• Intro
  • New Quarto website
  • Edit website
  • Add new page
  • Add R code
  • Share using Netlify
  • Updating

On this page

  • Instructions

Task: Add R code to your website

Instructions

  • Insert a code chunk.
    • Use the green +C button or Ctrl+Alt+I/Cmd+Opt+I.
  • Add in R code, for example:
library(tidyverse)
library(palmerpenguins)

penguins %>% 
  ggplot(aes(species, flipper_length_mm, fill = sex, size = body_mass_g)) +
  geom_jitter(shape = 21, colour = "grey", alpha = 0.8) +
  scale_fill_viridis_d() +
  theme_bw()
  • Hide the R code and its warnings.
    • Search online for ‘quarto output options’ to copy the relevant YAML options.

    • Displaying code is referred to as ‘echo’.