This is an automated email from the git hooks/post-receive script. benjamin-guest pushed a commit to branch master in repository r-cran-scales.
commit 7b9ddb554c4dfd14e17ebfb1d0fcdd92a51aaece Author: Benjamin Eikel <benja...@eikel.org> Date: Sun Oct 16 15:14:47 2016 +0200 New upstream version 0.4.0 --- DESCRIPTION | 9 ++- MD5 | 162 +++++++++++++++++++------------------- NAMESPACE | 2 +- NEWS => NEWS.md | 36 +++++---- R/formatter.r | 3 + R/pal-manual.r | 9 ++- R/scale-continuous.r | 2 +- build/partial.rdb | Bin 8447 -> 8415 bytes man/Range-class.Rd | 2 +- man/abs_area.Rd | 2 +- man/alpha.Rd | 2 +- man/area_pal.Rd | 2 +- man/as.trans.Rd | 2 +- man/asn_trans.Rd | 2 +- man/atanh_trans.Rd | 2 +- man/boxcox_trans.Rd | 2 +- man/brewer_pal.Rd | 2 +- man/cbreaks.Rd | 2 +- man/censor.Rd | 2 +- man/col2hcl.Rd | 2 +- man/col_numeric.Rd | 4 +- man/colour_ramp.Rd | 8 +- man/comma_format.Rd | 2 +- man/cscale.Rd | 2 +- man/date_breaks.Rd | 2 +- man/date_format.Rd | 2 +- man/date_trans.Rd | 2 +- man/dichromat_pal.Rd | 2 +- man/discard.Rd | 2 +- man/div_gradient_pal.Rd | 2 +- man/dollar_format.Rd | 4 +- man/dscale.Rd | 2 +- man/exp_trans.Rd | 2 +- man/expand_range.Rd | 2 +- man/extended_breaks.Rd | 2 +- man/format_format.Rd | 2 +- man/fullseq.Rd | 2 +- man/gradient_n_pal.Rd | 2 +- man/grey_pal.Rd | 2 +- man/hue_pal.Rd | 2 +- man/identity_pal.Rd | 2 +- man/identity_trans.Rd | 2 +- man/linetype_pal.Rd | 2 +- man/log1p_trans.Rd | 2 +- man/log_breaks.Rd | 2 +- man/log_trans.Rd | 2 +- man/manual_pal.Rd | 2 +- man/math_format.Rd | 2 +- man/muted.Rd | 2 +- man/ordinal_format.Rd | 2 +- man/package-scales.Rd | 2 +- man/parse_format.Rd | 2 +- man/percent_format.Rd | 2 +- man/pretty_breaks.Rd | 2 +- man/probability_trans.Rd | 2 +- man/reciprocal_trans.Rd | 2 +- man/rescale.Rd | 2 +- man/rescale_max.Rd | 2 +- man/rescale_mid.Rd | 2 +- man/rescale_none.Rd | 2 +- man/rescale_pal.Rd | 2 +- man/reverse_trans.Rd | 2 +- man/scientific_format.Rd | 2 +- man/seq_gradient_pal.Rd | 2 +- man/shape_pal.Rd | 2 +- man/show_col.Rd | 2 +- man/sqrt_trans.Rd | 2 +- man/squish.Rd | 2 +- man/squish_infinite.Rd | 2 +- man/time_trans.Rd | 2 +- man/train_continuous.Rd | 2 +- man/train_discrete.Rd | 2 +- man/trans_breaks.Rd | 2 +- man/trans_format.Rd | 2 +- man/trans_new.Rd | 2 +- man/trans_range.Rd | 2 +- man/unit_format.Rd | 2 +- man/wrap_format.Rd | 2 +- man/zero_range.Rd | 3 +- src/colors.cpp | 2 +- tests/testthat/test-colour-ramp.R | 10 +++ tests/testthat/test-formatter.r | 4 + tests/testthat/test-manual-pal.R | 5 ++ 83 files changed, 218 insertions(+), 179 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0f52d31..59f7157 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: scales -Version: 0.3.0 +Version: 0.4.0 Authors@R: c( person("Hadley", "Wickham", , "had...@rstudio.com", c("aut", "cre")), person("RStudio", role = "cph") @@ -14,13 +14,14 @@ Depends: R (>= 2.13) Imports: RColorBrewer, dichromat, plyr, munsell (>= 0.2), labeling, methods, Rcpp LinkingTo: Rcpp -Suggests: testthat (>= 0.8) +Suggests: testthat (>= 0.8), covr License: MIT + file LICENSE LazyLoad: yes +RoxygenNote: 5.0.1 NeedsCompilation: yes -Packaged: 2015-08-24 18:41:17 UTC; hadley +Packaged: 2016-02-26 13:10:16 UTC; hadley Author: Hadley Wickham [aut, cre], RStudio [cph] Maintainer: Hadley Wickham <had...@rstudio.com> Repository: CRAN -Date/Publication: 2015-08-25 00:48:31 +Date/Publication: 2016-02-26 15:45:07 diff --git a/MD5 b/MD5 index bc5e371..1408bdb 100644 --- a/MD5 +++ b/MD5 @@ -1,7 +1,7 @@ -7a912d5b194b30ffe629c909d88bd272 *DESCRIPTION +4e5466c6e09654bf89b86e6fbf12288f *DESCRIPTION 42d91d5ce1f6db25d653397ec9da4f25 *LICENSE -5c5ae3db358c91d8c1600359509074bf *NAMESPACE -f8db5a3c861e1acb9043ba7ef50e43b7 *NEWS +c7f322e3489424135cb779bb418828f2 *NAMESPACE +56a8e05d6e6259c14b1f140ef0c96e16 *NEWS.md ee154387df2488852decb38c14e4c697 *R/RcppExports.R b11eaa73b921a7f0ca0b9ce412d516c8 *R/bounds.r 079b8af0d7acb058149e54824572af5a *R/breaks.r @@ -9,7 +9,7 @@ b11eaa73b921a7f0ca0b9ce412d516c8 *R/bounds.r 4a57e7d2f12a3e7aa60e8e09b0a70f66 *R/colour-mapping.r 2bfecd87cf7c8abc88ca53b3e1f1b31c *R/date-time.r f967c78e39bbcb23a60709f2a2735dbc *R/documentation.r -398bb391a0b6d275eccf60483364becf *R/formatter.r +5ee4c61c60d9f1e79450271c53afc1b6 *R/formatter.r 4f198007ee8d818bed5a007004f43e65 *R/full-seq.r 932da2aa512e9fefe925ade14e87e30c *R/pal-area.r 4bef24eb3cd91584ceb428b48ea9b827 *R/pal-brewer.r @@ -19,97 +19,99 @@ ff822fc138fa2a4c20bf09b267b93215 *R/pal-grey.r 458af3f9b86a6e4661a6e09ab33f4644 *R/pal-hue.r 732494f5f4054ca39a7da7731d023add *R/pal-identity.r a4c1f8acacabe7943df7173df7fe0633 *R/pal-linetype.r -716233051ba6990a7f9df54b51227294 *R/pal-manual.r +d6b7f3fb2fa5b7e87e6fe15d2869d112 *R/pal-manual.r 8cf6ec1effbef4498ee7d88ce0cbe9e2 *R/pal-rescale.r 58a8a345646e7034a6558e481defc8d6 *R/pal-shape.r 6c4b15dde8f951ed9b35431756af8cb8 *R/range.r -0ab69e45b31579351cfe3ee1ea524380 *R/scale-continuous.r +abfb1b0f1687bcdc75a9e524ce9b53d1 *R/scale-continuous.r a3c1aeb6e357edf1b89db85eab5ef8e3 *R/scale-discrete.r 9637a3d24c3c74a814043f55e6591fd9 *R/scales.r fc31d25bce46ab8166e6b21a7601622e *R/trans-date.r 3f1ec156f1cb24f09643e4d02b68d393 *R/trans-numeric.r 62abc8fd73c997d6e5e2312681b21086 *R/trans.r a9c0a08ac634745398cca9316fddd656 *README.md -4b02916cf394c5bf6e9ca33112a651dc *build/partial.rdb -fd70092adc19b48aa793fdb0f92dce1b *man/Range-class.Rd -fce13530360aab377cc560559a4a2f93 *man/abs_area.Rd -4c8d00f834a88a59389fa961167df75a *man/alpha.Rd -d881492d8245940cfef56ccfb11d465f *man/area_pal.Rd -c8e4c7d2827b05cb36a1d7d59f9232f4 *man/as.trans.Rd -bb1bcadebad4c8fdf7f88ce0e2e68f89 *man/asn_trans.Rd -72fc591d1cba0de07625bc2461e71c76 *man/atanh_trans.Rd -780eddf013a39e7b8c5fe4f95e2bfeec *man/boxcox_trans.Rd -26081b6d8aec17644856bb53f6b5921f *man/brewer_pal.Rd -eaf194b88f726dbc78adcb31e597e67d *man/cbreaks.Rd -abe08ee28c8b500a428d99a15a6702de *man/censor.Rd -057c32eec20053bba0ab8f4c3285587a *man/col2hcl.Rd -fd4909fc3155ba9175d0aad916d2739f *man/col_numeric.Rd -fa0983e358e9f4c6cf3404ea9e252aa6 *man/colour_ramp.Rd -9f8f20685d08d3c8899e5edb87c8fb2e *man/comma_format.Rd -6af58fb0659e35ccd623578022b68229 *man/cscale.Rd -d1184e9313cea106baeccbfb11972a97 *man/date_breaks.Rd -e2ce34f86735e443653a822ad00be127 *man/date_format.Rd -ace144bb296e1cac3aa7a2361750f2f5 *man/date_trans.Rd -3abed1cf8af5322670a540780cafc606 *man/dichromat_pal.Rd -1d693820f56b36a92749acb1ef5c0c51 *man/discard.Rd -0fb84b7a30dc4c5e64951e840c754be2 *man/div_gradient_pal.Rd -dd9f77b9581800966162dfcaf1bce214 *man/dollar_format.Rd -aca55d1e3cf4a29a7587171c4c91f4f0 *man/dscale.Rd -aefdfdcc999b84ae8baa165707006774 *man/exp_trans.Rd -861eaade3c3ca07850123de7369528d5 *man/expand_range.Rd -fb25e4a8c9dfc63378e7e33e1e2dde13 *man/extended_breaks.Rd -c4eb666dde93e1837eb23cfaafcdfb60 *man/format_format.Rd -10107f4aeecf4630093b1f05b4c957c3 *man/fullseq.Rd -1be5557586f0d6507909ba25d300f943 *man/gradient_n_pal.Rd -51435e80a8cf16fc6f779641404b9301 *man/grey_pal.Rd -2102643b3fbaf92689fa1e138c3c7911 *man/hue_pal.Rd -e430a9cd1580ea10b2303dc73a024c56 *man/identity_pal.Rd -1dabc084871fe0a4ba5b4adda751fe12 *man/identity_trans.Rd -642b0ab7efd8cb05c86e9eba6767e55e *man/linetype_pal.Rd -88dc512a6a4d93ba73547dbf21498a6d *man/log1p_trans.Rd -4f98a6e3e8aaa2be34a7dfca8f9c7d61 *man/log_breaks.Rd -c5c53152d732efea98815eef3fa7d4db *man/log_trans.Rd -7283343859583ac9c24910adcea53649 *man/manual_pal.Rd -f88147e8f0a68082a33be8d0d9a2338a *man/math_format.Rd -7edc85cada114baef84ac84c97ae7388 *man/muted.Rd -37e2c97f91ef013cfaa73ca15c477cb3 *man/ordinal_format.Rd -63bdd34d82fd68a683052aeed5409493 *man/package-scales.Rd -42536b5030fc3c87497ad313199fccfa *man/parse_format.Rd -ddbfda0cf145475fcb278fd7cec04d5f *man/percent_format.Rd -e163f69f11dd3b5ea25a7e43c25a15ba *man/pretty_breaks.Rd -b6814d4a32eeff376cb0faf8fb85db16 *man/probability_trans.Rd -76e2d86afd4307c610fcd741bab16ced *man/reciprocal_trans.Rd -229bfc078c16f978d01178dd7f951d0e *man/rescale.Rd -6b3ea9a1fc3c698b00520734008b0ec1 *man/rescale_max.Rd -587a98fdf6437581b7794980eff7d80f *man/rescale_mid.Rd -c9ba91efea5c79cd225cc2f891e98af9 *man/rescale_none.Rd -f316dffe50d948ce165a3f70f6885b71 *man/rescale_pal.Rd -580b26f89573ac7fb3dc59f2ca10339a *man/reverse_trans.Rd -09c7e1d1e5b681b09e35b5389cb40e69 *man/scientific_format.Rd -115a0b711054508faee683c6cd8ae722 *man/seq_gradient_pal.Rd -b0bfb42b822b103e4247e723edd1244a *man/shape_pal.Rd -e35211937f0d0333d7d8acf00884989d *man/show_col.Rd -9b8a8077ed07e623fb1426a8be7148e8 *man/sqrt_trans.Rd -3aae272f7d19655f21bf8ed3109d8a38 *man/squish.Rd -cba1789efcb00599b2c60c34a9f7f423 *man/squish_infinite.Rd -6a8cad78fb208a0835db9b7fc14b2825 *man/time_trans.Rd -5ca5329c44b25166f9047bbfb03448d0 *man/train_continuous.Rd -b50430a4a6c253f3710c6f5510dd1d11 *man/train_discrete.Rd -e2f975db54c837882e145854cbd70430 *man/trans_breaks.Rd -7fef205b9dcd4e613cb4f8c00bf8ec92 *man/trans_format.Rd -df03a130e2e2a562cf936c6fe36815f6 *man/trans_new.Rd -7f96b3eecdbf2d1a4501d2af284081f7 *man/trans_range.Rd -ac433e5b09bdef99c9d15a47f02e3500 *man/unit_format.Rd -dbf6561109775b98018a4eb99a4b5aff *man/wrap_format.Rd -6983587d9ba3532024f4b1a0617af6c9 *man/zero_range.Rd +1b5b21a66e1649d50a3938fb6195d253 *build/partial.rdb +9cebb6e1cc6446e15fb87de481b439b5 *man/Range-class.Rd +cf7164e82a4551cd5b80b42025724922 *man/abs_area.Rd +96882bfa6056c0ea536a068734ffee38 *man/alpha.Rd +ace025b2b0329b6ea69fd97a17063290 *man/area_pal.Rd +fb75161f2ce5819749861f0d1b1dce3a *man/as.trans.Rd +0cbf691d42ffcf0ca7b4fa9d89d814ce *man/asn_trans.Rd +593f19f0f7495168c6093630495f861e *man/atanh_trans.Rd +c77b396cb70939d863b75c2e5479c148 *man/boxcox_trans.Rd +f0256dc779d1a7813356cd2dbde38caf *man/brewer_pal.Rd +7973693419128c1c1729d4ee9e6b3462 *man/cbreaks.Rd +75ae2a67fb1ad84826f27622abd0eb00 *man/censor.Rd +ddddab4e28bc0b4460bfd61162adc1ea *man/col2hcl.Rd +d6e7c33c2b7bc51ea2d8144e1bcc541e *man/col_numeric.Rd +fb8e4e4eb380ff3f7a74b19c97ed8e58 *man/colour_ramp.Rd +b3128c47d8f5c68d01b0263955e7081c *man/comma_format.Rd +75650f2c20aa38b63031c6b01ec8ac1c *man/cscale.Rd +57513d736051a95413f30197aeacb135 *man/date_breaks.Rd +3399ee5dd07bd5cf7c91f72fbf8ce937 *man/date_format.Rd +c515b3af1cd1f596dea26477b7856ffc *man/date_trans.Rd +8c7e64b699fbb79fbb49a53a49a8d532 *man/dichromat_pal.Rd +4e316acac9c4ccc7b852c561db901597 *man/discard.Rd +8caeef8d9bc313fe777c570fd193d208 *man/div_gradient_pal.Rd +25c6eec1cd5f84d9ee1323bf258bba56 *man/dollar_format.Rd +9afe9ab4271756529e2001bdf1cdfae4 *man/dscale.Rd +c5446cba677e2fff62fb402a1ba4c65a *man/exp_trans.Rd +c085b2a058fdd6eb72ad499005d160c4 *man/expand_range.Rd +d0783e1c6cbc8d00b8e149ff46cc2a30 *man/extended_breaks.Rd +62cad068ce4dd354f68863c57ae5bc5a *man/format_format.Rd +ae1ce88897cf6c70bee1d889cd028190 *man/fullseq.Rd +e2d157eb9a85701dc727829115d3cc8a *man/gradient_n_pal.Rd +8789d74a00daa4b600f205a9ff150ef0 *man/grey_pal.Rd +ac05a22cba58a6004560d7faa1e089fd *man/hue_pal.Rd +3a183825c2e46c22ea9f738be7c4e2cd *man/identity_pal.Rd +334a28ff9d31a4c4bafd637ab22cebf3 *man/identity_trans.Rd +d02fe4b0fa7f519fdb7c9a6c33bc057d *man/linetype_pal.Rd +e21c4272d12b7186a273eff08300a413 *man/log1p_trans.Rd +0df93d5276542f986e00dc424e21a5bf *man/log_breaks.Rd +28b6b760f1a307f76dda59407d2fb4ad *man/log_trans.Rd +e935faa48f42369af11e3e3942b03607 *man/manual_pal.Rd +20284d8dd67564f838e11bdfebbf0bd8 *man/math_format.Rd +5059a7029cc84d90f7b02d36369ed14f *man/muted.Rd +b19e24b58aecd76a2b8021003b58fb5d *man/ordinal_format.Rd +d1457d632a91e2e8773ce1fa871fbab2 *man/package-scales.Rd +e45d8c20d5e5ff37409989ad5c730382 *man/parse_format.Rd +1f99e330efa1a610b46d51dd40ed1a13 *man/percent_format.Rd +7d1f9c7d88de751eeea3f2b82367f77e *man/pretty_breaks.Rd +cc9c0f7f6d250cd3f0f5746a63ea0745 *man/probability_trans.Rd +51208b85e09a5467d3366ca5031be371 *man/reciprocal_trans.Rd +3070c59456ca1b663088c6fcda017f8b *man/rescale.Rd +e19830a6384b3eb8a9e5f2a940159436 *man/rescale_max.Rd +db815f8eb56f6350ae567c14bb42ef66 *man/rescale_mid.Rd +3af70efd513587e6eb9f2d255667d914 *man/rescale_none.Rd +eeb3100220dd856a20bc665d2e8272be *man/rescale_pal.Rd +d559d1a58999f12087878b6e3c5d1a76 *man/reverse_trans.Rd +95fa00d20a410bf1cf63f07fcd46d25f *man/scientific_format.Rd +2eb00f2a459f9bedd4accec0025b099f *man/seq_gradient_pal.Rd +2e53f06e9802c200a3b1bc5a212562ba *man/shape_pal.Rd +cbc7b40e6922f8d7d3ded0e7f79d22b0 *man/show_col.Rd +f5097c06dadbc32103b01a846899f6b1 *man/sqrt_trans.Rd +0376ff9300898a3cc3d19b4735bbd447 *man/squish.Rd +70f53a5242b480a25411d156f5fbf24a *man/squish_infinite.Rd +b2e178a8fa23f97077d1edf192c062c9 *man/time_trans.Rd +2e9b19fddb8f762acbd357759f77049c *man/train_continuous.Rd +19d3d917fa2d64d71ddb31f08af3abe5 *man/train_discrete.Rd +17078f916904432680cea7e716d65cae *man/trans_breaks.Rd +4a9b85fe979a0ec1ca40cdcd1555f73a *man/trans_format.Rd +aac3ecd802efcede4a24a1735d6520ef *man/trans_new.Rd +a4c05123a59924a6b3e9bc02ee5c8bbe *man/trans_range.Rd +5f0cade40a6995b50a1d1fd969b4764d *man/unit_format.Rd +04e34ca3cedbb591e96244b0068dd6ea *man/wrap_format.Rd +3086e5a29c13333160634a6b8147ea18 *man/zero_range.Rd 26153fe9ba8cc9c1db5c380f9b68ddd6 *src/RcppExports.cpp -a6352bdbb8fc2eec47d3bd78ae92cb8d *src/colors.cpp +50b694b150f1cc631e68e0c471b1737b *src/colors.cpp 1bc97669868c55fc86b10bffb2010b63 *tests/testthat.R 9b1f7ff67006d13e255f222feba5ee9e *tests/testthat/test-alpha.r 210d4b72f91809cb8c82a36d60eff279 *tests/testthat/test-bounds.r b5bb7a6051319394602be12701d8b845 *tests/testthat/test-breaks-log.r 361eca6c9ef2ec2361364c81ff4a39cc *tests/testthat/test-colors.r -654894086b182f8a53ecd56ba01e03cc *tests/testthat/test-formatter.r +fa5466f6b3cf5c5e7dd187b32c049408 *tests/testthat/test-colour-ramp.R +69eb75b4b1eca96bf1b34171b9e47056 *tests/testthat/test-formatter.r +ce76ff71a20a24fa15228b440fdaa092 *tests/testthat/test-manual-pal.R 0d20e9d3700f281822fcb193c9b5353d *tests/testthat/test-range.r 61f4a2eb83089e04f6002733d904f909 *tests/testthat/test-rescale.R 13dc6039e6126c6c5b837b69fdcca1be *tests/testthat/test-scale.r diff --git a/NAMESPACE b/NAMESPACE index 594605e..729ee5c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,4 @@ -# Generated by roxygen2 (4.1.1): do not edit by hand +# Generated by roxygen2: do not edit by hand S3method(fullseq,Date) S3method(fullseq,POSIXt) diff --git a/NEWS b/NEWS.md similarity index 88% rename from NEWS rename to NEWS.md index e570280..11c459d 100644 --- a/NEWS +++ b/NEWS.md @@ -1,5 +1,18 @@ -Version 0.3.0 ------------------------------------------------------------------------------- +# scales 0.4.0 + +* Switched from `NEWS` to `NEWS.md` + +* `manual_pal()` produces a warning if n is greater than the number of values + in the palette (@jrnold, #68). + +* `precision(0)` now returns 1, which means `percent(0)` now returns 0% (#50). + +* `scale_continuous()` uses a more correct check for numeric values. + +* NaN is correctly recognised as a missing value by the gradient palettes + (ggplot2#1482). + +# scales 0.3.0 * `rescale()` preserves missing values in input when the range of `x` is (effectively) 0 (ggplot2#985). @@ -8,8 +21,7 @@ Version 0.3.0 This only supports interpolation in Lab colour space, but is hundreds of times faster. -Version 0.2.5 ------------------------------------------------------------------------------- +# scales 0.2.5 ## Improved formatting functions @@ -52,15 +64,13 @@ Version 0.2.5 * Relaxed tolerance in `zero_range()` to `.Machine$double.eps * 1000` (#33). -Version 0.2.4 ------------------------------------------------------------------------------- +# scales 0.2.4 * Eliminate stringr dependency. * Fix outstanding errors in R CMD check -Version 0.2.3 ------------------------------------------------------------------------------- +# scales 0.2.3 * `floor_time` calls `to_time`, but that function was moved into a function so it was no longer available in the scales namespace. Now `floor_time` @@ -73,8 +83,7 @@ Version 0.2.3 of points to be proportional to their value. These are used by `scale_size_area` in ggplot2. -Version 0.2.2 ------------------------------------------------------------------------------- +# scales 0.2.2 * `zero_range` has improved behaviour thanks to Brian Diggs. @@ -98,8 +107,7 @@ Version 0.2.2 * fixed namespace problem with `fullseq` -Version 0.2.1 ------------------------------------------------------------------------------- +# scales 0.2.1 * `suppressWarnings` from `train_continuous` so zero-row or all infinite data frames don't potentially cause problems. @@ -117,8 +125,7 @@ Version 0.2.1 some ranges (e.g 0.5-0.6), but you probably shouldn't be using log scales in that situation anyway. -Version 0.2.0 ------------------------------------------------------------------------------- +# scales 0.2.0 * `censor` and `squish` gain `only.finite` argument and default to operating only on finite values. This is needed for ggplot2, and reflects the use of @@ -138,4 +145,3 @@ Version 0.2.0 * Another tweak to `zero_range` to better detect when a range has zero length. (Fixes #6) - diff --git a/R/formatter.r b/R/formatter.r index 021f4cd..4cd6bea 100644 --- a/R/formatter.r +++ b/R/formatter.r @@ -275,6 +275,9 @@ precision <- function(x) { rng <- range(x, na.rm = TRUE) span <- if (zero_range(rng)) abs(rng[1]) else diff(rng) + if (span == 0) + return(1) + 10 ^ floor(log10(span)) } diff --git a/R/pal-manual.r b/R/pal-manual.r index 0e4a736..ad1adf7 100644 --- a/R/pal-manual.r +++ b/R/pal-manual.r @@ -3,5 +3,12 @@ #' @param values vector of values to be used as a palette. #' @export manual_pal <- function(values) { - function(n) values[seq_len(n)] + function(n) { + n_values <- length(values) + if (n > n_values) { + warning("This manual palette can handle a maximum of ", n_values, + " values. You have supplied ", n , ".", call. = FALSE) + } + values[seq_len(n)] + } } diff --git a/R/scale-continuous.r b/R/scale-continuous.r index f7941c5..2f885ed 100644 --- a/R/scale-continuous.r +++ b/R/scale-continuous.r @@ -35,7 +35,7 @@ cscale <- function(x, palette, na.value = NA_real_, trans = identity_trans()) { train_continuous <- function(new, existing = NULL) { if (is.null(new)) return(existing) - if (!is.numeric(new)) { + if (is.factor(new) || !typeof(new) %in% c("integer", "double")) { stop("Discrete value supplied to continuous scale", call. = FALSE) } suppressWarnings(range(existing, new, na.rm = TRUE, finite = TRUE)) diff --git a/build/partial.rdb b/build/partial.rdb index 943b8e1..22717a9 100644 Binary files a/build/partial.rdb and b/build/partial.rdb differ diff --git a/man/Range-class.Rd b/man/Range-class.Rd index 892f5ce..ad2a9b5 100644 --- a/man/Range-class.Rd +++ b/man/Range-class.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/range.r \docType{class} \name{Range-class} diff --git a/man/abs_area.Rd b/man/abs_area.Rd index 8f9d0b3..185f259 100644 --- a/man/abs_area.Rd +++ b/man/abs_area.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pal-area.r \name{abs_area} \alias{abs_area} diff --git a/man/alpha.Rd b/man/alpha.Rd index a87b08b..e0156e3 100644 --- a/man/alpha.Rd +++ b/man/alpha.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/colour-manip.r \name{alpha} \alias{alpha} diff --git a/man/area_pal.Rd b/man/area_pal.Rd index 0719554..643f44d 100644 --- a/man/area_pal.Rd +++ b/man/area_pal.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pal-area.r \name{area_pal} \alias{area_pal} diff --git a/man/as.trans.Rd b/man/as.trans.Rd index 87dbbc2..ce2ceeb 100644 --- a/man/as.trans.Rd +++ b/man/as.trans.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans.r \name{as.trans} \alias{as.trans} diff --git a/man/asn_trans.Rd b/man/asn_trans.Rd index 796742e..344b2ee 100644 --- a/man/asn_trans.Rd +++ b/man/asn_trans.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-numeric.r \name{asn_trans} \alias{asn_trans} diff --git a/man/atanh_trans.Rd b/man/atanh_trans.Rd index 839e844..2de78f7 100644 --- a/man/atanh_trans.Rd +++ b/man/atanh_trans.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-numeric.r \name{atanh_trans} \alias{atanh_trans} diff --git a/man/boxcox_trans.Rd b/man/boxcox_trans.Rd index 2b6c02a..459c87f 100644 --- a/man/boxcox_trans.Rd +++ b/man/boxcox_trans.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-numeric.r \name{boxcox_trans} \alias{boxcox_trans} diff --git a/man/brewer_pal.Rd b/man/brewer_pal.Rd index 00db611..d2cff02 100644 --- a/man/brewer_pal.Rd +++ b/man/brewer_pal.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pal-brewer.r \name{brewer_pal} \alias{brewer_pal} diff --git a/man/cbreaks.Rd b/man/cbreaks.Rd index fcc327d..913d5a4 100644 --- a/man/cbreaks.Rd +++ b/man/cbreaks.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/breaks.r \name{cbreaks} \alias{cbreaks} diff --git a/man/censor.Rd b/man/censor.Rd index 4d6802e..b79895e 100644 --- a/man/censor.Rd +++ b/man/censor.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bounds.r \name{censor} \alias{censor} diff --git a/man/col2hcl.Rd b/man/col2hcl.Rd index c985e5a..d94b730 100644 --- a/man/col2hcl.Rd +++ b/man/col2hcl.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/colour-manip.r \name{col2hcl} \alias{col2hcl} diff --git a/man/col_numeric.Rd b/man/col_numeric.Rd index a32a9ee..f9d5899 100644 --- a/man/col_numeric.Rd +++ b/man/col_numeric.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/colour-mapping.r \name{col_numeric} \alias{col_bin} @@ -33,7 +33,7 @@ col_factor(palette, domain, levels = NULL, ordered = FALSE, domain.} \item{na.color}{The color to return for \code{NA} values. Note that - \code{na.color=NA} is valid.} +\code{na.color=NA} is valid.} \item{bins}{Either a numeric vector of two or more unique cut points or a single number (greater than or equal to 2) giving the number of intervals diff --git a/man/colour_ramp.Rd b/man/colour_ramp.Rd index 40ba5cb..6dfbf4c 100644 --- a/man/colour_ramp.Rd +++ b/man/colour_ramp.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/colour-mapping.r \name{colour_ramp} \alias{colour_ramp} @@ -19,9 +19,9 @@ values outside of [0,1]. Can itself by \code{NA}, which will simply cause an \code{NA} to be inserted into the output.} \item{alpha}{Whether to include alpha channels in interpolation; otherwise, - any alpha information will be discarded. If \code{TRUE} then the returned - function will provide colors in \code{"#RRGGBBAA"} format instead of - \code{"#RRGGBB"}.} +any alpha information will be discarded. If \code{TRUE} then the returned +function will provide colors in \code{"#RRGGBBAA"} format instead of +\code{"#RRGGBB"}.} } \value{ A function that takes a numeric vector and returns a character vector diff --git a/man/comma_format.Rd b/man/comma_format.Rd index 4eb1476..3587c1a 100644 --- a/man/comma_format.Rd +++ b/man/comma_format.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/formatter.r \name{comma_format} \alias{comma} diff --git a/man/cscale.Rd b/man/cscale.Rd index 5b7322b..fd4c188 100644 --- a/man/cscale.Rd +++ b/man/cscale.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scale-continuous.r \name{cscale} \alias{cscale} diff --git a/man/date_breaks.Rd b/man/date_breaks.Rd index 191388e..737fd4a 100644 --- a/man/date_breaks.Rd +++ b/man/date_breaks.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-date.r \name{date_breaks} \alias{date_breaks} diff --git a/man/date_format.Rd b/man/date_format.Rd index 5807e60..eb0c9e7 100644 --- a/man/date_format.Rd +++ b/man/date_format.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-date.r \name{date_format} \alias{date_format} diff --git a/man/date_trans.Rd b/man/date_trans.Rd index 88a9fea..b11a399 100644 --- a/man/date_trans.Rd +++ b/man/date_trans.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-date.r \name{date_trans} \alias{date_trans} diff --git a/man/dichromat_pal.Rd b/man/dichromat_pal.Rd index 3d9c055..8cdfa2d 100644 --- a/man/dichromat_pal.Rd +++ b/man/dichromat_pal.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pal-dichromat.r \name{dichromat_pal} \alias{dichromat_pal} diff --git a/man/discard.Rd b/man/discard.Rd index 4bc1378..08b6bff 100644 --- a/man/discard.Rd +++ b/man/discard.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bounds.r \name{discard} \alias{discard} diff --git a/man/div_gradient_pal.Rd b/man/div_gradient_pal.Rd index dcc203b..fd0048e 100644 --- a/man/div_gradient_pal.Rd +++ b/man/div_gradient_pal.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pal-gradient.r \name{div_gradient_pal} \alias{div_gradient_pal} diff --git a/man/dollar_format.Rd b/man/dollar_format.Rd index f0df57a..870917f 100644 --- a/man/dollar_format.Rd +++ b/man/dollar_format.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/formatter.r \name{dollar_format} \alias{dollar} @@ -11,7 +11,7 @@ dollar_format(prefix = "$", suffix = "", largest_with_cents = 1e+05, ..., dollar(x) } \arguments{ -\item{prefix,suffix}{Symbols to display before and after amount.} +\item{prefix, suffix}{Symbols to display before and after amount.} \item{largest_with_cents}{the value that all values of \code{x} must be less than in order for the cents to be displayed} diff --git a/man/dscale.Rd b/man/dscale.Rd index 05d1db7..573d1a3 100644 --- a/man/dscale.Rd +++ b/man/dscale.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scale-discrete.r \name{dscale} \alias{dscale} diff --git a/man/exp_trans.Rd b/man/exp_trans.Rd index c19a3de..25c767f 100644 --- a/man/exp_trans.Rd +++ b/man/exp_trans.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-numeric.r \name{exp_trans} \alias{exp_trans} diff --git a/man/expand_range.Rd b/man/expand_range.Rd index f2d7c28..db8490d 100644 --- a/man/expand_range.Rd +++ b/man/expand_range.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bounds.r \name{expand_range} \alias{expand_range} diff --git a/man/extended_breaks.Rd b/man/extended_breaks.Rd index 0ffb341..f053620 100644 --- a/man/extended_breaks.Rd +++ b/man/extended_breaks.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/breaks.r \name{extended_breaks} \alias{extended_breaks} diff --git a/man/format_format.Rd b/man/format_format.Rd index 8487b55..98ac088 100644 --- a/man/format_format.Rd +++ b/man/format_format.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/formatter.r \name{format_format} \alias{format_format} diff --git a/man/fullseq.Rd b/man/fullseq.Rd index ab96aeb..f1e69b5 100644 --- a/man/fullseq.Rd +++ b/man/fullseq.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/full-seq.r \name{fullseq} \alias{fullseq} diff --git a/man/gradient_n_pal.Rd b/man/gradient_n_pal.Rd index fbcac67..ceca85e 100644 --- a/man/gradient_n_pal.Rd +++ b/man/gradient_n_pal.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pal-gradient.r \name{gradient_n_pal} \alias{gradient_n_pal} diff --git a/man/grey_pal.Rd b/man/grey_pal.Rd index 515d9a9..ff156e8 100644 --- a/man/grey_pal.Rd +++ b/man/grey_pal.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pal-grey.r \name{grey_pal} \alias{grey_pal} diff --git a/man/hue_pal.Rd b/man/hue_pal.Rd index d7f71ef..193728f 100644 --- a/man/hue_pal.Rd +++ b/man/hue_pal.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pal-hue.r \name{hue_pal} \alias{hue_pal} diff --git a/man/identity_pal.Rd b/man/identity_pal.Rd index 4d8d7c0..950babe 100644 --- a/man/identity_pal.Rd +++ b/man/identity_pal.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pal-identity.r \name{identity_pal} \alias{identity_pal} diff --git a/man/identity_trans.Rd b/man/identity_trans.Rd index d1ed748..e0ea625 100644 --- a/man/identity_trans.Rd +++ b/man/identity_trans.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-numeric.r \name{identity_trans} \alias{identity_trans} diff --git a/man/linetype_pal.Rd b/man/linetype_pal.Rd index 1cc633a..a319906 100644 --- a/man/linetype_pal.Rd +++ b/man/linetype_pal.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pal-linetype.r \name{linetype_pal} \alias{linetype_pal} diff --git a/man/log1p_trans.Rd b/man/log1p_trans.Rd index 58c0957..0d74c14 100644 --- a/man/log1p_trans.Rd +++ b/man/log1p_trans.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-numeric.r \name{log1p_trans} \alias{log1p_trans} diff --git a/man/log_breaks.Rd b/man/log_breaks.Rd index 4c80f99..6f4f946 100644 --- a/man/log_breaks.Rd +++ b/man/log_breaks.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/breaks.r \name{log_breaks} \alias{log_breaks} diff --git a/man/log_trans.Rd b/man/log_trans.Rd index 50231a0..be4c1fb 100644 --- a/man/log_trans.Rd +++ b/man/log_trans.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-numeric.r \name{log_trans} \alias{log10_trans} diff --git a/man/manual_pal.Rd b/man/manual_pal.Rd index dc43650..bae2f9b 100644 --- a/man/manual_pal.Rd +++ b/man/manual_pal.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pal-manual.r \name{manual_pal} \alias{manual_pal} diff --git a/man/math_format.Rd b/man/math_format.Rd index 54a9df9..5fec678 100644 --- a/man/math_format.Rd +++ b/man/math_format.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/formatter.r \name{math_format} \alias{math_format} diff --git a/man/muted.Rd b/man/muted.Rd index 9eb3306..9b67e66 100644 --- a/man/muted.Rd +++ b/man/muted.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/colour-manip.r \name{muted} \alias{muted} diff --git a/man/ordinal_format.Rd b/man/ordinal_format.Rd index 86df7db..8ad6648 100644 --- a/man/ordinal_format.Rd +++ b/man/ordinal_format.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/formatter.r \name{ordinal_format} \alias{ordinal} diff --git a/man/package-scales.Rd b/man/package-scales.Rd index dee0f49..7f8721c 100644 --- a/man/package-scales.Rd +++ b/man/package-scales.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scales.r \docType{package} \name{package-scales} diff --git a/man/parse_format.Rd b/man/parse_format.Rd index 86a6653..b343dcf 100644 --- a/man/parse_format.Rd +++ b/man/parse_format.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/formatter.r \name{parse_format} \alias{parse_format} diff --git a/man/percent_format.Rd b/man/percent_format.Rd index 9ffdd85..2e739f4 100644 --- a/man/percent_format.Rd +++ b/man/percent_format.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/formatter.r \name{percent_format} \alias{percent} diff --git a/man/pretty_breaks.Rd b/man/pretty_breaks.Rd index a904c28..913e200 100644 --- a/man/pretty_breaks.Rd +++ b/man/pretty_breaks.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/breaks.r \name{pretty_breaks} \alias{pretty_breaks} diff --git a/man/probability_trans.Rd b/man/probability_trans.Rd index 825083b..564808c 100644 --- a/man/probability_trans.Rd +++ b/man/probability_trans.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-numeric.r \name{probability_trans} \alias{logit_trans} diff --git a/man/reciprocal_trans.Rd b/man/reciprocal_trans.Rd index 15d197a..fdca5d8 100644 --- a/man/reciprocal_trans.Rd +++ b/man/reciprocal_trans.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-numeric.r \name{reciprocal_trans} \alias{reciprocal_trans} diff --git a/man/rescale.Rd b/man/rescale.Rd index b7e8985..f783038 100644 --- a/man/rescale.Rd +++ b/man/rescale.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bounds.r \name{rescale} \alias{rescale} diff --git a/man/rescale_max.Rd b/man/rescale_max.Rd index d17f53d..9abb9d2 100644 --- a/man/rescale_max.Rd +++ b/man/rescale_max.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bounds.r \name{rescale_max} \alias{rescale_max} diff --git a/man/rescale_mid.Rd b/man/rescale_mid.Rd index d0772a9..7a6ef0b 100644 --- a/man/rescale_mid.Rd +++ b/man/rescale_mid.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bounds.r \name{rescale_mid} \alias{rescale_mid} diff --git a/man/rescale_none.Rd b/man/rescale_none.Rd index 44b482b..406edb8 100644 --- a/man/rescale_none.Rd +++ b/man/rescale_none.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bounds.r \name{rescale_none} \alias{rescale_none} diff --git a/man/rescale_pal.Rd b/man/rescale_pal.Rd index 16c2a4f..05a094d 100644 --- a/man/rescale_pal.Rd +++ b/man/rescale_pal.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pal-rescale.r \name{rescale_pal} \alias{rescale_pal} diff --git a/man/reverse_trans.Rd b/man/reverse_trans.Rd index fb05742..f15f4d8 100644 --- a/man/reverse_trans.Rd +++ b/man/reverse_trans.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-numeric.r \name{reverse_trans} \alias{reverse_trans} diff --git a/man/scientific_format.Rd b/man/scientific_format.Rd index fe96bac..99eee55 100644 --- a/man/scientific_format.Rd +++ b/man/scientific_format.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/formatter.r \name{scientific_format} \alias{scientific} diff --git a/man/seq_gradient_pal.Rd b/man/seq_gradient_pal.Rd index ad0b782..f11ffaa 100644 --- a/man/seq_gradient_pal.Rd +++ b/man/seq_gradient_pal.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pal-gradient.r \name{seq_gradient_pal} \alias{seq_gradient_pal} diff --git a/man/shape_pal.Rd b/man/shape_pal.Rd index 965aa39..0174750 100644 --- a/man/shape_pal.Rd +++ b/man/shape_pal.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pal-shape.r \name{shape_pal} \alias{shape_pal} diff --git a/man/show_col.Rd b/man/show_col.Rd index 88ee713..953ff9d 100644 --- a/man/show_col.Rd +++ b/man/show_col.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/colour-manip.r \name{show_col} \alias{show_col} diff --git a/man/sqrt_trans.Rd b/man/sqrt_trans.Rd index 6103908..db34d36 100644 --- a/man/sqrt_trans.Rd +++ b/man/sqrt_trans.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-numeric.r \name{sqrt_trans} \alias{sqrt_trans} diff --git a/man/squish.Rd b/man/squish.Rd index 7043951..03bb577 100644 --- a/man/squish.Rd +++ b/man/squish.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bounds.r \name{squish} \alias{squish} diff --git a/man/squish_infinite.Rd b/man/squish_infinite.Rd index 60a3c20..9841e08 100644 --- a/man/squish_infinite.Rd +++ b/man/squish_infinite.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bounds.r \name{squish_infinite} \alias{squish_infinite} diff --git a/man/time_trans.Rd b/man/time_trans.Rd index 08aeb2d..35daa4c 100644 --- a/man/time_trans.Rd +++ b/man/time_trans.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans-date.r \name{time_trans} \alias{time_trans} diff --git a/man/train_continuous.Rd b/man/train_continuous.Rd index 88d0a83..01d1a43 100644 --- a/man/train_continuous.Rd +++ b/man/train_continuous.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scale-continuous.r \name{train_continuous} \alias{train_continuous} diff --git a/man/train_discrete.Rd b/man/train_discrete.Rd index 0455d61..5b97bb2 100644 --- a/man/train_discrete.Rd +++ b/man/train_discrete.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scale-discrete.r \name{train_discrete} \alias{train_discrete} diff --git a/man/trans_breaks.Rd b/man/trans_breaks.Rd index 5afb75d..4c8b90a 100644 --- a/man/trans_breaks.Rd +++ b/man/trans_breaks.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/breaks.r \name{trans_breaks} \alias{trans_breaks} diff --git a/man/trans_format.Rd b/man/trans_format.Rd index 28207c9..2392fdc 100644 --- a/man/trans_format.Rd +++ b/man/trans_format.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/formatter.r \name{trans_format} \alias{trans_format} diff --git a/man/trans_new.Rd b/man/trans_new.Rd index 7ea4baf..00dd476 100644 --- a/man/trans_new.Rd +++ b/man/trans_new.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans.r \name{trans_new} \alias{is.trans} diff --git a/man/trans_range.Rd b/man/trans_range.Rd index ab8edba..8a58809 100644 --- a/man/trans_range.Rd +++ b/man/trans_range.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trans.r \name{trans_range} \alias{trans_range} diff --git a/man/unit_format.Rd b/man/unit_format.Rd index bf927da..99336c4 100644 --- a/man/unit_format.Rd +++ b/man/unit_format.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/formatter.r \name{unit_format} \alias{unit_format} diff --git a/man/wrap_format.Rd b/man/wrap_format.Rd index 1ced77a..aac65f9 100644 --- a/man/wrap_format.Rd +++ b/man/wrap_format.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/formatter.r \name{wrap_format} \alias{wrap_format} diff --git a/man/zero_range.Rd b/man/zero_range.Rd index 5b6805e..f980f0a 100644 --- a/man/zero_range.Rd +++ b/man/zero_range.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bounds.r \name{zero_range} \alias{zero_range} @@ -44,5 +44,6 @@ zero_range(c(1, NaN)) # NA zero_range(c(1, Inf)) # FALSE zero_range(c(-Inf, Inf)) # FALSE zero_range(c(Inf, Inf)) # TRUE + } diff --git a/src/colors.cpp b/src/colors.cpp index 6a7c1df..81e83a3 100644 --- a/src/colors.cpp +++ b/src/colors.cpp @@ -143,7 +143,7 @@ StringVector doColorRampSerial(NumericMatrix colors, NumericVector x, bool alpha StringVector result(x.length()); for (R_len_t i = 0; i < x.length(); i++) { double xval = x[i]; - if (xval < 0 || xval > 1 || R_IsNA(xval)) { + if (xval < 0 || xval > 1 || !R_finite(xval)) { // Illegal or NA value for this x value. result[i] = NA_STRING; } else { diff --git a/tests/testthat/test-colour-ramp.R b/tests/testthat/test-colour-ramp.R new file mode 100644 index 0000000..d4e233e --- /dev/null +++ b/tests/testthat/test-colour-ramp.R @@ -0,0 +1,10 @@ +context("Colour ramp") + +test_that("Special values yield NAs", { + pal <- seq_gradient_pal() + + expect_equal(pal(NA), NA_character_) + expect_equal(pal(NaN), NA_character_) + expect_equal(pal(Inf), NA_character_) + expect_equal(pal(-Inf), NA_character_) +}) diff --git a/tests/testthat/test-formatter.r b/tests/testthat/test-formatter.r index 9f3cd85..7bda20c 100644 --- a/tests/testthat/test-formatter.r +++ b/tests/testthat/test-formatter.r @@ -91,6 +91,10 @@ test_that("negative percents work", { expect_equal(percent(-0.6), "-60%") }) +test_that("Single 0 gives 0%", { + expect_equal(percent(0), "0%") +}) + # Dollar formatter -------------------------------------------------------- test_that("negative comes before prefix", { diff --git a/tests/testthat/test-manual-pal.R b/tests/testthat/test-manual-pal.R new file mode 100644 index 0000000..3b0442c --- /dev/null +++ b/tests/testthat/test-manual-pal.R @@ -0,0 +1,5 @@ +context("manual_pal") + +test_that("manual_pal gives warning if n greater than the number of values", { + expect_warning(manual_pal(c("red", "blue", "green"))(4), "can handle a maximum") +}) -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/r-cran-scales.git _______________________________________________ debian-med-commit mailing list debian-med-commit@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit