Appendix B — :technologist: Exercise: Finish setting the dependencies

Warning

🚧 We are doing major changes to this workshop, so much of the content will be changed. 🚧

Time: ~10 minutes.

  1. While we added readr to the function, we haven’t added it to the DESCRIPTION file yet. In the Console, use usethis::use_package() to add the readr package to the DESCRIPTION file.

  2. There is one other function we use in the import_cgm() function. Find it, figure out what package it comes from, use :: to explicitly state the package, and add it to DESCRIPTION file using usethis::use_package() in the Console.

This is what the function should look like after using ::.

  1. There is one other package we’ve used that we haven’t added to the DESCRIPTION file. We used the package in the data-raw/dime.R file. Open that file, which you can do with Ctrl-. and typing “dime.R” and selecting the file from the menu. In that file, find the package we used and add it to the DESCRIPTION file using usethis::use_package() in the Console.

Run these in the Console to add the packages to the DESCRIPTION file.

Console
usethis::use_package("readr")
usethis::use_package("snakecase")
usethis::use_package("fs")
  1. Finally, style the code using the Palette (Ctrl-Shift-P, then type “style file”), render the docs/learning.qmd file with Ctrl-Shift-K or with the Palette (Ctrl-Shift-P, then type “render”) to test that everything still works, and then add and commit the changes to Git with Ctrl-Alt-M or with the Palette (Ctrl-Shift-P, then type “commit”).
Sticky/hat up!

When you’re ready to continue, place the sticky/paper hat on your computer to indicate this to the teacher 👒 🎩