Description Usage Arguments Value Author(s) References Examples
Estimates single-station whole-stream metabolic rates from diel dissolved oxygen (DO) curves (see Grace et al. 2015).
1 2 3 4 5 |
data.dir |
relative or absolute path to the folder containing csv input data files to be read. |
results.dir |
relative or absolute path to the output folder where results (plots and tables) will be written. |
interval |
Integer. The time interval in seconds (e.g. 10 minutes = 600 seconds) |
n.iter |
Integer. Number of MCMC iterations (default = 20000) |
n.burnin |
Integer. Number of iterations of MCMC chains to delete |
K.init |
Numeric. Initial value of chains for K (/day). Reasonable estimate aids convergence. (default value = 2) |
smooth.DO |
Numeric. Proportion of high-frequency fluctuations to filter with fast Fourier transform (default = 0) |
smooth.PAR |
Logical. Should PAR be smoothed with a moving average? (default = FALSE) |
instant |
Logical. Should a table of instantaneous rates be written? (default = FALSE) |
update.chains |
Logical. Should the chains automatically update once if not converged? (default = TRUE) |
extra.iter |
Numeric. Number of extra iterations to run if chains are not converged, as multiple of n.iter (default = 1 times) |
K.est |
Logical. Should K be estimated with uninformative priors? (default = TRUE) |
K.meas.mean |
Numeric. Mean for informed normal prior distribution when K.est = FALSE |
K.meas.sd |
Numeric. Standard deviation for informed normal prior distribution when K.est = FALSE |
p.est |
Logical. Should p be estimated? (default = FALSE) |
theta.est |
Logical. Should theta be estimated? (default = FALSE) |
A dataframe and csv file of parameter estimates (mean, SD) and checks of model fit, plots of model fit (see Vignette for details https://github.com/dgiling/BASEmetab/blob/master/vignettes/BASEmetab.pdf).
Darren Giling, Ralph Mac Nally
Grace et al. (2015) Fast processing of diel oxygen curves: estimating stream metabolism with BASE (BAyesian Single-station Estimation). Limnology and Oceanography: Methods, 13, 103-114.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ##Link to JAGS
library(R2jags)
##View example data set.
#set path to example data.
data.dir <- system.file("extdata", package = "BASEmetab")
ex.data <- read.csv(file.path(data.dir, "Yallakool_example.csv"))
head(ex.data)
tail(ex.data)
##Run Example.
#set output directory to Output folder in current working directory.
results.dir <- file.path(getwd(), "Output")
if (dir.exists(results.dir)){} else {
dir.create(results.dir)}
#run model.
results <- bayesmetab(data.dir, results.dir, interval=600)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.