class: center, middle ![:scale 30%](/assets/images/coding_club_logo_1.png) # 24 OCTOBER 2019 ## INBO coding club Herman Teirlinck
01.71 - Frans Breziers --- class: center, left ![:scale 100%](/assets/images/20191024/20191024_room_reservation_reminder.png) --- class: center, middle ![:scale 90%](/assets/images/20191024/20191024_badge_strings.png) --- class: center, middle ## Strings? ![:scale 50%](/assets/images/20191024/20191024_string-theory.gif) --- class: center, middle ## No! Strings... ![:scale 90%](/assets/images/20191024/20191024_strings_intro.png) --- class: center, middle ![:scale 90%](/assets/images/20191024/20191024_stringr_cheatsheet_preview.png) [Download pdf here](https://github.com/inbo/coding-club/blob/master/cheat_sheets/20180426_cheat_sheet_stringr.pdf) --- class: center, middle ### How to get started? Check the [Each session setup](https://inbo.github.io/coding-club/gettingstarted.html#each-session-setup) to get started. ### First time coding club? Check the [First time setup](https://inbo.github.io/coding-club/gettingstarted.html#first-time-setup) section to setup. --- class: center, middle ![:scale 100%](/assets/images/coding_club_sticky_concept.png) --- class: center, middle ### Share your code during the coding session! Go to https://hackmd.io/K_ba-lfbTmuuC1iYt5HT4A?both
--- class: left, middle ### Install the package suite Run `install.packages("tidyverse")` ### Load the package suite Run `library(tidyverse)` --- background-image: url(/assets/images/background_challenge_1.png) class: left, middle # Challenge 1 - Click [`20191024/20191024_species.csv`](https://github.com/inbo/coding-club/blob/master/data/20191024/20191024_species.csv) and download* data file to `/data` folder. - Click [`20191024/20191024_challenges.R`](https://github.com/inbo/coding-club/blob/master/src/20191024/20191024_challenges.R) and download* script in `/src` folder.
After reading data.frame `species_df`: - Set columns `species_id` and `taxa` lowercase - Make a vector of labels from column `species_id` and sort it alphabetically - Extract `species_id` labels longer than 2 letters
* __Note__: check the getting started instructions on [how to download a single file](https://inbo.github.io/coding-club/gettingstarted.html#each-session-setup)
--- background-image: url(/assets/images/background_challenge_2.png) class: left, middle # Challenge 2 - Add a new column called `canonicalName` made of `Genus` + `species` separated by a space. - Column `taxa` contains not only taxonomic information. A census label, `not censused`, is present sometimes, e.g. `"rodent-not censused"`. Remove every census label from column `taxa` (output example: `"rodent"`). --- class: left, middle ## Intermezzo:
reg
ular
ex
pressions
How to detect/remove/extract: - any kind of digit? - anything but letters `a `, `b` and `e`? - all full stops (`.`)? - any extra full stop (`.`)? ![:scale 40%](/assets/images/20191024/20191024_regular_expresssions.png)
Try yourself some of these rules before moving to challenge 3. .footnote[Also check out [regex101](https://regex101.com)] --- class: left, middle background-image: url(/assets/images/background_challenge_3.png) # Challenge 3 Column `authorship` is quite dirty: vertical pipes (`|`), `NA`, tabs, white spaces and punctuations (, ; .) occur at the end. Make a new column to store the cleaned version of it. --- class: left, middle # Bonus challenge - Click [`20191024/20191024_bird_observations.csv`](https://github.com/inbo/coding-club/blob/master/data/20191024/20191024_bird_observations.csv)* and download data file to `/data` folder. - We want to aggregate information about location from three different columns as follows: `PlaatsGemeente,PlaatsToponym:PlaatsToponymDetail`. - Try to do the same with file [20191024/20191024_bird_observations_with_na.csv](https://github.com/inbo/coding-club/blob/master/data/20191024/20191024_bird_observations_with_na.csv) where the three fields are not always filled.
* __Note__: check the getting started instructions on [how to download a single file](https://inbo.github.io/coding-club/gettingstarted.html#each-session-setup)
--- class: center, middle ![:scale 30%](/assets/images/coding_club_logo_1.png) Room: Herman Teirlinck - 01.16 - Rik Wouters
Date: __26/11/2019__, van 10:00 tot 12:00
Title: ggplot (part 1)
(registration announced via DG_useR@inbo.be)