cutcertainstr: Split a string into multiple strings with a given maximum...

Description Usage Arguments Value Examples

View source: R/cutcertainstr.R

Description

The function shortens and cuts a given vector to a predefined length.

Usage

1
cutcertainstr(x = c(), split = " ", char = 80, newlines = FALSE)

Arguments

x

a string

split

a pattern with the splitting symbol. The default is " ".

char

a numeric with the maximum length of the result.

newlines

a boolean that indicates if the output is seperated by a newline operator or split into multiple parts.

Value

returns a vector with the shortened and cut input string

Examples

1
2
3
x <- "Hello world, this is a test sequence."
cutcertainstr(x, split = ",", char = 30, newlines = FALSE)
# [1] "Hello world,"              " this is a test sequence."

stat545ubc-2021/functions-Jiangsissi720 documentation built on Dec. 23, 2021, 5:25 a.m.