mda.df2mat: Convert data frame to a matrix

View source: R/misc.R

mda.df2matR Documentation

Convert data frame to a matrix

Description

The function converts data frame to a numeric matrix.

Usage

mda.df2mat(x, full = FALSE)

Arguments

x

a data frame

full

logical, if TRUE number of dummy variables for a factor will be the same as number of levels, otherwise by one smaller

Details

If one or several columns of the data frame are factors they will be converted to a set of dummy variables. If any columns/rows were hidden in the data frame they will remain hidden in the matrix. If there are factors among the hidden columns, the corresponding dummy variables will be hidden as well.

All other attributes (names, axis names, etc.) will be inherited.

Value

a numeric matrix


mdatools documentation built on Sept. 11, 2024, 7:59 p.m.