You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A shortcut for turning named vectors into data.frame/tibble would be great:
For me a common task is to turn named vectors into data.frames. bind_rows and map_df do not handle this nicely. So you can do one of the following workarounds:
require(tidyverse)
vec <- c("a" = 1, "b" = 2)
# Version one
vec %>% enframe %>% spread(name, value)
# Version two
vec %>% t %>% as_tibble
A usecase in a purrr setting: (this is why i put the feature-request as a purrr issue)
FEATURE REQUEST (hope that purrr is the right place for this)
Following up on this SO question:
A shortcut for turning named vectors into data.frame/tibble would be great:
For me a common task is to turn named vectors into data.frames.
bind_rows
andmap_df
do not handle this nicely. So you can do one of the following workarounds:A usecase in a
purrr
setting: (this is why i put the feature-request as a purrr issue)Which gives you:
The text was updated successfully, but these errors were encountered: