Skip to content

Commit e37cb0d

Browse files
author
e-perl-NOAA
committed
define replicate_df as coming from sdmTMB; include devtools and here in vignettes that use them
1 parent ff8a36a commit e37cb0d

File tree

6 files changed

+19
-14
lines changed

6 files changed

+19
-14
lines changed

R/clean_and_resample.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#' dir_out <- here::here("vignettes", "output")
4242
#' catch <- surveyresamplr::noaa_nwfsc_catch
4343
#' bio <- surveyresamplr::noaa_nwfsc_bio
44-
#' grid_yrs <- replicate_df(
44+
#' grid_yrs <- sdmTMB::replicate_df(
4545
#' dat = surveyresamplr::noaa_nwfsc_catch, time_name = "year",
4646
#' time_values = unique(catch$year)
4747
#' )

inst/r/run.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ pred_grid <- california_current_grid |> # rename x and y cols
326326
area_km2 = area_km2_WCGBTS
327327
) |>
328328
dplyr::mutate(srvy = "CA")
329-
grid_yrs <- replicate_df(pred_grid, "year", unique(catch$year))
329+
grid_yrs <- sdmTMB::replicate_df(pred_grid, "year", unique(catch$year))
330330

331331
### Variables ------------------------------------------------------------------
332332

@@ -555,7 +555,7 @@ catch <- noaa_afsc_catch |> dplyr::filter(srvy == "NBS")
555555
### Load grid data -------------------------------------------------------------
556556

557557
load(paste0(wd, "grids/noaa_afsc_nbs_pred_grid_depth.rdata"), verbose = TRUE)
558-
grid_yrs <- replicate_df(pred_grid_depth, "year", unique(catch$year))
558+
grid_yrs <- sdmTMB::replicate_df(pred_grid_depth, "year", unique(catch$year))
559559

560560
### Variables ------------------------------------------------------------------
561561

@@ -781,7 +781,7 @@ catch <- noaa_afsc_catch |> dplyr::filter(srvy == "GOA")
781781
### Load grid data -------------------------------------------------------------
782782

783783
load(paste0(wd, "grids/noaa_afsc_goa_pred_grid_depth.rdata"), verbose = TRUE)
784-
grid_yrs <- replicate_df(pred_grid_depth, "year", unique(catch$year))
784+
grid_yrs <- sdmTMB::replicate_df(pred_grid_depth, "year", unique(catch$year))
785785

786786
### Variables ------------------------------------------------------------------
787787

@@ -861,7 +861,7 @@ catch <- noaa_afsc_catch |> dplyr::filter(srvy == "AI")
861861
### Load grid data -------------------------------------------------------------
862862

863863
load(paste0(wd, "grids/noaa_afsc_ai_pred_grid_depth.rdata"), verbose = TRUE)
864-
grid_yrs <- replicate_df(pred_grid_depth, "year", unique(catch$year))
864+
grid_yrs <- sdmTMB::replicate_df(pred_grid_depth, "year", unique(catch$year))
865865

866866
### Variables ------------------------------------------------------------------
867867

@@ -963,7 +963,7 @@ catch <- noaa_nefsc_catch |> dplyr::filter(srvy == "SPRING")
963963
### Load grid data -------------------------------------------------------------
964964

965965
load(paste0(wd, "grids/noaa_nefsc_nwa_pred_grid_depth.rdata"), verbose = TRUE)
966-
grid_yrs <- replicate_df(pred_grid_depth, "year", unique(catch$year))
966+
grid_yrs <- sdmTMB::replicate_df(pred_grid_depth, "year", unique(catch$year))
967967

968968
### Variables ------------------------------------------------------------------
969969

@@ -1066,7 +1066,7 @@ catch <- noaa_nefsc_catch |> dplyr::filter(srvy == "FALL")
10661066
### Load grid data -------------------------------------------------------------
10671067

10681068
load(paste0(wd, "grids/noaa_nefsc_nwa_pred_grid_depth.rdata"), verbose = TRUE)
1069-
grid_yrs <- replicate_df(pred_grid_depth, "year", unique(catch$year))
1069+
grid_yrs <- sdmTMB::replicate_df(pred_grid_depth, "year", unique(catch$year))
10701070

10711071
### Variables ------------------------------------------------------------------
10721072

vignettes/afsc-ebs.Rmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ options(future.globals.maxSize = 1 * 1024^4) # Allow up to 1 TB for globals
2323
# Here we list all the packages we will need for this whole process
2424
# We'll also use this in our works cited page.
2525
PKG <- c(
26+
"devtools",
27+
"here",
2628
"surveyresamplr",
2729
"dplyr",
2830
"tidyr",

vignettes/afsc-goa.Rmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ PKG <- c(
2828
"tidyr",
2929
"purrr",
3030
"ggplot2",
31-
"flextable"
31+
"flextable",
32+
"sdmTMB"
3233
)
3334
3435
pkg_install <- function(p) {
@@ -84,7 +85,7 @@ catch <- surveyresamplr::noaa_afsc_catch |>
8485
8586
### Load grid data -------------------------------------------------------------
8687
87-
grid_yrs <- replicate_df(surveyresamplr::noaa_afsc_goa_pred_grid_depth, "year",
88+
grid_yrs <- sdmTMB::replicate_df(surveyresamplr::noaa_afsc_goa_pred_grid_depth, "year",
8889
unique(catch$year))
8990
9091
### Variables ------------------------------------------------------------------

vignettes/afsc-nbs.Rmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ PKG <- c(
2828
"tidyr",
2929
"purrr",
3030
"ggplot2",
31-
"flextable"
31+
"flextable",
32+
"sdmTMB"
3233
)
3334
3435
pkg_install <- function(p) {
@@ -87,7 +88,7 @@ catch <- surveyresamplr::noaa_afsc_catch |>
8788
8889
### Load grid data -------------------------------------------------------------
8990
90-
grid_yrs <- replicate_df(surveyresamplr::noaa_afsc_nbs_pred_grid_depth, "year",
91+
grid_yrs <- sdmTMB::replicate_df(surveyresamplr::noaa_afsc_nbs_pred_grid_depth, "year",
9192
unique(catch$year))
9293
9394
### Variables ------------------------------------------------------------------

vignettes/nefsc.Rmd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ PKG <- c(
2929
"tidyr",
3030
"purrr",
3131
"ggplot2",
32-
"flextable"
32+
"flextable",
33+
"sdmTMB"
3334
)
3435
3536
pkg_install <- function(p) {
@@ -105,7 +106,7 @@ catch <- surveyresamplr::noaa_nefsc_catch |> dplyr::filter(srvy == "SPRING")
105106
106107
### Load grid data -------------------------------------------------------------
107108
108-
grid_yrs <- replicate_df(surveyresamplr::noaa_nefsc_pred_grid_depth, "year",
109+
grid_yrs <- sdmTMB::replicate_df(surveyresamplr::noaa_nefsc_pred_grid_depth, "year",
109110
unique(catch$year))
110111
111112
### Variables ------------------------------------------------------------------
@@ -188,7 +189,7 @@ catch <- surveyresamplr::noaa_nefsc_catch |> dplyr::filter(srvy == "FALL")
188189
189190
### Load grid data -------------------------------------------------------------
190191
191-
grid_yrs <- replicate_df(surveyresamplr::noaa_nefsc_pred_grid_depth, "year",
192+
grid_yrs <- sdmTMB::replicate_df(surveyresamplr::noaa_nefsc_pred_grid_depth, "year",
192193
unique(catch$year))
193194
194195
### Variables ------------------------------------------------------------------

0 commit comments

Comments
 (0)