Skip to contents

Paste Columns of Data Frame With Separator

Usage

pasteColumns(x, columns = names(x), sep = " ", ...)

Arguments

x

data frame

columns

names of columns to be pasted. Default: all columns

sep

separator character. Default: space (" ")

...

args passed to selectColumns, e.g. do.stop to control whether the function shall stop if not all columns exist

Value

vector of character with each element representing the values of the selected columns of one row, being pasted with the separator character

Examples

x <- data.frame(A = 1:3, B = 2:4)
pasteColumns(x, sep = ";")
#> [1] "1;2" "2;3" "3;4"