Calculate and Visualize 'SNOTEL' Snow Data and Seasonality

Programmatic interface to the 'SNOTEL' snow data (< https://www.wcc.nrcs.usda.gov/snow/>). 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.


Build Status codecov Buy Me A Coffee

SnotelR is a R toolbox to facilitate easy SNOTEL data exploration and downloads through a convenient R shiny based GUI. In addition it provides a routine to extract basic snow phenology metrics.

Installation

stable release

To install the current stable release use a CRAN repository:

install.packages("snotelr")
library("snotelr")

development release

To install the development releases of the package run the following commands:

if(!require(devtools)){install.packages("devtools")}
devtools::install_github("khufkens/snotelr")
library("snotelr")

Vignettes are not rendered by default, if you want to include additional documentation please use:

if(!require(devtools)){install.packages("devtools")}
devtools::install_github("khufkens/snotelr", build_vignettes = TRUE)
library("snotelr")

Use

Most people will prefer the GUI to explore data on the fly. To envoke the GUI use the following command:

library(snotelr)
snotel_explorer()

This will start a shiny application with an R backend in your default browser. The first window will display all site locations, and allows for subsetting of the data based upon state or a bounding box. The bounding box can be selected by clicking top-left and bottom-right.

The plot data tab allows for interactive viewing of the soil water equivalent (SWE) data together with a covariate (temperature, precipitation). The SWE time series will also mark snow phenology statistics, mainly the day of:

  • first snow melt
  • a continuous snow free season (last snow melt)
  • first snow accumulation (first snow deposited)
  • continuous snow accumulation (permanent snow cover)
  • maximum SWE (and its amount)

To access the full list of SNOTEL sites and associated meta-data use the snotel.info() function.

# returns the site info as snotel_metadata.txt in the current working directory
snotel_info(path = ".") 
 
# export to data frame
meta-data <- snotel_info(path = NULL) 
 
# show some lines of the data frame
head(meta-data)

To query data for e.g. site 924 as shown in the image above use:

snotel_download(site_id = 924)

For in depth analysis the statistics in the GUI can be retrieved using the snotel_phenology() function

# with df a SNOTEL file or data frame in your R workspace
snotel_phenology(df)

Notes

Use the proper acknowledgements when using the downloaded data.

Acknowledgements

This project was in part supported by the National Science Foundation’s Macro-system Biology Program (award EF-1065029).

News

snotelr 1.0.1

  • CRAN compliance fixes

snotelr 1.0.0

  • first CRAN release
  • tidy data output
  • combined data output for multiple sites

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("snotelr")

1.0.1 by Koen Hufkens, 7 months ago


https://github.com/khufkens/snotelr


Report a bug at https://github.com/khufkens/snotelr/issues


Browse source code at https://github.com/cran/snotelr


Authors: Koen Hufkens [aut, cre]


Documentation:   PDF Manual  


AGPL-3 license


Imports shiny, xml2, httr, utils, stats, rvest, magrittr, wdman, RSelenium, memoise

Suggests knitr, rmarkdown, covr, testthat, shinydashboard, leaflet, plotly, DT


See at CRAN