I want to delete datapoints if their value are above a certain value but below another, but I simply cannot figure out how to do it in R.
I want to remove data points if x<0.5 and y>2, but both criteria needs to be met.
Thanks in advance!
dat <- data.frame(x=runif(100,0,2), y=runif(100,1,4))
todrop <- which(dat$x <0.5 & dat$y>2)
dat <- dat[-todrop,]