Learn R Programming

astrochron (version 0.3.1)

cb: Combine Multiple Vectors

Description

Take any number of input vectors, bind the columns together, and return as a data.frame

Usage

cb(a,b)

Arguments

a
first input vector OR a data frame with >1 column.
b
second input vector OR if a is a data frame with > 1 column, a list of columns to bind.

Examples

Run this code
# example dataset
x<-rnorm(100)
dim(x)<-c(10,10)
x<-data.frame(x)

# bind two columns
cb(x[1],x[5])

# bind five columns
cb(x,c(1,2,4,7,9))

Run the code above in your browser using DataLab