Skip to content

Commit

Permalink
add more webr exercises
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakillo committed Nov 21, 2024
1 parent 29347a3 commit 96578f1
Show file tree
Hide file tree
Showing 75 changed files with 27,977 additions and 93 deletions.
2,229 changes: 2,229 additions & 0 deletions docs/ex_moths.html

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions docs/ex_moths.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: "Exercise: moths"
author: "Francisco Rodríguez-Sánchez"
engine: knitr
format: html
toc: true
filters:
- webr
webr:
packages: ['visreg', 'easystats', 'patchwork', 'emmeans']
autoload-packages: true
channel-type: "post-message"
---

## Load dataset

```{webr-r}
download.file("https://raw.githubusercontent.com/Pakillo/LM-GLM-GLMM-intro/trees/data/moth.csv",
destfile = "moth.csv", mode = "wb")
moths <- read.csv("moth.csv")
head(moths)
```


## Visualise data

```{webr-r}
plot()
```


## Fit model

How does moth survival depend on light/dark morph and distance to city centre (pollution gradient)?

```{webr-r}
model <- glm()
summary(model)
```


## Visualise model

```{webr-r}
library(visreg)
visreg(model)
```


## Check model

```{webr-r}
library(easystats)
check_model(model)
```


2,078 changes: 2,078 additions & 0 deletions docs/ex_moths_files/libs/bootstrap/bootstrap-icons.css

Large diffs are not rendered by default.

Binary file not shown.
12 changes: 12 additions & 0 deletions docs/ex_moths_files/libs/bootstrap/bootstrap.min.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions docs/ex_moths_files/libs/bootstrap/bootstrap.min.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions docs/ex_moths_files/libs/clipboard/clipboard.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions docs/ex_moths_files/libs/quarto-html/anchor.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions docs/ex_moths_files/libs/quarto-html/popper.min.js

Large diffs are not rendered by default.

205 changes: 205 additions & 0 deletions docs/ex_moths_files/libs/quarto-html/quarto-syntax-highlighting.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 96578f1

Please sign in to comment.