Package 'snotelr'

Title: Calculate and Visualize 'SNOTEL' Snow Data and Seasonality
Description: Programmatic interface to the 'SNOTEL' snow data (<https://www.nrcs.usda.gov/programs-initiatives/sswsf-snow-survey-and-water-supply-forecasting-program>). Provides easy downloads of snow data into your R work space or a local directory. Additional post-processing routines to extract snow season indexes are provided.
Authors: Koen Hufkens [aut, cre] , BlueGreen Labs [cph, fnd]
Maintainer: Koen Hufkens <[email protected]>
License: AGPL-3
Version: 1.5.2
Built: 2024-11-25 16:37:52 UTC
Source: CRAN

Help Index


Dowloads snotel data based upon a subset of the sno-tel info as provided by snotel_info()

Description

Dowloads snotel data based upon a subset of the sno-tel info as provided by snotel_info()

Usage

snotel_download(
  site_id,
  network = "sntl",
  path = tempdir(),
  metric = TRUE,
  internal = FALSE
)

Arguments

site_id

subset of the sites listed by snotel_info()

network

network list to query (default = sntl, for SNOTEL)

path

where to save downloaded files (default = tempdir())

metric

return metric values, TRUE or FALSE (default = TRUE), when false returns the raw data files

internal

return data to workspace, TRUE or FALSE (default = FALSE)

Examples

## Not run: 
# download data for SNOTEL site 429 and 1287, returning data to 
# the R workspace
df <- snotel_download(site_id = c(429,1287), internal = TRUE)

# list a few first rows
head(df)

## End(Not run)

Start the SNOTEL shiny interface

Description

Start the SNOTEL shiny interface

Usage

snotel_explorer()

Examples

# snotel_explorer()

Downloads a SNOTEL site listing for further processing

Description

Downloads a SNOTEL site listing for further processing

Usage

snotel_info(network = "sntl", path)

Arguments

network

network list to query (default = sntl, for SNOTEL)

path

path where to save the snotel information (site list)

Examples

## Not run: 
# download the meta-data from the SNOTEL server
meta_data <- snotel_info()

# show a couple of lines
head(meta_data)

## End(Not run)

Convert snotel data to metric from imperial units

Description

Data is read from either a snotel data frame and returned as such.

Usage

snotel_metric(df)

Arguments

df

snotel data frame

Details

By default the conversion is done upon download. This function might serve some a purpose in processing of data grabbed straight from the server rather than through the package.

This is an internal function only. Hence, no examples are given.

Value

a data frame with imperial values converted to metric ones


Calculates snow phenology from the snow water equivalent data

Description

First snow melt, first continuous snow melt, first snow accumulation and continous snow accumulation are reported.

Usage

snotel_phenology(df, threshold = 0, offset = 180)

Arguments

df

a snotel data file or data frame

threshold

threshold for mapping continuous snow cover

offset

offset of the year relative to January first (DOY 1)

Details

Be sure to execute this code on individual sites when loading a combined tidy data frame containing data for multiple sites.

Examples

## Not run: 
# download one of the longer time series
df <- snotel_download(site_id = 670, internal = TRUE)

# calculate the snow phenology
phenology <- snotel_phenology(df)

# show a couple of lines
head(phenology)


## End(Not run)