Is there a simple way to do this in R:
plot(var1,var2, for all observations in the data frame where var3 < 155)
It is possible by creating a new data newdata <- data[which( data$var3 < 155),]
but then I have to redefine all the variables newvar1 <- newdata$var1
etc.
Most straightforward option:
It does not look good because of code redundancy, but is ok for fast
n
dirty hacking.with(dfr[dfr$var3 < 155,], plot(var1, var2))
should do the trick.Edit regarding multiple conditions:
This chunk should do the work:
My best regards.
How this works:
This is how I would do it, in order to get in the var4 restriction:
Rgds, Rainer