0

I have this list

my_list   list [3]                                       list length of 3

[[1]]     list [38 x 23] (S3: tbl_df, tbl, data.frame)   A tibble with 38 rows and 23 columns
[[2]]     list [38 x 23] (S3: tbl_df, tbl, data.frame)   A tibble with 38 rows and 23 columns
[[3]]     list [38 x 23] (S3: tbl_df, tbl, data.frame)   A tibble with 38 rows and 23 columns

I am trying to get a data frame (or a tibble) with 23 columns and 114 rows.

I have tried these codes

my_list %>% map(~ .,rbind.data.frame)
my_list %>% map(rbind.data.frame)
my_list %>% map(~ .,rbind.data.frame)
my_list %>% map(as.data.frame)

It works good only in console, but if I want to get the data frame to environment e.g.

my_list %>% map(~ .,rbind.data.frame) –> my_data_frame

I get a list again. What should I fix?

onhalu
  • 735
  • 1
  • 5
  • 17
  • 1
    You mistake how `map()` works...! `rbind.data.frame` make no sense in your codes. Please read the document of `map()`. – Darren Tsai Jul 30 '20 at 10:41

1 Answers1

0

Check out bind_rows

bind_rows(my_list)

will bind the three tibbles in the list together based on column names.

4126cfbe1fd5
  • 126
  • 5