Getting Started
Once you have followed all the steps for Installation and setup, you can start to create the Quarto document that you will be working in during the workshop.
1. Create an RStudio Project
- In RStudio, click File > New Project > Existing Directory.
- Browse to your folder
my-reproducible-manuscript
in which you have saved the workshop materials. - Check the Open in new session option.
- Click Create Project. This will create a
my-reproducible-manuscript.Rproj
file.
2. Document your project for reproducibility
Your project already contains pre-made folders, a README file and a License. Open the README.md
file and fill it with a few relevant details, for example:
- Purpose and contents of the project
- Your name (Author)
- The date of creation
- Etc.
3. Create a Quarto document for your manuscript.
- In RStudio, click File -> New File -> Quarto Document
- Give your document a title, such as
My Reproducible Manuscript
. - Add yourself as an author.
- For now, the default output format (HTML) and engine (knitr) are fine.
- Uncheck the Use visual markdown editor option.
- Click Create. A new Quarto document opens.
4. Render the Quarto document to HTML
- Save the Quarto document in the
docs
folder within themy-reproducible-manuscript
folder.
Give the file a clear name, without using spaces. For example,my-reproducible-manuscript.qmd
. - Once everything has been saved correctly, click the Render button in the menu bar.
- The rendered HTML copy of your document will appear in your web browser or alongside the editor in RStudio. You will also see a
my-reproducible-manuscript.html
file appear in thedocs
folder.
1. Open the my-reproducible-manuscript
folder in Visual Studio Code
In VS Code, click File > Open Folder… > my-reproducible-manuscript
> Select folder.
2. Document your project for reproducibility
Your project already contains pre-made folders, a README file and a License. Open the README.md
file and fill it with a few relevant details, for example:
- Purpose and contents of the project
- Your name (Author)
- The date of creation
- Etc.
3. Create a Quarto document for your manuscript.
- In the Command Palette of VS Code (usually at the top of the screen, looks like a search bar), type
> Quarto: New Document
. This will open up a new empty Quarto document. - Give your new document a Title, such as
My Reproducible Manuscript
. - Copy the following block of text and code into your Quarto document:
## Quarto
<https://quarto.org>.
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see
## Running Code
When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:
```{python}
1 + 1
```
You can add options to executable code like this
```{python}
#| echo: false
2 * 2
```
`echo: false` option disables the printing of code (only output is displayed). The
4. Render the Quarto document to HTML
- Save the Quarto document in the
docs
folder within themy-reproducible-manuscript
folder.
Give the file a clear name, without using spaces. For example,my-reproducible-manuscript.qmd
. - In VS Code, click Terminal -> Split Terminal
- In the newly created Terminal, run the following command:
quarto render my-reproducible-manuscript.qmd
The rendered HTML copy of your document will appear in your web browser or alongside the editor in VS Code. You will also see a my-reproducible-manuscript.html
file appear in the docs
folder.
1. Open the my-reproducible-manuscript
folder in Jupyter Lab
- Open Anaconda Navigator > Jupyter Lab.
- Start a clean environment: close running kernels and non-relevant files you have open.
- In the files section of Jupyter Lab, navigate to the location where you stored the
my-reproducible-manuscript
folder.
2. Document your project for reproducibility
Your project already contains pre-made folders, a README file and a License. Open the README.md
file and fill it with a few relevant details, for example:
- Purpose and contents of the project
- Your name (Author)
- The date of creation
- Etc.
3. Open the Jupyter Notebook
- Navigate to the
docs
folder. - Open the
my-reproducible-manuscript.ipynb
file. - Give your new document a Title, such as
My Reproducible Manuscript
and save your changes.
4. Render the Quarto document to HTML
- In Jupyter Lab, click File -> New -> Terminal
- Set the working directory to your project folder in the terminal, such as (use tab for autocompletion):
cd .\path\to\my-reproducible-manuscript\
- In the newly created Terminal, run the following command:
quarto render docs/my-reproducible-manuscript.ipynb
You will see a my-reproducible-manuscript.html
file appear in the docs
folder. Click on it to open it.