Data Set Availability

DESCRIPTION:

Determine if a data set exists or list available data sets.

USAGE:

data(x, package=NULL, ...)

OPTIONAL ARGUMENTS:

x
an object name.
package
a character string or vector giving the package(s) to search for the data set. The default value is NULL meaning to look in all attached packages. In this version of data, the package argument is ignored if x is given.
...
arguments ignored in this version of the function. The R version of this function includes arguments that are not used in the S-PLUS version.

VALUE:

a character vector of the data sets specified, or a list of all data sets in a package if package is given but x is not specified. If x is specified, then the return value is invisible.

DETAILS:

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.

SEE ALSO:

, ,

EXAMPLES:

# Does the object CO2 exist?
data(CO2)

# List all data sets in the nlme (version 3) library
data(package="nlme3")