cb | R Documentation |
Bind two vectors together and return result as a data frame. Alternatively, extract specified columns from a data frame, bind them together, and return result as a data frame.
cb(a,b)
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. |
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.