count_path_segments: Count occurrences of specific path segments at a given index

View source: R/count.R

count_path_segmentsR Documentation

Count occurrences of specific path segments at a given index

Description

Count occurrences of specific path segments at a given index

Usage

count_path_segments(path, segment_index, sort = FALSE, name = "n")

Arguments

path

A character vector of paths.

segment_index

Index of the segment to count.

sort

Logical indicating whether to sort the output by count. Defaults to FALSE.

name

The name of the column containing the counts. Defaults to 'n'.

Value

A tibble with each segment at the specified index and how often it occurs.

Examples

count_path_segments(c("/path/to/resource", "/path/to/shop"), 2)

urlexplorer documentation built on Aug. 8, 2025, 7:29 p.m.