Select_NOAA_Stations: Select NOAA Stations.

View source: R/Functions_NOAA_Stations.R

Select_NOAA_StationsR Documentation

Select NOAA Stations.

Description

This function retrieves the NOAA stations, like Get_NOAA_Stations, then selects a group of stations based on certain properties.

The output dataframe sacrifices robustness for simplicity to make code easier to understand.

If unique_stations is TRUE then the resultant dataframe will have one row per station.

Usage

Select_NOAA_Stations(
  localSave = FALSE,
  refresh = FALSE,
  localFileName = "stations.Rdata",
  selectElements = NULL,
  beginYear = NULL,
  endYear = NULL,
  unique_stations = FALSE,
  unique_cols = NULL,
  add_dist_from_coord = NULL,
  reorder_by_dist = TRUE
)

Arguments

localSave

saves / retrieves information locally

refresh

forces a refresh of cached station information

localFileName

local name of file used to cache station information

selectElements

list of elements to limit select

beginYear

the earliest year of data collection

endYear

the last year of data collection

unique_stations

reorganize so output only includes unique stations

unique_cols

when collapsing to only unique stations, this is the list of which rows to include.

add_dist_from_coord

if set to a coordinate, distance from coord is added

reorder_by_dist

TRUE if the stations are reordered by dist from a coord

Details

If selectElements parameter has a list of elements, like c('PRCP'), then the list will be narrowed to only those elements. If unique is used then a column for each element will identify if the data is available.

Examples


# If NOAA stations have not been downloaded in a while
 
stations <- Select_NOAA_Stations(refresh = TRUE)

 # If local saves are not desired
 
 stations <- Select_NOAA_Stations(localSave = FALSE)
 
 
 


JerryHMartin/waterDataSupport documentation built on Jan. 25, 2023, 2:36 a.m.