powered by
Count occurrences of specific path segments at a given index
count_path_segments(path, segment_index, sort = FALSE, name = "n")
A tibble with each segment at the specified index and how often it occurs.
A character vector of paths.
Index of the segment to count.
Logical indicating whether to sort the output by count. Defaults to FALSE.
The name of the column containing the counts. Defaults to 'n'.
count_path_segments(c("/path/to/resource", "/path/to/shop"), 2)
Run the code above in your browser using DataLab