You need to connect your different criteria using the various logical operators:
subset(Boston, chas > 0 & age > 50.0)
Read ?Logic
to learn more.
The documentation for subset
specifies that the second argument, subset
, must be a single logical expression. When you separate them with commas, R interprets them as entirely different arguments, not as a single expression.
Your attempt is equivalent to:
subset(Boston, subset = chas > 0, select = age > 50.0)
so you get "all rows but no columns".