0

I have problem with converting data type from character to factor. I have tried the following code:

#data$xx=as.factor(data$xx), 
#as.character(as.factor(xx)),
#data[sapply(data, is.character)] <- lapply(data[sapply(data, is.character)], as.factor)
#library(dplyr)- data <- data %>% mutate_if(is.character,as.factor)

But, when I check with #is.factor(xx) or use independent_test in "coin" package it said = false and error not support "character" What should I do? Or I have done something wrong?

Paul R
  • 208,748
  • 37
  • 389
  • 560
Wantidah
  • 21
  • 2
  • 1
    You did all these transformations? What are you really trying to do. It's easier to help if you provide a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data and the desired output data. – MrFlick Feb 15 '17 at 17:10
  • `data$xx` ≠ `xx`. Is this your problem? – Konrad Rudolph Feb 15 '17 at 17:15

0 Answers0