data <-rjson:: fromJSON (file='CA_category_id.json')
category_id <- list()
d <-rjson:: fromJSON(file='CA_category_id.json')
for (category in d$items) {
category_id[[category$id]] <- category$snippet$title
}
vedio5$category <- category_id[vedio5$category_id]
vedio5$category <- category_id[vedio5$category_id]
for (category in vedio5) {
vedio5$category <- category_id[vedio5$category_id]
}
I can not understand this code knowing that : Each of the JSON file contains id ranging from 1 to 44 (both inclusive). And with each id is given its category and other information related to title, kind etc. required is: use any one of the JSON files to map category to category id in our data frame.
how to map category to category id in our data frame?