JSON: Google Map Distance Matrix Data in R “How to download JSON data into R?”
问题 I am trying to get the data from the Google Map API Distance Matrix to R. I am trying to get the JSON data into R. How to download JSON data into R, so I will be able parse later? require(rjson) url <- "https://maps.googleapis.com/maps/api/distancematrix/jsonunits=imperial&origins=19+East+34th+Street+NewYork+NY+10016&destinations=40.5177433,-74.2749576&mode=transit&language=fr-FR&key=API_KEY_HERE" raw.data <- readLines(url, warn = "F") rd <- fromJSON(raw.data) I am getting this error: Error