Page MenuHomec4science

swisswatertemp.Rd
No OneTemporary

File Metadata

Created
Wed, May 1, 19:15

swisswatertemp.Rd

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Utils.R
\docType{package}
\name{swisswatertemp}
\alias{swisswatertemp}
\alias{swisswatertemp-package}
\title{swisswatertemp: A package to produce results presented in 'Stream temperature evolution in Switzerland over the last 50 years, Adrien Michel, Tristan Brauchli, Michael Lehning, Bettina Schaefli, and Hendrik Huwald, 2019'}
\description{
The swisswatertemp package is divided in two main parts: one is responsible to
generate the dataset, and one to perform the analysis and produce plots.
}
\section{Produce the data sets}{
The data set can be produced from raw data in a SMET fromat. Raw data are not
provided here. The details about how to get the raw data and the scripts to
transform them in the SMET format are given in the directory 1_Obtain_raw_data.
Once the raw data are in the correct SMET format, the dataset can be generated
by running Preprocessing.R in the 3_Produce_data directory. These steps are
not mandatory, the datasets are indeed already available in
4_Run_analysis/data/rds_data. Metedata can be found in the excel table
3_Produce_data/data/discharge_gauging_station.xlsx
}
\section{Description of data sets}{
Produced data sets have the general structure described below. Some data sets
produced have only part of it.
Structure of the data set:
\preformatted{
["station name"]
|--header
|--station_id = station number
|--station_name = station name
|--latitude: WG94 latitude
|--longitude: WG94 longitude
|--easting: CH1903 easting
|--northing: CH1903 nothing
|--altitude: altitude of the station
|--operator: source of the data
|--river: name of the river
|--area: area of the catchment at the station
|--mean_elevation: mean elevation of the catchment
|--glacier_percent: percentage of the catchment glacier covered
|--regime1: hydrological regime (classical)
|--regime2: hydrological regime with regards to location
|--regime3:Hydrological regime (following Aschwanden 1985, different from HADES 5.2)
|--nodata: no data value used
|--tz: timezone
|--fields: variables in the [data] table
|--data: raw data
|--timestamp: timestamp of the measurement as R date
|--T: measured temperature (°C)
|--Q: measured discharge (m3/s)
|--[monthly, yearly, DJF, MAM, JJA or SON]: data averaged over the given period
|--[T Q]
|--timestamp: timestamp in decimal year
|--values: raw data averaged over the indicated period
|--lm: output from linear model applied to trend + remainder
|--["1999-2018" "1979-1998" "1979-2018" "1970-2018"] Periods over which
trend is calculated, not necessarily all available
|--timestamp: timestamp over the used period
|--values: raw data over the given period
|--trend: slope from linear model
|--trend_std: std error of the trend value
|--trend_p: p_value of the trend value
|--intercept: intercept value from linear model
|--intercept_std: std error of the intercept value
|--intercept_p: p_value the of intercept value
|--r_squared: r^2
|--adj_r_squared: adjusted r^2
|--printable:
|--[trend, trend_std, trend_p, intercept, intercept_std, intercept_p,
r_squared, adj_r_squared]: Same value as above but as string in "e" notation for display
|--hysteresis:
|--[daily_mean or daily_mean_smoothed]: daily decadal mean, with or without
smoothing (smoothed data is used in QT plots)
|--["from_to" in years, e.g. "2009_1018"]
|--T: temperature values(°C), 365 values
|--Q: discharge values(m3/s), 365 values
|--meteo: attached meteo data
|--[[station name]]
|--header:
|--station_id = station ID
|--station_name = station name, same as ID
|--latitude: WG94 latitude
|--longitude: WG94 longitude
|--easting: CH1903 easting
|--northing: CH1903 nothing
|--altitude: altitude of the station
|--nodata: no data value used
|--source: source of the meteodata
|--tz: timezone
|--fields: variables in the [data] table
|--data: raw meteo data
|--timestamp: timestamp of the measurement as R date
|--[TA, P, TA_HOM, P_HOM, HS6, HS18, HSAUTO6, HSAUTO18]: available meteo variables
|--[monthly, yearly, DJF, MAM, JJA or SON]: data averaged over the given period
|--[TA,P]
|--timestamp: timestamp in decimal year
|--values: raw data averaged over the indicated period
|--lm: output from linear model applied to trend + remainder
|--["1999-2018" "1979-1998" "1979-2018" "1970-2018"] Periods over which
trend is calculated, not necessarily all available
|--timestamp: timestamps over the used period
|--values: raw data over the given period
|--trend: slope from linear model
|--trend_std: std error of the trend value
|--trend_p: p_value of the trend value
|--intercept: intercept value from linear model
|--intercept_std: std error of the intercept value
|--intercept_p: p_value the of intercept value
|--r_squared: r^2
|--adj_r_squared: adjusted r^2
|--printable:
|--[trend, trend_std, trend_p, intercept, intercept_std, intercept_p,
r_squared, adj_r_squared]: Same value as above but as string in "e" notation for display
|--STL
|--[T or Q]
|--timestamp: date, in decimal years
|--seasonal: seasonal component from STL
|--trend: trend from STL
|--remainder: remainders from STL
|--raw: raw data used for STL
|--acf: acf analysis as R acf object
|--pacf: pacf analysis as R pacf object
|--lm: output from linear model applied to trend + remainder
|--["1999-2018" "1979-1998" "1979-2018" "1970-2018"] Periods over which
trend is calculated, not necessarily all available
|--timestamp: timestamp over the used period
|--values: raw data over the given period
|--trend: slope from linear model
|--trend_std: std error of the trend value
|--trend_p: p_value of the trend value
|--intercept: intercept value from linear model
|--intercept_std: std error of the intercept value
|--intercept_p: p_value the of intercept value
|--r_squared: r^2
|--adj_r_squared: adjusted r^2
|--printable:
|--[trend, trend_std, trend_p, intercept, intercept_std, intercept_p,
r_squared, adj_r_squared]: Same value as above but as string in "e" notation for display
|--meteo
|--[station name]
|--[TA or P]
|--timestamp: date, in decimal years
|--seasonal: seasonal component from STL
|--trend: trend from STL
|--remainder: remainders from STL
|--raw: raw data used for STL
|--acf: acf analysis as R acf object
|--pacf: pacf analysis as R pacf object
|--ccf: ccf analysis (between meteo and river data T-TA and Q-P) as R ccf object
|--lm: output from linear model applied to trend + remainder
|--["1999-2018" "1979-1998" "1979-2018" "1970-2018"] Periods over
which trend is calculated, not necessarily all available
|--timestamp: timestamp over the used period
|--values: raw data over the given period
|--trend: slope from linear model
|--trend_std: std error of the trend value
|--trend_p: p_value of the trend value
|--intercept: intercept value from linear model
|--intercept_std: std error of the intercept value
|--intercept_p: p_value the of intercept value
|--r_squared: r^2
|--adj_r_squared: adjusted r^2
|--printable:
|--[trend, trend_std, trend_p, intercept, intercept_std,
intercept_p, r_squared, adj_r_squared]: Same value as above
but as string in "e" notation for display
}
}
\section{Usage of the data sets}{
\preformatted{
Entries can be accessed following the structure describes above
and with double brackets [["entry name here"]] (the name shoulb be
between quote marks), or with the "$" signe (in this case no quote
mark is needed except in the names contains special character).
If a variable containing the name of the entry to be accesses is
used, double brakets shoudl be used [[var]], note that $var will
not work (text after $ is taken as string, i.e. variable will not
be accessed).
Examples:
1) rivers_data[["Aare-Brienzwiler"]][["STL"]][["meteo"]][["GRH"]][["TA"]][["trend"]]
or
rivers_data$"Aare-Brienzwiler"$STL$meteo$GRH$TA$trend
are quivalent and return the trend component of the meteo station GRH linked
to the Aare-Brienzwiler water station.
2) Note that the function "names" is useful to retrieve the next entries at a
given entry level. E.g. names(rivers_data$"Aare-Brienzwiler"$meteo) returns
a list of the names of meteo station attached to the Aare-Brienzwiler river
station.
3) for (river_station in names(rivers_data))
will loop over all stations names which are stored in river_station. Data can
be thus accessed through: rivers_data[[river_station]]$...
For example rivers_data[[river_station]]$header$mean_elevation, if in the above
loop, will return the mean elevation for each catchment.
}
}

Event Timeline