Skip to content
A flag geom for ggplot2. Tweaks the original by using round flags (great for plotting as points).
Branch: master
Clone or download
Pull request Compare This branch is 7 commits ahead of ellisp:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
README_files/figure-markdown_github
data
inst
man
.Rbuildignore
.gitignore
DESCRIPTION
LICENSE
NAMESPACE
README.Rmd
README.md
ggflags.Rproj

README.md

ggflags

flag geom for ggplot2

library(ggflags)

set.seed(1234)
d <- data.frame(x=rnorm(50), y=rnorm(50), 
                country=sample(c("ar","fr", "nz", "gb", "es", "ca"), 50, TRUE), 
                stringsAsFactors = FALSE)
ggplot(d, aes(x=x, y=y, country=country, size=x)) + 
  geom_flag() + 
  scale_country() +
  scale_size(range = c(0, 15))

The flag SVG assets, used under the CC-BY licence, are taken from the EmojiOne set: https://github.com/eosrei/emojione-color-font

(Note: the EmojiOne set doesn't include UK counties or US states!)

(note: proof of principle only)

You can’t perform that action at this time.