Skip to content

Commit 43f1dfc

Browse files
committed
clean up some of the rmd check warnings
1 parent 72b6f79 commit 43f1dfc

26 files changed

+48
-53
lines changed

R/check_exp.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ check_exp <- function(ec, ec_names) {
22
#' Prepare expected catch matrix
33
#'
44
#' Checks that specified expected catch matrices exists and is formatted correctly
5-
#' when \code{\link{make_model_design}} is called.
5+
#' when \code{make_model_design} is called.
66
#'
77
#' @param ec Expected catch list created by \code{\link{create_expectations}}.
88
#' @param ec_names The names of the expected catch matrices to include in the
99
#' model and how they are used (i.e. used together or separately). See the
10-
#' \code{expectcatchmodels} argument in \code{\link{make_model_design}}.
10+
#' \code{expectcatchmodels} argument in \code{make_model_design}.
1111
#' @returns Returns a list containing the filtered expected catch list and specified
1212
#' matrices to include in model.
1313
#' @details Checks that \code{ec_names} is specified properly by identifying

R/create_alternative_choice.R

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,26 +80,21 @@
8080
#' @md
8181
#' @details Defines the alternative fishing choices. These choices are used to develop
8282
#' the matrix of distances between observed and alternative fishing choices (where
83-
#' they could have fished but did not). The distance matrix is calculated by the
84-
#' [make_model_design()] function. `occasion` defines the observed fishing
83+
#' they could have fished but did not). `occasion` defines the observed fishing
8584
#' location and `alt_var` the alternative fishing location. `occasion_var`
8685
#' identifies an ID column or set of lon-lat variables needed to create the
8786
#' distance matrix.
8887
#'
89-
#' Parts of the alternative choice list are pulled by [create_expectations()],
90-
#' [make_model_design()], and the model run [discretefish_subroutine()])
91-
#' functions. These output include choices of which variable to use for catch and
88+
#' Parts of the alternative choice list are pulled by [create_expectations()]
89+
#' function. These output include choices of which variable to use for catch and
9290
#' which zones to include in analyses based on a minimum number of hauls per trip
9391
#' within a zone. Note that if the alternative choice list is modified, the
94-
#' [create_expectations()] and [make_model_design()] functions
95-
#' should also be updated before rerunning models.
92+
#' [create_expectations()] function should also be updated before rerunning models.
9693
#'
9794
#' @return Function saves a list of alternative choice matrices to the FishSET
9895
#' database as `projectAlternativeChoice`. The list includes
9996
#' the alternative choice list from the user-defined choices. Multiple alternative
100-
#' choice cases can be added to the list by specifying unique names. The list is
101-
#' automatically saved to the FishSET database and is called in
102-
#' `make_model_design`.
97+
#' choice cases can be added to the list by specifying unique names.
10398

10499
create_alternative_choice <- function(dat,
105100
project,

R/create_dist_matrix.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#' @importFrom stats setNames
2929
#' @export
3030
#' @keywords internal
31-
#' @details Function is called by \code{\link{make_model_design}} to generate the
31+
#' @details Function is called by \code{\link{format_model_data}} to generate the
3232
#' distance matrix. Alternative fishing options come from the Alternative Choice
3333
#' list, generated from the \code{\link{create_alternative_choice}} function.
3434
#' @return

R/create_expectations.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Create expected catch/expected revenue matrix
22
#'
33
#' Create expected catch or expected revenue matrix. The matrix is required for
4-
#' the \code{\link{logit_c}} model. Multiple matrices (with unique names) can be saved in a
4+
#' the conditional logit model. Multiple matrices (with unique names) can be saved in a
55
#' project.
66
#'
77
#' @param dat Primary data containing information on hauls or trips. Table in FishSET
@@ -55,11 +55,11 @@
5555
#' as \code{projectExpectedCatch}. The list includes
5656
#' the expected catch matrix from the user-defined choices. Multiple expected catch cases
5757
#' can be added to the list by specifying unique names. The list is automatically saved to
58-
#' the FishSET database and is called in \code{\link{make_model_design}}. The expected catch
58+
#' the FishSET database and is called in \code{\link{format_model_data}}. The expected catch
5959
#' output does not need to be loaded when defining or running the model.
6060
#' @details Function creates an expectation of catch or revenue for alternative
6161
#' fishing zones (zones where they could have fished but did not). The output is
62-
#' saved to the FishSET database and called by the \code{\link{make_model_design}}
62+
#' saved to the FishSET database and called by the \code{\link{format_model_data}}
6363
#' function. \code{\link{create_alternative_choice}} must be called first as observed
6464
#' catch and zone inclusion requirements are defined there.\cr
6565
#' The primary choices are whether to treat data as a fleet or to group the data

R/epm_lognormal.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ epm_lognormal <- function(starts3, dat, otherdat, alts, project, expname, mod.na
3030
#' @param expname Expected catch table (optional)
3131
#' @param mod.name Name of model run for model result output table
3232
#' @return ld: negative log likelihood
33-
#' @details This function is called in \code{\link{discretefish_subroutine}} when running an EPM model with
33+
#' @details This function is called in \code{discretefish_subroutine} when running an EPM model with
3434
#' a log-normal catch function.
3535
#' @export
3636

R/epm_normal.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ epm_normal <- function(starts3, dat, otherdat, alts, project, expname, mod.name)
2929
#' @param expname Expected catch table (optional)
3030
#' @param mod.name Name of model run for model result output table
3131
#' @return ld: negative log likelihood
32-
#' @details This function is called in \code{\link{discretefish_subroutine}} when running an EPM model with
32+
#' @details This function is called in \code{discretefish_subroutine} when running an EPM model with
3333
#' a normal catch function.
3434
#' @export
3535

R/epm_weibull.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ epm_weibull <- function(starts3, dat, otherdat, alts, project, expname, mod.name
3030
#' @param expname Expected catch table (optional)
3131
#' @param mod.name Name of model run for model result output table
3232
#' @return ld: negative log likelihood
33-
#' @details This function is called in \code{\link{discretefish_subroutine}} when running an EPM model with
33+
#' @details This function is called in \code{discretefish_subroutine} when running an EPM model with
3434
#' a Weibull catch function.
3535
#' @export
3636

R/format_grid.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#'
33
#' Change the format of a gridded dataset from wide to long (or vice versa)
44
#' and remove any unmatched area/zones from `grid`. This is a necessary step
5-
#' for including gridded variables in the conditional logit ([logit_c()]) model.
5+
#' for including gridded variables in the conditional logit model.
66
#'
77
#' @param grid Gridded dataset to format.
88
#' @param dat Primary data containing information on hauls or trips. Table in

R/globals.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,10 @@ utils::globalVariables(c(
4040
'within_haul_dist',
4141
'between_haul_dist',
4242
'as.formula',
43-
'final_dist'
43+
'final_dist',
44+
'X',
45+
'J_alts',
46+
'N_obs',
47+
'choice_idx',
48+
'modifyList'
4449
))

R/model_prediction.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#' @importFrom yaml read_yaml
1919
#' @importFrom DBI dbConnect dbDisconnect dbGetQuery
2020
#' @importFrom RSQLite SQLite
21-
#' @details Calls \code{\link{logit_predict}}, \code{\link{epm_predict}}, and
21+
#' @details Calls \code{logit_predict}, \code{epm_predict}, and
2222
#' \code{\link{predict_probability}}. Closure scenarios and TAC must be define using
2323
#' \code{\link{zone_closure}} function before function can be run.
2424
#' @export

0 commit comments

Comments
 (0)