Skip to content

Commit

Permalink
Update ggeffects in README
Browse files Browse the repository at this point in the history
  • Loading branch information
seananderson committed Jan 17, 2024
1 parent e34a785 commit 48fc547
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ spatial and spatiotemporal random fields. bioRxiv

A list of (known) publications that use sdmTMB can be found [here](https://github.com/pbs-assess/sdmTMB/wiki/Publications-using-sdmTMB). Please use the above citation so we can track publications.


## Related software

sdmTMB is heavily inspired by the [VAST](https://github.com/James-Thorson-NOAA/VAST) R package:
Expand Down Expand Up @@ -167,12 +166,14 @@ Run some basic sanity checks on our model:
sanity(fit)
```

Use the [ggeffects](https://github.com/strengejacke/ggeffects) package (**the GitHub version until the next ggeffects CRAN update**) to plot the smoother effect:
Use the [ggeffects](https://github.com/strengejacke/ggeffects) package to plot the smoother effect:

```{r plot-ggpredict-link, warning=FALSE, message=FALSE}
ggeffects::ggpredict(fit, "depth [50:400, by=2]") |> plot()
```

If the depth effect was parametric and not a penalized smoother, we could have alternatively used `ggeffects::ggeffect()` for a fast marginal effect plot.

Predict on new data:

```{r}
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,18 @@ sanity(fit)
```

Use the [ggeffects](https://github.com/strengejacke/ggeffects) package
(**the GitHub version until the next ggeffects CRAN update**) to plot
the smoother effect:
to plot the smoother effect:

``` r
ggeffects::ggpredict(fit, "depth [50:400, by=2]") |> plot()
```

<img src="man/figures/README-plot-ggpredict-link-1.png" width="50%" />

If the depth effect was parametric and not a penalized smoother, we
could have alternatively used `ggeffects::ggeffect()` for a fast
marginal effect plot.

Predict on new data:

``` r
Expand Down

0 comments on commit 48fc547

Please sign in to comment.