Browse Source

README

master
boB Rudis 5 years ago
parent
commit
ea75042e86
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 8
      R/geom-chicklet.R
  2. 4
      R/ggchicklet-package.R
  3. 35
      README.Rmd
  4. 47
      README.md
  5. BIN
      README_files/figure-gfm/unnamed-chunk-1-1.png
  6. BIN
      man/figures/README-nyt-1.png
  7. BIN
      man/figures/README-unnamed-chunk-1-1.png
  8. BIN
      man/figures/chickletex.png
  9. 4
      man/geom_chicklet.Rd
  10. 4
      man/ggchicklet.Rd

8
R/geom-chicklet.R

@ -7,13 +7,13 @@
#' \if{html}{
#' A sample of the output from \code{geom_chicklet()}:
#'
#' \figure{chickletex.png}{options: width="100\%" alt="Figure: chickletex.png"}
#' \figure{README-nyt-1.png}{options: width="100\%" alt="Figure: README-nyt-1.png"}
#' }
#'
#' \if{latex}{
#' A sample of the output from \code{geom_chicklet()}:
#'
#' \figure{chickletex.png}{options: width=10cm}
#' \figure{README-nyt-1.png}{options: width=10cm}
#' }
#'
#' @section Aesthetics:
@ -71,14 +71,14 @@ geom_chicklet <- function(mapping = NULL, data = NULL,
)
}
draw_key_rrect <- function(data, params, size, ...) { # nocov start
draw_key_rrect <- function(data, params, size) { # nocov start
grid::roundrectGrob(
r = min(params$radius, unit(3, "pt")),
default.units = "native",
width = 1, height = 0.6,
name = "lkey",
gp = grid::gpar(
col = params[["color"]][[1]] %l0% params[["colour"]][1] %l0% data[["colour"]][[1]] %l0% "#00000000",
col = params$color %l0% "white",
fill = alpha(data$fill %||% data$colour %||% "grey20", data$alpha),
lty = data$linetype %||% 1
)

4
R/ggchicklet-package.R

@ -7,13 +7,13 @@
#' \if{html}{
#' A sample of the output from \code{geom_chicklet()}:
#'
#' \figure{chickletex.png}{options: width="100\%" alt="Figure: chickletex.png"}
#' \figure{README-nyt-1.png}{options: width="100\%" alt="Figure: README-nyt-1.png"}
#' }
#'
#' \if{latex}{
#' A sample of the output from \code{geom_chicklet()}:
#'
#' \figure{chickletex.png}{options: width=10cm}
#' \figure{README-nyt-1.png}{options: width=10cm}
#' }
#'
#' @md

35
README.Rmd

@ -4,16 +4,12 @@ editor_options:
chunk_output_type: console
---
```{r pkg-knitr-opts, include=FALSE}
knitr::opts_chunk$set(
collapse=TRUE, fig.retina=2, message=FALSE, warning=FALSE,
fig.path = "man/figures/README-"
)
options(width=120)
hrbrpkghelpr::global_opts()
```
[![Travis-CI Build Status](https://travis-ci.org/hrbrmstr/ggchicklet.svg?branch=master)](https://travis-ci.org/hrbrmstr/ggchicklet)
[![Coverage Status](https://codecov.io/gh/hrbrmstr/ggchicklet/branch/master/graph/badge.svg)](https://codecov.io/gh/hrbrmstr/ggchicklet)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ggchicklet)](https://cran.r-project.org/package=ggchicklet)
```{r badges, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::stinking_badges()
```
# ggchicklet
@ -22,27 +18,20 @@ Create Chicklet (Rounded Segmented Column) Charts
## Description
Sometimes it is useful to stylize column charts a bit more
than just bland rectangles. Methods are provided to create rounded
rectangle segmented column charts (i.e. "chicklets").
than just bland rectangles. Methods are provided to create rounded rectangle segmented column charts (i.e. "chicklets").
## What's Inside The Tin
```{r ingredients, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::describe_ingredients()
```
The following functions are implemented:
## Installation
```{r install-ex, eval=FALSE}
install.packages("ggchicklet", repos = "https://cinc.rud.is")
# or
devtools::install_git("https://git.rud.is/hrbrmstr/ggchicklet.git")
# or
devtools::install_git("https://git.sr.ht/~hrbrmstr/ggchicklet")
# or
devtools::install_gitlab("hrbrmstr/ggchicklet")
# or
devtools::install_bitbucket("hrbrmstr/ggchicklet")
# or (if you must)
devtools::install_github("hrbrmstr/ggchicklet")
```{r install-ex, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::install_block()
```
## Usage
@ -57,7 +46,7 @@ packageVersion("ggchicklet")
### From the NYTimes
```{r fig.width=10, fig.height=9, out.width="100%"}
```{r nyt, fig.width=10, fig.height=9, out.width="100%"}
library(hrbrthemes)
library(tidyverse)

47
README.md

@ -1,9 +1,18 @@
[![Travis-CI Build
[![Project Status: Active – The project has reached a stable, usable
state and is being actively
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Signed
by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keybase.io/hrbrmstr)
![Signed commit
%](https://img.shields.io/badge/Signed_Commits-100%25-lightgrey.svg)
[![Linux build
Status](https://travis-ci.org/hrbrmstr/ggchicklet.svg?branch=master)](https://travis-ci.org/hrbrmstr/ggchicklet)
[![Coverage
Status](https://codecov.io/gh/hrbrmstr/ggchicklet/branch/master/graph/badge.svg)](https://codecov.io/gh/hrbrmstr/ggchicklet)
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/ggchicklet)](https://cran.r-project.org/package=ggchicklet)
![Minimal R
Version](https://img.shields.io/badge/R%3E%3D-3.2.0-blue.svg)
![License](https://img.shields.io/badge/License-MIT-blue.svg)
# ggchicklet
@ -17,24 +26,32 @@ segmented column charts (i.e. “chicklets”).
## What’s Inside The Tin
- `debates2019`: June 2019 U.S. Democratic Debate Candidate/Topic
Times
- `geom_chicklet`: Chicklet (rounded segmented column) charts
- `GeomChicklet`: ggchicklet-ggplot2-ggproto
The following functions are implemented:
## Installation
``` r
install.packages("ggchicklet", repos = "https://cinc.rud.is")
# or
devtools::install_git("https://git.rud.is/hrbrmstr/ggchicklet.git")
# or
devtools::install_git("https://git.sr.ht/~hrbrmstr/ggchicklet")
# or
devtools::install_gitlab("hrbrmstr/ggchicklet")
remotes::install_git("https://git.rud.is/hrbrmstr/ggchicklet.git")
# or
remotes::install_git("https://git.sr.ht/~hrbrmstr/ggchicklet")
# or
remotes::install_gitlab("hrbrmstr/ggchicklet")
# or
devtools::install_bitbucket("hrbrmstr/ggchicklet")
# or (if you must)
devtools::install_github("hrbrmstr/ggchicklet")
remotes::install_bitbucket("hrbrmstr/ggchicklet")
# or
remotes::install_github("hrbrmstr/ggchicklet")
```
NOTE: To use the ‘remotes’ install options you will need to have the
[{remotes} package](https://github.com/r-lib/remotes) installed.
## Usage
``` r
@ -95,14 +112,14 @@ debates2019 %>%
theme(legend.position = "top")
```
<img src="man/figures/README-unnamed-chunk-1-1.png" width="100%" />
<img src="man/figures/README-nyt-1.png" width="100%" />
## ggchicklet Metrics
| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
| :--- | -------: | ---: | --: | ---: | ----------: | ---: | -------: | ---: |
| R | 9 | 0.82 | 123 | 0.51 | 27 | 0.37 | 105 | 0.54 |
| Rmd | 2 | 0.18 | 116 | 0.49 | 46 | 0.63 | 90 | 0.46 |
| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
| :--- | -------: | --: | --: | ---: | ----------: | ---: | -------: | ---: |
| R | 8 | 0.8 | 119 | 0.52 | 27 | 0.36 | 107 | 0.56 |
| Rmd | 2 | 0.2 | 109 | 0.48 | 47 | 0.64 | 85 | 0.44 |
## Code of Conduct

BIN
README_files/figure-gfm/unnamed-chunk-1-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

BIN
man/figures/README-nyt-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

BIN
man/figures/README-unnamed-chunk-1-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

BIN
man/figures/chickletex.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

4
man/geom_chicklet.Rd

@ -65,13 +65,13 @@ sets some sane defaults for making chicklet charts.
\if{html}{
A sample of the output from \code{geom_chicklet()}:
\figure{chickletex.png}{options: width="100\%" alt="Figure: chickletex.png"}
\figure{README-nyt-1.png}{options: width="100\%" alt="Figure: README-nyt-1.png"}
}
\if{latex}{
A sample of the output from \code{geom_chicklet()}:
\figure{chickletex.png}{options: width=10cm}
\figure{README-nyt-1.png}{options: width=10cm}
}
}
\note{

4
man/ggchicklet.Rd

@ -14,13 +14,13 @@ rectangle segmented column charts (i.e. "chicklets").
\if{html}{
A sample of the output from \code{geom_chicklet()}:
\figure{chickletex.png}{options: width="100\%" alt="Figure: chickletex.png"}
\figure{README-nyt-1.png}{options: width="100\%" alt="Figure: README-nyt-1.png"}
}
\if{latex}{
A sample of the output from \code{geom_chicklet()}:
\figure{chickletex.png}{options: width=10cm}
\figure{README-nyt-1.png}{options: width=10cm}
}
}
\seealso{

Loading…
Cancel
Save