Description Usage Arguments Author(s) Examples
View source: R/names2factorize.R
Ham so de liet ke nhung bien chuoi can phai factorize
1 | names2factorize(data = data1, factorize = F)
|
data |
|
factorize |
Do Van Dung
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function(data=data1,factorize=F){
namesdata<-names(data)
str1<-NULL
for (i in 1:ncol(data1)) {
if (!(is.factor(data1[,i])) & !(is.numeric(data1[,i]))) {
str1<-c(str1,namesdata[i])
if (factorize) data[,i]<-factor(data[,i])
}
}
return(str1)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.