changeColsBySpp: Extract Column Info And Rearrage A Data.Frame

Description Usage Arguments Examples

Description

This function takes columns that are names like (DensityABCO, DensityABMA, DensityCADE) and changes the data.frame into something like (Species, Density), with a key/value system instead. Check out the examples for how it works. It's used within parseOutFile.

Usage

1
changeColsBySpp(df, removalkey, dead = F)

Arguments

df

The data.frame to search

removalkey

The repeated part of the column name to remove, e.g., "Density"

dead

If dead=T, append "Natural.Dead." to the removal key and subset that way.

Examples

1
2
testdf <- data.frame(DensityABCO=c(1,2), DensityABMA=c(3,4), DensityCADE=c(5,6), stringsAsFactors=F)
changeColsBySpp(testdf, "Density", dead=F)

ecology-rocks/SortieIO documentation built on May 15, 2019, 7:57 p.m.