Skip to content

Commit

Permalink
dont delete readme folder
Browse files Browse the repository at this point in the history
  • Loading branch information
sebdalgarno committed Apr 12, 2019
1 parent 77c8663 commit 1f93088
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 67 deletions.
1 change: 1 addition & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ knitr::opts_chunk$set(

# tinter <img src="https://raw.githubusercontent.com/poissonconsulting/tinter/master/docs/logo.png" align="right" width='15%'/>


[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
[![Travis build status](https://travis-ci.org/poissonconsulting/tinter.svg?branch=master)](https://travis-ci.org/poissonconsulting/tinter)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/sebdalgarno/tinter?branch=master&svg=true)](https://ci.appveyor.com/project/sebdalgarno/tinter)
Expand Down
126 changes: 62 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,78 +1,76 @@
---
output: github_document
---

<!-- README.md is generated from README.Rmd. Please edit that file -->



# tinter <img src="https://raw.githubusercontent.com/poissonconsulting/tinter/master/docs/logo.png" align="right" width='15%'/>

[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
[![Travis build status](https://travis-ci.org/poissonconsulting/tinter.svg?branch=master)](https://travis-ci.org/poissonconsulting/tinter)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/sebdalgarno/tinter?branch=master&svg=true)](https://ci.appveyor.com/project/sebdalgarno/tinter)
[![Coverage status](https://codecov.io/gh/poissonconsulting/tinter/branch/master/graph/badge.svg)](https://codecov.io/github/poissonconsulting/tinter?branch=master)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![CRAN status](https://www.r-pkg.org/badges/version/tinter)](https://cran.r-project.org/package=tinter)
[![Travis build
status](https://travis-ci.org/poissonconsulting/tinter.svg?branch=master)](https://travis-ci.org/poissonconsulting/tinter)
[![AppVeyor build
status](https://ci.appveyor.com/api/projects/status/github/sebdalgarno/tinter?branch=master&svg=true)](https://ci.appveyor.com/project/sebdalgarno/tinter)
[![Coverage
status](https://codecov.io/gh/poissonconsulting/tinter/branch/master/graph/badge.svg)](https://codecov.io/github/poissonconsulting/tinter?branch=master)
[![License:
MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![CRAN
status](https://www.r-pkg.org/badges/version/tinter)](https://cran.r-project.org/package=tinter)
![CRAN Downloads](http://cranlogs.r-pkg.org/badges/grand-total/tinter)

### Introduction
`tinter` provides a simple way to generate monochromatic palettes. Easily define:
### Introduction

`tinter` provides a simple way to generate monochromatic palettes.
Easily define:

+ palette direction ("shades", "tints", or "both").
+ number of colours to generate on either side (`steps`).
+ number of colours to remove from extreme end(s) of palette (e.g. default `crop = 1` eliminates black and white).
+ darker or lighter output (`adjust`).
- palette direction (“shades”, “tints”, or “both”).
- number of colours to generate on either side (`steps`).
- number of colours to remove from extreme end(s) of palette
(e.g. default `crop = 1` eliminates black and white).
- darker or lighter output (`adjust`).

<!-- end list -->

```r
``` r
library(tinter)
hex <- "#335CAC"
```

![plot of chunk colour](figure/colour-1.png)
![](README_files/figure-gfm/colour-1.png)<!-- -->


```r
``` r
tinter(hex)
#> [1] "#D6DEEE" "#ADBDDD" "#849DCD" "#5B7CBC" "#335CAC" "#284989" "#1E3767"
#> [8] "#142444" "#0A1222"
```

![plot of chunk tinter](figure/tinter-1.png)

![](README_files/figure-gfm/tinter-1.png)<!-- -->

```r
``` r
tinter(hex, direction = "tints")
```

![plot of chunk tints](figure/tints-1.png)
![](README_files/figure-gfm/tints-1.png)<!-- -->


```r
``` r
tinter(hex, steps = 10)
```

![plot of chunk steps](figure/steps-1.png)

![](README_files/figure-gfm/steps-1.png)<!-- -->

```r
``` r
tinter(hex, steps = 10, crop = 7)
```

![plot of chunk crop](figure/crop-1.png)

![](README_files/figure-gfm/crop-1.png)<!-- -->

```r
``` r
tinter(hex, steps = 10, crop = 7, adjust = 0.4)
```

![plot of chunk darken](figure/darken-1.png)
![](README_files/figure-gfm/darken-1.png)<!-- -->

### Create a choropleth map


```r
``` r
library(ggplot2)
library(sf)

Expand All @@ -86,13 +84,14 @@ ggplot(data = nc) +
coord_sf(datum = NA)
```

![plot of chunk plot](figure/plot-1.png)
![](README_files/figure-gfm/plot-1.png)<!-- -->

### Doesn't this already exist?
`tinter` just simplifies a task usually done with `grDevices`. It's default is to remove black and white from the palette.
### Doesn’t this already exist?

`tinter` just simplifies a task usually done with `grDevices`. It’s
default is to remove black and white from the palette.

```r
``` r
tinter("blue")
#> [1] "#CCCCFF" "#9999FF" "#6666FF" "#3333FF" "#0000FF" "#0000CC" "#000099"
#> [8] "#000065" "#000032"
Expand All @@ -104,8 +103,7 @@ grDevices::colorRampPalette(colors = c("white", "blue", "black"))(11)[-(c(1, 11)
#> [8] "#000065" "#000032"
```


```r
``` r
tinter("blue", direction = "shades")
#> [1] "#0000FF" "#0000CC" "#000099" "#000065" "#000032"

Expand All @@ -115,9 +113,7 @@ grDevices::colorRampPalette(colors = c("blue", "black"))(6)[-6]
#> [1] "#0000FF" "#0000CC" "#000099" "#000065" "#000032"
```



```r
``` r
tinter("blue", crop = 2)
#> [1] "#9999FF" "#6666FF" "#3333FF" "#0000FF" "#0000CC" "#000099" "#000065"

Expand All @@ -130,30 +126,32 @@ grDevices::colorRampPalette(colors = c("white", "blue", "black"))(11)[-(c(1:2, 1
## Installation

To install from CRAN
```
install.packages("tinter")
```

To install the latest development version from [GitHub](https://github.com/poissonconsulting/tinter)
```
install.packages("devtools")
devtools::install_github("poissonconsulting/err")
devtools::install_github("poissonconsulting/checkr")
devtools::install_github("poissonconsulting/tinter")
```
install.packages("tinter")

To install the latest development version from the Poisson drat [repository](https://github.com/poissonconsulting/drat)
```
install.packages("drat")
drat::addRepo("poissonconsulting")
install.packages("tinter")
```
To install the latest development version from
[GitHub](https://github.com/poissonconsulting/tinter)

install.packages("devtools")
devtools::install_github("poissonconsulting/err")
devtools::install_github("poissonconsulting/checkr")
devtools::install_github("poissonconsulting/tinter")

To install the latest development version from the Poisson drat
[repository](https://github.com/poissonconsulting/drat)

install.packages("drat")
drat::addRepo("poissonconsulting")
install.packages("tinter")

## Contribution

Please report any [issues](https://github.com/poissonconsulting/tinter/issues).
Please report any
[issues](https://github.com/poissonconsulting/tinter/issues).

[Pull requests](https://github.com/poissonconsulting/tinter/pulls) are always welcome.
[Pull requests](https://github.com/poissonconsulting/tinter/pulls) are
always welcome.

Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md).
By participating in this project you agree to abide by its terms.
Please note that this project is released with a [Contributor Code of
Conduct](CONDUCT.md). By participating in this project you agree to
abide by its terms.
Binary file added README_files/figure-gfm/colour-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README_files/figure-gfm/crop-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README_files/figure-gfm/darken-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README_files/figure-gfm/plot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README_files/figure-gfm/steps-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README_files/figure-gfm/tinter-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README_files/figure-gfm/tints-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions build.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ if(TRUE) {
if(file.exists("DESCRIPTION")) unlink("docs", recursive = TRUE)
pkgdown::build_site()
}
### pkgdown absolute path issue unresolved - this is a workaround so CRAN checks pass
unlink("README_files", recursive = TRUE)
unlink("figure", recursive = TRUE)
# need to resolve pkgdown path issue before submitting to cran for update

devtools::check()

0 comments on commit 1f93088

Please sign in to comment.