You do not read enough error messages. Here, our error message tells you that you have not selected any columns. You specified a condition for the strings, though ....
> data[which(x>=2)]
Error in `[.data.frame`(data, which(x >= 2)) : undefined columns selected
, (, ), .
> data[which(x>=2), ]
x y
1 5 1
3 3 3
4 2 4
5 4 2
>
: data.frame :
data <- data.frame(x = c(5,1,3,2,4), y = c(1,5,3,4,2))
. -, . -, , , - , . : " , x- addresses <- which(x>=2)". , , , , ( ), , "x" data.frame, "x" .