DSI-Typical Errors
teaching
R
DSI
Example of lesson script with discussion about typical errors
Note
During the class we (collaboratively with students) gather typical errors and discuss how to fix them.
Life cycle might be:
Screenshot set by student -> adding to the file -> discussing how to fix -> reviewing at the start of next lesson -> retrieving on random next lessons (or using the bot)
select(gc, bc) Error in select(gc, bc) : unused argument (bc)
- What happened? we use
select
fromMASS
package instead ofdplyr
- How to check:
?select
, see what package is first - How to fix?
dplyr::select
detach("package:dplyr", character.only = TRUE); library("dplyr", character.only = TRUE)
placement_clean |> + group_by(status, degree_t) |> + ``` Error: attempt to use zero-length variable name
- What happened? We have a pipe at the end of line, leading to nothing