mc <- colorDF(mtcars)
col_type(mc, "gear") <- "factor"
col_type(mc, "gear")
col_type(mc) <- list(gear="factor", cyl="integer")
## Note: the *class* of the columns did not change!
## Chaning column type merely changes the way it is displayed
class(mc[["gear"]])
## Hide some columns
col_type(mc, c("disp", "hp")) <- "hidden"
## Create a new type and style
col_type(mc, "carb") <- "carbstyle"
df_style(mc)$type.styles$carbstyle <- list(fg="red", decoration="bold")
Run the code above in your browser using DataLab