insert_rows: Insert additional rows to a data frame.

insert_rowsR Documentation

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 signature 'data.frame,data.frame'
insert_rows(x, y, ...)

Arguments

x

A data frame.

y

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

...

Addicional arguments passed among methods.

Value

A data frame.

Examples

## 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)

ropensci/taxlist documentation built on Sept. 17, 2024, 3:39 p.m.