From JSON to R
In the simplest setting, fromJSON() can convert character strings that represent JSON data into a nicely structured R list. Give it a try!
To ćwiczenie jest częścią kursu
Intermediate Importing Data in R
Instrukcje do ćwiczenia
- Load the
jsonlitepackage. It's already installed on DataCamp's servers. wine_jsonrepresents a JSON. UsefromJSON()to convert it to a list, namedwine.- Display the structure of
wine
Interaktywne ćwiczenie praktyczne
Spróbuj tego ćwiczenia, uzupełniając ten przykładowy kod.
# Load the jsonlite package
# wine_json is a JSON
wine_json <- '{"name":"Chateau Migraine", "year":1997, "alcohol_pct":12.4, "color":"red", "awarded":false}'
# Convert wine_json into a list: wine
# Print structure of wine