knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

Yutani's utilities

Travis build status

This utilities are for me, but they might be useful for you.

Installation

# install.packages("devtools")
devtools::install_github("yutannihilation/yutanutils")

Usage

Labels

library(ggplot2)
library(yutanutils)

nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)

ggplot(head(nc, 3)) +
  geom_sf(aes(fill = AREA)) +
  geom_sf_label(aes(label = NAME))

library(gghighlight)

ggplot(nc) +
  geom_sf(aes(fill = AREA)) +
  gghighlight(AREA > 0.20) +
  geom_sf_label_repel(aes(label = NAME),
                      force = 100, nudge_x = -2, seed = 10) +
  scale_y_continuous(expand = expand_scale(mult = 0.5))


yutannihilation/yutanutils documentation built on May 20, 2019, 8:24 p.m.