diff --git a/.Rbuildignore b/.Rbuildignore index 4e689b2..32e0bda 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -4,6 +4,6 @@ ^README-.*\.png$ ^\.travis\.yml$ ^CONDUCT\.md$ -^README\.md$ +^README\.Rmd$ ^README_figs ^README\.html$ diff --git a/NEWS b/NEWS index 550cae0..ffcb230 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +0.2.0 +===================== +* Incorporated ProPublica StateFace font + 0.1.5 ===================== * Pokemon discrete color scales! diff --git a/R/ggalt-package.r b/R/ggalt-package.r index f805767..bb4f30a 100644 --- a/R/ggalt-package.r +++ b/R/ggalt-package.r @@ -1,4 +1,4 @@ -#' Extra Geoms, Stats and Coords for 'ggplot2' +#' Extra Geoms, Stats, Coords, Scales & Fonts for 'ggplot2' #' #' A package containing additional geoms, coords, stats, scales & fonts #' for ggplot2 2.0+ diff --git a/README.Rmd b/README.Rmd index 9665d10..b2dd321 100644 --- a/README.Rmd +++ b/README.Rmd @@ -190,7 +190,7 @@ m + stat_bkde2d(bandwidth=c(0.5, 4), aes(fill = ..level..), geom = "polygon") ``` -### `coord_proj` LIVES! (still needs work) +### `coord_proj` LIVES! (still needs a teensy bit of work) ```{r coord_proj} world <- map_data("world") @@ -203,6 +203,26 @@ gg <- gg + coord_proj("+proj=wintri") gg ``` +### ProPublica StateFace + +```{r stateface} +# Run show_stateface() to see the location of the TTF StateFace font +# You need to install it for it to work + +set.seed(1492) +dat <- data.frame(state=state.abb, + x=sample(100, 50), + y=sample(100, 50), + col=sample(c("#b2182b", "#2166ac"), 50, replace=TRUE), + sz=sample(6:15, 50, replace=TRUE), + stringsAsFactors=FALSE) +gg <- ggplot(dat, aes(x=x, y=y)) +gg <- gg + geom_stateface(aes(label=state, color=col, size=sz)) +gg <- gg + scale_color_identity() +gg <- gg + scale_size_identity() +gg +``` + ### Code of Conduct Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). diff --git a/README.html b/README.html index 3bdf280..2bee75f 100644 --- a/README.html +++ b/README.html @@ -15,7 +15,7 @@ - + @@ -38,6 +38,7 @@ if (window.hljs && document.readyState && document.readyState === "complete") { +
@@ -84,6 +85,8 @@ button.code-folding-btn:focus { outline: none; } + +ggalt
: Extra Coordinate Systems, Geoms and Statistical Transformations for ‘ggplot2’
A compendium of ‘geoms’, ‘coords’ and ‘stats’ for ‘ggplot2’, including splines, 1d and 2d densities, univariate average shifted histograms and a new map coordinate system based on the ‘PROJ.4’-library.
The first three forays into this brave, new ggplot2
world are splines! and being able to use the (much better) KernSmooth::bkde
and KernSmooth::bkde2D
for density plots and an initial port of the (still needing work) coord_proj
.
stat_ash
: Compute and display a univariate averaged shifted histogram (polynomial kernel) (uses ash::ash1
/ash::bin1
)scale_color_pokemon
:scale_fill_pokemon
: discrete pokemon scales (data taken from the hard work by the http://www.pokegraphs.com/)byte_format
: + helpers. e.g. turn 10000
into 10 Kb
stat_ash
coord_proj
LIVES! (still needs work)coord_proj
LIVES! (still needs a teensy bit of work)world <- map_data("world")
#>
#> # ATTENTION: maps v3.0 has an updated 'world' map. #
@@ -306,6 +310,25 @@ gg <- gg + coord_proj("+proj=wintri")
gg
# Run show_stateface() to see the location of the TTF StateFace font
+# You need to install it for it to work
+
+set.seed(1492)
+dat <- data.frame(state=state.abb,
+ x=sample(100, 50),
+ y=sample(100, 50),
+ col=sample(c("#b2182b", "#2166ac"), 50, replace=TRUE),
+ sz=sample(6:15, 50, replace=TRUE),
+ stringsAsFactors=FALSE)
+gg <- ggplot(dat, aes(x=x, y=y))
+gg <- gg + geom_stateface(aes(label=state, color=col, size=sz))
+gg <- gg + scale_color_identity()
+gg <- gg + scale_size_identity()
+gg
+
+Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
diff --git a/README.md b/README.md index 1070544..da09da3 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,13 @@ The following functions are implemented: - `stat_ash` : Compute and display a univariate averaged shifted histogram (polynomial kernel) (uses `ash::ash1`/`ash::bin1`) - `scale_color_pokemon` : - `scale_fill_pokemon` : discrete pokemon scales (data taken from the hard work by the