knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of ishihara is to create an Ishihara test, which can help assess colourblindness.
There are a few implementations of this test around the web, but I haven't seen one that worked for R, so here is my crack at implementing it.
Note that this is a work in progress, don't use it for proper testing.
The development version from GitHub with:
# install.packages("devtools") devtools::install_github("njtierney/ishihara")
I had an idea on how I could maybe create this kind of figure in R, using spatial tools. The general process is:
packcircles
gridfont
library(ishihara) ## basic example code library(ggplot2)
I'm still working through the details of the implementation and usability, but the general idea is to create something like this:
set.seed(2020-05-10) cb_1 <- ishihara_data("1") gg_ishihara <- gg_ishihara(cb_1) gg_ishihara gg_ishihara + scale_fill_brewer(palette = "Dark2") gg_ishihara + scale_fill_viridis_d() gg_ishihara + scale_fill_manual(values = c("black", "grey90")) gg_ishihara + scale_fill_manual(values = c("red", "green"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.