knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  warning = FALSE,
  cache = TRUE
)

lockeutils

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Travis build status Coverage status

The goal of lockeutils is to provide some common tools to the Locke Data team.

Installation

remotes::install_github("lockedata/lockeutils")

And then re-start your R session.

At the first package loading, lockeutils should guide you to install fonts. We'll update instructions here based on your experience.

ggplot2 theme

library("ggplot2")
library("lockeutils")
df <- data.frame(
gp = factor(rep(letters[1:3], each = 10)),
y = rnorm(30)
)
ggplot(df, aes(gp, y)) +
  geom_point() +
  ggtitle("wow title LHS great",
          subtitle = "nice plot") +
  theme_ld()

colour scale

For no more than 3 classes.

ggplot(mtcars, aes(factor(cyl), fill = factor(vs))) +
geom_bar() +
theme_ld() +
scale_fill_ld()

ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
  geom_point() +
  theme_ld() +
   scale_color_ld()

ggplot(diamonds[diamonds$color %in% unique(diamonds$color)[1:6],]) + 
  geom_point(aes(x = carat, 
                 y = price, 
                 color = color)) +
  theme_ld() +
   scale_color_ld()

Colours on their own

lockeutils::get_ld_colours()

Contributing

Wanna report a bug or suggest a feature? Great stuff! For more information on how to contribute check out our contributing guide.

Please note that this R package is released with a Contributor Code of Conduct. By participating in this package project you agree to abide by its terms.



lockedata/lockeutils documentation built on May 23, 2019, 6:04 p.m.