Skip to content

Commit

Permalink
revert back to itemize tag; new example for htmlSummary
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanCarbone committed May 17, 2024
1 parent 897dd89 commit 51ca352
Show file tree
Hide file tree
Showing 7 changed files with 547 additions and 7 deletions.
456 changes: 456 additions & 0 deletions Occ_viz_html.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion R/WSS.r
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#'
#' The data.frame has a number of attributes:
#'
#' \describe{
#' \itemize{
#' \item{\code{intercept_year}}{ - The year used for the intercept (i.e. the
#' year whose value is set to 0). Setting the intercept to the median year helps
#' to increase model stability}
Expand Down
44 changes: 43 additions & 1 deletion R/htmlSummary.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,50 @@
#' @param ... Additional arguments passed to rmarkdown::render
#'
#' @return Path to html report
#' @export
#' @import rmarkdown
#'
#' @examples
#'
#' \dontrun{
#' # Create data
#' set.seed(125)
#' n <- 15000 #size of dataset
#' nyr <- 20 # number of years in data
#' nSamples <- 100 # set number of dates
#' nSites <- 50 # set number of sites
#'
#' # Create somes dates
#' first <- as.Date(strptime("1980/01/01", "%Y/%m/%d"))
#' last <- as.Date(strptime(paste(1980+(nyr-1),"/12/31", sep=''), "%Y/%m/%d"))
#' dt <- last-first
#' rDates <- first + (runif(nSamples)*dt)
#'
#' # taxa are set as random letters
#' taxa <- sample(letters, size = n, TRUE)
#'
#' # three sites are visited randomly
#' site <- sample(paste('A', 1:nSites, sep=''), size = n, TRUE)
#'
#' # the date of visit is selected at random from those created earlier
#' survey <- sample(rDates, size = n, TRUE)
#'
#' # run the model with these data for one species
#' # using defaults
#' results <- occDetModel(taxa = taxa,
#' site = site,
#' survey = survey,
#' species_list = 'a',
#' write_results = TRUE,
#' n_iterations = 1000,
#' burnin = 10,
#' thinning = 2)
#'
#' generate summary
#' htmlSummary(results$a)
#'
#' }
#'
#' @export

htmlSummary <- function(occDet,
open = TRUE,
Expand Down
4 changes: 2 additions & 2 deletions R/occDetFunc.r
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
#' a combination that is not supported. There is usually a good reason why that
#' combination is not a good idea. Here are the model elements available:
#'
#' \describe{
#' \itemize{
#' \item{\code{"sparta"}}{ - This uses the same model as in Isaac et al (2014)}
#' \item{\code{"indran"}}{ - Here the prior for the year effect of the state model is modelled as a random effect. This allows the model to adapt to interannual variability.}
#' \item{\code{"ranwalk"}}{ - Here the prior for the year effect of the state model is modelled as a random walk. Each estimate for the year effect is dependent on that of the previous year.}
Expand All @@ -96,7 +96,7 @@
#'
#' @return A list including the model, JAGS model output, the path of the model file used and information on the number of iterations, first year, last year, etc.
#' Key aspects of the model output include:
#' \describe{
#' \itemize{
#' \item{\code{"out$model"}}{ - The model used as provided to JAGS. Also contained is a list of fully observed variables. These are those listed in the BUGS data.}
#' \item{\code{"out$BUGSoutput$n.chains"}}{ - The number of Markov chains ran in the MCMC simulations.}
#' \item{\code{"out$BUGSoutput$n.iter"}}{ - The total number of iterations per chain.}
Expand Down
2 changes: 1 addition & 1 deletion man/WSS.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions man/htmlSummary.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/occDetFunc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 51ca352

Please sign in to comment.