mergeStatInfo: Merge PAWMAP station information into a data frame.

View source: R/mergeStatInfo.r

mergeStatInfoR Documentation

Merge PAWMAP station information into a data frame.

Description

Merge PAWMAP station information into a data frame.

Usage

mergeStatInfo(
  df,
  by.y = "site_identifier",
  filterNA = TRUE,
  fields = c("site_identifier", "watershed", "subwat", "loc.lbl", "panel", "duration"),
  renameStat = NULL
)

Arguments

df

A data frame with a station field

by.y

Name of station field, to be matched with site_identifier

filterNA

should stations w/o info be filtered? (A warning listing the unmatched stations is provided.)

fields

Fields to add from the station table

renameStat

Should the site_identifier field be renamed to station? (to match historical output)

Value

The original data frame merged with station info fields. The merge returns all rows of df even if there is no match, to indicate that there are stations in df not present in the station table.

Examples

df <- data.frame(site_identifier=unique(stationInfo$site_identifier),
                 result=rnorm(length(stationInfo$site_identifier)))
mergeStatInfo(df)

PDXChris/pmtools documentation built on March 26, 2024, 8:13 a.m.