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
Hi, first of all - thank you for the amazing package, it made my life so much simpler! I ended stuck with one simple use-case though - is there a way to convert DataFrame with JSON object to a simple DataFrame, so that Tidyr package is fully compatible? I couldn't use spread() function in one of my solutions, and ended up unlisting the DataFrame with:
Hello! I recommend looking at the more up-to-date repo here. There are some helpful additional tools that have not yet made it to CRAN, if you are willing to install the dev version with devtools::install_github('jeremystan/tidyjson)`.
In any case, the simplest solution I have seen to your problem (that should work in the CRAN version of tidyjson too, I believe) is:
library(dplyr)
library(tidyjson)
## tbl_df at present drops the tbl_json components of the object
## so you are ready for working within tidyr
final-data <- myjson %>% as.tbl_json %>% tbl_df
Hi, first of all - thank you for the amazing package, it made my life so much simpler! I ended stuck with one simple use-case though - is there a way to convert DataFrame with JSON object to a simple DataFrame, so that Tidyr package is fully compatible? I couldn't use spread() function in one of my solutions, and ended up unlisting the DataFrame with:
final-data <- data.frame(lapply(data.frame(t(lapply(df_json,
[))), unlist))
Any tips / suggestions? Could I wrap tidyr verbs just as dplyr can be applied?
The text was updated successfully, but these errors were encountered: