The goal of lockeutils is to provide some common tools to the Locke Data team.
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.
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()
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()
lockeutils::get_ld_colours()
#> # A tibble: 7 x 2
#> colour_name colour_hex
#> <chr> <chr>
#> 1 blue #2165b6
#> 2 orange #e8830c
#> 3 teal #3cb4b8
#> 4 red #cf4729
#> 5 green #34ba17
#> 6 pink #c04aa9
#> 7 grey #4d4d4d
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.