Learn R Programming

RSurvey (version 0.5.0)

srvy.dat: Set or Query Data and Parameters

Description

A function used to set or query data and parameters.

Usage

srvy.dat(option, value, clearAll = FALSE)

Arguments

option
character; the parameter name, described in the Parameters section
value
a parameter value specified for option.
clearAll
logical; if TRUE all parameters are cleared from srvy.dat.

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.

Examples

Run this code
# To set a parameter
srvy.dat("test1", 3.14159265)
srvy.dat("test2", list(id = "PI", val = 3.14159265))
# To retrieve a parameter value
srvy.dat("test1")
srvy.dat("test2")
srvy.dat(c("test2", "id"))
srvy.dat(c("test2", "val"))
# To get all parameter values
d <- srvy.dat()
# To clear all parameters, use at your own risk
srvy.dat(clearAll = TRUE)

Run the code above in your browser using DataLab