make_Dummy | R Documentation |
This function creates dummy variables for specified features in a dataset.
make_Dummy(Data = dat, features = c("sex", "cause_burn"), reff = "first")
Data |
A data frame containing the data. |
features |
A character vector of feature names for which dummy variables are to be created. |
reff |
A character string indicating the reference level. It can be either "first" or "last". |
A list containing two elements:
New_Data |
A data frame with the original data and the newly created dummy variables. |
Original_Data |
The original data frame. |
dat <- data.frame(sex = c('M', 'F', 'M'), cause_burn = c('A', 'B', 'A'))
result <- make_Dummy(Data = dat, features = c('sex', 'cause_burn'), reff = "first")
print(result$New_Data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.