names0(9, "a")
names0(10, "a")
example <- data.frame(
x = ordered(letters[1:5]),
y = factor(LETTERS[1:5]),
z = factor(paste(LETTERS[1:5], 1:5))
)
dummy_names("y", levels(example$y)[-1])
dummy_names("z", levels(example$z)[-1])
after_mm <- colnames(model.matrix(~x, data = example))[-1]
after_mm
levels(example$x)
dummy_names("x", substring(after_mm, 2), ordinal = TRUE)
Run the code above in your browser using DataLab