library(jsonlite)
test <-as.dataframe(fromJSON('http://api.worldbank.org/v2/countries/all/indicators/SH.STA.ACSN?format=json')[2])
names(test)
However, it looks like there are more columns, such as the "country" column actually has "country.value" and "country.id" columns. This is annoying because "country.value" does not seem to exist, thus the following code returns errors saying this column is not in the data frame test. I only want to keep country.value. How can I resolve this? Does it have anything to do with how JSON returns data in R?
test$country.value