Using mtcars as an example for subset by position
mtcars[1:3,4:5]
#> hp drat
#> Mazda RX4 110 3.90
#> Mazda RX4 Wag 110 3.90
#> Datsun 710 93 3.85
Created on 2020-09-10 by the reprex package (v0.3.0)
Columns can also be selected by name, using the dplyr package
mtcars %>% select(hp,drat) -> result
That result can be subset by row position with
result[1:3,]