I’m parsing some JSON data in R and got this structure:
entry <- list("Ontario"="ON", "ON"="13.6")
When I try:
j <- entry["Ontario"]
population <- as.numeric(entry[j])
I get an error:
Error in if (population > 0) { : argument is of length zero
I think I’m not accessing the element correctly. What is the right way to get "13.6" as a number?
[with[[: stackoverflow.com/q/1169456/3358272, stackoverflow.com/q/45918827/3358272; stackoverflow.com/q/18222286/3358272