recodeValuesDS2 {dsBase}R Documentation

recodeValuesDS2 an assign function called by ds.recodeValues

Description

Second serverside function called by ds.recodeValues to convert specified values of elements in a vector into a matched set of alternative specified values.

Usage

recodeValuesDS2(var.name.text = NULL, values2replace.text = NULL,
  new.values.text = NULL, numeric.output.format.possible,
  force.output.format = "no", v2r.numeric = NULL)

Arguments

var.name.text

a character string providing the name for the vector representing the variable to be recoded. <var.name.text> argument generated and passed directly to recodeValuesDS2 by ds.recodeValues

values2replace.text

a character string specifying the values in the vector specified by the argument <var.name.text> that are to be replaced by new values as specified in the new.values.vector. The <values2replace.text> argument is generated and passed directly to recodeValuesDS2 by ds.recodeValues. In effect, the <values2replace.vector> argument of the ds.recodeValues function is converted to a character string format that is acceptable to the DataSHIELD parser in Opal and so can be accepted by recodeValuesDS2

new.values.text

a character string specifying the new values to which the specified values in the vector <var.name> are to be converted. The <new.values.text> argument is generated and passed directly to recodeValuesDS2 by ds.recodeValues. In effect, the <new.values.vector> argument of the ds.recodeValues function is converted to a character string format that is acceptable to the DataSHIELD parser in Opal and so can be used in the call to recodeValuesDS2

numeric.output.format.possible

logical, if TRUE the nature of <var.name>, <values2replace.vector> and <new.values.vector> are such that it is in principle possible for the output to be fully numeric. This argument is generated and passed directly to recodeValuesDS2 by ds.recodeValues - its value determines how recodeValuesDS2 handles situations where a numeric output may be desirable.

force.output.format

character string. This argument is generated and passed directly to recodeValuesDS2 by ds.recodeValues. For details see the equivalent parameter in the help header for ds.recodeValues

v2r.numeric

logical. This argument is generated and passed directly to recodeValuesDS2 by ds.recodeValues. If TRUE it informs recodeValuesDS2 that the nature of <var.name>, <values2replace.vector>, <new.values.vector> and <force.output.format> are such that recodeValuesDS2 should convert the recoded (output) vector to numeric. If false, recodeValuesDS2 should write out the recoded (output) vector as character.

Details

For all details see the help header for ds.recodeValues

Value

the object specified by the <newobj> argument (or default name '<var.name>_recoded') initially specified in calling ds.recodeValues. The output object (the required recoded variable called <newobj> is written to the serverside. In addition, two validity messages are returned via ds.recodeValues indicating whether <newobj> has been created in each data source and if so whether it is in a valid form. If its form is not valid in at least one study - e.g. because a disclosure trap was tripped and creation of the full output object was blocked - recodeValuesDS2 (via ds.recodeValues()) also returns any studysideMessages that can explain the error in creating the full output object. As well as appearing on the screen at run time,if you wish to see the relevant studysideMessages at a later date you can use the ds.message function. If you type ds.message("newobj") it will print out the relevant studysideMessage from any datasource in which there was an error in creating <newobj> and a studysideMessage was saved. If there was no error and <newobj> was created without problems no studysideMessage will have been saved and ds.message("newobj") will return the message: "ALL OK: there are no studysideMessage(s) on this datasource".

Author(s)

DataSHIELD Development Team


[Package dsBase version 5.0.0 ]