Description Usage Arguments Details Examples
dummy(dataframe,variable,drop=NULL)
1 |
dataframe |
name of the data frame |
variable |
either the name of the variable in inverted commas or column index |
abbrev |
logical whether the factor levels should be abbreviated too |
Will convert a variable with n levels to n dummy variables appended as columns to the data frame, each comprising 0s and 1s. The variable can be passed as either the name of the variable in inverted commas or the column number. The new variable names will be an abbreviated form of the original variable with an underscore and then the suffix of the original factor level (with the option to abbreviate). One of the levels may not be required in, say, a linear model since it will be represented by the intercept.
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.