5. Putting it all together
5.1 Putting it all together
Now that you have been introduced to:
- The importance of literate programming (LP)
- Using markdown to narrate your code
- Using Quarto to knit your code and narrative into a single LP-compliant document
It is time for a more comprehensive rounding-off exercise to bring it all together.
Exercise
Return to our original example of non-LP script and rework it into a full fledged literate programming document by applying uour knowledge of markdown and quarto to transform the original script into an LP HTML or PDF document (Fig. 5.1). The script relies on the the Wiconsin Breast Cancer data set.
Specifically:
- Obtain the analysis.R script, copy the script into a new empty script in your RStudio environment
- Convert the script into a .Qmd or .Rmd document, with explanatory text and code chunks for plain code and plots
- Knit your final .Qmd or .Rmd file to a PDF (or HTML) document
Solution
There are no right or wrong answers here but certain solutions will definitely be better than others. if you get stuck or need inspiration check out one possible solution here