Поскольку данных нет, вот один подход с пакетом dplyr для выбора диапазона строк на основе значений определенного столбца:
sampleData <- data.frame(int = seq(1, 16, by=2),#sequence of numbers from 1 to 16 increment by 2.
LETTER = LETTERS[1:8],#the 8 upper-case letters of the english alphabet.
month = month.abb[1:8], #the three-letter abbreviations for the first 8 English months
Sample = sample(10:20, 8, replace = TRUE),#8 random numbers with replacement from 10 to 20.
letter = letters[19:26],#the last 8 lower-case letters of the english alphabet.
randomNum = rnorm(8)#
); sampleData;
#> int LETTER month Sample letter randomNum
#> 1 1 A Jan 16 s 0.1254669
#> 2 3 B Feb 11 t -0.2154908
#> 3 5 C Mar 11 u -0.3709340
#> 4 7 D Apr 19 v -0.5496505
#> 5 9 E May 11 w 0.2783666
#> 6 11 F Jun 14 x -0.4791717
#> 7 13 G Jul 12 y 1.5229436
#> 8 15 H Aug 10 z 0.2406836
library(dplyr);
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
sampleData %>% filter(int > 7 & int <14)
#> int LETTER month Sample letter randomNum
#> 1 9 E May 11 w 0.2783666
#> 2 11 F Jun 14 x -0.4791717
#> 3 13 G Jul 12 y 1.5229436
Создано в 2020-04-18 по представьте пакет (v0.3.0)