# NOT RUN {
# Create an example data frame:
df <- data.frame(
animal = c("dog", "goldfish", "bird", "dog", "goldfish"),
numLegs = c(4, 0, 2, 4, 0),
lifeSpan = c(10, 10, 5, 10, 10))
# Create dummy coded variables for the variables "animal" and "numLegs":
df_dummy <- dummyCode(df, vars = c("animal", "numLegs"))
df_dummy
# }
Run the code above in your browser using DataLab