Skip to content

Commit

Permalink
Minor tweak of tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulRegular committed Jan 31, 2025
1 parent d2f1de2 commit a69755d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 0.1.6
Date: 2023-09-18 14:42:04 UTC
SHA: 28daf1f7c21db3a333d9752661e1771ca4d259bb
Date: 2023-09-18 20:13:26 UTC
SHA: d2f1de207dc4ba178aa883cc440cf0d1512289b9
1 change: 1 addition & 0 deletions SimSurvey.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: b80f9c1a-b225-47ef-bc29-3c521134f26c

RestoreWorkspace: Default
SaveWorkspace: Default
Expand Down
16 changes: 10 additions & 6 deletions tutorial/tutorial.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,12 @@ dat <- as_tibble(survey$setdet) %>%
## Make mesh and fit geostatistical model to survey data
mesh <- sdmTMB::make_mesh(dat, xy_cols = c("x", "y"), cutoff = 20)
fit <- sdmTMB(N ~ 0 + as.factor(year) + offset,
fit <- sdmTMB(N ~ 0 + as.factor(year),
offset = dat$offset,
mesh = mesh,
data = dat,
family = nbinom2(link = "log"), spde = mesh,
include_spatial = TRUE, time = "year")
family = nbinom2(link = "log"),
time = "year")
## Expand grid data for predictions
grid_dat <- as_tibble(select(survey$grid_xy, x, y, depth)) %>% distinct()
Expand Down Expand Up @@ -328,10 +330,12 @@ dat <- as_tibble(survey$setdet) %>%
## Make mesh and fit geostatistical model to survey data
mesh <- sdmTMB::make_mesh(dat, xy_cols = c("x", "y"), cutoff = 20)
fit <- sdmTMB(N ~ 0 + as.factor(year) + offset,
fit <- sdmTMB(N ~ 0 + as.factor(year),
offset = dat$offset,
mesh = mesh,
data = dat,
family = nbinom2(link = "log"), spde = mesh,
include_spatial = TRUE, time = "year")
family = nbinom2(link = "log"),
time = "year")
## Expand grid data for predictions
grid_dat <- as_tibble(select(survey$grid_xy, x, y, depth)) %>% distinct()
Expand Down

0 comments on commit a69755d

Please sign in to comment.