r-raster-vector-geospatial icon indicating copy to clipboard operation
r-raster-vector-geospatial copied to clipboard

Required Packages by Episode

Open drakeasberry opened this issue 1 year ago • 1 comments

We have various ways of stating the required R packages that need to be loaded in order to run the code that follows. It ranges from assuming the person has not restarted their R session from a previous episode, to describing (partially at times) in paragraph text to explicitly stating which packages are needed inside and r code block.

Would it be beneficial to create a consistent format where all required packages are listed explicitly in the THINGS YOU’LL NEED TO COMPLETE THIS EPISODE callout at the beginning of each episode?

This would seem to prevent difficulties if someone does not begin with episode 1 and continue working in the same R session. It would also prevent issues such as those described in #356 and #365.

Potential Example:

**Required R Packages:**  
Make sure that you have these packages loaded before running code in this episode.
```{r load-libraries-2, eval=FALSE}
library(terra)
library(ggplot2)
library(dplyr)

drakeasberry avatar Mar 20 '23 23:03 drakeasberry

Hi, I think this is a good idea, this would ensure that each episode runs independently of any other and could help self-paced lerners. Anyway the whole lesson isn't using more than 4 or 5 packages (sf, terra, dplyr, & ggplot2). Cheers!

albhasan avatar Apr 22 '23 15:04 albhasan