Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

read data from internet

Tags:

r

I have a remote folder on a webserver containing data. I access the data using:

myData <-read.table("http://.../myData.csv", sep=',', header=T)

Is there a way to password protect the remote folder and enter the authorisation in the above command?

Thx.

like image 812
John Avatar asked Dec 03 '22 05:12

John


1 Answers

You could use the RCurl package:

require("RCurl")
read.table(textConnection(getURL("http://.../data.csv",
                                 userpwd = "user:pass")),
           sep=",", header=TRUE)
like image 134
rcs Avatar answered Jan 10 '23 10:01

rcs