Created
April 21, 2020 13:17
-
-
Save jnolis/aad7879f235d44fe840895b7e977e435 to your computer and use it in GitHub Desktop.
Layout a grid of figures in an RMarkdown file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Side-by-side images" | |
author: "Jacqueline Nolis" | |
date: "4/21/2020" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
``` | |
```{r} | |
library(ggplot2) | |
``` | |
```{r example, results="asis"} | |
cat("<div class=\"row\">") | |
for(i in 1:12){ | |
cat("<div class=\"col-xs-4\">") | |
plot <- ggplot(cars,aes(x=speed,y=dist))+geom_point(position=position_jitter()) | |
print(plot) | |
cat("</div>") | |
} | |
cat("</div>") | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment