R cbind Function

cbind() function combines vector, matrix or data frame by columns.

x1,x2:vector, matrix, data frames



Read in the data from the file:
>x <- read.csv("data1.csv",header=T,sep=",")
>x2 <- read.csv("data2.csv",header=T,sep=",")

>x3 <- cbind(x,x2)
  Subtype Gender Expression Age     City
1       A      m      -0.54  32 New York
2       A      f      -0.80  21  Houston
3       B      f      -1.03  34  Seattle
4       C      m      -0.41  67  Houston

The row number of the two datasets must be equal.