Count Duckula

Count Duckula

defaults for all chunks set here. add css class of language_r to all source code chunks prism javascript and css library will use that class to do highlighting.

knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(eval = TRUE)
knitr::opts_chunk$set(class.source = c("language-r"))

Clone the repository https://github.com/adam-gruer/quack_quack.git

The following folders and files are required in your project in order for quack_quack.rmd to knit to html correctly:

 
your_project
|   quack_quack.rmd
|   
+---partials
|       header.html
|       
+---scripts
|       prism.js
|       
\---themes
        prism.css
   

Example quack_quack code.

chunks given the non-existent language quack_quack r markdown complains and doesn’t/can’t run the code but will print the code block!

When you have replaced the occurrences of some_dataset and column_name, your code will be ready to run, almost! Replace {quack_quack} with {r} and you are good to go.

library(ggplot2)

some_dataset %>%  
  ggplot(aes(x = column_name, y = column_name)) +
  geom_point() # Adds a scatterplot.

Example non quack_quack code

library(ggplot2)
library(magrittr)

boot::ducks %>%  
  ggplot(aes(x = plumage, y = behaviour)) +
  geom_point(aes(colour = plumage), size = 7, alpha = 0.7) + # Adds a scatterplot.
  geom_smooth( colour = "#005c47",method = "lm", se = FALSE) + #adds regression line
  labs(title = "If it looks like a duck",
     subtitle = "Behavioral and Plumage Characteristics of Hybrid Ducks",
     x = "Looks like: Mallard <-> Pintail",
     y = "Acts like: Mallard <-> Pintail")+
  theme_minimal() +
  scale_color_continuous(low = "#005c47", high = "#5f4433", guide = "none")