R Markdown Template

Author
Affiliation

University of State

Published

September 1, 2025

R environment (renv)

Using renv while writing your tutorial will ensure that when a LingMethodsHub maintainer renders your tutorial, all of the necessary packages will be installed. Even if you’ve already been working on the tutorial, you can start using renv like so:

renv::init()
renv::snapshot()

This will create an renv/ directory, and an renv.lock file. You should add renv.lock to git.

Once you’ve run through all of the code for your tutorial again, just run renv::snapshot() one more time before you push your final commit.

Sample R Markdown Template

renv::use(lockfile = "renv.lock")
Installing bit [4.0.4] ...
    OK [linked cache]
Installing rlang [1.0.4] ...
    OK [linked cache]
Installing lifecycle [1.0.1] ...
    OK [linked cache]
Installing cli [3.3.0] ...
    OK [linked cache]
Installing vctrs [0.4.1] ...
    OK [linked cache]
Installing pillar [1.8.0] ...
    OK [linked cache]
Installing purrr [0.3.4] ...
    OK [linked cache]
Installing tidyselect [1.1.2] ...
    OK [linked cache]
Installing dplyr [1.0.9] ...
    OK [linked cache]
Installing stringr [1.4.0] ...
    OK [linked cache]
Installing cpp11 [0.4.2] ...
    OK [linked cache]
Installing tidyr [1.2.0] ...
    OK [linked cache]
Installing digest [0.6.29] ...
    OK [linked cache]
Installing gtable [0.3.0] ...
    OK [linked cache]
Installing isoband [0.2.5] ...
    OK [linked cache]
Installing Matrix [1.4-1] ...
    OK [linked cache]
Installing viridisLite [0.4.0] ...
    OK [linked cache]
Installing scales [1.2.0] ...
    OK [linked cache]
Installing ggplot2 [3.3.6] ...
    OK [linked cache]
Installing broom [1.0.0] ...
    OK [linked cache]
Installing ps [1.7.1] ...
    OK [linked cache]
Installing processx [3.7.0] ...
    OK [linked cache]
Installing callr [3.7.0] ...
    OK [linked cache]
Installing crayon [1.5.1] ...
    OK [linked cache]
Installing curl [4.3.2] ...
    OK [linked cache]
Installing data.table [1.14.2] ...
    OK [linked cache]
Installing dtplyr [1.2.1] ...
    OK [linked cache]
Installing evaluate [0.15] ...
    OK [linked cache]
Installing forcats [0.5.1] ...
    OK [linked cache]
Installing jsonlite [1.8.0] ...
    OK [linked cache]
Installing sys [3.4] ...
    OK [linked cache]
Installing openssl [2.0.2] ...
    OK [linked cache]
Installing httr [1.4.3] ...
    OK [linked cache]
Installing rstudioapi [0.13] ...
    OK [linked cache]
Installing gargle [1.2.0] ...
    OK [linked cache]
Installing googlesheets4 [1.0.0] ...
    OK [linked cache]
Installing hms [1.1.1] ...
    OK [linked cache]
Installing vroom [1.5.7] ...
    OK [linked cache]
Installing readr [2.1.2] ...
    OK [linked cache]
Installing haven [2.5.0] ...
    OK [linked cache]
Installing htmltools [0.5.3] ...
    OK [linked cache]
Installing xfun [0.31] ...
    OK [linked cache]
Installing yaml [2.3.5] ...
    OK [linked cache]
Installing knitr [1.39] ...
    OK [linked cache]
Installing lubridate [1.8.0] ...
    OK [linked cache]
Installing modelr [0.1.8] ...
    OK [linked cache]
Installing png [0.1-7] ...
    OK [linked cache]
Installing RcppTOML [0.1.7] ...
    OK [linked cache]
Installing readxl [1.4.0] ...
    OK [linked cache]
Installing renv [0.15.5] ...
    OK [linked cache]
Installing tinytex [0.40] ...
    OK [linked cache]
Installing rmarkdown [2.14] ...
    OK [linked cache]
Installing reprex [2.0.1] ...
    OK [linked cache]
Installing reticulate [1.25] ...
    OK [linked cache]
Installing rvest [1.0.2] ...
    OK [linked cache]
Installing tidyverse [1.3.1] ...
    OK [linked cache]
library(tidyverse)
library(palmerpenguins)
library(showtext)
library(khroma)
font_add_google("Atkinson Hyperlegible", "atkinson")
showtext_auto()
palmerpenguins::penguins %>%
  ggplot(aes(flipper_length_mm, body_mass_g, color = species))+
    geom_point()+
    scale_color_bright()+
    theme_minimal()+
    theme(text = element_text(family = "atkinson"))
Warning: Removed 2 rows containing missing values (geom_point).

00_rmarkdown_template.pdf

Reuse

CC-BY-SA 4.0

Citation

BibTeX citation:
@online{doe2025,
  author = {Doe, Robin},
  title = {R {Markdown} {Template}},
  series = {Linguistics Methods Hub},
  date = {2025-09-01},
  url = {https://lingmethodshub.github.io/content/contributing/template/00_rmarkdown_template.html},
  langid = {en}
}
For attribution, please cite this work as:
Doe, Robin. 2025, September 1. R Markdown Template. Linguistics Methods Hub. (https://lingmethodshub.github.io/content/contributing/template/00_rmarkdown_template.html).