mi2-warsaw / FSelectorRcpp

Rcpp (free of Java/Weka) implementation of FSelector entropy-based feature selection algorithms with a sparse matrix support
http://mi2-warsaw.github.io/FSelectorRcpp/
35 stars 15 forks source link

Error when column names are not syntactically valid variable names #52

Closed khotilov closed 7 years ago

khotilov commented 7 years ago

E.g., this results in error:

> df <- data.frame(a=0:1, "b + c"=3:4, check.names=F)
> FSelectorRcpp::information_gain(a ~ ., df)
Error in `[.data.frame`(data, c(formula$x, formula$y)) : 
  undefined columns selected

The problem comes from attr(terms(a ~ ., data=df), "term.labels") returning such column names enclosed in ` `

MarcinKosinski commented 7 years ago

@zzawadz @krzyslom : O

MarcinKosinski commented 7 years ago

@khotilov I think the easiest way is not to use such fancy names : )