fre2dat {confreq}R Documentation

pattern frequency to dataset conversion

Description

Given a (response) pattern frequencies table this function returns a dataset representation of it.

Usage

fre2dat(x, fact = FALSE, ...)

Arguments

x

an object of class "matrix" which is a (response) pattern frequencies table. It is assumed, that the last column of the object x represents the frequencies of the (respose) patern represented by the other columns in x.

fact

logical, default is (fact=FALSE). If this argument is set to (fact=TRUE) the result is coerced to a data.frame with factor variables.

...

additional parameters passed trough. This is an option to assign factor labels to the resulting data.frame (when setting argument fact=TRUE) –> see factor in the base package and examples.

WARNING using this option will only work correct when all 'pattern' columns (variables) in the frequencies table share the same number of categories

Details

No details

Value

An object of class "matrix" or "data.frame" (depending on the argument fact) containing the dataset representation of the (response) pattern frequencies table give in the argument x.

References

No references in the moment

Examples

#######################################
data(LienertLSD)# loading example pattern frequencies table
fre2dat(LienertLSD)# coverting it into a (data) matrix
# for a matrix without colnames
colnames(LienertLSD)<-NULL # first removing the colnames
fre2dat(LienertLSD) # conversion with automatic new colnames
# requesting a data.frame using factor levels 
fre2dat(LienertLSD,fact=TRUE,labels=c("yes","no"))

[Package confreq version 1.6.1-1 Index]