For a vector, definitely yes. From the documentation for the subset:
For ordinary vectors, the result is simply x[subset & !is.na(subset)] .
For data frames, the same will be displayed as true, since a subset simply applies to each row effectively as a vector. For example, the following will always return only records from column b d , the corresponding value of a greater than 5. There is no row reordering.
d <- data.frame(a=1:10, b=20:29) subset(d, a>5, b)
source share