Your first report in 3 min.
Now that we understand what a data analytics report is, let's build one using Quarto!
I'm confident you can do this in less than 3 minutes 🔥
1️⃣ Open R Studio
R Studio is an IDE (Integrated Development Environment) for R.
You should have it installed already. But just in case, it is available here otherwise.
2️⃣ Install required packages
The rmarkdown
library is required to render a quarto file. To install it, simply use install.packages("rmarkdown")
in the console.
3️⃣ Create a quarto file
In R Studio, click File
→ New File
→ Quarto Document...
A window opens. Give a random title like Test Doc
and click Create
. Ignore the rest for now! This title will be written in big at the top of the report.
You just created your first quarto document 🎉. For now it is just a file with a .qmd
extension.
4️⃣ Save the file
Click File
→ Save
(or use the shortcut cmd
+ s
) to save the file.
Call the file test.qmd
, and save it wherever you want on your computer. (but remember where 🙃!)
That's it, we have our first quarto doc on our machine. Note that this file must have the .qmd
extension!
Take a very quick look at the doc. There is a header, some text and some R code. The R code is minimal (1 + 1
) for now.
5️⃣ Render the document
Click the Render
button and the magick happens. An engine will read your text, execute your R code, and build an HTML document with all of that!
Your browser should open the .html
output in a new tab. You are reading your first Quarto output! 👏
Locate your test.qmd
file; you'll also find test.html
, the rendered output of test.qmd
. Avoid editing test.html
directly—always update test.qmd
and re-render for changes.
Now read the document carefully and try to understand what each part of the .qmd
doc became in the .html
.
Homework
It's time to transform our analysis.R
file in a Quarto document! 🔥
Penguin Analysis
. Save the document as analysis.qmd
in the R folder of our work project.Replace the current text of the quarto document. Explain briefly what we are doing in our penguin analysis!
Replace the current R code (1 + 1
) with the code we have in our analysis.R
file.
Click Render
to build the report and get an HTML file. Remove the analysis.R
file, we won't need it anymore!