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_04.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,8 +63,6 @@ Quarto documents bring together code, results, and narrative in a single file, e
63
63
2.**Quarto-formatted Text**: Narrative text follows Markdown syntax, allowing for straightforward formatting of headers, lists, links, and more. This makes your document both readable and versatile.
64
64
3.**R Code Chunks**: Enclosed by three backticks (```), code chunks can contain R code (or other supported languages) for executing within your document. These chunks can perform data analysis, visualize results, and more. You can directly copy and paste existing R scripts into these chunks, with Quarto handling the execution and integration of results into the final document.
65
65
66
-
Quarto's flexibility extends to supporting multiple programming languages within the same document, facilitating interdisciplinary collaboration and analysis.
67
-
68
66
**Example Code:**
69
67
70
68
```{r}
@@ -128,17 +126,18 @@ This header sets up the document with a title, an author, specifies that code ec
128
126
1. **Create Document**: In RStudio, use `File > New File > Quarto Document`.
3. **Set Output**: Ensure the YAML includes `format: html`.
131
-
4. **Render**: Click the "Render" button to produce your HTML document.Here are some potential problems we can think of (you may have similar):
129
+
4. **Render**: Click the "Render" button to produce your HTML document.
132
130
133
131
134
132
*Insert screenshots demonstrating each step for clarity.*
135
133
136
-
To do : *[Provide screenshots of the solution here]* or describe it
137
134
138
135
## 4.5 Writing Quarto Documents
139
136
140
137
### RStudio Visual Editor: Simplified Formatting
141
138
139
+
*Insert screenshots of visual editor.*
140
+
142
141
The RStudio Visual Editor offers a user-friendly approach to formatting Quarto documents, featuring a rich text interface similar to popular word processors. This guide will help you navigate the essential features of the Visual Editor to enhance your document creation process.
143
142
144
143
#### Activate Visual Mode
@@ -147,7 +146,7 @@ To access the Visual Editor, click the "Visual" option at the top-left corner of
147
146
148
147
#### Switch Between Modes
149
148
150
-
RStudio allows you to toggle between Source and Visual modes effortlessly, enabling you to work with the code directly or through the visual interface without losing your place. This flexibility ensures that you can enjoy the best of both worlds—direct code manipulation and simplified visual editing.
149
+
RStudio allows you to toggle between Source and Visual modes effortlessly, enabling you to work with the code directly or through the visual interface without losing your place.
151
150
152
151
### Writing Text
153
152
@@ -200,7 +199,8 @@ Images significantly enhance the visual appeal and clarity of documents. To inse
200
199
```markdown
201
200

202
201
```
203
-
**Browse and Insert**: Click on the image icon in the formatting bar, browse your computer to find the image file, and insert it into your Qmd document.
202
+
203
+
**Using visual editor**: Click on the image icon in the formatting bar, browse your computer to find the image file, and insert it into your Qmd document.
204
204
205
205
### Adding Links
206
206
@@ -321,27 +321,28 @@ When naming your code chunks, consider the following best practices:
321
321
-**Keep it Short and Simple**: While being descriptive, also try to be concise to keep the readability of the document high.
322
322
-**Use a Consistent Naming Scheme**: This could be based on the type of analysis, data being used, or the output being generated. Consistency helps in quickly understanding the role of different code chunks in your document.
323
323
324
-
### Example of Naming and Referencing Code Chunks
324
+
To name a code chunk in Quarto, you add a label. This helps you refer to the chunk later in your document. For example:
325
325
326
326
```markdown
327
327
#| label: data-summary
328
328
summary(cars)
329
329
```
330
+
This chunk is labeled data-summary, allowing you to mention it easily elsewhere.
330
331
331
-
In the narrative sections of your Quarto document, the ability to reference named code chunks can significantly enhance the clarity and coherence of your explanations. By directly linking to the results or analyses provided by specific chunks, you create a more interactive and connected document. This approach not only improves the flow of your document but also makes it easier for readers to follow your analytical journey.
332
+
**The Importance of Naming and Referencing Code Chunks**
333
+
Naming code chunks allows you to refer to them in your narrative sections, improving the clarity of your explanations. When you link directly to the results or analyses of specific chunks, your document becomes more connected and easier to navigate. This method improve the document's structure and guides readers through your analysis.
332
334
333
335
### Linking to Named Chunks in Your Narrative
334
-
335
-
When you want to mention or discuss the output of a code chunk within your narrative, you can refer to it by its label. This method allows you to seamlessly integrate your analytical findings with your textual explanations, making your document more dynamic and informative.
336
+
You can refer to a named code chunk in your narrative by its label. This integration helps in making your explanations more cohesive with your analytical findings.
336
337
337
338
### Example of Referencing a Named Chunk
338
339
339
-
Assume you have a code chunk labeled `plot-distribution` that generates a plot of data distribution. In your narrative, you could refer to this plot like so:
340
+
Suppose you have a code chunk named plot-distribution that generates a plot. You can reference this plot in your narrative like so:
340
341
341
342
```markdown
342
343
See the distribution of our data in the "plot-distribution" section below
343
344
```
344
-
This textual reference guides readers directly to the relevant analysis, enhancing the document's navigability.
345
+
This reference makes it easy for readers to find and understand the relevant analysis, improving the navigability of your document.
345
346
346
347
### Integrating a Bibliography in Quarto Documents
0 commit comments