encodeSO {clamix} | R Documentation |
Function encodes numerical vector using given encoding. Encoding could be obtained by function makeEnc
.
encodeSO(x, encoding, codeNA)
x |
number |
encoding |
function name to produce the encoding. See result of |
codeNA |
code (or number) for |
Returns category into which the number x
is encoded.
Vladimir Batagelj
makeEnc
set.seed(42) testset <- runif(100) makeEnc(testset,"Rand",10,file="temp.R") # make "encRand" encoding source("temp.R") unlink("temp.R") # tidy up testcat <- sapply(testset,function(x) encodeSO(x,encRand,NA)) tabulate(testcat)