Learn R Programming

RSurvey (version 0.7-4)

Data: Set or Query Data and Parameters

Description

A function to set or query parameters and their attributes.

Usage

Data(option, value, which.attr = NULL, clear.proj = FALSE, clear.data = FALSE,
     replace.all = NULL)

Arguments

option
character; the parameter name, see Parameters.
value
a parameter value specified for option (optional).
which.attr
character, a non-empty character string specifying which attribute is to be accessed (optional).
clear.proj
logical; if TRUE basic GUI preferences will be saved and all other data removed; its default is FALSE.
clear.data
logical; if TRUE only data sets will be removed, its default is FALSE.
replace.all
list; a replacement list of parameter values (optional).

Value

  • If value is given the object specified by option is returned. A NULL value is returned for objects not yet assigned a value and where no default value is available. Default values are specified internally within this function.

Data

Imported raw data is saved to the data frame data.raw, see ReadData. Processed point data is saved to the data frame data.pts and interpolated surface data is saved to the list data.grd, see ProcessData.

Examples

Run this code
# To set a parameter
Data("test1", 3.14159265)
Data("test2", list(id = "PI", val = 3.14159265))
# To retrieve a parameter value
Data("test1")
Data("test2")
Data(c("test2", "id"))
Data(c("test2", "val"))
# To get all parameter values
d <- Data()
# To remove all saved parameter values
Data(replace.all = list())
# To recover saved parameter values
Data(replace.all = d)

Run the code above in your browser using DataLab