Skip to content

Commit b306a3e

Browse files
authored
Update Chapter_04.md
1 parent b09985c commit b306a3e

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

docs/chapters/Chapter_04.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ Quarto documents bring together code, results, and narrative in a single file, e
6363
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.
6464
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.
6565

66-
Quarto's flexibility extends to supporting multiple programming languages within the same document, facilitating interdisciplinary collaboration and analysis.
67-
6866
**Example Code:**
6967

7068
```{r}
@@ -128,17 +126,18 @@ This header sets up the document with a title, an author, specifies that code ec
128126
1. **Create Document**: In RStudio, use `File > New File > Quarto Document`.
129127
2. **Edit YAML Header**: Add `title: "Your Title"` and `author: "Your Name"`.
130128
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.
132130

133131

134132
*Insert screenshots demonstrating each step for clarity.*
135133

136-
To do : *[Provide screenshots of the solution here]* or describe it
137134
138135
## 4.5 Writing Quarto Documents
139136

140137
### RStudio Visual Editor: Simplified Formatting
141138

139+
*Insert screenshots of visual editor.*
140+
142141
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.
143142

144143
#### Activate Visual Mode
@@ -147,7 +146,7 @@ To access the Visual Editor, click the "Visual" option at the top-left corner of
147146

148147
#### Switch Between Modes
149148

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.
151150

152151
### Writing Text
153152

@@ -200,7 +199,8 @@ Images significantly enhance the visual appeal and clarity of documents. To inse
200199
```markdown
201200
![Alt text for the image](path/to/image.png "Optional title")
202201
```
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.
204204

205205
### Adding Links
206206

@@ -321,27 +321,28 @@ When naming your code chunks, consider the following best practices:
321321
- **Keep it Short and Simple**: While being descriptive, also try to be concise to keep the readability of the document high.
322322
- **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.
323323

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:
325325

326326
```markdown
327327
#| label: data-summary
328328
summary(cars)
329329
```
330+
This chunk is labeled data-summary, allowing you to mention it easily elsewhere.
330331

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.
332334

333335
### 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.
336337

337338
### Example of Referencing a Named Chunk
338339

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:
340341

341342
```markdown
342343
See the distribution of our data in the "plot-distribution" section below
343344
```
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.
345346

346347
### Integrating a Bibliography in Quarto Documents
347348

0 commit comments

Comments
 (0)