diff --git a/R/detection_calculate.R b/R/detection_calculate.R index f4d9a09..d073388 100644 --- a/R/detection_calculate.R +++ b/R/detection_calculate.R @@ -62,7 +62,7 @@ #' cov_val = c(0,0), pcr_n = 3) #' #' # Calculate mu_critical at salinity 0.5 z-scores greater than the mean -#' detection_calculate(fit.cov$model, mu = seq(from = 0.1, to = 1, by = 0.1), +#' detection_calculate(fit_cov$model, mu = seq(from = 0.1, to = 1, by = 0.1), #' cov_val = c(0,0.5), pcr_n = 3) #' #' # Ex. 2: Calculating necessary effort for detection with multiple traditional diff --git a/R/mu_critical.R b/R/mu_critical.R index 5630f77..65c3fbd 100644 --- a/R/mu_critical.R +++ b/R/mu_critical.R @@ -48,8 +48,8 @@ #' #' # Fit a model including 'Filter_time' and 'Salinity' site-level covariates #' fit_cov <- joint_model(data = goby_data, cov = c('Filter_time','Salinity'), -#' family = "poisson", p10_priors = c(1,20), q = FALSE, -#' multicore = FALSE) +#' family = "poisson", p10_priors = c(1,20), q = FALSE, +#' multicore = FALSE) #' #' # Calculate mu_critical at the mean covariate values (covariates are #' # standardized, so mean = 0) diff --git a/R/traditional_model.R b/R/traditional_model.R index 27be5f0..519d549 100644 --- a/R/traditional_model.R +++ b/R/traditional_model.R @@ -92,23 +92,23 @@ #' @examples #' \donttest{ #' # Load data -#' data(greencrabData) +#' data(green_crab_data) #' #' # Examine data in list #' # This function uses only traditional survey count data and optionally #' # the count type data -#' names(greencrabData) +#' names(green_crab_data) #' #' # Note that the surveyed sites (rows) should match in the data -#' dim(greencrabData$count)[1] -#' dim(greencrabData$count_type)[1] +#' dim(green_crab_data$count)[1] +#' dim(green_crab_data$count_type)[1] #' #' # Fit a model without estimating a gear scaling coefficient for traditional #' # survey gear types. #' # This model assumes all traditional survey methods have the same #' # catchability. #' # Count data is modeled using a poisson distribution. -#' fit_no_q <- traditional_model(data = greencrabData, family = "poisson", +#' fit_no_q <- traditional_model(data = green_crab_data, family = "poisson", #' q = FALSE, phi_priors = NULL, #' multicore = FALSE, verbose = TRUE) #' @@ -118,11 +118,12 @@ #' # This model does not assume all traditional survey methods have the same #' # catchability. #' # Count data is modeled using a negative binomial distribution. -#' fit_q <- traditional_model(data = greencrabData, family = "negbin", q = TRUE, -#' phi_priors = c(0.25,0.25), multicore = FALSE, -#' initial_values = NULL, n_chain = 4, -#' n_warmup = 500, n_iter = 3000, thin = 1, -#' adapt_delta = 0.9, verbose = TRUE, seed = 123) +#' fit_q <- traditional_model(data = green_crab_data, family = "negbin", +#' q = TRUE, phi_priors = c(0.25,0.25), +#' multicore = FALSE, initial_values = NULL, +#' n_chain = 4, n_warmup = 500, n_iter = 3000, +#' thin = 1, adapt_delta = 0.9, verbose = TRUE, +#' seed = 123) #' } #' diff --git a/man/detection_calculate.Rd b/man/detection_calculate.Rd index 629728e..f4e98a8 100644 --- a/man/detection_calculate.Rd +++ b/man/detection_calculate.Rd @@ -78,7 +78,7 @@ detection_calculate(fit_cov$model, mu = seq(from = 0.1, to = 1, by = 0.1), cov_val = c(0,0), pcr_n = 3) # Calculate mu_critical at salinity 0.5 z-scores greater than the mean -detection_calculate(fit.cov$model, mu = seq(from = 0.1, to = 1, by = 0.1), +detection_calculate(fit_cov$model, mu = seq(from = 0.1, to = 1, by = 0.1), cov_val = c(0,0.5), pcr_n = 3) # Ex. 2: Calculating necessary effort for detection with multiple traditional diff --git a/man/mu_critical.Rd b/man/mu_critical.Rd index 1123a1e..84fa81c 100644 --- a/man/mu_critical.Rd +++ b/man/mu_critical.Rd @@ -56,8 +56,8 @@ data(goby_data) # Fit a model including 'Filter_time' and 'Salinity' site-level covariates fit_cov <- joint_model(data = goby_data, cov = c('Filter_time','Salinity'), - family = "poisson", p10_priors = c(1,20), q = FALSE, - multicore = FALSE) + family = "poisson", p10_priors = c(1,20), q = FALSE, + multicore = FALSE) # Calculate mu_critical at the mean covariate values (covariates are # standardized, so mean = 0) diff --git a/man/traditional_model.Rd b/man/traditional_model.Rd index a7d36e2..fa645c2 100644 --- a/man/traditional_model.Rd +++ b/man/traditional_model.Rd @@ -114,23 +114,23 @@ If any of these checks fail, the function returns an error message. \examples{ \donttest{ # Load data -data(greencrabData) +data(green_crab_data) # Examine data in list # This function uses only traditional survey count data and optionally # the count type data -names(greencrabData) +names(green_crab_data) # Note that the surveyed sites (rows) should match in the data -dim(greencrabData$count)[1] -dim(greencrabData$count_type)[1] +dim(green_crab_data$count)[1] +dim(green_crab_data$count_type)[1] # Fit a model without estimating a gear scaling coefficient for traditional # survey gear types. # This model assumes all traditional survey methods have the same # catchability. # Count data is modeled using a poisson distribution. -fit_no_q <- traditional_model(data = greencrabData, family = "poisson", +fit_no_q <- traditional_model(data = green_crab_data, family = "poisson", q = FALSE, phi_priors = NULL, multicore = FALSE, verbose = TRUE) @@ -140,11 +140,12 @@ fit_no_q <- traditional_model(data = greencrabData, family = "poisson", # This model does not assume all traditional survey methods have the same # catchability. # Count data is modeled using a negative binomial distribution. -fit_q <- traditional_model(data = greencrabData, family = "negbin", q = TRUE, - phi_priors = c(0.25,0.25), multicore = FALSE, - initial_values = NULL, n_chain = 4, - n_warmup = 500, n_iter = 3000, thin = 1, - adapt_delta = 0.9, verbose = TRUE, seed = 123) +fit_q <- traditional_model(data = green_crab_data, family = "negbin", + q = TRUE, phi_priors = c(0.25,0.25), + multicore = FALSE, initial_values = NULL, + n_chain = 4, n_warmup = 500, n_iter = 3000, + thin = 1, adapt_delta = 0.9, verbose = TRUE, + seed = 123) } }