diff --git a/.Rbuildignore b/.Rbuildignore index 0f4fa91..546384c 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -15,3 +15,4 @@ README.md ^pkgdown$ ^revdep$ cran-comments.md +^CRAN-RELEASE$ diff --git a/DESCRIPTION b/DESCRIPTION index 695c0db..f91365a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: viridis Type: Package -Title: Default Color Maps from 'matplotlib' -Version: 0.6.0 +Title: Colorblind-Friendly Color Maps for R +Version: 0.6.1 Authors@R: c( person("Simon", "Garnier", email = "garnier@njit.edu", role = c("aut", "cre")), person("Noam", "Ross", email = "noam.ross@gmail.com", role = c("ctb", "cph")), @@ -44,6 +44,7 @@ Suggests: covr, rmarkdown, rgdal +LazyData: true VignetteBuilder: knitr URL: https://sjmgarnier.github.io/viridis/, https://github.com/sjmgarnier/viridis/ BugReports: https://github.com/sjmgarnier/viridis/issues diff --git a/NEWS.md b/NEWS.md index ba1e7ff..a47b1de 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,17 @@ -# viridisLite 0.4.0 +# viridisLite 0.6.1 + +## New features + +* N/A. + +## Minor improvements and fixes + +* Include unemployment data in package to avoid CRAN check errors when original + data is not accessible. + +--- + +# viridisLite 0.6.0 ## New features @@ -8,4 +21,4 @@ * Minor bug fixes and improvements here and there. ---- \ No newline at end of file +--- diff --git a/R/scales.R b/R/scales.R index 49675ee..a540e6a 100644 --- a/R/scales.R +++ b/R/scales.R @@ -216,3 +216,23 @@ viridisLite::turbo #' @importFrom viridisLite viridis.map #' @export viridisLite::viridis.map + + +#' @title USA Unemployment in 2009 +#' +#' @description A data set containing the 2009 unemployment data in the USA by +#' county. +#' +#' @format A data frame with 3218 rows and 8 variables: +#' \describe{ +#' \item{id}{the county ID number} +#' \item{state_fips}{the state FIPS number} +#' \item{county_fips}{the county FIPS number} +#' \item{name}{the county name} +#' \item{year}{the year} +#' \item{rate}{the unemployment rate} +#' \item{county}{the county abbreviated name} +#' \item{state}{the state acronym} +#' } +#' @source \url{http://datasets.flowingdata.com/unemployment09.csv} +"unemp" diff --git a/data/unemp.RData b/data/unemp.RData new file mode 100644 index 0000000..d491833 Binary files /dev/null and b/data/unemp.RData differ diff --git a/docs/404.html b/docs/404.html index 01f0398..b5ee557 100644 --- a/docs/404.html +++ b/docs/404.html @@ -79,7 +79,7 @@ viridis - 0.6.0 + 0.6.1 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 0c956a6..97ea4a6 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -79,7 +79,7 @@ viridis - 0.6.0 + 0.6.1 diff --git a/docs/articles/index.html b/docs/articles/index.html index eb03c80..cf14a6e 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -79,7 +79,7 @@ viridis - 0.6.0 + 0.6.1 diff --git a/docs/articles/intro-to-viridis.html b/docs/articles/intro-to-viridis.html index b017af8..82aa902 100644 --- a/docs/articles/intro-to-viridis.html +++ b/docs/articles/intro-to-viridis.html @@ -38,7 +38,7 @@ viridis - 0.6.0 + 0.6.1 @@ -92,7 +92,7 @@

Introduction to the viridis color maps

Bob Rudis, Noam Ross and Simon Garnier

-

2021-04-14

+

2021-05-04

Source: vignettes/intro-to-viridis.Rmd @@ -216,13 +216,14 @@

The package also contains color scale functions for ggplot plots: scale_color_viridis() and scale_fill_viridis(). As with viridis(), you can use the other scales with the option argument in the ggplot scales.
Here the “magma” scale is used for a cloropleth map of U.S. unemployment:

-unemp <- read.csv("http://datasets.flowingdata.com/unemployment09.csv",
-                  header = FALSE, stringsAsFactors = FALSE)
-names(unemp) <- c("id", "state_fips", "county_fips", "name", "year",
-                  "?", "?", "?", "rate")
-unemp$county <- tolower(gsub(" County, [A-Z]{2}", "", unemp$name))
-unemp$county <- gsub("^(.*) parish, ..$","\\1", unemp$county)
-unemp$state <- gsub("^.*([A-Z]{2}).*$", "\\1", unemp$name)
+# unemp <- read.csv("http://datasets.flowingdata.com/unemployment09.csv",
+#                   header = FALSE, stringsAsFactors = FALSE)
+# names(unemp) <- c("id", "state_fips", "county_fips", "name", "year",
+#                   "?", "?", "?", "rate")
+# unemp$county <- tolower(gsub(" County, [A-Z]{2}", "", unemp$name))
+# unemp$county <- gsub("^(.*) parish, ..$","\\1", unemp$county)
+# unemp$state <- gsub("^.*([A-Z]{2}).*$", "\\1", unemp$name)
+data(unemp)
 
 county_df <- map_data("county", projection = "albers", parameters = c(39, 45))
 names(county_df) <- c("long", "lat", "group", "order", "state_name", "county")
diff --git a/docs/articles/intro-to-viridis_files/figure-html/tldr_ggplot-1.png b/docs/articles/intro-to-viridis_files/figure-html/tldr_ggplot-1.png
index 1a48bae..ed96a7a 100644
Binary files a/docs/articles/intro-to-viridis_files/figure-html/tldr_ggplot-1.png and b/docs/articles/intro-to-viridis_files/figure-html/tldr_ggplot-1.png differ
diff --git a/docs/authors.html b/docs/authors.html
index e312249..db66dc7 100644
--- a/docs/authors.html
+++ b/docs/authors.html
@@ -79,7 +79,7 @@
       
       
         viridis
-        0.6.0
+        0.6.1
       
     
@@ -134,11 +134,11 @@

Citation

Source: inst/CITATION -

Simon Garnier, Noam Ross, Robert Rudis, Antônio P. Camargo, Marco Sciaini, and Cédric Scherer (). Rvision - Colorblind-Friendly Color Maps for R. R package version 0.6.0.

+

Simon Garnier, Noam Ross, Robert Rudis, Antônio P. Camargo, Marco Sciaini, and Cédric Scherer (). Rvision - Colorblind-Friendly Color Maps for R. R package version 0.6.1.

@Manual{,
   title = {{viridis} - Colorblind-Friendly Color Maps for R},
   author = {{Garnier} and {Simon} and {Ross} and {Noam} and {Rudis} and {Robert} and {Camargo} and Antônio Pedro and {Sciaini} and {Marco} and {Scherer} and {Cédric}},
-  note = {R package version 0.6.0},
+  note = {R package version 0.6.1},
   url = {https://sjmgarnier.github.io/viridis/},
   doi = {10.5281/zenodo.4679424},
   doi = {10.5281/zenodo.4679424},
diff --git a/docs/index.html b/docs/index.html
index 141f945..479cbb2 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -5,7 +5,7 @@
 
 
 
-Default Color Maps from matplotlib • viridis
+Colorblind-Friendly Color Maps for R • viridis
 
 
 
@@ -17,7 +17,7 @@
 
 
 
-
+
 
         viridis
-        0.6.0
+        0.6.1
       
     
 
diff --git a/docs/news/index.html b/docs/news/index.html
index 665bde8..bc689d2 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -79,7 +79,7 @@
       
       
         viridis
-        0.6.0
+        0.6.1
       
     
 
@@ -134,21 +134,41 @@ 

Changelog

Source: NEWS.md -
-

-viridisLite 0.4.0 2017-03-27 +
+

+viridisLite 0.6.1 Unreleased

New features

    -
  • Add 3 more color maps: mako, rocket, and turbo.
  • +
  • N/A.

Minor improvements and fixes

    +
  • Include unemployment data in package to avoid CRAN check errors when original data is not accessible.
  • +
+
+
+
+
+

+viridisLite 0.6.0 2021-04-15 +

+
+

+New features

+
    +
  • Add 3 more color maps: mako, rocket, and turbo.
  • +
+
+
+

+Minor improvements and fixes

+
  • Minor bug fixes and improvements here and there.

diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index f90471c..d456e47 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 1.6.1 pkgdown_sha: ~ articles: intro-to-viridis: intro-to-viridis.html -last_built: 2021-04-14T15:18Z +last_built: 2021-05-04T09:42Z urls: reference: https://sjmgarnier.github.io/viridis/reference article: https://sjmgarnier.github.io/viridis/articles diff --git a/docs/reference/index.html b/docs/reference/index.html index 4d945ce..e16e083 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -79,7 +79,7 @@ viridis - 0.6.0 + 0.6.1
@@ -161,6 +161,12 @@

unemp

+ +

USA Unemployment in 2009

+ +

viridis_pal()

diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html index 038d895..ccd70be 100644 --- a/docs/reference/reexports.html +++ b/docs/reference/reexports.html @@ -85,7 +85,7 @@ viridis - 0.6.0 + 0.6.1

diff --git a/docs/reference/scale_viridis.html b/docs/reference/scale_viridis.html index a63411f..8ce21b6 100644 --- a/docs/reference/scale_viridis.html +++ b/docs/reference/scale_viridis.html @@ -89,7 +89,7 @@ viridis - 0.6.0 + 0.6.1

diff --git a/docs/reference/unemp.html b/docs/reference/unemp.html new file mode 100644 index 0000000..9ea8a30 --- /dev/null +++ b/docs/reference/unemp.html @@ -0,0 +1,193 @@ + + + + + + + + +USA Unemployment in 2009 — unemp • viridis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
+

A data set containing the 2009 unemployment data in the USA by + county.

+
+ +
unemp
+ + +

Format

+ +

A data frame with 3218 rows and 8 variables:

+
id

the county ID number

+
state_fips

the state FIPS number

+
county_fips

the county FIPS number

+
name

the county name

+
year

the year

+
rate

the unemployment rate

+
county

the county abbreviated name

+
state

the state acronym

+ +
+ +

Source

+ +

http://datasets.flowingdata.com/unemployment09.csv

+ +
+ +
+ + + +
+ + + + + + + + diff --git a/docs/reference/viridis_pal.html b/docs/reference/viridis_pal.html index 307fc38..bc7ca27 100644 --- a/docs/reference/viridis_pal.html +++ b/docs/reference/viridis_pal.html @@ -82,7 +82,7 @@ viridis - 0.6.0 + 0.6.1 diff --git a/docs/sitemap.xml b/docs/sitemap.xml index e24be7f..28792f9 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -9,6 +9,9 @@ https://sjmgarnier.github.io/viridis/reference/scale_viridis.html + + https://sjmgarnier.github.io/viridis/reference/unemp.html + https://sjmgarnier.github.io/viridis/reference/viridis_pal.html diff --git a/man/unemp.Rd b/man/unemp.Rd new file mode 100644 index 0000000..afeb6df --- /dev/null +++ b/man/unemp.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/scales.R +\docType{data} +\name{unemp} +\alias{unemp} +\title{USA Unemployment in 2009} +\format{ +A data frame with 3218 rows and 8 variables: +\describe{ + \item{id}{the county ID number} + \item{state_fips}{the state FIPS number} + \item{county_fips}{the county FIPS number} + \item{name}{the county name} + \item{year}{the year} + \item{rate}{the unemployment rate} + \item{county}{the county abbreviated name} + \item{state}{the state acronym} +} +} +\source{ +\url{http://datasets.flowingdata.com/unemployment09.csv} +} +\usage{ +unemp +} +\description{ +A data set containing the 2009 unemployment data in the USA by + county. +} +\keyword{datasets} diff --git a/vignettes/intro-to-viridis.R b/vignettes/intro-to-viridis.R index 73425ff..1d7f240 100644 --- a/vignettes/intro-to-viridis.R +++ b/vignettes/intro-to-viridis.R @@ -103,13 +103,14 @@ us <- projectRaster(us, crs="+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_ image(us, col=inferno(256), asp=1, axes=FALSE, xaxs="i", xaxt='n', yaxt='n', ann=FALSE) ## ---- ggplot2----------------------------------------------------------------- -unemp <- read.csv("http://datasets.flowingdata.com/unemployment09.csv", - header = FALSE, stringsAsFactors = FALSE) -names(unemp) <- c("id", "state_fips", "county_fips", "name", "year", - "?", "?", "?", "rate") -unemp$county <- tolower(gsub(" County, [A-Z]{2}", "", unemp$name)) -unemp$county <- gsub("^(.*) parish, ..$","\\1", unemp$county) -unemp$state <- gsub("^.*([A-Z]{2}).*$", "\\1", unemp$name) +# unemp <- read.csv("http://datasets.flowingdata.com/unemployment09.csv", +# header = FALSE, stringsAsFactors = FALSE) +# names(unemp) <- c("id", "state_fips", "county_fips", "name", "year", +# "?", "?", "?", "rate") +# unemp$county <- tolower(gsub(" County, [A-Z]{2}", "", unemp$name)) +# unemp$county <- gsub("^(.*) parish, ..$","\\1", unemp$county) +# unemp$state <- gsub("^.*([A-Z]{2}).*$", "\\1", unemp$name) +data(unemp) county_df <- map_data("county", projection = "albers", parameters = c(39, 45)) names(county_df) <- c("long", "lat", "group", "order", "state_name", "county") diff --git a/vignettes/intro-to-viridis.Rmd b/vignettes/intro-to-viridis.Rmd index a0a4821..18803b1 100644 --- a/vignettes/intro-to-viridis.Rmd +++ b/vignettes/intro-to-viridis.Rmd @@ -265,13 +265,14 @@ you can use the other scales with the `option` argument in the `ggplot` scales. Here the "magma" scale is used for a cloropleth map of U.S. unemployment: ```{r, ggplot2} -unemp <- read.csv("http://datasets.flowingdata.com/unemployment09.csv", - header = FALSE, stringsAsFactors = FALSE) -names(unemp) <- c("id", "state_fips", "county_fips", "name", "year", - "?", "?", "?", "rate") -unemp$county <- tolower(gsub(" County, [A-Z]{2}", "", unemp$name)) -unemp$county <- gsub("^(.*) parish, ..$","\\1", unemp$county) -unemp$state <- gsub("^.*([A-Z]{2}).*$", "\\1", unemp$name) +# unemp <- read.csv("http://datasets.flowingdata.com/unemployment09.csv", +# header = FALSE, stringsAsFactors = FALSE) +# names(unemp) <- c("id", "state_fips", "county_fips", "name", "year", +# "?", "?", "?", "rate") +# unemp$county <- tolower(gsub(" County, [A-Z]{2}", "", unemp$name)) +# unemp$county <- gsub("^(.*) parish, ..$","\\1", unemp$county) +# unemp$state <- gsub("^.*([A-Z]{2}).*$", "\\1", unemp$name) +data(unemp) county_df <- map_data("county", projection = "albers", parameters = c(39, 45)) names(county_df) <- c("long", "lat", "group", "order", "state_name", "county")