data(x, package=NULL, ...)
NULL
meaning to look in
all attached packages. In this version of
data
,
the
package
argument is ignored if
x
is given.
package
is given but
x
is not specified. If
x
is specified, then the return value is invisible.
If the argument
x
is given then the function
tests to see if the object exists and gives a warning if it does not exist.
In this version of
data
, the
package
argument is ignored if
x
is given.
So in order to get an object from a specific package, instead of the first one
found in the search list, use the
get
function.
If
x
is not specified,
data
lists all available data sets in the specified package(s).
If
data
is called with no arguments then a list
of data sets in all attached packages is returned.
This function was added for compatibility with R, but is limited
in functionality. The R version will load in data sets from files using
functions such as
source
and
read.table
according to the ending of the file name.
Also, the argument list of the S-PLUS version of
data
differs from that of the R version.
This function does not load data sets from files as the R version of this function does. In S-PLUS, a package's data sets are always available so it is not necessary to load a data set before using it.
# Does the object CO2 exist? data(CO2) # List all data sets in the nlme (version 3) library data(package="nlme3")