rbind.match | R Documentation |
row binds a vector to an existing data.frame object (data.frame can be empty). The vector should be named. This function ensures that the vector values are added to the column that shares their respectives names.
## S3 method for class 'match' rbind(df.old, x.new, names = colnames(df.old))
df.old |
data.frame object |
x.new |
vector object. Should be named carefully |
names |
Desired column names for output df |
data.frame object
df <- data.frame() x <- 1:5 names(x) <- c("a","b","c","f","g") rbind.match(df, x, names = c("a","b","c","d","e")) rbind.match(df, x, names = c("g","f","c","b","a"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.