read.table.url {base} | R Documentation |
Read data and code from web server
Description
Extensions of read.table, scan, source
and file.show to read text files on a remote HTTP (Web) server.
HTTP errors are handled correctly, but attempts to read non-text files
are currently not (thus the check.MIME.type
option).
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,...)
Arguments
url |
URL beginning with |
port |
Port number for the HTTP server (usually 80) |
check.MIME.type |
Check that the document is of a type known to be plain ASCII? |
... |
Arguments to pass to read.table,scan, source or file.show |
error.is.fatal |
An HTTP error causes an error instead of a warning? |
file |
File to copy to |
delete.file |
Delete the file? |
drop.ctrl.z |
Filter out the |
Value
copy.url
returns the name of a temporary file.
See Also
read.table
, scan
, source
,
make.socket
, read.socket
,
file.show
Examples
## Not run: read.table.url("http://lib.stat.cmu.edu/jcgs/tu",skip=4,header=T)
## Not run: url.show("http://lib.stat.cmu.edu/datasets/csb/ch11b.txt")
## Not run: beaver<-read.table.url("http://lib.stat.cmu.edu/datasets/csb/ch11b.dat",
col.names=c("obsnum","day","time","temperature","activity"),row.names=1)
## End(Not run)
## Not run: url.show("http://lib.stat.cmu.edu/datasets/csb/ch3a.txt")
## Not run: 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=".")
## End(Not run)