Description Usage Arguments Details Value Examples
fetchData
provides a means for students and others to
locate and load data sets and R commands provided by instructors.
Data can be pre-loaded for off-line sessions, can be positioned
on identified web sites, or loaded from packages.
fetchData
also will load local files using a complete path name (relative
to the current working directory) or, if no name is given, via a dialog box.
1 2 |
name |
a character string naming a data set.
This will often end in |
show.path |
If |
add.to.path |
Name of a web directory (ending in |
drop.from.path |
Name of a web directory to be deleted from the path. |
cache |
If |
verbose |
a logical indicating whether additional status messages (e.g., indicating where the dataset was located) should be printed. |
There are two major purposes for this function. One is to provide a
consistent interface to reading data: a file name is given and a data frame is
returned, which can be assigned to an object as the user desires. This
differs from the behavior of data
, which doesn't return a value but
instead creates an object without explicit assignment.
The other purpose is to allow instructors or other group leaders to post data and R code on web sites that can be searched as naturally as if the data were on the users' own machines. For instance, an instructor might want to post a new data set just before class, enabling her students to access it in class.
To support this, fetchData
allows new web sites to be added to the
web search path. Typically, the command to add a site would be in a script
file that is provided to the student that could be run automatically at start
up or source
d over the web. That is, an instructor might create a
script file stored on a website and, using a web page, provide students with
the text of the command to source
it.
Currently, https addresses are changed to http
a data frame.
1 2 3 4 5 6 | ## Not run: dome <- fetchData("Dome.csv")
## Not run: carbon <- fetchData("CO2")
## Not run: fetchData(show=TRUE)
## Not run: fetchData(add.to.path="http://www.macalester.edu/~kaplan/ISM/datasets/")
## Not run: fetchData(drop.from.path="http://www.macalester.edu/~kaplan/ISM/datasets/")
## Not run: dome <- fetchData("Dome.csv", cache=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.