VSCode & Quarto Setup, Current Status and Questions

R
Shiny
Quarto
Author

Jihong Zhang

Published

June 10, 2025

1 Basic workflow

  1. VSCode Docs - Language R
  2. quarto Docs - VSCode tutorial

1.1 Render the .qmd

To render and preview, execute the Quarto: Preview command. You can alternatively use the Cmd+Shift+K keyboard shortcut.

1.2 Running Cells

Use cmd+shift+i to create new code cell.

```{r}
#| eval: true
theta = 3 * 4
beta = theta + 2
print(beta)
```
[1] 14
```{python}
#| label: fig-polar
#| fig-cap: "A line plot on a polar axis"

import numpy as np
import matplotlib.pyplot as plt

r = np.arange(0, 2, 0.01)
theta = 2 * np.pi * r
fig, ax = plt.subplots(
  subplot_kw = {'projection': 'polar'} 
)
ax.plot(theta, r)
ax.set_rticks([0.5, 1, 1.5, 2])
ax.grid(True)
plt.show()
```
Figure 1: A line plot on a polar axis

1.3 Visual Editing in VS Code

Similar to RStudio, use the ⇧⌘ F4 keyboard shortcut to switch to Visual Editing Mode.

1.4 Execution Option

Do not use jupyter: python3. Instead, leave it blank to execute both R and Python and output.

2 Radian terminal on VSCode

  1. Blog - R and radian on macOS and VSCode
  2. radian GitHub
Back to top