
i
i
“K23166” — 2015/1/28 — 9:35 — page 6 — #32
i
i
i
i
i
i
6 CHAPTER 1. DATA INPUT AND OUTPUT
or
library(RCurl)
myurl = getURL("https://example.com/file.txt")
ds = readLines(textConnection(myurl))
Note: The read.csv() function, like others that read files from outside R, can access data
from a URL. The readLines() function reads arbitrary text. To read https (Hypertext
Transfer Protocol Secure) URLs, the getURL() function from the RCurl package is needed,
in conjunction with the textConnection() function (see also url()). Access through
proxy servers as well as specification of username and passwords is provided by the func-
tion download.file(). The source DropboxData() ...