You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/chapters/chapter_05.md
+18-8Lines changed: 18 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,21 +4,31 @@ Now that you have been introduced to:
4
4
5
5
1. The importance of literate programming (LP)
6
6
2. Using markdown to narrate your code
7
-
3. Using Quarto to knit your code and narrative into a single LP document
7
+
3. Using Quarto to knit your code and narrative into a single LP-compliant document
8
8
9
+
It is time for a more comprehensive rounding-off exercise to bring it all together.
9
10
10
-
It is time to back to our original script (#81: do we need to introduce this earlier?) and rework it into a full fledged literate programming document by applying our knowledge of markdown and quarto
11
-
to transform the original script into an LP HTML or PDF document (Fig. 5.1).
11
+
12
+
!!! question "Exercise"
13
+
14
+
Return to our original example of [non-LP script](https://github.com/clement-lee/coderep/blob/master/wisconsin.R) (#81: do we need to introduce this in chapter?) and rework it into a full fledged literate programming
15
+
document by applying uour knowledge of markdown and quarto to transform the original script into an LP HTML or PDF document (Fig. 5.1).
16
+
17
+
Specifically:
18
+
19
+
1. Obtain the [Wisconsin.R](https://github.com/clement-lee/coderep/blob/master/wisconsin.R) script, copy the script into a new empty script in your RStudio environment
20
+
2. Convert the script into a .Qmd or .Rmd document, with explanatory text and code chunks for plain code and plots
21
+
3. Knit your final .Qmd or .Rmd file to a PDF (or HTML) document
22
+
23
+
??? success "Solution"
24
+
25
+
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](https://github.com/clement-lee/coderep/blob/master/wisconsin.Rmd)
12
26
13
27
<figure>
14
28
<imgsrc="../../assets/images/RtoQmdtoPDF.png"width="600"alt="Image showing path from .R to .Rmd to .pdf"/>
15
29
<figcaption> Figure 5.1 Going from the script (Winconsin.R) to a Qmd (or Rmd) file that can be knitted into a LP PDF or similar LP document. </figcaption>
16
30
</figure>
17
31
18
32
19
-
To complete this rounding off activity, you need to:
20
-
1. Obtain the [Wisconsin.R](https://github.com/clement-lee/coderep/blob/master/wisconsin.R) script, copy the script into a new empty script in your RStudio environment
21
-
2. Convert the script into a .Qmd or .Rmd document, complete with explanatory narrative and appropriate code chunks for plain code and plots
22
-
3. Knit your final .Qmd or .Rmd file to a PDF (or HTML) document and marvel and your wonderful LP-ified verison os the Wisconsin.R script
23
33
24
-
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](https://github.com/clement-lee/coderep/blob/master/wisconsin.Rmd)
0 commit comments