Skip to content

A repository for the R package containing the code for the process rate estimator (PRE).

License

Notifications You must be signed in to change notification settings

Damian-Oswald/PRE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The R package PRE

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.

Installation

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)

Loading the data

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)

Impute the missing dependent data

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 once

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 over time

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))

About

A repository for the R package containing the code for the process rate estimator (PRE).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published