set.seed(391)
a <- sample(c("net gain", "little effect", "modest loss", "major loss"),
20, replace=TRUE)
dta <- as.data.frame( list(ncost=a) , stringsAsFactors = FALSE)
print(dta)
newdat <- convert("ncost", data = dta,
order = c("net gain", "little effect", "modest loss", "major loss"))
print(newdat)
Run the code above in your browser using DataLab