diff --git a/.gitignore b/.gitignore index a058f5f..5487ed4 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ inst/png/ inst/svg/ inst/cairo/ +README.html diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..6281c3a --- /dev/null +++ b/NEWS.md @@ -0,0 +1,10 @@ +# ggflags 0.0.3 + +- Adds Rémi Thériault as an author and contributor! +- Package now complies with R CMD CHECK, paving the way for possible CRAN submission in the future! +- The package will also promptly be available on https://jimjam-slam.r-universe.dev + +# 0.0.2 + +- Fork from ellisp/ggflags +- Switches from the use of rectangular PNG flags in ellisp/ggflags to circular SVG flags. This makes them much better for plotting at high resolution, and especially for use in bubble plots. diff --git a/README.Rmd b/README.Rmd index e6c2f5f..ebd5954 100644 --- a/README.Rmd +++ b/README.Rmd @@ -15,9 +15,22 @@ knitr::opts_chunk$set( ## ggflags: Plot flags of the world in ggplot2 -A flag geom for ggplot2 +A flag geom for ggplot2. Uses circular SVG flags. + +# Install + +Install from R-Universe: + +```r +install.packages("ggflags", repos = c( + "https://jimjam-slam.r-universe.dev", + "https://cloud.r-project.org")) +``` + +# Use ```{r demo, warning=FALSE} +library(ggplot2) library(ggflags) set.seed(1234) @@ -26,6 +39,7 @@ d <- data.frame( country = sample(c("ar", "fr", "nz", "gb", "es", "ca", "lv", "qa"), 50, TRUE), stringsAsFactors = FALSE ) + ggplot(d, aes(x = x, y = y, country = country, size = x)) + geom_flag() + scale_country() + diff --git a/README.md b/README.md index c3ff46a..dbbf225 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,25 @@ -## ggflags +## ggflags: Plot flags of the world in ggplot2 -flag geom for ggplot2 +A flag geom for ggplot2. Uses circular SVG flags. + +# Install + +Install from R-Universe: ``` r +install.packages("ggflags", repos = c( + "https://jimjam-slam.r-universe.dev", + "https://cloud.r-project.org")) +``` + +# Use + +``` r +library(ggplot2) library(ggflags) -#> Loading required package: ggplot2 set.seed(1234) d <- data.frame( @@ -15,6 +27,7 @@ d <- data.frame( country = sample(c("ar", "fr", "nz", "gb", "es", "ca", "lv", "qa"), 50, TRUE), stringsAsFactors = FALSE ) + ggplot(d, aes(x = x, y = y, country = country, size = x)) + geom_flag() + scale_country() + diff --git a/man/figures/README-demo-1.png b/man/figures/README-demo-1.png index cf25554..47818da 100644 Binary files a/man/figures/README-demo-1.png and b/man/figures/README-demo-1.png differ