Assignment 12
In this assignment, I used R Markdown to create a document that combines written text, R code, and output in one place. R Markdown is useful because it allows for reproducible analysis, meaning the results automatically update whenever the code is changed. The introduction and narrative sections were written using Markdown, which is a simple formatting language that helps structure text clearly within the document. I also included both inline and displayed mathematical expressions using LaTeX. The inline expression ($\alpha + \beta = \gamma$) appears within a sentence, while the displayed equation ($y = mx + b$) is centered on its own line, demonstrating how R Markdown can present mathematical concepts effectively.
The Summary Statistics Code:
The first code chunk loads the built-in mtcars dataset and uses the summary() function to generate descriptive statistics. This includes values such as the minimum, maximum, mean, and median for each variable. The output is automatically displayed in the final document, which helps make the analysis easy to interpret.
The second code chunk creates a scatter plot showing the relationship between car weight and miles per gallon. Each point represents a car in the dataset. This visualization helps identify patterns, such as how fuel efficiency tends to decrease as vehicle weight increases. Using R Markdown was a helpful experience because it allows code and written explanations to exist in the same document. This makes the workflow more efficient and ensures that the results are reproducible. One challenge I faced was learning how to properly format code chunks and Markdown text, but it became easier with practice. Overall, R Markdown is a powerful tool for creating organized and reproducible reports. It simplifies the process of combining analysis and explanation, making it especially useful for data-driven projects.
.png)
.png)
Comments
Post a Comment