Skip to contents

These are normally not used directly by end users; they're used internally to extract notes.

Usage

nr_in_interval(x, interval)

nr_in_any_interval(x, intervals)

find_blocks_of_lines(x)

Arguments

x

A numeric vector of value 1 (for nr_in_interval() and more for the other functions.

interval, intervals

One or more intervals: sets of two or more line numbers, with the minimum and maximum line numbers forming an internal

Value

A logical value or vector for nr_in_interval(), nr_in_any_interval(), and nrs_in_any_interval(); a list for find_blocks_of_lines()

Examples

rock::nr_in_interval(5, 7:10);
#> [1] FALSE
rock::nr_in_interval(8, 7:10);
#> [1] TRUE

rock::nr_in_intervals(
  5,
  c(c(1,4), 7:10)
);
#> Error: 'nr_in_intervals' is not an exported object from 'namespace:rock'

rock::find_blocks_of_lines(
  c(
    1, 2, 5, 7, 8, 9, 10,
    18, 20, 23, 24, 25, 30
  )
);
#> [[1]]
#> [1] 1 2
#> 
#> [[2]]
#> [1] 5
#> 
#> [[3]]
#> [1]  7  8  9 10
#> 
#> [[4]]
#> [1] 18
#> 
#> [[5]]
#> [1] 20
#> 
#> [[6]]
#> [1] 23 24 25
#> 
#> [[7]]
#> [1] 30
#>