A repository for the R package containing the code for the process rate estimator (PRE). Note that this README file contains only a very brief documentation. For a more comprehensive overview, please visit the documentation site.
You can install this R package directly from GitHub using the following R command.
install.packages("remotes")
remotes::install_github("https://github.com/Damian-Oswald/PRE")
Next, attach the library to your search path and your good to go!
library(PRE)
First, load the prepared hyperparameters.
hyperparameters <- PRE::hyperparameters
Next, load the measurements used for the modelling.
measurements <- PRE::measurements
Finally, load the parameters for this session.
parameters <- getParameters()
You may also load the parameters with some (or any number of) alternative parameter value.
parameters <- getParameters(BD = 1.7)
Calculate N2O-N:
data <- getN2ON(data = measurements, parameters = parameters)
Interpolate the missing values based on the bandwidths in hyperparameters
(This function interpolates all values over time; and it also computes and adds the derivatives):
data <- getMissing(data = data, hyperparameters = hyperparameters)
Calculate fluxes from measurement data (This function calculates all necessary parameters from the data)
data <- calculateFluxes(data = data, parameters = parameters)
Read some details on a function.
help(calculateFluxes)
Run the solver for some column, depth and date combination.
x <- PRE(data = data, column = 1, depth = 7.5, date = "2016-01-01", n = 200, parameters = parameters)
Print out information.
print(x)
Generate a plot.
plot(x)
Produce a pairwise panel plot.
pairs(x)
Run the solver for all the dates.
x <- longPRE(data, column = 6, depth = 90, n = 10)
Print information about the PRE results.
print(x)
Plot the results to get an overview.
plot(x)
Plot the results for a specific process.
plot(x, which = "Nitrification")
Plot the overview with fixed y-axis limits.
plot(x, ylim.processes = list(Nitrification = c(-50,50), Denitrification = NA, Reduction = NA))