【R】emphatic
2020年10月31日
1. はじめに
emphatic
は、R
でdata.frameなどに色付けや強調などの装飾をして見やすくしてくれるパッケージです。
2. インストール
remotes::install_github('coolbutuseless/emphatic')
3. つかってみる
library(tidyverse) library(emphatic) mtcars %>% hl(c('blue', 'white'))

iris %>% hl(rainbow(12)) %>% hl_opt(text_contrast = 0.8)

diamonds %>% select(carat, depth, table, price) %>% cor() %>% hl_matrix(scale_colour_gradient2(), selection = abs(.x) > 0.2 & row(.x) != col(.x))

4. さいごに
CUIでも色がつくと見やすさが全然違いますね。