powered by
Add a constant column to data.frame or matrix.
addCol(x, ..., value)
data.frame or matrix
data.frame
matrix
constants
vector a vector of constants
vector
a data.frame or matrix contains all columns in x and those constant columns.
# NOT RUN { d=data.frame(x=1:5,y=11:15) addCol(d,a=1,b=2,c=3) addCol(d,value=c(a=100,b=200,c=300)) # }
Run the code above in your browser using DataLab