Learn R Programming

MLDS (version 0.1-5)

df2mlds.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

df2mlds.df(d, st)

Arguments

d
a 5 column data frame from an MLDS experiment, with one column of responses followed by four indicated the indices of the stimuli from each trial
st
numeric indicating the stimulus levels from the MLDS experiment

Value

  • data.frame of class mlds.df with stimulus and invord attributes.

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.

See Also

mlds