Skip to contents

These functions return a logical vector indicating on which lines the specific content occurs.

Usage

lines_with_rock_codes(x)

lines_with_rock_breaks(x)

lines_with_rock_anchors(x)

lines_with_rock_uids(x)

lines_with_rock_comments(x)

lines_with_rock_nesting(x)

lines_with_yaml(x)

lines_with_rock_notes(x)

lines_with_whitespaceOnly(x)

lines_with_data(x)

Arguments

x

The charactor vector to search.

Value

A logical vector.

Examples

### Get path to example source
examplePath <-
  system.file("extdata", package="rock");

### Get a path to one example file
exampleFile <-
  file.path(examplePath, "example-5.rock");

### Parse single example source
loadedExample <-
  rock::load_source(exampleFile);

linesWithCodes <-
  lines_with_codes(loadedExample);
#> Error in lines_with_codes(loadedExample): could not find function "lines_with_codes"
loadedExample[linesWithCodes];
#> Error: object 'linesWithCodes' not found

linesWithBreaks <-
  lines_with_breaks(loadedExample);
#> Error in lines_with_breaks(loadedExample): could not find function "lines_with_breaks"
loadedExample[linesWithBreaks];
#> Error: object 'linesWithBreaks' not found