Loading CSV from URL and getting error "non-numeric argument to binary operator"

Using RStudio Cloud on mac.

Testing url to make sure it exists then trying to get the CSV at that location and getting error "non-numeric argument to binary operator"

''' R

covidexists = url.exists("web address as shown below") ### Rstudio community will only allow me to include 2 URLs in a topic

covid19 <- read.csv(text - getURL("https://data.humdata.org/hxlproxy/api/data-preview.csv?url=https%3A%2F%2Fraw.githubusercontent.com%2FCSSEGISandData%2FCOVID-19%2Fmaster%2Fcsse_covid_19_data%2Fcsse_covid_19_time_series%2Ftime_series_covid19_confirmed_global.csv&filename=time_series_covid19_confirmed_global.csv"))

View(covid19)
'''

CloudApp

I don't understand what are you trying to do with this part but you could simply do this instead

covid19 <- read.csv("https://data.humdata.org/hxlproxy/api/data-preview.csv?url=https%3A%2F%2Fraw.githubusercontent.com%2FCSSEGISandData%2FCOVID-19%2Fmaster%2Fcsse_covid_19_data%2Fcsse_covid_19_time_series%2Ftime_series_covid19_confirmed_global.csv&filename=time_series_covid19_confirmed_global.csv")
1 Like

Thank you that solved the issue!

I dont know where I picked up that code but found that some where else as this is the first time I have pulled a source directly from a URL

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.