Description Usage Arguments Value Examples
View source: R/class_df_from_term.R
Looks up and returns the class of the data.frame column(s) associated with a model's term.
1 | class_df_from_term(model, class_post_formula = FALSE)
|
model |
an 'lm' object |
class_post_formula |
if FALSE (default), returns class of df col BEFORE any in-formula transformations applied to terms if TRUE, returns class of df col AFTER any in-formula transformations applied to terms |
a named list containing named character vectors. The list names are model terms. The vector names are data frame column names. The vector values are characters for the data frame column's class. NOTE: If any in-formula transformations were applied, the data.frame referenced would represent an 'intermediate' one that is not exactly the originating data.frame passed to the 'data' arg of lm(data=.).
1 2 3 4 5 6 7 8 | model = lm(data = iris,Sepal.Length ~ Species + as.numeric(Species) +
Species:Sepal.Width + as.factor(Sepal.Width)+
as.factor(Sepal.Width)*as.factor(Petal.Length)+
as.numeric(Species)*as.factor(Petal.Length))
class_df_from_term(model,class_post_formula = TRUE)
class_df_from_term(model,class_post_formula = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.