expand_ocean: A function to to add a row for each instance where a string...

Description Usage Arguments Examples

View source: R/functions.R

Description

A function to to add a row for each instance where a comma-seperated string occurs in a column (e.g. if a cell contains the string "Atlantic, Pacific, Arctic this suction will replace the row with three rows containing "Atlantic", "Pacific" and "Arctic"). This is useful when compiling summary statistics for species that occur in multiple oceans.

Usage

1
expand_ocean(data, column_name)

Arguments

data

The data frame containing the rows to expand

column_name

The column name holding the string to expand the data over in quotes (e.g. "Ocean").

Examples

1
expand_ocean(data, "ocean")

rooperc4/ForageFishLitReview documentation built on Feb. 21, 2022, 9:54 a.m.