How to replace outliers with NA having a particular range of values in R?
问题 I have climate data and I'm trying to replace outliers with NA . I'm not using boxplot(x)$out is because I have a range of values to be considered to compute the outlier. temp_range <- c(-15, 45) wind_range <- c(0, 15) humidity_range <- c(0, 100) My dataframe looks like this df with outliers (I highlighted values that should be replaced with NA according to ranges.) So temp1 and temp2 outliers must be replaced to NA according to temp_range , wind 's outliers should be replaced to NA according