powered by
hashFactor(x = character(), levels, codes)
fac <- hashFactor(sample(LETTERS[1:5], 10, replace=TRUE), levels=LETTERS[1:5], codes=c(1,5,8,2,6)) d <- data.frame(i=11:20, f=fac)
Run the code above in your browser using DataLab