[R] Restructuring Star Wars data from rwars package
Matt Van Scoyoc
scoyoc at gmail.com
Fri Aug 4 05:57:10 CEST 2017
I'm having trouble restructuring data from the rwars package into a
dataframe. Can someone help me?
Here's what I have...
library("rwars")
library("tidyverse")
# These data are json, so they load into R as a list
people <- get_all_people(parse_result = T)
people <- get_all_people(getElement(people, "next"), parse_result = T)
# Look at Anakin Skywalker's data
people$results[[1]]
people$results[[1]][1] # print his name
# To use them in R, I need to restructure them to a dataframe like they are
in dplyr
data("starwars")
glimpse(starwars)
Thanks for the help.
Cheers,
MVS
=====
Matthew Van Scoyoc
=====
Think SNOW!
[[alternative HTML version deleted]]
More information about the R-help
mailing list