cbind.data.frame
Build Data Frame from Columns

Description

Build a data frame by combining vectors, existing data frames, or matrices.

Usage

cbind.data.frame(..., deparse.level = 1)

Arguments

... either vectors, data frames, or matrices.
deparse.level value determining the construction of labels (column labels for cbind or row labels for rbind). This applies only to unnamed vector (non-matrix) arguments.
  • If deparse.level is 0, the corresponding row or column has no label.
  • If deparse.level is 1, the deparsed form is used only if the argument is a simple name.
  • If deparse.level is 2, the label is the deparsed form of the argument.
Any other expression results in no label. These are the only acceptable values for this argument.

Details

Calling this function is nearly equivalent to calling data.frame. See the help for data.frame for information on other arguments to control the creation of row and column names, and so on.
This is a method for the generic function cbind. Calling cbind when at least one argument is a data frame is equivalent to calling data.frame with the same arguments, with the exception of the control arguments check.names and deparse.level.
Unlike data.frame, column names are not changed. If you want variable names to be made unique, call data.frame instead of cbind.
The argument deparse.level (an argument to cbind) is ignored. Names created correspond to deparse.level=1.
Value
returns a data frame formed using the vectors, the variables in the data frames, or the columns of the matrices as variables.
returns the first row names of a data frame or matrix encountered if row names are not supplied.
See Also
cbind, data.frame.
Examples

x <- data.frame(a=1:3) cbind(1, x)

cbind(x,x) # variable names are "a", "a" data.frame(x,x) # variable names are "a", "a.1"

Package base version 6.1.1-7
Package Index