paste2: Paste an Unspecified Number Of Text Columns

Description Usage Arguments Value Note See Also Examples

Description

Paste unspecified columns or a list of vectors together.

Usage

1
2
  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.

Note

paste differs from paste2 because paste does not allowed an unspecified number of columns to be pasted. This behavior can be convenient for inside of functions when the number of columns being pasted is unknown.

See Also

paste

Examples

1
2
3
4
5
6
7
8
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="|-|")

trinker/qdap2 documentation built on May 31, 2019, 9:47 p.m.