add_metadata: add_metadata function

View source: R/add_metadata.R

add_metadataR Documentation

add_metadata function

Description

Add the metadata to a dataframe based on a common ID column.

Usage

add_metadata(data, metadata, cols)

Arguments

data

: A dataframe with ID and some other columns

metadata:

A metadata table with ID

cols:

Vector of column indices, indicating which columns of metadata to copy over.

Value

The original dataframe with the additional columns from the metadata.

Examples

data = tibble::tibble(Bird.ID = c("JS001", "JS002"),a = c(1,2), b = c(1,2))
metadata = tibble::tibble(Bird.ID = c("JS001", "JS002"), x= c(3,4), y = c(5,6), z = c(7,8))
add_metadata(data,metadata, col = 1)

Anthony-Kwong/birdsong.tools documentation built on April 14, 2023, 9:50 a.m.