Learn R Programming

qdap (version 0.2.5)

paste2: Paste an Unspecified Number Of Text Columns

Description

Paste unspecified columns or a list of vectors together.

Usage

paste2(multi.columns, sep = ".", handle.na = TRUE,
    trim = TRUE)

Arguments

multi.columns
The multiple columns or a list of vectors to paste together.
sep
A character string to separate the terms.
handle.na
logical. If TRUE returns NA if any column/vector contains a missing value.
trim
logical. If TRUE leading/trailing white space is removed.

Value

  • Returns a vector with row-wise elements pasted together.

See Also

paste

Examples

Run this code
v <- rep(list(state.abb[1:8],  month.abb[1:8]) , 5)
n <- sample(5:10, 1)
paste(v[1:n]) #odd looking return
paste2(v[1:n])
paste2(v[1:n], sep="|")
paste2(mtcars[1:10,], sep="|")
paste(mtcars[1:10,], sep="|") #odd looking return
paste2(CO2[1:10,], sep="|-|")

Run the code above in your browser using DataLab