# NOT RUN {
data("rl_reg1")
## random prototyping
rep_dat_random <- represent(rl_reg1, identity.rl_reg1, "proto_random", id = FALSE, parallel = FALSE)
head(rep_dat_random)
## minimax prototyping
col_type <- c("string", "string", "numeric", "numeric", "numeric", "categorical", "ordinal",
"numeric", "numeric")
orders <- list(education = c("Less than a high school diploma", "High school graduates, no college",
"Some college or associate degree", "Bachelor's degree only", "Advanced degree"))
weights <- c(.25, .25, .05, .05, .1, .15, .05, .05, .05)
rep_dat_minimax <- represent(rl_reg1, identity.rl_reg1, "proto_minimax", id = FALSE,
distance = dist_col_type, col_type = col_type, weights = weights, orders = orders,
scale = TRUE, parallel = FALSE)
head(rep_dat_minimax)
## composite prototyping
rep_dat_composite <- represent(rl_reg1, identity.rl_reg1, "composite",
col_type = col_type, parallel = FALSE)
head(rep_dat_composite)
# }
Run the code above in your browser using DataLab