BASSLINE_convert | R Documentation |
BASSLINE's functions require a numeric matrix be provided. This function converts a dataframe of mixed variable types (numeric and factors) to a matrix. A factor with $m$ levels is converted to $m$ columns with binary values used to denote which level the observation belongs to.
BASSLINE_convert(df)
df |
A dataframe intended for conversion |
A numeric matrix suitable for BASSLINE functions
library(BASSLINE) Time <- c(5,15,15) Cens <- c(1,0,1) experiment <- as.factor(c("chem1", "chem2", "chem3")) age <- c(15,35,20) df <- data.frame(Time, Cens, experiment, age) converted <- BASSLINE_convert(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.