Learn R Programming

taxlist (version 0.3.0)

insert_rows: Insert additional rows to a data frame.

Description

Adding new rows from data frame sharing some columns. Data contained in y is assumed to be additional data and will be appended.

Columns occurring in only one of the data frames will be added to the output.

Usage

insert_rows(x, y, ...)

# S4 method for data.frame,data.frame insert_rows(x, y, ...)

Value

A data frame.

Arguments

x

A data frame.

y

A data frame including rows (and columns) to be inserted in x.

...

Addicional arguments passed among methods.

Examples

Run this code
## Merge data frames including new columns
data(iris)
iris$Species <- paste(iris$Species)
new_iris <- data.frame(Species = rep("humilis", 2), Height = c(15, 20),
    stringsAsFactors = FALSE)
insert_rows(iris, new_iris)

Run the code above in your browser using DataLab