Skip to content

Commit 835e629

Browse files
committed
use globalVariables to pass r-cmd-check when error given that there are undefined global variables; include devtools and here in description
1 parent 7adbfaa commit 835e629

File tree

6 files changed

+34
-1
lines changed

6 files changed

+34
-1
lines changed

DESCRIPTION

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ Suggests:
5151
flextable,
5252
terra,
5353
rmarkdown,
54-
tidyr
54+
tidyr,
55+
devtools,
56+
here
5557
VignetteBuilder:
5658
knitr
5759
VignetteDepends:

R/cleanup_by_species.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#'
1818
#' @importFrom dplyr filter bind_rows
1919
#' @importFrom purrr map2 map
20+
#' @importFrom utils globalVariables
2021
#'
2122
#' @examples
2223
#' catch <- surveyresamplr::noaa_nwfsc_catch
@@ -174,3 +175,14 @@ join_dfs <- function(list_of_dfs, main_df, shared_column) {
174175
})
175176
return(merged_dfs)
176177
}
178+
179+
# The following lines are used to declare global variables
180+
# to avoid "no visible binding for global variable" warnings in R CMD check.
181+
utils::globalVariables(
182+
c(
183+
"common_name",
184+
"trawlid",
185+
"latitude_dd",
186+
"depth_m"
187+
)
188+
)

R/plot_results.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,16 @@ plot_results <- function(srvy, dir_out, dir_final = NULL) {
215215

216216
return(out)
217217
}
218+
219+
# The following lines are used to declare global variables
220+
# to avoid "no visible binding for global variable" warnings in R CMD check.
221+
utils::globalVariables(
222+
c(
223+
"depth_m",
224+
"effort",
225+
"log_est",
226+
"se",
227+
"est",
228+
"year"
229+
)
230+
)

R/wrapper_sdmtmb.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ wrapper_sdmtmb <- function(x, y, z, dir_spp, spp_info, n_knots = 300) {
6060

6161
return(out)
6262
}
63+
64+
utils::globalVariables("fit")

R/wrapper_surveyIndex.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,5 @@ wrapper_surveyIndex <- function(x, y, z, dir_spp, spp_info, n_knots = 500) {
7878

7979
return(out)
8080
}
81+
82+
utils::globalVariables("fit")

R/wrapper_tinyVAST.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,5 @@ wrapper_tinyVAST <- function(x, y, z, dir_spp, spp_info, n_knots = 500) {
7878

7979
return(out)
8080
}
81+
82+
utils::globalVariables("fit")

0 commit comments

Comments
 (0)