Skip to content

Commit

Permalink
Split challenge 2 in two slides 20230926
Browse files Browse the repository at this point in the history
  • Loading branch information
damianooldoni committed Sep 25, 2023
1 parent 3de36e3 commit ce263ac
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions docs/sessions/20230926_functions_in_r.html
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
background-image: url({{ site.baseurl}}/assets/images/background_challenge_2.png)
class: left, top

# Challenge 2
# Challenge 2A

How does Dr Z proceed to write the following functions?

Expand All @@ -298,12 +298,21 @@
- `max_coord_uncertain`: maximum of `coordinateUncertaintyInMeters` (numeric), deafult value as in script.
- `issues_to_discard`: issues whose obs have to be filtered out (character vector), default value as in script.
- `occurrenceStatus_to_discard`: the `occurrenceStatus` values whose obs have to be filtered out (character vector), default value as in script.
2. `calc_grid_cell()`: function to return the input data.frame with an extra column containing the cell code (step 3). Allow users to specify different cell sizes (lat/lon). Default values as in script
3. `calc_n_obs_ind`: function to calculate the number of observations and individuals in each grid cell (step 4)
4. `plot_distr_cells()`: function to create a histogram showing the cells distribution for both number of observations and number of individuals (step 5). Allow the user to choose the histogram binwidth. Default value as in script. Notice also that there are other hardcoded values in title which should be transformed to variables.
2. `calc_grid_cell()`*: function to return the input data.frame with an extra column containing the cell code (step 3). Allow users to specify different cell sizes (lat/lon). Default values as in script.

<br>
<small> __\* Note__: `!!sym()` commando can help you to use the longitude/latitude colnames in the `mutate()`</small>
<small> __\* Note__: `!!sym()` commando can help you to pass the longitude/latitude column names as variables in the `mutate()`</small>

---
background-image: url({{ site.baseurl}}/assets/images/background_challenge_2.png)
class: left, top

# Challenge 2B

How does Dr Z proceed to write the following functions?

3. `calc_n_obs_ind`: function to calculate the number of observations and individuals in each grid cell (step 4)
4. `plot_distr_cells()`: function to create a histogram showing the cells distribution for both number of observations and number of individuals (step 5). Allow the user to choose the histogram binwidth. Default value as in script. Notice also that there are other hardcoded values in title. What is the best way to proceed?

---
class: left, top
Expand Down

0 comments on commit ce263ac

Please sign in to comment.