Learn R Programming

do (version 2.0.0.1)

paste0_columns: Paste Columns Together

Description

Paste each column in a dataframe together.

Usage

paste0_columns(df, collapse = ",")

Value

a character

Arguments

df

a dataframe

collapse

collapse, default is comma

Examples

Run this code
df=data.frame(a=c(1,2,30),
              b=c('x','y','z'))
paste0_columns(df)

df=data.frame(a=c(1,2,30),b=c('x','y','z'),c=c(1,7,8))
paste0_columns(df)

Run the code above in your browser using DataLab