Lifecycle: experimental CRAN status Travis build status Codecov test coverage Downloads

The goal of gluedown is to ease the transition from R’s powerful vectors to formatted markdown text. The package uses glue() to wrap character vectors in markdown syntax. With the knitr package, users can print the formatted vectors directly to the body of a markdown document.


Install the release version from CRAN:


Install the development version from GitHub:



Use the results='asis' chunk option to print the formatted output to the body of a document.

  1. Legislative
  2. Executive
  3. Judicial


Printing vectors as markdown lists was the initial inspiration for the package. Here, we use five different functions to create five elements of a new vector.

Then we can print that new vector as a list, including the inline formatting.

  • Alabama
  • Alaska
  • Arizona
  • Arkansas
  • California


You can also use gluedown to format R inline code results.

In this case, our randomly selected state is Utah, which has the abbreviation UT.


All functions are designed to fit within the tidyverse ecosystem and work with pipes.

read_html("") %>% 
  html_node("blockquote") %>% 
  html_text(trim = TRUE) %>% 
  str_remove("\\[.*\\]") %>% 

We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America.


The package primarily uses GitHub Flavored Markdown, with support for useful extensions like task lists.

legislation <- c("Houses passes", "Senate concurs", "President signs")
md_task(legislation, check = 1:2)
  • [x] Houses passes
  • [x] Senate concurs
  • [ ] President signs


Please note that the gluedown project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.