Description Usage Arguments Details Value Examples
View source: R/MGDrivE-Auxiliary.R
This function reads in all repetitions for each patch and calculates either
the mean, quantiles, or both. User chooses the quantiles, up to 4 decimal places,
and enters them as a vector. Quantiles are calculated empirically. (order does not matter)
1 | calcQuantiles(readDir, writeDir, mean = TRUE, quantiles = NULL, verbose = TRUE)
|
readDir |
Directory to find repetition folders in |
writeDir |
Directory to write output |
mean |
Boolean, calculate mean or not. Default is TRUE |
quantiles |
Vector of quantiles to calculate. Default is NULL |
verbose |
Chatty? Default is TRUE |
Given the readDir, this function assumes the follow file structure:
readDir
repetition 1
patch 1
patch 2
patch 3
repetition 2
patch 1
patch 2
patch 3
repetition 3
repetition 4
...
Output files are *.csv contain the mean or quantile in the file name, i.e. M/FMean(patchNum).csv and M/FQuantile(quantNum)_(patchNum).csv.
Writes output to files in writeDir
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
# This function assumes network$multRun() has been performed, or several
# network$oneRun() have been performed and all of the data has been split
# and aggregated.
# read/write paths
fPath <- "path/to/folder/ofFolders/with/data"
oPath <- "my/path/output"
# here, only calculate mean, no quantiles
# no return value
calcQuantiles(readDir = fPath, writeDir = oPath, mean = TRUE,
quantiles = NULL)
# here, calculate 2.5% and 97.5% quantiles
calcQuantiles(readDir = fPath, writeDir = oPath, mean = FALSE,
quantiles = c(0.025, 0.975))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.