README.md

inkyr

R-CMD-check

This is an R package with basic functionality for generating output for the inky impression.

Installation

You can install the development version with:

remotes::install_github('alexwhan/inkyr')

Using a ggplot inky scale

Here’s a simple use of the inky palette for ggplot.

library(inkyr)
library(ggplot2)

set.seed(123)
df <- expand.grid(x = 1:19, y = 1:16)
df$hex <- sample(factor(1:7), nrow(df), replace = TRUE)

p <- ggplot(df, aes(x, y)) +
  geom_tile(aes(fill = hex)) +
  scale_fill_inky(guide = FALSE) +
  theme_void() +
  coord_cartesian(expand = FALSE)

p

And to export for the impression:

inkysave(p, "filename.jpg")

Generating an example gradient

The inky_2d_fig function lets you can define four colours, and builds gradients between for inky output.

p <- inky_2d_fig(inky_colours()[3:6])

p



alexwhan/inkyr documentation built on Jan. 26, 2021, 12:28 a.m.