apply rxKmeans or other RevoScaleR on all dataframe columns RRS feed

  • Question

  • Hello,

    As I understand the ~. formula is not permitted in RevoScaleR so I am asking a logical question: how can I apply a rsKmeans or other function on all dataframe columns without explicitly writing each and every field ?!?

    Thank you !

    Friday, March 17, 2017 6:07 AM

All replies

  • myForm <- formula(paste0("~", paste(names(myDataSource), collapse = "+")))
    rxKmeans(myForm, myDataSource, numClusters = 3)
    Here myDataSource can be a data.frame or an R Server data source (e.g. RxXdfData, RxTextData, RxHiveData, etc).

    Tuesday, March 28, 2017 10:35 AM