Learn R Programming

RSurvey (version 0.9.3)

Data: Set or Query Data and Parameters

Description

This function is used 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. Parameter name, see ‘Parameters’ section.

value

Parameter value specified for option (optional)

which.attr

character. A non-empty character string specifying which attribute is to be accessed.

clear.proj

logical. If true, basic graphical user interface (GUI) preferences will be saved and all other data removed.

clear.data

logical. If true, only datasets will be removed.

replace.all

list. A replacement list of parameter values.

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 unprocessed data is saved to the data frame data.raw, see ImportText. Processed point data is saved to the data frame data.pts, and interpolated surface data is saved to the list data.grd.

Parameters

Parameters undefined elsewhere in the help documentation include:

ver

package version number

win.loc

default horizontal and vertical location for GUI placement in pixels.

Examples

Run this code
# NOT RUN {
# set a parameter
Data("test1", 3.14159265)
Data("test2", list(id = "PI", val = 3.14159265))

# retrieve a parameter value
Data("test1")
Data("test2")
Data(c("test2", "id"))
Data(c("test2", "val"))

# get all parameter values
d <- Data()

# remove all saved parameter values
Data(replace.all = list())

# recover saved parameter values
Data(replace.all = d)

# }

Run the code above in your browser using DataLab