knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  fig.align = "center"
)

rphl

The rphl package contains R code for quickly creating figures using the City of Philadelphia's visual standards, including the color palette and typography.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("CityOfPhiladelphia/rphl")

In order to use the package, you will have to install Open Sans and Montserrat on your computer, and use the extrafont package to load the fonts into R:

# extrafont should install with rphl. If not, install from CRAN:
# install.packages("extrafont")
extrafont::font_import()

This step is only required once. Afterwards, rphl will automatically load the necessary fonts when attached with library(rphl).

Example

library(rphl)
library(ggplot2)
ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) +
  geom_point(size = 3) +
  scale_color_phl() +
  labs(title = "Plot of Iris data using City of Philadelphia Standards",
       x = "Sepal Width", y = "Sepal Length") +
  theme_phl(base_size = 14)


CityOfPhiladelphia/rphl documentation built on Oct. 30, 2019, 5:44 a.m.