greenplum-db/PivotalR-archive

Creating many factors with as.factor

ronert opened this issue · 2 comments

I am currently working on a model that contains many categorical features. To cast them as factors, I need to call pivotalr_df$factor_column <- as.factor(pivotalr_df$factor_column) on 90 columns. Usually one would for example loop over an array of factors using the df[, factor_column] subsetting mechanism. If I try to call pivotalr_df[, factor_column] <- as.factor(pivotalr_df[, factor_column]) I get the following error: Error in is(i, "db.Rquery") (from <text>#1) : argument "i" is missing.

Is it possible to add an convenience function to transform a vector of column names to factors?

Thanks and best

Bug fixed in master. Thank you for reporting this.

Maybe add a convenience function later.

Thanks for the quick bug fix!