git clone git@github.com:MikeLydeamore/solardash.gitETC5523: Communicating with Data
Tutorial 10
🎯 Objectives
- practice writing long-form documentation vignettes
- write functions and its documentation using
usethisandroxygen2 - convert your package documentation into a website with
pkgdown
Preparation
install.packages(c("pkgdown"))- Clone the github repo below:
Exercise 9A
Open the solardash project directory and create a new vignette via usethis.
The name of the vignette should be “crops” and the title will be “Our World in Data: Key Crop Yields”.
Your vignette should contain the following:
- A description of the data, including it’s source, and how to access it with your package.
- Two
ggplot2visualisations with short descriptions, giving examples of things you could learn from thesmartmeterdata. Remember that any external packages you use should be added to your DESCRIPTION file under Suggests.
Once you have finished your vignette, create a README file via usethis that describes the intent of the package and how you could install it from your github.
Exercise 9B
Build a local pkgdown website. Modify the pkgdown YAML file so your website has the following:
- a customised theme for the website
- the vignette is available via “Articles” link in the navbar
Exercise 9C
Inspect the inst directory. What do you see in there?
How is that code being used in the package?
Write a new shiny app, based on the one in inst, that converts the current ggplot to a plotly output. Then, write a new function for the package that will run this app.