knitr::opts_chunk$set(
  echo = TRUE,
  message = FALSE, 
  warning = FALSE
)

PWD Memo RMarkdown Template

This template is designed to create a standard memo template that fits with PWD styles. This style is likely better for shorter reports that are to be distributed throughout multiple groups within PWD. The goal of this template is to make it easy to create reports that integrate text and data without you having to worry about custom LaTeX to be able to make the report look like a memo.

This template includes two images, similar to the PWD Report tempalte. These images will be in the images/ subdirectory of the directory that contains the Rmarkdown file. The footer.png file is the same as the PWD Report Tempalte and is the footer that is included on all PWD documents. If you do not want to include this image in your memo, than you can set footer: false in the YAML of your report. The other image is a PWD logo. This is a logo without the commissioner's name, so that it can fit more easily in the header of the document.

There are several yaml options that will allow for users to easily change the look and feel of the memo. The default value, if specified, indicates the value that will be used if the given yaml parameter is not specified in your .Rmd document. If no default is shown, then the aregument is ignored if no value is given

This template also creates commands that can be used to create full-page landscape figures. You would implement it by doing the following:

\newpage \blandscape

knitr::include_graphics("images/logo.png")

\newpage \elandscape

The \blandscape function stands for "Begin Landscape" and starts the new page as a landscape rather than portrait. Likewise, the \elandscape function stands for "End Landscape" and ends the landscape on the next page.

Outside of the features mentioned above, all of the normal Rmarkdown features should be applicable to this theme as well. If you find any bugs, please file an issue at the Github repo

R content

The benefit of using Rmarkdown is that you can easily integrate your text and code into a single document which can then be easily rendered into a publication quality document. You can include R code by using "chunks" as follows:

library(ggplot2)
library(dplyr)
library(pwdthemes)
large_diamonds <- diamonds %>% 
  filter(carat > 2.2)

You can embed R figures directly into the document.

large_diamonds %>% 
  ggplot(aes(price, carat, color = cut)) + 
  geom_point() + 
  theme_bw() + 
  labs(
    title = "Diamond Carat vs Price",
    subtitle = "Only Diamonds with carat > 2.2 shown"
  ) + 
  scale_color_pwd("dark")

In addition to embedding R figures and code, you can also embed images in the document:

More

To see more ways to use Rmarkdwon and further capabilities, check out the Rmarkdown website and free online book



tbradley1013/pwdthemes documentation built on April 2, 2022, 1:34 a.m.