Will.S89
Will.S89

Reputation: 327

Access a csv file from a website and read into r shiny app

I would like to read a CSV file from a website into my R Shiny app.

This CSV file contains data that will regularly be updated on the website and so downloading the file once and accessing it on my local computer will not suffice.

Is a a way to automatically download and read the CSV file into the app every time is it launched?

Upvotes: 2

Views: 1425

Answers (1)

Jason Jisu Park
Jason Jisu Park

Reputation: 411

If the website links and updates a csv file with a same filename, try this:

importedData <- read.csv(url("http://mywebsite.com/dataName.csv"))

Whenever you execute the above code, it will newly download the updated csv file and save it within the importData variable.

Refer to this link for more details. https://stackoverflow.com/a/6299291/5365437

Hope this helps.

Upvotes: 1

Related Questions