covar_from_df: Numeric matrix from data frame

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Transform a data frame to a numeric matrix by one-hot encoding factors. The last factor value is always omitted to prevent having a singular matrix when adding a column of 1s (intercept) in models.

Usage

1

Arguments

df

A data frame.

Value

A numeric matrix.

Examples

1
2
mat <- covar_from_df(iris)
head(mat)

bigstatsr documentation built on April 5, 2021, 5:08 p.m.