read.table.url {base}R Documentation

Read Data and Code from a Web Server

Description

Extensions of read.table, scan, source and file.show to read text files on a remote HTTP (Web) server.

Usage

read.table.url(url, port = 80, check.MIME.type = TRUE, ...)
scan.url(url, port = 80, check.MIME.type = TRUE, ...)
source.url(url, port = 80, check.MIME.type = TRUE, ...)
copy.url(url, port = 80, error.is.fatal = TRUE, file = tempfile(),
         check.MIME.type = TRUE, drop.ctrl.z = TRUE)
url.show(url, port = 80, check.MIME.type = TRUE, file = tempfile(),
         delete.file = TRUE, ...)

Details

HTTP errors are handled correctly, but attempts to read non-text files are currently not (thus the check.MIME.type option).

Value

copy.url returns the name of a temporary file.

See Also

read.table, scan, source, make.socket, read.socket, file.show

Examples

read.table.url("http://lib.stat.cmu.edu/jcgs/tu",skip=4,header=T)
url.show("http://lib.stat.cmu.edu/datasets/csb/ch11b.txt")
beaver<-read.table.url("http://lib.stat.cmu.edu/datasets/csb/ch11b.dat",
  col.names=c("obsnum","day","time","temperature","activity"),row.names=1)
url.show("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt")
ozone<-read.table.url("http://lib.stat.cmu.edu/datasets/csb/ch3a.dat",
  col.names=c("date","day.cts","day.passive","night.cts","night.passive"),
  na.strings=".")


[Package Contents]