How to render a single qmd-file to html or pdf
Clicking Render in RStudio defaults to render all qmd files in the
directory (“project”) and to render both html and pdf. To save time in
rendering, you can install quarto
R package
install.packages("quarto")
library(quarto)
and then render just one file and choose the target to be html
with
quarto_render("template2.qmd", output_format = "html")
and when you are ready to submit the pdf, use
quarto_render("template2.qmd", output_format = "pdf")
quarto
R package is available as pre-installed in
JupyterHub (you may need to restart your server o get the new
image).
If the rendering to pdf doesn’t work, you can print the html to pdf
file, but do make sure to turn off “More setings -> Print headers and
footers” to avoid accidentally printing your identity.
How to use R and RStudio remotely
Option 1: Using R and RStudio via JupyterHub
Instead of installing RStudio on your computer, you can use it in
your web browser:
- Information
about Aalto JupyterHub
- Go to jupyter.cs.aalto.fi
- Choose
CS-E5710 - Bayesian Data Analysis (2023)
- In the Launcher click
RStudio
- In the RStudio Files pane (bottom right) you can create folders for
your work and upload files from your computer to the server
- The notebooks folder is the only persistent folder
(stays there if you sign out) so save everything to that folder!
- You may get an error when uploading a large zip file, but uploading
smaller zip files work. If you can’t upload demo zip file contact the
course staff via Zulip.
- You may access your data as a network drive by SMB mounting it on
your own computer - see Accessing
JupyterHub data. This allows you to have total control over your
data.
- After uploading files, use Files pane to open them (e.g. an
RMarkdown or Quarto notebook)
- Knitting of R, Rmd, and qmd files works as well (tested 24th
August)
- CmdStanR used later in the course has been tested to work 24th
August.
- To use CmdStanR:
library(cmdstanr)
- If you do not see the following output, please contact us on Zulip:
This is cmdstanr version 0.6.0
- CmdStanR documentation and vignettes: mc-stan.org/cmdstanr
- CmdStan path: /coursedata/cmdstan
- CmdStan version: 2.33.0
- There is a limited memory available (3Gib) and bigger models and
datasets can run out of memory with cryptic error message, but the demos
and assignment models should run (if not, then contact the course staff
via Zulip).
- See also Aalto
JupyterHub FAQ and bugs
Option 2: Use Aalto Linux via remote-desktop solution provided by
Aalto-IT.
- Information
about Aalto remote desktop
- Go to vdi.aalto.fi
- Download VMWare Horizon application or use the web portal
- If using the VMWare Horizon application, click on
New Server
and enter vdi.aalto.fi
- Enter your aalto username (aalto email works too) and password in
the respective fields.
- Select
Ubuntu 20.04
- Click Activities, start typing
RStudio
in the search
bar, and click RStudio
.
How to access the BDA R (and Python) demos on CS JupyterHub