lundi 5 octobre 2015

convert values below a threshold into 1

Let's say if I have the following data

x <- rnorm(100)

I want to create another column where where if x is equal to or greater than 0.2, give it a value of 1 or else 0.

Aucun commentaire:

Enregistrer un commentaire