lockedata / lockeutils

Utils R package for the Locke Data team :art: :chart:
Other
1 stars 0 forks source link

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()
#> # 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

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.