Skip to content
Prev 179187 / 398502 Next

Need to clean a table, and compute mean and SD

Thom_249 wrote:
Hi,

If you are dealing with a data frame, you can simply use the index 
function like this,

my.data.frame[my.data.frame>2000] = NA

This way, all values in your data.frame that are greater than 2000 will 
be transformed into NAs. However, this kind of substitution wouldn't be 
recommended if your goal is to fit a regression model to the data. 
Missing data can sometimes be informative, hence the importance to be 
careful when doing such substitutions.