Learn R Programming

MLDS (version 0.1-8)

as.mlds.df: Coerces a data.frame to mlds.df

Description

Coerce a data frame from an MLDS experiment to an object of class mlds.df by adding column names and attributes so that it will be properly treated by methods related to the MLDS functions.

Usage

as.mlds.df(d, ...)

## S3 method for class 'default': as.mlds.df(d, ...)

## S3 method for class 'data.frame': as.mlds.df(d, st, ...)

df2mlds.df(d, st)

Arguments

d
a 5 column data frame from an MLDS experiment, with one column of responses followed by four indicating the indices of the stimuli from each trial or a data frame of > 5 columns with the response in the first column and the covariates (signed indicator va
st
numeric indicating the stimulus levels from the MLDS experiment
...
additional arguments passed to the methods

Value

  • data.frame of class mlds.df with stimulus and invord attributes, unless the input is in signed indicator form. See details.

Details

This function coerces a data frome from an MLDS experiment to an object of class mlds.df but inheriting from class data.frame. It changes the column names to resp and S1, S2, S3, S4 and adds two attributes: stimulus, a vector of scale values used in plotting the estimated scale and invord, a logical vector indicating the order of the presentation of pairs (were the larger scale values on the bottom or not) which is used with the SwapOrder function. Note that when the argument is in signed indicator form, just a data frame is returned with no special mlds attributes.

See Also

mlds