splitInputNumbers: Split Input Numbers

View source: R/splitInputNumbers.R

splitInputNumbersR Documentation

Split Input Numbers

Description

When list of numbers are provided as a character (usually as command-line argument, or user text input), split them into a numeric vector. Also supports splitting "4:8" into 4, 5, 6, 7, 8.

Usage

splitInputNumbers(char_v, split_v = ",")

Arguments

char_v

Character vector that is input

split_v

Delimiter used to separate numbers.

Examples

char1_v <- "1,2,3,4,5"
char2_v <- "1:5"
char3_v <- "1:5,9,10,20:25"
splitInputNumbers(char1_v)
splitInputNumbers(char2_v)
splitInputNumbers(char3_v)

weshorton/wrh.rUtils documentation built on Oct. 28, 2024, 7:24 a.m.