This tutorial will get you started with writing Quarto Documents and Presentations using RStudio
Pre-requisites
- A Personal Computer.
- RStudio Desktop
- Familiarity with Word Processors.1
Creating a New Document
- Open RStudio Desktop on the Computer.
- In the File menu, select New File > Quarto Document.
- In the New Quarto Document dialog box, provide the Title and Author name of the Document. Let HTML be the output format, and toggle ON the Use visual markdown editor option.
- A new Quarto Document would be created, save it by clicking the Save button in RStudio toolbar2.
Composition
- Click the Render button in the Document toolbar, a preview webpage of the document would be displayed and refreshed.
- The beginning of the file would contain the Document and HTML format metadata such as Title, Author, Date, CSS theme, etc.
- In the document body, you may begin writing and format it afterwards.
- To format some text, select it. Click the desired formatting in the Document toolbar such as Bold3, Italic4, Underline,
Code
5 etc. - To set a line to be a heading/subheading, select it wholly and click Block Format > Header # in the Document Toolbar.
Code
To embed Code cell/chunk in the Document, navigate to a new line.
Select Insert > Executable Cell > language in the Document toolbar.
A blank code cell would be created, any code written inside would be run during Document render.
The code along with the output produced would displayed in the document. For example:
```{r} = 100000 n = runif(n) u1 = runif(n) u2 = sqrt(-2*log(u1)) * cos(2 * pi * u2) z1 = sqrt(-2*log(u1)) * sin(2 * pi * u2) z2 plot(density(c(z1, z2))) ```
Miscellaneous Tips
Insert/create tables using the Table Document toolbar item.
Embed links by selecting the hypertext and clicking the Link..6 button in toolbar. Provide the URL to open if the hypertext is clicked.
Latex content may be inserted via the Insert > Latex Math option.