diff --git a/dev/news/index.html b/dev/news/index.html index 5135e535..7fb3d555 100644 --- a/dev/news/index.html +++ b/dev/news/index.html @@ -62,6 +62,7 @@

@teunbrand, #403).
  • The scale_cut argument in number() now works as advertised for values below the lowest cut value (#346)
  • +
  • Added a new option to the style_positive argument in label_*() functions. Setting this to "space" will add a figure space in front of the number to make it easier to align positive and negative values as figure space takes up the same amount of space as - (#366)
  • label_dollar() has been superseeded by label_currency() for clarity (#344)
  • diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index 48775791..38173bdd 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 2.19.2 pkgdown: 2.0.7 pkgdown_sha: ~ articles: {} -last_built: 2023-11-06T08:42Z +last_built: 2023-11-06T10:46Z urls: reference: https://scales.r-lib.org/reference article: https://scales.r-lib.org/articles diff --git a/dev/reference/col_numeric-1.png b/dev/reference/col_numeric-1.png index c21933e9..e646ca42 100644 Binary files a/dev/reference/col_numeric-1.png and b/dev/reference/col_numeric-1.png differ diff --git a/dev/reference/col_numeric-2.png b/dev/reference/col_numeric-2.png index ef666793..6a50b2af 100644 Binary files a/dev/reference/col_numeric-2.png and b/dev/reference/col_numeric-2.png differ diff --git a/dev/reference/col_numeric-3.png b/dev/reference/col_numeric-3.png index 86b8ad3a..cab58699 100644 Binary files a/dev/reference/col_numeric-3.png and b/dev/reference/col_numeric-3.png differ diff --git a/dev/reference/comma.html b/dev/reference/comma.html index 625eec7f..07bfab32 100644 --- a/dev/reference/comma.html +++ b/dev/reference/comma.html @@ -85,7 +85,7 @@

    Usage suffix = "", big.mark = " ", decimal.mark = ".", - style_positive = c("none", "plus"), + style_positive = c("none", "plus", "space"), style_negative = c("hyphen", "minus", "parens"), scale_cut = NULL, trim = TRUE, @@ -160,6 +160,10 @@

    Arguments (the default): no change, e.g. 1.

  • "plus": preceded by +, e.g. +1.

  • +
  • "space": preceded by a Unicode "figure space", i.e., a space equally +as wide as a number or +. Compared to "none", adding a figure space +can ensure numbers remain properly aligned when they are left- or +right-justified.

  • diff --git a/dev/reference/label_number.html b/dev/reference/label_number.html index 581de78b..ff6e69ee 100644 --- a/dev/reference/label_number.html +++ b/dev/reference/label_number.html @@ -72,7 +72,7 @@

    Usage suffix = "", big.mark = " ", decimal.mark = ".", - style_positive = c("none", "plus"), + style_positive = c("none", "plus", "space"), style_negative = c("hyphen", "minus", "parens"), scale_cut = NULL, trim = TRUE, @@ -130,6 +130,10 @@

    Arguments (the default): no change, e.g. 1.

  • "plus": preceded by +, e.g. +1.

  • +
  • "space": preceded by a Unicode "figure space", i.e., a space equally +as wide as a number or +. Compared to "none", adding a figure space +can ensure numbers remain properly aligned when they are left- or +right-justified.

  • diff --git a/dev/reference/number.html b/dev/reference/number.html index 759fdbda..e9a22ee6 100644 --- a/dev/reference/number.html +++ b/dev/reference/number.html @@ -73,7 +73,7 @@

    Usage suffix = "", big.mark = " ", decimal.mark = ".", - style_positive = c("none", "plus"), + style_positive = c("none", "plus", "space"), style_negative = c("hyphen", "minus", "parens"), scale_cut = NULL, trim = TRUE, @@ -125,6 +125,10 @@

    Arguments (the default): no change, e.g. 1.

  • "plus": preceded by +, e.g. +1.

  • +
  • "space": preceded by a Unicode "figure space", i.e., a space equally +as wide as a number or +. Compared to "none", adding a figure space +can ensure numbers remain properly aligned when they are left- or +right-justified.

  • diff --git a/dev/reference/rescale.html b/dev/reference/rescale.html index 40dc4942..daf6c838 100644 --- a/dev/reference/rescale.html +++ b/dev/reference/rescale.html @@ -131,15 +131,15 @@

    Examples#> [91] 0.90909091 0.91919192 0.92929293 0.93939394 0.94949495 0.95959596 #> [97] 0.96969697 0.97979798 0.98989899 1.00000000 rescale(runif(50)) -#> [1] 0.35294605 0.16181607 0.39314045 0.85065834 0.35802212 0.05633311 -#> [7] 0.77341801 0.34494675 0.65761841 0.58279869 0.38302583 0.33666975 -#> [13] 0.23789271 0.73177620 0.16677564 0.68218924 0.09342438 0.88245698 -#> [19] 0.69983096 0.19467163 0.75648344 0.00000000 0.95210076 0.82642746 -#> [25] 0.27111510 0.36507516 0.06692242 0.16661516 0.95829225 0.30041852 -#> [31] 0.35879886 0.12296450 0.84605472 0.82585116 0.61050248 0.12729648 -#> [37] 0.18173535 0.39313541 0.96840614 0.41471765 0.50594759 0.14284788 -#> [43] 0.47642865 1.00000000 0.40439016 0.30692111 0.55356293 0.95861828 -#> [49] 0.45697453 0.89713203 +#> [1] 0.39420856 0.66935531 0.11640937 0.40330034 0.33654059 0.99494352 +#> [7] 0.76271009 0.70998425 0.00000000 0.43729730 0.73922326 0.31947480 +#> [13] 0.85245515 0.26309400 0.13713742 0.68603998 0.69772433 0.89189524 +#> [19] 0.96277029 0.54202030 0.07529310 0.68519471 0.82954677 0.64289433 +#> [25] 0.46068838 0.26006225 0.96731471 0.27559077 0.43033716 0.82798740 +#> [31] 0.08380864 0.10013610 0.41428980 0.98047695 0.51891922 0.19856952 +#> [37] 0.28768167 0.96209972 0.53464096 0.07325354 0.49223528 0.63137120 +#> [43] 0.11800022 0.97893846 1.00000000 0.18599411 0.36719722 0.36477999 +#> [49] 0.29788309 0.60650176 rescale(1) #> [1] 0.5 diff --git a/dev/reference/rescale_max.html b/dev/reference/rescale_max.html index 4d04c978..a0b79ceb 100644 --- a/dev/reference/rescale_max.html +++ b/dev/reference/rescale_max.html @@ -90,15 +90,15 @@

    Examples#> [79] 0.79 0.80 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.90 0.91 #> [92] 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.00 rescale_max(runif(50)) -#> [1] 0.38892514 0.73607949 0.82669058 0.39723952 0.07484311 0.89453769 -#> [7] 0.01922970 0.49815929 0.30428408 0.55724717 0.70652149 0.79347443 -#> [13] 0.12139773 0.11679893 0.45051510 0.20936790 0.43005844 0.75168601 -#> [19] 0.41016505 0.22234548 0.08153313 0.05265336 0.65905837 0.91345277 -#> [25] 0.32511201 0.54304242 0.45009993 0.09975043 1.00000000 0.74319320 -#> [31] 0.34742648 0.45707189 0.10110435 0.49342050 0.81058855 0.26832750 -#> [37] 0.82084827 0.39844007 0.86196453 0.95687918 0.79931857 0.37543684 -#> [43] 0.69139558 0.75177763 0.35796626 0.76010418 0.69593931 0.71550978 -#> [49] 0.64317453 0.82467219 +#> [1] 0.90996289 0.25216964 0.15257142 0.65400914 0.68085877 0.06984956 +#> [7] 0.82164775 0.37119430 0.92751808 0.79581876 0.72835150 0.06921417 +#> [13] 0.40058184 0.28120119 0.61290125 0.20504491 0.64699384 0.22592742 +#> [19] 0.78135249 0.43294132 0.34668315 0.68345365 0.54717946 0.33737163 +#> [25] 0.73995474 0.69704911 0.93010761 0.95678170 0.72491203 0.92818696 +#> [31] 0.78037694 1.00000000 0.42842897 0.94304249 0.52006318 0.87465284 +#> [37] 0.03998167 0.37534339 0.97718812 0.17725302 0.34538623 0.72205975 +#> [43] 0.97059012 0.44452590 0.63001834 0.06652080 0.43385183 0.15704666 +#> [49] 0.23964440 0.74921839 rescale_max(1) #> [1] 1 diff --git a/dev/reference/rescale_mid.html b/dev/reference/rescale_mid.html index b98a6e0a..5454e0db 100644 --- a/dev/reference/rescale_mid.html +++ b/dev/reference/rescale_mid.html @@ -132,15 +132,15 @@

    Examples#> [91] 0.90909091 0.91919192 0.92929293 0.93939394 0.94949495 0.95959596 #> [97] 0.96969697 0.97979798 0.98989899 1.00000000 rescale_mid(runif(50), mid = 0.5) -#> [1] 0.06262396 0.53902465 0.93641895 0.57480904 0.80473723 0.19075331 -#> [7] 0.49824808 0.19589617 0.30973516 0.45119286 0.15711198 0.30465784 -#> [13] 0.70868387 0.23752440 0.62786019 0.47440867 0.72446532 0.35806606 -#> [19] 0.27395095 0.02798991 0.65947846 0.33384084 0.09402949 0.58214290 -#> [25] 0.76952319 0.64177821 0.23798579 0.23896937 0.24869525 0.01314989 -#> [31] 0.40605523 0.05629610 0.97706818 0.89750490 0.42905334 0.90458556 -#> [37] 0.46103609 0.92888646 0.38542860 0.91165048 0.50981009 0.36223602 -#> [43] 0.39668231 0.00000000 0.27207087 0.23489024 0.93340462 0.02818688 -#> [49] 0.14345649 0.66958400 +#> [1] 0.34452385 0.63914002 0.26494808 0.70112701 0.21578626 0.64843385 +#> [7] 0.60595484 0.89112367 0.85166760 0.81653556 0.54621678 0.43085156 +#> [13] 0.69842320 0.33468166 0.62442328 0.43939962 0.89237127 0.55715633 +#> [19] 0.69615512 0.04067676 0.38128547 0.60056953 0.43289440 0.32342231 +#> [25] 0.52432800 0.78629430 0.38427329 0.91270870 0.77193855 0.45730293 +#> [31] 0.52881642 0.82842972 0.14757170 0.20155017 0.36774229 0.00000000 +#> [37] 0.08560456 0.13003248 0.78380793 0.62389790 0.59271872 0.79877982 +#> [43] 0.04576317 0.89024866 0.68575724 0.44521443 0.82242402 0.40278808 +#> [49] 0.49002454 0.40091980 rescale_mid(1) #> [1] 0.5 diff --git a/dev/reference/timespan_trans-3.png b/dev/reference/timespan_trans-3.png index 5f995385..d3ec49b6 100644 Binary files a/dev/reference/timespan_trans-3.png and b/dev/reference/timespan_trans-3.png differ diff --git a/dev/search.json b/dev/search.json index 7e30a5c1..2ca76f10 100644 --- a/dev/search.json +++ b/dev/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement codeofconduct@posit.co. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://scales.r-lib.org/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 scales authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://scales.r-lib.org/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Hadley Wickham. Author. Thomas Lin Pedersen. Maintainer, author. Dana Seidel. Author. . Copyright holder, funder.","code":""},{"path":"https://scales.r-lib.org/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Wickham H, Pedersen T, Seidel D (2023). scales: Scale Functions Visualization. R package version 1.2.1.9000, https://github.com/r-lib/scales, https://scales.r-lib.org.","code":"@Manual{, title = {scales: Scale Functions for Visualization}, author = {Hadley Wickham and Thomas Lin Pedersen and Dana Seidel}, year = {2023}, note = {R package version 1.2.1.9000, https://github.com/r-lib/scales}, url = {https://scales.r-lib.org}, }"},{"path":"https://scales.r-lib.org/dev/index.html","id":"scales-","dir":"","previous_headings":"","what":"Scale Functions for Visualization","title":"Scale Functions for Visualization","text":"One difficult parts graphics package scaling, converting data values perceptual properties. inverse scaling, making guides (legends axes) can used read graph, often even harder! scales packages provides internal scaling infrastructure used ggplot2, gives tools override default breaks, labels, transformations palettes.","code":""},{"path":"https://scales.r-lib.org/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Scale Functions for Visualization","text":"","code":"# Scales is installed when you install ggplot2 or the tidyverse. # But you can install just scales from CRAN: install.packages(\"scales\") # Or the development version from Github: # install.packages(\"pak\") pak::pak(\"r-lib/scales\")"},{"path":[]},{"path":"https://scales.r-lib.org/dev/index.html","id":"breaks-and-labels","dir":"","previous_headings":"Usage","what":"Breaks and labels","title":"Scale Functions for Visualization","text":"common use scales package control appearance axis legend labels. Use break_ function control breaks generated limits, label_ function control breaks turned labels. Generally, don’t recommend running library(scales) type (e.g.) scales::label_ autocomplete provide list labelling functions jog memory.","code":"library(ggplot2) library(dplyr, warn.conflicts = FALSE) library(lubridate, warn.conflicts = FALSE) txhousing %>% mutate(date = make_date(year, month, 1)) %>% group_by(city) %>% filter(min(sales) > 5e2) %>% ggplot(aes(date, sales, group = city)) + geom_line(na.rm = TRUE) + scale_x_date( NULL, breaks = scales::breaks_width(\"2 years\"), labels = scales::label_date(\"'%y\") ) + scale_y_log10( \"Total sales\", labels = scales::label_number(scale_cut = scales::cut_short_scale()) ) economics %>% filter(date < ymd(\"1970-01-01\")) %>% ggplot(aes(date, pce)) + geom_line() + scale_x_date(NULL, breaks = scales::breaks_width(\"3 months\"), labels = scales::label_date_short() ) + scale_y_continuous(\"Personal consumption expenditures\", breaks = scales::breaks_extended(8), labels = scales::label_dollar() )"},{"path":"https://scales.r-lib.org/dev/index.html","id":"advanced-features","dir":"","previous_headings":"Usage","what":"Advanced features","title":"Scale Functions for Visualization","text":"Scales colour palettes used power scales ggplot2, can use plotting system. following example shows might apply base plot. scales also gives users ability define apply custom transformation functions repeated use.","code":"library(scales) # pull a list of colours from any palette viridis_pal()(4) #> [1] \"#440154FF\" \"#31688EFF\" \"#35B779FF\" \"#FDE725FF\" # use in combination with baseR `palette()` to set new defaults palette(brewer_pal(palette = \"Set2\")(4)) par(mar = c(5, 5, 1, 1)) plot(Sepal.Length ~ Sepal.Width, data = iris, col = Species, pch = 20) # use trans_new to build a new transformation logp3_trans <- trans_new( name = \"logp\", transform = function(x) log(x + 3), inverse = function(x) exp(x) - 3, breaks = log_breaks() ) dsamp <- sample_n(diamonds, 100) ggplot(dsamp, aes(carat, price, colour = color)) + geom_point() + scale_y_continuous(trans = logp3_trans)"},{"path":"https://scales.r-lib.org/dev/reference/Range.html","id":null,"dir":"Reference","previous_headings":"","what":"Mutable ranges — Range","title":"Mutable ranges — Range","text":"Mutable ranges two methods (train reset), make possible build complete ranges multiple passes.","code":""},{"path":"https://scales.r-lib.org/dev/reference/alpha.html","id":null,"dir":"Reference","previous_headings":"","what":"Modify colour transparency — alpha","title":"Modify colour transparency — alpha","text":"Vectorised colour alpha.","code":""},{"path":"https://scales.r-lib.org/dev/reference/alpha.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Modify colour transparency — alpha","text":"","code":"alpha(colour, alpha = NA)"},{"path":"https://scales.r-lib.org/dev/reference/alpha.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Modify colour transparency — alpha","text":"colour colour alpha new alpha level [0,1]. alpha NA, existing alpha values preserved.","code":""},{"path":"https://scales.r-lib.org/dev/reference/alpha.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Modify colour transparency — alpha","text":"","code":"alpha(\"red\", 0.1) #> [1] \"#FF00001A\" alpha(colours(), 0.5) #> [1] \"#FFFFFF80\" \"#F0F8FF80\" \"#FAEBD780\" \"#FFEFDB80\" \"#EEDFCC80\" #> [6] \"#CDC0B080\" \"#8B837880\" \"#7FFFD480\" \"#7FFFD480\" \"#76EEC680\" #> [11] \"#66CDAA80\" \"#458B7480\" \"#F0FFFF80\" \"#F0FFFF80\" \"#E0EEEE80\" #> [16] \"#C1CDCD80\" \"#838B8B80\" \"#F5F5DC80\" \"#FFE4C480\" \"#FFE4C480\" #> [21] \"#EED5B780\" \"#CDB79E80\" \"#8B7D6B80\" \"#00000080\" \"#FFEBCD80\" #> [26] \"#0000FF80\" \"#0000FF80\" \"#0000EE80\" \"#0000CD80\" \"#00008B80\" #> [31] \"#8A2BE280\" \"#A52A2A80\" \"#FF404080\" \"#EE3B3B80\" \"#CD333380\" #> [36] \"#8B232380\" \"#DEB88780\" \"#FFD39B80\" \"#EEC59180\" \"#CDAA7D80\" #> [41] \"#8B735580\" \"#5F9EA080\" \"#98F5FF80\" \"#8EE5EE80\" \"#7AC5CD80\" #> [46] \"#53868B80\" \"#7FFF0080\" \"#7FFF0080\" \"#76EE0080\" \"#66CD0080\" #> [51] \"#458B0080\" \"#D2691E80\" \"#FF7F2480\" \"#EE762180\" \"#CD661D80\" #> [56] \"#8B451380\" \"#FF7F5080\" \"#FF725680\" \"#EE6A5080\" \"#CD5B4580\" #> [61] \"#8B3E2F80\" \"#6495ED80\" \"#FFF8DC80\" \"#FFF8DC80\" \"#EEE8CD80\" #> [66] \"#CDC8B180\" \"#8B887880\" \"#00FFFF80\" \"#00FFFF80\" \"#00EEEE80\" #> [71] \"#00CDCD80\" \"#008B8B80\" \"#00008B80\" \"#008B8B80\" \"#B8860B80\" #> [76] \"#FFB90F80\" \"#EEAD0E80\" \"#CD950C80\" \"#8B650880\" \"#A9A9A980\" #> [81] \"#00640080\" \"#A9A9A980\" \"#BDB76B80\" \"#8B008B80\" \"#556B2F80\" #> [86] \"#CAFF7080\" \"#BCEE6880\" \"#A2CD5A80\" \"#6E8B3D80\" \"#FF8C0080\" #> [91] \"#FF7F0080\" \"#EE760080\" \"#CD660080\" \"#8B450080\" \"#9932CC80\" #> [96] \"#BF3EFF80\" \"#B23AEE80\" \"#9A32CD80\" \"#68228B80\" \"#8B000080\" #> [101] \"#E9967A80\" \"#8FBC8F80\" \"#C1FFC180\" \"#B4EEB480\" \"#9BCD9B80\" #> [106] \"#698B6980\" \"#483D8B80\" \"#2F4F4F80\" \"#97FFFF80\" \"#8DEEEE80\" #> [111] \"#79CDCD80\" \"#528B8B80\" \"#2F4F4F80\" \"#00CED180\" \"#9400D380\" #> [116] \"#FF149380\" \"#FF149380\" \"#EE128980\" \"#CD107680\" \"#8B0A5080\" #> [121] \"#00BFFF80\" \"#00BFFF80\" \"#00B2EE80\" \"#009ACD80\" \"#00688B80\" #> [126] \"#69696980\" \"#69696980\" \"#1E90FF80\" \"#1E90FF80\" \"#1C86EE80\" #> [131] \"#1874CD80\" \"#104E8B80\" \"#B2222280\" \"#FF303080\" \"#EE2C2C80\" #> [136] \"#CD262680\" \"#8B1A1A80\" \"#FFFAF080\" \"#228B2280\" \"#DCDCDC80\" #> [141] \"#F8F8FF80\" \"#FFD70080\" \"#FFD70080\" \"#EEC90080\" \"#CDAD0080\" #> [146] \"#8B750080\" \"#DAA52080\" \"#FFC12580\" \"#EEB42280\" \"#CD9B1D80\" #> [151] \"#8B691480\" \"#BEBEBE80\" \"#00000080\" \"#03030380\" \"#05050580\" #> [156] \"#08080880\" \"#0A0A0A80\" \"#0D0D0D80\" \"#0F0F0F80\" \"#12121280\" #> [161] \"#14141480\" \"#17171780\" \"#1A1A1A80\" \"#1C1C1C80\" \"#1F1F1F80\" #> [166] \"#21212180\" \"#24242480\" \"#26262680\" \"#29292980\" \"#2B2B2B80\" #> [171] \"#2E2E2E80\" \"#30303080\" \"#33333380\" \"#36363680\" \"#38383880\" #> [176] \"#3B3B3B80\" \"#3D3D3D80\" \"#40404080\" \"#42424280\" \"#45454580\" #> [181] \"#47474780\" \"#4A4A4A80\" \"#4D4D4D80\" \"#4F4F4F80\" \"#52525280\" #> [186] \"#54545480\" \"#57575780\" \"#59595980\" \"#5C5C5C80\" \"#5E5E5E80\" #> [191] \"#61616180\" \"#63636380\" \"#66666680\" \"#69696980\" \"#6B6B6B80\" #> [196] \"#6E6E6E80\" \"#70707080\" \"#73737380\" \"#75757580\" \"#78787880\" #> [201] \"#7A7A7A80\" \"#7D7D7D80\" \"#7F7F7F80\" \"#82828280\" \"#85858580\" #> [206] \"#87878780\" \"#8A8A8A80\" \"#8C8C8C80\" \"#8F8F8F80\" \"#91919180\" #> [211] \"#94949480\" \"#96969680\" \"#99999980\" \"#9C9C9C80\" \"#9E9E9E80\" #> [216] \"#A1A1A180\" \"#A3A3A380\" \"#A6A6A680\" \"#A8A8A880\" \"#ABABAB80\" #> [221] \"#ADADAD80\" \"#B0B0B080\" \"#B3B3B380\" \"#B5B5B580\" \"#B8B8B880\" #> [226] \"#BABABA80\" \"#BDBDBD80\" \"#BFBFBF80\" \"#C2C2C280\" \"#C4C4C480\" #> [231] \"#C7C7C780\" \"#C9C9C980\" \"#CCCCCC80\" \"#CFCFCF80\" \"#D1D1D180\" #> [236] \"#D4D4D480\" \"#D6D6D680\" \"#D9D9D980\" \"#DBDBDB80\" \"#DEDEDE80\" #> [241] \"#E0E0E080\" \"#E3E3E380\" \"#E5E5E580\" \"#E8E8E880\" \"#EBEBEB80\" #> [246] \"#EDEDED80\" \"#F0F0F080\" \"#F2F2F280\" \"#F5F5F580\" \"#F7F7F780\" #> [251] \"#FAFAFA80\" \"#FCFCFC80\" \"#FFFFFF80\" \"#00FF0080\" \"#00FF0080\" #> [256] \"#00EE0080\" \"#00CD0080\" \"#008B0080\" \"#ADFF2F80\" \"#BEBEBE80\" #> [261] \"#00000080\" \"#03030380\" \"#05050580\" \"#08080880\" \"#0A0A0A80\" #> [266] \"#0D0D0D80\" \"#0F0F0F80\" \"#12121280\" \"#14141480\" \"#17171780\" #> [271] \"#1A1A1A80\" \"#1C1C1C80\" \"#1F1F1F80\" \"#21212180\" \"#24242480\" #> [276] \"#26262680\" \"#29292980\" \"#2B2B2B80\" \"#2E2E2E80\" \"#30303080\" #> [281] \"#33333380\" \"#36363680\" \"#38383880\" \"#3B3B3B80\" \"#3D3D3D80\" #> [286] \"#40404080\" \"#42424280\" \"#45454580\" \"#47474780\" \"#4A4A4A80\" #> [291] \"#4D4D4D80\" \"#4F4F4F80\" \"#52525280\" \"#54545480\" \"#57575780\" #> [296] \"#59595980\" \"#5C5C5C80\" \"#5E5E5E80\" \"#61616180\" \"#63636380\" #> [301] \"#66666680\" \"#69696980\" \"#6B6B6B80\" \"#6E6E6E80\" \"#70707080\" #> [306] \"#73737380\" \"#75757580\" \"#78787880\" \"#7A7A7A80\" \"#7D7D7D80\" #> [311] \"#7F7F7F80\" \"#82828280\" \"#85858580\" \"#87878780\" \"#8A8A8A80\" #> [316] \"#8C8C8C80\" \"#8F8F8F80\" \"#91919180\" \"#94949480\" \"#96969680\" #> [321] \"#99999980\" \"#9C9C9C80\" \"#9E9E9E80\" \"#A1A1A180\" \"#A3A3A380\" #> [326] \"#A6A6A680\" \"#A8A8A880\" \"#ABABAB80\" \"#ADADAD80\" \"#B0B0B080\" #> [331] \"#B3B3B380\" \"#B5B5B580\" \"#B8B8B880\" \"#BABABA80\" \"#BDBDBD80\" #> [336] \"#BFBFBF80\" \"#C2C2C280\" \"#C4C4C480\" \"#C7C7C780\" \"#C9C9C980\" #> [341] \"#CCCCCC80\" \"#CFCFCF80\" \"#D1D1D180\" \"#D4D4D480\" \"#D6D6D680\" #> [346] \"#D9D9D980\" \"#DBDBDB80\" \"#DEDEDE80\" \"#E0E0E080\" \"#E3E3E380\" #> [351] \"#E5E5E580\" \"#E8E8E880\" \"#EBEBEB80\" \"#EDEDED80\" \"#F0F0F080\" #> [356] \"#F2F2F280\" \"#F5F5F580\" \"#F7F7F780\" \"#FAFAFA80\" \"#FCFCFC80\" #> [361] \"#FFFFFF80\" \"#F0FFF080\" \"#F0FFF080\" \"#E0EEE080\" \"#C1CDC180\" #> [366] \"#838B8380\" \"#FF69B480\" \"#FF6EB480\" \"#EE6AA780\" \"#CD609080\" #> [371] \"#8B3A6280\" \"#CD5C5C80\" \"#FF6A6A80\" \"#EE636380\" \"#CD555580\" #> [376] \"#8B3A3A80\" \"#FFFFF080\" \"#FFFFF080\" \"#EEEEE080\" \"#CDCDC180\" #> [381] \"#8B8B8380\" \"#F0E68C80\" \"#FFF68F80\" \"#EEE68580\" \"#CDC67380\" #> [386] \"#8B864E80\" \"#E6E6FA80\" \"#FFF0F580\" \"#FFF0F580\" \"#EEE0E580\" #> [391] \"#CDC1C580\" \"#8B838680\" \"#7CFC0080\" \"#FFFACD80\" \"#FFFACD80\" #> [396] \"#EEE9BF80\" \"#CDC9A580\" \"#8B897080\" \"#ADD8E680\" \"#BFEFFF80\" #> [401] \"#B2DFEE80\" \"#9AC0CD80\" \"#68838B80\" \"#F0808080\" \"#E0FFFF80\" #> [406] \"#E0FFFF80\" \"#D1EEEE80\" \"#B4CDCD80\" \"#7A8B8B80\" \"#EEDD8280\" #> [411] \"#FFEC8B80\" \"#EEDC8280\" \"#CDBE7080\" \"#8B814C80\" \"#FAFAD280\" #> [416] \"#D3D3D380\" \"#90EE9080\" \"#D3D3D380\" \"#FFB6C180\" \"#FFAEB980\" #> [421] \"#EEA2AD80\" \"#CD8C9580\" \"#8B5F6580\" \"#FFA07A80\" \"#FFA07A80\" #> [426] \"#EE957280\" \"#CD816280\" \"#8B574280\" \"#20B2AA80\" \"#87CEFA80\" #> [431] \"#B0E2FF80\" \"#A4D3EE80\" \"#8DB6CD80\" \"#607B8B80\" \"#8470FF80\" #> [436] \"#77889980\" \"#77889980\" \"#B0C4DE80\" \"#CAE1FF80\" \"#BCD2EE80\" #> [441] \"#A2B5CD80\" \"#6E7B8B80\" \"#FFFFE080\" \"#FFFFE080\" \"#EEEED180\" #> [446] \"#CDCDB480\" \"#8B8B7A80\" \"#32CD3280\" \"#FAF0E680\" \"#FF00FF80\" #> [451] \"#FF00FF80\" \"#EE00EE80\" \"#CD00CD80\" \"#8B008B80\" \"#B0306080\" #> [456] \"#FF34B380\" \"#EE30A780\" \"#CD299080\" \"#8B1C6280\" \"#66CDAA80\" #> [461] \"#0000CD80\" \"#BA55D380\" \"#E066FF80\" \"#D15FEE80\" \"#B452CD80\" #> [466] \"#7A378B80\" \"#9370DB80\" \"#AB82FF80\" \"#9F79EE80\" \"#8968CD80\" #> [471] \"#5D478B80\" \"#3CB37180\" \"#7B68EE80\" \"#00FA9A80\" \"#48D1CC80\" #> [476] \"#C7158580\" \"#19197080\" \"#F5FFFA80\" \"#FFE4E180\" \"#FFE4E180\" #> [481] \"#EED5D280\" \"#CDB7B580\" \"#8B7D7B80\" \"#FFE4B580\" \"#FFDEAD80\" #> [486] \"#FFDEAD80\" \"#EECFA180\" \"#CDB38B80\" \"#8B795E80\" \"#00008080\" #> [491] \"#00008080\" \"#FDF5E680\" \"#6B8E2380\" \"#C0FF3E80\" \"#B3EE3A80\" #> [496] \"#9ACD3280\" \"#698B2280\" \"#FFA50080\" \"#FFA50080\" \"#EE9A0080\" #> [501] \"#CD850080\" \"#8B5A0080\" \"#FF450080\" \"#FF450080\" \"#EE400080\" #> [506] \"#CD370080\" \"#8B250080\" \"#DA70D680\" \"#FF83FA80\" \"#EE7AE980\" #> [511] \"#CD69C980\" \"#8B478980\" \"#EEE8AA80\" \"#98FB9880\" \"#9AFF9A80\" #> [516] \"#90EE9080\" \"#7CCD7C80\" \"#548B5480\" \"#AFEEEE80\" \"#BBFFFF80\" #> [521] \"#AEEEEE80\" \"#96CDCD80\" \"#668B8B80\" \"#DB709380\" \"#FF82AB80\" #> [526] \"#EE799F80\" \"#CD688980\" \"#8B475D80\" \"#FFEFD580\" \"#FFDAB980\" #> [531] \"#FFDAB980\" \"#EECBAD80\" \"#CDAF9580\" \"#8B776580\" \"#CD853F80\" #> [536] \"#FFC0CB80\" \"#FFB5C580\" \"#EEA9B880\" \"#CD919E80\" \"#8B636C80\" #> [541] \"#DDA0DD80\" \"#FFBBFF80\" \"#EEAEEE80\" \"#CD96CD80\" \"#8B668B80\" #> [546] \"#B0E0E680\" \"#A020F080\" \"#9B30FF80\" \"#912CEE80\" \"#7D26CD80\" #> [551] \"#551A8B80\" \"#FF000080\" \"#FF000080\" \"#EE000080\" \"#CD000080\" #> [556] \"#8B000080\" \"#BC8F8F80\" \"#FFC1C180\" \"#EEB4B480\" \"#CD9B9B80\" #> [561] \"#8B696980\" \"#4169E180\" \"#4876FF80\" \"#436EEE80\" \"#3A5FCD80\" #> [566] \"#27408B80\" \"#8B451380\" \"#FA807280\" \"#FF8C6980\" \"#EE826280\" #> [571] \"#CD705480\" \"#8B4C3980\" \"#F4A46080\" \"#2E8B5780\" \"#54FF9F80\" #> [576] \"#4EEE9480\" \"#43CD8080\" \"#2E8B5780\" \"#FFF5EE80\" \"#FFF5EE80\" #> [581] \"#EEE5DE80\" \"#CDC5BF80\" \"#8B868280\" \"#A0522D80\" \"#FF824780\" #> [586] \"#EE794280\" \"#CD683980\" \"#8B472680\" \"#87CEEB80\" \"#87CEFF80\" #> [591] \"#7EC0EE80\" \"#6CA6CD80\" \"#4A708B80\" \"#6A5ACD80\" \"#836FFF80\" #> [596] \"#7A67EE80\" \"#6959CD80\" \"#473C8B80\" \"#70809080\" \"#C6E2FF80\" #> [601] \"#B9D3EE80\" \"#9FB6CD80\" \"#6C7B8B80\" \"#70809080\" \"#FFFAFA80\" #> [606] \"#FFFAFA80\" \"#EEE9E980\" \"#CDC9C980\" \"#8B898980\" \"#00FF7F80\" #> [611] \"#00FF7F80\" \"#00EE7680\" \"#00CD6680\" \"#008B4580\" \"#4682B480\" #> [616] \"#63B8FF80\" \"#5CACEE80\" \"#4F94CD80\" \"#36648B80\" \"#D2B48C80\" #> [621] \"#FFA54F80\" \"#EE9A4980\" \"#CD853F80\" \"#8B5A2B80\" \"#D8BFD880\" #> [626] \"#FFE1FF80\" \"#EED2EE80\" \"#CDB5CD80\" \"#8B7B8B80\" \"#FF634780\" #> [631] \"#FF634780\" \"#EE5C4280\" \"#CD4F3980\" \"#8B362680\" \"#40E0D080\" #> [636] \"#00F5FF80\" \"#00E5EE80\" \"#00C5CD80\" \"#00868B80\" \"#EE82EE80\" #> [641] \"#D0209080\" \"#FF3E9680\" \"#EE3A8C80\" \"#CD327880\" \"#8B225280\" #> [646] \"#F5DEB380\" \"#FFE7BA80\" \"#EED8AE80\" \"#CDBA9680\" \"#8B7E6680\" #> [651] \"#F5F5F580\" \"#FFFF0080\" \"#FFFF0080\" \"#EEEE0080\" \"#CDCD0080\" #> [656] \"#8B8B0080\" \"#9ACD3280\" alpha(\"red\", seq(0, 1, length.out = 10)) #> [1] \"#FF000000\" \"#FF00001C\" \"#FF000039\" \"#FF000055\" \"#FF000071\" #> [6] \"#FF00008E\" \"#FF0000AA\" \"#FF0000C6\" \"#FF0000E3\" \"#FF0000\" alpha(c(\"first\" = \"gold\", \"second\" = \"lightgray\", \"third\" = \"#cd7f32\"), .5) #> first second third #> \"#FFD70080\" \"#D3D3D380\" \"#CD7F3280\""},{"path":"https://scales.r-lib.org/dev/reference/area_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Area palettes (continuous) — area_pal","title":"Area palettes (continuous) — area_pal","text":"Area palettes (continuous)","code":""},{"path":"https://scales.r-lib.org/dev/reference/area_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Area palettes (continuous) — area_pal","text":"","code":"area_pal(range = c(1, 6)) abs_area(max)"},{"path":"https://scales.r-lib.org/dev/reference/area_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Area palettes (continuous) — area_pal","text":"range Numeric vector length two, giving range possible sizes. greater 0. max number representing maximum size.","code":""},{"path":"https://scales.r-lib.org/dev/reference/asinh_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Inverse Hyperbolic Sine transformation — asinh_trans","title":"Inverse Hyperbolic Sine transformation — asinh_trans","text":"Inverse Hyperbolic Sine transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/asinh_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Inverse Hyperbolic Sine transformation — asinh_trans","text":"","code":"asinh_trans()"},{"path":"https://scales.r-lib.org/dev/reference/asinh_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Inverse Hyperbolic Sine transformation — asinh_trans","text":"","code":"plot(asinh_trans(), xlim = c(-1e2, 1e2))"},{"path":"https://scales.r-lib.org/dev/reference/asn_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Arc-sin square root transformation — asn_trans","title":"Arc-sin square root transformation — asn_trans","text":"variance stabilising transformation binomial distribution.","code":""},{"path":"https://scales.r-lib.org/dev/reference/asn_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arc-sin square root transformation — asn_trans","text":"","code":"asn_trans()"},{"path":"https://scales.r-lib.org/dev/reference/asn_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Arc-sin square root transformation — asn_trans","text":"","code":"plot(asn_trans(), xlim = c(0, 1))"},{"path":"https://scales.r-lib.org/dev/reference/atanh_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Arc-tangent transformation — atanh_trans","title":"Arc-tangent transformation — atanh_trans","text":"Arc-tangent transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/atanh_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arc-tangent transformation — atanh_trans","text":"","code":"atanh_trans()"},{"path":"https://scales.r-lib.org/dev/reference/atanh_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Arc-tangent transformation — atanh_trans","text":"","code":"plot(atanh_trans(), xlim = c(-1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/boxcox_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Box-Cox & modulus transformations — boxcox_trans","title":"Box-Cox & modulus transformations — boxcox_trans","text":"Box-Cox transformation flexible transformation, often used transform data towards normality. modulus transformation generalises Box-Cox also work negative values.","code":""},{"path":"https://scales.r-lib.org/dev/reference/boxcox_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Box-Cox & modulus transformations — boxcox_trans","text":"","code":"boxcox_trans(p, offset = 0) modulus_trans(p, offset = 1)"},{"path":"https://scales.r-lib.org/dev/reference/boxcox_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Box-Cox & modulus transformations — boxcox_trans","text":"p Transformation exponent, \\(\\lambda\\). offset Constant offset. 0 Box-Cox type 1, otherwise non-negative constant (Box-Cox type 2). modulus_trans() sets default 1.","code":""},{"path":"https://scales.r-lib.org/dev/reference/boxcox_trans.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Box-Cox & modulus transformations — boxcox_trans","text":"Box-Cox power transformation (type 1) requires strictly positive values takes following form y > 0: $$y^{(\\lambda)} = \\frac{y^\\lambda - 1}{\\lambda}$$ y = 0, natural log transform used. modulus transformation implements generalisation Box-Cox transformation works data positive negative values. equation takes following forms, y != 0 : $$y^{(\\lambda)} = sign(y) * \\frac{(|y| + 1)^\\lambda - 1}{\\lambda}$$ y = 0: $$y^{(\\lambda)} = sign(y) * \\ln(|y| + 1)$$","code":""},{"path":"https://scales.r-lib.org/dev/reference/boxcox_trans.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Box-Cox & modulus transformations — boxcox_trans","text":"Box, G. E., & Cox, D. R. (1964). analysis transformations. Journal Royal Statistical Society. Series B (Methodological), 211-252. https://www.jstor.org/stable/2984418 John, J. ., & Draper, N. R. (1980). alternative family transformations. Applied Statistics, 190-197. https://www.jstor.org/stable/2986305","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/boxcox_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Box-Cox & modulus transformations — boxcox_trans","text":"","code":"plot(boxcox_trans(-1), xlim = c(0, 10)) plot(boxcox_trans(0), xlim = c(0, 10)) plot(boxcox_trans(1), xlim = c(0, 10)) plot(boxcox_trans(2), xlim = c(0, 10)) plot(modulus_trans(-1), xlim = c(-10, 10)) plot(modulus_trans(0), xlim = c(-10, 10)) plot(modulus_trans(1), xlim = c(-10, 10)) plot(modulus_trans(2), xlim = c(-10, 10))"},{"path":"https://scales.r-lib.org/dev/reference/breaks_extended.html","id":null,"dir":"Reference","previous_headings":"","what":"Automatic breaks for numeric axes — breaks_extended","title":"Automatic breaks for numeric axes — breaks_extended","text":"Uses Wilkinson's extended breaks algorithm implemented labeling package.","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_extended.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Automatic breaks for numeric axes — breaks_extended","text":"","code":"breaks_extended(n = 5, ...)"},{"path":"https://scales.r-lib.org/dev/reference/breaks_extended.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Automatic breaks for numeric axes — breaks_extended","text":"n Desired number breaks. may get slightly fewer breaks requested. ... arguments passed labeling::extended()","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_extended.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Automatic breaks for numeric axes — breaks_extended","text":"Talbot, J., Lin, S., Hanrahan, P. (2010) Extension Wilkinson's Algorithm Positioning Tick Labels Axes, InfoVis 2010 http://vis.stanford.edu/files/2010-TickLabels-InfoVis.pdf.","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_extended.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Automatic breaks for numeric axes — breaks_extended","text":"","code":"demo_continuous(c(0, 10)) #> scale_x_continuous() demo_continuous(c(0, 10), breaks = breaks_extended(3)) #> scale_x_continuous(breaks = breaks_extended(3)) demo_continuous(c(0, 10), breaks = breaks_extended(10)) #> scale_x_continuous(breaks = breaks_extended(10))"},{"path":"https://scales.r-lib.org/dev/reference/breaks_log.html","id":null,"dir":"Reference","previous_headings":"","what":"Breaks for log axes — breaks_log","title":"Breaks for log axes — breaks_log","text":"algorithm starts looking integer powers base. provide enough breaks, looks additional intermediate breaks integer multiples integer powers base. fails (can small ranges), fall back extended_breaks()","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_log.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Breaks for log axes — breaks_log","text":"","code":"breaks_log(n = 5, base = 10)"},{"path":"https://scales.r-lib.org/dev/reference/breaks_log.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Breaks for log axes — breaks_log","text":"n desired number breaks base base logarithm use","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_log.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Breaks for log axes — breaks_log","text":"algorithm starts looking set integer powers base cover range data. generate least n - 2 breaks, look integer 1 base splits interval approximately half. example, case base = 10, integer 3 log10(3) = 0.477. leaves 2 intervals: c(1, 3) c(3, 10). still need breaks, look another integer splits largest remaining interval (log-scale) approximately half. base = 10, 5 log10(5) = 0.699. generic algorithm starts set integers steps containing 1 set candidate integers containing integers larger 1 smaller base. remaining candidate integer x, smallest interval (log-scale) vector sort(c(x, steps, base)) calculated. candidate x yields largest minimal interval added steps removed candidate set. repeated either sufficient number breaks, >= n-2, returned candidates used.","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_log.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Breaks for log axes — breaks_log","text":"","code":"demo_log10(c(1, 1e5)) #> scale_x_log10() demo_log10(c(1, 1e6)) #> scale_x_log10() # Request more breaks by setting n demo_log10(c(1, 1e6), breaks = breaks_log(6)) #> scale_x_log10(breaks = breaks_log(6)) # Some tricky ranges demo_log10(c(2000, 9000)) #> scale_x_log10() demo_log10(c(2000, 14000)) #> scale_x_log10() demo_log10(c(2000, 85000), expand = c(0, 0)) #> scale_x_log10(expand = c(0, 0)) # An even smaller range that requires falling back to linear breaks demo_log10(c(1800, 2000)) #> scale_x_log10()"},{"path":"https://scales.r-lib.org/dev/reference/breaks_pretty.html","id":null,"dir":"Reference","previous_headings":"","what":"Pretty breaks for date/times — breaks_pretty","title":"Pretty breaks for date/times — breaks_pretty","text":"Uses default R break algorithm implemented pretty(). primarily useful date/times, extended_breaks() slightly better job numeric scales.","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_pretty.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pretty breaks for date/times — breaks_pretty","text":"","code":"breaks_pretty(n = 5, ...)"},{"path":"https://scales.r-lib.org/dev/reference/breaks_pretty.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pretty breaks for date/times — breaks_pretty","text":"n Desired number breaks. may get slightly fewer breaks requested. ... arguments passed pretty()","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_pretty.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pretty breaks for date/times — breaks_pretty","text":"","code":"one_month <- as.POSIXct(c(\"2020-05-01\", \"2020-06-01\")) demo_datetime(one_month) #> scale_x_datetime() demo_datetime(one_month, breaks = breaks_pretty(2)) #> scale_x_datetime(breaks = breaks_pretty(2)) demo_datetime(one_month, breaks = breaks_pretty(4)) #> scale_x_datetime(breaks = breaks_pretty(4)) # Tightly spaced date breaks often need custom labels too demo_datetime(one_month, breaks = breaks_pretty(12)) #> scale_x_datetime(breaks = breaks_pretty(12)) demo_datetime(one_month, breaks = breaks_pretty(12), labels = label_date_short() ) #> scale_x_datetime(breaks = breaks_pretty(12), labels = label_date_short())"},{"path":"https://scales.r-lib.org/dev/reference/breaks_timespan.html","id":null,"dir":"Reference","previous_headings":"","what":"Breaks for timespan data — breaks_timespan","title":"Breaks for timespan data — breaks_timespan","text":"timespan units span variety bases (1000 seconds, 60 second minutes, 24 hours, 7 days), range input data determines base used calculating breaks","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_timespan.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Breaks for timespan data — breaks_timespan","text":"","code":"breaks_timespan(unit = c(\"secs\", \"mins\", \"hours\", \"days\", \"weeks\"), n = 5)"},{"path":"https://scales.r-lib.org/dev/reference/breaks_timespan.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Breaks for timespan data — breaks_timespan","text":"unit unit used interpret numeric data input n Desired number breaks. may get slightly fewer breaks requested.","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_timespan.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Breaks for timespan data — breaks_timespan","text":"","code":"demo_timespan(seq(0, 100), breaks = breaks_timespan()) #> scale_x_continuous(breaks = breaks_timespan())"},{"path":"https://scales.r-lib.org/dev/reference/breaks_width.html","id":null,"dir":"Reference","previous_headings":"","what":"Equally spaced breaks — breaks_width","title":"Equally spaced breaks — breaks_width","text":"Useful numeric, date, date-time scales.","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_width.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Equally spaced breaks — breaks_width","text":"","code":"breaks_width(width, offset = 0)"},{"path":"https://scales.r-lib.org/dev/reference/breaks_width.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Equally spaced breaks — breaks_width","text":"width Distance break. Either number, date/times, single string form \"{n} {unit}\", e.g. \"1 month\", \"5 days\". Unit can one \"sec\", \"min\", \"hour\", \"day\", \"week\", \"month\", \"year\". offset Use want breaks start zero, conventional date time boundary 1st January midnight. Either number, date/times, single string form \"{n} {unit}\", width. offset can vector, accumulate order given. mostly useful dates, e.g. c(\"3 months\", \"5 days\") offset three months five days, useful UK tax year. Note due way dates rounded, guarantee offset = c(x, y) give result offset = c(y, x).","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_width.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Equally spaced breaks — breaks_width","text":"","code":"demo_continuous(c(0, 100)) #> scale_x_continuous() demo_continuous(c(0, 100), breaks = breaks_width(10)) #> scale_x_continuous(breaks = breaks_width(10)) demo_continuous(c(0, 100), breaks = breaks_width(20, -4)) #> scale_x_continuous(breaks = breaks_width(20, -4)) demo_continuous(c(0, 100), breaks = breaks_width(20, 4)) #> scale_x_continuous(breaks = breaks_width(20, 4)) # This is also useful for dates one_month <- as.POSIXct(c(\"2020-05-01\", \"2020-06-01\")) demo_datetime(one_month) #> scale_x_datetime() demo_datetime(one_month, breaks = breaks_width(\"1 week\")) #> scale_x_datetime(breaks = breaks_width(\"1 week\")) demo_datetime(one_month, breaks = breaks_width(\"5 days\")) #> scale_x_datetime(breaks = breaks_width(\"5 days\")) # This is so useful that scale_x_datetime() has a shorthand: demo_datetime(one_month, date_breaks = \"5 days\") #> scale_x_datetime(date_breaks = \"5 days\") # hms times also work one_hour <- hms::hms(hours = 0:1) demo_time(one_hour) #> scale_x_time() demo_time(one_hour, breaks = breaks_width(\"15 min\")) #> scale_x_time(breaks = breaks_width(\"15 min\")) demo_time(one_hour, breaks = breaks_width(\"600 sec\")) #> scale_x_time(breaks = breaks_width(\"600 sec\")) # Offets are useful for years that begin on dates other than the 1st of # January, such as the UK financial year, which begins on the 1st of April. three_years <- as.POSIXct(c(\"2020-01-01\", \"2021-01-01\", \"2022-01-01\")) demo_datetime( three_years, breaks = breaks_width(\"1 year\", offset = \"3 months\") ) #> scale_x_datetime(breaks = breaks_width(\"1 year\", offset = \"3 months\")) # The offset can be a vector, to create offsets that have compound units, # such as the UK fiscal (tax) year, which begins on the 6th of April. demo_datetime( three_years, breaks = breaks_width(\"1 year\", offset = c(\"3 months\", \"5 days\")) ) #> scale_x_datetime(breaks = breaks_width(\"1 year\", offset = c(\"3 months\", #> \"5 days\")))"},{"path":"https://scales.r-lib.org/dev/reference/brewer_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Colour Brewer palette (discrete) — brewer_pal","title":"Colour Brewer palette (discrete) — brewer_pal","text":"Colour Brewer palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/brewer_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Colour Brewer palette (discrete) — brewer_pal","text":"","code":"brewer_pal(type = \"seq\", palette = 1, direction = 1)"},{"path":"https://scales.r-lib.org/dev/reference/brewer_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Colour Brewer palette (discrete) — brewer_pal","text":"type One \"seq\" (sequential), \"div\" (diverging) \"qual\" (qualitative) palette string, use named palette. number, index list palettes appropriate type direction Sets order colours scale. 1, default, colours output RColorBrewer::brewer.pal(). -1, order colours reversed.","code":""},{"path":"https://scales.r-lib.org/dev/reference/brewer_pal.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Colour Brewer palette (discrete) — brewer_pal","text":"https://colorbrewer2.org","code":""},{"path":"https://scales.r-lib.org/dev/reference/brewer_pal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Colour Brewer palette (discrete) — brewer_pal","text":"","code":"show_col(brewer_pal()(10)) #> Warning: n too large, allowed maximum for palette Blues is 9 #> Returning the palette you asked for with that many colors show_col(brewer_pal(\"div\")(5)) show_col(brewer_pal(palette = \"Greens\")(5)) # Can use with gradient_n to create a continuous gradient cols <- brewer_pal(\"div\")(5) show_col(gradient_n_pal(cols)(seq(0, 1, length.out = 30)))"},{"path":"https://scales.r-lib.org/dev/reference/cbreaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute breaks for continuous scale — cbreaks","title":"Compute breaks for continuous scale — cbreaks","text":"function wraps components needed go continuous range set breaks labels suitable display axes legends.","code":""},{"path":"https://scales.r-lib.org/dev/reference/cbreaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute breaks for continuous scale — cbreaks","text":"","code":"cbreaks(range, breaks = extended_breaks(), labels = scientific_format())"},{"path":"https://scales.r-lib.org/dev/reference/cbreaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute breaks for continuous scale — cbreaks","text":"range numeric vector length 2 giving range underlying data breaks either vector break values, break function make vector breaks given range data labels either vector labels (character vector list expression) format function make vector labels called vector breaks. Labels can specified manually breaks - extremely dangerous supply labels know breaks .","code":""},{"path":"https://scales.r-lib.org/dev/reference/cbreaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute breaks for continuous scale — cbreaks","text":"","code":"cbreaks(c(0, 100)) #> $breaks #> [1] 0 25 50 75 100 #> #> $labels #> [1] \"0.0e+00\" \"2.5e+01\" \"5.0e+01\" \"7.5e+01\" \"1.0e+02\" #> cbreaks(c(0, 100), breaks_pretty(3)) #> $breaks #> [1] 0 50 100 #> #> $labels #> [1] \"0e+00\" \"5e+01\" \"1e+02\" #> cbreaks(c(0, 100), breaks_pretty(10)) #> $breaks #> [1] 0 10 20 30 40 50 60 70 80 90 100 #> #> $labels #> [1] \"0e+00\" \"1e+01\" \"2e+01\" \"3e+01\" \"4e+01\" \"5e+01\" \"6e+01\" \"7e+01\" #> [9] \"8e+01\" \"9e+01\" \"1e+02\" #> cbreaks(c(1, 100), log_breaks()) #> $breaks #> [1] 1 10 100 #> #> $labels #> [1] \"1e+00\" \"1e+01\" \"1e+02\" #> cbreaks(c(1, 1e4), log_breaks()) #> $breaks #> [1] 1 10 100 1000 10000 #> #> $labels #> [1] \"1e+00\" \"1e+01\" \"1e+02\" \"1e+03\" \"1e+04\" #> cbreaks(c(0, 100), labels = math_format()) #> $breaks #> [1] 0 25 50 75 100 #> #> $labels #> expression(10^0, 10^25, 10^50, 10^75, 10^100) #> cbreaks(c(0, 1), labels = percent_format()) #> $breaks #> [1] 0.00 0.25 0.50 0.75 1.00 #> #> $labels #> [1] \"0%\" \"25%\" \"50%\" \"75%\" \"100%\" #> cbreaks(c(0, 1e6), labels = comma_format()) #> $breaks #> [1] 0 250000 500000 750000 1000000 #> #> $labels #> [1] \"0\" \"250,000\" \"500,000\" \"750,000\" \"1,000,000\" #> cbreaks(c(0, 1e6), labels = dollar_format()) #> $breaks #> [1] 0 250000 500000 750000 1000000 #> #> $labels #> [1] \"$0\" \"$250,000\" \"$500,000\" \"$750,000\" \"$1,000,000\" #> cbreaks(c(0, 30), labels = dollar_format()) #> $breaks #> [1] 0 10 20 30 #> #> $labels #> [1] \"$0\" \"$10\" \"$20\" \"$30\" #> # You can also specify them manually: cbreaks(c(0, 100), breaks = c(15, 20, 80)) #> $breaks #> [1] 15 20 80 #> #> $labels #> [1] \"1.5e+01\" \"2.0e+01\" \"8.0e+01\" #> cbreaks(c(0, 100), breaks = c(15, 20, 80), labels = c(1.5, 2.0, 8.0)) #> $breaks #> [1] 15 20 80 #> #> $labels #> [1] \"1.5\" \"2\" \"8\" #> cbreaks(c(0, 100), breaks = c(15, 20, 80), labels = expression(alpha, beta, gamma) ) #> $breaks #> [1] 15 20 80 #> #> $labels #> $labels[[1]] #> alpha #> #> $labels[[2]] #> beta #> #> $labels[[3]] #> gamma #> #>"},{"path":"https://scales.r-lib.org/dev/reference/col2hcl.html","id":null,"dir":"Reference","previous_headings":"","what":"Modify standard R colour in hcl colour space. — col2hcl","title":"Modify standard R colour in hcl colour space. — col2hcl","text":"Transforms rgb hcl, sets non-missing arguments backtransforms rgb.","code":""},{"path":"https://scales.r-lib.org/dev/reference/col2hcl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Modify standard R colour in hcl colour space. — col2hcl","text":"","code":"col2hcl(colour, h = NULL, c = NULL, l = NULL, alpha = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/col2hcl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Modify standard R colour in hcl colour space. — col2hcl","text":"colour character vector colours modified h Hue, [0, 360] c Chroma, [0, 100] l Luminance, [0, 100] alpha Alpha, [0, 1].","code":""},{"path":"https://scales.r-lib.org/dev/reference/col2hcl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Modify standard R colour in hcl colour space. — col2hcl","text":"","code":"reds <- rep(\"red\", 6) show_col(col2hcl(reds, h = seq(0, 180, length = 6))) show_col(col2hcl(reds, c = seq(0, 80, length = 6))) show_col(col2hcl(reds, l = seq(0, 100, length = 6))) show_col(col2hcl(reds, alpha = seq(0, 1, length = 6)))"},{"path":"https://scales.r-lib.org/dev/reference/col_numeric.html","id":null,"dir":"Reference","previous_headings":"","what":"Colour mapping — col_numeric","title":"Colour mapping — col_numeric","text":"Conveniently maps data values (numeric factor/character) colours according given palette, can provided variety formats.","code":""},{"path":"https://scales.r-lib.org/dev/reference/col_numeric.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Colour mapping — col_numeric","text":"","code":"col_numeric( palette, domain, na.color = \"#808080\", alpha = FALSE, reverse = FALSE ) col_bin( palette, domain, bins = 7, pretty = TRUE, na.color = \"#808080\", alpha = FALSE, reverse = FALSE, right = FALSE ) col_quantile( palette, domain, n = 4, probs = seq(0, 1, length.out = n + 1), na.color = \"#808080\", alpha = FALSE, reverse = FALSE, right = FALSE ) col_factor( palette, domain, levels = NULL, ordered = FALSE, na.color = \"#808080\", alpha = FALSE, reverse = FALSE )"},{"path":"https://scales.r-lib.org/dev/reference/col_numeric.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Colour mapping — col_numeric","text":"palette colours colour function values mapped domain possible values can mapped. col_numeric col_bin, can simple numeric range (e.g. c(0, 100)); col_quantile needs representative numeric data; col_factor needs categorical data. NULL, whenever resulting colour function called, x value represent domain. implies function invoked multiple times, encoding values colours may consistent; consistency needed, must provide non-NULL domain. na.color colour return NA values. Note na.color = NA valid. alpha Whether alpha channels respected ignored. TRUE colors without explicit alpha information treated fully opaque. reverse Whether colors (color function) palette used reverse order. example, default order palette goes blue green, reverse = TRUE result colors going green blue. bins Either numeric vector two unique cut points single number (greater equal 2) giving number intervals domain values cut. pretty Whether use function pretty() generate bins argument bins single number. pretty = TRUE, actual number bins may number bins specified. pretty = FALSE, seq() used generate bins breaks may \"pretty\". right parameter supplied base::cut(). See Details n Number equal-size quantiles desired. precise control, use probs argument instead. probs See stats::quantile(). provided, n argument ignored. levels alternate way specifying levels; specified, domain ignored ordered TRUE domain needs coerced factor, treat already correct order","code":""},{"path":"https://scales.r-lib.org/dev/reference/col_numeric.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Colour mapping — col_numeric","text":"function takes single parameter x; called vector numbers (except col_factor, expects factors/characters), #RRGGBB colour strings returned (unless alpha = TRUE case #RRGGBBAA may also possible).","code":""},{"path":"https://scales.r-lib.org/dev/reference/col_numeric.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Colour mapping — col_numeric","text":"col_numeric simple linear mapping continuous numeric data interpolated palette. col_bin also maps continuous numeric data, performs binning based value (see base::cut() function). col_bin defaults cut function include.lowest = TRUE right = FALSE. col_quantile similarly bins numeric data, via stats::quantile() function. col_factor maps factors colours. palette discrete different number colours number factors, interpolation used. palette argument can following: character vector RGB named colours. Examples: palette(), c(\"#000000\", \"#0000FF\", \"#FFFFFF\"), topo.colors(10) name RColorBrewer palette, e.g. \"BuPu\" \"Greens\". full name viridis palette: \"viridis\", \"magma\", \"inferno\", \"plasma\". function receives single value 0 1 returns colour. Examples: colorRamp(c(\"#000000\", \"#FFFFFF\"), interpolate=\"spline\").","code":""},{"path":"https://scales.r-lib.org/dev/reference/col_numeric.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Colour mapping — col_numeric","text":"","code":"pal <- col_bin(\"Greens\", domain = 0:100) show_col(pal(sort(runif(10, 60, 100)))) # Exponential distribution, mapped continuously show_col(col_numeric(\"Blues\", domain = NULL)(sort(rexp(16)))) # Exponential distribution, mapped by interval show_col(col_bin(\"Blues\", domain = NULL, bins = 4)(sort(rexp(16)))) # Exponential distribution, mapped by quantile show_col(col_quantile(\"Blues\", domain = NULL)(sort(rexp(16)))) # Categorical data; by default, the values being coloured span the gamut... show_col(col_factor(\"RdYlBu\", domain = NULL)(LETTERS[1:5])) # ...unless the data is a factor, without droplevels... show_col(col_factor(\"RdYlBu\", domain = NULL)(factor(LETTERS[1:5], levels = LETTERS))) #> Warning: n too large, allowed maximum for palette RdYlBu is 11 #> Returning the palette you asked for with that many colors # ...or the domain is stated explicitly. show_col(col_factor(\"RdYlBu\", levels = LETTERS)(LETTERS[1:5])) #> Warning: n too large, allowed maximum for palette RdYlBu is 11 #> Returning the palette you asked for with that many colors"},{"path":"https://scales.r-lib.org/dev/reference/colour_ramp.html","id":null,"dir":"Reference","previous_headings":"","what":"Fast colour interpolation — colour_ramp","title":"Fast colour interpolation — colour_ramp","text":"Returns function maps interval [0,1] set colours. Interpolation performed CIELAB colour space. Similar colorRamp(space = 'Lab'), hundreds times faster, provides results \"#RRGGBB\" (\"#RRGGBBAA\") character form instead RGB colour matrices.","code":""},{"path":"https://scales.r-lib.org/dev/reference/colour_ramp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fast colour interpolation — colour_ramp","text":"","code":"colour_ramp(colors, na.color = NA, alpha = TRUE)"},{"path":"https://scales.r-lib.org/dev/reference/colour_ramp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fast colour interpolation — colour_ramp","text":"colors Colours interpolate; must valid argument grDevices::col2rgb(). can character vector \"#RRGGBB\" \"#RRGGBBAA\", colour names grDevices::colors(), positive integer indexes grDevices::palette(). na.color colour map NA values (example, \"#606060\" dark grey, \"#00000000\" transparent) values outside [0,1]. Can NA, simply cause NA inserted output. alpha Whether include alpha transparency channels interpolation. TRUE alpha information included interpolation. returned colours provided \"#RRGGBBAA\" format needed, .e., cases colour fully opaque, \"AA\" part equal \"FF\". Fully opaque colours returned \"#RRGGBB\" format. FALSE, alpha information discarded interpolation colours always returned \"#RRGGBB\".","code":""},{"path":"https://scales.r-lib.org/dev/reference/colour_ramp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fast colour interpolation — colour_ramp","text":"function takes numeric vector returns character vector length RGB RGBA hex colours.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/colour_ramp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fast colour interpolation — colour_ramp","text":"","code":"ramp <- colour_ramp(c(\"red\", \"green\", \"blue\")) show_col(ramp(seq(0, 1, length = 12)))"},{"path":"https://scales.r-lib.org/dev/reference/comma.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_number()/label_comma() — comma","title":"Superseded interface to label_number()/label_comma() — comma","text":"functions kept backward compatibility; switch label_number()/label_comma() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/comma.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_number()/label_comma() — comma","text":"","code":"comma( x, accuracy = NULL, scale = 1, prefix = \"\", suffix = \"\", big.mark = \",\", decimal.mark = \".\", trim = TRUE, digits, ... ) number_format( accuracy = NULL, scale = 1, prefix = \"\", suffix = \"\", big.mark = \" \", decimal.mark = \".\", style_positive = c(\"none\", \"plus\"), style_negative = c(\"hyphen\", \"minus\", \"parens\"), scale_cut = NULL, trim = TRUE, ... ) comma_format( accuracy = NULL, scale = 1, prefix = \"\", suffix = \"\", big.mark = \",\", decimal.mark = \".\", trim = TRUE, digits, ... )"},{"path":"https://scales.r-lib.org/dev/reference/comma.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_number()/label_comma() — comma","text":"x numeric vector format. accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). digits Use accuracy instead. ... arguments passed base::format(). style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\".","code":""},{"path":"https://scales.r-lib.org/dev/reference/compose_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Compose two or more transformations together — compose_trans","title":"Compose two or more transformations together — compose_trans","text":"transformer provides general mechanism composing two transformers together. important use case combine reverse transformations.","code":""},{"path":"https://scales.r-lib.org/dev/reference/compose_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compose two or more transformations together — compose_trans","text":"","code":"compose_trans(...)"},{"path":"https://scales.r-lib.org/dev/reference/compose_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compose two or more transformations together — compose_trans","text":"... One transformers, either specified string individual transformer objects.","code":""},{"path":"https://scales.r-lib.org/dev/reference/compose_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compose two or more transformations together — compose_trans","text":"","code":"demo_continuous(10^c(-2:4), trans = \"log10\", labels = label_log()) #> scale_x_continuous(trans = \"log10\", labels = label_log()) demo_continuous(10^c(-2:4), trans = c(\"log10\", \"reverse\"), labels = label_log()) #> scale_x_continuous(trans = c(\"log10\", \"reverse\"), labels = label_log())"},{"path":"https://scales.r-lib.org/dev/reference/cscale.html","id":null,"dir":"Reference","previous_headings":"","what":"Continuous scale — cscale","title":"Continuous scale — cscale","text":"Continuous scale","code":""},{"path":"https://scales.r-lib.org/dev/reference/cscale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Continuous scale — cscale","text":"","code":"cscale(x, palette, na.value = NA_real_, trans = identity_trans())"},{"path":"https://scales.r-lib.org/dev/reference/cscale.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Continuous scale — cscale","text":"x vector continuous values scale palette palette use. Built palettes: area_pal, brewer_pal, dichromat_pal, div_gradient_pal, gradient_n_pal, grey_pal, hue_pal, identity_pal, linetype_pal, manual_pal, rescale_pal, seq_gradient_pal, shape_pal, viridis_pal na.value value use missing values trans transformation object describing transform raw data prior scaling. Defaults identity transformation leaves data unchanged. Built transformations: asinh_trans, asn_trans, atanh_trans, boxcox_trans, compose_trans, date_trans, exp_trans, hms_trans, identity_trans, log_trans, log10_trans, log1p_trans, log2_trans, logit_trans, modulus_trans, probability_trans, probit_trans, pseudo_log_trans, reciprocal_trans, reverse_trans, sqrt_trans, time_trans, timespan_trans, yj_trans .","code":""},{"path":"https://scales.r-lib.org/dev/reference/cscale.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Continuous scale — cscale","text":"","code":"with(mtcars, plot(disp, mpg, cex = cscale(hp, rescale_pal()))) with(mtcars, plot(disp, mpg, cex = cscale(hp, rescale_pal(), trans = sqrt_trans() ))) with(mtcars, plot(disp, mpg, cex = cscale(hp, area_pal()))) with(mtcars, plot(disp, mpg, pch = 20, cex = 5, col = cscale(hp, seq_gradient_pal(\"grey80\", \"black\")) ))"},{"path":"https://scales.r-lib.org/dev/reference/date_breaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Regularly spaced dates — date_breaks","title":"Regularly spaced dates — date_breaks","text":"Use breaks_width() instead.","code":""},{"path":"https://scales.r-lib.org/dev/reference/date_breaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Regularly spaced dates — date_breaks","text":"","code":"date_breaks(width = \"1 month\")"},{"path":"https://scales.r-lib.org/dev/reference/date_breaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Regularly spaced dates — date_breaks","text":"width interval specification, one \"sec\", \"min\", \"hour\", \"day\", \"week\", \"month\", \"year\". Can integer space, followed \"s\". Fractional seconds supported.","code":""},{"path":"https://scales.r-lib.org/dev/reference/date_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_date()/label_time() — date_format","title":"Superseded interface to label_date()/label_time() — date_format","text":"functions kept backward compatibility; switch [label_date()/label_time() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/date_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_date()/label_time() — date_format","text":"","code":"date_format(format = \"%Y-%m-%d\", tz = \"UTC\", locale = NULL) time_format(format = \"%H:%M:%S\", tz = \"UTC\", locale = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/date_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_date()/label_time() — date_format","text":"format date_format() time_format() date/time format string using standard POSIX specification. See strptime() details. date_short() character vector length 4 giving format components use year, month, day, hour respectively. tz time zone name, see timezones(). Defaults UTC locale Locale use day month names. default uses current locale. Setting argument requires stringi, can see complete list supported locales stringi::stri_locale_list().","code":""},{"path":"https://scales.r-lib.org/dev/reference/date_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Transformation for dates (class Date) — date_trans","title":"Transformation for dates (class Date) — date_trans","text":"Transformation dates (class Date)","code":""},{"path":"https://scales.r-lib.org/dev/reference/date_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transformation for dates (class Date) — date_trans","text":"","code":"date_trans()"},{"path":"https://scales.r-lib.org/dev/reference/date_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Transformation for dates (class Date) — date_trans","text":"","code":"years <- seq(as.Date(\"1910/1/1\"), as.Date(\"1999/1/1\"), \"years\") t <- date_trans() t$transform(years) #> [1] -21915 -21550 -21185 -20819 -20454 -20089 -19724 -19358 -18993 -18628 #> [11] -18263 -17897 -17532 -17167 -16802 -16436 -16071 -15706 -15341 -14975 #> [21] -14610 -14245 -13880 -13514 -13149 -12784 -12419 -12053 -11688 -11323 #> [31] -10958 -10592 -10227 -9862 -9497 -9131 -8766 -8401 -8036 -7670 #> [41] -7305 -6940 -6575 -6209 -5844 -5479 -5114 -4748 -4383 -4018 #> [51] -3653 -3287 -2922 -2557 -2192 -1826 -1461 -1096 -731 -365 #> [61] 0 365 730 1096 1461 1826 2191 2557 2922 3287 #> [71] 3652 4018 4383 4748 5113 5479 5844 6209 6574 6940 #> [81] 7305 7670 8035 8401 8766 9131 9496 9862 10227 10592 t$inverse(t$transform(years)) #> [1] \"1910-01-01\" \"1911-01-01\" \"1912-01-01\" \"1913-01-01\" \"1914-01-01\" #> [6] \"1915-01-01\" \"1916-01-01\" \"1917-01-01\" \"1918-01-01\" \"1919-01-01\" #> [11] \"1920-01-01\" \"1921-01-01\" \"1922-01-01\" \"1923-01-01\" \"1924-01-01\" #> [16] \"1925-01-01\" \"1926-01-01\" \"1927-01-01\" \"1928-01-01\" \"1929-01-01\" #> [21] \"1930-01-01\" \"1931-01-01\" \"1932-01-01\" \"1933-01-01\" \"1934-01-01\" #> [26] \"1935-01-01\" \"1936-01-01\" \"1937-01-01\" \"1938-01-01\" \"1939-01-01\" #> [31] \"1940-01-01\" \"1941-01-01\" \"1942-01-01\" \"1943-01-01\" \"1944-01-01\" #> [36] \"1945-01-01\" \"1946-01-01\" \"1947-01-01\" \"1948-01-01\" \"1949-01-01\" #> [41] \"1950-01-01\" \"1951-01-01\" \"1952-01-01\" \"1953-01-01\" \"1954-01-01\" #> [46] \"1955-01-01\" \"1956-01-01\" \"1957-01-01\" \"1958-01-01\" \"1959-01-01\" #> [51] \"1960-01-01\" \"1961-01-01\" \"1962-01-01\" \"1963-01-01\" \"1964-01-01\" #> [56] \"1965-01-01\" \"1966-01-01\" \"1967-01-01\" \"1968-01-01\" \"1969-01-01\" #> [61] \"1970-01-01\" \"1971-01-01\" \"1972-01-01\" \"1973-01-01\" \"1974-01-01\" #> [66] \"1975-01-01\" \"1976-01-01\" \"1977-01-01\" \"1978-01-01\" \"1979-01-01\" #> [71] \"1980-01-01\" \"1981-01-01\" \"1982-01-01\" \"1983-01-01\" \"1984-01-01\" #> [76] \"1985-01-01\" \"1986-01-01\" \"1987-01-01\" \"1988-01-01\" \"1989-01-01\" #> [81] \"1990-01-01\" \"1991-01-01\" \"1992-01-01\" \"1993-01-01\" \"1994-01-01\" #> [86] \"1995-01-01\" \"1996-01-01\" \"1997-01-01\" \"1998-01-01\" \"1999-01-01\" t$format(t$breaks(range(years))) #> [1] \"1900\" \"1920\" \"1940\" \"1960\" \"1980\" \"2000\""},{"path":"https://scales.r-lib.org/dev/reference/demo_continuous.html","id":null,"dir":"Reference","previous_headings":"","what":"Demonstrate scales functions with ggplot2 code — demo_continuous","title":"Demonstrate scales functions with ggplot2 code — demo_continuous","text":"functions generate ggplot2 code needed use scales functions real code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/demo_continuous.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Demonstrate scales functions with ggplot2 code — demo_continuous","text":"","code":"demo_continuous(x, ...) demo_log10(x, ...) demo_discrete(x, ...) demo_datetime(x, ...) demo_time(x, ...) demo_timespan(x, ...)"},{"path":"https://scales.r-lib.org/dev/reference/demo_continuous.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Demonstrate scales functions with ggplot2 code — demo_continuous","text":"x vector data","code":""},{"path":"https://scales.r-lib.org/dev/reference/dichromat_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Dichromat (colour-blind) palette (discrete) — dichromat_pal","title":"Dichromat (colour-blind) palette (discrete) — dichromat_pal","text":"Dichromat (colour-blind) palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/dichromat_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dichromat (colour-blind) palette (discrete) — dichromat_pal","text":"","code":"dichromat_pal(name)"},{"path":"https://scales.r-lib.org/dev/reference/dichromat_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dichromat (colour-blind) palette (discrete) — dichromat_pal","text":"name Name colour palette. One : BrowntoBlue.10, BrowntoBlue.12, BluetoDarkOrange.12, BluetoDarkOrange.18, DarkRedtoBlue.12, DarkRedtoBlue.18, BluetoGreen.14, BluetoGray.8, BluetoOrangeRed.14, BluetoOrange.10, BluetoOrange.12, BluetoOrange.8, LightBluetoDarkBlue.10, LightBluetoDarkBlue.7, Categorical.12, GreentoMagenta.16, SteppedSequential.5","code":""},{"path":"https://scales.r-lib.org/dev/reference/dichromat_pal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dichromat (colour-blind) palette (discrete) — dichromat_pal","text":"","code":"if (requireNamespace(\"dichromat\", quietly = TRUE)) { show_col(dichromat_pal(\"BluetoOrange.10\")(10)) show_col(dichromat_pal(\"BluetoOrange.10\")(5)) # Can use with gradient_n to create a continous gradient cols <- dichromat_pal(\"DarkRedtoBlue.12\")(12) show_col(gradient_n_pal(cols)(seq(0, 1, length.out = 30))) }"},{"path":"https://scales.r-lib.org/dev/reference/div_gradient_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Diverging colour gradient (continuous). — div_gradient_pal","title":"Diverging colour gradient (continuous). — div_gradient_pal","text":"Diverging colour gradient (continuous).","code":""},{"path":"https://scales.r-lib.org/dev/reference/div_gradient_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Diverging colour gradient (continuous). — div_gradient_pal","text":"","code":"div_gradient_pal( low = mnsl(\"10B 4/6\"), mid = mnsl(\"N 8/0\"), high = mnsl(\"10R 4/6\"), space = \"Lab\" )"},{"path":"https://scales.r-lib.org/dev/reference/div_gradient_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Diverging colour gradient (continuous). — div_gradient_pal","text":"low colour low end gradient. mid colour mid point high colour high end gradient. space colour space calculate gradient. Must \"Lab\" - values deprecated.","code":""},{"path":"https://scales.r-lib.org/dev/reference/div_gradient_pal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Diverging colour gradient (continuous). — div_gradient_pal","text":"","code":"x <- seq(-1, 1, length.out = 100) r <- sqrt(outer(x^2, x^2, \"+\")) image(r, col = div_gradient_pal()(seq(0, 1, length.out = 12))) image(r, col = div_gradient_pal()(seq(0, 1, length.out = 30))) image(r, col = div_gradient_pal()(seq(0, 1, length.out = 100))) library(munsell) pal <- div_gradient_pal(low = mnsl(complement(\"10R 4/6\"), fix = TRUE)) image(r, col = pal(seq(0, 1, length.out = 100)))"},{"path":"https://scales.r-lib.org/dev/reference/dollar_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_currency() — dollar_format","title":"Superseded interface to label_currency() — dollar_format","text":"functions kept backward compatibility; switch label_currency() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/dollar_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_currency() — dollar_format","text":"","code":"dollar_format( accuracy = NULL, scale = 1, prefix = \"$\", suffix = \"\", big.mark = \",\", decimal.mark = \".\", trim = TRUE, largest_with_cents = 1e+05, negative_parens = deprecated(), ... ) dollar( x, accuracy = NULL, scale = 1, prefix = \"$\", suffix = \"\", big.mark = \",\", decimal.mark = \".\", trim = TRUE, largest_with_cents = 1e+05, negative_parens = deprecated(), style_negative = c(\"hyphen\", \"minus\", \"parens\"), scale_cut = NULL, ... ) label_dollar( accuracy = NULL, scale = 1, prefix = \"$\", suffix = \"\", big.mark = \",\", decimal.mark = \".\", trim = TRUE, largest_with_cents = 1e+05, negative_parens = deprecated(), ... )"},{"path":"https://scales.r-lib.org/dev/reference/dollar_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_currency() — dollar_format","text":"scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix, suffix Symbols display value. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). largest_with_cents Like largest_with_fractional() label_currency() negative_parens Use style_negative = \"parens\" instead. ... arguments passed base::format(). x numeric vector","code":""},{"path":"https://scales.r-lib.org/dev/reference/dscale.html","id":null,"dir":"Reference","previous_headings":"","what":"Discrete scale — dscale","title":"Discrete scale — dscale","text":"Discrete scale","code":""},{"path":"https://scales.r-lib.org/dev/reference/dscale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Discrete scale — dscale","text":"","code":"dscale(x, palette, na.value = NA)"},{"path":"https://scales.r-lib.org/dev/reference/dscale.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Discrete scale — dscale","text":"x vector discrete values scale palette aesthetic palette use na.value aesthetic use missing values","code":""},{"path":"https://scales.r-lib.org/dev/reference/dscale.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Discrete scale — dscale","text":"","code":"with(mtcars, plot(disp, mpg, pch = 20, cex = 3, col = dscale(factor(cyl), brewer_pal()) ))"},{"path":"https://scales.r-lib.org/dev/reference/exp_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential transformation (inverse of log transformation) — exp_trans","title":"Exponential transformation (inverse of log transformation) — exp_trans","text":"Exponential transformation (inverse log transformation)","code":""},{"path":"https://scales.r-lib.org/dev/reference/exp_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential transformation (inverse of log transformation) — exp_trans","text":"","code":"exp_trans(base = exp(1))"},{"path":"https://scales.r-lib.org/dev/reference/exp_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential transformation (inverse of log transformation) — exp_trans","text":"base Base logarithm","code":""},{"path":"https://scales.r-lib.org/dev/reference/exp_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential transformation (inverse of log transformation) — exp_trans","text":"","code":"plot(exp_trans(0.5), xlim = c(-2, 2)) plot(exp_trans(1), xlim = c(-2, 2)) plot(exp_trans(2), xlim = c(-2, 2)) plot(exp_trans(), xlim = c(-2, 2))"},{"path":"https://scales.r-lib.org/dev/reference/expand_range.html","id":null,"dir":"Reference","previous_headings":"","what":"Expand a range with a multiplicative or additive constant — expand_range","title":"Expand a range with a multiplicative or additive constant — expand_range","text":"Expand range multiplicative additive constant","code":""},{"path":"https://scales.r-lib.org/dev/reference/expand_range.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Expand a range with a multiplicative or additive constant — expand_range","text":"","code":"expand_range(range, mul = 0, add = 0, zero_width = 1)"},{"path":"https://scales.r-lib.org/dev/reference/expand_range.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Expand a range with a multiplicative or additive constant — expand_range","text":"range range data, numeric vector length 2 mul multiplicative constant add additive constant zero_width distance use range zero width","code":""},{"path":"https://scales.r-lib.org/dev/reference/format_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Label using format() — format_format","title":"Label using format() — format_format","text":"function kept backward compatiblity; either use label_number() label_date() instead.","code":""},{"path":"https://scales.r-lib.org/dev/reference/format_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label using format() — format_format","text":"","code":"format_format(...)"},{"path":"https://scales.r-lib.org/dev/reference/format_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label using format() — format_format","text":"... Arguments passed format().","code":""},{"path":"https://scales.r-lib.org/dev/reference/fullseq.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate sequence of fixed size intervals covering range. — fullseq","title":"Generate sequence of fixed size intervals covering range. — fullseq","text":"Generate sequence fixed size intervals covering range.","code":""},{"path":"https://scales.r-lib.org/dev/reference/fullseq.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate sequence of fixed size intervals covering range. — fullseq","text":"","code":"fullseq(range, size, ...)"},{"path":"https://scales.r-lib.org/dev/reference/fullseq.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate sequence of fixed size intervals covering range. — fullseq","text":"range range size interval size ... arguments passed methods","code":""},{"path":"https://scales.r-lib.org/dev/reference/gradient_n_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Arbitrary colour gradient palette (continuous) — gradient_n_pal","title":"Arbitrary colour gradient palette (continuous) — gradient_n_pal","text":"Arbitrary colour gradient palette (continuous)","code":""},{"path":"https://scales.r-lib.org/dev/reference/gradient_n_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arbitrary colour gradient palette (continuous) — gradient_n_pal","text":"","code":"gradient_n_pal(colours, values = NULL, space = \"Lab\")"},{"path":"https://scales.r-lib.org/dev/reference/gradient_n_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Arbitrary colour gradient palette (continuous) — gradient_n_pal","text":"colours vector colours values colours evenly positioned along gradient vector gives position (0 1) colour colours vector. See rescale() convenience function map arbitrary range 0 1. space colour space calculate gradient. Must \"Lab\" - values deprecated.","code":""},{"path":"https://scales.r-lib.org/dev/reference/grey_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Grey scale palette (discrete) — grey_pal","title":"Grey scale palette (discrete) — grey_pal","text":"Grey scale palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/grey_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Grey scale palette (discrete) — grey_pal","text":"","code":"grey_pal(start = 0.2, end = 0.8)"},{"path":"https://scales.r-lib.org/dev/reference/grey_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Grey scale palette (discrete) — grey_pal","text":"start grey value low end palette end grey value high end palette","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/grey_pal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Grey scale palette (discrete) — grey_pal","text":"","code":"show_col(grey_pal()(25)) show_col(grey_pal(0, 1)(25))"},{"path":"https://scales.r-lib.org/dev/reference/hue_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Hue palette (discrete) — hue_pal","title":"Hue palette (discrete) — hue_pal","text":"Hue palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/hue_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Hue palette (discrete) — hue_pal","text":"","code":"hue_pal(h = c(0, 360) + 15, c = 100, l = 65, h.start = 0, direction = 1)"},{"path":"https://scales.r-lib.org/dev/reference/hue_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Hue palette (discrete) — hue_pal","text":"h range hues use, [0, 360] c chroma (intensity colour), maximum value varies depending combination hue luminance. l luminance (lightness), [0, 100] h.start hue start direction direction travel around colour wheel, 1 = clockwise, -1 = counter-clockwise","code":""},{"path":"https://scales.r-lib.org/dev/reference/hue_pal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Hue palette (discrete) — hue_pal","text":"","code":"show_col(hue_pal()(4)) show_col(hue_pal()(9)) show_col(hue_pal(l = 90)(9)) show_col(hue_pal(l = 30)(9)) show_col(hue_pal()(9)) show_col(hue_pal(direction = -1)(9)) show_col(hue_pal(h.start = 30)(9)) show_col(hue_pal(h.start = 90)(9)) show_col(hue_pal()(9)) show_col(hue_pal(h = c(0, 90))(9)) show_col(hue_pal(h = c(90, 180))(9)) show_col(hue_pal(h = c(180, 270))(9)) show_col(hue_pal(h = c(270, 360))(9))"},{"path":"https://scales.r-lib.org/dev/reference/identity_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Identity palette — identity_pal","title":"Identity palette — identity_pal","text":"Leaves values unchanged - useful data already scaled.","code":""},{"path":"https://scales.r-lib.org/dev/reference/identity_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identity palette — identity_pal","text":"","code":"identity_pal()"},{"path":"https://scales.r-lib.org/dev/reference/identity_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Identity transformation (do nothing) — identity_trans","title":"Identity transformation (do nothing) — identity_trans","text":"Identity transformation (nothing)","code":""},{"path":"https://scales.r-lib.org/dev/reference/identity_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identity transformation (do nothing) — identity_trans","text":"","code":"identity_trans()"},{"path":"https://scales.r-lib.org/dev/reference/identity_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identity transformation (do nothing) — identity_trans","text":"","code":"plot(identity_trans(), xlim = c(-1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/label_bytes.html","id":null,"dir":"Reference","previous_headings":"","what":"Label bytes (1 kB, 2 MB, etc) — label_bytes","title":"Label bytes (1 kB, 2 MB, etc) — label_bytes","text":"Scale bytes human friendly units. Can use either SI units (e.g. kB = 1000 bytes) binary units (e.g. kiB = 1024 bytes). See Units Information Wikipedia details.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_bytes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label bytes (1 kB, 2 MB, etc) — label_bytes","text":"","code":"label_bytes(units = \"auto_si\", accuracy = 1, scale = 1, ...)"},{"path":"https://scales.r-lib.org/dev/reference/label_bytes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label bytes (1 kB, 2 MB, etc) — label_bytes","text":"units Unit use. either one : \"kB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\" SI units (base 1000). \"kiB\", \"MiB\", \"GiB\", \"TiB\", \"PiB\", \"EiB\", \"ZiB\", \"YiB\" binary units (base 1024). auto_si auto_binary automatically pick appropriate unit value. accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. ... Arguments passed number prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\". trim Logical, FALSE, values right-justified common width (see base::format()).","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_bytes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label bytes (1 kB, 2 MB, etc) — label_bytes","text":"labeller function takes numeric vector breaks returns character vector labels.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_bytes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label bytes (1 kB, 2 MB, etc) — label_bytes","text":"","code":"demo_continuous(c(1, 1e6)) #> scale_x_continuous() demo_continuous(c(1, 1e6), labels = label_bytes()) #> scale_x_continuous(labels = label_bytes()) # Auto units are particularly nice on log scales demo_log10(c(1, 1e7), labels = label_bytes()) #> scale_x_log10(labels = label_bytes()) # You can also set the units demo_continuous(c(1, 1e6), labels = label_bytes(\"kB\")) #> scale_x_continuous(labels = label_bytes(\"kB\")) # You can also use binary units where a megabyte is defined as # (1024) ^ 2 bytes rather than (1000) ^ 2. You'll need to override # the default breaks to make this more informative. demo_continuous(c(1, 1024^2), breaks = breaks_width(250 * 1024), labels = label_bytes(\"auto_binary\") ) #> scale_x_continuous(breaks = breaks_width(250 * 1024), labels = label_bytes(\"auto_binary\"))"},{"path":"https://scales.r-lib.org/dev/reference/label_currency.html","id":null,"dir":"Reference","previous_headings":"","what":"Label currencies ($100, €2.50, etc) — label_currency","title":"Label currencies ($100, €2.50, etc) — label_currency","text":"Format numbers currency, rounding values monetary fractional monetary using unit convenient heuristic.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_currency.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label currencies ($100, €2.50, etc) — label_currency","text":"","code":"label_currency( accuracy = NULL, scale = 1, prefix = \"$\", suffix = \"\", big.mark = \",\", decimal.mark = \".\", trim = TRUE, largest_with_fractional = 1e+05, ... )"},{"path":"https://scales.r-lib.org/dev/reference/label_currency.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label currencies ($100, €2.50, etc) — label_currency","text":"accuracy, largest_with_fractional Number round . NULL, default, values rounded nearest integer, unless values non-zero fractional component (e.g. cents) largest value less largest_with_fractional default 100,000. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix, suffix Symbols display value. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). ... Arguments passed number style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\".","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_currency.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label currencies ($100, €2.50, etc) — label_currency","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_currency.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label currencies ($100, €2.50, etc) — label_currency","text":"","code":"demo_continuous(c(0, 1), labels = label_currency()) #> scale_x_continuous(labels = label_currency()) demo_continuous(c(1, 100), labels = label_currency()) #> scale_x_continuous(labels = label_currency()) # Customise currency display with prefix and suffix demo_continuous(c(1, 100), labels = label_currency(prefix = \"USD \")) #> scale_x_continuous(labels = label_currency(prefix = \"USD \")) yen <- label_currency( prefix = \"¥\", suffix = \"\", big.mark = \".\", decimal.mark = \",\" ) demo_continuous(c(1000, 1100), labels = yen) #> scale_x_continuous(labels = yen) # Use style_negative = \"parens\" for finance style display demo_continuous(c(-100, 100), labels = label_currency(style_negative = \"parens\")) #> scale_x_continuous(labels = label_currency(style_negative = \"parens\")) # Use scale_cut to use K/M/B where appropriate demo_log10(c(1, 1e16), breaks = log_breaks(7, 1e3), labels = label_currency(scale_cut = cut_short_scale()) ) #> scale_x_log10(breaks = log_breaks(7, 1000), labels = label_currency(scale_cut = cut_short_scale())) # cut_short_scale() uses B = one thousand million # cut_long_scale() uses B = one million million demo_log10(c(1, 1e16), breaks = log_breaks(7, 1e3), labels = label_currency(scale_cut = cut_long_scale()) ) #> scale_x_log10(breaks = log_breaks(7, 1000), labels = label_currency(scale_cut = cut_long_scale())) # You can also define your own breaks gbp <- label_currency( prefix = \"\\u00a3\", scale_cut = c(0, k = 1e3, m = 1e6, bn = 1e9, tn = 1e12) ) demo_log10(c(1, 1e12), breaks = log_breaks(5, 1e3), labels = gbp) #> scale_x_log10(breaks = log_breaks(5, 1000), labels = gbp)"},{"path":"https://scales.r-lib.org/dev/reference/label_date.html","id":null,"dir":"Reference","previous_headings":"","what":"Label date/times — label_date","title":"Label date/times — label_date","text":"label_date() label_time() label date/times using date/time format strings. label_date_short() automatically constructs short format string sufficient uniquely identify labels. inspired matplotlib's ConciseDateFormatter, uses slightly different approach: ConciseDateFormatter formats \"firsts\" (e.g. first day month, first day day) specially; date_short() formats changes (e.g. new month, new year) specially. label_timespan() intended show time passed adds common time units suffix input (ns, μs, ms, s, m, h, d, w).","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_date.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label date/times — label_date","text":"","code":"label_date(format = \"%Y-%m-%d\", tz = \"UTC\", locale = NULL) label_date_short(format = c(\"%Y\", \"%b\", \"%d\", \"%H:%M\"), sep = \"\\n\") label_time(format = \"%H:%M:%S\", tz = \"UTC\", locale = NULL) label_timespan(unit = c(\"secs\", \"mins\", \"hours\", \"days\", \"weeks\"), ...)"},{"path":"https://scales.r-lib.org/dev/reference/label_date.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label date/times — label_date","text":"format date_format() time_format() date/time format string using standard POSIX specification. See strptime() details. date_short() character vector length 4 giving format components use year, month, day, hour respectively. tz time zone name, see timezones(). Defaults UTC locale Locale use day month names. default uses current locale. Setting argument requires stringi, can see complete list supported locales stringi::stri_locale_list(). sep Separator use combining date formats single string. unit unit used interpret numeric input ... Arguments passed number accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). trim Logical, FALSE, values right-justified common width (see base::format()).","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_date.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label date/times — label_date","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_date.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label date/times — label_date","text":"","code":"date_range <- function(start, days) { start <- as.POSIXct(start) c(start, start + days * 24 * 60 * 60) } two_months <- date_range(\"2020-05-01\", 60) demo_datetime(two_months) #> scale_x_datetime() demo_datetime(two_months, labels = date_format(\"%m/%d\")) #> scale_x_datetime(labels = date_format(\"%m/%d\")) demo_datetime(two_months, labels = date_format(\"%e %b\", locale = \"fr\")) #> scale_x_datetime(labels = date_format(\"%e %b\", locale = \"fr\")) demo_datetime(two_months, labels = date_format(\"%e %B\", locale = \"es\")) #> scale_x_datetime(labels = date_format(\"%e %B\", locale = \"es\")) # ggplot2 provides a short-hand: demo_datetime(two_months, date_labels = \"%m/%d\") #> scale_x_datetime(date_labels = \"%m/%d\") # An alternative labelling system is label_date_short() demo_datetime(two_months, date_breaks = \"7 days\", labels = label_date_short()) #> scale_x_datetime(date_breaks = \"7 days\", labels = label_date_short()) # This is particularly effective for dense labels one_year <- date_range(\"2020-05-01\", 365) demo_datetime(one_year, date_breaks = \"month\") #> scale_x_datetime(date_breaks = \"month\") demo_datetime(one_year, date_breaks = \"month\", labels = label_date_short()) #> scale_x_datetime(date_breaks = \"month\", labels = label_date_short())"},{"path":"https://scales.r-lib.org/dev/reference/label_log.html","id":null,"dir":"Reference","previous_headings":"","what":"Label numbers in log format (10^3, 10^6, etc) — label_log","title":"Label numbers in log format (10^3, 10^6, etc) — label_log","text":"label_log() displays numbers base^exponent, using superscript formatting.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_log.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label numbers in log format (10^3, 10^6, etc) — label_log","text":"","code":"label_log(base = 10, digits = 3)"},{"path":"https://scales.r-lib.org/dev/reference/label_log.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label numbers in log format (10^3, 10^6, etc) — label_log","text":"base Base logarithm use digits Number significant digits show exponent. Argument passed base::format().","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_log.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label numbers in log format (10^3, 10^6, etc) — label_log","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_log.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label numbers in log format (10^3, 10^6, etc) — label_log","text":"","code":"demo_log10(c(1, 1e5), labels = label_log()) #> scale_x_log10(labels = label_log()) demo_log10(c(1, 1e5), breaks = breaks_log(base = 2), labels = label_log(base = 2)) #> scale_x_log10(breaks = breaks_log(base = 2), labels = label_log(base = 2))"},{"path":"https://scales.r-lib.org/dev/reference/label_number.html","id":null,"dir":"Reference","previous_headings":"","what":"Label numbers in decimal format (e.g. 0.12, 1,234) — label_number","title":"Label numbers in decimal format (e.g. 0.12, 1,234) — label_number","text":"Use label_number() force decimal display numbers (.e. use scientific notation). label_comma() special case inserts comma every three digits.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_number.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label numbers in decimal format (e.g. 0.12, 1,234) — label_number","text":"","code":"label_number( accuracy = NULL, scale = 1, prefix = \"\", suffix = \"\", big.mark = \" \", decimal.mark = \".\", style_positive = c(\"none\", \"plus\"), style_negative = c(\"hyphen\", \"minus\", \"parens\"), scale_cut = NULL, trim = TRUE, ... ) label_comma( accuracy = NULL, scale = 1, prefix = \"\", suffix = \"\", big.mark = \",\", decimal.mark = \".\", trim = TRUE, digits, ... )"},{"path":"https://scales.r-lib.org/dev/reference/label_number.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label numbers in decimal format (e.g. 0.12, 1,234) — label_number","text":"accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\". trim Logical, FALSE, values right-justified common width (see base::format()). ... arguments passed base::format(). digits Use accuracy instead.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_number.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label numbers in decimal format (e.g. 0.12, 1,234) — label_number","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_number.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label numbers in decimal format (e.g. 0.12, 1,234) — label_number","text":"","code":"demo_continuous(c(-1e6, 1e6)) #> scale_x_continuous() demo_continuous(c(-1e6, 1e6), labels = label_number()) #> scale_x_continuous(labels = label_number()) demo_continuous(c(-1e6, 1e6), labels = label_comma()) #> scale_x_continuous(labels = label_comma()) # Use scale to rescale very small or large numbers to generate # more readable labels demo_continuous(c(0, 1e6), labels = label_number()) #> scale_x_continuous(labels = label_number()) demo_continuous(c(0, 1e6), labels = label_number(scale = 1 / 1e3)) #> scale_x_continuous(labels = label_number(scale = 1/1000)) demo_continuous(c(0, 1e-6), labels = label_number()) #> scale_x_continuous(labels = label_number()) demo_continuous(c(0, 1e-6), labels = label_number(scale = 1e6)) #> scale_x_continuous(labels = label_number(scale = 1e+06)) #' Use scale_cut to automatically add prefixes for large/small numbers demo_log10( c(1, 1e9), breaks = log_breaks(10), labels = label_number(scale_cut = cut_short_scale()) ) #> scale_x_log10(breaks = log_breaks(10), labels = label_number(scale_cut = cut_short_scale())) demo_log10( c(1, 1e9), breaks = log_breaks(10), labels = label_number(scale_cut = cut_si(\"m\")) ) #> scale_x_log10(breaks = log_breaks(10), labels = label_number(scale_cut = cut_si(\"m\"))) demo_log10( c(1e-9, 1), breaks = log_breaks(10), labels = label_number(scale_cut = cut_si(\"g\")) ) #> scale_x_log10(breaks = log_breaks(10), labels = label_number(scale_cut = cut_si(\"g\"))) # use scale and scale_cut when data already uses SI prefix # for example, if data was stored in kg demo_log10( c(1e-9, 1), breaks = log_breaks(10), labels = label_number(scale_cut = cut_si(\"g\"), scale = 1e3) ) #> scale_x_log10(breaks = log_breaks(10), labels = label_number(scale_cut = cut_si(\"g\"), #> scale = 1000)) #' # Use style arguments to vary the appearance of positive and negative numbers demo_continuous(c(-1e3, 1e3), labels = label_number( style_positive = \"plus\", style_negative = \"minus\" )) #> scale_x_continuous(labels = label_number(style_positive = \"plus\", #> style_negative = \"minus\")) demo_continuous(c(-1e3, 1e3), labels = label_number(style_negative = \"parens\")) #> scale_x_continuous(labels = label_number(style_negative = \"parens\")) # You can use prefix and suffix for other types of display demo_continuous(c(32, 212), labels = label_number(suffix = \"\\u00b0F\")) #> scale_x_continuous(labels = label_number(suffix = \"°F\")) demo_continuous(c(0, 100), labels = label_number(suffix = \"\\u00b0C\")) #> scale_x_continuous(labels = label_number(suffix = \"°C\"))"},{"path":"https://scales.r-lib.org/dev/reference/label_number_auto.html","id":null,"dir":"Reference","previous_headings":"","what":"Label numbers, avoiding scientific notation where possible — label_number_auto","title":"Label numbers, avoiding scientific notation where possible — label_number_auto","text":"Switches number_format() scientific_format() based set heuristics designed automatically generate useful labels across wide range inputs","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_number_auto.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label numbers, avoiding scientific notation where possible — label_number_auto","text":"","code":"label_number_auto()"},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_number_auto.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label numbers, avoiding scientific notation where possible — label_number_auto","text":"","code":"# Very small and very large numbers get scientific notation demo_continuous(c(0, 1e-6), labels = label_number_auto()) #> scale_x_continuous(labels = label_number_auto()) demo_continuous(c(0, 1e9), labels = label_number_auto()) #> scale_x_continuous(labels = label_number_auto()) # Other ranges get the numbers printed in full demo_continuous(c(0, 1e-3), labels = label_number_auto()) #> scale_x_continuous(labels = label_number_auto()) demo_continuous(c(0, 1), labels = label_number_auto()) #> scale_x_continuous(labels = label_number_auto()) demo_continuous(c(0, 1e3), labels = label_number_auto()) #> scale_x_continuous(labels = label_number_auto()) demo_continuous(c(0, 1e6), labels = label_number_auto()) #> scale_x_continuous(labels = label_number_auto()) # Transformation is applied individually so you get as little # scientific notation as possible demo_log10(c(1, 1e7), labels = label_number_auto()) #> scale_x_log10(labels = label_number_auto())"},{"path":"https://scales.r-lib.org/dev/reference/label_number_si.html","id":null,"dir":"Reference","previous_headings":"","what":"Label numbers with SI prefixes (2 kg, 5 mm, etc) — label_number_si","title":"Label numbers with SI prefixes (2 kg, 5 mm, etc) — label_number_si","text":"label_number_si() deprecated previous unit actually use SI units, instead used called \"short scale\". can now get results label_number(scale_cut = cut_short_scale()), want correct SI units, label_number(scale_cut = cut_si(\"unit\")).","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_number_si.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label numbers with SI prefixes (2 kg, 5 mm, etc) — label_number_si","text":"","code":"label_number_si(unit = \"\", accuracy = NULL, scale = 1, suffix = \"\", ...)"},{"path":"https://scales.r-lib.org/dev/reference/label_number_si.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label numbers with SI prefixes (2 kg, 5 mm, etc) — label_number_si","text":"unit Unit measurement (e.g. \"m\" meter, SI unit length). accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data already using SI prefix. suffix Additional text display number. ... Arguments passed label_number prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\". trim Logical, FALSE, values right-justified common width (see base::format()).","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_number_si.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label numbers with SI prefixes (2 kg, 5 mm, etc) — label_number_si","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_number_si.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label numbers with SI prefixes (2 kg, 5 mm, etc) — label_number_si","text":"","code":"# label_number_si() doesn't actually produce SI prefixes: demo_continuous(c(1, 1e9), labels = label_number_si(\"g\")) #> scale_x_continuous(labels = label_number_si(\"g\")) #> Warning: `label_number_si()` was deprecated in scales 1.2.0. #> ℹ Please use the `scale_cut` argument of `label_number()` instead. # If you want real SI prefixes, use cut_si() demo_continuous(c(1, 1e9), labels = label_number(scale_cut = cut_si(\"m\"))) #> scale_x_continuous(labels = label_number(scale_cut = cut_si(\"m\"))) # If you want the existing behavior, use cut_short_scale() demo_continuous(c(1, 1e9), labels = label_number(scale_cut = cut_short_scale())) #> scale_x_continuous(labels = label_number(scale_cut = cut_short_scale()))"},{"path":"https://scales.r-lib.org/dev/reference/label_ordinal.html","id":null,"dir":"Reference","previous_headings":"","what":"Label ordinal numbers (1st, 2nd, 3rd, etc) — label_ordinal","title":"Label ordinal numbers (1st, 2nd, 3rd, etc) — label_ordinal","text":"Round values integers display ordinal values (e.g. 1st, 2nd, 3rd). Built-rules provided English, French, Spanish.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_ordinal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label ordinal numbers (1st, 2nd, 3rd, etc) — label_ordinal","text":"","code":"label_ordinal( prefix = \"\", suffix = \"\", big.mark = \" \", rules = ordinal_english(), ... ) ordinal_english() ordinal_french(gender = c(\"masculin\", \"feminin\"), plural = FALSE) ordinal_spanish()"},{"path":"https://scales.r-lib.org/dev/reference/label_ordinal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label ordinal numbers (1st, 2nd, 3rd, etc) — label_ordinal","text":"prefix, suffix Symbols display value. big.mark Character used every 3 digits separate thousands. rules Named list regular expressions, matched order. Name gives suffix, value specifies numbers match. ... Arguments passed number accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. decimal.mark character used indicate numeric decimal point. style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\". trim Logical, FALSE, values right-justified common width (see base::format()). gender Masculin feminin gender French ordinal. plural Plural singular French ordinal.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_ordinal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label ordinal numbers (1st, 2nd, 3rd, etc) — label_ordinal","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_ordinal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label ordinal numbers (1st, 2nd, 3rd, etc) — label_ordinal","text":"","code":"demo_continuous(c(1, 5)) #> scale_x_continuous() demo_continuous(c(1, 5), labels = label_ordinal()) #> scale_x_continuous(labels = label_ordinal()) demo_continuous(c(1, 5), labels = label_ordinal(rules = ordinal_french())) #> scale_x_continuous(labels = label_ordinal(rules = ordinal_french())) # The rules are just a set of regular expressions that are applied in turn ordinal_french() #> $er #> [1] \"^1$\" #> #> $e #> [1] \".\" #> ordinal_english() #> $st #> [1] \"(? #> $nd #> [1] \"(? #> $rd #> [1] \"(? #> $th #> [1] \"(?<=1)[123]$\" #> #> $th #> [1] \"[0456789]$\" #> #> $th #> [1] \".\" #> # Note that ordinal rounds values, so you may need to adjust the breaks too demo_continuous(c(1, 10)) #> scale_x_continuous() demo_continuous(c(1, 10), labels = label_ordinal()) #> scale_x_continuous(labels = label_ordinal()) demo_continuous(c(1, 10), labels = label_ordinal(), breaks = breaks_width(2) ) #> scale_x_continuous(labels = label_ordinal(), breaks = breaks_width(2))"},{"path":"https://scales.r-lib.org/dev/reference/label_parse.html","id":null,"dir":"Reference","previous_headings":"","what":"Label with mathematical annotations — label_parse","title":"Label with mathematical annotations — label_parse","text":"label_parse() produces expression strings parsing ; label_math() constructs expressions replacing pronoun .x string.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_parse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label with mathematical annotations — label_parse","text":"","code":"label_parse() label_math(expr = 10^.x, format = force)"},{"path":"https://scales.r-lib.org/dev/reference/label_parse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label with mathematical annotations — label_parse","text":"expr expression use format another format function apply prior mathematical transformation - makes easier use floating point numbers mathematical expressions.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_parse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label with mathematical annotations — label_parse","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_parse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label with mathematical annotations — label_parse","text":"","code":"# Use label_parse() with discrete scales greek <- c(\"alpha\", \"beta\", \"gamma\") demo_discrete(greek) #> scale_x_discrete() demo_discrete(greek, labels = label_parse()) #> scale_x_discrete(labels = label_parse()) # Use label_math() with continuous scales demo_continuous(c(1, 5)) #> scale_x_continuous() demo_continuous(c(1, 5), labels = label_math(alpha[.x])) #> scale_x_continuous(labels = label_math(alpha[.x])) demo_continuous(c(1, 5), labels = label_math()) #> scale_x_continuous(labels = label_math())"},{"path":"https://scales.r-lib.org/dev/reference/label_percent.html","id":null,"dir":"Reference","previous_headings":"","what":"Label percentages (2.5%, 50%, etc) — label_percent","title":"Label percentages (2.5%, 50%, etc) — label_percent","text":"Label percentages (2.5%, 50%, etc)","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_percent.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label percentages (2.5%, 50%, etc) — label_percent","text":"","code":"label_percent( accuracy = NULL, scale = 100, prefix = \"\", suffix = \"%\", big.mark = \" \", decimal.mark = \".\", trim = TRUE, ... )"},{"path":"https://scales.r-lib.org/dev/reference/label_percent.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label percentages (2.5%, 50%, etc) — label_percent","text":"accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). ... Arguments passed label_number style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\".","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_percent.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label percentages (2.5%, 50%, etc) — label_percent","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_percent.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label percentages (2.5%, 50%, etc) — label_percent","text":"","code":"demo_continuous(c(0, 1)) #> scale_x_continuous() demo_continuous(c(0, 1), labels = label_percent()) #> scale_x_continuous(labels = label_percent()) # Use prefix and suffix to create your own variants french_percent <- label_percent( decimal.mark = \",\", suffix = \" %\" ) demo_continuous(c(0, .01), labels = french_percent) #> scale_x_continuous(labels = french_percent)"},{"path":"https://scales.r-lib.org/dev/reference/label_pvalue.html","id":null,"dir":"Reference","previous_headings":"","what":"Label p-values (e.g. <0.001, 0.25, p >= 0.99) — label_pvalue","title":"Label p-values (e.g. <0.001, 0.25, p >= 0.99) — label_pvalue","text":"Formatter p-values, using \"<\" \">\" p-values close 0 1.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_pvalue.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label p-values (e.g. <0.001, 0.25, p >= 0.99) — label_pvalue","text":"","code":"label_pvalue( accuracy = 0.001, decimal.mark = \".\", prefix = NULL, add_p = FALSE )"},{"path":"https://scales.r-lib.org/dev/reference/label_pvalue.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label p-values (e.g. <0.001, 0.25, p >= 0.99) — label_pvalue","text":"accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. decimal.mark character used indicate numeric decimal point. prefix character vector length 3 giving prefixes put front numbers. default values c(\"<\", \"\", \">\") add_p TRUE c(\"p<\", \"p=\", \"p>\") FALSE. add_p Add \"p=\" value?","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_pvalue.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label p-values (e.g. <0.001, 0.25, p >= 0.99) — label_pvalue","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_pvalue.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label p-values (e.g. <0.001, 0.25, p >= 0.99) — label_pvalue","text":"","code":"demo_continuous(c(0, 1)) #> scale_x_continuous() demo_continuous(c(0, 1), labels = label_pvalue()) #> scale_x_continuous(labels = label_pvalue()) demo_continuous(c(0, 1), labels = label_pvalue(accuracy = 0.1)) #> scale_x_continuous(labels = label_pvalue(accuracy = 0.1)) demo_continuous(c(0, 1), labels = label_pvalue(add_p = TRUE)) #> scale_x_continuous(labels = label_pvalue(add_p = TRUE)) # Or provide your own prefixes prefix <- c(\"p < \", \"p = \", \"p > \") demo_continuous(c(0, 1), labels = label_pvalue(prefix = prefix)) #> scale_x_continuous(labels = label_pvalue(prefix = prefix))"},{"path":"https://scales.r-lib.org/dev/reference/label_scientific.html","id":null,"dir":"Reference","previous_headings":"","what":"Label numbers with scientific notation (e.g. 1e05, 1.5e-02) — label_scientific","title":"Label numbers with scientific notation (e.g. 1e05, 1.5e-02) — label_scientific","text":"Label numbers scientific notation (e.g. 1e05, 1.5e-02)","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_scientific.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label numbers with scientific notation (e.g. 1e05, 1.5e-02) — label_scientific","text":"","code":"label_scientific( digits = 3, scale = 1, prefix = \"\", suffix = \"\", decimal.mark = \".\", trim = TRUE, ... )"},{"path":"https://scales.r-lib.org/dev/reference/label_scientific.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label numbers with scientific notation (e.g. 1e05, 1.5e-02) — label_scientific","text":"digits Number digits show exponent. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix, suffix Symbols display value. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). ... arguments passed base::format().","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_scientific.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label numbers with scientific notation (e.g. 1e05, 1.5e-02) — label_scientific","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_scientific.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label numbers with scientific notation (e.g. 1e05, 1.5e-02) — label_scientific","text":"","code":"demo_continuous(c(1, 10)) #> scale_x_continuous() demo_continuous(c(1, 10), labels = label_scientific()) #> scale_x_continuous(labels = label_scientific()) demo_continuous(c(1, 10), labels = label_scientific(digits = 3)) #> scale_x_continuous(labels = label_scientific(digits = 3)) demo_log10(c(1, 1e9)) #> scale_x_log10()"},{"path":"https://scales.r-lib.org/dev/reference/label_wrap.html","id":null,"dir":"Reference","previous_headings":"","what":"Label strings by wrapping across multiple lines — label_wrap","title":"Label strings by wrapping across multiple lines — label_wrap","text":"Uses strwrap() split long labels across multiple lines.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_wrap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label strings by wrapping across multiple lines — label_wrap","text":"","code":"label_wrap(width)"},{"path":"https://scales.r-lib.org/dev/reference/label_wrap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label strings by wrapping across multiple lines — label_wrap","text":"width Number characters per line.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_wrap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label strings by wrapping across multiple lines — label_wrap","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_wrap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label strings by wrapping across multiple lines — label_wrap","text":"","code":"x <- c( \"this is a long label\", \"this is another long label\", \"this a label this is even longer\" ) demo_discrete(x) #> scale_x_discrete() demo_discrete(x, labels = label_wrap(10)) #> scale_x_discrete(labels = label_wrap(10)) demo_discrete(x, labels = label_wrap(20)) #> scale_x_discrete(labels = label_wrap(20))"},{"path":"https://scales.r-lib.org/dev/reference/linetype_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Line type palette (discrete) — linetype_pal","title":"Line type palette (discrete) — linetype_pal","text":"Based set supplied Richard Pearson, University Manchester","code":""},{"path":"https://scales.r-lib.org/dev/reference/linetype_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Line type palette (discrete) — linetype_pal","text":"","code":"linetype_pal()"},{"path":"https://scales.r-lib.org/dev/reference/log_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Log transformations — log_trans","title":"Log transformations — log_trans","text":"log_trans(): log(x) log1p(): log(x + 1) pseudo_log_trans(): smoothly transition linear scale around 0.","code":""},{"path":"https://scales.r-lib.org/dev/reference/log_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Log transformations — log_trans","text":"","code":"log_trans(base = exp(1)) log10_trans() log2_trans() log1p_trans() pseudo_log_trans(sigma = 1, base = exp(1))"},{"path":"https://scales.r-lib.org/dev/reference/log_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Log transformations — log_trans","text":"base base logarithm sigma Scaling factor linear part pseudo-log transformation.","code":""},{"path":"https://scales.r-lib.org/dev/reference/log_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Log transformations — log_trans","text":"","code":"plot(log2_trans(), xlim = c(0, 5)) plot(log_trans(), xlim = c(0, 5)) plot(log10_trans(), xlim = c(0, 5)) plot(log_trans(), xlim = c(0, 2)) plot(log1p_trans(), xlim = c(-1, 1)) # The pseudo-log is defined for all real numbers plot(pseudo_log_trans(), xlim = c(-5, 5)) lines(log_trans(), xlim = c(0, 5), col = \"red\") # For large positives nubmers it's very close to log plot(pseudo_log_trans(), xlim = c(1, 20)) lines(log_trans(), xlim = c(1, 20), col = \"red\")"},{"path":"https://scales.r-lib.org/dev/reference/manual_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Manual palette (discrete) — manual_pal","title":"Manual palette (discrete) — manual_pal","text":"Manual palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/manual_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Manual palette (discrete) — manual_pal","text":"","code":"manual_pal(values)"},{"path":"https://scales.r-lib.org/dev/reference/manual_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Manual palette (discrete) — manual_pal","text":"values vector values used palette.","code":""},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_width.html","id":null,"dir":"Reference","previous_headings":"","what":"Minor breaks — minor_breaks_width","title":"Minor breaks — minor_breaks_width","text":"Generate minor breaks major breaks either spaced fixed width, fixed number.","code":""},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_width.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Minor breaks — minor_breaks_width","text":"","code":"minor_breaks_width(width, offset) minor_breaks_n(n)"},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_width.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Minor breaks — minor_breaks_width","text":"width Distance break. Either number, date/times, single string form \"{n} {unit}\", e.g. \"1 month\", \"5 days\". Unit can one \"sec\", \"min\", \"hour\", \"day\", \"week\", \"month\", \"year\". offset Use want breaks start zero, conventional date time boundary 1st January midnight. Either number, date/times, single string form \"{n} {unit}\", width. offset can vector, accumulate order given. mostly useful dates, e.g. c(\"3 months\", \"5 days\") offset three months five days, useful UK tax year. Note due way dates rounded, guarantee offset = c(x, y) give result offset = c(y, x). n number breaks","code":""},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_width.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Minor breaks — minor_breaks_width","text":"","code":"demo_log10(c(1, 1e6)) #> scale_x_log10() if (FALSE) { # Requires https://github.com/tidyverse/ggplot2/pull/3591 demo_log10(c(1, 1e6), minor_breaks = minor_breaks_n(10)) }"},{"path":"https://scales.r-lib.org/dev/reference/muted.html","id":null,"dir":"Reference","previous_headings":"","what":"Mute standard colour — muted","title":"Mute standard colour — muted","text":"Mute standard colour","code":""},{"path":"https://scales.r-lib.org/dev/reference/muted.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Mute standard colour — muted","text":"","code":"muted(colour, l = 30, c = 70)"},{"path":"https://scales.r-lib.org/dev/reference/muted.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Mute standard colour — muted","text":"colour character vector colours modify l new luminance c new chroma","code":""},{"path":"https://scales.r-lib.org/dev/reference/muted.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Mute standard colour — muted","text":"","code":"muted(\"red\") #> [1] \"#832424\" muted(\"blue\") #> [1] \"#3A3A98\" show_col(c(\"red\", \"blue\", muted(\"red\"), muted(\"blue\")))"},{"path":"https://scales.r-lib.org/dev/reference/number.html","id":null,"dir":"Reference","previous_headings":"","what":"A low-level numeric formatter — number","title":"A low-level numeric formatter — number","text":"function low-level helper powers many labelling functions. generally need call directly unless creating labelling function.","code":""},{"path":"https://scales.r-lib.org/dev/reference/number.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A low-level numeric formatter — number","text":"","code":"number( x, accuracy = NULL, scale = 1, prefix = \"\", suffix = \"\", big.mark = \" \", decimal.mark = \".\", style_positive = c(\"none\", \"plus\"), style_negative = c(\"hyphen\", \"minus\", \"parens\"), scale_cut = NULL, trim = TRUE, ... ) cut_short_scale(space = FALSE) cut_long_scale(space = FALSE) cut_si(unit)"},{"path":"https://scales.r-lib.org/dev/reference/number.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A low-level numeric formatter — number","text":"accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\". trim Logical, FALSE, values right-justified common width (see base::format()). ... arguments passed base::format(). space Add space scale suffix? unit SI unit abbreviation.","code":""},{"path":"https://scales.r-lib.org/dev/reference/number.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A low-level numeric formatter — number","text":"character vector length(x).","code":""},{"path":"https://scales.r-lib.org/dev/reference/number_bytes_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Older interface to label_bytes() — number_bytes_format","title":"Older interface to label_bytes() — number_bytes_format","text":"functions kept backward compatibility, switch label_bytes() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/number_bytes_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Older interface to label_bytes() — number_bytes_format","text":"","code":"number_bytes_format(symbol = \"auto\", units = \"binary\", ...) number_bytes(x, symbol = \"auto\", units = c(\"binary\", \"si\"), accuracy = 1, ...)"},{"path":"https://scales.r-lib.org/dev/reference/number_bytes_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Older interface to label_bytes() — number_bytes_format","text":"symbol byte symbol use. \"auto\" symbol used determined separately value x. Valid symbols \"B\", \"kB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\" SI units, \"iB\" variants binary units. units unit base use, \"binary\" (1024 base) \"si\" (1000 base)","code":""},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":null,"dir":"Reference","previous_headings":"","what":"Out of bounds handling — oob","title":"Out of bounds handling — oob","text":"set functions modify data values outside given range. oob_*() functions designed passed oob argument ggplot2 continuous binned scales, oob_discard exception. functions affect bounds values following ways: oob_censor() replaces bounds values NAs. default oob argument continuous scales. oob_censor_any() acts like oob_censor(), also replaces infinite values NAs. oob_squish() replaces bounds values nearest limit. default oob argument binned scales. oob_squish_any() acts like oob_squish(), also replaces infinite values nearest limit. oob_squish_infinite() replaces infinite values nearest limit. oob_keep() adjust bounds values. position scales, behaves zooming limits without data removal. oob_discard() removes bounds values input. suitable ggplot2 scales.","code":""},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Out of bounds handling — oob","text":"","code":"oob_censor(x, range = c(0, 1), only.finite = TRUE) oob_censor_any(x, range = c(0, 1)) oob_discard(x, range = c(0, 1)) oob_squish(x, range = c(0, 1), only.finite = TRUE) oob_squish_any(x, range = c(0, 1)) oob_squish_infinite(x, range = c(0, 1)) oob_keep(x, range = c(0, 1)) censor(x, range = c(0, 1), only.finite = TRUE) discard(x, range = c(0, 1)) squish(x, range = c(0, 1), only.finite = TRUE) squish_infinite(x, range = c(0, 1))"},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Out of bounds handling — oob","text":"x numeric vector values modify. range numeric vector length two giving minimum maximum limit desired output range respectively. .finite logical length one. TRUE, finite values altered. FALSE, also infinite values altered.","code":""},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Out of bounds handling — oob","text":"oob_() functions return vector numerical values length x argument, wherein bounds values modified. oob_discard() returns vector less equal length x argument.","code":""},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Out of bounds handling — oob","text":"oob_censor_any() oob_squish_any() functions oob_censor() oob_squish() .finite argument set FALSE. Replacing position values NAs, oob_censor() , typically lead removal datapoints ggplot. Setting ggplot coordinate limits equivalent using oob_keep() position scales.","code":""},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":"old-interface","dir":"Reference","previous_headings":"","what":"Old interface","title":"Out of bounds handling — oob","text":"censor(), squish(), squish_infinite() discard() longer recommended; please use oob_censor(), oob_squish(), oob_squish_infinite() oob_discard() instead.","code":""},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Out of bounds handling — oob","text":"oob_squish(): Homer Strong homer.strong@gmail.com","code":""},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Out of bounds handling — oob","text":"","code":"# Censoring replaces out of bounds values with NAs oob_censor(c(-Inf, -1, 0.5, 1, 2, NA, Inf)) #> [1] -Inf NA 0.5 1.0 NA NA Inf oob_censor_any(c(-Inf, -1, 0.5, 1, 2, NA, Inf)) #> [1] NA NA 0.5 1.0 NA NA NA # Squishing replaces out of bounds values with the nearest range limit oob_squish(c(-Inf, -1, 0.5, 1, 2, NA, Inf)) #> [1] -Inf 0.0 0.5 1.0 1.0 NA Inf oob_squish_any(c(-Inf, -1, 0.5, 1, 2, NA, Inf)) #> [1] 0.0 0.0 0.5 1.0 1.0 NA 1.0 oob_squish_infinite(c(-Inf, -1, 0.5, 1, 2, NA, Inf)) #> [1] 0.0 -1.0 0.5 1.0 2.0 NA 1.0 # Keeping does not alter values oob_keep(c(-Inf, -1, 0.5, 1, 2, NA, Inf)) #> [1] -Inf -1.0 0.5 1.0 2.0 NA Inf # Discarding will remove out of bounds values oob_discard(c(-Inf, -1, 0.5, 1, 2, NA, Inf)) #> [1] 0.5 1.0 NA"},{"path":"https://scales.r-lib.org/dev/reference/ordinal_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_ordinal() — ordinal_format","title":"Superseded interface to label_ordinal() — ordinal_format","text":"functions kept backward compatibility; switch label_ordinal() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/ordinal_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_ordinal() — ordinal_format","text":"","code":"ordinal_format( prefix = \"\", suffix = \"\", big.mark = \" \", rules = ordinal_english(), ... ) ordinal( x, prefix = \"\", suffix = \"\", big.mark = \" \", rules = ordinal_english(), ... )"},{"path":"https://scales.r-lib.org/dev/reference/ordinal_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_ordinal() — ordinal_format","text":"prefix, suffix Symbols display value. big.mark Character used every 3 digits separate thousands. rules Named list regular expressions, matched order. Name gives suffix, value specifies numbers match. ... arguments passed base::format().","code":""},{"path":"https://scales.r-lib.org/dev/reference/parse_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_parse()/label_math() — parse_format","title":"Superseded interface to label_parse()/label_math() — parse_format","text":"functions kept backward compatibility; switch label_parse()/label_math() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/parse_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_parse()/label_math() — parse_format","text":"","code":"parse_format() math_format(expr = 10^.x, format = force)"},{"path":"https://scales.r-lib.org/dev/reference/parse_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_parse()/label_math() — parse_format","text":"expr expression use format another format function apply prior mathematical transformation - makes easier use floating point numbers mathematical expressions.","code":""},{"path":"https://scales.r-lib.org/dev/reference/percent_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_percent() — percent_format","title":"Superseded interface to label_percent() — percent_format","text":"functions kept backward compatibility; switch label_percent() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/percent_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_percent() — percent_format","text":"","code":"percent_format( accuracy = NULL, scale = 100, prefix = \"\", suffix = \"%\", big.mark = \" \", decimal.mark = \".\", trim = TRUE, ... ) percent( x, accuracy = NULL, scale = 100, prefix = \"\", suffix = \"%\", big.mark = \" \", decimal.mark = \".\", trim = TRUE, ... )"},{"path":"https://scales.r-lib.org/dev/reference/percent_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_percent() — percent_format","text":"accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). ... arguments passed base::format().","code":""},{"path":"https://scales.r-lib.org/dev/reference/pretty_breaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to breaks_pretty() — pretty_breaks","title":"Superseded interface to breaks_pretty() — pretty_breaks","text":"functions kept backward compatibility; switch breaks_pretty() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/pretty_breaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to breaks_pretty() — pretty_breaks","text":"","code":"pretty_breaks(n = 5, ...)"},{"path":"https://scales.r-lib.org/dev/reference/pretty_breaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to breaks_pretty() — pretty_breaks","text":"n Desired number breaks. may get slightly fewer breaks requested. ... arguments passed pretty()","code":""},{"path":"https://scales.r-lib.org/dev/reference/probability_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Probability transformation — probability_trans","title":"Probability transformation — probability_trans","text":"Probability transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/probability_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Probability transformation — probability_trans","text":"","code":"probability_trans(distribution, ...) logit_trans() probit_trans()"},{"path":"https://scales.r-lib.org/dev/reference/probability_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Probability transformation — probability_trans","text":"distribution probability distribution. standard R abbreviation \"p\" + distribution valid cumulative distribution function, \"q\" + distribution valid quantile function, \"d\" + distribution valid probability density function. ... arguments passed distribution quantile functions","code":""},{"path":"https://scales.r-lib.org/dev/reference/probability_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Probability transformation — probability_trans","text":"","code":"plot(logit_trans(), xlim = c(0, 1)) plot(probit_trans(), xlim = c(0, 1))"},{"path":"https://scales.r-lib.org/dev/reference/pvalue_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_pvalue() — pvalue_format","title":"Superseded interface to label_pvalue() — pvalue_format","text":"functions kept backward compatibility; switch label_pvalue() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/pvalue_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_pvalue() — pvalue_format","text":"","code":"pvalue_format( accuracy = 0.001, decimal.mark = \".\", prefix = NULL, add_p = FALSE ) pvalue(x, accuracy = 0.001, decimal.mark = \".\", prefix = NULL, add_p = FALSE)"},{"path":"https://scales.r-lib.org/dev/reference/pvalue_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_pvalue() — pvalue_format","text":"accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. decimal.mark character used indicate numeric decimal point. prefix character vector length 3 giving prefixes put front numbers. default values c(\"<\", \"\", \">\") add_p TRUE c(\"p<\", \"p=\", \"p>\") FALSE. add_p Add \"p=\" value?","code":""},{"path":"https://scales.r-lib.org/dev/reference/reciprocal_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Reciprocal transformation — reciprocal_trans","title":"Reciprocal transformation — reciprocal_trans","text":"Reciprocal transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/reciprocal_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reciprocal transformation — reciprocal_trans","text":"","code":"reciprocal_trans()"},{"path":"https://scales.r-lib.org/dev/reference/reciprocal_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reciprocal transformation — reciprocal_trans","text":"","code":"plot(reciprocal_trans(), xlim = c(0, 1))"},{"path":"https://scales.r-lib.org/dev/reference/regular_minor_breaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Minor breaks — regular_minor_breaks","title":"Minor breaks — regular_minor_breaks","text":"Places minor breaks major breaks.","code":""},{"path":"https://scales.r-lib.org/dev/reference/regular_minor_breaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Minor breaks — regular_minor_breaks","text":"","code":"regular_minor_breaks(reverse = FALSE)"},{"path":"https://scales.r-lib.org/dev/reference/regular_minor_breaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Minor breaks — regular_minor_breaks","text":"reverse TRUE, calculates minor breaks reversed scale","code":""},{"path":"https://scales.r-lib.org/dev/reference/regular_minor_breaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Minor breaks — regular_minor_breaks","text":"","code":"m <- extended_breaks()(c(1, 10)) regular_minor_breaks()(m, c(1, 10), n = 2) #> [1] 0.00 1.25 2.50 3.75 5.00 6.25 7.50 8.75 10.00 n <- extended_breaks()(c(0, -9)) regular_minor_breaks(reverse = TRUE)(n, c(0, -9), n = 2) #> [1] -10.00 -8.75 -7.50 -6.25 -5.00 -3.75 -2.50 -1.25 0.00"},{"path":"https://scales.r-lib.org/dev/reference/rescale.html","id":null,"dir":"Reference","previous_headings":"","what":"Rescale continuous vector to have specified minimum and maximum — rescale","title":"Rescale continuous vector to have specified minimum and maximum — rescale","text":"Rescale continuous vector specified minimum maximum","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rescale continuous vector to have specified minimum and maximum — rescale","text":"","code":"rescale(x, to, from, ...) # S3 method for numeric rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for dist rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for logical rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for POSIXt rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for Date rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for integer64 rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE), ...) # S3 method for difftime rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for AsIs rescale(x, to, from, ...)"},{"path":"https://scales.r-lib.org/dev/reference/rescale.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rescale continuous vector to have specified minimum and maximum — rescale","text":"x continuous vector values manipulate. output range (numeric vector length two) input range (vector length two). given, calculated range x ... arguments passed methods","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Rescale continuous vector to have specified minimum and maximum — rescale","text":"Objects class returned unaltered.","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Rescale continuous vector to have specified minimum and maximum — rescale","text":"","code":"rescale(1:100) #> [1] 0.00000000 0.01010101 0.02020202 0.03030303 0.04040404 0.05050505 #> [7] 0.06060606 0.07070707 0.08080808 0.09090909 0.10101010 0.11111111 #> [13] 0.12121212 0.13131313 0.14141414 0.15151515 0.16161616 0.17171717 #> [19] 0.18181818 0.19191919 0.20202020 0.21212121 0.22222222 0.23232323 #> [25] 0.24242424 0.25252525 0.26262626 0.27272727 0.28282828 0.29292929 #> [31] 0.30303030 0.31313131 0.32323232 0.33333333 0.34343434 0.35353535 #> [37] 0.36363636 0.37373737 0.38383838 0.39393939 0.40404040 0.41414141 #> [43] 0.42424242 0.43434343 0.44444444 0.45454545 0.46464646 0.47474747 #> [49] 0.48484848 0.49494949 0.50505051 0.51515152 0.52525253 0.53535354 #> [55] 0.54545455 0.55555556 0.56565657 0.57575758 0.58585859 0.59595960 #> [61] 0.60606061 0.61616162 0.62626263 0.63636364 0.64646465 0.65656566 #> [67] 0.66666667 0.67676768 0.68686869 0.69696970 0.70707071 0.71717172 #> [73] 0.72727273 0.73737374 0.74747475 0.75757576 0.76767677 0.77777778 #> [79] 0.78787879 0.79797980 0.80808081 0.81818182 0.82828283 0.83838384 #> [85] 0.84848485 0.85858586 0.86868687 0.87878788 0.88888889 0.89898990 #> [91] 0.90909091 0.91919192 0.92929293 0.93939394 0.94949495 0.95959596 #> [97] 0.96969697 0.97979798 0.98989899 1.00000000 rescale(runif(50)) #> [1] 0.35294605 0.16181607 0.39314045 0.85065834 0.35802212 0.05633311 #> [7] 0.77341801 0.34494675 0.65761841 0.58279869 0.38302583 0.33666975 #> [13] 0.23789271 0.73177620 0.16677564 0.68218924 0.09342438 0.88245698 #> [19] 0.69983096 0.19467163 0.75648344 0.00000000 0.95210076 0.82642746 #> [25] 0.27111510 0.36507516 0.06692242 0.16661516 0.95829225 0.30041852 #> [31] 0.35879886 0.12296450 0.84605472 0.82585116 0.61050248 0.12729648 #> [37] 0.18173535 0.39313541 0.96840614 0.41471765 0.50594759 0.14284788 #> [43] 0.47642865 1.00000000 0.40439016 0.30692111 0.55356293 0.95861828 #> [49] 0.45697453 0.89713203 rescale(1) #> [1] 0.5"},{"path":"https://scales.r-lib.org/dev/reference/rescale_max.html","id":null,"dir":"Reference","previous_headings":"","what":"Rescale numeric vector to have specified maximum — rescale_max","title":"Rescale numeric vector to have specified maximum — rescale_max","text":"Rescale numeric vector specified maximum","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_max.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rescale numeric vector to have specified maximum — rescale_max","text":"","code":"rescale_max(x, to = c(0, 1), from = range(x, na.rm = TRUE))"},{"path":"https://scales.r-lib.org/dev/reference/rescale_max.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rescale numeric vector to have specified maximum — rescale_max","text":"x numeric vector values manipulate. output range (numeric vector length two) input range (numeric vector length two). given, calculated range x","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_max.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Rescale numeric vector to have specified maximum — rescale_max","text":"","code":"rescale_max(1:100) #> [1] 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12 0.13 #> [14] 0.14 0.15 0.16 0.17 0.18 0.19 0.20 0.21 0.22 0.23 0.24 0.25 0.26 #> [27] 0.27 0.28 0.29 0.30 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 #> [40] 0.40 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.50 0.51 0.52 #> [53] 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.60 0.61 0.62 0.63 0.64 0.65 #> [66] 0.66 0.67 0.68 0.69 0.70 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 #> [79] 0.79 0.80 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.90 0.91 #> [92] 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.00 rescale_max(runif(50)) #> [1] 0.38892514 0.73607949 0.82669058 0.39723952 0.07484311 0.89453769 #> [7] 0.01922970 0.49815929 0.30428408 0.55724717 0.70652149 0.79347443 #> [13] 0.12139773 0.11679893 0.45051510 0.20936790 0.43005844 0.75168601 #> [19] 0.41016505 0.22234548 0.08153313 0.05265336 0.65905837 0.91345277 #> [25] 0.32511201 0.54304242 0.45009993 0.09975043 1.00000000 0.74319320 #> [31] 0.34742648 0.45707189 0.10110435 0.49342050 0.81058855 0.26832750 #> [37] 0.82084827 0.39844007 0.86196453 0.95687918 0.79931857 0.37543684 #> [43] 0.69139558 0.75177763 0.35796626 0.76010418 0.69593931 0.71550978 #> [49] 0.64317453 0.82467219 rescale_max(1) #> [1] 1"},{"path":"https://scales.r-lib.org/dev/reference/rescale_mid.html","id":null,"dir":"Reference","previous_headings":"","what":"Rescale vector to have specified minimum, midpoint, and maximum — rescale_mid","title":"Rescale vector to have specified minimum, midpoint, and maximum — rescale_mid","text":"Rescale vector specified minimum, midpoint, maximum","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_mid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rescale vector to have specified minimum, midpoint, and maximum — rescale_mid","text":"","code":"rescale_mid(x, to, from, mid, ...) # S3 method for numeric rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for logical rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for dist rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for POSIXt rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid, ...) # S3 method for Date rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid, ...) # S3 method for integer64 rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for AsIs rescale_mid(x, to, from, ...)"},{"path":"https://scales.r-lib.org/dev/reference/rescale_mid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rescale vector to have specified minimum, midpoint, and maximum — rescale_mid","text":"x vector values manipulate. output range (numeric vector length two) input range (vector length two). given, calculated range x mid mid-point input range ... arguments passed methods","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_mid.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Rescale vector to have specified minimum, midpoint, and maximum — rescale_mid","text":"Objects class returned unaltered.","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_mid.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Rescale vector to have specified minimum, midpoint, and maximum — rescale_mid","text":"","code":"rescale_mid(1:100, mid = 50.5) #> [1] 0.00000000 0.01010101 0.02020202 0.03030303 0.04040404 0.05050505 #> [7] 0.06060606 0.07070707 0.08080808 0.09090909 0.10101010 0.11111111 #> [13] 0.12121212 0.13131313 0.14141414 0.15151515 0.16161616 0.17171717 #> [19] 0.18181818 0.19191919 0.20202020 0.21212121 0.22222222 0.23232323 #> [25] 0.24242424 0.25252525 0.26262626 0.27272727 0.28282828 0.29292929 #> [31] 0.30303030 0.31313131 0.32323232 0.33333333 0.34343434 0.35353535 #> [37] 0.36363636 0.37373737 0.38383838 0.39393939 0.40404040 0.41414141 #> [43] 0.42424242 0.43434343 0.44444444 0.45454545 0.46464646 0.47474747 #> [49] 0.48484848 0.49494949 0.50505051 0.51515152 0.52525253 0.53535354 #> [55] 0.54545455 0.55555556 0.56565657 0.57575758 0.58585859 0.59595960 #> [61] 0.60606061 0.61616162 0.62626263 0.63636364 0.64646465 0.65656566 #> [67] 0.66666667 0.67676768 0.68686869 0.69696970 0.70707071 0.71717172 #> [73] 0.72727273 0.73737374 0.74747475 0.75757576 0.76767677 0.77777778 #> [79] 0.78787879 0.79797980 0.80808081 0.81818182 0.82828283 0.83838384 #> [85] 0.84848485 0.85858586 0.86868687 0.87878788 0.88888889 0.89898990 #> [91] 0.90909091 0.91919192 0.92929293 0.93939394 0.94949495 0.95959596 #> [97] 0.96969697 0.97979798 0.98989899 1.00000000 rescale_mid(runif(50), mid = 0.5) #> [1] 0.06262396 0.53902465 0.93641895 0.57480904 0.80473723 0.19075331 #> [7] 0.49824808 0.19589617 0.30973516 0.45119286 0.15711198 0.30465784 #> [13] 0.70868387 0.23752440 0.62786019 0.47440867 0.72446532 0.35806606 #> [19] 0.27395095 0.02798991 0.65947846 0.33384084 0.09402949 0.58214290 #> [25] 0.76952319 0.64177821 0.23798579 0.23896937 0.24869525 0.01314989 #> [31] 0.40605523 0.05629610 0.97706818 0.89750490 0.42905334 0.90458556 #> [37] 0.46103609 0.92888646 0.38542860 0.91165048 0.50981009 0.36223602 #> [43] 0.39668231 0.00000000 0.27207087 0.23489024 0.93340462 0.02818688 #> [49] 0.14345649 0.66958400 rescale_mid(1) #> [1] 0.5"},{"path":"https://scales.r-lib.org/dev/reference/rescale_none.html","id":null,"dir":"Reference","previous_headings":"","what":"Don't perform rescaling — rescale_none","title":"Don't perform rescaling — rescale_none","text":"perform rescaling","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_none.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Don't perform rescaling — rescale_none","text":"","code":"rescale_none(x, ...)"},{"path":"https://scales.r-lib.org/dev/reference/rescale_none.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Don't perform rescaling — rescale_none","text":"x numeric vector values manipulate. ... arguments ignored","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_none.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Don't perform rescaling — rescale_none","text":"","code":"rescale_none(1:100) #> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #> [18] 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 #> [35] 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 #> [52] 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 #> [69] 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 #> [86] 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100"},{"path":"https://scales.r-lib.org/dev/reference/rescale_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Rescale palette (continuous) — rescale_pal","title":"Rescale palette (continuous) — rescale_pal","text":"Just rescales input specific output range. Useful alpha, size, continuous position.","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rescale palette (continuous) — rescale_pal","text":"","code":"rescale_pal(range = c(0.1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/rescale_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rescale palette (continuous) — rescale_pal","text":"range Numeric vector length two, giving range possible values. 0 1.","code":""},{"path":"https://scales.r-lib.org/dev/reference/reverse_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Reverse transformation — reverse_trans","title":"Reverse transformation — reverse_trans","text":"reversing transformation works multiplying input -1. means reverse transformation easily composed transformations require positive input unless reversing done final step.","code":""},{"path":"https://scales.r-lib.org/dev/reference/reverse_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reverse transformation — reverse_trans","text":"","code":"reverse_trans()"},{"path":"https://scales.r-lib.org/dev/reference/reverse_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reverse transformation — reverse_trans","text":"","code":"plot(reverse_trans(), xlim = c(-1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/scales-package.html","id":null,"dir":"Reference","previous_headings":"","what":"scales: Scale Functions for Visualization — scales-package","title":"scales: Scale Functions for Visualization — scales-package","text":"Graphical scales map data aesthetics, provide methods automatically determining breaks labels axes legends.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/scales-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"scales: Scale Functions for Visualization — scales-package","text":"Maintainer: Thomas Lin Pedersen thomasp85@posit.co (ORCID) Authors: Hadley Wickham hadley@posit.co Dana Seidel contributors: Posit, PBC [copyright holder, funder]","code":""},{"path":"https://scales.r-lib.org/dev/reference/scientific_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_scientific() — scientific_format","title":"Superseded interface to label_scientific() — scientific_format","text":"functions kept backward compatibility; switch label_scientific() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/scientific_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_scientific() — scientific_format","text":"","code":"scientific_format( digits = 3, scale = 1, prefix = \"\", suffix = \"\", decimal.mark = \".\", trim = TRUE, ... ) scientific( x, digits = 3, scale = 1, prefix = \"\", suffix = \"\", decimal.mark = \".\", trim = TRUE, ... )"},{"path":"https://scales.r-lib.org/dev/reference/scientific_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_scientific() — scientific_format","text":"digits Number digits show exponent. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix, suffix Symbols display value. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). ... arguments passed base::format().","code":""},{"path":"https://scales.r-lib.org/dev/reference/seq_gradient_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Sequential colour gradient palette (continuous) — seq_gradient_pal","title":"Sequential colour gradient palette (continuous) — seq_gradient_pal","text":"Sequential colour gradient palette (continuous)","code":""},{"path":"https://scales.r-lib.org/dev/reference/seq_gradient_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sequential colour gradient palette (continuous) — seq_gradient_pal","text":"","code":"seq_gradient_pal(low = mnsl(\"10B 4/6\"), high = mnsl(\"10R 4/6\"), space = \"Lab\")"},{"path":"https://scales.r-lib.org/dev/reference/seq_gradient_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sequential colour gradient palette (continuous) — seq_gradient_pal","text":"low colour low end gradient. high colour high end gradient. space colour space calculate gradient. Must \"Lab\" - values deprecated.","code":""},{"path":"https://scales.r-lib.org/dev/reference/seq_gradient_pal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sequential colour gradient palette (continuous) — seq_gradient_pal","text":"","code":"x <- seq(0, 1, length.out = 25) show_col(seq_gradient_pal()(x)) show_col(seq_gradient_pal(\"white\", \"black\")(x)) library(munsell) show_col(seq_gradient_pal(\"white\", mnsl(\"10R 4/6\"))(x))"},{"path":"https://scales.r-lib.org/dev/reference/shape_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Shape palette (discrete) — shape_pal","title":"Shape palette (discrete) — shape_pal","text":"Shape palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/shape_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Shape palette (discrete) — shape_pal","text":"","code":"shape_pal(solid = TRUE)"},{"path":"https://scales.r-lib.org/dev/reference/shape_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shape palette (discrete) — shape_pal","text":"solid shapes solid ?","code":""},{"path":"https://scales.r-lib.org/dev/reference/show_col.html","id":null,"dir":"Reference","previous_headings":"","what":"Show colours — show_col","title":"Show colours — show_col","text":"quick dirty way show colours plot.","code":""},{"path":"https://scales.r-lib.org/dev/reference/show_col.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show colours — show_col","text":"","code":"show_col(colours, labels = TRUE, borders = NULL, cex_label = 1, ncol = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/show_col.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show colours — show_col","text":"colours character vector colours labels Label colour hex name? borders Border colour tile. Default uses par(\"fg\"). Use border = NA omit borders. cex_label Size printed labels, multiplier default size. ncol Number columns. supplied, tries square possible.","code":""},{"path":"https://scales.r-lib.org/dev/reference/show_col.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Show colours — show_col","text":"","code":"show_col(hue_pal()(9)) show_col(hue_pal()(9), borders = NA) show_col(viridis_pal()(16)) show_col(viridis_pal()(16), labels = FALSE)"},{"path":"https://scales.r-lib.org/dev/reference/sqrt_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Square-root transformation — sqrt_trans","title":"Square-root transformation — sqrt_trans","text":"variance stabilising transformation Poisson distribution.","code":""},{"path":"https://scales.r-lib.org/dev/reference/sqrt_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Square-root transformation — sqrt_trans","text":"","code":"sqrt_trans()"},{"path":"https://scales.r-lib.org/dev/reference/sqrt_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Square-root transformation — sqrt_trans","text":"","code":"plot(sqrt_trans(), xlim = c(0, 5))"},{"path":"https://scales.r-lib.org/dev/reference/time_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Transformation for date-times (class POSIXt) — time_trans","title":"Transformation for date-times (class POSIXt) — time_trans","text":"Transformation date-times (class POSIXt)","code":""},{"path":"https://scales.r-lib.org/dev/reference/time_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transformation for date-times (class POSIXt) — time_trans","text":"","code":"time_trans(tz = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/time_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Transformation for date-times (class POSIXt) — time_trans","text":"tz Optionally supply time zone. NULL, default, time zone extracted first input non-null tz.","code":""},{"path":"https://scales.r-lib.org/dev/reference/time_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Transformation for date-times (class POSIXt) — time_trans","text":"","code":"hours <- seq(ISOdate(2000, 3, 20, tz = \"\"), by = \"hour\", length.out = 10) t <- time_trans() t$transform(hours) #> [1] 953553600 953557200 953560800 953564400 953568000 953571600 953575200 #> [8] 953578800 953582400 953586000 t$inverse(t$transform(hours)) #> [1] \"2000-03-20 12:00:00 UTC\" \"2000-03-20 13:00:00 UTC\" #> [3] \"2000-03-20 14:00:00 UTC\" \"2000-03-20 15:00:00 UTC\" #> [5] \"2000-03-20 16:00:00 UTC\" \"2000-03-20 17:00:00 UTC\" #> [7] \"2000-03-20 18:00:00 UTC\" \"2000-03-20 19:00:00 UTC\" #> [9] \"2000-03-20 20:00:00 UTC\" \"2000-03-20 21:00:00 UTC\" t$format(t$breaks(range(hours))) #> [1] \"12:00\" \"15:00\" \"18:00\" \"21:00\""},{"path":"https://scales.r-lib.org/dev/reference/timespan_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Transformation for times (class hms) — timespan_trans","title":"Transformation for times (class hms) — timespan_trans","text":"timespan_trans() provides transformations data encoding time passed along breaks label formatting showing standard unit time fitting range data. hms_trans() provides using standard hms idioms formatting.","code":""},{"path":"https://scales.r-lib.org/dev/reference/timespan_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transformation for times (class hms) — timespan_trans","text":"","code":"timespan_trans(unit = c(\"secs\", \"mins\", \"hours\", \"days\", \"weeks\")) hms_trans()"},{"path":"https://scales.r-lib.org/dev/reference/timespan_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Transformation for times (class hms) — timespan_trans","text":"unit unit used interpret numeric input","code":""},{"path":"https://scales.r-lib.org/dev/reference/timespan_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Transformation for times (class hms) — timespan_trans","text":"","code":"# timespan_trans allows you to specify the time unit numeric data is # interpreted in min_trans <- timespan_trans(\"mins\") demo_timespan(seq(0, 100), trans = min_trans) #> scale_x_continuous(trans = min_trans) # Input already in difftime format is interpreted correctly demo_timespan(as.difftime(seq(0, 100), units = \"secs\"), trans = min_trans) #> scale_x_continuous(trans = min_trans) if (require(\"hms\")) { # hms_trans always assumes seconds hms <- round(runif(10) * 86400) t <- hms_trans() t$transform(hms) t$inverse(t$transform(hms)) t$breaks(hms) # The break labels also follow the hms format demo_timespan(hms, trans = t) } #> Loading required package: hms #> scale_x_continuous(trans = t)"},{"path":"https://scales.r-lib.org/dev/reference/train_continuous.html","id":null,"dir":"Reference","previous_headings":"","what":"Train (update) a continuous scale — train_continuous","title":"Train (update) a continuous scale — train_continuous","text":"Strips attributes always returns numeric vector","code":""},{"path":"https://scales.r-lib.org/dev/reference/train_continuous.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Train (update) a continuous scale — train_continuous","text":"","code":"train_continuous(new, existing = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/train_continuous.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Train (update) a continuous scale — train_continuous","text":"new New data add scale existing Optional existing scale update","code":""},{"path":"https://scales.r-lib.org/dev/reference/train_discrete.html","id":null,"dir":"Reference","previous_headings":"","what":"Train (update) a discrete scale — train_discrete","title":"Train (update) a discrete scale — train_discrete","text":"Train (update) discrete scale","code":""},{"path":"https://scales.r-lib.org/dev/reference/train_discrete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Train (update) a discrete scale — train_discrete","text":"","code":"train_discrete(new, existing = NULL, drop = FALSE, na.rm = FALSE)"},{"path":"https://scales.r-lib.org/dev/reference/train_discrete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Train (update) a discrete scale — train_discrete","text":"new New data add scale existing Optional existing scale update drop TRUE, drop factor levels associated data na.rm TRUE, remove missing values","code":""},{"path":"https://scales.r-lib.org/dev/reference/trans_breaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Pretty breaks on transformed scale — trans_breaks","title":"Pretty breaks on transformed scale — trans_breaks","text":"often produce attractive breaks.","code":""},{"path":"https://scales.r-lib.org/dev/reference/trans_breaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pretty breaks on transformed scale — trans_breaks","text":"","code":"trans_breaks(trans, inv, n = 5, ...)"},{"path":"https://scales.r-lib.org/dev/reference/trans_breaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pretty breaks on transformed scale — trans_breaks","text":"trans function single variable, x, given numeric vector returns transformed values inv inverse transformation function n desired number ticks ... arguments passed pretty","code":""},{"path":"https://scales.r-lib.org/dev/reference/trans_breaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pretty breaks on transformed scale — trans_breaks","text":"","code":"trans_breaks(\"log10\", function(x) 10^x)(c(1, 1e6)) #> [1] 1e+00 1e+01 1e+02 1e+03 1e+04 1e+05 1e+06 trans_breaks(\"sqrt\", function(x) x^2)(c(1, 100)) #> [1] 0 4 16 36 64 100 trans_breaks(function(x) 1 / x, function(x) 1 / x)(c(1, 100)) #> [1] Inf 5.000000 2.500000 1.666667 1.250000 1.000000 trans_breaks(function(x) -x, function(x) -x)(c(1, 100)) #> [1] 100 80 60 40 20 0"},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/trans_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format labels after transformation — trans_format","text":"","code":"trans_format(trans, format = scientific_format())"},{"path":"https://scales.r-lib.org/dev/reference/trans_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format labels after transformation — trans_format","text":"trans transformation apply format additional formatter apply transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/trans_format.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format labels after transformation — trans_format","text":"function single parameter x, numeric vector, returns character vector list expressions","code":""},{"path":"https://scales.r-lib.org/dev/reference/trans_format.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Format labels after transformation — trans_format","text":"","code":"tf <- trans_format(\"log10\", scientific_format()) tf(10^1:6) #> [1] \"1.00e+00\" \"9.54e-01\" \"9.03e-01\" \"8.45e-01\" \"7.78e-01\""},{"path":"https://scales.r-lib.org/dev/reference/trans_new.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new transformation object — trans_new","title":"Create a new transformation object — trans_new","text":"transformation encapsulates transformation inverse, well information needed create pleasing breaks labels. breaks() function applied un-transformed range data, format() function takes output breaks() function returns well-formatted labels. Transformations may also include derivatives transformation inverse, required .","code":""},{"path":"https://scales.r-lib.org/dev/reference/trans_new.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new transformation object — trans_new","text":"","code":"trans_new( name, transform, inverse, d_transform = NULL, d_inverse = NULL, breaks = extended_breaks(), minor_breaks = regular_minor_breaks(), format = format_format(), domain = c(-Inf, Inf) ) is.trans(x) as.trans(x, arg = deparse(substitute(x)))"},{"path":"https://scales.r-lib.org/dev/reference/trans_new.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new transformation object — trans_new","text":"name transformation name transform function, name function, performs transformation inverse function, name function, performs inverse transformation d_transform Optional function, name function, gives derivative transformation. May NULL. d_inverse Optional function, name function, gives derivative inverse transformation. May NULL. breaks default breaks function transformation. breaks function applied un-transformed data. minor_breaks default minor breaks function transformation. format default format transformation. format applied breaks generated un-transformed data. domain allowed range data transformed. function transform argument expected able transform domain argument.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/trans_range.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute range of transformed values — trans_range","title":"Compute range of transformed values — trans_range","text":"Silently drops ranges outside domain trans.","code":""},{"path":"https://scales.r-lib.org/dev/reference/trans_range.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute range of transformed values — trans_range","text":"","code":"trans_range(trans, x)"},{"path":"https://scales.r-lib.org/dev/reference/trans_range.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute range of transformed values — trans_range","text":"trans transformation object, name transformation object given string. x numeric vector compute range ","code":""},{"path":"https://scales.r-lib.org/dev/reference/unit_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Unit labels — unit_format","title":"Unit labels — unit_format","text":"function kept backward compatiblity; either use label_number() label_number_si() instead.","code":""},{"path":"https://scales.r-lib.org/dev/reference/unit_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Unit labels — unit_format","text":"","code":"unit_format( accuracy = NULL, scale = 1, prefix = \"\", unit = \"m\", sep = \" \", suffix = paste0(sep, unit), big.mark = \" \", decimal.mark = \".\", trim = TRUE, ... )"},{"path":"https://scales.r-lib.org/dev/reference/unit_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Unit labels — unit_format","text":"accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). unit units append. sep separator number unit label. suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). ... arguments passed base::format().","code":""},{"path":"https://scales.r-lib.org/dev/reference/unit_format.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Unit labels — unit_format","text":"","code":"# Label with units demo_continuous(c(0, 1), labels = unit_format(unit = \"m\")) #> scale_x_continuous(labels = unit_format(unit = \"m\")) # Labels in kg, but original data in g km <- unit_format(unit = \"km\", scale = 1e-3, digits = 2) demo_continuous(c(0, 2500), labels = km) #> scale_x_continuous(labels = km)"},{"path":"https://scales.r-lib.org/dev/reference/viridis_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Viridis palette — viridis_pal","title":"Viridis palette — viridis_pal","text":"Viridis palette","code":""},{"path":"https://scales.r-lib.org/dev/reference/viridis_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Viridis palette — viridis_pal","text":"","code":"viridis_pal(alpha = 1, begin = 0, end = 1, direction = 1, option = \"D\")"},{"path":"https://scales.r-lib.org/dev/reference/viridis_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Viridis palette — viridis_pal","text":"alpha alpha transparency, number [0,1], see argument alpha hsv. begin, end (corrected) hue [0,1] color map begins ends. direction Sets order colors scale. 1, default, colors ordered darkest lightest. -1, order colors reversed. option character string indicating color map option use. Eight options available: \"magma\" (\"\") \"inferno\" (\"B\") \"plasma\" (\"C\") \"viridis\" (\"D\") \"cividis\" (\"E\") \"rocket\" (\"F\") \"mako\" (\"G\") \"turbo\" (\"H\")","code":""},{"path":"https://scales.r-lib.org/dev/reference/viridis_pal.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Viridis palette — viridis_pal","text":"https://bids.github.io/colormap/","code":""},{"path":"https://scales.r-lib.org/dev/reference/viridis_pal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Viridis palette — viridis_pal","text":"","code":"show_col(viridis_pal()(10)) show_col(viridis_pal(direction = -1)(6)) show_col(viridis_pal(begin = 0.2, end = 0.8)(4)) show_col(viridis_pal(option = \"plasma\")(6))"},{"path":"https://scales.r-lib.org/dev/reference/wrap_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_wrap() — wrap_format","title":"Superseded interface to label_wrap() — wrap_format","text":"functions kept backward compatibility; switch label_wrap() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/wrap_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_wrap() — wrap_format","text":"","code":"wrap_format(width)"},{"path":"https://scales.r-lib.org/dev/reference/wrap_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_wrap() — wrap_format","text":"width Number characters per line.","code":""},{"path":"https://scales.r-lib.org/dev/reference/yj_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Yeo-Johnson transformation — yj_trans","title":"Yeo-Johnson transformation — yj_trans","text":"Yeo-Johnson transformation flexible transformation similiar Box-Cox, boxcox_trans(), require input values greater zero.","code":""},{"path":"https://scales.r-lib.org/dev/reference/yj_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Yeo-Johnson transformation — yj_trans","text":"","code":"yj_trans(p)"},{"path":"https://scales.r-lib.org/dev/reference/yj_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Yeo-Johnson transformation — yj_trans","text":"p Transformation exponent, \\(\\lambda\\).","code":""},{"path":"https://scales.r-lib.org/dev/reference/yj_trans.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Yeo-Johnson transformation — yj_trans","text":"transformation takes one four forms depending values y \\(\\lambda\\). \\(y \\ge 0\\) \\(\\lambda \\neq 0\\) : \\(y^{(\\lambda)} = \\frac{(y + 1)^\\lambda - 1}{\\lambda}\\) \\(y \\ge 0\\) \\(\\lambda = 0\\): \\(y^{(\\lambda)} = \\ln(y + 1)\\) \\(y < 0\\) \\(\\lambda \\neq 2\\): \\(y^{(\\lambda)} = -\\frac{(-y + 1)^{(2 - \\lambda)} - 1}{2 - \\lambda}\\) \\(y < 0\\) \\(\\lambda = 2\\): \\(y^{(\\lambda)} = -\\ln(-y + 1)\\)","code":""},{"path":"https://scales.r-lib.org/dev/reference/yj_trans.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Yeo-Johnson transformation — yj_trans","text":"Yeo, ., & Johnson, R. (2000). New Family Power Transformations Improve Normality Symmetry. Biometrika, 87(4), 954-959. https://www.jstor.org/stable/2673623","code":""},{"path":"https://scales.r-lib.org/dev/reference/yj_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Yeo-Johnson transformation — yj_trans","text":"","code":"plot(yj_trans(-1), xlim = c(-10, 10)) plot(yj_trans(0), xlim = c(-10, 10)) plot(yj_trans(1), xlim = c(-10, 10)) plot(yj_trans(2), xlim = c(-10, 10))"},{"path":"https://scales.r-lib.org/dev/reference/zero_range.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine if range of vector is close to zero, with a specified tolerance — zero_range","title":"Determine if range of vector is close to zero, with a specified tolerance — zero_range","text":"machine epsilon difference 1.0 next number can represented machine. default, function uses epsilon * 1000 tolerance. First scales values mean 1, checks difference larger tolerance.","code":""},{"path":"https://scales.r-lib.org/dev/reference/zero_range.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine if range of vector is close to zero, with a specified tolerance — zero_range","text":"","code":"zero_range(x, tol = 1000 * .Machine$double.eps)"},{"path":"https://scales.r-lib.org/dev/reference/zero_range.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine if range of vector is close to zero, with a specified tolerance — zero_range","text":"x numeric range: vector length 2 tol value specifying tolerance.","code":""},{"path":"https://scales.r-lib.org/dev/reference/zero_range.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine if range of vector is close to zero, with a specified tolerance — zero_range","text":"logical TRUE relative difference endpoints range distinguishable 0.","code":""},{"path":"https://scales.r-lib.org/dev/reference/zero_range.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Determine if range of vector is close to zero, with a specified tolerance — zero_range","text":"","code":"eps <- .Machine$double.eps zero_range(c(1, 1 + eps)) #> [1] TRUE zero_range(c(1, 1 + 99 * eps)) #> [1] TRUE zero_range(c(1, 1 + 1001 * eps)) #> [1] FALSE zero_range(c(1, 1 + 2 * eps), tol = eps) #> [1] FALSE # Scaling up or down all the values has no effect since the values # are rescaled to 1 before checking against tol zero_range(100000 * c(1, 1 + eps)) #> [1] TRUE zero_range(100000 * c(1, 1 + 1001 * eps)) #> [1] FALSE zero_range(.00001 * c(1, 1 + eps)) #> [1] TRUE zero_range(.00001 * c(1, 1 + 1001 * eps)) #> [1] FALSE # NA values zero_range(c(1, NA)) # NA #> [1] NA zero_range(c(1, NaN)) # NA #> [1] NA # Infinite values zero_range(c(1, Inf)) # FALSE #> [1] FALSE zero_range(c(-Inf, Inf)) # FALSE #> [1] FALSE zero_range(c(Inf, Inf)) # TRUE #> [1] TRUE"},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-development-version","dir":"Changelog","previous_headings":"","what":"scales (development version)","title":"scales (development version)","text":"train_continuous() coerces new numeric calculating range (@teunbrand, #369). Training factor data longer sorts range multiple training passes (#383) Attempt make sort behavior range consistent character vectors training. Mixing character factor data still lead different results depending training order. Add rescale method difftime objects (#382) rescale((x), ...) rescale_mid((x), ...) return (x) unaltered (@teunbrand, #403). scale_cut argument number() now works advertised values lowest cut value (#346) label_dollar() superseeded label_currency() clarity (#344) sqrt_trans() longer returns inverse values outside domain (#214) Add better support difftime objects. label_timespan() adds functionality adding correct unit suffix timespan data, breaks_timespan() adds functionality finding pleasant breakpoints across various bases time units, timespan_trans() wraps together provides alternative hms_trans() (#212) Add inverse (area) hyperbolic sine transformation asinh_trans(), provides logarithm-like transformation space, accommodates negative values (#297) Transformation objects can optionally include derivatives transform inverse transform (@mjskay, #322).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-121","dir":"Changelog","previous_headings":"","what":"scales 1.2.1","title":"scales 1.2.1","text":"CRAN release: 2022-08-19 Re-document fix HTML issues .Rd.","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-120","dir":"Changelog","previous_headings":"","what":"scales 1.2.0","title":"scales 1.2.0","text":"CRAN release: 2022-04-13","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"new-features-1-2-0","dir":"Changelog","previous_headings":"","what":"New features","title":"scales 1.2.0","text":"label_number(): New style_positive style_negative argument control positive negative numbers styled (#249, #262). prefix comes negative sign, rather , yielding (e.g) correct -$1 instead $-1. New scale_cut argument enables independent scaling different parts range. useful label_dollar() support scaling large numbers suffix (e.g. “M” million, “B” billion). can used cut_short_scale() billion = thousand million cut_long_scale() billion = million million (initial implementation provided @davidchall). Additionally, accuracy now computed per scale category, rescaled values can different numbers decimal places (#339). label_number_si() deprecated previously used short scale abbreviations instead correct SI prefixes. can mimic previous results label_number(scale_cut = cut_scale_short()) get real SI labels label_number(scale_cut = cut_SI(\"m\")) (#339, help @davidchall). label_bytes() now correctly accounts scale argument choosing auto units (@davidchall, #235). label_date() label_time() gain locale argument allows set locale used generate day month names (#309). New label_log() displays base superscript exponent, use logarithmic axes (@davidchall, #312). New compose_trans() allows arbitrary composition transformers. mostly easily achieved passing character vector whenever might previously passed name single transformer. example, scale_y_continuous(trans = c(\"log10\", \"reverse\")) create reverse log-10 scale (#287).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"bug-fixes-and-minor-improvements-1-2-0","dir":"Changelog","previous_headings":"","what":"Bug fixes and minor improvements","title":"scales 1.2.0","text":"breaks_width() now supports units like \"3 months\" offset argument. col_quantile() longer errors data sufficiently skewed can’t generate requested number unique colours (#294). dollar(negative_parens) deprecated favour style_negative = \"parens\". hue_pal() respects h.start (#288). label_number_auto() correctly formats single numbers greater 1e+06 without error (@karawoo, #321) manual_pal() now always returns unnamed colour vector, easy use ggplot2::discrete_scale() (@yutannihilation, #284). time_trans() date_trans() domains correct type can transformed without error (#298). Internal precision(), used accuracy = NULL, now avoids displaying unnecessary digits (@davidchall, #304).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-111","dir":"Changelog","previous_headings":"","what":"scales 1.1.1","title":"scales 1.1.1","text":"CRAN release: 2020-05-11 breaks_width() now handles difftime/hms objects (@bhogan-mitre, #244). hue_pal() now correctly inverts color palettes direction = -1 (@dpseidel, #252). Internal precision(), used accuracy = NULL, now better job duplicate values present (@teunbrand, #251). also better job ’s mix finite non-finite values (#257). New oob_keep() keep data outside range, allowing zoom-limits oob_keep used oob argument scales. Existing bounds functions renamed oob_-prefix indicate role (@teunbrand, #255). ordinal_french() gains plural gender arguments (@stephLH, #256).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-110","dir":"Changelog","previous_headings":"","what":"scales 1.1.0","title":"scales 1.1.0","text":"CRAN release: 2019-11-18 Axis breaks labels new naming scheme: functions generate breaks limits called breaks_; functions generate labels breaks called labels_ (#226). breaks labels examples overhauled use new demo_continuous(), demo_discrete(), demo_log10(), can see use scales functions ggplot2.","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"labels-1-1-0","dir":"Changelog","previous_headings":"","what":"Labels","title":"scales 1.1.0","text":"label functions preserve names (#202) keep NAs NAs instead trying convert \"NA\" (@clauswilke, #187). New label_bytes() replaces number_bytes_format() convenient interface. takes single unit argument can either SI unit (e.g. “kB”), binary unit (e.g. “kIB”), automatic unit (either “auto_si” “auto_binary”). always uses “B” symbol bytes (#174), checks units valid. Additionally, auto units now used determine symbol separately value (@mikmart): New label_date_short() creates labels date axis show components date changed since previous label. example, Jan 10, Jan 20, Jan 30, Feb 1, label_date_short() use labels Jan 10, 20, 30, Feb 1 (#209). label_dollar() now correctly formats negative numbers (e.g.) -$200 (#216). label_math() now returns expression vector, doesn’t coerce inputs names. label_number() takes scale account computing accuracy, supplied. means label_percent() better default accuracy many cases (#192). label_number() now picks accuracy automatically default. underlying heuristic improved use distance adjacent breaks (rather total range break). New label_number_auto() automatically picks number_format() scientific_format() based range input. produce nice output wide range inputs (@paleolimbot, #208). New label_number_si() formats numeric vectors limited SI units. Individual values scaled labelled abbreviations “K”, “M”, “B”, “T” dependent magnitude (@dpseidel, #83). label_parse() now generates expression object can used display formatted labels ggplot2 (@agila5, #203). label_pvalue() now reports values close 1 (determined accuracy) (e.g.) “>0.99”. can control prefixes used new prefix argument (#213).","code":"label_bytes(\"auto_binary\")(1024^(1:3)) #> [1] \"1 kiB\" \"1 MiB\" \"1 GiB\""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"breaks-1-1-0","dir":"Changelog","previous_headings":"","what":"Breaks","title":"scales 1.1.0","text":"built breaks functions now returns function takes range desired number breaks, making possible overwrite defaults number desired breaks given constructor call (@thomasp85). breaks_log() nicer behaviour finite inputs (#210). also provides usable breaks even small ranges (@billdenney, #168) New breaks_width() allows specify fixed distance breaks (along optional offset).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"transformations-1-1-0","dir":"Changelog","previous_headings":"","what":"Transformations","title":"scales 1.1.0","text":"New yj_trans() implements Yeo-Johnson transformation (@zamorarr, #196) trans objects gets methods plot() lines(), numeric transformations get example showing transformation. boxcox_trans() longer throws error given NA values (@sflippl, #181).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"other-bug-fixes-and-minor-improvements-1-1-0","dir":"Changelog","previous_headings":"","what":"Other bug fixes and minor improvements","title":"scales 1.1.0","text":"scales now uses farver package colour manipulation instead combination grDevices hand-rolled C++ code (#223). alpha() now preserves element names (@wibeasley, #195) ContinuousRange DiscreteRange methods now properly inherit fully mutable (@dpseidel). col_numeric(), col_bin(), col_quantile(), col_factor() now support viridis colors. Just pass palette name (\"magma\", \"inferno\", \"plasma\", \"viridis\") palette argument (@jcheng5, #191). col_numeric(), col_bin(), col_quantile(), col_factor() now reverse parameter, apply color palettes opposite usual order (.e. high--low instead low--high) (@jcheng5, #191). col_bin() col_quantile() now take right argument, passed base::cut(); indicates whether bin/quantile intervals closed right (open left), vice versa (@jcheng5, #191). col_factor() now tries avoid interpolating qualitative RColorBrewer palettes. Instead, attempts assign palette color factor level. Interpolation still used factor levels available colors, warning emitted case (@jcheng5, #191). dichromat_pal() documentation now builds without requiring suggested dichromat package installed (@dpseidel, #172). date_breaks() now supports subsecond intervals (@dpseidel, #85).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-100","dir":"Changelog","previous_headings":"","what":"scales 1.0.0","title":"scales 1.0.0","text":"CRAN release: 2018-08-09","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"formatters-1-0-0","dir":"Changelog","previous_headings":"New Features","what":"Formatters","title":"scales 1.0.0","text":"comma_format(), percent_format() unit_format() gain new arguments: accuracy, scale, prefix, suffix, decimal.mark, big.mark (@larmarange, #146). dollar_format() gains new arguments: accuracy, scale, decimal.mark, trim (@larmarange, #148). New number_bytes_format() number_bytes() format numeric vectors byte measurements (@hrbrmstr, @dpseidel). New number_format() provides generic formatter numbers (@larmarange, #142). New pvalue_format() formats p-values (@larmarange, #145). ordinal_format() gains new arguments: prefix, suffix, big.mark, rules; rules French Spanish also provided (@larmarange, #149). scientific_format() gains new arguments: scale, prefix, suffix, decimal.mark, trim (@larmarange, #147). New time_format() formats POSIXt hms objects (@dpseidel, #88).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"transformations--breaks-1-0-0","dir":"Changelog","previous_headings":"New Features","what":"Transformations & breaks","title":"scales 1.0.0","text":"boxcox_trans() now invertible x >= 0 requires positive values. new argument offset allows specification type-1 type-2 Box-Cox transformations (@dpseidel, #103). log_breaks() returns integer multiples integer powers base finer breaks needed (@ThierryO, #117). New function modulus_trans() implements modulus transformation positive negative values (@dpseidel). New pseudo_log_trans() transforming numerics signed logarithmic scale smooth transition linear scale around 0 (@lepennec, #106).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"minor-bug-fixes-and-improvements-1-0-0","dir":"Changelog","previous_headings":"","what":"Minor bug fixes and improvements","title":"scales 1.0.0","text":"scales functions now work expected used inside loop. previous package versions scales function used variable custom parameters inside loop, parameters evaluated end loop, due R lazy evaluation works (@zeehio, #81). colour_ramp() now uses alpha = TRUE default (@clauswilke, #108). date_breaks() now supports subsecond intervals (@dpseidel, #85). Removes dichromat plyr dependencies. dichromat now suggested (@dpseidel, #118). expand_range() arguments mul add now affect scales range 0 (@dpseidel, ggplot2-2281). extended_breaks() now allows user specification labeling::extended() argument .loose permit flexible breaks specification (@dpseidel, #99). New rescale() rescale_mid() methods support dist objects (@zeehio, #105). rescale_mid() now properly handles NAs (@foo-bar-baz-qux, #104).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-050","dir":"Changelog","previous_headings":"","what":"scales 0.5.0","title":"scales 0.5.0","text":"CRAN release: 2017-08-24 New function regular_minor_breaks() calculates minor breaks property transformation (@karawoo). Adds viridis_pal() creating palettes color maps viridisLite package (@karawoo). Switched reference classes R6 (#96). rescale() rescale_mid() now S3 generics, work numeric, Date, POSIXct, POSIXlt bit64::integer64 objects (@zeehio, #74).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-041","dir":"Changelog","previous_headings":"","what":"scales 0.4.1","title":"scales 0.4.1","text":"CRAN release: 2016-11-09 extended_breaks() longer fails pathological inputs. New hms_trans() transforming hms time vectors. train_discrete() gets new na.rm argument controls whether NAs preserved dropped.","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-040","dir":"Changelog","previous_headings":"","what":"scales 0.4.0","title":"scales 0.4.0","text":"CRAN release: 2016-02-26 Switched NEWS NEWS.md. manual_pal() produces warning n greater number values palette (@jrnold, #68). precision(0) now returns 1, means percent(0) now returns 0% (#50). scale_continuous() uses correct check numeric values. NaN correctly recognised missing value gradient palettes (ggplot2-1482).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-030","dir":"Changelog","previous_headings":"","what":"scales 0.3.0","title":"scales 0.3.0","text":"CRAN release: 2015-08-25 rescale() preserves missing values input range x (effectively) 0 (ggplot2-985). Continuous colour palettes now use colour_ramp() instead colorRamp(). supports interpolation Lab colour space, hundreds times faster.","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-025","dir":"Changelog","previous_headings":"","what":"scales 0.2.5","title":"scales 0.2.5","text":"CRAN release: 2015-06-12","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"improved-formatting-functions-0-2-5","dir":"Changelog","previous_headings":"","what":"Improved formatting functions","title":"scales 0.2.5","text":"date_format() gains option specify time zone (#51). dollar_format() now flexible can add either prefixes suffixes different currencies (#53). gains negative_parens argument show negative values ($100) now passes missing values unchanged (@dougmitarotonda, #40). New ordinal_format() generates ordinal numbers (1st, 2nd, etc) (@aaronwolen, #55). New unit_format() makes easier add units labels, optionally scaling (@ThierryO, #46). New wrap_format() function wrap character vectors desired width. (@jimhester, #37).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"new-colour-scaling-functions-0-2-5","dir":"Changelog","previous_headings":"","what":"New colour scaling functions","title":"scales 0.2.5","text":"New color scaling functions col_numeric(), col_bin(), col_quantile(), col_factor(). functions provide concise ways map continuous categorical values color spectra. New colour_ramp() function performing color interpolation CIELAB color space (like grDevices::colorRamp(space = 'Lab'), much faster).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"other-bug-fixes-and-minor-improvements-0-2-5","dir":"Changelog","previous_headings":"","what":"Other bug fixes and minor improvements","title":"scales 0.2.5","text":"boxcox_trans() returns correct value p close zero (#31). dollar() percent() correctly return zero length string zero length input (@BrianDiggs, #35). brewer_pal() gains direction argument easily invert order colours (@jiho, #36). show_col() additional options showcase colors better (@jiho, #52). Relaxed tolerance zero_range() .Machine$double.eps * 1000 (#33).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-024","dir":"Changelog","previous_headings":"","what":"scales 0.2.4","title":"scales 0.2.4","text":"CRAN release: 2014-04-22 Eliminate stringr dependency. Fix outstanding errors R CMD check.","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-023","dir":"Changelog","previous_headings":"","what":"scales 0.2.3","title":"scales 0.2.3","text":"CRAN release: 2012-12-05 floor_time() calls to_time(), function moved function longer available scales namespace. Now floor_time() copy function (Thanks Stefan Novak). Color palettes generated brewer_pal() longer give warnings fewer 3 colors requested (@wch). abs_area() rescale_max() functions added, scaling area points proportional value. used scale_size_area() ggplot2.","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-022","dir":"Changelog","previous_headings":"","what":"scales 0.2.2","title":"scales 0.2.2","text":"CRAN release: 2012-09-04 zero_range() improved behaviour thanks Brian Diggs. brewer_pal() complains give incorrect palette type. (Fixes #15, thanks Jean-Olivier Irisson). shape_pal() warns asked 6 values. (Fixes #16, thanks Jean-Olivier Irisson). time_trans() gains optional argument tz specify time zone use times. specified, guess first input non-null time zone. date_trans() time_trans() now check inputs correct type. prevents ggplot2 scales silently giving incorrect outputs given incorrect inputs. Change default breaks algorithm cbreaks() trans_new(). Previously pretty_breaks(), now ’s extended_breaks(), uses extended() algorithm labeling package. fixed namespace problem fullseq().","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-021","dir":"Changelog","previous_headings":"","what":"scales 0.2.1","title":"scales 0.2.1","text":"CRAN release: 2012-05-08 suppressWarnings train_continuous() zero-row infinite data frames don’t potentially cause problems. check zero-length colour gradient_n_pal(). added extended_breaks() implements extension Wilkinson’s labelling approach, implemented labeling package. generally produce nicer breaks pretty_breaks(). alpha() can now preserve existing alpha values alpha() missing. log_breaks() always gives breaks evenly spaced log scale, never evenly spaced data scale. result really bad breaks ranges (e.g 0.5-0.6), probably shouldn’t using log scales situation anyway.","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-020","dir":"Changelog","previous_headings":"","what":"scales 0.2.0","title":"scales 0.2.0","text":"CRAN release: 2012-02-27 censor() squish() gain .finite argument default operating finite values. needed ggplot2, reflects use Inf -Inf special values. bounds functions now force evaluation range avoid bug S3 method dispatch inside primitive functions (e.g. [). Simplified algorithm discrete_range() robust stringsAsFactors global option. Now, order factor preserved full factor first object seen, subsequent inputs subsets levels original factor. scientific() ensures output always scientific format specified number significant digits. comma() ensures output never scientific format (Fixes #7). Another tweak zero_range() better detect range zero length (Fixes #6).","code":""}] +[{"path":[]},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement codeofconduct@posit.co. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://scales.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://scales.r-lib.org/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 scales authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://scales.r-lib.org/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Hadley Wickham. Author. Thomas Lin Pedersen. Maintainer, author. Dana Seidel. Author. . Copyright holder, funder.","code":""},{"path":"https://scales.r-lib.org/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Wickham H, Pedersen T, Seidel D (2023). scales: Scale Functions Visualization. R package version 1.2.1.9000, https://github.com/r-lib/scales, https://scales.r-lib.org.","code":"@Manual{, title = {scales: Scale Functions for Visualization}, author = {Hadley Wickham and Thomas Lin Pedersen and Dana Seidel}, year = {2023}, note = {R package version 1.2.1.9000, https://github.com/r-lib/scales}, url = {https://scales.r-lib.org}, }"},{"path":"https://scales.r-lib.org/dev/index.html","id":"scales-","dir":"","previous_headings":"","what":"Scale Functions for Visualization","title":"Scale Functions for Visualization","text":"One difficult parts graphics package scaling, converting data values perceptual properties. inverse scaling, making guides (legends axes) can used read graph, often even harder! scales packages provides internal scaling infrastructure used ggplot2, gives tools override default breaks, labels, transformations palettes.","code":""},{"path":"https://scales.r-lib.org/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Scale Functions for Visualization","text":"","code":"# Scales is installed when you install ggplot2 or the tidyverse. # But you can install just scales from CRAN: install.packages(\"scales\") # Or the development version from Github: # install.packages(\"pak\") pak::pak(\"r-lib/scales\")"},{"path":[]},{"path":"https://scales.r-lib.org/dev/index.html","id":"breaks-and-labels","dir":"","previous_headings":"Usage","what":"Breaks and labels","title":"Scale Functions for Visualization","text":"common use scales package control appearance axis legend labels. Use break_ function control breaks generated limits, label_ function control breaks turned labels. Generally, don’t recommend running library(scales) type (e.g.) scales::label_ autocomplete provide list labelling functions jog memory.","code":"library(ggplot2) library(dplyr, warn.conflicts = FALSE) library(lubridate, warn.conflicts = FALSE) txhousing %>% mutate(date = make_date(year, month, 1)) %>% group_by(city) %>% filter(min(sales) > 5e2) %>% ggplot(aes(date, sales, group = city)) + geom_line(na.rm = TRUE) + scale_x_date( NULL, breaks = scales::breaks_width(\"2 years\"), labels = scales::label_date(\"'%y\") ) + scale_y_log10( \"Total sales\", labels = scales::label_number(scale_cut = scales::cut_short_scale()) ) economics %>% filter(date < ymd(\"1970-01-01\")) %>% ggplot(aes(date, pce)) + geom_line() + scale_x_date(NULL, breaks = scales::breaks_width(\"3 months\"), labels = scales::label_date_short() ) + scale_y_continuous(\"Personal consumption expenditures\", breaks = scales::breaks_extended(8), labels = scales::label_dollar() )"},{"path":"https://scales.r-lib.org/dev/index.html","id":"advanced-features","dir":"","previous_headings":"Usage","what":"Advanced features","title":"Scale Functions for Visualization","text":"Scales colour palettes used power scales ggplot2, can use plotting system. following example shows might apply base plot. scales also gives users ability define apply custom transformation functions repeated use.","code":"library(scales) # pull a list of colours from any palette viridis_pal()(4) #> [1] \"#440154FF\" \"#31688EFF\" \"#35B779FF\" \"#FDE725FF\" # use in combination with baseR `palette()` to set new defaults palette(brewer_pal(palette = \"Set2\")(4)) par(mar = c(5, 5, 1, 1)) plot(Sepal.Length ~ Sepal.Width, data = iris, col = Species, pch = 20) # use trans_new to build a new transformation logp3_trans <- trans_new( name = \"logp\", transform = function(x) log(x + 3), inverse = function(x) exp(x) - 3, breaks = log_breaks() ) dsamp <- sample_n(diamonds, 100) ggplot(dsamp, aes(carat, price, colour = color)) + geom_point() + scale_y_continuous(trans = logp3_trans)"},{"path":"https://scales.r-lib.org/dev/reference/Range.html","id":null,"dir":"Reference","previous_headings":"","what":"Mutable ranges — Range","title":"Mutable ranges — Range","text":"Mutable ranges two methods (train reset), make possible build complete ranges multiple passes.","code":""},{"path":"https://scales.r-lib.org/dev/reference/alpha.html","id":null,"dir":"Reference","previous_headings":"","what":"Modify colour transparency — alpha","title":"Modify colour transparency — alpha","text":"Vectorised colour alpha.","code":""},{"path":"https://scales.r-lib.org/dev/reference/alpha.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Modify colour transparency — alpha","text":"","code":"alpha(colour, alpha = NA)"},{"path":"https://scales.r-lib.org/dev/reference/alpha.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Modify colour transparency — alpha","text":"colour colour alpha new alpha level [0,1]. alpha NA, existing alpha values preserved.","code":""},{"path":"https://scales.r-lib.org/dev/reference/alpha.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Modify colour transparency — alpha","text":"","code":"alpha(\"red\", 0.1) #> [1] \"#FF00001A\" alpha(colours(), 0.5) #> [1] \"#FFFFFF80\" \"#F0F8FF80\" \"#FAEBD780\" \"#FFEFDB80\" \"#EEDFCC80\" #> [6] \"#CDC0B080\" \"#8B837880\" \"#7FFFD480\" \"#7FFFD480\" \"#76EEC680\" #> [11] \"#66CDAA80\" \"#458B7480\" \"#F0FFFF80\" \"#F0FFFF80\" \"#E0EEEE80\" #> [16] \"#C1CDCD80\" \"#838B8B80\" \"#F5F5DC80\" \"#FFE4C480\" \"#FFE4C480\" #> [21] \"#EED5B780\" \"#CDB79E80\" \"#8B7D6B80\" \"#00000080\" \"#FFEBCD80\" #> [26] \"#0000FF80\" \"#0000FF80\" \"#0000EE80\" \"#0000CD80\" \"#00008B80\" #> [31] \"#8A2BE280\" \"#A52A2A80\" \"#FF404080\" \"#EE3B3B80\" \"#CD333380\" #> [36] \"#8B232380\" \"#DEB88780\" \"#FFD39B80\" \"#EEC59180\" \"#CDAA7D80\" #> [41] \"#8B735580\" \"#5F9EA080\" \"#98F5FF80\" \"#8EE5EE80\" \"#7AC5CD80\" #> [46] \"#53868B80\" \"#7FFF0080\" \"#7FFF0080\" \"#76EE0080\" \"#66CD0080\" #> [51] \"#458B0080\" \"#D2691E80\" \"#FF7F2480\" \"#EE762180\" \"#CD661D80\" #> [56] \"#8B451380\" \"#FF7F5080\" \"#FF725680\" \"#EE6A5080\" \"#CD5B4580\" #> [61] \"#8B3E2F80\" \"#6495ED80\" \"#FFF8DC80\" \"#FFF8DC80\" \"#EEE8CD80\" #> [66] \"#CDC8B180\" \"#8B887880\" \"#00FFFF80\" \"#00FFFF80\" \"#00EEEE80\" #> [71] \"#00CDCD80\" \"#008B8B80\" \"#00008B80\" \"#008B8B80\" \"#B8860B80\" #> [76] \"#FFB90F80\" \"#EEAD0E80\" \"#CD950C80\" \"#8B650880\" \"#A9A9A980\" #> [81] \"#00640080\" \"#A9A9A980\" \"#BDB76B80\" \"#8B008B80\" \"#556B2F80\" #> [86] \"#CAFF7080\" \"#BCEE6880\" \"#A2CD5A80\" \"#6E8B3D80\" \"#FF8C0080\" #> [91] \"#FF7F0080\" \"#EE760080\" \"#CD660080\" \"#8B450080\" \"#9932CC80\" #> [96] \"#BF3EFF80\" \"#B23AEE80\" \"#9A32CD80\" \"#68228B80\" \"#8B000080\" #> [101] \"#E9967A80\" \"#8FBC8F80\" \"#C1FFC180\" \"#B4EEB480\" \"#9BCD9B80\" #> [106] \"#698B6980\" \"#483D8B80\" \"#2F4F4F80\" \"#97FFFF80\" \"#8DEEEE80\" #> [111] \"#79CDCD80\" \"#528B8B80\" \"#2F4F4F80\" \"#00CED180\" \"#9400D380\" #> [116] \"#FF149380\" \"#FF149380\" \"#EE128980\" \"#CD107680\" \"#8B0A5080\" #> [121] \"#00BFFF80\" \"#00BFFF80\" \"#00B2EE80\" \"#009ACD80\" \"#00688B80\" #> [126] \"#69696980\" \"#69696980\" \"#1E90FF80\" \"#1E90FF80\" \"#1C86EE80\" #> [131] \"#1874CD80\" \"#104E8B80\" \"#B2222280\" \"#FF303080\" \"#EE2C2C80\" #> [136] \"#CD262680\" \"#8B1A1A80\" \"#FFFAF080\" \"#228B2280\" \"#DCDCDC80\" #> [141] \"#F8F8FF80\" \"#FFD70080\" \"#FFD70080\" \"#EEC90080\" \"#CDAD0080\" #> [146] \"#8B750080\" \"#DAA52080\" \"#FFC12580\" \"#EEB42280\" \"#CD9B1D80\" #> [151] \"#8B691480\" \"#BEBEBE80\" \"#00000080\" \"#03030380\" \"#05050580\" #> [156] \"#08080880\" \"#0A0A0A80\" \"#0D0D0D80\" \"#0F0F0F80\" \"#12121280\" #> [161] \"#14141480\" \"#17171780\" \"#1A1A1A80\" \"#1C1C1C80\" \"#1F1F1F80\" #> [166] \"#21212180\" \"#24242480\" \"#26262680\" \"#29292980\" \"#2B2B2B80\" #> [171] \"#2E2E2E80\" \"#30303080\" \"#33333380\" \"#36363680\" \"#38383880\" #> [176] \"#3B3B3B80\" \"#3D3D3D80\" \"#40404080\" \"#42424280\" \"#45454580\" #> [181] \"#47474780\" \"#4A4A4A80\" \"#4D4D4D80\" \"#4F4F4F80\" \"#52525280\" #> [186] \"#54545480\" \"#57575780\" \"#59595980\" \"#5C5C5C80\" \"#5E5E5E80\" #> [191] \"#61616180\" \"#63636380\" \"#66666680\" \"#69696980\" \"#6B6B6B80\" #> [196] \"#6E6E6E80\" \"#70707080\" \"#73737380\" \"#75757580\" \"#78787880\" #> [201] \"#7A7A7A80\" \"#7D7D7D80\" \"#7F7F7F80\" \"#82828280\" \"#85858580\" #> [206] \"#87878780\" \"#8A8A8A80\" \"#8C8C8C80\" \"#8F8F8F80\" \"#91919180\" #> [211] \"#94949480\" \"#96969680\" \"#99999980\" \"#9C9C9C80\" \"#9E9E9E80\" #> [216] \"#A1A1A180\" \"#A3A3A380\" \"#A6A6A680\" \"#A8A8A880\" \"#ABABAB80\" #> [221] \"#ADADAD80\" \"#B0B0B080\" \"#B3B3B380\" \"#B5B5B580\" \"#B8B8B880\" #> [226] \"#BABABA80\" \"#BDBDBD80\" \"#BFBFBF80\" \"#C2C2C280\" \"#C4C4C480\" #> [231] \"#C7C7C780\" \"#C9C9C980\" \"#CCCCCC80\" \"#CFCFCF80\" \"#D1D1D180\" #> [236] \"#D4D4D480\" \"#D6D6D680\" \"#D9D9D980\" \"#DBDBDB80\" \"#DEDEDE80\" #> [241] \"#E0E0E080\" \"#E3E3E380\" \"#E5E5E580\" \"#E8E8E880\" \"#EBEBEB80\" #> [246] \"#EDEDED80\" \"#F0F0F080\" \"#F2F2F280\" \"#F5F5F580\" \"#F7F7F780\" #> [251] \"#FAFAFA80\" \"#FCFCFC80\" \"#FFFFFF80\" \"#00FF0080\" \"#00FF0080\" #> [256] \"#00EE0080\" \"#00CD0080\" \"#008B0080\" \"#ADFF2F80\" \"#BEBEBE80\" #> [261] \"#00000080\" \"#03030380\" \"#05050580\" \"#08080880\" \"#0A0A0A80\" #> [266] \"#0D0D0D80\" \"#0F0F0F80\" \"#12121280\" \"#14141480\" \"#17171780\" #> [271] \"#1A1A1A80\" \"#1C1C1C80\" \"#1F1F1F80\" \"#21212180\" \"#24242480\" #> [276] \"#26262680\" \"#29292980\" \"#2B2B2B80\" \"#2E2E2E80\" \"#30303080\" #> [281] \"#33333380\" \"#36363680\" \"#38383880\" \"#3B3B3B80\" \"#3D3D3D80\" #> [286] \"#40404080\" \"#42424280\" \"#45454580\" \"#47474780\" \"#4A4A4A80\" #> [291] \"#4D4D4D80\" \"#4F4F4F80\" \"#52525280\" \"#54545480\" \"#57575780\" #> [296] \"#59595980\" \"#5C5C5C80\" \"#5E5E5E80\" \"#61616180\" \"#63636380\" #> [301] \"#66666680\" \"#69696980\" \"#6B6B6B80\" \"#6E6E6E80\" \"#70707080\" #> [306] \"#73737380\" \"#75757580\" \"#78787880\" \"#7A7A7A80\" \"#7D7D7D80\" #> [311] \"#7F7F7F80\" \"#82828280\" \"#85858580\" \"#87878780\" \"#8A8A8A80\" #> [316] \"#8C8C8C80\" \"#8F8F8F80\" \"#91919180\" \"#94949480\" \"#96969680\" #> [321] \"#99999980\" \"#9C9C9C80\" \"#9E9E9E80\" \"#A1A1A180\" \"#A3A3A380\" #> [326] \"#A6A6A680\" \"#A8A8A880\" \"#ABABAB80\" \"#ADADAD80\" \"#B0B0B080\" #> [331] \"#B3B3B380\" \"#B5B5B580\" \"#B8B8B880\" \"#BABABA80\" \"#BDBDBD80\" #> [336] \"#BFBFBF80\" \"#C2C2C280\" \"#C4C4C480\" \"#C7C7C780\" \"#C9C9C980\" #> [341] \"#CCCCCC80\" \"#CFCFCF80\" \"#D1D1D180\" \"#D4D4D480\" \"#D6D6D680\" #> [346] \"#D9D9D980\" \"#DBDBDB80\" \"#DEDEDE80\" \"#E0E0E080\" \"#E3E3E380\" #> [351] \"#E5E5E580\" \"#E8E8E880\" \"#EBEBEB80\" \"#EDEDED80\" \"#F0F0F080\" #> [356] \"#F2F2F280\" \"#F5F5F580\" \"#F7F7F780\" \"#FAFAFA80\" \"#FCFCFC80\" #> [361] \"#FFFFFF80\" \"#F0FFF080\" \"#F0FFF080\" \"#E0EEE080\" \"#C1CDC180\" #> [366] \"#838B8380\" \"#FF69B480\" \"#FF6EB480\" \"#EE6AA780\" \"#CD609080\" #> [371] \"#8B3A6280\" \"#CD5C5C80\" \"#FF6A6A80\" \"#EE636380\" \"#CD555580\" #> [376] \"#8B3A3A80\" \"#FFFFF080\" \"#FFFFF080\" \"#EEEEE080\" \"#CDCDC180\" #> [381] \"#8B8B8380\" \"#F0E68C80\" \"#FFF68F80\" \"#EEE68580\" \"#CDC67380\" #> [386] \"#8B864E80\" \"#E6E6FA80\" \"#FFF0F580\" \"#FFF0F580\" \"#EEE0E580\" #> [391] \"#CDC1C580\" \"#8B838680\" \"#7CFC0080\" \"#FFFACD80\" \"#FFFACD80\" #> [396] \"#EEE9BF80\" \"#CDC9A580\" \"#8B897080\" \"#ADD8E680\" \"#BFEFFF80\" #> [401] \"#B2DFEE80\" \"#9AC0CD80\" \"#68838B80\" \"#F0808080\" \"#E0FFFF80\" #> [406] \"#E0FFFF80\" \"#D1EEEE80\" \"#B4CDCD80\" \"#7A8B8B80\" \"#EEDD8280\" #> [411] \"#FFEC8B80\" \"#EEDC8280\" \"#CDBE7080\" \"#8B814C80\" \"#FAFAD280\" #> [416] \"#D3D3D380\" \"#90EE9080\" \"#D3D3D380\" \"#FFB6C180\" \"#FFAEB980\" #> [421] \"#EEA2AD80\" \"#CD8C9580\" \"#8B5F6580\" \"#FFA07A80\" \"#FFA07A80\" #> [426] \"#EE957280\" \"#CD816280\" \"#8B574280\" \"#20B2AA80\" \"#87CEFA80\" #> [431] \"#B0E2FF80\" \"#A4D3EE80\" \"#8DB6CD80\" \"#607B8B80\" \"#8470FF80\" #> [436] \"#77889980\" \"#77889980\" \"#B0C4DE80\" \"#CAE1FF80\" \"#BCD2EE80\" #> [441] \"#A2B5CD80\" \"#6E7B8B80\" \"#FFFFE080\" \"#FFFFE080\" \"#EEEED180\" #> [446] \"#CDCDB480\" \"#8B8B7A80\" \"#32CD3280\" \"#FAF0E680\" \"#FF00FF80\" #> [451] \"#FF00FF80\" \"#EE00EE80\" \"#CD00CD80\" \"#8B008B80\" \"#B0306080\" #> [456] \"#FF34B380\" \"#EE30A780\" \"#CD299080\" \"#8B1C6280\" \"#66CDAA80\" #> [461] \"#0000CD80\" \"#BA55D380\" \"#E066FF80\" \"#D15FEE80\" \"#B452CD80\" #> [466] \"#7A378B80\" \"#9370DB80\" \"#AB82FF80\" \"#9F79EE80\" \"#8968CD80\" #> [471] \"#5D478B80\" \"#3CB37180\" \"#7B68EE80\" \"#00FA9A80\" \"#48D1CC80\" #> [476] \"#C7158580\" \"#19197080\" \"#F5FFFA80\" \"#FFE4E180\" \"#FFE4E180\" #> [481] \"#EED5D280\" \"#CDB7B580\" \"#8B7D7B80\" \"#FFE4B580\" \"#FFDEAD80\" #> [486] \"#FFDEAD80\" \"#EECFA180\" \"#CDB38B80\" \"#8B795E80\" \"#00008080\" #> [491] \"#00008080\" \"#FDF5E680\" \"#6B8E2380\" \"#C0FF3E80\" \"#B3EE3A80\" #> [496] \"#9ACD3280\" \"#698B2280\" \"#FFA50080\" \"#FFA50080\" \"#EE9A0080\" #> [501] \"#CD850080\" \"#8B5A0080\" \"#FF450080\" \"#FF450080\" \"#EE400080\" #> [506] \"#CD370080\" \"#8B250080\" \"#DA70D680\" \"#FF83FA80\" \"#EE7AE980\" #> [511] \"#CD69C980\" \"#8B478980\" \"#EEE8AA80\" \"#98FB9880\" \"#9AFF9A80\" #> [516] \"#90EE9080\" \"#7CCD7C80\" \"#548B5480\" \"#AFEEEE80\" \"#BBFFFF80\" #> [521] \"#AEEEEE80\" \"#96CDCD80\" \"#668B8B80\" \"#DB709380\" \"#FF82AB80\" #> [526] \"#EE799F80\" \"#CD688980\" \"#8B475D80\" \"#FFEFD580\" \"#FFDAB980\" #> [531] \"#FFDAB980\" \"#EECBAD80\" \"#CDAF9580\" \"#8B776580\" \"#CD853F80\" #> [536] \"#FFC0CB80\" \"#FFB5C580\" \"#EEA9B880\" \"#CD919E80\" \"#8B636C80\" #> [541] \"#DDA0DD80\" \"#FFBBFF80\" \"#EEAEEE80\" \"#CD96CD80\" \"#8B668B80\" #> [546] \"#B0E0E680\" \"#A020F080\" \"#9B30FF80\" \"#912CEE80\" \"#7D26CD80\" #> [551] \"#551A8B80\" \"#FF000080\" \"#FF000080\" \"#EE000080\" \"#CD000080\" #> [556] \"#8B000080\" \"#BC8F8F80\" \"#FFC1C180\" \"#EEB4B480\" \"#CD9B9B80\" #> [561] \"#8B696980\" \"#4169E180\" \"#4876FF80\" \"#436EEE80\" \"#3A5FCD80\" #> [566] \"#27408B80\" \"#8B451380\" \"#FA807280\" \"#FF8C6980\" \"#EE826280\" #> [571] \"#CD705480\" \"#8B4C3980\" \"#F4A46080\" \"#2E8B5780\" \"#54FF9F80\" #> [576] \"#4EEE9480\" \"#43CD8080\" \"#2E8B5780\" \"#FFF5EE80\" \"#FFF5EE80\" #> [581] \"#EEE5DE80\" \"#CDC5BF80\" \"#8B868280\" \"#A0522D80\" \"#FF824780\" #> [586] \"#EE794280\" \"#CD683980\" \"#8B472680\" \"#87CEEB80\" \"#87CEFF80\" #> [591] \"#7EC0EE80\" \"#6CA6CD80\" \"#4A708B80\" \"#6A5ACD80\" \"#836FFF80\" #> [596] \"#7A67EE80\" \"#6959CD80\" \"#473C8B80\" \"#70809080\" \"#C6E2FF80\" #> [601] \"#B9D3EE80\" \"#9FB6CD80\" \"#6C7B8B80\" \"#70809080\" \"#FFFAFA80\" #> [606] \"#FFFAFA80\" \"#EEE9E980\" \"#CDC9C980\" \"#8B898980\" \"#00FF7F80\" #> [611] \"#00FF7F80\" \"#00EE7680\" \"#00CD6680\" \"#008B4580\" \"#4682B480\" #> [616] \"#63B8FF80\" \"#5CACEE80\" \"#4F94CD80\" \"#36648B80\" \"#D2B48C80\" #> [621] \"#FFA54F80\" \"#EE9A4980\" \"#CD853F80\" \"#8B5A2B80\" \"#D8BFD880\" #> [626] \"#FFE1FF80\" \"#EED2EE80\" \"#CDB5CD80\" \"#8B7B8B80\" \"#FF634780\" #> [631] \"#FF634780\" \"#EE5C4280\" \"#CD4F3980\" \"#8B362680\" \"#40E0D080\" #> [636] \"#00F5FF80\" \"#00E5EE80\" \"#00C5CD80\" \"#00868B80\" \"#EE82EE80\" #> [641] \"#D0209080\" \"#FF3E9680\" \"#EE3A8C80\" \"#CD327880\" \"#8B225280\" #> [646] \"#F5DEB380\" \"#FFE7BA80\" \"#EED8AE80\" \"#CDBA9680\" \"#8B7E6680\" #> [651] \"#F5F5F580\" \"#FFFF0080\" \"#FFFF0080\" \"#EEEE0080\" \"#CDCD0080\" #> [656] \"#8B8B0080\" \"#9ACD3280\" alpha(\"red\", seq(0, 1, length.out = 10)) #> [1] \"#FF000000\" \"#FF00001C\" \"#FF000039\" \"#FF000055\" \"#FF000071\" #> [6] \"#FF00008E\" \"#FF0000AA\" \"#FF0000C6\" \"#FF0000E3\" \"#FF0000\" alpha(c(\"first\" = \"gold\", \"second\" = \"lightgray\", \"third\" = \"#cd7f32\"), .5) #> first second third #> \"#FFD70080\" \"#D3D3D380\" \"#CD7F3280\""},{"path":"https://scales.r-lib.org/dev/reference/area_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Area palettes (continuous) — area_pal","title":"Area palettes (continuous) — area_pal","text":"Area palettes (continuous)","code":""},{"path":"https://scales.r-lib.org/dev/reference/area_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Area palettes (continuous) — area_pal","text":"","code":"area_pal(range = c(1, 6)) abs_area(max)"},{"path":"https://scales.r-lib.org/dev/reference/area_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Area palettes (continuous) — area_pal","text":"range Numeric vector length two, giving range possible sizes. greater 0. max number representing maximum size.","code":""},{"path":"https://scales.r-lib.org/dev/reference/asinh_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Inverse Hyperbolic Sine transformation — asinh_trans","title":"Inverse Hyperbolic Sine transformation — asinh_trans","text":"Inverse Hyperbolic Sine transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/asinh_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Inverse Hyperbolic Sine transformation — asinh_trans","text":"","code":"asinh_trans()"},{"path":"https://scales.r-lib.org/dev/reference/asinh_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Inverse Hyperbolic Sine transformation — asinh_trans","text":"","code":"plot(asinh_trans(), xlim = c(-1e2, 1e2))"},{"path":"https://scales.r-lib.org/dev/reference/asn_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Arc-sin square root transformation — asn_trans","title":"Arc-sin square root transformation — asn_trans","text":"variance stabilising transformation binomial distribution.","code":""},{"path":"https://scales.r-lib.org/dev/reference/asn_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arc-sin square root transformation — asn_trans","text":"","code":"asn_trans()"},{"path":"https://scales.r-lib.org/dev/reference/asn_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Arc-sin square root transformation — asn_trans","text":"","code":"plot(asn_trans(), xlim = c(0, 1))"},{"path":"https://scales.r-lib.org/dev/reference/atanh_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Arc-tangent transformation — atanh_trans","title":"Arc-tangent transformation — atanh_trans","text":"Arc-tangent transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/atanh_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arc-tangent transformation — atanh_trans","text":"","code":"atanh_trans()"},{"path":"https://scales.r-lib.org/dev/reference/atanh_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Arc-tangent transformation — atanh_trans","text":"","code":"plot(atanh_trans(), xlim = c(-1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/boxcox_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Box-Cox & modulus transformations — boxcox_trans","title":"Box-Cox & modulus transformations — boxcox_trans","text":"Box-Cox transformation flexible transformation, often used transform data towards normality. modulus transformation generalises Box-Cox also work negative values.","code":""},{"path":"https://scales.r-lib.org/dev/reference/boxcox_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Box-Cox & modulus transformations — boxcox_trans","text":"","code":"boxcox_trans(p, offset = 0) modulus_trans(p, offset = 1)"},{"path":"https://scales.r-lib.org/dev/reference/boxcox_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Box-Cox & modulus transformations — boxcox_trans","text":"p Transformation exponent, \\(\\lambda\\). offset Constant offset. 0 Box-Cox type 1, otherwise non-negative constant (Box-Cox type 2). modulus_trans() sets default 1.","code":""},{"path":"https://scales.r-lib.org/dev/reference/boxcox_trans.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Box-Cox & modulus transformations — boxcox_trans","text":"Box-Cox power transformation (type 1) requires strictly positive values takes following form y > 0: $$y^{(\\lambda)} = \\frac{y^\\lambda - 1}{\\lambda}$$ y = 0, natural log transform used. modulus transformation implements generalisation Box-Cox transformation works data positive negative values. equation takes following forms, y != 0 : $$y^{(\\lambda)} = sign(y) * \\frac{(|y| + 1)^\\lambda - 1}{\\lambda}$$ y = 0: $$y^{(\\lambda)} = sign(y) * \\ln(|y| + 1)$$","code":""},{"path":"https://scales.r-lib.org/dev/reference/boxcox_trans.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Box-Cox & modulus transformations — boxcox_trans","text":"Box, G. E., & Cox, D. R. (1964). analysis transformations. Journal Royal Statistical Society. Series B (Methodological), 211-252. https://www.jstor.org/stable/2984418 John, J. ., & Draper, N. R. (1980). alternative family transformations. Applied Statistics, 190-197. https://www.jstor.org/stable/2986305","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/boxcox_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Box-Cox & modulus transformations — boxcox_trans","text":"","code":"plot(boxcox_trans(-1), xlim = c(0, 10)) plot(boxcox_trans(0), xlim = c(0, 10)) plot(boxcox_trans(1), xlim = c(0, 10)) plot(boxcox_trans(2), xlim = c(0, 10)) plot(modulus_trans(-1), xlim = c(-10, 10)) plot(modulus_trans(0), xlim = c(-10, 10)) plot(modulus_trans(1), xlim = c(-10, 10)) plot(modulus_trans(2), xlim = c(-10, 10))"},{"path":"https://scales.r-lib.org/dev/reference/breaks_extended.html","id":null,"dir":"Reference","previous_headings":"","what":"Automatic breaks for numeric axes — breaks_extended","title":"Automatic breaks for numeric axes — breaks_extended","text":"Uses Wilkinson's extended breaks algorithm implemented labeling package.","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_extended.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Automatic breaks for numeric axes — breaks_extended","text":"","code":"breaks_extended(n = 5, ...)"},{"path":"https://scales.r-lib.org/dev/reference/breaks_extended.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Automatic breaks for numeric axes — breaks_extended","text":"n Desired number breaks. may get slightly fewer breaks requested. ... arguments passed labeling::extended()","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_extended.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Automatic breaks for numeric axes — breaks_extended","text":"Talbot, J., Lin, S., Hanrahan, P. (2010) Extension Wilkinson's Algorithm Positioning Tick Labels Axes, InfoVis 2010 http://vis.stanford.edu/files/2010-TickLabels-InfoVis.pdf.","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_extended.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Automatic breaks for numeric axes — breaks_extended","text":"","code":"demo_continuous(c(0, 10)) #> scale_x_continuous() demo_continuous(c(0, 10), breaks = breaks_extended(3)) #> scale_x_continuous(breaks = breaks_extended(3)) demo_continuous(c(0, 10), breaks = breaks_extended(10)) #> scale_x_continuous(breaks = breaks_extended(10))"},{"path":"https://scales.r-lib.org/dev/reference/breaks_log.html","id":null,"dir":"Reference","previous_headings":"","what":"Breaks for log axes — breaks_log","title":"Breaks for log axes — breaks_log","text":"algorithm starts looking integer powers base. provide enough breaks, looks additional intermediate breaks integer multiples integer powers base. fails (can small ranges), fall back extended_breaks()","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_log.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Breaks for log axes — breaks_log","text":"","code":"breaks_log(n = 5, base = 10)"},{"path":"https://scales.r-lib.org/dev/reference/breaks_log.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Breaks for log axes — breaks_log","text":"n desired number breaks base base logarithm use","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_log.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Breaks for log axes — breaks_log","text":"algorithm starts looking set integer powers base cover range data. generate least n - 2 breaks, look integer 1 base splits interval approximately half. example, case base = 10, integer 3 log10(3) = 0.477. leaves 2 intervals: c(1, 3) c(3, 10). still need breaks, look another integer splits largest remaining interval (log-scale) approximately half. base = 10, 5 log10(5) = 0.699. generic algorithm starts set integers steps containing 1 set candidate integers containing integers larger 1 smaller base. remaining candidate integer x, smallest interval (log-scale) vector sort(c(x, steps, base)) calculated. candidate x yields largest minimal interval added steps removed candidate set. repeated either sufficient number breaks, >= n-2, returned candidates used.","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_log.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Breaks for log axes — breaks_log","text":"","code":"demo_log10(c(1, 1e5)) #> scale_x_log10() demo_log10(c(1, 1e6)) #> scale_x_log10() # Request more breaks by setting n demo_log10(c(1, 1e6), breaks = breaks_log(6)) #> scale_x_log10(breaks = breaks_log(6)) # Some tricky ranges demo_log10(c(2000, 9000)) #> scale_x_log10() demo_log10(c(2000, 14000)) #> scale_x_log10() demo_log10(c(2000, 85000), expand = c(0, 0)) #> scale_x_log10(expand = c(0, 0)) # An even smaller range that requires falling back to linear breaks demo_log10(c(1800, 2000)) #> scale_x_log10()"},{"path":"https://scales.r-lib.org/dev/reference/breaks_pretty.html","id":null,"dir":"Reference","previous_headings":"","what":"Pretty breaks for date/times — breaks_pretty","title":"Pretty breaks for date/times — breaks_pretty","text":"Uses default R break algorithm implemented pretty(). primarily useful date/times, extended_breaks() slightly better job numeric scales.","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_pretty.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pretty breaks for date/times — breaks_pretty","text":"","code":"breaks_pretty(n = 5, ...)"},{"path":"https://scales.r-lib.org/dev/reference/breaks_pretty.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pretty breaks for date/times — breaks_pretty","text":"n Desired number breaks. may get slightly fewer breaks requested. ... arguments passed pretty()","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_pretty.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pretty breaks for date/times — breaks_pretty","text":"","code":"one_month <- as.POSIXct(c(\"2020-05-01\", \"2020-06-01\")) demo_datetime(one_month) #> scale_x_datetime() demo_datetime(one_month, breaks = breaks_pretty(2)) #> scale_x_datetime(breaks = breaks_pretty(2)) demo_datetime(one_month, breaks = breaks_pretty(4)) #> scale_x_datetime(breaks = breaks_pretty(4)) # Tightly spaced date breaks often need custom labels too demo_datetime(one_month, breaks = breaks_pretty(12)) #> scale_x_datetime(breaks = breaks_pretty(12)) demo_datetime(one_month, breaks = breaks_pretty(12), labels = label_date_short() ) #> scale_x_datetime(breaks = breaks_pretty(12), labels = label_date_short())"},{"path":"https://scales.r-lib.org/dev/reference/breaks_timespan.html","id":null,"dir":"Reference","previous_headings":"","what":"Breaks for timespan data — breaks_timespan","title":"Breaks for timespan data — breaks_timespan","text":"timespan units span variety bases (1000 seconds, 60 second minutes, 24 hours, 7 days), range input data determines base used calculating breaks","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_timespan.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Breaks for timespan data — breaks_timespan","text":"","code":"breaks_timespan(unit = c(\"secs\", \"mins\", \"hours\", \"days\", \"weeks\"), n = 5)"},{"path":"https://scales.r-lib.org/dev/reference/breaks_timespan.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Breaks for timespan data — breaks_timespan","text":"unit unit used interpret numeric data input n Desired number breaks. may get slightly fewer breaks requested.","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_timespan.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Breaks for timespan data — breaks_timespan","text":"","code":"demo_timespan(seq(0, 100), breaks = breaks_timespan()) #> scale_x_continuous(breaks = breaks_timespan())"},{"path":"https://scales.r-lib.org/dev/reference/breaks_width.html","id":null,"dir":"Reference","previous_headings":"","what":"Equally spaced breaks — breaks_width","title":"Equally spaced breaks — breaks_width","text":"Useful numeric, date, date-time scales.","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_width.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Equally spaced breaks — breaks_width","text":"","code":"breaks_width(width, offset = 0)"},{"path":"https://scales.r-lib.org/dev/reference/breaks_width.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Equally spaced breaks — breaks_width","text":"width Distance break. Either number, date/times, single string form \"{n} {unit}\", e.g. \"1 month\", \"5 days\". Unit can one \"sec\", \"min\", \"hour\", \"day\", \"week\", \"month\", \"year\". offset Use want breaks start zero, conventional date time boundary 1st January midnight. Either number, date/times, single string form \"{n} {unit}\", width. offset can vector, accumulate order given. mostly useful dates, e.g. c(\"3 months\", \"5 days\") offset three months five days, useful UK tax year. Note due way dates rounded, guarantee offset = c(x, y) give result offset = c(y, x).","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_width.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Equally spaced breaks — breaks_width","text":"","code":"demo_continuous(c(0, 100)) #> scale_x_continuous() demo_continuous(c(0, 100), breaks = breaks_width(10)) #> scale_x_continuous(breaks = breaks_width(10)) demo_continuous(c(0, 100), breaks = breaks_width(20, -4)) #> scale_x_continuous(breaks = breaks_width(20, -4)) demo_continuous(c(0, 100), breaks = breaks_width(20, 4)) #> scale_x_continuous(breaks = breaks_width(20, 4)) # This is also useful for dates one_month <- as.POSIXct(c(\"2020-05-01\", \"2020-06-01\")) demo_datetime(one_month) #> scale_x_datetime() demo_datetime(one_month, breaks = breaks_width(\"1 week\")) #> scale_x_datetime(breaks = breaks_width(\"1 week\")) demo_datetime(one_month, breaks = breaks_width(\"5 days\")) #> scale_x_datetime(breaks = breaks_width(\"5 days\")) # This is so useful that scale_x_datetime() has a shorthand: demo_datetime(one_month, date_breaks = \"5 days\") #> scale_x_datetime(date_breaks = \"5 days\") # hms times also work one_hour <- hms::hms(hours = 0:1) demo_time(one_hour) #> scale_x_time() demo_time(one_hour, breaks = breaks_width(\"15 min\")) #> scale_x_time(breaks = breaks_width(\"15 min\")) demo_time(one_hour, breaks = breaks_width(\"600 sec\")) #> scale_x_time(breaks = breaks_width(\"600 sec\")) # Offets are useful for years that begin on dates other than the 1st of # January, such as the UK financial year, which begins on the 1st of April. three_years <- as.POSIXct(c(\"2020-01-01\", \"2021-01-01\", \"2022-01-01\")) demo_datetime( three_years, breaks = breaks_width(\"1 year\", offset = \"3 months\") ) #> scale_x_datetime(breaks = breaks_width(\"1 year\", offset = \"3 months\")) # The offset can be a vector, to create offsets that have compound units, # such as the UK fiscal (tax) year, which begins on the 6th of April. demo_datetime( three_years, breaks = breaks_width(\"1 year\", offset = c(\"3 months\", \"5 days\")) ) #> scale_x_datetime(breaks = breaks_width(\"1 year\", offset = c(\"3 months\", #> \"5 days\")))"},{"path":"https://scales.r-lib.org/dev/reference/brewer_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Colour Brewer palette (discrete) — brewer_pal","title":"Colour Brewer palette (discrete) — brewer_pal","text":"Colour Brewer palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/brewer_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Colour Brewer palette (discrete) — brewer_pal","text":"","code":"brewer_pal(type = \"seq\", palette = 1, direction = 1)"},{"path":"https://scales.r-lib.org/dev/reference/brewer_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Colour Brewer palette (discrete) — brewer_pal","text":"type One \"seq\" (sequential), \"div\" (diverging) \"qual\" (qualitative) palette string, use named palette. number, index list palettes appropriate type direction Sets order colours scale. 1, default, colours output RColorBrewer::brewer.pal(). -1, order colours reversed.","code":""},{"path":"https://scales.r-lib.org/dev/reference/brewer_pal.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Colour Brewer palette (discrete) — brewer_pal","text":"https://colorbrewer2.org","code":""},{"path":"https://scales.r-lib.org/dev/reference/brewer_pal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Colour Brewer palette (discrete) — brewer_pal","text":"","code":"show_col(brewer_pal()(10)) #> Warning: n too large, allowed maximum for palette Blues is 9 #> Returning the palette you asked for with that many colors show_col(brewer_pal(\"div\")(5)) show_col(brewer_pal(palette = \"Greens\")(5)) # Can use with gradient_n to create a continuous gradient cols <- brewer_pal(\"div\")(5) show_col(gradient_n_pal(cols)(seq(0, 1, length.out = 30)))"},{"path":"https://scales.r-lib.org/dev/reference/cbreaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute breaks for continuous scale — cbreaks","title":"Compute breaks for continuous scale — cbreaks","text":"function wraps components needed go continuous range set breaks labels suitable display axes legends.","code":""},{"path":"https://scales.r-lib.org/dev/reference/cbreaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute breaks for continuous scale — cbreaks","text":"","code":"cbreaks(range, breaks = extended_breaks(), labels = scientific_format())"},{"path":"https://scales.r-lib.org/dev/reference/cbreaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute breaks for continuous scale — cbreaks","text":"range numeric vector length 2 giving range underlying data breaks either vector break values, break function make vector breaks given range data labels either vector labels (character vector list expression) format function make vector labels called vector breaks. Labels can specified manually breaks - extremely dangerous supply labels know breaks .","code":""},{"path":"https://scales.r-lib.org/dev/reference/cbreaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute breaks for continuous scale — cbreaks","text":"","code":"cbreaks(c(0, 100)) #> $breaks #> [1] 0 25 50 75 100 #> #> $labels #> [1] \"0.0e+00\" \"2.5e+01\" \"5.0e+01\" \"7.5e+01\" \"1.0e+02\" #> cbreaks(c(0, 100), breaks_pretty(3)) #> $breaks #> [1] 0 50 100 #> #> $labels #> [1] \"0e+00\" \"5e+01\" \"1e+02\" #> cbreaks(c(0, 100), breaks_pretty(10)) #> $breaks #> [1] 0 10 20 30 40 50 60 70 80 90 100 #> #> $labels #> [1] \"0e+00\" \"1e+01\" \"2e+01\" \"3e+01\" \"4e+01\" \"5e+01\" \"6e+01\" \"7e+01\" #> [9] \"8e+01\" \"9e+01\" \"1e+02\" #> cbreaks(c(1, 100), log_breaks()) #> $breaks #> [1] 1 10 100 #> #> $labels #> [1] \"1e+00\" \"1e+01\" \"1e+02\" #> cbreaks(c(1, 1e4), log_breaks()) #> $breaks #> [1] 1 10 100 1000 10000 #> #> $labels #> [1] \"1e+00\" \"1e+01\" \"1e+02\" \"1e+03\" \"1e+04\" #> cbreaks(c(0, 100), labels = math_format()) #> $breaks #> [1] 0 25 50 75 100 #> #> $labels #> expression(10^0, 10^25, 10^50, 10^75, 10^100) #> cbreaks(c(0, 1), labels = percent_format()) #> $breaks #> [1] 0.00 0.25 0.50 0.75 1.00 #> #> $labels #> [1] \"0%\" \"25%\" \"50%\" \"75%\" \"100%\" #> cbreaks(c(0, 1e6), labels = comma_format()) #> $breaks #> [1] 0 250000 500000 750000 1000000 #> #> $labels #> [1] \"0\" \"250,000\" \"500,000\" \"750,000\" \"1,000,000\" #> cbreaks(c(0, 1e6), labels = dollar_format()) #> $breaks #> [1] 0 250000 500000 750000 1000000 #> #> $labels #> [1] \"$0\" \"$250,000\" \"$500,000\" \"$750,000\" \"$1,000,000\" #> cbreaks(c(0, 30), labels = dollar_format()) #> $breaks #> [1] 0 10 20 30 #> #> $labels #> [1] \"$0\" \"$10\" \"$20\" \"$30\" #> # You can also specify them manually: cbreaks(c(0, 100), breaks = c(15, 20, 80)) #> $breaks #> [1] 15 20 80 #> #> $labels #> [1] \"1.5e+01\" \"2.0e+01\" \"8.0e+01\" #> cbreaks(c(0, 100), breaks = c(15, 20, 80), labels = c(1.5, 2.0, 8.0)) #> $breaks #> [1] 15 20 80 #> #> $labels #> [1] \"1.5\" \"2\" \"8\" #> cbreaks(c(0, 100), breaks = c(15, 20, 80), labels = expression(alpha, beta, gamma) ) #> $breaks #> [1] 15 20 80 #> #> $labels #> $labels[[1]] #> alpha #> #> $labels[[2]] #> beta #> #> $labels[[3]] #> gamma #> #>"},{"path":"https://scales.r-lib.org/dev/reference/col2hcl.html","id":null,"dir":"Reference","previous_headings":"","what":"Modify standard R colour in hcl colour space. — col2hcl","title":"Modify standard R colour in hcl colour space. — col2hcl","text":"Transforms rgb hcl, sets non-missing arguments backtransforms rgb.","code":""},{"path":"https://scales.r-lib.org/dev/reference/col2hcl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Modify standard R colour in hcl colour space. — col2hcl","text":"","code":"col2hcl(colour, h = NULL, c = NULL, l = NULL, alpha = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/col2hcl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Modify standard R colour in hcl colour space. — col2hcl","text":"colour character vector colours modified h Hue, [0, 360] c Chroma, [0, 100] l Luminance, [0, 100] alpha Alpha, [0, 1].","code":""},{"path":"https://scales.r-lib.org/dev/reference/col2hcl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Modify standard R colour in hcl colour space. — col2hcl","text":"","code":"reds <- rep(\"red\", 6) show_col(col2hcl(reds, h = seq(0, 180, length = 6))) show_col(col2hcl(reds, c = seq(0, 80, length = 6))) show_col(col2hcl(reds, l = seq(0, 100, length = 6))) show_col(col2hcl(reds, alpha = seq(0, 1, length = 6)))"},{"path":"https://scales.r-lib.org/dev/reference/col_numeric.html","id":null,"dir":"Reference","previous_headings":"","what":"Colour mapping — col_numeric","title":"Colour mapping — col_numeric","text":"Conveniently maps data values (numeric factor/character) colours according given palette, can provided variety formats.","code":""},{"path":"https://scales.r-lib.org/dev/reference/col_numeric.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Colour mapping — col_numeric","text":"","code":"col_numeric( palette, domain, na.color = \"#808080\", alpha = FALSE, reverse = FALSE ) col_bin( palette, domain, bins = 7, pretty = TRUE, na.color = \"#808080\", alpha = FALSE, reverse = FALSE, right = FALSE ) col_quantile( palette, domain, n = 4, probs = seq(0, 1, length.out = n + 1), na.color = \"#808080\", alpha = FALSE, reverse = FALSE, right = FALSE ) col_factor( palette, domain, levels = NULL, ordered = FALSE, na.color = \"#808080\", alpha = FALSE, reverse = FALSE )"},{"path":"https://scales.r-lib.org/dev/reference/col_numeric.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Colour mapping — col_numeric","text":"palette colours colour function values mapped domain possible values can mapped. col_numeric col_bin, can simple numeric range (e.g. c(0, 100)); col_quantile needs representative numeric data; col_factor needs categorical data. NULL, whenever resulting colour function called, x value represent domain. implies function invoked multiple times, encoding values colours may consistent; consistency needed, must provide non-NULL domain. na.color colour return NA values. Note na.color = NA valid. alpha Whether alpha channels respected ignored. TRUE colors without explicit alpha information treated fully opaque. reverse Whether colors (color function) palette used reverse order. example, default order palette goes blue green, reverse = TRUE result colors going green blue. bins Either numeric vector two unique cut points single number (greater equal 2) giving number intervals domain values cut. pretty Whether use function pretty() generate bins argument bins single number. pretty = TRUE, actual number bins may number bins specified. pretty = FALSE, seq() used generate bins breaks may \"pretty\". right parameter supplied base::cut(). See Details n Number equal-size quantiles desired. precise control, use probs argument instead. probs See stats::quantile(). provided, n argument ignored. levels alternate way specifying levels; specified, domain ignored ordered TRUE domain needs coerced factor, treat already correct order","code":""},{"path":"https://scales.r-lib.org/dev/reference/col_numeric.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Colour mapping — col_numeric","text":"function takes single parameter x; called vector numbers (except col_factor, expects factors/characters), #RRGGBB colour strings returned (unless alpha = TRUE case #RRGGBBAA may also possible).","code":""},{"path":"https://scales.r-lib.org/dev/reference/col_numeric.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Colour mapping — col_numeric","text":"col_numeric simple linear mapping continuous numeric data interpolated palette. col_bin also maps continuous numeric data, performs binning based value (see base::cut() function). col_bin defaults cut function include.lowest = TRUE right = FALSE. col_quantile similarly bins numeric data, via stats::quantile() function. col_factor maps factors colours. palette discrete different number colours number factors, interpolation used. palette argument can following: character vector RGB named colours. Examples: palette(), c(\"#000000\", \"#0000FF\", \"#FFFFFF\"), topo.colors(10) name RColorBrewer palette, e.g. \"BuPu\" \"Greens\". full name viridis palette: \"viridis\", \"magma\", \"inferno\", \"plasma\". function receives single value 0 1 returns colour. Examples: colorRamp(c(\"#000000\", \"#FFFFFF\"), interpolate=\"spline\").","code":""},{"path":"https://scales.r-lib.org/dev/reference/col_numeric.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Colour mapping — col_numeric","text":"","code":"pal <- col_bin(\"Greens\", domain = 0:100) show_col(pal(sort(runif(10, 60, 100)))) # Exponential distribution, mapped continuously show_col(col_numeric(\"Blues\", domain = NULL)(sort(rexp(16)))) # Exponential distribution, mapped by interval show_col(col_bin(\"Blues\", domain = NULL, bins = 4)(sort(rexp(16)))) # Exponential distribution, mapped by quantile show_col(col_quantile(\"Blues\", domain = NULL)(sort(rexp(16)))) # Categorical data; by default, the values being coloured span the gamut... show_col(col_factor(\"RdYlBu\", domain = NULL)(LETTERS[1:5])) # ...unless the data is a factor, without droplevels... show_col(col_factor(\"RdYlBu\", domain = NULL)(factor(LETTERS[1:5], levels = LETTERS))) #> Warning: n too large, allowed maximum for palette RdYlBu is 11 #> Returning the palette you asked for with that many colors # ...or the domain is stated explicitly. show_col(col_factor(\"RdYlBu\", levels = LETTERS)(LETTERS[1:5])) #> Warning: n too large, allowed maximum for palette RdYlBu is 11 #> Returning the palette you asked for with that many colors"},{"path":"https://scales.r-lib.org/dev/reference/colour_ramp.html","id":null,"dir":"Reference","previous_headings":"","what":"Fast colour interpolation — colour_ramp","title":"Fast colour interpolation — colour_ramp","text":"Returns function maps interval [0,1] set colours. Interpolation performed CIELAB colour space. Similar colorRamp(space = 'Lab'), hundreds times faster, provides results \"#RRGGBB\" (\"#RRGGBBAA\") character form instead RGB colour matrices.","code":""},{"path":"https://scales.r-lib.org/dev/reference/colour_ramp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fast colour interpolation — colour_ramp","text":"","code":"colour_ramp(colors, na.color = NA, alpha = TRUE)"},{"path":"https://scales.r-lib.org/dev/reference/colour_ramp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fast colour interpolation — colour_ramp","text":"colors Colours interpolate; must valid argument grDevices::col2rgb(). can character vector \"#RRGGBB\" \"#RRGGBBAA\", colour names grDevices::colors(), positive integer indexes grDevices::palette(). na.color colour map NA values (example, \"#606060\" dark grey, \"#00000000\" transparent) values outside [0,1]. Can NA, simply cause NA inserted output. alpha Whether include alpha transparency channels interpolation. TRUE alpha information included interpolation. returned colours provided \"#RRGGBBAA\" format needed, .e., cases colour fully opaque, \"AA\" part equal \"FF\". Fully opaque colours returned \"#RRGGBB\" format. FALSE, alpha information discarded interpolation colours always returned \"#RRGGBB\".","code":""},{"path":"https://scales.r-lib.org/dev/reference/colour_ramp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fast colour interpolation — colour_ramp","text":"function takes numeric vector returns character vector length RGB RGBA hex colours.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/colour_ramp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fast colour interpolation — colour_ramp","text":"","code":"ramp <- colour_ramp(c(\"red\", \"green\", \"blue\")) show_col(ramp(seq(0, 1, length = 12)))"},{"path":"https://scales.r-lib.org/dev/reference/comma.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_number()/label_comma() — comma","title":"Superseded interface to label_number()/label_comma() — comma","text":"functions kept backward compatibility; switch label_number()/label_comma() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/comma.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_number()/label_comma() — comma","text":"","code":"comma( x, accuracy = NULL, scale = 1, prefix = \"\", suffix = \"\", big.mark = \",\", decimal.mark = \".\", trim = TRUE, digits, ... ) number_format( accuracy = NULL, scale = 1, prefix = \"\", suffix = \"\", big.mark = \" \", decimal.mark = \".\", style_positive = c(\"none\", \"plus\", \"space\"), style_negative = c(\"hyphen\", \"minus\", \"parens\"), scale_cut = NULL, trim = TRUE, ... ) comma_format( accuracy = NULL, scale = 1, prefix = \"\", suffix = \"\", big.mark = \",\", decimal.mark = \".\", trim = TRUE, digits, ... )"},{"path":"https://scales.r-lib.org/dev/reference/comma.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_number()/label_comma() — comma","text":"x numeric vector format. accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). digits Use accuracy instead. ... arguments passed base::format(). style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. \"space\": preceded Unicode \"figure space\", .e., space equally wide number +. Compared \"none\", adding figure space can ensure numbers remain properly aligned left- right-justified. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\".","code":""},{"path":"https://scales.r-lib.org/dev/reference/compose_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Compose two or more transformations together — compose_trans","title":"Compose two or more transformations together — compose_trans","text":"transformer provides general mechanism composing two transformers together. important use case combine reverse transformations.","code":""},{"path":"https://scales.r-lib.org/dev/reference/compose_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compose two or more transformations together — compose_trans","text":"","code":"compose_trans(...)"},{"path":"https://scales.r-lib.org/dev/reference/compose_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compose two or more transformations together — compose_trans","text":"... One transformers, either specified string individual transformer objects.","code":""},{"path":"https://scales.r-lib.org/dev/reference/compose_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compose two or more transformations together — compose_trans","text":"","code":"demo_continuous(10^c(-2:4), trans = \"log10\", labels = label_log()) #> scale_x_continuous(trans = \"log10\", labels = label_log()) demo_continuous(10^c(-2:4), trans = c(\"log10\", \"reverse\"), labels = label_log()) #> scale_x_continuous(trans = c(\"log10\", \"reverse\"), labels = label_log())"},{"path":"https://scales.r-lib.org/dev/reference/cscale.html","id":null,"dir":"Reference","previous_headings":"","what":"Continuous scale — cscale","title":"Continuous scale — cscale","text":"Continuous scale","code":""},{"path":"https://scales.r-lib.org/dev/reference/cscale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Continuous scale — cscale","text":"","code":"cscale(x, palette, na.value = NA_real_, trans = identity_trans())"},{"path":"https://scales.r-lib.org/dev/reference/cscale.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Continuous scale — cscale","text":"x vector continuous values scale palette palette use. Built palettes: area_pal, brewer_pal, dichromat_pal, div_gradient_pal, gradient_n_pal, grey_pal, hue_pal, identity_pal, linetype_pal, manual_pal, rescale_pal, seq_gradient_pal, shape_pal, viridis_pal na.value value use missing values trans transformation object describing transform raw data prior scaling. Defaults identity transformation leaves data unchanged. Built transformations: asinh_trans, asn_trans, atanh_trans, boxcox_trans, compose_trans, date_trans, exp_trans, hms_trans, identity_trans, log_trans, log10_trans, log1p_trans, log2_trans, logit_trans, modulus_trans, probability_trans, probit_trans, pseudo_log_trans, reciprocal_trans, reverse_trans, sqrt_trans, time_trans, timespan_trans, yj_trans .","code":""},{"path":"https://scales.r-lib.org/dev/reference/cscale.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Continuous scale — cscale","text":"","code":"with(mtcars, plot(disp, mpg, cex = cscale(hp, rescale_pal()))) with(mtcars, plot(disp, mpg, cex = cscale(hp, rescale_pal(), trans = sqrt_trans() ))) with(mtcars, plot(disp, mpg, cex = cscale(hp, area_pal()))) with(mtcars, plot(disp, mpg, pch = 20, cex = 5, col = cscale(hp, seq_gradient_pal(\"grey80\", \"black\")) ))"},{"path":"https://scales.r-lib.org/dev/reference/date_breaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Regularly spaced dates — date_breaks","title":"Regularly spaced dates — date_breaks","text":"Use breaks_width() instead.","code":""},{"path":"https://scales.r-lib.org/dev/reference/date_breaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Regularly spaced dates — date_breaks","text":"","code":"date_breaks(width = \"1 month\")"},{"path":"https://scales.r-lib.org/dev/reference/date_breaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Regularly spaced dates — date_breaks","text":"width interval specification, one \"sec\", \"min\", \"hour\", \"day\", \"week\", \"month\", \"year\". Can integer space, followed \"s\". Fractional seconds supported.","code":""},{"path":"https://scales.r-lib.org/dev/reference/date_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_date()/label_time() — date_format","title":"Superseded interface to label_date()/label_time() — date_format","text":"functions kept backward compatibility; switch [label_date()/label_time() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/date_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_date()/label_time() — date_format","text":"","code":"date_format(format = \"%Y-%m-%d\", tz = \"UTC\", locale = NULL) time_format(format = \"%H:%M:%S\", tz = \"UTC\", locale = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/date_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_date()/label_time() — date_format","text":"format date_format() time_format() date/time format string using standard POSIX specification. See strptime() details. date_short() character vector length 4 giving format components use year, month, day, hour respectively. tz time zone name, see timezones(). Defaults UTC locale Locale use day month names. default uses current locale. Setting argument requires stringi, can see complete list supported locales stringi::stri_locale_list().","code":""},{"path":"https://scales.r-lib.org/dev/reference/date_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Transformation for dates (class Date) — date_trans","title":"Transformation for dates (class Date) — date_trans","text":"Transformation dates (class Date)","code":""},{"path":"https://scales.r-lib.org/dev/reference/date_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transformation for dates (class Date) — date_trans","text":"","code":"date_trans()"},{"path":"https://scales.r-lib.org/dev/reference/date_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Transformation for dates (class Date) — date_trans","text":"","code":"years <- seq(as.Date(\"1910/1/1\"), as.Date(\"1999/1/1\"), \"years\") t <- date_trans() t$transform(years) #> [1] -21915 -21550 -21185 -20819 -20454 -20089 -19724 -19358 -18993 -18628 #> [11] -18263 -17897 -17532 -17167 -16802 -16436 -16071 -15706 -15341 -14975 #> [21] -14610 -14245 -13880 -13514 -13149 -12784 -12419 -12053 -11688 -11323 #> [31] -10958 -10592 -10227 -9862 -9497 -9131 -8766 -8401 -8036 -7670 #> [41] -7305 -6940 -6575 -6209 -5844 -5479 -5114 -4748 -4383 -4018 #> [51] -3653 -3287 -2922 -2557 -2192 -1826 -1461 -1096 -731 -365 #> [61] 0 365 730 1096 1461 1826 2191 2557 2922 3287 #> [71] 3652 4018 4383 4748 5113 5479 5844 6209 6574 6940 #> [81] 7305 7670 8035 8401 8766 9131 9496 9862 10227 10592 t$inverse(t$transform(years)) #> [1] \"1910-01-01\" \"1911-01-01\" \"1912-01-01\" \"1913-01-01\" \"1914-01-01\" #> [6] \"1915-01-01\" \"1916-01-01\" \"1917-01-01\" \"1918-01-01\" \"1919-01-01\" #> [11] \"1920-01-01\" \"1921-01-01\" \"1922-01-01\" \"1923-01-01\" \"1924-01-01\" #> [16] \"1925-01-01\" \"1926-01-01\" \"1927-01-01\" \"1928-01-01\" \"1929-01-01\" #> [21] \"1930-01-01\" \"1931-01-01\" \"1932-01-01\" \"1933-01-01\" \"1934-01-01\" #> [26] \"1935-01-01\" \"1936-01-01\" \"1937-01-01\" \"1938-01-01\" \"1939-01-01\" #> [31] \"1940-01-01\" \"1941-01-01\" \"1942-01-01\" \"1943-01-01\" \"1944-01-01\" #> [36] \"1945-01-01\" \"1946-01-01\" \"1947-01-01\" \"1948-01-01\" \"1949-01-01\" #> [41] \"1950-01-01\" \"1951-01-01\" \"1952-01-01\" \"1953-01-01\" \"1954-01-01\" #> [46] \"1955-01-01\" \"1956-01-01\" \"1957-01-01\" \"1958-01-01\" \"1959-01-01\" #> [51] \"1960-01-01\" \"1961-01-01\" \"1962-01-01\" \"1963-01-01\" \"1964-01-01\" #> [56] \"1965-01-01\" \"1966-01-01\" \"1967-01-01\" \"1968-01-01\" \"1969-01-01\" #> [61] \"1970-01-01\" \"1971-01-01\" \"1972-01-01\" \"1973-01-01\" \"1974-01-01\" #> [66] \"1975-01-01\" \"1976-01-01\" \"1977-01-01\" \"1978-01-01\" \"1979-01-01\" #> [71] \"1980-01-01\" \"1981-01-01\" \"1982-01-01\" \"1983-01-01\" \"1984-01-01\" #> [76] \"1985-01-01\" \"1986-01-01\" \"1987-01-01\" \"1988-01-01\" \"1989-01-01\" #> [81] \"1990-01-01\" \"1991-01-01\" \"1992-01-01\" \"1993-01-01\" \"1994-01-01\" #> [86] \"1995-01-01\" \"1996-01-01\" \"1997-01-01\" \"1998-01-01\" \"1999-01-01\" t$format(t$breaks(range(years))) #> [1] \"1900\" \"1920\" \"1940\" \"1960\" \"1980\" \"2000\""},{"path":"https://scales.r-lib.org/dev/reference/demo_continuous.html","id":null,"dir":"Reference","previous_headings":"","what":"Demonstrate scales functions with ggplot2 code — demo_continuous","title":"Demonstrate scales functions with ggplot2 code — demo_continuous","text":"functions generate ggplot2 code needed use scales functions real code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/demo_continuous.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Demonstrate scales functions with ggplot2 code — demo_continuous","text":"","code":"demo_continuous(x, ...) demo_log10(x, ...) demo_discrete(x, ...) demo_datetime(x, ...) demo_time(x, ...) demo_timespan(x, ...)"},{"path":"https://scales.r-lib.org/dev/reference/demo_continuous.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Demonstrate scales functions with ggplot2 code — demo_continuous","text":"x vector data","code":""},{"path":"https://scales.r-lib.org/dev/reference/dichromat_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Dichromat (colour-blind) palette (discrete) — dichromat_pal","title":"Dichromat (colour-blind) palette (discrete) — dichromat_pal","text":"Dichromat (colour-blind) palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/dichromat_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dichromat (colour-blind) palette (discrete) — dichromat_pal","text":"","code":"dichromat_pal(name)"},{"path":"https://scales.r-lib.org/dev/reference/dichromat_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dichromat (colour-blind) palette (discrete) — dichromat_pal","text":"name Name colour palette. One : BrowntoBlue.10, BrowntoBlue.12, BluetoDarkOrange.12, BluetoDarkOrange.18, DarkRedtoBlue.12, DarkRedtoBlue.18, BluetoGreen.14, BluetoGray.8, BluetoOrangeRed.14, BluetoOrange.10, BluetoOrange.12, BluetoOrange.8, LightBluetoDarkBlue.10, LightBluetoDarkBlue.7, Categorical.12, GreentoMagenta.16, SteppedSequential.5","code":""},{"path":"https://scales.r-lib.org/dev/reference/dichromat_pal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dichromat (colour-blind) palette (discrete) — dichromat_pal","text":"","code":"if (requireNamespace(\"dichromat\", quietly = TRUE)) { show_col(dichromat_pal(\"BluetoOrange.10\")(10)) show_col(dichromat_pal(\"BluetoOrange.10\")(5)) # Can use with gradient_n to create a continous gradient cols <- dichromat_pal(\"DarkRedtoBlue.12\")(12) show_col(gradient_n_pal(cols)(seq(0, 1, length.out = 30))) }"},{"path":"https://scales.r-lib.org/dev/reference/div_gradient_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Diverging colour gradient (continuous). — div_gradient_pal","title":"Diverging colour gradient (continuous). — div_gradient_pal","text":"Diverging colour gradient (continuous).","code":""},{"path":"https://scales.r-lib.org/dev/reference/div_gradient_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Diverging colour gradient (continuous). — div_gradient_pal","text":"","code":"div_gradient_pal( low = mnsl(\"10B 4/6\"), mid = mnsl(\"N 8/0\"), high = mnsl(\"10R 4/6\"), space = \"Lab\" )"},{"path":"https://scales.r-lib.org/dev/reference/div_gradient_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Diverging colour gradient (continuous). — div_gradient_pal","text":"low colour low end gradient. mid colour mid point high colour high end gradient. space colour space calculate gradient. Must \"Lab\" - values deprecated.","code":""},{"path":"https://scales.r-lib.org/dev/reference/div_gradient_pal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Diverging colour gradient (continuous). — div_gradient_pal","text":"","code":"x <- seq(-1, 1, length.out = 100) r <- sqrt(outer(x^2, x^2, \"+\")) image(r, col = div_gradient_pal()(seq(0, 1, length.out = 12))) image(r, col = div_gradient_pal()(seq(0, 1, length.out = 30))) image(r, col = div_gradient_pal()(seq(0, 1, length.out = 100))) library(munsell) pal <- div_gradient_pal(low = mnsl(complement(\"10R 4/6\"), fix = TRUE)) image(r, col = pal(seq(0, 1, length.out = 100)))"},{"path":"https://scales.r-lib.org/dev/reference/dollar_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_currency() — dollar_format","title":"Superseded interface to label_currency() — dollar_format","text":"functions kept backward compatibility; switch label_currency() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/dollar_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_currency() — dollar_format","text":"","code":"dollar_format( accuracy = NULL, scale = 1, prefix = \"$\", suffix = \"\", big.mark = \",\", decimal.mark = \".\", trim = TRUE, largest_with_cents = 1e+05, negative_parens = deprecated(), ... ) dollar( x, accuracy = NULL, scale = 1, prefix = \"$\", suffix = \"\", big.mark = \",\", decimal.mark = \".\", trim = TRUE, largest_with_cents = 1e+05, negative_parens = deprecated(), style_negative = c(\"hyphen\", \"minus\", \"parens\"), scale_cut = NULL, ... ) label_dollar( accuracy = NULL, scale = 1, prefix = \"$\", suffix = \"\", big.mark = \",\", decimal.mark = \".\", trim = TRUE, largest_with_cents = 1e+05, negative_parens = deprecated(), ... )"},{"path":"https://scales.r-lib.org/dev/reference/dollar_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_currency() — dollar_format","text":"scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix, suffix Symbols display value. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). largest_with_cents Like largest_with_fractional() label_currency() negative_parens Use style_negative = \"parens\" instead. ... arguments passed base::format(). x numeric vector","code":""},{"path":"https://scales.r-lib.org/dev/reference/dscale.html","id":null,"dir":"Reference","previous_headings":"","what":"Discrete scale — dscale","title":"Discrete scale — dscale","text":"Discrete scale","code":""},{"path":"https://scales.r-lib.org/dev/reference/dscale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Discrete scale — dscale","text":"","code":"dscale(x, palette, na.value = NA)"},{"path":"https://scales.r-lib.org/dev/reference/dscale.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Discrete scale — dscale","text":"x vector discrete values scale palette aesthetic palette use na.value aesthetic use missing values","code":""},{"path":"https://scales.r-lib.org/dev/reference/dscale.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Discrete scale — dscale","text":"","code":"with(mtcars, plot(disp, mpg, pch = 20, cex = 3, col = dscale(factor(cyl), brewer_pal()) ))"},{"path":"https://scales.r-lib.org/dev/reference/exp_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential transformation (inverse of log transformation) — exp_trans","title":"Exponential transformation (inverse of log transformation) — exp_trans","text":"Exponential transformation (inverse log transformation)","code":""},{"path":"https://scales.r-lib.org/dev/reference/exp_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential transformation (inverse of log transformation) — exp_trans","text":"","code":"exp_trans(base = exp(1))"},{"path":"https://scales.r-lib.org/dev/reference/exp_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential transformation (inverse of log transformation) — exp_trans","text":"base Base logarithm","code":""},{"path":"https://scales.r-lib.org/dev/reference/exp_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential transformation (inverse of log transformation) — exp_trans","text":"","code":"plot(exp_trans(0.5), xlim = c(-2, 2)) plot(exp_trans(1), xlim = c(-2, 2)) plot(exp_trans(2), xlim = c(-2, 2)) plot(exp_trans(), xlim = c(-2, 2))"},{"path":"https://scales.r-lib.org/dev/reference/expand_range.html","id":null,"dir":"Reference","previous_headings":"","what":"Expand a range with a multiplicative or additive constant — expand_range","title":"Expand a range with a multiplicative or additive constant — expand_range","text":"Expand range multiplicative additive constant","code":""},{"path":"https://scales.r-lib.org/dev/reference/expand_range.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Expand a range with a multiplicative or additive constant — expand_range","text":"","code":"expand_range(range, mul = 0, add = 0, zero_width = 1)"},{"path":"https://scales.r-lib.org/dev/reference/expand_range.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Expand a range with a multiplicative or additive constant — expand_range","text":"range range data, numeric vector length 2 mul multiplicative constant add additive constant zero_width distance use range zero width","code":""},{"path":"https://scales.r-lib.org/dev/reference/format_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Label using format() — format_format","title":"Label using format() — format_format","text":"function kept backward compatiblity; either use label_number() label_date() instead.","code":""},{"path":"https://scales.r-lib.org/dev/reference/format_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label using format() — format_format","text":"","code":"format_format(...)"},{"path":"https://scales.r-lib.org/dev/reference/format_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label using format() — format_format","text":"... Arguments passed format().","code":""},{"path":"https://scales.r-lib.org/dev/reference/fullseq.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate sequence of fixed size intervals covering range. — fullseq","title":"Generate sequence of fixed size intervals covering range. — fullseq","text":"Generate sequence fixed size intervals covering range.","code":""},{"path":"https://scales.r-lib.org/dev/reference/fullseq.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate sequence of fixed size intervals covering range. — fullseq","text":"","code":"fullseq(range, size, ...)"},{"path":"https://scales.r-lib.org/dev/reference/fullseq.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate sequence of fixed size intervals covering range. — fullseq","text":"range range size interval size ... arguments passed methods","code":""},{"path":"https://scales.r-lib.org/dev/reference/gradient_n_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Arbitrary colour gradient palette (continuous) — gradient_n_pal","title":"Arbitrary colour gradient palette (continuous) — gradient_n_pal","text":"Arbitrary colour gradient palette (continuous)","code":""},{"path":"https://scales.r-lib.org/dev/reference/gradient_n_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arbitrary colour gradient palette (continuous) — gradient_n_pal","text":"","code":"gradient_n_pal(colours, values = NULL, space = \"Lab\")"},{"path":"https://scales.r-lib.org/dev/reference/gradient_n_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Arbitrary colour gradient palette (continuous) — gradient_n_pal","text":"colours vector colours values colours evenly positioned along gradient vector gives position (0 1) colour colours vector. See rescale() convenience function map arbitrary range 0 1. space colour space calculate gradient. Must \"Lab\" - values deprecated.","code":""},{"path":"https://scales.r-lib.org/dev/reference/grey_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Grey scale palette (discrete) — grey_pal","title":"Grey scale palette (discrete) — grey_pal","text":"Grey scale palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/grey_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Grey scale palette (discrete) — grey_pal","text":"","code":"grey_pal(start = 0.2, end = 0.8)"},{"path":"https://scales.r-lib.org/dev/reference/grey_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Grey scale palette (discrete) — grey_pal","text":"start grey value low end palette end grey value high end palette","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/grey_pal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Grey scale palette (discrete) — grey_pal","text":"","code":"show_col(grey_pal()(25)) show_col(grey_pal(0, 1)(25))"},{"path":"https://scales.r-lib.org/dev/reference/hue_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Hue palette (discrete) — hue_pal","title":"Hue palette (discrete) — hue_pal","text":"Hue palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/hue_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Hue palette (discrete) — hue_pal","text":"","code":"hue_pal(h = c(0, 360) + 15, c = 100, l = 65, h.start = 0, direction = 1)"},{"path":"https://scales.r-lib.org/dev/reference/hue_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Hue palette (discrete) — hue_pal","text":"h range hues use, [0, 360] c chroma (intensity colour), maximum value varies depending combination hue luminance. l luminance (lightness), [0, 100] h.start hue start direction direction travel around colour wheel, 1 = clockwise, -1 = counter-clockwise","code":""},{"path":"https://scales.r-lib.org/dev/reference/hue_pal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Hue palette (discrete) — hue_pal","text":"","code":"show_col(hue_pal()(4)) show_col(hue_pal()(9)) show_col(hue_pal(l = 90)(9)) show_col(hue_pal(l = 30)(9)) show_col(hue_pal()(9)) show_col(hue_pal(direction = -1)(9)) show_col(hue_pal(h.start = 30)(9)) show_col(hue_pal(h.start = 90)(9)) show_col(hue_pal()(9)) show_col(hue_pal(h = c(0, 90))(9)) show_col(hue_pal(h = c(90, 180))(9)) show_col(hue_pal(h = c(180, 270))(9)) show_col(hue_pal(h = c(270, 360))(9))"},{"path":"https://scales.r-lib.org/dev/reference/identity_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Identity palette — identity_pal","title":"Identity palette — identity_pal","text":"Leaves values unchanged - useful data already scaled.","code":""},{"path":"https://scales.r-lib.org/dev/reference/identity_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identity palette — identity_pal","text":"","code":"identity_pal()"},{"path":"https://scales.r-lib.org/dev/reference/identity_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Identity transformation (do nothing) — identity_trans","title":"Identity transformation (do nothing) — identity_trans","text":"Identity transformation (nothing)","code":""},{"path":"https://scales.r-lib.org/dev/reference/identity_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identity transformation (do nothing) — identity_trans","text":"","code":"identity_trans()"},{"path":"https://scales.r-lib.org/dev/reference/identity_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identity transformation (do nothing) — identity_trans","text":"","code":"plot(identity_trans(), xlim = c(-1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/label_bytes.html","id":null,"dir":"Reference","previous_headings":"","what":"Label bytes (1 kB, 2 MB, etc) — label_bytes","title":"Label bytes (1 kB, 2 MB, etc) — label_bytes","text":"Scale bytes human friendly units. Can use either SI units (e.g. kB = 1000 bytes) binary units (e.g. kiB = 1024 bytes). See Units Information Wikipedia details.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_bytes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label bytes (1 kB, 2 MB, etc) — label_bytes","text":"","code":"label_bytes(units = \"auto_si\", accuracy = 1, scale = 1, ...)"},{"path":"https://scales.r-lib.org/dev/reference/label_bytes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label bytes (1 kB, 2 MB, etc) — label_bytes","text":"units Unit use. either one : \"kB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\" SI units (base 1000). \"kiB\", \"MiB\", \"GiB\", \"TiB\", \"PiB\", \"EiB\", \"ZiB\", \"YiB\" binary units (base 1024). auto_si auto_binary automatically pick appropriate unit value. accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. ... Arguments passed number prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\". trim Logical, FALSE, values right-justified common width (see base::format()).","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_bytes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label bytes (1 kB, 2 MB, etc) — label_bytes","text":"labeller function takes numeric vector breaks returns character vector labels.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_bytes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label bytes (1 kB, 2 MB, etc) — label_bytes","text":"","code":"demo_continuous(c(1, 1e6)) #> scale_x_continuous() demo_continuous(c(1, 1e6), labels = label_bytes()) #> scale_x_continuous(labels = label_bytes()) # Auto units are particularly nice on log scales demo_log10(c(1, 1e7), labels = label_bytes()) #> scale_x_log10(labels = label_bytes()) # You can also set the units demo_continuous(c(1, 1e6), labels = label_bytes(\"kB\")) #> scale_x_continuous(labels = label_bytes(\"kB\")) # You can also use binary units where a megabyte is defined as # (1024) ^ 2 bytes rather than (1000) ^ 2. You'll need to override # the default breaks to make this more informative. demo_continuous(c(1, 1024^2), breaks = breaks_width(250 * 1024), labels = label_bytes(\"auto_binary\") ) #> scale_x_continuous(breaks = breaks_width(250 * 1024), labels = label_bytes(\"auto_binary\"))"},{"path":"https://scales.r-lib.org/dev/reference/label_currency.html","id":null,"dir":"Reference","previous_headings":"","what":"Label currencies ($100, €2.50, etc) — label_currency","title":"Label currencies ($100, €2.50, etc) — label_currency","text":"Format numbers currency, rounding values monetary fractional monetary using unit convenient heuristic.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_currency.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label currencies ($100, €2.50, etc) — label_currency","text":"","code":"label_currency( accuracy = NULL, scale = 1, prefix = \"$\", suffix = \"\", big.mark = \",\", decimal.mark = \".\", trim = TRUE, largest_with_fractional = 1e+05, ... )"},{"path":"https://scales.r-lib.org/dev/reference/label_currency.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label currencies ($100, €2.50, etc) — label_currency","text":"accuracy, largest_with_fractional Number round . NULL, default, values rounded nearest integer, unless values non-zero fractional component (e.g. cents) largest value less largest_with_fractional default 100,000. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix, suffix Symbols display value. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). ... Arguments passed number style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\".","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_currency.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label currencies ($100, €2.50, etc) — label_currency","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_currency.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label currencies ($100, €2.50, etc) — label_currency","text":"","code":"demo_continuous(c(0, 1), labels = label_currency()) #> scale_x_continuous(labels = label_currency()) demo_continuous(c(1, 100), labels = label_currency()) #> scale_x_continuous(labels = label_currency()) # Customise currency display with prefix and suffix demo_continuous(c(1, 100), labels = label_currency(prefix = \"USD \")) #> scale_x_continuous(labels = label_currency(prefix = \"USD \")) yen <- label_currency( prefix = \"¥\", suffix = \"\", big.mark = \".\", decimal.mark = \",\" ) demo_continuous(c(1000, 1100), labels = yen) #> scale_x_continuous(labels = yen) # Use style_negative = \"parens\" for finance style display demo_continuous(c(-100, 100), labels = label_currency(style_negative = \"parens\")) #> scale_x_continuous(labels = label_currency(style_negative = \"parens\")) # Use scale_cut to use K/M/B where appropriate demo_log10(c(1, 1e16), breaks = log_breaks(7, 1e3), labels = label_currency(scale_cut = cut_short_scale()) ) #> scale_x_log10(breaks = log_breaks(7, 1000), labels = label_currency(scale_cut = cut_short_scale())) # cut_short_scale() uses B = one thousand million # cut_long_scale() uses B = one million million demo_log10(c(1, 1e16), breaks = log_breaks(7, 1e3), labels = label_currency(scale_cut = cut_long_scale()) ) #> scale_x_log10(breaks = log_breaks(7, 1000), labels = label_currency(scale_cut = cut_long_scale())) # You can also define your own breaks gbp <- label_currency( prefix = \"\\u00a3\", scale_cut = c(0, k = 1e3, m = 1e6, bn = 1e9, tn = 1e12) ) demo_log10(c(1, 1e12), breaks = log_breaks(5, 1e3), labels = gbp) #> scale_x_log10(breaks = log_breaks(5, 1000), labels = gbp)"},{"path":"https://scales.r-lib.org/dev/reference/label_date.html","id":null,"dir":"Reference","previous_headings":"","what":"Label date/times — label_date","title":"Label date/times — label_date","text":"label_date() label_time() label date/times using date/time format strings. label_date_short() automatically constructs short format string sufficient uniquely identify labels. inspired matplotlib's ConciseDateFormatter, uses slightly different approach: ConciseDateFormatter formats \"firsts\" (e.g. first day month, first day day) specially; date_short() formats changes (e.g. new month, new year) specially. label_timespan() intended show time passed adds common time units suffix input (ns, μs, ms, s, m, h, d, w).","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_date.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label date/times — label_date","text":"","code":"label_date(format = \"%Y-%m-%d\", tz = \"UTC\", locale = NULL) label_date_short(format = c(\"%Y\", \"%b\", \"%d\", \"%H:%M\"), sep = \"\\n\") label_time(format = \"%H:%M:%S\", tz = \"UTC\", locale = NULL) label_timespan(unit = c(\"secs\", \"mins\", \"hours\", \"days\", \"weeks\"), ...)"},{"path":"https://scales.r-lib.org/dev/reference/label_date.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label date/times — label_date","text":"format date_format() time_format() date/time format string using standard POSIX specification. See strptime() details. date_short() character vector length 4 giving format components use year, month, day, hour respectively. tz time zone name, see timezones(). Defaults UTC locale Locale use day month names. default uses current locale. Setting argument requires stringi, can see complete list supported locales stringi::stri_locale_list(). sep Separator use combining date formats single string. unit unit used interpret numeric input ... Arguments passed number accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). trim Logical, FALSE, values right-justified common width (see base::format()).","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_date.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label date/times — label_date","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_date.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label date/times — label_date","text":"","code":"date_range <- function(start, days) { start <- as.POSIXct(start) c(start, start + days * 24 * 60 * 60) } two_months <- date_range(\"2020-05-01\", 60) demo_datetime(two_months) #> scale_x_datetime() demo_datetime(two_months, labels = date_format(\"%m/%d\")) #> scale_x_datetime(labels = date_format(\"%m/%d\")) demo_datetime(two_months, labels = date_format(\"%e %b\", locale = \"fr\")) #> scale_x_datetime(labels = date_format(\"%e %b\", locale = \"fr\")) demo_datetime(two_months, labels = date_format(\"%e %B\", locale = \"es\")) #> scale_x_datetime(labels = date_format(\"%e %B\", locale = \"es\")) # ggplot2 provides a short-hand: demo_datetime(two_months, date_labels = \"%m/%d\") #> scale_x_datetime(date_labels = \"%m/%d\") # An alternative labelling system is label_date_short() demo_datetime(two_months, date_breaks = \"7 days\", labels = label_date_short()) #> scale_x_datetime(date_breaks = \"7 days\", labels = label_date_short()) # This is particularly effective for dense labels one_year <- date_range(\"2020-05-01\", 365) demo_datetime(one_year, date_breaks = \"month\") #> scale_x_datetime(date_breaks = \"month\") demo_datetime(one_year, date_breaks = \"month\", labels = label_date_short()) #> scale_x_datetime(date_breaks = \"month\", labels = label_date_short())"},{"path":"https://scales.r-lib.org/dev/reference/label_log.html","id":null,"dir":"Reference","previous_headings":"","what":"Label numbers in log format (10^3, 10^6, etc) — label_log","title":"Label numbers in log format (10^3, 10^6, etc) — label_log","text":"label_log() displays numbers base^exponent, using superscript formatting.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_log.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label numbers in log format (10^3, 10^6, etc) — label_log","text":"","code":"label_log(base = 10, digits = 3)"},{"path":"https://scales.r-lib.org/dev/reference/label_log.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label numbers in log format (10^3, 10^6, etc) — label_log","text":"base Base logarithm use digits Number significant digits show exponent. Argument passed base::format().","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_log.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label numbers in log format (10^3, 10^6, etc) — label_log","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_log.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label numbers in log format (10^3, 10^6, etc) — label_log","text":"","code":"demo_log10(c(1, 1e5), labels = label_log()) #> scale_x_log10(labels = label_log()) demo_log10(c(1, 1e5), breaks = breaks_log(base = 2), labels = label_log(base = 2)) #> scale_x_log10(breaks = breaks_log(base = 2), labels = label_log(base = 2))"},{"path":"https://scales.r-lib.org/dev/reference/label_number.html","id":null,"dir":"Reference","previous_headings":"","what":"Label numbers in decimal format (e.g. 0.12, 1,234) — label_number","title":"Label numbers in decimal format (e.g. 0.12, 1,234) — label_number","text":"Use label_number() force decimal display numbers (.e. use scientific notation). label_comma() special case inserts comma every three digits.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_number.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label numbers in decimal format (e.g. 0.12, 1,234) — label_number","text":"","code":"label_number( accuracy = NULL, scale = 1, prefix = \"\", suffix = \"\", big.mark = \" \", decimal.mark = \".\", style_positive = c(\"none\", \"plus\", \"space\"), style_negative = c(\"hyphen\", \"minus\", \"parens\"), scale_cut = NULL, trim = TRUE, ... ) label_comma( accuracy = NULL, scale = 1, prefix = \"\", suffix = \"\", big.mark = \",\", decimal.mark = \".\", trim = TRUE, digits, ... )"},{"path":"https://scales.r-lib.org/dev/reference/label_number.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label numbers in decimal format (e.g. 0.12, 1,234) — label_number","text":"accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. \"space\": preceded Unicode \"figure space\", .e., space equally wide number +. Compared \"none\", adding figure space can ensure numbers remain properly aligned left- right-justified. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\". trim Logical, FALSE, values right-justified common width (see base::format()). ... arguments passed base::format(). digits Use accuracy instead.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_number.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label numbers in decimal format (e.g. 0.12, 1,234) — label_number","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_number.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label numbers in decimal format (e.g. 0.12, 1,234) — label_number","text":"","code":"demo_continuous(c(-1e6, 1e6)) #> scale_x_continuous() demo_continuous(c(-1e6, 1e6), labels = label_number()) #> scale_x_continuous(labels = label_number()) demo_continuous(c(-1e6, 1e6), labels = label_comma()) #> scale_x_continuous(labels = label_comma()) # Use scale to rescale very small or large numbers to generate # more readable labels demo_continuous(c(0, 1e6), labels = label_number()) #> scale_x_continuous(labels = label_number()) demo_continuous(c(0, 1e6), labels = label_number(scale = 1 / 1e3)) #> scale_x_continuous(labels = label_number(scale = 1/1000)) demo_continuous(c(0, 1e-6), labels = label_number()) #> scale_x_continuous(labels = label_number()) demo_continuous(c(0, 1e-6), labels = label_number(scale = 1e6)) #> scale_x_continuous(labels = label_number(scale = 1e+06)) #' Use scale_cut to automatically add prefixes for large/small numbers demo_log10( c(1, 1e9), breaks = log_breaks(10), labels = label_number(scale_cut = cut_short_scale()) ) #> scale_x_log10(breaks = log_breaks(10), labels = label_number(scale_cut = cut_short_scale())) demo_log10( c(1, 1e9), breaks = log_breaks(10), labels = label_number(scale_cut = cut_si(\"m\")) ) #> scale_x_log10(breaks = log_breaks(10), labels = label_number(scale_cut = cut_si(\"m\"))) demo_log10( c(1e-9, 1), breaks = log_breaks(10), labels = label_number(scale_cut = cut_si(\"g\")) ) #> scale_x_log10(breaks = log_breaks(10), labels = label_number(scale_cut = cut_si(\"g\"))) # use scale and scale_cut when data already uses SI prefix # for example, if data was stored in kg demo_log10( c(1e-9, 1), breaks = log_breaks(10), labels = label_number(scale_cut = cut_si(\"g\"), scale = 1e3) ) #> scale_x_log10(breaks = log_breaks(10), labels = label_number(scale_cut = cut_si(\"g\"), #> scale = 1000)) #' # Use style arguments to vary the appearance of positive and negative numbers demo_continuous(c(-1e3, 1e3), labels = label_number( style_positive = \"plus\", style_negative = \"minus\" )) #> scale_x_continuous(labels = label_number(style_positive = \"plus\", #> style_negative = \"minus\")) demo_continuous(c(-1e3, 1e3), labels = label_number(style_negative = \"parens\")) #> scale_x_continuous(labels = label_number(style_negative = \"parens\")) # You can use prefix and suffix for other types of display demo_continuous(c(32, 212), labels = label_number(suffix = \"\\u00b0F\")) #> scale_x_continuous(labels = label_number(suffix = \"°F\")) demo_continuous(c(0, 100), labels = label_number(suffix = \"\\u00b0C\")) #> scale_x_continuous(labels = label_number(suffix = \"°C\"))"},{"path":"https://scales.r-lib.org/dev/reference/label_number_auto.html","id":null,"dir":"Reference","previous_headings":"","what":"Label numbers, avoiding scientific notation where possible — label_number_auto","title":"Label numbers, avoiding scientific notation where possible — label_number_auto","text":"Switches number_format() scientific_format() based set heuristics designed automatically generate useful labels across wide range inputs","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_number_auto.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label numbers, avoiding scientific notation where possible — label_number_auto","text":"","code":"label_number_auto()"},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_number_auto.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label numbers, avoiding scientific notation where possible — label_number_auto","text":"","code":"# Very small and very large numbers get scientific notation demo_continuous(c(0, 1e-6), labels = label_number_auto()) #> scale_x_continuous(labels = label_number_auto()) demo_continuous(c(0, 1e9), labels = label_number_auto()) #> scale_x_continuous(labels = label_number_auto()) # Other ranges get the numbers printed in full demo_continuous(c(0, 1e-3), labels = label_number_auto()) #> scale_x_continuous(labels = label_number_auto()) demo_continuous(c(0, 1), labels = label_number_auto()) #> scale_x_continuous(labels = label_number_auto()) demo_continuous(c(0, 1e3), labels = label_number_auto()) #> scale_x_continuous(labels = label_number_auto()) demo_continuous(c(0, 1e6), labels = label_number_auto()) #> scale_x_continuous(labels = label_number_auto()) # Transformation is applied individually so you get as little # scientific notation as possible demo_log10(c(1, 1e7), labels = label_number_auto()) #> scale_x_log10(labels = label_number_auto())"},{"path":"https://scales.r-lib.org/dev/reference/label_number_si.html","id":null,"dir":"Reference","previous_headings":"","what":"Label numbers with SI prefixes (2 kg, 5 mm, etc) — label_number_si","title":"Label numbers with SI prefixes (2 kg, 5 mm, etc) — label_number_si","text":"label_number_si() deprecated previous unit actually use SI units, instead used called \"short scale\". can now get results label_number(scale_cut = cut_short_scale()), want correct SI units, label_number(scale_cut = cut_si(\"unit\")).","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_number_si.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label numbers with SI prefixes (2 kg, 5 mm, etc) — label_number_si","text":"","code":"label_number_si(unit = \"\", accuracy = NULL, scale = 1, suffix = \"\", ...)"},{"path":"https://scales.r-lib.org/dev/reference/label_number_si.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label numbers with SI prefixes (2 kg, 5 mm, etc) — label_number_si","text":"unit Unit measurement (e.g. \"m\" meter, SI unit length). accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data already using SI prefix. suffix Additional text display number. ... Arguments passed label_number prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\". trim Logical, FALSE, values right-justified common width (see base::format()).","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_number_si.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label numbers with SI prefixes (2 kg, 5 mm, etc) — label_number_si","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_number_si.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label numbers with SI prefixes (2 kg, 5 mm, etc) — label_number_si","text":"","code":"# label_number_si() doesn't actually produce SI prefixes: demo_continuous(c(1, 1e9), labels = label_number_si(\"g\")) #> scale_x_continuous(labels = label_number_si(\"g\")) #> Warning: `label_number_si()` was deprecated in scales 1.2.0. #> ℹ Please use the `scale_cut` argument of `label_number()` instead. # If you want real SI prefixes, use cut_si() demo_continuous(c(1, 1e9), labels = label_number(scale_cut = cut_si(\"m\"))) #> scale_x_continuous(labels = label_number(scale_cut = cut_si(\"m\"))) # If you want the existing behavior, use cut_short_scale() demo_continuous(c(1, 1e9), labels = label_number(scale_cut = cut_short_scale())) #> scale_x_continuous(labels = label_number(scale_cut = cut_short_scale()))"},{"path":"https://scales.r-lib.org/dev/reference/label_ordinal.html","id":null,"dir":"Reference","previous_headings":"","what":"Label ordinal numbers (1st, 2nd, 3rd, etc) — label_ordinal","title":"Label ordinal numbers (1st, 2nd, 3rd, etc) — label_ordinal","text":"Round values integers display ordinal values (e.g. 1st, 2nd, 3rd). Built-rules provided English, French, Spanish.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_ordinal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label ordinal numbers (1st, 2nd, 3rd, etc) — label_ordinal","text":"","code":"label_ordinal( prefix = \"\", suffix = \"\", big.mark = \" \", rules = ordinal_english(), ... ) ordinal_english() ordinal_french(gender = c(\"masculin\", \"feminin\"), plural = FALSE) ordinal_spanish()"},{"path":"https://scales.r-lib.org/dev/reference/label_ordinal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label ordinal numbers (1st, 2nd, 3rd, etc) — label_ordinal","text":"prefix, suffix Symbols display value. big.mark Character used every 3 digits separate thousands. rules Named list regular expressions, matched order. Name gives suffix, value specifies numbers match. ... Arguments passed number accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. decimal.mark character used indicate numeric decimal point. style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\". trim Logical, FALSE, values right-justified common width (see base::format()). gender Masculin feminin gender French ordinal. plural Plural singular French ordinal.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_ordinal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label ordinal numbers (1st, 2nd, 3rd, etc) — label_ordinal","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_ordinal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label ordinal numbers (1st, 2nd, 3rd, etc) — label_ordinal","text":"","code":"demo_continuous(c(1, 5)) #> scale_x_continuous() demo_continuous(c(1, 5), labels = label_ordinal()) #> scale_x_continuous(labels = label_ordinal()) demo_continuous(c(1, 5), labels = label_ordinal(rules = ordinal_french())) #> scale_x_continuous(labels = label_ordinal(rules = ordinal_french())) # The rules are just a set of regular expressions that are applied in turn ordinal_french() #> $er #> [1] \"^1$\" #> #> $e #> [1] \".\" #> ordinal_english() #> $st #> [1] \"(? #> $nd #> [1] \"(? #> $rd #> [1] \"(? #> $th #> [1] \"(?<=1)[123]$\" #> #> $th #> [1] \"[0456789]$\" #> #> $th #> [1] \".\" #> # Note that ordinal rounds values, so you may need to adjust the breaks too demo_continuous(c(1, 10)) #> scale_x_continuous() demo_continuous(c(1, 10), labels = label_ordinal()) #> scale_x_continuous(labels = label_ordinal()) demo_continuous(c(1, 10), labels = label_ordinal(), breaks = breaks_width(2) ) #> scale_x_continuous(labels = label_ordinal(), breaks = breaks_width(2))"},{"path":"https://scales.r-lib.org/dev/reference/label_parse.html","id":null,"dir":"Reference","previous_headings":"","what":"Label with mathematical annotations — label_parse","title":"Label with mathematical annotations — label_parse","text":"label_parse() produces expression strings parsing ; label_math() constructs expressions replacing pronoun .x string.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_parse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label with mathematical annotations — label_parse","text":"","code":"label_parse() label_math(expr = 10^.x, format = force)"},{"path":"https://scales.r-lib.org/dev/reference/label_parse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label with mathematical annotations — label_parse","text":"expr expression use format another format function apply prior mathematical transformation - makes easier use floating point numbers mathematical expressions.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_parse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label with mathematical annotations — label_parse","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_parse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label with mathematical annotations — label_parse","text":"","code":"# Use label_parse() with discrete scales greek <- c(\"alpha\", \"beta\", \"gamma\") demo_discrete(greek) #> scale_x_discrete() demo_discrete(greek, labels = label_parse()) #> scale_x_discrete(labels = label_parse()) # Use label_math() with continuous scales demo_continuous(c(1, 5)) #> scale_x_continuous() demo_continuous(c(1, 5), labels = label_math(alpha[.x])) #> scale_x_continuous(labels = label_math(alpha[.x])) demo_continuous(c(1, 5), labels = label_math()) #> scale_x_continuous(labels = label_math())"},{"path":"https://scales.r-lib.org/dev/reference/label_percent.html","id":null,"dir":"Reference","previous_headings":"","what":"Label percentages (2.5%, 50%, etc) — label_percent","title":"Label percentages (2.5%, 50%, etc) — label_percent","text":"Label percentages (2.5%, 50%, etc)","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_percent.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label percentages (2.5%, 50%, etc) — label_percent","text":"","code":"label_percent( accuracy = NULL, scale = 100, prefix = \"\", suffix = \"%\", big.mark = \" \", decimal.mark = \".\", trim = TRUE, ... )"},{"path":"https://scales.r-lib.org/dev/reference/label_percent.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label percentages (2.5%, 50%, etc) — label_percent","text":"accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). ... Arguments passed label_number style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\".","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_percent.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label percentages (2.5%, 50%, etc) — label_percent","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_percent.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label percentages (2.5%, 50%, etc) — label_percent","text":"","code":"demo_continuous(c(0, 1)) #> scale_x_continuous() demo_continuous(c(0, 1), labels = label_percent()) #> scale_x_continuous(labels = label_percent()) # Use prefix and suffix to create your own variants french_percent <- label_percent( decimal.mark = \",\", suffix = \" %\" ) demo_continuous(c(0, .01), labels = french_percent) #> scale_x_continuous(labels = french_percent)"},{"path":"https://scales.r-lib.org/dev/reference/label_pvalue.html","id":null,"dir":"Reference","previous_headings":"","what":"Label p-values (e.g. <0.001, 0.25, p >= 0.99) — label_pvalue","title":"Label p-values (e.g. <0.001, 0.25, p >= 0.99) — label_pvalue","text":"Formatter p-values, using \"<\" \">\" p-values close 0 1.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_pvalue.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label p-values (e.g. <0.001, 0.25, p >= 0.99) — label_pvalue","text":"","code":"label_pvalue( accuracy = 0.001, decimal.mark = \".\", prefix = NULL, add_p = FALSE )"},{"path":"https://scales.r-lib.org/dev/reference/label_pvalue.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label p-values (e.g. <0.001, 0.25, p >= 0.99) — label_pvalue","text":"accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. decimal.mark character used indicate numeric decimal point. prefix character vector length 3 giving prefixes put front numbers. default values c(\"<\", \"\", \">\") add_p TRUE c(\"p<\", \"p=\", \"p>\") FALSE. add_p Add \"p=\" value?","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_pvalue.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label p-values (e.g. <0.001, 0.25, p >= 0.99) — label_pvalue","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_pvalue.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label p-values (e.g. <0.001, 0.25, p >= 0.99) — label_pvalue","text":"","code":"demo_continuous(c(0, 1)) #> scale_x_continuous() demo_continuous(c(0, 1), labels = label_pvalue()) #> scale_x_continuous(labels = label_pvalue()) demo_continuous(c(0, 1), labels = label_pvalue(accuracy = 0.1)) #> scale_x_continuous(labels = label_pvalue(accuracy = 0.1)) demo_continuous(c(0, 1), labels = label_pvalue(add_p = TRUE)) #> scale_x_continuous(labels = label_pvalue(add_p = TRUE)) # Or provide your own prefixes prefix <- c(\"p < \", \"p = \", \"p > \") demo_continuous(c(0, 1), labels = label_pvalue(prefix = prefix)) #> scale_x_continuous(labels = label_pvalue(prefix = prefix))"},{"path":"https://scales.r-lib.org/dev/reference/label_scientific.html","id":null,"dir":"Reference","previous_headings":"","what":"Label numbers with scientific notation (e.g. 1e05, 1.5e-02) — label_scientific","title":"Label numbers with scientific notation (e.g. 1e05, 1.5e-02) — label_scientific","text":"Label numbers scientific notation (e.g. 1e05, 1.5e-02)","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_scientific.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label numbers with scientific notation (e.g. 1e05, 1.5e-02) — label_scientific","text":"","code":"label_scientific( digits = 3, scale = 1, prefix = \"\", suffix = \"\", decimal.mark = \".\", trim = TRUE, ... )"},{"path":"https://scales.r-lib.org/dev/reference/label_scientific.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label numbers with scientific notation (e.g. 1e05, 1.5e-02) — label_scientific","text":"digits Number digits show exponent. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix, suffix Symbols display value. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). ... arguments passed base::format().","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_scientific.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label numbers with scientific notation (e.g. 1e05, 1.5e-02) — label_scientific","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_scientific.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label numbers with scientific notation (e.g. 1e05, 1.5e-02) — label_scientific","text":"","code":"demo_continuous(c(1, 10)) #> scale_x_continuous() demo_continuous(c(1, 10), labels = label_scientific()) #> scale_x_continuous(labels = label_scientific()) demo_continuous(c(1, 10), labels = label_scientific(digits = 3)) #> scale_x_continuous(labels = label_scientific(digits = 3)) demo_log10(c(1, 1e9)) #> scale_x_log10()"},{"path":"https://scales.r-lib.org/dev/reference/label_wrap.html","id":null,"dir":"Reference","previous_headings":"","what":"Label strings by wrapping across multiple lines — label_wrap","title":"Label strings by wrapping across multiple lines — label_wrap","text":"Uses strwrap() split long labels across multiple lines.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_wrap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label strings by wrapping across multiple lines — label_wrap","text":"","code":"label_wrap(width)"},{"path":"https://scales.r-lib.org/dev/reference/label_wrap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label strings by wrapping across multiple lines — label_wrap","text":"width Number characters per line.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_wrap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label strings by wrapping across multiple lines — label_wrap","text":"label_() functions return \"labelling\" function, .e. function takes vector x returns character vector length(x) giving label input value. Labelling functions designed used labels argument ggplot2 scales. examples demonstrate use x scales, work similarly scales, including generate legends rather axes.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_wrap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label strings by wrapping across multiple lines — label_wrap","text":"","code":"x <- c( \"this is a long label\", \"this is another long label\", \"this a label this is even longer\" ) demo_discrete(x) #> scale_x_discrete() demo_discrete(x, labels = label_wrap(10)) #> scale_x_discrete(labels = label_wrap(10)) demo_discrete(x, labels = label_wrap(20)) #> scale_x_discrete(labels = label_wrap(20))"},{"path":"https://scales.r-lib.org/dev/reference/linetype_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Line type palette (discrete) — linetype_pal","title":"Line type palette (discrete) — linetype_pal","text":"Based set supplied Richard Pearson, University Manchester","code":""},{"path":"https://scales.r-lib.org/dev/reference/linetype_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Line type palette (discrete) — linetype_pal","text":"","code":"linetype_pal()"},{"path":"https://scales.r-lib.org/dev/reference/log_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Log transformations — log_trans","title":"Log transformations — log_trans","text":"log_trans(): log(x) log1p(): log(x + 1) pseudo_log_trans(): smoothly transition linear scale around 0.","code":""},{"path":"https://scales.r-lib.org/dev/reference/log_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Log transformations — log_trans","text":"","code":"log_trans(base = exp(1)) log10_trans() log2_trans() log1p_trans() pseudo_log_trans(sigma = 1, base = exp(1))"},{"path":"https://scales.r-lib.org/dev/reference/log_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Log transformations — log_trans","text":"base base logarithm sigma Scaling factor linear part pseudo-log transformation.","code":""},{"path":"https://scales.r-lib.org/dev/reference/log_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Log transformations — log_trans","text":"","code":"plot(log2_trans(), xlim = c(0, 5)) plot(log_trans(), xlim = c(0, 5)) plot(log10_trans(), xlim = c(0, 5)) plot(log_trans(), xlim = c(0, 2)) plot(log1p_trans(), xlim = c(-1, 1)) # The pseudo-log is defined for all real numbers plot(pseudo_log_trans(), xlim = c(-5, 5)) lines(log_trans(), xlim = c(0, 5), col = \"red\") # For large positives nubmers it's very close to log plot(pseudo_log_trans(), xlim = c(1, 20)) lines(log_trans(), xlim = c(1, 20), col = \"red\")"},{"path":"https://scales.r-lib.org/dev/reference/manual_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Manual palette (discrete) — manual_pal","title":"Manual palette (discrete) — manual_pal","text":"Manual palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/manual_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Manual palette (discrete) — manual_pal","text":"","code":"manual_pal(values)"},{"path":"https://scales.r-lib.org/dev/reference/manual_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Manual palette (discrete) — manual_pal","text":"values vector values used palette.","code":""},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_width.html","id":null,"dir":"Reference","previous_headings":"","what":"Minor breaks — minor_breaks_width","title":"Minor breaks — minor_breaks_width","text":"Generate minor breaks major breaks either spaced fixed width, fixed number.","code":""},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_width.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Minor breaks — minor_breaks_width","text":"","code":"minor_breaks_width(width, offset) minor_breaks_n(n)"},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_width.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Minor breaks — minor_breaks_width","text":"width Distance break. Either number, date/times, single string form \"{n} {unit}\", e.g. \"1 month\", \"5 days\". Unit can one \"sec\", \"min\", \"hour\", \"day\", \"week\", \"month\", \"year\". offset Use want breaks start zero, conventional date time boundary 1st January midnight. Either number, date/times, single string form \"{n} {unit}\", width. offset can vector, accumulate order given. mostly useful dates, e.g. c(\"3 months\", \"5 days\") offset three months five days, useful UK tax year. Note due way dates rounded, guarantee offset = c(x, y) give result offset = c(y, x). n number breaks","code":""},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_width.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Minor breaks — minor_breaks_width","text":"","code":"demo_log10(c(1, 1e6)) #> scale_x_log10() if (FALSE) { # Requires https://github.com/tidyverse/ggplot2/pull/3591 demo_log10(c(1, 1e6), minor_breaks = minor_breaks_n(10)) }"},{"path":"https://scales.r-lib.org/dev/reference/muted.html","id":null,"dir":"Reference","previous_headings":"","what":"Mute standard colour — muted","title":"Mute standard colour — muted","text":"Mute standard colour","code":""},{"path":"https://scales.r-lib.org/dev/reference/muted.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Mute standard colour — muted","text":"","code":"muted(colour, l = 30, c = 70)"},{"path":"https://scales.r-lib.org/dev/reference/muted.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Mute standard colour — muted","text":"colour character vector colours modify l new luminance c new chroma","code":""},{"path":"https://scales.r-lib.org/dev/reference/muted.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Mute standard colour — muted","text":"","code":"muted(\"red\") #> [1] \"#832424\" muted(\"blue\") #> [1] \"#3A3A98\" show_col(c(\"red\", \"blue\", muted(\"red\"), muted(\"blue\")))"},{"path":"https://scales.r-lib.org/dev/reference/number.html","id":null,"dir":"Reference","previous_headings":"","what":"A low-level numeric formatter — number","title":"A low-level numeric formatter — number","text":"function low-level helper powers many labelling functions. generally need call directly unless creating labelling function.","code":""},{"path":"https://scales.r-lib.org/dev/reference/number.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A low-level numeric formatter — number","text":"","code":"number( x, accuracy = NULL, scale = 1, prefix = \"\", suffix = \"\", big.mark = \" \", decimal.mark = \".\", style_positive = c(\"none\", \"plus\", \"space\"), style_negative = c(\"hyphen\", \"minus\", \"parens\"), scale_cut = NULL, trim = TRUE, ... ) cut_short_scale(space = FALSE) cut_long_scale(space = FALSE) cut_si(unit)"},{"path":"https://scales.r-lib.org/dev/reference/number.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A low-level numeric formatter — number","text":"accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. style_positive string determines style positive numbers: \"none\" (default): change, e.g. 1. \"plus\": preceded +, e.g. +1. \"space\": preceded Unicode \"figure space\", .e., space equally wide number +. Compared \"none\", adding figure space can ensure numbers remain properly aligned left- right-justified. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hypen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). scale_cut Named numeric vector allows rescale large (small) numbers add prefix. Built-helpers include: cut_short_scale(): [10^3, 10^6) = K, [10^6, 10^9) = M, [10^9, 10^12) = B, [10^12, Inf) = T. cut_long_scale(): [10^3, 10^6) = K, [10^6, 10^12) = M, [10^12, 10^18) = B, [10^18, Inf) = T. cut_si(unit): uses standard SI units. supply vector c(= 100, b = 1000), absolute values range [0, 100) rescaled, absolute values range [100, 1000) divided 100 given suffix \"\", absolute values range [1000, Inf) divided 1000 given suffix \"b\". trim Logical, FALSE, values right-justified common width (see base::format()). ... arguments passed base::format(). space Add space scale suffix? unit SI unit abbreviation.","code":""},{"path":"https://scales.r-lib.org/dev/reference/number.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A low-level numeric formatter — number","text":"character vector length(x).","code":""},{"path":"https://scales.r-lib.org/dev/reference/number_bytes_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Older interface to label_bytes() — number_bytes_format","title":"Older interface to label_bytes() — number_bytes_format","text":"functions kept backward compatibility, switch label_bytes() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/number_bytes_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Older interface to label_bytes() — number_bytes_format","text":"","code":"number_bytes_format(symbol = \"auto\", units = \"binary\", ...) number_bytes(x, symbol = \"auto\", units = c(\"binary\", \"si\"), accuracy = 1, ...)"},{"path":"https://scales.r-lib.org/dev/reference/number_bytes_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Older interface to label_bytes() — number_bytes_format","text":"symbol byte symbol use. \"auto\" symbol used determined separately value x. Valid symbols \"B\", \"kB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\" SI units, \"iB\" variants binary units. units unit base use, \"binary\" (1024 base) \"si\" (1000 base)","code":""},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":null,"dir":"Reference","previous_headings":"","what":"Out of bounds handling — oob","title":"Out of bounds handling — oob","text":"set functions modify data values outside given range. oob_*() functions designed passed oob argument ggplot2 continuous binned scales, oob_discard exception. functions affect bounds values following ways: oob_censor() replaces bounds values NAs. default oob argument continuous scales. oob_censor_any() acts like oob_censor(), also replaces infinite values NAs. oob_squish() replaces bounds values nearest limit. default oob argument binned scales. oob_squish_any() acts like oob_squish(), also replaces infinite values nearest limit. oob_squish_infinite() replaces infinite values nearest limit. oob_keep() adjust bounds values. position scales, behaves zooming limits without data removal. oob_discard() removes bounds values input. suitable ggplot2 scales.","code":""},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Out of bounds handling — oob","text":"","code":"oob_censor(x, range = c(0, 1), only.finite = TRUE) oob_censor_any(x, range = c(0, 1)) oob_discard(x, range = c(0, 1)) oob_squish(x, range = c(0, 1), only.finite = TRUE) oob_squish_any(x, range = c(0, 1)) oob_squish_infinite(x, range = c(0, 1)) oob_keep(x, range = c(0, 1)) censor(x, range = c(0, 1), only.finite = TRUE) discard(x, range = c(0, 1)) squish(x, range = c(0, 1), only.finite = TRUE) squish_infinite(x, range = c(0, 1))"},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Out of bounds handling — oob","text":"x numeric vector values modify. range numeric vector length two giving minimum maximum limit desired output range respectively. .finite logical length one. TRUE, finite values altered. FALSE, also infinite values altered.","code":""},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Out of bounds handling — oob","text":"oob_() functions return vector numerical values length x argument, wherein bounds values modified. oob_discard() returns vector less equal length x argument.","code":""},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Out of bounds handling — oob","text":"oob_censor_any() oob_squish_any() functions oob_censor() oob_squish() .finite argument set FALSE. Replacing position values NAs, oob_censor() , typically lead removal datapoints ggplot. Setting ggplot coordinate limits equivalent using oob_keep() position scales.","code":""},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":"old-interface","dir":"Reference","previous_headings":"","what":"Old interface","title":"Out of bounds handling — oob","text":"censor(), squish(), squish_infinite() discard() longer recommended; please use oob_censor(), oob_squish(), oob_squish_infinite() oob_discard() instead.","code":""},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Out of bounds handling — oob","text":"oob_squish(): Homer Strong homer.strong@gmail.com","code":""},{"path":"https://scales.r-lib.org/dev/reference/oob.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Out of bounds handling — oob","text":"","code":"# Censoring replaces out of bounds values with NAs oob_censor(c(-Inf, -1, 0.5, 1, 2, NA, Inf)) #> [1] -Inf NA 0.5 1.0 NA NA Inf oob_censor_any(c(-Inf, -1, 0.5, 1, 2, NA, Inf)) #> [1] NA NA 0.5 1.0 NA NA NA # Squishing replaces out of bounds values with the nearest range limit oob_squish(c(-Inf, -1, 0.5, 1, 2, NA, Inf)) #> [1] -Inf 0.0 0.5 1.0 1.0 NA Inf oob_squish_any(c(-Inf, -1, 0.5, 1, 2, NA, Inf)) #> [1] 0.0 0.0 0.5 1.0 1.0 NA 1.0 oob_squish_infinite(c(-Inf, -1, 0.5, 1, 2, NA, Inf)) #> [1] 0.0 -1.0 0.5 1.0 2.0 NA 1.0 # Keeping does not alter values oob_keep(c(-Inf, -1, 0.5, 1, 2, NA, Inf)) #> [1] -Inf -1.0 0.5 1.0 2.0 NA Inf # Discarding will remove out of bounds values oob_discard(c(-Inf, -1, 0.5, 1, 2, NA, Inf)) #> [1] 0.5 1.0 NA"},{"path":"https://scales.r-lib.org/dev/reference/ordinal_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_ordinal() — ordinal_format","title":"Superseded interface to label_ordinal() — ordinal_format","text":"functions kept backward compatibility; switch label_ordinal() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/ordinal_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_ordinal() — ordinal_format","text":"","code":"ordinal_format( prefix = \"\", suffix = \"\", big.mark = \" \", rules = ordinal_english(), ... ) ordinal( x, prefix = \"\", suffix = \"\", big.mark = \" \", rules = ordinal_english(), ... )"},{"path":"https://scales.r-lib.org/dev/reference/ordinal_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_ordinal() — ordinal_format","text":"prefix, suffix Symbols display value. big.mark Character used every 3 digits separate thousands. rules Named list regular expressions, matched order. Name gives suffix, value specifies numbers match. ... arguments passed base::format().","code":""},{"path":"https://scales.r-lib.org/dev/reference/parse_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_parse()/label_math() — parse_format","title":"Superseded interface to label_parse()/label_math() — parse_format","text":"functions kept backward compatibility; switch label_parse()/label_math() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/parse_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_parse()/label_math() — parse_format","text":"","code":"parse_format() math_format(expr = 10^.x, format = force)"},{"path":"https://scales.r-lib.org/dev/reference/parse_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_parse()/label_math() — parse_format","text":"expr expression use format another format function apply prior mathematical transformation - makes easier use floating point numbers mathematical expressions.","code":""},{"path":"https://scales.r-lib.org/dev/reference/percent_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_percent() — percent_format","title":"Superseded interface to label_percent() — percent_format","text":"functions kept backward compatibility; switch label_percent() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/percent_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_percent() — percent_format","text":"","code":"percent_format( accuracy = NULL, scale = 100, prefix = \"\", suffix = \"%\", big.mark = \" \", decimal.mark = \".\", trim = TRUE, ... ) percent( x, accuracy = NULL, scale = 100, prefix = \"\", suffix = \"%\", big.mark = \" \", decimal.mark = \".\", trim = TRUE, ... )"},{"path":"https://scales.r-lib.org/dev/reference/percent_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_percent() — percent_format","text":"accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). ... arguments passed base::format().","code":""},{"path":"https://scales.r-lib.org/dev/reference/pretty_breaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to breaks_pretty() — pretty_breaks","title":"Superseded interface to breaks_pretty() — pretty_breaks","text":"functions kept backward compatibility; switch breaks_pretty() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/pretty_breaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to breaks_pretty() — pretty_breaks","text":"","code":"pretty_breaks(n = 5, ...)"},{"path":"https://scales.r-lib.org/dev/reference/pretty_breaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to breaks_pretty() — pretty_breaks","text":"n Desired number breaks. may get slightly fewer breaks requested. ... arguments passed pretty()","code":""},{"path":"https://scales.r-lib.org/dev/reference/probability_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Probability transformation — probability_trans","title":"Probability transformation — probability_trans","text":"Probability transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/probability_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Probability transformation — probability_trans","text":"","code":"probability_trans(distribution, ...) logit_trans() probit_trans()"},{"path":"https://scales.r-lib.org/dev/reference/probability_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Probability transformation — probability_trans","text":"distribution probability distribution. standard R abbreviation \"p\" + distribution valid cumulative distribution function, \"q\" + distribution valid quantile function, \"d\" + distribution valid probability density function. ... arguments passed distribution quantile functions","code":""},{"path":"https://scales.r-lib.org/dev/reference/probability_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Probability transformation — probability_trans","text":"","code":"plot(logit_trans(), xlim = c(0, 1)) plot(probit_trans(), xlim = c(0, 1))"},{"path":"https://scales.r-lib.org/dev/reference/pvalue_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_pvalue() — pvalue_format","title":"Superseded interface to label_pvalue() — pvalue_format","text":"functions kept backward compatibility; switch label_pvalue() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/pvalue_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_pvalue() — pvalue_format","text":"","code":"pvalue_format( accuracy = 0.001, decimal.mark = \".\", prefix = NULL, add_p = FALSE ) pvalue(x, accuracy = 0.001, decimal.mark = \".\", prefix = NULL, add_p = FALSE)"},{"path":"https://scales.r-lib.org/dev/reference/pvalue_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_pvalue() — pvalue_format","text":"accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. decimal.mark character used indicate numeric decimal point. prefix character vector length 3 giving prefixes put front numbers. default values c(\"<\", \"\", \">\") add_p TRUE c(\"p<\", \"p=\", \"p>\") FALSE. add_p Add \"p=\" value?","code":""},{"path":"https://scales.r-lib.org/dev/reference/reciprocal_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Reciprocal transformation — reciprocal_trans","title":"Reciprocal transformation — reciprocal_trans","text":"Reciprocal transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/reciprocal_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reciprocal transformation — reciprocal_trans","text":"","code":"reciprocal_trans()"},{"path":"https://scales.r-lib.org/dev/reference/reciprocal_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reciprocal transformation — reciprocal_trans","text":"","code":"plot(reciprocal_trans(), xlim = c(0, 1))"},{"path":"https://scales.r-lib.org/dev/reference/regular_minor_breaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Minor breaks — regular_minor_breaks","title":"Minor breaks — regular_minor_breaks","text":"Places minor breaks major breaks.","code":""},{"path":"https://scales.r-lib.org/dev/reference/regular_minor_breaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Minor breaks — regular_minor_breaks","text":"","code":"regular_minor_breaks(reverse = FALSE)"},{"path":"https://scales.r-lib.org/dev/reference/regular_minor_breaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Minor breaks — regular_minor_breaks","text":"reverse TRUE, calculates minor breaks reversed scale","code":""},{"path":"https://scales.r-lib.org/dev/reference/regular_minor_breaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Minor breaks — regular_minor_breaks","text":"","code":"m <- extended_breaks()(c(1, 10)) regular_minor_breaks()(m, c(1, 10), n = 2) #> [1] 0.00 1.25 2.50 3.75 5.00 6.25 7.50 8.75 10.00 n <- extended_breaks()(c(0, -9)) regular_minor_breaks(reverse = TRUE)(n, c(0, -9), n = 2) #> [1] -10.00 -8.75 -7.50 -6.25 -5.00 -3.75 -2.50 -1.25 0.00"},{"path":"https://scales.r-lib.org/dev/reference/rescale.html","id":null,"dir":"Reference","previous_headings":"","what":"Rescale continuous vector to have specified minimum and maximum — rescale","title":"Rescale continuous vector to have specified minimum and maximum — rescale","text":"Rescale continuous vector specified minimum maximum","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rescale continuous vector to have specified minimum and maximum — rescale","text":"","code":"rescale(x, to, from, ...) # S3 method for numeric rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for dist rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for logical rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for POSIXt rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for Date rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for integer64 rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE), ...) # S3 method for difftime rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for AsIs rescale(x, to, from, ...)"},{"path":"https://scales.r-lib.org/dev/reference/rescale.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rescale continuous vector to have specified minimum and maximum — rescale","text":"x continuous vector values manipulate. output range (numeric vector length two) input range (vector length two). given, calculated range x ... arguments passed methods","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Rescale continuous vector to have specified minimum and maximum — rescale","text":"Objects class returned unaltered.","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Rescale continuous vector to have specified minimum and maximum — rescale","text":"","code":"rescale(1:100) #> [1] 0.00000000 0.01010101 0.02020202 0.03030303 0.04040404 0.05050505 #> [7] 0.06060606 0.07070707 0.08080808 0.09090909 0.10101010 0.11111111 #> [13] 0.12121212 0.13131313 0.14141414 0.15151515 0.16161616 0.17171717 #> [19] 0.18181818 0.19191919 0.20202020 0.21212121 0.22222222 0.23232323 #> [25] 0.24242424 0.25252525 0.26262626 0.27272727 0.28282828 0.29292929 #> [31] 0.30303030 0.31313131 0.32323232 0.33333333 0.34343434 0.35353535 #> [37] 0.36363636 0.37373737 0.38383838 0.39393939 0.40404040 0.41414141 #> [43] 0.42424242 0.43434343 0.44444444 0.45454545 0.46464646 0.47474747 #> [49] 0.48484848 0.49494949 0.50505051 0.51515152 0.52525253 0.53535354 #> [55] 0.54545455 0.55555556 0.56565657 0.57575758 0.58585859 0.59595960 #> [61] 0.60606061 0.61616162 0.62626263 0.63636364 0.64646465 0.65656566 #> [67] 0.66666667 0.67676768 0.68686869 0.69696970 0.70707071 0.71717172 #> [73] 0.72727273 0.73737374 0.74747475 0.75757576 0.76767677 0.77777778 #> [79] 0.78787879 0.79797980 0.80808081 0.81818182 0.82828283 0.83838384 #> [85] 0.84848485 0.85858586 0.86868687 0.87878788 0.88888889 0.89898990 #> [91] 0.90909091 0.91919192 0.92929293 0.93939394 0.94949495 0.95959596 #> [97] 0.96969697 0.97979798 0.98989899 1.00000000 rescale(runif(50)) #> [1] 0.39420856 0.66935531 0.11640937 0.40330034 0.33654059 0.99494352 #> [7] 0.76271009 0.70998425 0.00000000 0.43729730 0.73922326 0.31947480 #> [13] 0.85245515 0.26309400 0.13713742 0.68603998 0.69772433 0.89189524 #> [19] 0.96277029 0.54202030 0.07529310 0.68519471 0.82954677 0.64289433 #> [25] 0.46068838 0.26006225 0.96731471 0.27559077 0.43033716 0.82798740 #> [31] 0.08380864 0.10013610 0.41428980 0.98047695 0.51891922 0.19856952 #> [37] 0.28768167 0.96209972 0.53464096 0.07325354 0.49223528 0.63137120 #> [43] 0.11800022 0.97893846 1.00000000 0.18599411 0.36719722 0.36477999 #> [49] 0.29788309 0.60650176 rescale(1) #> [1] 0.5"},{"path":"https://scales.r-lib.org/dev/reference/rescale_max.html","id":null,"dir":"Reference","previous_headings":"","what":"Rescale numeric vector to have specified maximum — rescale_max","title":"Rescale numeric vector to have specified maximum — rescale_max","text":"Rescale numeric vector specified maximum","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_max.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rescale numeric vector to have specified maximum — rescale_max","text":"","code":"rescale_max(x, to = c(0, 1), from = range(x, na.rm = TRUE))"},{"path":"https://scales.r-lib.org/dev/reference/rescale_max.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rescale numeric vector to have specified maximum — rescale_max","text":"x numeric vector values manipulate. output range (numeric vector length two) input range (numeric vector length two). given, calculated range x","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_max.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Rescale numeric vector to have specified maximum — rescale_max","text":"","code":"rescale_max(1:100) #> [1] 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12 0.13 #> [14] 0.14 0.15 0.16 0.17 0.18 0.19 0.20 0.21 0.22 0.23 0.24 0.25 0.26 #> [27] 0.27 0.28 0.29 0.30 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 #> [40] 0.40 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.50 0.51 0.52 #> [53] 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.60 0.61 0.62 0.63 0.64 0.65 #> [66] 0.66 0.67 0.68 0.69 0.70 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 #> [79] 0.79 0.80 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.90 0.91 #> [92] 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.00 rescale_max(runif(50)) #> [1] 0.90996289 0.25216964 0.15257142 0.65400914 0.68085877 0.06984956 #> [7] 0.82164775 0.37119430 0.92751808 0.79581876 0.72835150 0.06921417 #> [13] 0.40058184 0.28120119 0.61290125 0.20504491 0.64699384 0.22592742 #> [19] 0.78135249 0.43294132 0.34668315 0.68345365 0.54717946 0.33737163 #> [25] 0.73995474 0.69704911 0.93010761 0.95678170 0.72491203 0.92818696 #> [31] 0.78037694 1.00000000 0.42842897 0.94304249 0.52006318 0.87465284 #> [37] 0.03998167 0.37534339 0.97718812 0.17725302 0.34538623 0.72205975 #> [43] 0.97059012 0.44452590 0.63001834 0.06652080 0.43385183 0.15704666 #> [49] 0.23964440 0.74921839 rescale_max(1) #> [1] 1"},{"path":"https://scales.r-lib.org/dev/reference/rescale_mid.html","id":null,"dir":"Reference","previous_headings":"","what":"Rescale vector to have specified minimum, midpoint, and maximum — rescale_mid","title":"Rescale vector to have specified minimum, midpoint, and maximum — rescale_mid","text":"Rescale vector specified minimum, midpoint, maximum","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_mid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rescale vector to have specified minimum, midpoint, and maximum — rescale_mid","text":"","code":"rescale_mid(x, to, from, mid, ...) # S3 method for numeric rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for logical rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for dist rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for POSIXt rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid, ...) # S3 method for Date rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid, ...) # S3 method for integer64 rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for AsIs rescale_mid(x, to, from, ...)"},{"path":"https://scales.r-lib.org/dev/reference/rescale_mid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rescale vector to have specified minimum, midpoint, and maximum — rescale_mid","text":"x vector values manipulate. output range (numeric vector length two) input range (vector length two). given, calculated range x mid mid-point input range ... arguments passed methods","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_mid.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Rescale vector to have specified minimum, midpoint, and maximum — rescale_mid","text":"Objects class returned unaltered.","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_mid.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Rescale vector to have specified minimum, midpoint, and maximum — rescale_mid","text":"","code":"rescale_mid(1:100, mid = 50.5) #> [1] 0.00000000 0.01010101 0.02020202 0.03030303 0.04040404 0.05050505 #> [7] 0.06060606 0.07070707 0.08080808 0.09090909 0.10101010 0.11111111 #> [13] 0.12121212 0.13131313 0.14141414 0.15151515 0.16161616 0.17171717 #> [19] 0.18181818 0.19191919 0.20202020 0.21212121 0.22222222 0.23232323 #> [25] 0.24242424 0.25252525 0.26262626 0.27272727 0.28282828 0.29292929 #> [31] 0.30303030 0.31313131 0.32323232 0.33333333 0.34343434 0.35353535 #> [37] 0.36363636 0.37373737 0.38383838 0.39393939 0.40404040 0.41414141 #> [43] 0.42424242 0.43434343 0.44444444 0.45454545 0.46464646 0.47474747 #> [49] 0.48484848 0.49494949 0.50505051 0.51515152 0.52525253 0.53535354 #> [55] 0.54545455 0.55555556 0.56565657 0.57575758 0.58585859 0.59595960 #> [61] 0.60606061 0.61616162 0.62626263 0.63636364 0.64646465 0.65656566 #> [67] 0.66666667 0.67676768 0.68686869 0.69696970 0.70707071 0.71717172 #> [73] 0.72727273 0.73737374 0.74747475 0.75757576 0.76767677 0.77777778 #> [79] 0.78787879 0.79797980 0.80808081 0.81818182 0.82828283 0.83838384 #> [85] 0.84848485 0.85858586 0.86868687 0.87878788 0.88888889 0.89898990 #> [91] 0.90909091 0.91919192 0.92929293 0.93939394 0.94949495 0.95959596 #> [97] 0.96969697 0.97979798 0.98989899 1.00000000 rescale_mid(runif(50), mid = 0.5) #> [1] 0.34452385 0.63914002 0.26494808 0.70112701 0.21578626 0.64843385 #> [7] 0.60595484 0.89112367 0.85166760 0.81653556 0.54621678 0.43085156 #> [13] 0.69842320 0.33468166 0.62442328 0.43939962 0.89237127 0.55715633 #> [19] 0.69615512 0.04067676 0.38128547 0.60056953 0.43289440 0.32342231 #> [25] 0.52432800 0.78629430 0.38427329 0.91270870 0.77193855 0.45730293 #> [31] 0.52881642 0.82842972 0.14757170 0.20155017 0.36774229 0.00000000 #> [37] 0.08560456 0.13003248 0.78380793 0.62389790 0.59271872 0.79877982 #> [43] 0.04576317 0.89024866 0.68575724 0.44521443 0.82242402 0.40278808 #> [49] 0.49002454 0.40091980 rescale_mid(1) #> [1] 0.5"},{"path":"https://scales.r-lib.org/dev/reference/rescale_none.html","id":null,"dir":"Reference","previous_headings":"","what":"Don't perform rescaling — rescale_none","title":"Don't perform rescaling — rescale_none","text":"perform rescaling","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_none.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Don't perform rescaling — rescale_none","text":"","code":"rescale_none(x, ...)"},{"path":"https://scales.r-lib.org/dev/reference/rescale_none.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Don't perform rescaling — rescale_none","text":"x numeric vector values manipulate. ... arguments ignored","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_none.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Don't perform rescaling — rescale_none","text":"","code":"rescale_none(1:100) #> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #> [18] 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 #> [35] 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 #> [52] 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 #> [69] 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 #> [86] 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100"},{"path":"https://scales.r-lib.org/dev/reference/rescale_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Rescale palette (continuous) — rescale_pal","title":"Rescale palette (continuous) — rescale_pal","text":"Just rescales input specific output range. Useful alpha, size, continuous position.","code":""},{"path":"https://scales.r-lib.org/dev/reference/rescale_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rescale palette (continuous) — rescale_pal","text":"","code":"rescale_pal(range = c(0.1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/rescale_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rescale palette (continuous) — rescale_pal","text":"range Numeric vector length two, giving range possible values. 0 1.","code":""},{"path":"https://scales.r-lib.org/dev/reference/reverse_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Reverse transformation — reverse_trans","title":"Reverse transformation — reverse_trans","text":"reversing transformation works multiplying input -1. means reverse transformation easily composed transformations require positive input unless reversing done final step.","code":""},{"path":"https://scales.r-lib.org/dev/reference/reverse_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reverse transformation — reverse_trans","text":"","code":"reverse_trans()"},{"path":"https://scales.r-lib.org/dev/reference/reverse_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reverse transformation — reverse_trans","text":"","code":"plot(reverse_trans(), xlim = c(-1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/scales-package.html","id":null,"dir":"Reference","previous_headings":"","what":"scales: Scale Functions for Visualization — scales-package","title":"scales: Scale Functions for Visualization — scales-package","text":"Graphical scales map data aesthetics, provide methods automatically determining breaks labels axes legends.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/scales-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"scales: Scale Functions for Visualization — scales-package","text":"Maintainer: Thomas Lin Pedersen thomasp85@posit.co (ORCID) Authors: Hadley Wickham hadley@posit.co Dana Seidel contributors: Posit, PBC [copyright holder, funder]","code":""},{"path":"https://scales.r-lib.org/dev/reference/scientific_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_scientific() — scientific_format","title":"Superseded interface to label_scientific() — scientific_format","text":"functions kept backward compatibility; switch label_scientific() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/scientific_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_scientific() — scientific_format","text":"","code":"scientific_format( digits = 3, scale = 1, prefix = \"\", suffix = \"\", decimal.mark = \".\", trim = TRUE, ... ) scientific( x, digits = 3, scale = 1, prefix = \"\", suffix = \"\", decimal.mark = \".\", trim = TRUE, ... )"},{"path":"https://scales.r-lib.org/dev/reference/scientific_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_scientific() — scientific_format","text":"digits Number digits show exponent. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix, suffix Symbols display value. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). ... arguments passed base::format().","code":""},{"path":"https://scales.r-lib.org/dev/reference/seq_gradient_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Sequential colour gradient palette (continuous) — seq_gradient_pal","title":"Sequential colour gradient palette (continuous) — seq_gradient_pal","text":"Sequential colour gradient palette (continuous)","code":""},{"path":"https://scales.r-lib.org/dev/reference/seq_gradient_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sequential colour gradient palette (continuous) — seq_gradient_pal","text":"","code":"seq_gradient_pal(low = mnsl(\"10B 4/6\"), high = mnsl(\"10R 4/6\"), space = \"Lab\")"},{"path":"https://scales.r-lib.org/dev/reference/seq_gradient_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sequential colour gradient palette (continuous) — seq_gradient_pal","text":"low colour low end gradient. high colour high end gradient. space colour space calculate gradient. Must \"Lab\" - values deprecated.","code":""},{"path":"https://scales.r-lib.org/dev/reference/seq_gradient_pal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sequential colour gradient palette (continuous) — seq_gradient_pal","text":"","code":"x <- seq(0, 1, length.out = 25) show_col(seq_gradient_pal()(x)) show_col(seq_gradient_pal(\"white\", \"black\")(x)) library(munsell) show_col(seq_gradient_pal(\"white\", mnsl(\"10R 4/6\"))(x))"},{"path":"https://scales.r-lib.org/dev/reference/shape_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Shape palette (discrete) — shape_pal","title":"Shape palette (discrete) — shape_pal","text":"Shape palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/shape_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Shape palette (discrete) — shape_pal","text":"","code":"shape_pal(solid = TRUE)"},{"path":"https://scales.r-lib.org/dev/reference/shape_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shape palette (discrete) — shape_pal","text":"solid shapes solid ?","code":""},{"path":"https://scales.r-lib.org/dev/reference/show_col.html","id":null,"dir":"Reference","previous_headings":"","what":"Show colours — show_col","title":"Show colours — show_col","text":"quick dirty way show colours plot.","code":""},{"path":"https://scales.r-lib.org/dev/reference/show_col.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show colours — show_col","text":"","code":"show_col(colours, labels = TRUE, borders = NULL, cex_label = 1, ncol = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/show_col.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show colours — show_col","text":"colours character vector colours labels Label colour hex name? borders Border colour tile. Default uses par(\"fg\"). Use border = NA omit borders. cex_label Size printed labels, multiplier default size. ncol Number columns. supplied, tries square possible.","code":""},{"path":"https://scales.r-lib.org/dev/reference/show_col.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Show colours — show_col","text":"","code":"show_col(hue_pal()(9)) show_col(hue_pal()(9), borders = NA) show_col(viridis_pal()(16)) show_col(viridis_pal()(16), labels = FALSE)"},{"path":"https://scales.r-lib.org/dev/reference/sqrt_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Square-root transformation — sqrt_trans","title":"Square-root transformation — sqrt_trans","text":"variance stabilising transformation Poisson distribution.","code":""},{"path":"https://scales.r-lib.org/dev/reference/sqrt_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Square-root transformation — sqrt_trans","text":"","code":"sqrt_trans()"},{"path":"https://scales.r-lib.org/dev/reference/sqrt_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Square-root transformation — sqrt_trans","text":"","code":"plot(sqrt_trans(), xlim = c(0, 5))"},{"path":"https://scales.r-lib.org/dev/reference/time_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Transformation for date-times (class POSIXt) — time_trans","title":"Transformation for date-times (class POSIXt) — time_trans","text":"Transformation date-times (class POSIXt)","code":""},{"path":"https://scales.r-lib.org/dev/reference/time_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transformation for date-times (class POSIXt) — time_trans","text":"","code":"time_trans(tz = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/time_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Transformation for date-times (class POSIXt) — time_trans","text":"tz Optionally supply time zone. NULL, default, time zone extracted first input non-null tz.","code":""},{"path":"https://scales.r-lib.org/dev/reference/time_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Transformation for date-times (class POSIXt) — time_trans","text":"","code":"hours <- seq(ISOdate(2000, 3, 20, tz = \"\"), by = \"hour\", length.out = 10) t <- time_trans() t$transform(hours) #> [1] 953553600 953557200 953560800 953564400 953568000 953571600 953575200 #> [8] 953578800 953582400 953586000 t$inverse(t$transform(hours)) #> [1] \"2000-03-20 12:00:00 UTC\" \"2000-03-20 13:00:00 UTC\" #> [3] \"2000-03-20 14:00:00 UTC\" \"2000-03-20 15:00:00 UTC\" #> [5] \"2000-03-20 16:00:00 UTC\" \"2000-03-20 17:00:00 UTC\" #> [7] \"2000-03-20 18:00:00 UTC\" \"2000-03-20 19:00:00 UTC\" #> [9] \"2000-03-20 20:00:00 UTC\" \"2000-03-20 21:00:00 UTC\" t$format(t$breaks(range(hours))) #> [1] \"12:00\" \"15:00\" \"18:00\" \"21:00\""},{"path":"https://scales.r-lib.org/dev/reference/timespan_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Transformation for times (class hms) — timespan_trans","title":"Transformation for times (class hms) — timespan_trans","text":"timespan_trans() provides transformations data encoding time passed along breaks label formatting showing standard unit time fitting range data. hms_trans() provides using standard hms idioms formatting.","code":""},{"path":"https://scales.r-lib.org/dev/reference/timespan_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transformation for times (class hms) — timespan_trans","text":"","code":"timespan_trans(unit = c(\"secs\", \"mins\", \"hours\", \"days\", \"weeks\")) hms_trans()"},{"path":"https://scales.r-lib.org/dev/reference/timespan_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Transformation for times (class hms) — timespan_trans","text":"unit unit used interpret numeric input","code":""},{"path":"https://scales.r-lib.org/dev/reference/timespan_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Transformation for times (class hms) — timespan_trans","text":"","code":"# timespan_trans allows you to specify the time unit numeric data is # interpreted in min_trans <- timespan_trans(\"mins\") demo_timespan(seq(0, 100), trans = min_trans) #> scale_x_continuous(trans = min_trans) # Input already in difftime format is interpreted correctly demo_timespan(as.difftime(seq(0, 100), units = \"secs\"), trans = min_trans) #> scale_x_continuous(trans = min_trans) if (require(\"hms\")) { # hms_trans always assumes seconds hms <- round(runif(10) * 86400) t <- hms_trans() t$transform(hms) t$inverse(t$transform(hms)) t$breaks(hms) # The break labels also follow the hms format demo_timespan(hms, trans = t) } #> Loading required package: hms #> scale_x_continuous(trans = t)"},{"path":"https://scales.r-lib.org/dev/reference/train_continuous.html","id":null,"dir":"Reference","previous_headings":"","what":"Train (update) a continuous scale — train_continuous","title":"Train (update) a continuous scale — train_continuous","text":"Strips attributes always returns numeric vector","code":""},{"path":"https://scales.r-lib.org/dev/reference/train_continuous.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Train (update) a continuous scale — train_continuous","text":"","code":"train_continuous(new, existing = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/train_continuous.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Train (update) a continuous scale — train_continuous","text":"new New data add scale existing Optional existing scale update","code":""},{"path":"https://scales.r-lib.org/dev/reference/train_discrete.html","id":null,"dir":"Reference","previous_headings":"","what":"Train (update) a discrete scale — train_discrete","title":"Train (update) a discrete scale — train_discrete","text":"Train (update) discrete scale","code":""},{"path":"https://scales.r-lib.org/dev/reference/train_discrete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Train (update) a discrete scale — train_discrete","text":"","code":"train_discrete(new, existing = NULL, drop = FALSE, na.rm = FALSE)"},{"path":"https://scales.r-lib.org/dev/reference/train_discrete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Train (update) a discrete scale — train_discrete","text":"new New data add scale existing Optional existing scale update drop TRUE, drop factor levels associated data na.rm TRUE, remove missing values","code":""},{"path":"https://scales.r-lib.org/dev/reference/trans_breaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Pretty breaks on transformed scale — trans_breaks","title":"Pretty breaks on transformed scale — trans_breaks","text":"often produce attractive breaks.","code":""},{"path":"https://scales.r-lib.org/dev/reference/trans_breaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pretty breaks on transformed scale — trans_breaks","text":"","code":"trans_breaks(trans, inv, n = 5, ...)"},{"path":"https://scales.r-lib.org/dev/reference/trans_breaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pretty breaks on transformed scale — trans_breaks","text":"trans function single variable, x, given numeric vector returns transformed values inv inverse transformation function n desired number ticks ... arguments passed pretty","code":""},{"path":"https://scales.r-lib.org/dev/reference/trans_breaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pretty breaks on transformed scale — trans_breaks","text":"","code":"trans_breaks(\"log10\", function(x) 10^x)(c(1, 1e6)) #> [1] 1e+00 1e+01 1e+02 1e+03 1e+04 1e+05 1e+06 trans_breaks(\"sqrt\", function(x) x^2)(c(1, 100)) #> [1] 0 4 16 36 64 100 trans_breaks(function(x) 1 / x, function(x) 1 / x)(c(1, 100)) #> [1] Inf 5.000000 2.500000 1.666667 1.250000 1.000000 trans_breaks(function(x) -x, function(x) -x)(c(1, 100)) #> [1] 100 80 60 40 20 0"},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/trans_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format labels after transformation — trans_format","text":"","code":"trans_format(trans, format = scientific_format())"},{"path":"https://scales.r-lib.org/dev/reference/trans_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format labels after transformation — trans_format","text":"trans transformation apply format additional formatter apply transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/trans_format.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format labels after transformation — trans_format","text":"function single parameter x, numeric vector, returns character vector list expressions","code":""},{"path":"https://scales.r-lib.org/dev/reference/trans_format.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Format labels after transformation — trans_format","text":"","code":"tf <- trans_format(\"log10\", scientific_format()) tf(10^1:6) #> [1] \"1.00e+00\" \"9.54e-01\" \"9.03e-01\" \"8.45e-01\" \"7.78e-01\""},{"path":"https://scales.r-lib.org/dev/reference/trans_new.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new transformation object — trans_new","title":"Create a new transformation object — trans_new","text":"transformation encapsulates transformation inverse, well information needed create pleasing breaks labels. breaks() function applied un-transformed range data, format() function takes output breaks() function returns well-formatted labels. Transformations may also include derivatives transformation inverse, required .","code":""},{"path":"https://scales.r-lib.org/dev/reference/trans_new.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new transformation object — trans_new","text":"","code":"trans_new( name, transform, inverse, d_transform = NULL, d_inverse = NULL, breaks = extended_breaks(), minor_breaks = regular_minor_breaks(), format = format_format(), domain = c(-Inf, Inf) ) is.trans(x) as.trans(x, arg = deparse(substitute(x)))"},{"path":"https://scales.r-lib.org/dev/reference/trans_new.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new transformation object — trans_new","text":"name transformation name transform function, name function, performs transformation inverse function, name function, performs inverse transformation d_transform Optional function, name function, gives derivative transformation. May NULL. d_inverse Optional function, name function, gives derivative inverse transformation. May NULL. breaks default breaks function transformation. breaks function applied un-transformed data. minor_breaks default minor breaks function transformation. format default format transformation. format applied breaks generated un-transformed data. domain allowed range data transformed. function transform argument expected able transform domain argument.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/trans_range.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute range of transformed values — trans_range","title":"Compute range of transformed values — trans_range","text":"Silently drops ranges outside domain trans.","code":""},{"path":"https://scales.r-lib.org/dev/reference/trans_range.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute range of transformed values — trans_range","text":"","code":"trans_range(trans, x)"},{"path":"https://scales.r-lib.org/dev/reference/trans_range.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute range of transformed values — trans_range","text":"trans transformation object, name transformation object given string. x numeric vector compute range ","code":""},{"path":"https://scales.r-lib.org/dev/reference/unit_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Unit labels — unit_format","title":"Unit labels — unit_format","text":"function kept backward compatiblity; either use label_number() label_number_si() instead.","code":""},{"path":"https://scales.r-lib.org/dev/reference/unit_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Unit labels — unit_format","text":"","code":"unit_format( accuracy = NULL, scale = 1, prefix = \"\", unit = \"m\", sep = \" \", suffix = paste0(sep, unit), big.mark = \" \", decimal.mark = \".\", trim = TRUE, ... )"},{"path":"https://scales.r-lib.org/dev/reference/unit_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Unit labels — unit_format","text":"accuracy number round . Use (e.g.) 0.01 show 2 decimal places precision. NULL, default, uses heuristic ensure breaks minimum number digits needed show difference adjacent values. Applied rescaled data. scale scaling factor: x multiplied scale formatting. useful underlying data small large. prefix Additional text display number. suffix applied absolute value style_positive style_negative processed prefix = \"$\" yield (e.g.) -$1 ($1). unit units append. sep separator number unit label. suffix Additional text display number. big.mark Character used every 3 digits separate thousands. decimal.mark character used indicate numeric decimal point. trim Logical, FALSE, values right-justified common width (see base::format()). ... arguments passed base::format().","code":""},{"path":"https://scales.r-lib.org/dev/reference/unit_format.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Unit labels — unit_format","text":"","code":"# Label with units demo_continuous(c(0, 1), labels = unit_format(unit = \"m\")) #> scale_x_continuous(labels = unit_format(unit = \"m\")) # Labels in kg, but original data in g km <- unit_format(unit = \"km\", scale = 1e-3, digits = 2) demo_continuous(c(0, 2500), labels = km) #> scale_x_continuous(labels = km)"},{"path":"https://scales.r-lib.org/dev/reference/viridis_pal.html","id":null,"dir":"Reference","previous_headings":"","what":"Viridis palette — viridis_pal","title":"Viridis palette — viridis_pal","text":"Viridis palette","code":""},{"path":"https://scales.r-lib.org/dev/reference/viridis_pal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Viridis palette — viridis_pal","text":"","code":"viridis_pal(alpha = 1, begin = 0, end = 1, direction = 1, option = \"D\")"},{"path":"https://scales.r-lib.org/dev/reference/viridis_pal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Viridis palette — viridis_pal","text":"alpha alpha transparency, number [0,1], see argument alpha hsv. begin, end (corrected) hue [0,1] color map begins ends. direction Sets order colors scale. 1, default, colors ordered darkest lightest. -1, order colors reversed. option character string indicating color map option use. Eight options available: \"magma\" (\"\") \"inferno\" (\"B\") \"plasma\" (\"C\") \"viridis\" (\"D\") \"cividis\" (\"E\") \"rocket\" (\"F\") \"mako\" (\"G\") \"turbo\" (\"H\")","code":""},{"path":"https://scales.r-lib.org/dev/reference/viridis_pal.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Viridis palette — viridis_pal","text":"https://bids.github.io/colormap/","code":""},{"path":"https://scales.r-lib.org/dev/reference/viridis_pal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Viridis palette — viridis_pal","text":"","code":"show_col(viridis_pal()(10)) show_col(viridis_pal(direction = -1)(6)) show_col(viridis_pal(begin = 0.2, end = 0.8)(4)) show_col(viridis_pal(option = \"plasma\")(6))"},{"path":"https://scales.r-lib.org/dev/reference/wrap_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Superseded interface to label_wrap() — wrap_format","title":"Superseded interface to label_wrap() — wrap_format","text":"functions kept backward compatibility; switch label_wrap() new code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/wrap_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Superseded interface to label_wrap() — wrap_format","text":"","code":"wrap_format(width)"},{"path":"https://scales.r-lib.org/dev/reference/wrap_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Superseded interface to label_wrap() — wrap_format","text":"width Number characters per line.","code":""},{"path":"https://scales.r-lib.org/dev/reference/yj_trans.html","id":null,"dir":"Reference","previous_headings":"","what":"Yeo-Johnson transformation — yj_trans","title":"Yeo-Johnson transformation — yj_trans","text":"Yeo-Johnson transformation flexible transformation similiar Box-Cox, boxcox_trans(), require input values greater zero.","code":""},{"path":"https://scales.r-lib.org/dev/reference/yj_trans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Yeo-Johnson transformation — yj_trans","text":"","code":"yj_trans(p)"},{"path":"https://scales.r-lib.org/dev/reference/yj_trans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Yeo-Johnson transformation — yj_trans","text":"p Transformation exponent, \\(\\lambda\\).","code":""},{"path":"https://scales.r-lib.org/dev/reference/yj_trans.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Yeo-Johnson transformation — yj_trans","text":"transformation takes one four forms depending values y \\(\\lambda\\). \\(y \\ge 0\\) \\(\\lambda \\neq 0\\) : \\(y^{(\\lambda)} = \\frac{(y + 1)^\\lambda - 1}{\\lambda}\\) \\(y \\ge 0\\) \\(\\lambda = 0\\): \\(y^{(\\lambda)} = \\ln(y + 1)\\) \\(y < 0\\) \\(\\lambda \\neq 2\\): \\(y^{(\\lambda)} = -\\frac{(-y + 1)^{(2 - \\lambda)} - 1}{2 - \\lambda}\\) \\(y < 0\\) \\(\\lambda = 2\\): \\(y^{(\\lambda)} = -\\ln(-y + 1)\\)","code":""},{"path":"https://scales.r-lib.org/dev/reference/yj_trans.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Yeo-Johnson transformation — yj_trans","text":"Yeo, ., & Johnson, R. (2000). New Family Power Transformations Improve Normality Symmetry. Biometrika, 87(4), 954-959. https://www.jstor.org/stable/2673623","code":""},{"path":"https://scales.r-lib.org/dev/reference/yj_trans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Yeo-Johnson transformation — yj_trans","text":"","code":"plot(yj_trans(-1), xlim = c(-10, 10)) plot(yj_trans(0), xlim = c(-10, 10)) plot(yj_trans(1), xlim = c(-10, 10)) plot(yj_trans(2), xlim = c(-10, 10))"},{"path":"https://scales.r-lib.org/dev/reference/zero_range.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine if range of vector is close to zero, with a specified tolerance — zero_range","title":"Determine if range of vector is close to zero, with a specified tolerance — zero_range","text":"machine epsilon difference 1.0 next number can represented machine. default, function uses epsilon * 1000 tolerance. First scales values mean 1, checks difference larger tolerance.","code":""},{"path":"https://scales.r-lib.org/dev/reference/zero_range.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine if range of vector is close to zero, with a specified tolerance — zero_range","text":"","code":"zero_range(x, tol = 1000 * .Machine$double.eps)"},{"path":"https://scales.r-lib.org/dev/reference/zero_range.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine if range of vector is close to zero, with a specified tolerance — zero_range","text":"x numeric range: vector length 2 tol value specifying tolerance.","code":""},{"path":"https://scales.r-lib.org/dev/reference/zero_range.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine if range of vector is close to zero, with a specified tolerance — zero_range","text":"logical TRUE relative difference endpoints range distinguishable 0.","code":""},{"path":"https://scales.r-lib.org/dev/reference/zero_range.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Determine if range of vector is close to zero, with a specified tolerance — zero_range","text":"","code":"eps <- .Machine$double.eps zero_range(c(1, 1 + eps)) #> [1] TRUE zero_range(c(1, 1 + 99 * eps)) #> [1] TRUE zero_range(c(1, 1 + 1001 * eps)) #> [1] FALSE zero_range(c(1, 1 + 2 * eps), tol = eps) #> [1] FALSE # Scaling up or down all the values has no effect since the values # are rescaled to 1 before checking against tol zero_range(100000 * c(1, 1 + eps)) #> [1] TRUE zero_range(100000 * c(1, 1 + 1001 * eps)) #> [1] FALSE zero_range(.00001 * c(1, 1 + eps)) #> [1] TRUE zero_range(.00001 * c(1, 1 + 1001 * eps)) #> [1] FALSE # NA values zero_range(c(1, NA)) # NA #> [1] NA zero_range(c(1, NaN)) # NA #> [1] NA # Infinite values zero_range(c(1, Inf)) # FALSE #> [1] FALSE zero_range(c(-Inf, Inf)) # FALSE #> [1] FALSE zero_range(c(Inf, Inf)) # TRUE #> [1] TRUE"},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-development-version","dir":"Changelog","previous_headings":"","what":"scales (development version)","title":"scales (development version)","text":"train_continuous() coerces new numeric calculating range (@teunbrand, #369). Training factor data longer sorts range multiple training passes (#383) Attempt make sort behavior range consistent character vectors training. Mixing character factor data still lead different results depending training order. Add rescale method difftime objects (#382) rescale((x), ...) rescale_mid((x), ...) return (x) unaltered (@teunbrand, #403). scale_cut argument number() now works advertised values lowest cut value (#346) Added new option style_positive argument label_*() functions. Setting \"space\" add figure space front number make easier align positive negative values figure space takes amount space - (#366) label_dollar() superseeded label_currency() clarity (#344) sqrt_trans() longer returns inverse values outside domain (#214) Add better support difftime objects. label_timespan() adds functionality adding correct unit suffix timespan data, breaks_timespan() adds functionality finding pleasant breakpoints across various bases time units, timespan_trans() wraps together provides alternative hms_trans() (#212) Add inverse (area) hyperbolic sine transformation asinh_trans(), provides logarithm-like transformation space, accommodates negative values (#297) Transformation objects can optionally include derivatives transform inverse transform (@mjskay, #322).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-121","dir":"Changelog","previous_headings":"","what":"scales 1.2.1","title":"scales 1.2.1","text":"CRAN release: 2022-08-19 Re-document fix HTML issues .Rd.","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-120","dir":"Changelog","previous_headings":"","what":"scales 1.2.0","title":"scales 1.2.0","text":"CRAN release: 2022-04-13","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"new-features-1-2-0","dir":"Changelog","previous_headings":"","what":"New features","title":"scales 1.2.0","text":"label_number(): New style_positive style_negative argument control positive negative numbers styled (#249, #262). prefix comes negative sign, rather , yielding (e.g) correct -$1 instead $-1. New scale_cut argument enables independent scaling different parts range. useful label_dollar() support scaling large numbers suffix (e.g. “M” million, “B” billion). can used cut_short_scale() billion = thousand million cut_long_scale() billion = million million (initial implementation provided @davidchall). Additionally, accuracy now computed per scale category, rescaled values can different numbers decimal places (#339). label_number_si() deprecated previously used short scale abbreviations instead correct SI prefixes. can mimic previous results label_number(scale_cut = cut_scale_short()) get real SI labels label_number(scale_cut = cut_SI(\"m\")) (#339, help @davidchall). label_bytes() now correctly accounts scale argument choosing auto units (@davidchall, #235). label_date() label_time() gain locale argument allows set locale used generate day month names (#309). New label_log() displays base superscript exponent, use logarithmic axes (@davidchall, #312). New compose_trans() allows arbitrary composition transformers. mostly easily achieved passing character vector whenever might previously passed name single transformer. example, scale_y_continuous(trans = c(\"log10\", \"reverse\")) create reverse log-10 scale (#287).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"bug-fixes-and-minor-improvements-1-2-0","dir":"Changelog","previous_headings":"","what":"Bug fixes and minor improvements","title":"scales 1.2.0","text":"breaks_width() now supports units like \"3 months\" offset argument. col_quantile() longer errors data sufficiently skewed can’t generate requested number unique colours (#294). dollar(negative_parens) deprecated favour style_negative = \"parens\". hue_pal() respects h.start (#288). label_number_auto() correctly formats single numbers greater 1e+06 without error (@karawoo, #321) manual_pal() now always returns unnamed colour vector, easy use ggplot2::discrete_scale() (@yutannihilation, #284). time_trans() date_trans() domains correct type can transformed without error (#298). Internal precision(), used accuracy = NULL, now avoids displaying unnecessary digits (@davidchall, #304).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-111","dir":"Changelog","previous_headings":"","what":"scales 1.1.1","title":"scales 1.1.1","text":"CRAN release: 2020-05-11 breaks_width() now handles difftime/hms objects (@bhogan-mitre, #244). hue_pal() now correctly inverts color palettes direction = -1 (@dpseidel, #252). Internal precision(), used accuracy = NULL, now better job duplicate values present (@teunbrand, #251). also better job ’s mix finite non-finite values (#257). New oob_keep() keep data outside range, allowing zoom-limits oob_keep used oob argument scales. Existing bounds functions renamed oob_-prefix indicate role (@teunbrand, #255). ordinal_french() gains plural gender arguments (@stephLH, #256).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-110","dir":"Changelog","previous_headings":"","what":"scales 1.1.0","title":"scales 1.1.0","text":"CRAN release: 2019-11-18 Axis breaks labels new naming scheme: functions generate breaks limits called breaks_; functions generate labels breaks called labels_ (#226). breaks labels examples overhauled use new demo_continuous(), demo_discrete(), demo_log10(), can see use scales functions ggplot2.","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"labels-1-1-0","dir":"Changelog","previous_headings":"","what":"Labels","title":"scales 1.1.0","text":"label functions preserve names (#202) keep NAs NAs instead trying convert \"NA\" (@clauswilke, #187). New label_bytes() replaces number_bytes_format() convenient interface. takes single unit argument can either SI unit (e.g. “kB”), binary unit (e.g. “kIB”), automatic unit (either “auto_si” “auto_binary”). always uses “B” symbol bytes (#174), checks units valid. Additionally, auto units now used determine symbol separately value (@mikmart): New label_date_short() creates labels date axis show components date changed since previous label. example, Jan 10, Jan 20, Jan 30, Feb 1, label_date_short() use labels Jan 10, 20, 30, Feb 1 (#209). label_dollar() now correctly formats negative numbers (e.g.) -$200 (#216). label_math() now returns expression vector, doesn’t coerce inputs names. label_number() takes scale account computing accuracy, supplied. means label_percent() better default accuracy many cases (#192). label_number() now picks accuracy automatically default. underlying heuristic improved use distance adjacent breaks (rather total range break). New label_number_auto() automatically picks number_format() scientific_format() based range input. produce nice output wide range inputs (@paleolimbot, #208). New label_number_si() formats numeric vectors limited SI units. Individual values scaled labelled abbreviations “K”, “M”, “B”, “T” dependent magnitude (@dpseidel, #83). label_parse() now generates expression object can used display formatted labels ggplot2 (@agila5, #203). label_pvalue() now reports values close 1 (determined accuracy) (e.g.) “>0.99”. can control prefixes used new prefix argument (#213).","code":"label_bytes(\"auto_binary\")(1024^(1:3)) #> [1] \"1 kiB\" \"1 MiB\" \"1 GiB\""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"breaks-1-1-0","dir":"Changelog","previous_headings":"","what":"Breaks","title":"scales 1.1.0","text":"built breaks functions now returns function takes range desired number breaks, making possible overwrite defaults number desired breaks given constructor call (@thomasp85). breaks_log() nicer behaviour finite inputs (#210). also provides usable breaks even small ranges (@billdenney, #168) New breaks_width() allows specify fixed distance breaks (along optional offset).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"transformations-1-1-0","dir":"Changelog","previous_headings":"","what":"Transformations","title":"scales 1.1.0","text":"New yj_trans() implements Yeo-Johnson transformation (@zamorarr, #196) trans objects gets methods plot() lines(), numeric transformations get example showing transformation. boxcox_trans() longer throws error given NA values (@sflippl, #181).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"other-bug-fixes-and-minor-improvements-1-1-0","dir":"Changelog","previous_headings":"","what":"Other bug fixes and minor improvements","title":"scales 1.1.0","text":"scales now uses farver package colour manipulation instead combination grDevices hand-rolled C++ code (#223). alpha() now preserves element names (@wibeasley, #195) ContinuousRange DiscreteRange methods now properly inherit fully mutable (@dpseidel). col_numeric(), col_bin(), col_quantile(), col_factor() now support viridis colors. Just pass palette name (\"magma\", \"inferno\", \"plasma\", \"viridis\") palette argument (@jcheng5, #191). col_numeric(), col_bin(), col_quantile(), col_factor() now reverse parameter, apply color palettes opposite usual order (.e. high--low instead low--high) (@jcheng5, #191). col_bin() col_quantile() now take right argument, passed base::cut(); indicates whether bin/quantile intervals closed right (open left), vice versa (@jcheng5, #191). col_factor() now tries avoid interpolating qualitative RColorBrewer palettes. Instead, attempts assign palette color factor level. Interpolation still used factor levels available colors, warning emitted case (@jcheng5, #191). dichromat_pal() documentation now builds without requiring suggested dichromat package installed (@dpseidel, #172). date_breaks() now supports subsecond intervals (@dpseidel, #85).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-100","dir":"Changelog","previous_headings":"","what":"scales 1.0.0","title":"scales 1.0.0","text":"CRAN release: 2018-08-09","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"formatters-1-0-0","dir":"Changelog","previous_headings":"New Features","what":"Formatters","title":"scales 1.0.0","text":"comma_format(), percent_format() unit_format() gain new arguments: accuracy, scale, prefix, suffix, decimal.mark, big.mark (@larmarange, #146). dollar_format() gains new arguments: accuracy, scale, decimal.mark, trim (@larmarange, #148). New number_bytes_format() number_bytes() format numeric vectors byte measurements (@hrbrmstr, @dpseidel). New number_format() provides generic formatter numbers (@larmarange, #142). New pvalue_format() formats p-values (@larmarange, #145). ordinal_format() gains new arguments: prefix, suffix, big.mark, rules; rules French Spanish also provided (@larmarange, #149). scientific_format() gains new arguments: scale, prefix, suffix, decimal.mark, trim (@larmarange, #147). New time_format() formats POSIXt hms objects (@dpseidel, #88).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"transformations--breaks-1-0-0","dir":"Changelog","previous_headings":"New Features","what":"Transformations & breaks","title":"scales 1.0.0","text":"boxcox_trans() now invertible x >= 0 requires positive values. new argument offset allows specification type-1 type-2 Box-Cox transformations (@dpseidel, #103). log_breaks() returns integer multiples integer powers base finer breaks needed (@ThierryO, #117). New function modulus_trans() implements modulus transformation positive negative values (@dpseidel). New pseudo_log_trans() transforming numerics signed logarithmic scale smooth transition linear scale around 0 (@lepennec, #106).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"minor-bug-fixes-and-improvements-1-0-0","dir":"Changelog","previous_headings":"","what":"Minor bug fixes and improvements","title":"scales 1.0.0","text":"scales functions now work expected used inside loop. previous package versions scales function used variable custom parameters inside loop, parameters evaluated end loop, due R lazy evaluation works (@zeehio, #81). colour_ramp() now uses alpha = TRUE default (@clauswilke, #108). date_breaks() now supports subsecond intervals (@dpseidel, #85). Removes dichromat plyr dependencies. dichromat now suggested (@dpseidel, #118). expand_range() arguments mul add now affect scales range 0 (@dpseidel, ggplot2-2281). extended_breaks() now allows user specification labeling::extended() argument .loose permit flexible breaks specification (@dpseidel, #99). New rescale() rescale_mid() methods support dist objects (@zeehio, #105). rescale_mid() now properly handles NAs (@foo-bar-baz-qux, #104).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-050","dir":"Changelog","previous_headings":"","what":"scales 0.5.0","title":"scales 0.5.0","text":"CRAN release: 2017-08-24 New function regular_minor_breaks() calculates minor breaks property transformation (@karawoo). Adds viridis_pal() creating palettes color maps viridisLite package (@karawoo). Switched reference classes R6 (#96). rescale() rescale_mid() now S3 generics, work numeric, Date, POSIXct, POSIXlt bit64::integer64 objects (@zeehio, #74).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-041","dir":"Changelog","previous_headings":"","what":"scales 0.4.1","title":"scales 0.4.1","text":"CRAN release: 2016-11-09 extended_breaks() longer fails pathological inputs. New hms_trans() transforming hms time vectors. train_discrete() gets new na.rm argument controls whether NAs preserved dropped.","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-040","dir":"Changelog","previous_headings":"","what":"scales 0.4.0","title":"scales 0.4.0","text":"CRAN release: 2016-02-26 Switched NEWS NEWS.md. manual_pal() produces warning n greater number values palette (@jrnold, #68). precision(0) now returns 1, means percent(0) now returns 0% (#50). scale_continuous() uses correct check numeric values. NaN correctly recognised missing value gradient palettes (ggplot2-1482).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-030","dir":"Changelog","previous_headings":"","what":"scales 0.3.0","title":"scales 0.3.0","text":"CRAN release: 2015-08-25 rescale() preserves missing values input range x (effectively) 0 (ggplot2-985). Continuous colour palettes now use colour_ramp() instead colorRamp(). supports interpolation Lab colour space, hundreds times faster.","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-025","dir":"Changelog","previous_headings":"","what":"scales 0.2.5","title":"scales 0.2.5","text":"CRAN release: 2015-06-12","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"improved-formatting-functions-0-2-5","dir":"Changelog","previous_headings":"","what":"Improved formatting functions","title":"scales 0.2.5","text":"date_format() gains option specify time zone (#51). dollar_format() now flexible can add either prefixes suffixes different currencies (#53). gains negative_parens argument show negative values ($100) now passes missing values unchanged (@dougmitarotonda, #40). New ordinal_format() generates ordinal numbers (1st, 2nd, etc) (@aaronwolen, #55). New unit_format() makes easier add units labels, optionally scaling (@ThierryO, #46). New wrap_format() function wrap character vectors desired width. (@jimhester, #37).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"new-colour-scaling-functions-0-2-5","dir":"Changelog","previous_headings":"","what":"New colour scaling functions","title":"scales 0.2.5","text":"New color scaling functions col_numeric(), col_bin(), col_quantile(), col_factor(). functions provide concise ways map continuous categorical values color spectra. New colour_ramp() function performing color interpolation CIELAB color space (like grDevices::colorRamp(space = 'Lab'), much faster).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"other-bug-fixes-and-minor-improvements-0-2-5","dir":"Changelog","previous_headings":"","what":"Other bug fixes and minor improvements","title":"scales 0.2.5","text":"boxcox_trans() returns correct value p close zero (#31). dollar() percent() correctly return zero length string zero length input (@BrianDiggs, #35). brewer_pal() gains direction argument easily invert order colours (@jiho, #36). show_col() additional options showcase colors better (@jiho, #52). Relaxed tolerance zero_range() .Machine$double.eps * 1000 (#33).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-024","dir":"Changelog","previous_headings":"","what":"scales 0.2.4","title":"scales 0.2.4","text":"CRAN release: 2014-04-22 Eliminate stringr dependency. Fix outstanding errors R CMD check.","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-023","dir":"Changelog","previous_headings":"","what":"scales 0.2.3","title":"scales 0.2.3","text":"CRAN release: 2012-12-05 floor_time() calls to_time(), function moved function longer available scales namespace. Now floor_time() copy function (Thanks Stefan Novak). Color palettes generated brewer_pal() longer give warnings fewer 3 colors requested (@wch). abs_area() rescale_max() functions added, scaling area points proportional value. used scale_size_area() ggplot2.","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-022","dir":"Changelog","previous_headings":"","what":"scales 0.2.2","title":"scales 0.2.2","text":"CRAN release: 2012-09-04 zero_range() improved behaviour thanks Brian Diggs. brewer_pal() complains give incorrect palette type. (Fixes #15, thanks Jean-Olivier Irisson). shape_pal() warns asked 6 values. (Fixes #16, thanks Jean-Olivier Irisson). time_trans() gains optional argument tz specify time zone use times. specified, guess first input non-null time zone. date_trans() time_trans() now check inputs correct type. prevents ggplot2 scales silently giving incorrect outputs given incorrect inputs. Change default breaks algorithm cbreaks() trans_new(). Previously pretty_breaks(), now ’s extended_breaks(), uses extended() algorithm labeling package. fixed namespace problem fullseq().","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-021","dir":"Changelog","previous_headings":"","what":"scales 0.2.1","title":"scales 0.2.1","text":"CRAN release: 2012-05-08 suppressWarnings train_continuous() zero-row infinite data frames don’t potentially cause problems. check zero-length colour gradient_n_pal(). added extended_breaks() implements extension Wilkinson’s labelling approach, implemented labeling package. generally produce nicer breaks pretty_breaks(). alpha() can now preserve existing alpha values alpha() missing. log_breaks() always gives breaks evenly spaced log scale, never evenly spaced data scale. result really bad breaks ranges (e.g 0.5-0.6), probably shouldn’t using log scales situation anyway.","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-020","dir":"Changelog","previous_headings":"","what":"scales 0.2.0","title":"scales 0.2.0","text":"CRAN release: 2012-02-27 censor() squish() gain .finite argument default operating finite values. needed ggplot2, reflects use Inf -Inf special values. bounds functions now force evaluation range avoid bug S3 method dispatch inside primitive functions (e.g. [). Simplified algorithm discrete_range() robust stringsAsFactors global option. Now, order factor preserved full factor first object seen, subsequent inputs subsets levels original factor. scientific() ensures output always scientific format specified number significant digits. comma() ensures output never scientific format (Fixes #7). Another tweak zero_range() better detect range zero length (Fixes #6).","code":""}]