nzffdr_widen_habitat {nzffdr}R Documentation

Converts habitat variables to tidy wide format

Description

Converts habitat variables to tidy wide format columns and appends to original dataframe. Warning, with large (>100k rows) datasets this function slow (~30 seconds).

Usage

nzffdr_widen_habitat(
  fishd,
  cols_to_expand = c("habitatFlowPercent", "habitatInstreamCoverPresent",
    "habitatRiparianVegPercent", "habitatSubstratePercent")
)

Arguments

fishd

an NZFFD dataframe returned from nzffdr_import.

cols_to_expand

the habitat columns to expand, can be any combination of "habitatFlowPercent", "habitatInstreamCoverPresent", "habitatRiparianVegPercent", "habitatSubstratePercent".

Value

An NZFFD dataframe with added wide format columns for each of the selected habitat columns.

Examples

nzffdr_widen_habitat(nzffdr::nzffdr_data)

[Package nzffdr version 2.1.0 Index]