names2factorize: Liet ke cac bien can factor hoa

Description Usage Arguments Author(s) Examples

View source: R/names2factorize.R

Description

Ham so de liet ke nhung bien chuoi can phai factorize

Usage

1
names2factorize(data = data1, factorize = F)

Arguments

data
factorize

Author(s)

Do Van Dung

Examples

 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)
  }

gvdovandzung/thongke documentation built on May 23, 2020, 12:35 a.m.