paste0 {stringr} R Documentation

Concatenate Strings

Description


Concatenate vectors after converting to character. Concatenation happens in two basically different ways,
determined by collapse being a string or not.

paste0(..., collapse) is equivalent to paste(..., sep = "", collapse), slightly more efficiently.

Usage

paste0(...,
    collapse = NULL);

Arguments

x

one or more R objects, to be converted to character vectors. [as list]

collapse

an optional character string to separate the results. Not NAcharacter. When collapse is a string, the result is always a string (character of length 1). [as string]

env

[as Environment]

Details

Authors

SMRUCC genomics Institute

Value

A character vector of the concatenated values. This will be of length zero if all the objects are, unless collapse is non-NULL, in which case it is "" (a single empty string).

If any input into an element Of the result Is In UTF-8 (And none are declared With encoding "bytes", see Encoding), that element will be In UTF-8, otherwise In the current encoding In which Case the encoding Of the element Is declared If the current locale Is either Latin-1 Or UTF-8, at least one Of the corresponding inputs (including separators) had a declared encoding And all inputs were either ASCII Or declared.

If an input into an element Is declared With encoding "bytes", no translation will be done Of any Of the elements And the resulting element will have encoding "bytes". If collapse Is non-NULL, this applies also To the second, collapsing, phase, but some translation may have been done In pasting Object together In the first phase.

clr value class

Examples


[Package stringr version 2.33.856.6961 Index]