load                  package:base                  R Documentation

Reload Saved Datasets

Description:

     Reload the datasets written to a file with the function 'save'.

Usage:

     load(file, envir = parent.frame())
     loadURL(url, envir = parent.frame(), quiet = TRUE, ...)

Arguments:

    file: a connection or a character string giving the name of the
          file to load.

   envir: the environment where the data should be loaded.

     url: a character string naming a URL.

quiet, ...: additional arguments to 'download.file'.

Details:

     'load' can load R objects saved in the current or any earlier
     format.  It can read a compressed file (see 'save') directly from
     a file or from a suitable connection.

     'loadURL' is a convenience wrapper which downloads a file, loads
     it and deletes the downloaded copy.

Value:

     A character vector of the names of objects created, invisibly.

See Also:

     'save', 'download.file'.

Examples:

     ## save all data
     save(list = ls(), file= "all.Rdata")

     ## restore the saved values to the current environment
     load("all.Rdata")

     ## restore the saved values to the user's workspace
     load("all.Rdata", .GlobalEnv)

     ## Not run: 
     ## This example may not still be available
     ## print the value to see what objects were created.
     print(loadURL("http://hesweb1.med.virginia.edu/biostat/s/data/sav/kprats.sav"))
     ## End(Not run)

