New to Rstudio in general so some of my concepts are not clear. Trying to view data from OpenWeatherMap, on JSON files. They look something like this (shortened the data to view here).
[{"city_name":"X-Land"
"lon": -10.10,
"lat": 10.10
,"main":{
"temp":19,
"temp_min":18,
"temp_max":20 }
"weather": [{
"id": 800,
"main": "Clear",
"description": "clear sky",
"icon": "01d"
}],
"base": "stations", }]
Using jsonlite almost all the information display correctly
library(jsonlite)
jsonData = fromJSON ("weatherfile.json")
The problem is the weather, it's an array of objects? and when converted it all remain together in a list / object??.
I tried to use jsonlite flatten and pretty and either I didn't do it right or it didn't work for this case.
The question is, how do I separate weather into different columns (working with +15000 obs).
EDIT:
Adding to it, tried tidyr, unnest and separate. Extra info. This is what one of the rows looks like.
list(id = 800. main = "Clear". description = "sky is clear". icon = "01n")
Was trying to use separate to get the number and strings between "" into columns.
Thank you.