get_nth_part: Extracts the first (or nth) entry from each split.

Description Usage Arguments Value Examples

View source: R/get_nth_part.R

Description

Extracts the first (or nth) entry from each split.

Usage

1
get_nth_part(x, delimiter, entry_no)

Arguments

x

A character vector.

delimiter

A character to split by.

entry_no

A number indicating which part of split to return.

Value

A character vector containing parts

Examples

1
2
3
4
x = "2wk.1"   "2wk.2"   "2wk.3"   "2wk.4"   "2wk.5"   "2wk.6"   "2wk.7"   "2wk.8"   "2wk.9"   "2wk.10"
         delimiter = "\\."
         entry_no = 1L
         The return value is "2wk"  "2wk"  "2wk"  "2wk"  "2wk"  "2wk"  "2wk"  "2wk"  "2wk"  "2wk"  "2wk"  "2wk"

kazeera/kazutils documentation built on March 7, 2021, 10:59 p.m.