knitr::opts_chunk$set(echo = TRUE, message = F, warning = F, dpi = 300) library(codehover) library(tidyverse)
ggplot(data = cars) + aes(x = speed) + aes(y = dist) + geom_point(color = 'darkslateblue', size = 4, alpha = .8) + theme_bw(base_size = 18) + scale_x_continuous(limits = c(0,25)) + geom_smooth() + labs(y = "stopping distance") + labs(title = 'A ggplot for the rest of us') + labs(subtitle = 'Explicitly showing the R workflow...') + theme(plot.title.position = "plot")
chunk_code_hover(chunk_name = "my_cars")
{css, echo = F}
.column {
float: left;
width: 50%;
padding: 10px;
background-color:white;
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.