README.md

ggpic

ggpic extends ggplot2 package adding geoms based on the the default ones, but using raster objects instead of rect elements. This way you can make a barplot with trees, buildings or leaves instead bars.

Usage

# libraries
library(ggplot2)
library(ggpic)
library(dplyr)

# pic
leaf <- as.matrix(as.raster(rsvg::rsvg(
  system.file('pics', 'leaf.svg', package = 'ggpic')
)))

# plot
iris %>%
  ggplot(aes(x = Species, fill = Species)) +
  geom_bar_pic(pic = 'leaf')

Installation

ggpic is only at GitHub at the moment. You can install it using devtools package:

# install devtools if necessary
install.packages('devtools')

# install ggpic
devtools::install_github('MalditoBarbudo/ggpic', build_vignettes = TRUE)

Components:

Features

See more

For more examples and a complete description of the package see the Introduction to ggpic vignette:

vignette('Introducing_ggpic', package = 'ggpic')

Known issues

flexdashboards

ggpic does not work well in a flexdashboard environment, even if it works in Rmd documents. Not sure why this is happening yet.



MalditoBarbudo/ggpic documentation built on May 7, 2019, 2:09 p.m.