I\'m trying to figure out a simple way to do something like this with dplyr (data set = dat, variable = x):
day$x[dat$x<0]=NA
Should be
Using replace directly on the x column and not using mutate also works.
replace
x
mutate
dat$x <- replace(dat$x, dat$x<0, NA)