Skip to content

Commit

Permalink
Update Intro to R slides
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenErnst committed Oct 9, 2023
1 parent 75422e5 commit d3d3858
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 45 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
95 changes: 51 additions & 44 deletions Introduction to R/Intro_to_R.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@

<img src="GraphicsSlides/Logo RUG hell.png" width="50%" />

##### Authors/Presenters: Sven, Mathias
##### Last updated: _2022-09-29 10:37:20_
##### Authors: Sven, Mathias
##### Presenters: Sven, Ruben
##### Last updated: _2023-10-09 16:51:33_

---

Expand Down Expand Up @@ -78,6 +79,13 @@

<img src="GraphicsSlides/palmer.png" width="35%" />

---

### Resources

You can find these slides and additional resources on our website: https://rusergroup-sg.ch/resources

<img src="GraphicsSlides/rug_resources.png" width="100%" />

---

Expand Down Expand Up @@ -158,14 +166,14 @@
<br>
<br>

<img src="Intro_to_R_files/figure-html/unnamed-chunk-10-1.png" width="100%" />
<img src="Intro_to_R_files/figure-html/unnamed-chunk-11-1.png" width="100%" />
]
---

### Why should you learn R?

.pull-left[
<img src="Intro_to_R_files/figure-html/unnamed-chunk-11-1.png" width="100%" />
<img src="Intro_to_R_files/figure-html/unnamed-chunk-12-1.png" width="100%" />
]

.pull-right[
Expand Down Expand Up @@ -369,13 +377,13 @@

```
## # A tibble: 4 × 8
## species island bill_length_mm bill_depth_mm flipper_length_… body_mass_g sex
## <fct> <fct> <dbl> <dbl> <int> <int> <fct>
## 1 Adelie Torge… 39.1 18.7 181 3750 male
## 2 Adelie Torge… 39.5 17.4 186 3800 fema…
## 3 Adelie Torge… 40.3 18 195 3250 fema…
## 4 Adelie Torge… NA NA NA NA <NA>
## # … with 1 more variable: year <int>
## species island bill_length_mm bill_depth_mm flipper_length_mm body_mass_g
## <fct> <fct> <dbl> <dbl> <int> <int>
## 1 Adelie Torgersen 39.1 18.7 181 3750
## 2 Adelie Torgersen 39.5 17.4 186 3800
## 3 Adelie Torgersen 40.3 18 195 3250
## 4 Adelie Torgersen NA NA NA NA
## # ℹ 2 more variables: sex <fct>, year <int>
```

---
Expand Down Expand Up @@ -432,14 +440,14 @@

```
## # A tibble: 5 × 8
## species island bill_length_mm bill_depth_mm flipper_length_… body_mass_g sex
## <fct> <fct> <dbl> <dbl> <int> <int> <fct>
## 1 Adelie Biscoe 37.7 18.7 180 3600 male
## 2 Adelie Biscoe 38.2 18.1 185 3950 male
## 3 Adelie Biscoe 38.8 17.2 180 3800 male
## 4 Adelie Biscoe 40.6 18.6 183 3550 male
## 5 Adelie Biscoe 40.5 18.9 180 3950 male
## # … with 1 more variable: year <int>
## species island bill_length_mm bill_depth_mm flipper_length_mm body_mass_g
## <fct> <fct> <dbl> <dbl> <int> <int>
## 1 Adelie Biscoe 37.7 18.7 180 3600
## 2 Adelie Biscoe 38.2 18.1 185 3950
## 3 Adelie Biscoe 38.8 17.2 180 3800
## 4 Adelie Biscoe 40.6 18.6 183 3550
## 5 Adelie Biscoe 40.5 18.9 180 3950
## # ℹ 2 more variables: sex <fct>, year <int>
```

---
Expand Down Expand Up @@ -467,7 +475,7 @@
## 8 Torgersen
## 9 Torgersen
## 10 Torgersen
## # … with 334 more rows
## # 334 more rows
```

---
Expand All @@ -490,11 +498,12 @@
.pull-right[

```
## Error:
## Error in `[<-`:
## ! Assigned data `"Unknown"` must be compatible with existing data.
## ℹ Error occurred for column `island`.
## ✖ Can't convert from <character> to <factor<ccf33>> due to loss of generality.
## • Locations: 1.
## Caused by error in `vec_assign()`:
## ! Can't convert from <character> to <factor<ccf33>> due to loss of generality.
## • Locations: 1
```
]
---
Expand Down Expand Up @@ -547,12 +556,12 @@

```
## # A tibble: 3 × 8
## species island bill_length_mm bill_depth_mm flipper_length_… body_mass_g sex
## <fct> <chr> <dbl> <dbl> <int> <int> <fct>
## 1 Adelie Unkno… 39.5 16.7 178 3250 fema…
## 2 Adelie Unkno… 37.2 18.1 178 3900 male
## 3 Adelie Unkno… 39.5 17.8 188 3300 fema…
## # … with 1 more variable: year <int>
## species island bill_length_mm bill_depth_mm flipper_length_mm body_mass_g
## <fct> <chr> <dbl> <dbl> <int> <int>
## 1 Adelie Unknown 39.5 16.7 178 3250
## 2 Adelie Unknown 37.2 18.1 178 3900
## 3 Adelie Unknown 39.5 17.8 188 3300
## # ℹ 2 more variables: sex <fct>, year <int>
```

--
Expand Down Expand Up @@ -612,7 +621,8 @@
## 8 <NA> <NA> NA NA NA NA
## 9 Adelie Torgersen 38.6 21.2 191 3800
## 10 Adelie Torgersen 34.6 21.1 198 4400
## # … with 169 more rows, and 2 more variables: sex <fct>, year <int>
## # ℹ 169 more rows
## # ℹ 2 more variables: sex <fct>, year <int>
```
---

Expand Down Expand Up @@ -1012,7 +1022,8 @@
## 8 Adelie Biscoe 40.5 17.9 187 3200
## 9 Adelie Biscoe 37.9 18.6 172 3150
## 10 Adelie Biscoe 40.5 18.9 180 3950
## # … with 158 more rows, and 2 more variables: sex <fct>, year <int>
## # ℹ 158 more rows
## # ℹ 2 more variables: sex <fct>, year <int>
```

---
Expand Down Expand Up @@ -1142,12 +1153,8 @@
```

```
## [1] "as_tibble.data.frame"
## [2] "as_tibble.default"
## [3] "as_tibble.dribble"
## [4] "as_tibble.googlesheets4_schema_GridRange"
## [5] "as_tibble.googlesheets4_schema_NamedRange"
## [6] "as_tibble.googlesheets4_schema_ProtectedRange"
## [1] "as_tibble.data.frame" "as_tibble.default" "as_tibble.grouped_df"
## [4] "as_tibble.list" "as_tibble.matrix" "as_tibble.NULL"
```
]

Expand All @@ -1158,8 +1165,8 @@
```

```
## [1] "as.data.frame.resample" "as.data.frame.spec_tbl_df"
## [3] "as.data.frame.table" "as.data.frame.tbl_df"
## [1] "as.data.frame.table" "as.data.frame.tbl_df"
## [3] "as.data.frame.ts" "as.data.frame.vctrs_sclr"
```
[**Class Tibble Documentation**](https://tibble.tidyverse.org/reference/as_tibble.html)
]
Expand Down Expand Up @@ -1263,7 +1270,7 @@
plot(x = penguins$bill_length_mm, y = penguins$body_mass_g)
```

<img src="Intro_to_R_files/figure-html/unnamed-chunk-72-1.png" width="75%" />
<img src="Intro_to_R_files/figure-html/unnamed-chunk-73-1.png" width="75%" />

---

Expand All @@ -1276,7 +1283,7 @@
* col = "blue", lwd = 2, lty = 2)
```

<img src="Intro_to_R_files/figure-html/unnamed-chunk-73-1.png" width="75%" />
<img src="Intro_to_R_files/figure-html/unnamed-chunk-74-1.png" width="75%" />


---
Expand All @@ -1294,7 +1301,7 @@
col = "blue", lwd = 2, lty = 2)
```

<img src="Intro_to_R_files/figure-html/unnamed-chunk-74-1.png" width="75%" />
<img src="Intro_to_R_files/figure-html/unnamed-chunk-75-1.png" width="75%" />

---

Expand All @@ -1307,7 +1314,7 @@
col = "blue", lwd = 2, lty = 2)
```

<img src="Intro_to_R_files/figure-html/unnamed-chunk-75-1.png" width="75%" />
<img src="Intro_to_R_files/figure-html/unnamed-chunk-76-1.png" width="75%" />

---

Expand All @@ -1321,7 +1328,7 @@
geom_smooth(method = "lm", se = F, lty = 2)
```

<img src="Intro_to_R_files/figure-html/unnamed-chunk-76-1.png" width="90%" />
<img src="Intro_to_R_files/figure-html/unnamed-chunk-77-1.png" width="90%" />
---

# That's it for today!
Expand Down
12 changes: 11 additions & 1 deletion Introduction to R/Intro_to_R.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ library(rstudioapi)
knitr::include_graphics("GraphicsSlides/Logo RUG hell.png")
```

##### Authors/Presenters: Sven, Mathias
##### Authors: Sven, Mathias
##### Presenters: Sven, Ruben
##### Last updated: _`r Sys.time()`_

---
Expand Down Expand Up @@ -110,6 +111,15 @@ background-size: contain
knitr::include_graphics("GraphicsSlides/palmer.png")
```

---

### Resources

You can find these slides and additional resources on our website: https://rusergroup-sg.ch/resources

```{r, echo=FALSE, out.width="100%"}
knitr::include_graphics("GraphicsSlides/rug_resources.png")
```

---

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d3d3858

Please sign in to comment.