Quickly remove zero variance variables from a data.frame

后端 未结 8 760
独厮守ぢ
独厮守ぢ 2020-12-13 01:07

I have a large data.frame that was generated by a process outside my control, which may or may not contain variables with zero variance (i.e. all the observations are the sa

8条回答
  •  遥遥无期
    2020-12-13 01:33

    You may also want to look into the nearZeroVar() function in the caret package.

    If you have one event out of 1000, it might be a good idea to discard these data (but this depends on the model). nearZeroVar() can do that.

提交回复
热议问题