Learn R Programming

urlexplorer (version 0.1.0)

count_path_segments: 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")

Value

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

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'.

Examples

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

Run the code above in your browser using DataLab