README.md

funkea

library(funkea)

ggplot theme

p <-
  mtcars %>%
  mutate(am = if_else(am == 0, "オートマティック", "マニュアル")) %>%
  ggplot(aes(hp, mpg, col = cyl)) +
  theme_grey() +
  geom_point() +
  facet_wrap(~ am)

p + 
  legend_topleft()


p +
  theme_funkea() +
  legend_topleft() # = p + theme_bw() + inwart_tick() + transparent + jpn

ggplot label

see_unicode()

qplot(1:5) + theme_bw() +
  labs(x = gglabel("\u2206 Temperature", type = "degC"),
       y = gglabel("PPFD", type = "muflux"),
       subtitle = gglabel(~CO[2], type = "muconc"))
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

zero filling

x <- c(1, 20, 100, NA)
lead_zero(x, 1)
#> [1] "1"   "20"  "100" NA
lead_zero(x, 2)
#> [1] "01"  "20"  "100" NA
lead_zero(x, 3)
#> [1] "001" "020" "100" NA
y <- c(0.1, 0.001, 0.09, NA)
tail_zero(y, 1)
#> [1] "0.1" "0.0" "0.1" NA
tail_zero(y, 2)
#> [1] "0.10" "0.00" "0.09" NA
tail_zero(y, 3)
#> [1] "0.100" "0.001" "0.090" NA


KeachMurakami/funkea documentation built on Nov. 26, 2024, 11:11 p.m.