From 80185214533b9437b10bcdd2aab1bfe2e03bbc08 Mon Sep 17 00:00:00 2001 From: thomasp85 Date: Fri, 25 Oct 2024 13:08:53 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20r-lib/sc?= =?UTF-8?q?ales@4a95f277767e29b080eb0c4e815e360cdbf983fd=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev/pkgdown.yml | 2 +- dev/reference/breaks_exp.html | 7 +++++++ dev/reference/breaks_extended.html | 7 +++++++ dev/reference/breaks_log.html | 7 +++++++ dev/reference/breaks_pretty.html | 7 +++++++ dev/reference/breaks_timespan.html | 7 +++++++ dev/reference/breaks_width.html | 7 +++++++ dev/reference/compose_label.html | 9 +++++++-- dev/reference/get_palette.html | 8 ++++---- dev/reference/label_bytes.html | 9 +++++++-- dev/reference/label_dictionary.html | 9 +++++++-- dev/reference/label_glue.html | 9 +++++++-- dev/reference/label_number_auto.html | 10 ++++++++++ dev/reference/new_continuous_palette.html | 4 ++-- dev/search.json | 2 +- 15 files changed, 88 insertions(+), 16 deletions(-) diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index a6376a21..6bf9a878 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 3.1.11 pkgdown: 2.1.1 pkgdown_sha: ~ articles: {} -last_built: 2024-10-25T12:50Z +last_built: 2024-10-25T13:07Z urls: reference: https://scales.r-lib.org/reference article: https://scales.r-lib.org/articles diff --git a/dev/reference/breaks_exp.html b/dev/reference/breaks_exp.html index dfaf36b4..197f680c 100644 --- a/dev/reference/breaks_exp.html +++ b/dev/reference/breaks_exp.html @@ -69,6 +69,13 @@

Argumentslabeling::extended()

+
+

Value

+

All breaks_() functions return a function for generating breaks. These +functions takes, as their first argument a vector of values that represent +the data range to provide breaks for. Some will optionally take a second +argument that allows you to specify the number of breaks to recieve.

+

Examples

diff --git a/dev/reference/breaks_extended.html b/dev/reference/breaks_extended.html index 3fa85790..216edf9a 100644 --- a/dev/reference/breaks_extended.html +++ b/dev/reference/breaks_extended.html @@ -66,6 +66,13 @@

Argumentslabeling::extended()

+
+

Value

+

All breaks_() functions return a function for generating breaks. These +functions takes, as their first argument a vector of values that represent +the data range to provide breaks for. Some will optionally take a second +argument that allows you to specify the number of breaks to recieve.

+

References

Talbot, J., Lin, S., Hanrahan, P. (2010) An Extension of diff --git a/dev/reference/breaks_log.html b/dev/reference/breaks_log.html index d727e270..dfd54af8 100644 --- a/dev/reference/breaks_log.html +++ b/dev/reference/breaks_log.html @@ -71,6 +71,13 @@

Arguments +

Value

+

All breaks_() functions return a function for generating breaks. These +functions takes, as their first argument a vector of values that represent +the data range to provide breaks for. Some will optionally take a second +argument that allows you to specify the number of breaks to recieve.

+

Details

The algorithm starts by looking for a set of integer powers of base that diff --git a/dev/reference/breaks_pretty.html b/dev/reference/breaks_pretty.html index 25a06282..483aea0a 100644 --- a/dev/reference/breaks_pretty.html +++ b/dev/reference/breaks_pretty.html @@ -69,6 +69,13 @@

Argumentspretty()

+
+

Value

+

All breaks_() functions return a function for generating breaks. These +functions takes, as their first argument a vector of values that represent +the data range to provide breaks for. Some will optionally take a second +argument that allows you to specify the number of breaks to recieve.

+

Examples

diff --git a/dev/reference/breaks_timespan.html b/dev/reference/breaks_timespan.html index 87d72711..d8a8eecf 100644 --- a/dev/reference/breaks_timespan.html +++ b/dev/reference/breaks_timespan.html @@ -69,6 +69,13 @@

Arguments +

Value

+

All breaks_() functions return a function for generating breaks. These +functions takes, as their first argument a vector of values that represent +the data range to provide breaks for. Some will optionally take a second +argument that allows you to specify the number of breaks to recieve.

+

Examples

diff --git a/dev/reference/breaks_width.html b/dev/reference/breaks_width.html index 2b9b66e7..db7e3c63 100644 --- a/dev/reference/breaks_width.html +++ b/dev/reference/breaks_width.html @@ -73,6 +73,13 @@

Arguments +

Value

+

All breaks_() functions return a function for generating breaks. These +functions takes, as their first argument a vector of values that represent +the data range to provide breaks for. Some will optionally take a second +argument that allows you to specify the number of breaks to recieve.

+

Examples

diff --git a/dev/reference/compose_label.html b/dev/reference/compose_label.html index 653a5e0e..76884e28 100644 --- a/dev/reference/compose_label.html +++ b/dev/reference/compose_label.html @@ -69,8 +69,13 @@

Arguments

Value

-

A labelling function that applies the provided -functions to breaks to return labels.

+

All label_() functions return a "labelling" function, i.e. a function that +takes a vector x and returns a character vector of length(x) giving a +label for each input value.

+

Labelling functions are designed to be used with the labels argument of +ggplot2 scales. The examples demonstrate their use with x scales, but +they work similarly for all scales, including those that generate legends +rather than axes.

diff --git a/dev/reference/get_palette.html b/dev/reference/get_palette.html index 4db4dd02..93aa749c 100644 --- a/dev/reference/get_palette.html +++ b/dev/reference/get_palette.html @@ -114,8 +114,8 @@

Examples#> pal #> } #> } -#> <bytecode: 0x5569ea4ce848> -#> <environment: 0x5569f1152920> +#> <bytecode: 0x5587f0aab380> +#> <environment: 0x5587fa3788d0> #> attr(,"class") #> [1] "pal_discrete" "scales_pal" "function" #> attr(,"type") @@ -139,8 +139,8 @@

Examples#> out[is.na(out)] <- na.color #> out #> } -#> <bytecode: 0x5569eaf6e348> -#> <environment: 0x5569f4b647b8> +#> <bytecode: 0x5587eef70f20> +#> <environment: 0x5587f43d3d80> #> attr(,"class") #> [1] "pal_continuous" "scales_pal" "function" #> attr(,"type") diff --git a/dev/reference/label_bytes.html b/dev/reference/label_bytes.html index e53712dd..4a97fd38 100644 --- a/dev/reference/label_bytes.html +++ b/dev/reference/label_bytes.html @@ -148,8 +148,13 @@

Arguments

Value

-

A labeller function that takes a numeric vector of breaks and -returns a character vector of labels.

+

All label_() functions return a "labelling" function, i.e. a function that +takes a vector x and returns a character vector of length(x) giving a +label for each input value.

+

Labelling functions are designed to be used with the labels argument of +ggplot2 scales. The examples demonstrate their use with x scales, but +they work similarly for all scales, including those that generate legends +rather than axes.

See also

diff --git a/dev/reference/label_dictionary.html b/dev/reference/label_dictionary.html index 3885d3fd..324e96d7 100644 --- a/dev/reference/label_dictionary.html +++ b/dev/reference/label_dictionary.html @@ -70,8 +70,13 @@

Arguments

Value

-

A labeller function that takes a character vector of breaks and -returns a character vector of labels.

+

All label_() functions return a "labelling" function, i.e. a function that +takes a vector x and returns a character vector of length(x) giving a +label for each input value.

+

Labelling functions are designed to be used with the labels argument of +ggplot2 scales. The examples demonstrate their use with x scales, but +they work similarly for all scales, including those that generate legends +rather than axes.

See also

diff --git a/dev/reference/label_glue.html b/dev/reference/label_glue.html index b0705082..e5d91aa5 100644 --- a/dev/reference/label_glue.html +++ b/dev/reference/label_glue.html @@ -78,8 +78,13 @@

Arguments

Value

-

A labeller function that takes a vector of breaks and returns a -character vector of labels.

+

All label_() functions return a "labelling" function, i.e. a function that +takes a vector x and returns a character vector of length(x) giving a +label for each input value.

+

Labelling functions are designed to be used with the labels argument of +ggplot2 scales. The examples demonstrate their use with x scales, but +they work similarly for all scales, including those that generate legends +rather than axes.

See also

diff --git a/dev/reference/label_number_auto.html b/dev/reference/label_number_auto.html index d33d2b82..81bb0ea7 100644 --- a/dev/reference/label_number_auto.html +++ b/dev/reference/label_number_auto.html @@ -56,6 +56,16 @@

Usage
label_number_auto()

+
+

Value

+

All label_() functions return a "labelling" function, i.e. a function that +takes a vector x and returns a character vector of length(x) giving a +label for each input value.

+

Labelling functions are designed to be used with the labels argument of +ggplot2 scales. The examples demonstrate their use with x scales, but +they work similarly for all scales, including those that generate legends +rather than axes.

+

See also

Other labels for continuous scales: diff --git a/dev/reference/new_continuous_palette.html b/dev/reference/new_continuous_palette.html index 1e24990e..a196c627 100644 --- a/dev/reference/new_continuous_palette.html +++ b/dev/reference/new_continuous_palette.html @@ -154,7 +154,7 @@

Examples#> } #> else character() #> } -#> <bytecode: 0x5569ebf9b8b0> +#> <bytecode: 0x5587f795dd70> #> <environment: namespace:grDevices> #> attr(,"class") #> [1] "pal_discrete" "scales_pal" "function" @@ -170,7 +170,7 @@

Examples) #> function (x) #> rescale(x, to = c(1, 0)) -#> <environment: 0x5569ef0b3bd0> +#> <environment: 0x5587f794d640> #> attr(,"class") #> [1] "pal_continuous" "scales_pal" "function" #> attr(,"type") diff --git a/dev/search.json b/dev/search.json index d1f7a859..0f861f24 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) 2024 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 (2024). scales: Scale Functions Visualization. R package version 1.3.0.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 = {2024}, note = {R package version 1.3.0.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":"#|  sepal length and sepal width in the Iris dataset. The points are coloured #| according to species and the `scales::pal_brewer()` are used to provide the #| colours. library(scales) # pull a list of colours from any palette pal_viridis()(4) #> [1] \"#440154FF\" \"#31688EFF\" \"#35B779FF\" \"#FDE725FF\" # use in combination with baseR `palette()` to set new defaults palette(pal_brewer(palette = \"Set2\")(4)) par(mar = c(5, 5, 1, 1)) plot(Sepal.Length ~ Sepal.Width, data = iris, col = Species, pch = 20) # use new_transform to build a new transformation transform_logp3 <- new_transform( 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 = transform_logp3)"},{"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":[]},{"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/breaks_exp.html","id":null,"dir":"Reference","previous_headings":"","what":"Breaks for exponentially transformed data — breaks_exp","title":"Breaks for exponentially transformed data — breaks_exp","text":"breaks function typically labels zero last n - 1 integers range range large enough (currently: 3). smaller ranges, uses breaks_extended().","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_exp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Breaks for exponentially transformed data — breaks_exp","text":"","code":"breaks_exp(n = 5, ...)"},{"path":"https://scales.r-lib.org/dev/reference/breaks_exp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Breaks for exponentially transformed data — breaks_exp","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_exp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Breaks for exponentially transformed data — breaks_exp","text":"","code":"# Small range demo_continuous(c(100, 102), transform = \"exp\", breaks = breaks_exp()) #> scale_x_continuous(transform = \"exp\", breaks = breaks_exp()) # Large range demo_continuous(c(0, 100), transform = \"exp\", breaks = breaks_exp(n = 4)) #> scale_x_continuous(transform = \"exp\", breaks = breaks_exp(n = 4))"},{"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/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":[]},{"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_mix.html","id":null,"dir":"Reference","previous_headings":"","what":"Mix colours — col_mix","title":"Mix colours — col_mix","text":"Produces interpolation two colours.","code":""},{"path":"https://scales.r-lib.org/dev/reference/col_mix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Mix colours — col_mix","text":"","code":"col_mix(a, b, amount = 0.5, space = \"rgb\")"},{"path":"https://scales.r-lib.org/dev/reference/col_mix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Mix colours — col_mix","text":"Either character vector colours colour palette function. b character vector colours. amount numeric fraction 0 1 giving contribution b colour. space string giving colour space perform mixing operation . Polar spaces recommended.","code":""},{"path":"https://scales.r-lib.org/dev/reference/col_mix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Mix colours — col_mix","text":"character vector colours.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/col_mix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Mix colours — col_mix","text":"","code":"col_mix(\"blue\", \"red\") # purple #> [1] \"#800080FF\" col_mix(\"blue\", \"red\", amount = 1) # red #> [1] \"#FF0000FF\" col_mix(\"blue\", \"red\", amount = 0) # blue #> [1] \"#0000FFFF\" # Not recommended: col_mix(\"blue\", \"red\", space = \"hcl\") # green! #> [1] \"#008800FF\""},{"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_manip.html","id":null,"dir":"Reference","previous_headings":"","what":"Colour manipulation — colour_manip","title":"Colour manipulation — colour_manip","text":"set convenience functions standard colour manipulation operations.","code":""},{"path":"https://scales.r-lib.org/dev/reference/colour_manip.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Colour manipulation — colour_manip","text":"","code":"col_shift(col, amount = 10) col_lighter(col, amount = 10) col_darker(col, amount = 10) col_saturate(col, amount = 10)"},{"path":"https://scales.r-lib.org/dev/reference/colour_manip.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Colour manipulation — colour_manip","text":"col character vector colours colour palette function. amount numeric vector giving change. interpretation depends function: col_shift() takes number -360 360 shifting hues HCL space. col_lighter() col_darker() take number -100 100 adding (subtracting) lightness channel HSL space. col_saturate() takes number -100 100 adding saturation channel HSL space. Negative numbers desaturate colour.","code":""},{"path":"https://scales.r-lib.org/dev/reference/colour_manip.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Colour manipulation — colour_manip","text":"vector colours.","code":""},{"path":"https://scales.r-lib.org/dev/reference/colour_manip.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Colour manipulation — colour_manip","text":"col_shift() considers hue channel periodic, adding 180 colour hue 270 result colour hue 90.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/colour_manip.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Colour manipulation — colour_manip","text":"","code":"col_shift(\"red\", 180) # teal #> [1] \"#00B8B8FF\" col_lighter(\"red\", 50) # light red #> [1] \"#FFFFFF\" col_darker(\"red\", 50) # dark red #> [1] \"#000000\" col_saturate(\"red\", -50) # brick-red #> [1] \"#BF4040\""},{"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 = NULL, decimal.mark = NULL, style_positive = NULL, style_negative = NULL, 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label.","code":""},{"path":"https://scales.r-lib.org/dev/reference/compose_label.html","id":null,"dir":"Reference","previous_headings":"","what":"Compose two or more label formatters together — compose_label","title":"Compose two or more label formatters together — compose_label","text":"labeller provides general mechanism composing two labellers together.","code":""},{"path":"https://scales.r-lib.org/dev/reference/compose_label.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compose two or more label formatters together — compose_label","text":"","code":"compose_label(..., call = caller_env())"},{"path":"https://scales.r-lib.org/dev/reference/compose_label.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compose two or more label formatters together — compose_label","text":"... One labelling functions. applied breaks consecutively. Lambda syntax allowed. call call display error messages.","code":""},{"path":"https://scales.r-lib.org/dev/reference/compose_label.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compose two or more label formatters together — compose_label","text":"labelling function applies provided functions breaks return labels.","code":""},{"path":"https://scales.r-lib.org/dev/reference/compose_label.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compose two or more label formatters together — compose_label","text":"","code":"demo_continuous( c(-100, 100), labels = compose_label(abs, number, ~paste0(.x, \" foobar\"), toupper) ) #> scale_x_continuous(labels = compose_label(abs, number, ~paste0(.x, #> \" foobar\"), toupper)) # Same result demo_continuous( c(-100, 100), labels = compose_label(abs, label_number(suffix = \" FOOBAR\")) ) #> scale_x_continuous(labels = compose_label(abs, label_number(suffix = \" FOOBAR\")))"},{"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 = transform_identity())"},{"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: pal_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 na.value value use missing values trans transformation object describing transform raw data prior scaling. Defaults identity transformation leaves data unchanged. Built transformations: transform_asinh, transform_asn, transform_atanh, transform_boxcox, transform_compose, transform_date, transform_exp, transform_hms, transform_identity, transform_log, transform_log10, transform_log1p, transform_log2, transform_logit, transform_modulus, transform_probability, transform_probit, transform_pseudo_log, transform_reciprocal, transform_reverse, transform_sqrt, transform_time, transform_timespan, transform_yj .","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, pal_rescale()))) with(mtcars, plot(disp, mpg, cex = cscale(hp, pal_rescale(), trans = transform_sqrt() ))) with(mtcars, plot(disp, mpg, cex = cscale(hp, pal_area()))) with(mtcars, plot(disp, mpg, pch = 20, cex = 5, col = cscale(hp, pal_seq_gradient(\"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 label_date() label_time() date/time format string using standard POSIX specification. See strptime() details. label_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/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/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 = NULL, suffix = NULL, big.mark = NULL, decimal.mark = NULL, 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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), pal_brewer()) ))"},{"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/get_palette.html","id":null,"dir":"Reference","previous_headings":"","what":"Known palettes — get_palette","title":"Known palettes — get_palette","text":"scales packages keeps track set palettes considers 'known'. benefit known palette can called name functions as_continuous_pal() as_discrete_pal().","code":""},{"path":"https://scales.r-lib.org/dev/reference/get_palette.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Known palettes — get_palette","text":"","code":"get_palette(name, ...) set_palette(name, palette, warn_conflict = TRUE) palette_names() reset_palettes()"},{"path":"https://scales.r-lib.org/dev/reference/get_palette.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Known palettes — get_palette","text":"name string giving palette name. ... Additional arguments pass palette function palette class function. palette palette, function character vector. warn_conflict boolean TRUE (default), warns replacing known palette.","code":""},{"path":"https://scales.r-lib.org/dev/reference/get_palette.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Known palettes — get_palette","text":"get_palette() function returns palette. set_palette() function called side effects returns nothing.","code":""},{"path":"https://scales.r-lib.org/dev/reference/get_palette.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Known palettes — get_palette","text":"","code":"# Get one of the known palettes get_palette(\"hue\") #> function (n) #> { #> if (n == 0) { #> cli::cli_abort(\"Must request at least one colour from a hue palette.\") #> } #> if ((diff(h)%%360) < 1) { #> h[2] <- h[2] - 360/n #> } #> hues <- seq(h[1], h[2], length.out = n) #> hues <- (hues + h.start)%%360 #> hcl <- cbind(hues, c, l) #> pal <- farver::encode_colour(hcl, from = \"hcl\") #> if (direction == -1) { #> rev(pal) #> } #> else { #> pal #> } #> } #> #> #> attr(,\"class\") #> [1] \"pal_discrete\" \"scales_pal\" \"function\" #> attr(,\"type\") #> [1] \"colour\" #> attr(,\"nlevels\") #> [1] 255 # Set a new custom palette cols <- c(\"palegreen\", \"deepskyblue\", \"magenta\") set_palette(\"aurora\", palette = cols) # Palette is now known \"aurora\" %in% palette_names() #> [1] TRUE as_continuous_pal(\"aurora\") #> function (x) #> { #> lab_out <- cbind(l_interp(x), u_interp(x), v_interp(x)) #> out <- farver::encode_colour(lab_out, alpha = alpha_interp(x), #> from = \"lab\") #> out[is.na(out)] <- na.color #> out #> } #> #> #> attr(,\"class\") #> [1] \"pal_continuous\" \"scales_pal\" \"function\" #> attr(,\"type\") #> [1] \"colour\" #> attr(,\"na_safe\") #> [1] FALSE # Resetting palettes reset_palettes()"},{"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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label. 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 = NULL, suffix = NULL, big.mark = NULL, decimal.mark = NULL, 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. \"space\": preceded Unicode \"figure space\", .e., space equally wide number +. Compared \"none\", adding figure space can ensure numbers remain properly aligned left- right-justified. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label.","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, us, 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\", leading = \"0\" ) label_time(format = \"%H:%M:%S\", tz = \"UTC\", locale = NULL) label_timespan( unit = c(\"secs\", \"mins\", \"hours\", \"days\", \"weeks\"), space = FALSE, ... )"},{"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 label_date() label_time() date/time format string using standard POSIX specification. See strptime() details. label_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. leading string replace leading zeroes . Can \"\" disable leading characters \"\\u2007\" figure-spaces. unit unit used interpret numeric input space Add space time unit? ... 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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 = label_date(\"%m/%d\")) #> scale_x_datetime(labels = label_date(\"%m/%d\")) demo_datetime(two_months, labels = label_date(\"%e %b\", locale = \"fr\")) #> scale_x_datetime(labels = label_date(\"%e %b\", locale = \"fr\")) demo_datetime(two_months, labels = label_date(\"%e %B\", locale = \"es\")) #> scale_x_datetime(labels = label_date(\"%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_dictionary.html","id":null,"dir":"Reference","previous_headings":"","what":"Labels from lookup tables — label_dictionary","title":"Labels from lookup tables — label_dictionary","text":"Use label_dictionary() looking succinct breaks named character vector giving complete labels.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_dictionary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Labels from lookup tables — label_dictionary","text":"","code":"label_dictionary(dictionary = character(), nomatch = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/label_dictionary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Labels from lookup tables — label_dictionary","text":"dictionary named character vector labels. names expected match breaks, values become labels. nomatch string label breaks match name dictionary. NULL (default), breaks translated kept -.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_dictionary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Labels from lookup tables — label_dictionary","text":"labeller function takes character vector breaks returns character vector labels.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_dictionary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Labels from lookup tables — label_dictionary","text":"","code":"# Example lookup table lut <- c( \"4\" = \"four wheel drive\", \"r\" = \"rear wheel drive\", \"f\" = \"front wheel drive\" ) # Typical usage demo_discrete(c(\"4\", \"r\", \"f\"), labels = label_dictionary(lut)) #> scale_x_discrete(labels = label_dictionary(lut)) # By default, extra values ('w') will remain as-is demo_discrete(c(\"4\", \"r\", \"f\", \"w\"), labels = label_dictionary(lut)) #> scale_x_discrete(labels = label_dictionary(lut)) # Alternatively, you can relabel extra values demo_discrete( c(\"4\", \"r\", \"f\", \"w\"), labels = label_dictionary(lut, nomatch = \"unknown\") ) #> scale_x_discrete(labels = label_dictionary(lut, nomatch = \"unknown\"))"},{"path":"https://scales.r-lib.org/dev/reference/label_glue.html","id":null,"dir":"Reference","previous_headings":"","what":"Interpolated labels — label_glue","title":"Interpolated labels — label_glue","text":"Use label_glue() perform string interpolation using glue package. Enclosed expressions evaluated R code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_glue.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Interpolated labels — label_glue","text":"","code":"label_glue(pattern = \"{x}\", ..., parse = FALSE, .envir = caller_env())"},{"path":"https://scales.r-lib.org/dev/reference/label_glue.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Interpolated labels — label_glue","text":"pattern glue string used formatting. x variable holds breaks, \"{x}\" (default) returns breaks -. ... Arguments passed glue::glue(). parse Whether return labels expressions. .envir [environment: parent.frame()] Environment evaluate expression . Expressions evaluated left right. .x environment, expressions evaluated environment .envir ignored. NULL passed, equivalent emptyenv().","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_glue.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Interpolated labels — label_glue","text":"labeller function takes vector breaks returns character vector labels.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/label_glue.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Interpolated labels — label_glue","text":"","code":"# Example variables animal <- \"penguin\" species <- c(\"Adelie\", \"Chinstrap\", \"Emperor\", \"Gentoo\") # Typical use, note that {x} will become the breaks demo_discrete(species, labels = label_glue(\"The {x}\\n{animal}\")) #> scale_x_discrete(labels = label_glue(\"The {x}\\n{animal}\")) # It adapts to the breaks that are present demo_discrete(species[-3], labels = label_glue(\"The {x}\\n{animal}\")) #> scale_x_discrete(labels = label_glue(\"The {x}\\n{animal}\")) # Contrary to directly glueing species + animal, which results in mislabelling! demo_discrete(species[-3], labels = glue::glue(\"The {species}\\n{animal}\")) #> scale_x_discrete(labels = glue::glue(\"The {species}\\n{animal}\"))"},{"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() format_log() display numbers base^exponent, using superscript formatting. label_log() returns expressions suitable labelling scales, whereas format_log() returns deparsed text.","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, signed = NULL) format_log(x, base = 10, signed = NULL, ...)"},{"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(). signed + - displayed prefix? default, NULL, displays signs zeroes negative numbers present. x numeric vector format ... Passed 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)) format_log(c(0.1, 1, 10)) #> [1] \"10^-1\" \"10^ 0\" \"10^ 1\""},{"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 = NULL, decimal.mark = NULL, style_positive = NULL, style_negative = NULL, 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label. 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label. 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_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 = NULL, rules = NULL, ...) 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. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label. 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 = NULL, decimal.mark = NULL, 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. \"space\": preceded Unicode \"figure space\", .e., space equally wide number +. Compared \"none\", adding figure space can ensure numbers remain properly aligned left- right-justified. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label.","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 = NULL, 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. default (NULL) retrieves setting number options. prefix character vector length 3 giving prefixes put front numbers. default values c(\"p<\", \"p=\", \"p>\") add_p TRUE c(\"<\", \"\", \">\") 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 = NULL, 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. default (NULL) retrieves setting number options. 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/minor_breaks_log.html","id":null,"dir":"Reference","previous_headings":"","what":"Minor breaks for log-10 axes — minor_breaks_log","title":"Minor breaks for log-10 axes — minor_breaks_log","text":"break function designed mark every power, multiples 5 /1 power base 10.","code":""},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_log.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Minor breaks for log-10 axes — minor_breaks_log","text":"","code":"minor_breaks_log(detail = NULL, smallest = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_log.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Minor breaks for log-10 axes — minor_breaks_log","text":"detail 1, 5 10 mark multiples powers, multiples 5 powers just powers respectively. smallest Smallest absolute value mark range includes negative numbers.","code":""},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_log.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Minor breaks for log-10 axes — minor_breaks_log","text":"function generate minor ticks.","code":""},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_log.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Minor breaks for log-10 axes — minor_breaks_log","text":"","code":"# Standard usage with log10 scale demo_log10(c(1, 1e10), minor_breaks = minor_breaks_log()) #> scale_x_log10(minor_breaks = minor_breaks_log()) # Increasing detail over many powers demo_log10(c(1, 1e10), minor_breaks = minor_breaks_log(detail = 1)) #> scale_x_log10(minor_breaks = minor_breaks_log(detail = 1)) # Adjusting until where to draw minor breaks demo_continuous( c(-1000, 1000), transform = asinh_trans(), minor_breaks = minor_breaks_log(smallest = 1) ) #> scale_x_continuous(transform = asinh_trans(), minor_breaks = minor_breaks_log(smallest = 1))"},{"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":[]},{"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/new_continuous_palette.html","id":null,"dir":"Reference","previous_headings":"","what":"Constructors for palettes — new_continuous_palette","title":"Constructors for palettes — new_continuous_palette","text":"constructor functions attach metadata palette functions. metadata can used testing coercion.","code":""},{"path":"https://scales.r-lib.org/dev/reference/new_continuous_palette.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Constructors for palettes — new_continuous_palette","text":"","code":"new_continuous_palette(fun, type, na_safe = NA) new_discrete_palette(fun, type, nlevels = NA) is_pal(x) is_continuous_pal(x) is_discrete_pal(x) is_colour_pal(x) is_numeric_pal(x) palette_nlevels(pal) palette_na_safe(pal) palette_type(pal) as_discrete_pal(x, ...) as_continuous_pal(x, ...)"},{"path":"https://scales.r-lib.org/dev/reference/new_continuous_palette.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Constructors for palettes — new_continuous_palette","text":"fun function serve palette. continuous palettes, typically take vectors numeric values (0, 1) return vector equal length. discrete palettes, typically take scalar integer return vector length. type string giving type return values. example strings include \"colour\", \"numeric\", \"linetype\" \"shape\". na_safe boolean indicating whether NA values translated palette values (TRUE) kept NA (FALSE). Applies continuous palettes. nlevels integer giving number distinct palette values can returned discrete palette. x object test coerce. pal palette retrieve properties . ... Additional arguments. Currently use.","code":""},{"path":"https://scales.r-lib.org/dev/reference/new_continuous_palette.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Constructors for palettes — new_continuous_palette","text":"new_continuous_palette(), new_discret_palette(), as_discrete_pal() as_continuous_pal(): function class pal_continuous pal_discrete. is_pal(), is_continuous_pal(), is_discret_pal(), is_colour_pal(), is_numeric_pal(): logical value length 1. palette_nlevels() single integer. palette_na_safe() boolean. palette_type() string.","code":""},{"path":"https://scales.r-lib.org/dev/reference/new_continuous_palette.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Constructors for palettes — new_continuous_palette","text":"","code":"# Creating a new discrete palette new_discrete_palette( fun = grDevices::terrain.colors, type = \"colour\", nlevels = 255 ) #> function (n, alpha, rev = FALSE) #> { #> if ((n <- as.integer(n[1L])) > 0) { #> k <- n%/%2 #> h <- c(4/12, 2/12, 0/12) #> s <- c(1, 1, 0) #> v <- c(0.65, 0.9, 0.95) #> alpha <- if (missing(alpha) || is.null(alpha)) #> NULL #> else rep_len(alpha, n) #> cols <- c(hsv(h = seq.int(h[1L], h[2L], length.out = k), #> s = seq.int(s[1L], s[2L], length.out = k), v = seq.int(v[1L], #> v[2L], length.out = k), alpha = alpha[seq_len(k)]), #> hsv(h = seq.int(h[2L], h[3L], length.out = n - k + #> 1)[-1L], s = seq.int(s[2L], s[3L], length.out = n - #> k + 1)[-1L], v = seq.int(v[2L], v[3L], length.out = n - #> k + 1)[-1L], alpha = alpha[k + seq_len(n - k)])) #> if (rev) #> rev(cols) #> else cols #> } #> else character() #> } #> #> #> attr(,\"class\") #> [1] \"pal_discrete\" \"scales_pal\" \"function\" #> attr(,\"type\") #> [1] \"colour\" #> attr(,\"nlevels\") #> [1] 255 # Creating a new continuous palette new_continuous_palette( fun = function(x) rescale(x, to = c(1, 0)), type = \"numeric\", na_safe = FALSE ) #> function (x) #> rescale(x, to = c(1, 0)) #> #> attr(,\"class\") #> [1] \"pal_continuous\" \"scales_pal\" \"function\" #> attr(,\"type\") #> [1] \"numeric\" #> attr(,\"na_safe\") #> [1] FALSE # Testing palette properties is_continuous_pal(pal_seq_gradient()) #> [1] TRUE is_discrete_pal(pal_viridis()) #> [1] TRUE is_numeric_pal(pal_area()) #> [1] TRUE is_colour_pal(pal_manual(c(\"red\", \"green\"))) #> [1] TRUE is_pal(transform_log10()) #> [1] FALSE # Extracting properties palette_nlevels(pal_viridis()) #> [1] 255 palette_na_safe(colour_ramp(c(\"red\", \"green\"), na.color = \"grey50\")) #> [1] TRUE palette_type(pal_shape()) #> [1] \"shape\" # Switching discrete to continuous pal <- as_continuous_pal(pal_viridis()) show_col(pal(c(0, 0.1, 0.2, 0.4, 1))) # Switching continuous to discrete pal <- as_discrete_pal(pal_div_gradient()) show_col(pal(9))"},{"path":"https://scales.r-lib.org/dev/reference/new_transform.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new transformation object — new_transform","title":"Create a new transformation object — new_transform","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/new_transform.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new transformation object — new_transform","text":"","code":"new_transform( name, transform, inverse, d_transform = NULL, d_inverse = NULL, breaks = extended_breaks(), minor_breaks = regular_minor_breaks(), format = format_format(), domain = c(-Inf, Inf) ) 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.transform(x) is.trans(x) as.transform(x, arg = deparse(substitute(x))) as.trans(x, arg = deparse(substitute(x)))"},{"path":"https://scales.r-lib.org/dev/reference/new_transform.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new transformation object — new_transform","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/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 = NULL, decimal.mark = NULL, style_positive = NULL, style_negative = NULL, scale_cut = NULL, trim = TRUE, ... ) cut_short_scale(space = FALSE) cut_long_scale(space = FALSE) cut_time_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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label. 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/number_options.html","id":null,"dir":"Reference","previous_headings":"","what":"Number options — number_options","title":"Number options — number_options","text":"Control settings formatting numbers globally.","code":""},{"path":"https://scales.r-lib.org/dev/reference/number_options.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Number options — number_options","text":"","code":"number_options( decimal.mark = \".\", big.mark = \" \", style_positive = c(\"none\", \"plus\", \"space\"), style_negative = c(\"hyphen\", \"minus\", \"parens\"), currency.prefix = \"$\", currency.suffix = \"\", currency.decimal.mark = decimal.mark, currency.big.mark = setdiff(c(\".\", \",\"), currency.decimal.mark)[1], ordinal.rules = ordinal_english() )"},{"path":"https://scales.r-lib.org/dev/reference/number_options.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Number options — number_options","text":"decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. big.mark Character used every 3 digits separate thousands. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. currency.prefix, currency.suffix, currency.decimal.mark, currency.big.mark Settings label_currency() passed without currency.-prefix. ordinal.rules Setting label_ordinal() passed without ordinal.-prefix.","code":""},{"path":"https://scales.r-lib.org/dev/reference/number_options.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Number options — number_options","text":"old options invisibly","code":""},{"path":"https://scales.r-lib.org/dev/reference/number_options.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Number options — number_options","text":"","code":"# Default number formatting x <- c(0.1, 1, 1000) label_number()(x) #> [1] \"0.1\" \"1.0\" \"1 000.0\" # Now again with new options set number_options(style_positive = \"plus\", decimal.mark = \",\") label_number()(x) #> [1] \"+0,1\" \"+1,0\" \"+1 000,0\" # The options are the argument names with a 'scales.'-prefix options(\"scales.style_positive\") #> $scales.style_positive #> [1] \"plus\" #> # Resetting the options to their defaults number_options() label_number()(x) #> [1] \"0.1\" \"1.0\" \"1 000.0\""},{"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 = NULL, rules = NULL, ...) ordinal(x, prefix = \"\", suffix = \"\", big.mark = \" \", rules = NULL, ...)"},{"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. default (NULL) retrieves setting number options. 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/pal_area.html","id":null,"dir":"Reference","previous_headings":"","what":"Area palettes (continuous) — pal_area","title":"Area palettes (continuous) — pal_area","text":"Area palettes (continuous)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_area.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Area palettes (continuous) — pal_area","text":"","code":"pal_area(range = c(1, 6)) area_pal(range = c(1, 6)) abs_area(max)"},{"path":"https://scales.r-lib.org/dev/reference/pal_area.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Area palettes (continuous) — pal_area","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/pal_brewer.html","id":null,"dir":"Reference","previous_headings":"","what":"Colour Brewer palette (discrete) — pal_brewer","title":"Colour Brewer palette (discrete) — pal_brewer","text":"Colour Brewer palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_brewer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Colour Brewer palette (discrete) — pal_brewer","text":"","code":"pal_brewer(type = \"seq\", palette = 1, direction = 1) brewer_pal(type = \"seq\", palette = 1, direction = 1)"},{"path":"https://scales.r-lib.org/dev/reference/pal_brewer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Colour Brewer palette (discrete) — pal_brewer","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/pal_brewer.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Colour Brewer palette (discrete) — pal_brewer","text":"https://colorbrewer2.org","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_brewer.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Colour Brewer palette (discrete) — pal_brewer","text":"","code":"show_col(pal_brewer()(10)) #> Warning: n too large, allowed maximum for palette Blues is 9 #> Returning the palette you asked for with that many colors show_col(pal_brewer(\"div\")(5)) show_col(pal_brewer(palette = \"Greens\")(5)) # Can use with gradient_n to create a continuous gradient cols <- pal_brewer(\"div\")(5) show_col(pal_gradient_n(cols)(seq(0, 1, length.out = 30)))"},{"path":"https://scales.r-lib.org/dev/reference/pal_dichromat.html","id":null,"dir":"Reference","previous_headings":"","what":"Dichromat (colour-blind) palette (discrete) — pal_dichromat","title":"Dichromat (colour-blind) palette (discrete) — pal_dichromat","text":"Dichromat (colour-blind) palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_dichromat.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dichromat (colour-blind) palette (discrete) — pal_dichromat","text":"","code":"pal_dichromat(name) dichromat_pal(name)"},{"path":"https://scales.r-lib.org/dev/reference/pal_dichromat.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dichromat (colour-blind) palette (discrete) — pal_dichromat","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/pal_dichromat.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dichromat (colour-blind) palette (discrete) — pal_dichromat","text":"","code":"if (requireNamespace(\"dichromat\", quietly = TRUE)) { show_col(pal_dichromat(\"BluetoOrange.10\")(10)) show_col(pal_dichromat(\"BluetoOrange.10\")(5)) # Can use with gradient_n to create a continuous gradient cols <- pal_dichromat(\"DarkRedtoBlue.12\")(12) show_col(pal_gradient_n(cols)(seq(0, 1, length.out = 30))) }"},{"path":"https://scales.r-lib.org/dev/reference/pal_div_gradient.html","id":null,"dir":"Reference","previous_headings":"","what":"Diverging colour gradient (continuous). — pal_div_gradient","title":"Diverging colour gradient (continuous). — pal_div_gradient","text":"Diverging colour gradient (continuous).","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_div_gradient.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Diverging colour gradient (continuous). — pal_div_gradient","text":"","code":"pal_div_gradient( low = \"#2B6788\", mid = \"#CBCBCB\", high = \"#90503F\", space = \"Lab\" ) div_gradient_pal( low = \"#2B6788\", mid = \"#CBCBCB\", high = \"#90503F\", space = \"Lab\" )"},{"path":"https://scales.r-lib.org/dev/reference/pal_div_gradient.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Diverging colour gradient (continuous). — pal_div_gradient","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/pal_div_gradient.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Diverging colour gradient (continuous). — pal_div_gradient","text":"","code":"x <- seq(-1, 1, length.out = 100) r <- sqrt(outer(x^2, x^2, \"+\")) image(r, col = pal_div_gradient()(seq(0, 1, length.out = 12))) image(r, col = pal_div_gradient()(seq(0, 1, length.out = 30))) image(r, col = pal_div_gradient()(seq(0, 1, length.out = 100))) pal <- pal_div_gradient(low = \"#2E6A70\") image(r, col = pal(seq(0, 1, length.out = 100)))"},{"path":"https://scales.r-lib.org/dev/reference/pal_gradient_n.html","id":null,"dir":"Reference","previous_headings":"","what":"Arbitrary colour gradient palette (continuous) — pal_gradient_n","title":"Arbitrary colour gradient palette (continuous) — pal_gradient_n","text":"Arbitrary colour gradient palette (continuous)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_gradient_n.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arbitrary colour gradient palette (continuous) — pal_gradient_n","text":"","code":"pal_gradient_n(colours, values = NULL, space = \"Lab\") gradient_n_pal(colours, values = NULL, space = \"Lab\")"},{"path":"https://scales.r-lib.org/dev/reference/pal_gradient_n.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Arbitrary colour gradient palette (continuous) — pal_gradient_n","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/pal_grey.html","id":null,"dir":"Reference","previous_headings":"","what":"Grey scale palette (discrete) — pal_grey","title":"Grey scale palette (discrete) — pal_grey","text":"Grey scale palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_grey.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Grey scale palette (discrete) — pal_grey","text":"","code":"pal_grey(start = 0.2, end = 0.8) grey_pal(start = 0.2, end = 0.8)"},{"path":"https://scales.r-lib.org/dev/reference/pal_grey.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Grey scale palette (discrete) — pal_grey","text":"start grey value low end palette end grey value high end palette","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/pal_grey.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Grey scale palette (discrete) — pal_grey","text":"","code":"show_col(pal_grey()(25)) show_col(pal_grey(0, 1)(25))"},{"path":"https://scales.r-lib.org/dev/reference/pal_hue.html","id":null,"dir":"Reference","previous_headings":"","what":"Hue palette (discrete) — pal_hue","title":"Hue palette (discrete) — pal_hue","text":"Hue palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_hue.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Hue palette (discrete) — pal_hue","text":"","code":"pal_hue(h = c(0, 360) + 15, c = 100, l = 65, h.start = 0, direction = 1) hue_pal(h = c(0, 360) + 15, c = 100, l = 65, h.start = 0, direction = 1)"},{"path":"https://scales.r-lib.org/dev/reference/pal_hue.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Hue palette (discrete) — pal_hue","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/pal_hue.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Hue palette (discrete) — pal_hue","text":"","code":"show_col(pal_hue()(4)) show_col(pal_hue()(9)) show_col(pal_hue(l = 90)(9)) show_col(pal_hue(l = 30)(9)) show_col(pal_hue()(9)) show_col(pal_hue(direction = -1)(9)) show_col(pal_hue(h.start = 30)(9)) show_col(pal_hue(h.start = 90)(9)) show_col(pal_hue()(9)) show_col(pal_hue(h = c(0, 90))(9)) show_col(pal_hue(h = c(90, 180))(9)) show_col(pal_hue(h = c(180, 270))(9)) show_col(pal_hue(h = c(270, 360))(9))"},{"path":"https://scales.r-lib.org/dev/reference/pal_identity.html","id":null,"dir":"Reference","previous_headings":"","what":"Identity palette — pal_identity","title":"Identity palette — pal_identity","text":"Leaves values unchanged - useful data already scaled.","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_identity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identity palette — pal_identity","text":"","code":"pal_identity() identity_pal()"},{"path":"https://scales.r-lib.org/dev/reference/pal_linetype.html","id":null,"dir":"Reference","previous_headings":"","what":"Line type palette (discrete) — pal_linetype","title":"Line type palette (discrete) — pal_linetype","text":"Based set supplied Richard Pearson, University Manchester","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_linetype.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Line type palette (discrete) — pal_linetype","text":"","code":"pal_linetype() linetype_pal()"},{"path":"https://scales.r-lib.org/dev/reference/pal_manual.html","id":null,"dir":"Reference","previous_headings":"","what":"Manual palette (discrete) — pal_manual","title":"Manual palette (discrete) — pal_manual","text":"Manual palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_manual.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Manual palette (discrete) — pal_manual","text":"","code":"pal_manual(values, type = NULL) manual_pal(values, type = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/pal_manual.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Manual palette (discrete) — pal_manual","text":"values vector values used palette. type string giving type return values. example strings include \"colour\", \"numeric\", \"linetype\" \"shape\".","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_rescale.html","id":null,"dir":"Reference","previous_headings":"","what":"Rescale palette (continuous) — pal_rescale","title":"Rescale palette (continuous) — pal_rescale","text":"Just rescales input specific output range. Useful alpha, size, continuous position.","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_rescale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rescale palette (continuous) — pal_rescale","text":"","code":"pal_rescale(range = c(0.1, 1)) rescale_pal(range = c(0.1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/pal_rescale.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rescale palette (continuous) — pal_rescale","text":"range Numeric vector length two, giving range possible values. 0 1.","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_seq_gradient.html","id":null,"dir":"Reference","previous_headings":"","what":"Sequential colour gradient palette (continuous) — pal_seq_gradient","title":"Sequential colour gradient palette (continuous) — pal_seq_gradient","text":"Sequential colour gradient palette (continuous)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_seq_gradient.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sequential colour gradient palette (continuous) — pal_seq_gradient","text":"","code":"pal_seq_gradient(low = \"#2B6788\", high = \"#90503F\", space = \"Lab\") seq_gradient_pal(low = \"#2B6788\", high = \"#90503F\", space = \"Lab\")"},{"path":"https://scales.r-lib.org/dev/reference/pal_seq_gradient.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sequential colour gradient palette (continuous) — pal_seq_gradient","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/pal_seq_gradient.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sequential colour gradient palette (continuous) — pal_seq_gradient","text":"","code":"x <- seq(0, 1, length.out = 25) show_col(pal_seq_gradient()(x)) show_col(pal_seq_gradient(\"white\", \"black\")(x)) show_col(pal_seq_gradient(\"white\", \"#90503F\")(x))"},{"path":"https://scales.r-lib.org/dev/reference/pal_shape.html","id":null,"dir":"Reference","previous_headings":"","what":"Shape palette (discrete) — pal_shape","title":"Shape palette (discrete) — pal_shape","text":"Shape palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_shape.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Shape palette (discrete) — pal_shape","text":"","code":"pal_shape(solid = TRUE) shape_pal(solid = TRUE)"},{"path":"https://scales.r-lib.org/dev/reference/pal_shape.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shape palette (discrete) — pal_shape","text":"solid shapes solid ?","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_viridis.html","id":null,"dir":"Reference","previous_headings":"","what":"Viridis palette — pal_viridis","title":"Viridis palette — pal_viridis","text":"Viridis palette","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_viridis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Viridis palette — pal_viridis","text":"","code":"pal_viridis(alpha = 1, begin = 0, end = 1, direction = 1, option = \"D\") viridis_pal(alpha = 1, begin = 0, end = 1, direction = 1, option = \"D\")"},{"path":"https://scales.r-lib.org/dev/reference/pal_viridis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Viridis palette — pal_viridis","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/pal_viridis.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Viridis palette — pal_viridis","text":"https://bids.github.io/colormap/","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_viridis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Viridis palette — pal_viridis","text":"","code":"show_col(pal_viridis()(10)) show_col(pal_viridis(direction = -1)(6)) show_col(pal_viridis(begin = 0.2, end = 0.8)(4)) show_col(pal_viridis(option = \"plasma\")(6))"},{"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 = NULL, decimal.mark = NULL, trim = TRUE, ... ) percent( x, accuracy = NULL, scale = 100, prefix = \"\", suffix = \"%\", big.mark = NULL, decimal.mark = NULL, 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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/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 = NULL, prefix = NULL, add_p = FALSE ) pvalue(x, accuracy = 0.001, decimal.mark = NULL, 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. default (NULL) retrieves setting number options. prefix character vector length 3 giving prefixes put front numbers. default values c(\"p<\", \"p=\", \"p>\") add_p TRUE c(\"<\", \"\", \">\") FALSE. add_p Add \"p=\" value?","code":""},{"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 class 'numeric' rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for class 'dist' rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for class 'logical' rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for class 'POSIXt' rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for class 'Date' rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for class 'integer64' rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE), ...) # S3 method for class 'difftime' rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for class '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.21001519 0.41290535 0.66712325 0.50351607 0.65848580 0.50771840 #> [7] 0.83627250 0.70762450 0.87549823 0.00000000 0.88974976 0.99944738 #> [13] 0.49594687 0.35263170 0.77473537 0.58147836 0.63171229 0.85972839 #> [19] 0.56363718 0.24509291 0.92075572 0.86854100 0.24056859 0.39719599 #> [25] 0.76937432 0.10960476 0.18592775 0.15535605 0.66137523 0.85760628 #> [31] 0.92861359 0.54890553 0.57395911 0.68597526 0.23669156 0.03362819 #> [37] 0.91167459 0.06007810 1.00000000 0.60926082 0.16346393 0.91125487 #> [43] 0.02635611 0.59069130 0.22883630 0.90806463 0.81934612 0.69854017 #> [49] 0.21160774 0.72711865 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.217159935 0.456388813 0.332915461 0.568550264 0.252293408 #> [6] 0.464174887 0.917979544 0.973182440 0.819367212 0.903237712 #> [11] 0.581568164 0.773277228 0.995468995 0.711218429 0.215017323 #> [16] 0.291859063 0.722010659 0.866916994 0.238536008 0.004497871 #> [21] 0.943844491 0.438289525 0.750864286 0.668047940 0.408115039 #> [26] 0.351370931 0.738348169 0.664516441 0.085254330 0.856429803 #> [31] 0.077010086 0.853141306 0.106383934 0.484971372 0.247305059 #> [36] 0.686807906 0.163680084 0.953156062 0.321966448 0.361659809 #> [41] 0.888032047 0.828302288 0.100691452 0.906366579 0.772999015 #> [46] 0.383503955 1.000000000 0.349420487 0.947647614 0.216175106 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 class 'numeric' rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for class 'logical' rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for class 'dist' rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for class 'POSIXt' rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid, ...) # S3 method for class 'Date' rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid, ...) # S3 method for class 'integer64' rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for class '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.0161502545 0.1332311077 0.8664583930 0.2033757852 0.2004404969 #> [6] 0.0238313205 0.9599290915 0.2362372190 0.7907009264 0.2810220225 #> [11] 0.8881470385 0.2887909275 1.0000000000 0.5928984858 0.7679883783 #> [16] 0.8475260042 0.7717742081 0.4144511619 0.1257433910 0.0665635854 #> [21] 0.6612972385 0.6054793165 0.6623449638 0.3235016883 0.9958107811 #> [26] 0.7225179181 0.8853264986 0.9997501052 0.2089739211 0.6701359034 #> [31] 0.3858012835 0.0305971997 0.6208980503 0.6018302169 0.4036799634 #> [36] 0.8705370429 0.5182836151 0.9956238106 0.0005595317 0.6793575095 #> [41] 0.3668838124 0.9322530215 0.6840421328 0.6707795067 0.7647648747 #> [46] 0.5442966948 0.2304051687 0.5091965925 0.4144454177 0.7346814140 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/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 thomas.pedersen@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 = NULL, trim = TRUE, ... ) scientific( x, digits = 3, scale = 1, prefix = \"\", suffix = \"\", decimal.mark = NULL, 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. default (NULL) retrieves setting number options. trim Logical, FALSE, values right-justified common width (see base::format()). ... arguments passed base::format().","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(pal_hue()(9)) show_col(pal_hue()(9), borders = NA) show_col(pal_viridis()(16)) show_col(pal_viridis()(16), labels = FALSE)"},{"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, call = caller_env())"},{"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 call call display error messages","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, fct = NA, call = caller_env() )"},{"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 fct Treat existing came factor (ie. sort range) call call display error messages","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/transform_asinh.html","id":null,"dir":"Reference","previous_headings":"","what":"Inverse Hyperbolic Sine transformation — transform_asinh","title":"Inverse Hyperbolic Sine transformation — transform_asinh","text":"Inverse Hyperbolic Sine transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_asinh.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Inverse Hyperbolic Sine transformation — transform_asinh","text":"","code":"transform_asinh() asinh_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_asinh.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Inverse Hyperbolic Sine transformation — transform_asinh","text":"","code":"plot(transform_asinh(), xlim = c(-1e2, 1e2))"},{"path":"https://scales.r-lib.org/dev/reference/transform_asn.html","id":null,"dir":"Reference","previous_headings":"","what":"Arc-sin square root transformation — transform_asn","title":"Arc-sin square root transformation — transform_asn","text":"variance stabilising transformation binomial distribution.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_asn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arc-sin square root transformation — transform_asn","text":"","code":"transform_asn() asn_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_asn.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Arc-sin square root transformation — transform_asn","text":"","code":"plot(transform_asn(), xlim = c(0, 1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_atanh.html","id":null,"dir":"Reference","previous_headings":"","what":"Arc-tangent transformation — transform_atanh","title":"Arc-tangent transformation — transform_atanh","text":"Arc-tangent transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_atanh.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arc-tangent transformation — transform_atanh","text":"","code":"transform_atanh() atanh_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_atanh.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Arc-tangent transformation — transform_atanh","text":"","code":"plot(transform_atanh(), xlim = c(-1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_boxcox.html","id":null,"dir":"Reference","previous_headings":"","what":"Box-Cox & modulus transformations — transform_boxcox","title":"Box-Cox & modulus transformations — transform_boxcox","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/transform_boxcox.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Box-Cox & modulus transformations — transform_boxcox","text":"","code":"transform_boxcox(p, offset = 0) boxcox_trans(p, offset = 0) transform_modulus(p, offset = 1) modulus_trans(p, offset = 1)"},{"path":"https://scales.r-lib.org/dev/reference/transform_boxcox.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Box-Cox & modulus transformations — transform_boxcox","text":"p Transformation exponent, \\(\\lambda\\). offset Constant offset. 0 Box-Cox type 1, otherwise non-negative constant (Box-Cox type 2). transform_modulus() sets default 1.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_boxcox.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Box-Cox & modulus transformations — transform_boxcox","text":"Box-Cox power transformation (type 1) requires strictly positive values takes following form \\(\\lambda > 0\\): $$y^{(\\lambda)} = \\frac{y^\\lambda - 1}{\\lambda}$$ \\(\\lambda = 0\\), natural log transform used. modulus transformation implements generalisation Box-Cox transformation works data positive negative values. equation takes following forms, \\(\\lambda \\neq 0\\) : $$y^{(\\lambda)} = sign(y) * \\frac{(|y| + 1)^\\lambda - 1}{\\lambda}$$ \\(\\lambda = 0\\): $$y^{(\\lambda)} = sign(y) * \\ln(|y| + 1)$$","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_boxcox.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Box-Cox & modulus transformations — transform_boxcox","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/transform_boxcox.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Box-Cox & modulus transformations — transform_boxcox","text":"","code":"plot(transform_boxcox(-1), xlim = c(0, 10)) plot(transform_boxcox(0), xlim = c(0, 10)) plot(transform_boxcox(1), xlim = c(0, 10)) plot(transform_boxcox(2), xlim = c(0, 10)) plot(transform_modulus(-1), xlim = c(-10, 10)) plot(transform_modulus(0), xlim = c(-10, 10)) plot(transform_modulus(1), xlim = c(-10, 10)) plot(transform_modulus(2), xlim = c(-10, 10))"},{"path":"https://scales.r-lib.org/dev/reference/transform_compose.html","id":null,"dir":"Reference","previous_headings":"","what":"Compose two or more transformations together — transform_compose","title":"Compose two or more transformations together — transform_compose","text":"transformer provides general mechanism composing two transformers together. important use case combine reverse transformations.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_compose.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compose two or more transformations together — transform_compose","text":"","code":"transform_compose(...) compose_trans(...)"},{"path":"https://scales.r-lib.org/dev/reference/transform_compose.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compose two or more transformations together — transform_compose","text":"... One transformers, either specified string individual transformer objects.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_compose.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compose two or more transformations together — transform_compose","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/transform_date.html","id":null,"dir":"Reference","previous_headings":"","what":"Transformation for dates (class Date) — transform_date","title":"Transformation for dates (class Date) — transform_date","text":"Transformation dates (class Date)","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_date.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transformation for dates (class Date) — transform_date","text":"","code":"transform_date() date_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_date.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Transformation for dates (class Date) — transform_date","text":"","code":"years <- seq(as.Date(\"1910/1/1\"), as.Date(\"1999/1/1\"), \"years\") t <- transform_date() 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/transform_exp.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential transformation (inverse of log transformation) — transform_exp","title":"Exponential transformation (inverse of log transformation) — transform_exp","text":"Exponential transformation (inverse log transformation)","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_exp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential transformation (inverse of log transformation) — transform_exp","text":"","code":"transform_exp(base = exp(1)) exp_trans(base = exp(1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_exp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential transformation (inverse of log transformation) — transform_exp","text":"base Base logarithm","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_exp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential transformation (inverse of log transformation) — transform_exp","text":"","code":"plot(transform_exp(0.5), xlim = c(-2, 2)) plot(transform_exp(1), xlim = c(-2, 2)) plot(transform_exp(2), xlim = c(-2, 2)) plot(transform_exp(), xlim = c(-2, 2))"},{"path":"https://scales.r-lib.org/dev/reference/transform_identity.html","id":null,"dir":"Reference","previous_headings":"","what":"Identity transformation (do nothing) — transform_identity","title":"Identity transformation (do nothing) — transform_identity","text":"Identity transformation (nothing)","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_identity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identity transformation (do nothing) — transform_identity","text":"","code":"transform_identity() identity_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_identity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identity transformation (do nothing) — transform_identity","text":"","code":"plot(transform_identity(), xlim = c(-1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_log.html","id":null,"dir":"Reference","previous_headings":"","what":"Log transformations — transform_log","title":"Log transformations — transform_log","text":"transform_log(): log(x) log1p(): log(x + 1) transform_pseudo_log(): smoothly transition linear scale around 0.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_log.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Log transformations — transform_log","text":"","code":"transform_log(base = exp(1)) transform_log10() transform_log2() transform_log1p() log_trans(base = exp(1)) log10_trans() log2_trans() log1p_trans() transform_pseudo_log(sigma = 1, base = exp(1)) pseudo_log_trans(sigma = 1, base = exp(1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_log.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Log transformations — transform_log","text":"base base logarithm sigma Scaling factor linear part pseudo-log transformation.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_log.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Log transformations — transform_log","text":"","code":"plot(transform_log2(), xlim = c(0, 5)) plot(transform_log(), xlim = c(0, 5)) plot(transform_log10(), xlim = c(0, 5)) plot(transform_log(), xlim = c(0, 2)) plot(transform_log1p(), xlim = c(-1, 1)) # The pseudo-log is defined for all real numbers plot(transform_pseudo_log(), xlim = c(-5, 5)) lines(transform_log(), xlim = c(0, 5), col = \"red\") # For large positives numbers it's very close to log plot(transform_pseudo_log(), xlim = c(1, 20)) lines(transform_log(), xlim = c(1, 20), col = \"red\")"},{"path":"https://scales.r-lib.org/dev/reference/transform_probability.html","id":null,"dir":"Reference","previous_headings":"","what":"Probability transformation — transform_probability","title":"Probability transformation — transform_probability","text":"Probability transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_probability.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Probability transformation — transform_probability","text":"","code":"transform_probability(distribution, ...) transform_logit() transform_probit() probability_trans(distribution, ...) logit_trans() probit_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_probability.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Probability transformation — transform_probability","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/transform_probability.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Probability transformation — transform_probability","text":"","code":"plot(transform_logit(), xlim = c(0, 1)) plot(transform_probit(), xlim = c(0, 1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_reciprocal.html","id":null,"dir":"Reference","previous_headings":"","what":"Reciprocal transformation — transform_reciprocal","title":"Reciprocal transformation — transform_reciprocal","text":"Reciprocal transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_reciprocal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reciprocal transformation — transform_reciprocal","text":"","code":"transform_reciprocal() reciprocal_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_reciprocal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reciprocal transformation — transform_reciprocal","text":"","code":"plot(transform_reciprocal(), xlim = c(0, 1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_reverse.html","id":null,"dir":"Reference","previous_headings":"","what":"Reverse transformation — transform_reverse","title":"Reverse transformation — transform_reverse","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/transform_reverse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reverse transformation — transform_reverse","text":"","code":"transform_reverse() reverse_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_reverse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reverse transformation — transform_reverse","text":"","code":"plot(transform_reverse(), xlim = c(-1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_sqrt.html","id":null,"dir":"Reference","previous_headings":"","what":"Square-root transformation — transform_sqrt","title":"Square-root transformation — transform_sqrt","text":"variance stabilising transformation Poisson distribution.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_sqrt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Square-root transformation — transform_sqrt","text":"","code":"transform_sqrt() sqrt_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_sqrt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Square-root transformation — transform_sqrt","text":"","code":"plot(transform_sqrt(), xlim = c(0, 5))"},{"path":"https://scales.r-lib.org/dev/reference/transform_time.html","id":null,"dir":"Reference","previous_headings":"","what":"Transformation for date-times (class POSIXt) — transform_time","title":"Transformation for date-times (class POSIXt) — transform_time","text":"Transformation date-times (class POSIXt)","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_time.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transformation for date-times (class POSIXt) — transform_time","text":"","code":"transform_time(tz = NULL) time_trans(tz = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/transform_time.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Transformation for date-times (class POSIXt) — transform_time","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/transform_time.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Transformation for date-times (class POSIXt) — transform_time","text":"","code":"hours <- seq(ISOdate(2000, 3, 20, tz = \"\"), by = \"hour\", length.out = 10) t <- transform_time() 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/transform_timespan.html","id":null,"dir":"Reference","previous_headings":"","what":"Transformation for times (class hms) — transform_timespan","title":"Transformation for times (class hms) — transform_timespan","text":"transform_timespan() provides transformations data encoding time passed along breaks label formatting showing standard unit time fitting range data. transform_hms() provides using standard hms idioms formatting.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_timespan.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transformation for times (class hms) — transform_timespan","text":"","code":"transform_timespan(unit = c(\"secs\", \"mins\", \"hours\", \"days\", \"weeks\")) timespan_trans(unit = c(\"secs\", \"mins\", \"hours\", \"days\", \"weeks\")) transform_hms() hms_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_timespan.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Transformation for times (class hms) — transform_timespan","text":"unit unit used interpret numeric input","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_timespan.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Transformation for times (class hms) — transform_timespan","text":"","code":"# transform_timespan allows you to specify the time unit numeric data is # interpreted in trans_min <- transform_timespan(\"mins\") demo_timespan(seq(0, 100), trans = trans_min) #> scale_x_continuous(trans = trans_min) # Input already in difftime format is interpreted correctly demo_timespan(as.difftime(seq(0, 100), units = \"secs\"), trans = trans_min) #> scale_x_continuous(trans = trans_min) if (require(\"hms\")) { # transform_hms always assumes seconds hms <- round(runif(10) * 86400) t <- transform_hms() 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/transform_yj.html","id":null,"dir":"Reference","previous_headings":"","what":"Yeo-Johnson transformation — transform_yj","title":"Yeo-Johnson transformation — transform_yj","text":"Yeo-Johnson transformation flexible transformation similar Box-Cox, transform_boxcox(), require input values greater zero.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_yj.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Yeo-Johnson transformation — transform_yj","text":"","code":"transform_yj(p) yj_trans(p)"},{"path":"https://scales.r-lib.org/dev/reference/transform_yj.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Yeo-Johnson transformation — transform_yj","text":"p Transformation exponent, \\(\\lambda\\).","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_yj.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Yeo-Johnson transformation — transform_yj","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/transform_yj.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Yeo-Johnson transformation — transform_yj","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/transform_yj.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Yeo-Johnson transformation — transform_yj","text":"","code":"plot(transform_yj(-1), xlim = c(-10, 10)) plot(transform_yj(0), xlim = c(-10, 10)) plot(transform_yj(1), xlim = c(-10, 10)) plot(transform_yj(2), xlim = c(-10, 10))"},{"path":"https://scales.r-lib.org/dev/reference/trim_to_domain.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute range of transformed values — trim_to_domain","title":"Compute range of transformed values — trim_to_domain","text":"Silently drops ranges outside domain transform.","code":""},{"path":"https://scales.r-lib.org/dev/reference/trim_to_domain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute range of transformed values — trim_to_domain","text":"","code":"trim_to_domain(transform, x) trans_range(transform, x)"},{"path":"https://scales.r-lib.org/dev/reference/trim_to_domain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute range of transformed values — trim_to_domain","text":"transform 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 = NULL, decimal.mark = NULL, 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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/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/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":"New label_glue() labelling function interpolated strings (#457). fullseq() extension breaks_width() can now deal unsorted ranges (#435). New label_date_short(leading) argument replace leading zeroes (#442) breaks_pretty() return input limit range (#446) transform_exp() now sensible breaks, available breaks_exp() (@teunbrand, #405). scales package now keeps track known palettes. can retrieved using get_palette() registered using set_palette() (#396). label_log() signed argument displaying negative numbers (@teunbrand, #421). New label_dictionary() named lookup labels (#458). New function compose_label() chain together label formatting functions (#462)","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-130","dir":"Changelog","previous_headings":"","what":"scales 1.3.0","title":"scales 1.3.0","text":"CRAN release: 2023-11-28","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"better-type-support-1-3-0","dir":"Changelog","previous_headings":"","what":"Better type support","title":"scales 1.3.0","text":"rescale((x), ...) rescale_mid((x), ...) return (x) unaltered (@teunbrand, #403). Add rescale method difftime objects (#382) 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, transform_timespan() wraps together provides alternative transform_hms() (#212)","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"ranges-1-3-0","dir":"Changelog","previous_headings":"","what":"Ranges","title":"scales 1.3.0","text":"train_continuous() coerces new numeric calculating range (@teunbrand, #369). Training factor data longer sorts range multiple training passes new fct argument train_discrete() used (#383) DiscreteRange class now keeps track whether trained factor data. Attempt make sort behavior range consistent character vectors training. Mixing character factor data make factor level order take precedence matter training starts charactor vector","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"transformations-1-3-0","dir":"Changelog","previous_headings":"","what":"Transformations","title":"scales 1.3.0","text":"Transformation function renamed transform_*-prefixed names instead *_trans-suffixed names. allows better tab-completion search transformations. S3 class transformations renamed \"trans\" \"transform\". new_transform() replaces trans_new() trim_to_domain() replaces trans_range(). old functions kept posterity. transform_sqrt() longer returns inverse values outside domain (#214) Add inverse (area) hyperbolic sine transformation transform_asinh(), provides logarithm-like transformation space, accommodates negative values (#297) Correct domain calculation transform_compose() (@mjskay, #408). Transformation objects can optionally include derivatives transform inverse transform (@mjskay, #322).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"misc-1-3-0","dir":"Changelog","previous_headings":"","what":"Misc","title":"scales 1.3.0","text":"scale_cut argument number() now works advertised values lowest cut value (#346) scale_cut now choose appropriate cut case first cut creating irrational-ish number. 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) Palette functions now pal_-prefix. old _pal-suffixed versions kept backward compatibility.","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) 2024 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 (2024). scales: Scale Functions Visualization. R package version 1.3.0.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 = {2024}, note = {R package version 1.3.0.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":"#|  sepal length and sepal width in the Iris dataset. The points are coloured #| according to species and the `scales::pal_brewer()` are used to provide the #| colours. library(scales) # pull a list of colours from any palette pal_viridis()(4) #> [1] \"#440154FF\" \"#31688EFF\" \"#35B779FF\" \"#FDE725FF\" # use in combination with baseR `palette()` to set new defaults palette(pal_brewer(palette = \"Set2\")(4)) par(mar = c(5, 5, 1, 1)) plot(Sepal.Length ~ Sepal.Width, data = iris, col = Species, pch = 20) # use new_transform to build a new transformation transform_logp3 <- new_transform( 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 = transform_logp3)"},{"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":[]},{"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/breaks_exp.html","id":null,"dir":"Reference","previous_headings":"","what":"Breaks for exponentially transformed data — breaks_exp","title":"Breaks for exponentially transformed data — breaks_exp","text":"breaks function typically labels zero last n - 1 integers range range large enough (currently: 3). smaller ranges, uses breaks_extended().","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_exp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Breaks for exponentially transformed data — breaks_exp","text":"","code":"breaks_exp(n = 5, ...)"},{"path":"https://scales.r-lib.org/dev/reference/breaks_exp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Breaks for exponentially transformed data — breaks_exp","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_exp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Breaks for exponentially transformed data — breaks_exp","text":"breaks_() functions return function generating breaks. functions takes, first argument vector values represent data range provide breaks . optionally take second argument allows specify number breaks recieve.","code":""},{"path":"https://scales.r-lib.org/dev/reference/breaks_exp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Breaks for exponentially transformed data — breaks_exp","text":"","code":"# Small range demo_continuous(c(100, 102), transform = \"exp\", breaks = breaks_exp()) #> scale_x_continuous(transform = \"exp\", breaks = breaks_exp()) # Large range demo_continuous(c(0, 100), transform = \"exp\", breaks = breaks_exp(n = 4)) #> scale_x_continuous(transform = \"exp\", breaks = breaks_exp(n = 4))"},{"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":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Automatic breaks for numeric axes — breaks_extended","text":"breaks_() functions return function generating breaks. functions takes, first argument vector values represent data range provide breaks . optionally take second argument allows specify number breaks recieve.","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":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Breaks for log axes — breaks_log","text":"breaks_() functions return function generating breaks. functions takes, first argument vector values represent data range provide breaks . optionally take second argument allows specify number breaks recieve.","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":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pretty breaks for date/times — breaks_pretty","text":"breaks_() functions return function generating breaks. functions takes, first argument vector values represent data range provide breaks . optionally take second argument allows specify number breaks recieve.","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":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Breaks for timespan data — breaks_timespan","text":"breaks_() functions return function generating breaks. functions takes, first argument vector values represent data range provide breaks . optionally take second argument allows specify number breaks recieve.","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":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Equally spaced breaks — breaks_width","text":"breaks_() functions return function generating breaks. functions takes, first argument vector values represent data range provide breaks . optionally take second argument allows specify number breaks recieve.","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/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":[]},{"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_mix.html","id":null,"dir":"Reference","previous_headings":"","what":"Mix colours — col_mix","title":"Mix colours — col_mix","text":"Produces interpolation two colours.","code":""},{"path":"https://scales.r-lib.org/dev/reference/col_mix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Mix colours — col_mix","text":"","code":"col_mix(a, b, amount = 0.5, space = \"rgb\")"},{"path":"https://scales.r-lib.org/dev/reference/col_mix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Mix colours — col_mix","text":"Either character vector colours colour palette function. b character vector colours. amount numeric fraction 0 1 giving contribution b colour. space string giving colour space perform mixing operation . Polar spaces recommended.","code":""},{"path":"https://scales.r-lib.org/dev/reference/col_mix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Mix colours — col_mix","text":"character vector colours.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/col_mix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Mix colours — col_mix","text":"","code":"col_mix(\"blue\", \"red\") # purple #> [1] \"#800080FF\" col_mix(\"blue\", \"red\", amount = 1) # red #> [1] \"#FF0000FF\" col_mix(\"blue\", \"red\", amount = 0) # blue #> [1] \"#0000FFFF\" # Not recommended: col_mix(\"blue\", \"red\", space = \"hcl\") # green! #> [1] \"#008800FF\""},{"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_manip.html","id":null,"dir":"Reference","previous_headings":"","what":"Colour manipulation — colour_manip","title":"Colour manipulation — colour_manip","text":"set convenience functions standard colour manipulation operations.","code":""},{"path":"https://scales.r-lib.org/dev/reference/colour_manip.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Colour manipulation — colour_manip","text":"","code":"col_shift(col, amount = 10) col_lighter(col, amount = 10) col_darker(col, amount = 10) col_saturate(col, amount = 10)"},{"path":"https://scales.r-lib.org/dev/reference/colour_manip.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Colour manipulation — colour_manip","text":"col character vector colours colour palette function. amount numeric vector giving change. interpretation depends function: col_shift() takes number -360 360 shifting hues HCL space. col_lighter() col_darker() take number -100 100 adding (subtracting) lightness channel HSL space. col_saturate() takes number -100 100 adding saturation channel HSL space. Negative numbers desaturate colour.","code":""},{"path":"https://scales.r-lib.org/dev/reference/colour_manip.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Colour manipulation — colour_manip","text":"vector colours.","code":""},{"path":"https://scales.r-lib.org/dev/reference/colour_manip.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Colour manipulation — colour_manip","text":"col_shift() considers hue channel periodic, adding 180 colour hue 270 result colour hue 90.","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/colour_manip.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Colour manipulation — colour_manip","text":"","code":"col_shift(\"red\", 180) # teal #> [1] \"#00B8B8FF\" col_lighter(\"red\", 50) # light red #> [1] \"#FFFFFF\" col_darker(\"red\", 50) # dark red #> [1] \"#000000\" col_saturate(\"red\", -50) # brick-red #> [1] \"#BF4040\""},{"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 = NULL, decimal.mark = NULL, style_positive = NULL, style_negative = NULL, 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label.","code":""},{"path":"https://scales.r-lib.org/dev/reference/compose_label.html","id":null,"dir":"Reference","previous_headings":"","what":"Compose two or more label formatters together — compose_label","title":"Compose two or more label formatters together — compose_label","text":"labeller provides general mechanism composing two labellers together.","code":""},{"path":"https://scales.r-lib.org/dev/reference/compose_label.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compose two or more label formatters together — compose_label","text":"","code":"compose_label(..., call = caller_env())"},{"path":"https://scales.r-lib.org/dev/reference/compose_label.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compose two or more label formatters together — compose_label","text":"... One labelling functions. applied breaks consecutively. Lambda syntax allowed. call call display error messages.","code":""},{"path":"https://scales.r-lib.org/dev/reference/compose_label.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compose two or more label formatters together — compose_label","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/compose_label.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compose two or more label formatters together — compose_label","text":"","code":"demo_continuous( c(-100, 100), labels = compose_label(abs, number, ~paste0(.x, \" foobar\"), toupper) ) #> scale_x_continuous(labels = compose_label(abs, number, ~paste0(.x, #> \" foobar\"), toupper)) # Same result demo_continuous( c(-100, 100), labels = compose_label(abs, label_number(suffix = \" FOOBAR\")) ) #> scale_x_continuous(labels = compose_label(abs, label_number(suffix = \" FOOBAR\")))"},{"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 = transform_identity())"},{"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: pal_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 na.value value use missing values trans transformation object describing transform raw data prior scaling. Defaults identity transformation leaves data unchanged. Built transformations: transform_asinh, transform_asn, transform_atanh, transform_boxcox, transform_compose, transform_date, transform_exp, transform_hms, transform_identity, transform_log, transform_log10, transform_log1p, transform_log2, transform_logit, transform_modulus, transform_probability, transform_probit, transform_pseudo_log, transform_reciprocal, transform_reverse, transform_sqrt, transform_time, transform_timespan, transform_yj .","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, pal_rescale()))) with(mtcars, plot(disp, mpg, cex = cscale(hp, pal_rescale(), trans = transform_sqrt() ))) with(mtcars, plot(disp, mpg, cex = cscale(hp, pal_area()))) with(mtcars, plot(disp, mpg, pch = 20, cex = 5, col = cscale(hp, pal_seq_gradient(\"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 label_date() label_time() date/time format string using standard POSIX specification. See strptime() details. label_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/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/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 = NULL, suffix = NULL, big.mark = NULL, decimal.mark = NULL, 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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), pal_brewer()) ))"},{"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/get_palette.html","id":null,"dir":"Reference","previous_headings":"","what":"Known palettes — get_palette","title":"Known palettes — get_palette","text":"scales packages keeps track set palettes considers 'known'. benefit known palette can called name functions as_continuous_pal() as_discrete_pal().","code":""},{"path":"https://scales.r-lib.org/dev/reference/get_palette.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Known palettes — get_palette","text":"","code":"get_palette(name, ...) set_palette(name, palette, warn_conflict = TRUE) palette_names() reset_palettes()"},{"path":"https://scales.r-lib.org/dev/reference/get_palette.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Known palettes — get_palette","text":"name string giving palette name. ... Additional arguments pass palette function palette class function. palette palette, function character vector. warn_conflict boolean TRUE (default), warns replacing known palette.","code":""},{"path":"https://scales.r-lib.org/dev/reference/get_palette.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Known palettes — get_palette","text":"get_palette() function returns palette. set_palette() function called side effects returns nothing.","code":""},{"path":"https://scales.r-lib.org/dev/reference/get_palette.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Known palettes — get_palette","text":"","code":"# Get one of the known palettes get_palette(\"hue\") #> function (n) #> { #> if (n == 0) { #> cli::cli_abort(\"Must request at least one colour from a hue palette.\") #> } #> if ((diff(h)%%360) < 1) { #> h[2] <- h[2] - 360/n #> } #> hues <- seq(h[1], h[2], length.out = n) #> hues <- (hues + h.start)%%360 #> hcl <- cbind(hues, c, l) #> pal <- farver::encode_colour(hcl, from = \"hcl\") #> if (direction == -1) { #> rev(pal) #> } #> else { #> pal #> } #> } #> #> #> attr(,\"class\") #> [1] \"pal_discrete\" \"scales_pal\" \"function\" #> attr(,\"type\") #> [1] \"colour\" #> attr(,\"nlevels\") #> [1] 255 # Set a new custom palette cols <- c(\"palegreen\", \"deepskyblue\", \"magenta\") set_palette(\"aurora\", palette = cols) # Palette is now known \"aurora\" %in% palette_names() #> [1] TRUE as_continuous_pal(\"aurora\") #> function (x) #> { #> lab_out <- cbind(l_interp(x), u_interp(x), v_interp(x)) #> out <- farver::encode_colour(lab_out, alpha = alpha_interp(x), #> from = \"lab\") #> out[is.na(out)] <- na.color #> out #> } #> #> #> attr(,\"class\") #> [1] \"pal_continuous\" \"scales_pal\" \"function\" #> attr(,\"type\") #> [1] \"colour\" #> attr(,\"na_safe\") #> [1] FALSE # Resetting palettes reset_palettes()"},{"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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label. 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":"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_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 = NULL, suffix = NULL, big.mark = NULL, decimal.mark = NULL, 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. \"space\": preceded Unicode \"figure space\", .e., space equally wide number +. Compared \"none\", adding figure space can ensure numbers remain properly aligned left- right-justified. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label.","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, us, 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\", leading = \"0\" ) label_time(format = \"%H:%M:%S\", tz = \"UTC\", locale = NULL) label_timespan( unit = c(\"secs\", \"mins\", \"hours\", \"days\", \"weeks\"), space = FALSE, ... )"},{"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 label_date() label_time() date/time format string using standard POSIX specification. See strptime() details. label_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. leading string replace leading zeroes . Can \"\" disable leading characters \"\\u2007\" figure-spaces. unit unit used interpret numeric input space Add space time unit? ... 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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 = label_date(\"%m/%d\")) #> scale_x_datetime(labels = label_date(\"%m/%d\")) demo_datetime(two_months, labels = label_date(\"%e %b\", locale = \"fr\")) #> scale_x_datetime(labels = label_date(\"%e %b\", locale = \"fr\")) demo_datetime(two_months, labels = label_date(\"%e %B\", locale = \"es\")) #> scale_x_datetime(labels = label_date(\"%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_dictionary.html","id":null,"dir":"Reference","previous_headings":"","what":"Labels from lookup tables — label_dictionary","title":"Labels from lookup tables — label_dictionary","text":"Use label_dictionary() looking succinct breaks named character vector giving complete labels.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_dictionary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Labels from lookup tables — label_dictionary","text":"","code":"label_dictionary(dictionary = character(), nomatch = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/label_dictionary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Labels from lookup tables — label_dictionary","text":"dictionary named character vector labels. names expected match breaks, values become labels. nomatch string label breaks match name dictionary. NULL (default), breaks translated kept -.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_dictionary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Labels from lookup tables — label_dictionary","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_dictionary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Labels from lookup tables — label_dictionary","text":"","code":"# Example lookup table lut <- c( \"4\" = \"four wheel drive\", \"r\" = \"rear wheel drive\", \"f\" = \"front wheel drive\" ) # Typical usage demo_discrete(c(\"4\", \"r\", \"f\"), labels = label_dictionary(lut)) #> scale_x_discrete(labels = label_dictionary(lut)) # By default, extra values ('w') will remain as-is demo_discrete(c(\"4\", \"r\", \"f\", \"w\"), labels = label_dictionary(lut)) #> scale_x_discrete(labels = label_dictionary(lut)) # Alternatively, you can relabel extra values demo_discrete( c(\"4\", \"r\", \"f\", \"w\"), labels = label_dictionary(lut, nomatch = \"unknown\") ) #> scale_x_discrete(labels = label_dictionary(lut, nomatch = \"unknown\"))"},{"path":"https://scales.r-lib.org/dev/reference/label_glue.html","id":null,"dir":"Reference","previous_headings":"","what":"Interpolated labels — label_glue","title":"Interpolated labels — label_glue","text":"Use label_glue() perform string interpolation using glue package. Enclosed expressions evaluated R code.","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_glue.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Interpolated labels — label_glue","text":"","code":"label_glue(pattern = \"{x}\", ..., parse = FALSE, .envir = caller_env())"},{"path":"https://scales.r-lib.org/dev/reference/label_glue.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Interpolated labels — label_glue","text":"pattern glue string used formatting. x variable holds breaks, \"{x}\" (default) returns breaks -. ... Arguments passed glue::glue(). parse Whether return labels expressions. .envir [environment: parent.frame()] Environment evaluate expression . Expressions evaluated left right. .x environment, expressions evaluated environment .envir ignored. NULL passed, equivalent emptyenv().","code":""},{"path":"https://scales.r-lib.org/dev/reference/label_glue.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Interpolated labels — label_glue","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_glue.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Interpolated labels — label_glue","text":"","code":"# Example variables animal <- \"penguin\" species <- c(\"Adelie\", \"Chinstrap\", \"Emperor\", \"Gentoo\") # Typical use, note that {x} will become the breaks demo_discrete(species, labels = label_glue(\"The {x}\\n{animal}\")) #> scale_x_discrete(labels = label_glue(\"The {x}\\n{animal}\")) # It adapts to the breaks that are present demo_discrete(species[-3], labels = label_glue(\"The {x}\\n{animal}\")) #> scale_x_discrete(labels = label_glue(\"The {x}\\n{animal}\")) # Contrary to directly glueing species + animal, which results in mislabelling! demo_discrete(species[-3], labels = glue::glue(\"The {species}\\n{animal}\")) #> scale_x_discrete(labels = glue::glue(\"The {species}\\n{animal}\"))"},{"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() format_log() display numbers base^exponent, using superscript formatting. label_log() returns expressions suitable labelling scales, whereas format_log() returns deparsed text.","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, signed = NULL) format_log(x, base = 10, signed = NULL, ...)"},{"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(). signed + - displayed prefix? default, NULL, displays signs zeroes negative numbers present. x numeric vector format ... Passed 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)) format_log(c(0.1, 1, 10)) #> [1] \"10^-1\" \"10^ 0\" \"10^ 1\""},{"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 = NULL, decimal.mark = NULL, style_positive = NULL, style_negative = NULL, 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label. 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":"https://scales.r-lib.org/dev/reference/label_number_auto.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label numbers, avoiding scientific notation where possible — label_number_auto","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_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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label. 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_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 = NULL, rules = NULL, ...) 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. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label. 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 = NULL, decimal.mark = NULL, 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. \"space\": preceded Unicode \"figure space\", .e., space equally wide number +. Compared \"none\", adding figure space can ensure numbers remain properly aligned left- right-justified. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label.","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 = NULL, 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. default (NULL) retrieves setting number options. prefix character vector length 3 giving prefixes put front numbers. default values c(\"p<\", \"p=\", \"p>\") add_p TRUE c(\"<\", \"\", \">\") 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 = NULL, 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. default (NULL) retrieves setting number options. 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/minor_breaks_log.html","id":null,"dir":"Reference","previous_headings":"","what":"Minor breaks for log-10 axes — minor_breaks_log","title":"Minor breaks for log-10 axes — minor_breaks_log","text":"break function designed mark every power, multiples 5 /1 power base 10.","code":""},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_log.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Minor breaks for log-10 axes — minor_breaks_log","text":"","code":"minor_breaks_log(detail = NULL, smallest = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_log.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Minor breaks for log-10 axes — minor_breaks_log","text":"detail 1, 5 10 mark multiples powers, multiples 5 powers just powers respectively. smallest Smallest absolute value mark range includes negative numbers.","code":""},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_log.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Minor breaks for log-10 axes — minor_breaks_log","text":"function generate minor ticks.","code":""},{"path":"https://scales.r-lib.org/dev/reference/minor_breaks_log.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Minor breaks for log-10 axes — minor_breaks_log","text":"","code":"# Standard usage with log10 scale demo_log10(c(1, 1e10), minor_breaks = minor_breaks_log()) #> scale_x_log10(minor_breaks = minor_breaks_log()) # Increasing detail over many powers demo_log10(c(1, 1e10), minor_breaks = minor_breaks_log(detail = 1)) #> scale_x_log10(minor_breaks = minor_breaks_log(detail = 1)) # Adjusting until where to draw minor breaks demo_continuous( c(-1000, 1000), transform = asinh_trans(), minor_breaks = minor_breaks_log(smallest = 1) ) #> scale_x_continuous(transform = asinh_trans(), minor_breaks = minor_breaks_log(smallest = 1))"},{"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":[]},{"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/new_continuous_palette.html","id":null,"dir":"Reference","previous_headings":"","what":"Constructors for palettes — new_continuous_palette","title":"Constructors for palettes — new_continuous_palette","text":"constructor functions attach metadata palette functions. metadata can used testing coercion.","code":""},{"path":"https://scales.r-lib.org/dev/reference/new_continuous_palette.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Constructors for palettes — new_continuous_palette","text":"","code":"new_continuous_palette(fun, type, na_safe = NA) new_discrete_palette(fun, type, nlevels = NA) is_pal(x) is_continuous_pal(x) is_discrete_pal(x) is_colour_pal(x) is_numeric_pal(x) palette_nlevels(pal) palette_na_safe(pal) palette_type(pal) as_discrete_pal(x, ...) as_continuous_pal(x, ...)"},{"path":"https://scales.r-lib.org/dev/reference/new_continuous_palette.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Constructors for palettes — new_continuous_palette","text":"fun function serve palette. continuous palettes, typically take vectors numeric values (0, 1) return vector equal length. discrete palettes, typically take scalar integer return vector length. type string giving type return values. example strings include \"colour\", \"numeric\", \"linetype\" \"shape\". na_safe boolean indicating whether NA values translated palette values (TRUE) kept NA (FALSE). Applies continuous palettes. nlevels integer giving number distinct palette values can returned discrete palette. x object test coerce. pal palette retrieve properties . ... Additional arguments. Currently use.","code":""},{"path":"https://scales.r-lib.org/dev/reference/new_continuous_palette.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Constructors for palettes — new_continuous_palette","text":"new_continuous_palette(), new_discret_palette(), as_discrete_pal() as_continuous_pal(): function class pal_continuous pal_discrete. is_pal(), is_continuous_pal(), is_discret_pal(), is_colour_pal(), is_numeric_pal(): logical value length 1. palette_nlevels() single integer. palette_na_safe() boolean. palette_type() string.","code":""},{"path":"https://scales.r-lib.org/dev/reference/new_continuous_palette.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Constructors for palettes — new_continuous_palette","text":"","code":"# Creating a new discrete palette new_discrete_palette( fun = grDevices::terrain.colors, type = \"colour\", nlevels = 255 ) #> function (n, alpha, rev = FALSE) #> { #> if ((n <- as.integer(n[1L])) > 0) { #> k <- n%/%2 #> h <- c(4/12, 2/12, 0/12) #> s <- c(1, 1, 0) #> v <- c(0.65, 0.9, 0.95) #> alpha <- if (missing(alpha) || is.null(alpha)) #> NULL #> else rep_len(alpha, n) #> cols <- c(hsv(h = seq.int(h[1L], h[2L], length.out = k), #> s = seq.int(s[1L], s[2L], length.out = k), v = seq.int(v[1L], #> v[2L], length.out = k), alpha = alpha[seq_len(k)]), #> hsv(h = seq.int(h[2L], h[3L], length.out = n - k + #> 1)[-1L], s = seq.int(s[2L], s[3L], length.out = n - #> k + 1)[-1L], v = seq.int(v[2L], v[3L], length.out = n - #> k + 1)[-1L], alpha = alpha[k + seq_len(n - k)])) #> if (rev) #> rev(cols) #> else cols #> } #> else character() #> } #> #> #> attr(,\"class\") #> [1] \"pal_discrete\" \"scales_pal\" \"function\" #> attr(,\"type\") #> [1] \"colour\" #> attr(,\"nlevels\") #> [1] 255 # Creating a new continuous palette new_continuous_palette( fun = function(x) rescale(x, to = c(1, 0)), type = \"numeric\", na_safe = FALSE ) #> function (x) #> rescale(x, to = c(1, 0)) #> #> attr(,\"class\") #> [1] \"pal_continuous\" \"scales_pal\" \"function\" #> attr(,\"type\") #> [1] \"numeric\" #> attr(,\"na_safe\") #> [1] FALSE # Testing palette properties is_continuous_pal(pal_seq_gradient()) #> [1] TRUE is_discrete_pal(pal_viridis()) #> [1] TRUE is_numeric_pal(pal_area()) #> [1] TRUE is_colour_pal(pal_manual(c(\"red\", \"green\"))) #> [1] TRUE is_pal(transform_log10()) #> [1] FALSE # Extracting properties palette_nlevels(pal_viridis()) #> [1] 255 palette_na_safe(colour_ramp(c(\"red\", \"green\"), na.color = \"grey50\")) #> [1] TRUE palette_type(pal_shape()) #> [1] \"shape\" # Switching discrete to continuous pal <- as_continuous_pal(pal_viridis()) show_col(pal(c(0, 0.1, 0.2, 0.4, 1))) # Switching continuous to discrete pal <- as_discrete_pal(pal_div_gradient()) show_col(pal(9))"},{"path":"https://scales.r-lib.org/dev/reference/new_transform.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new transformation object — new_transform","title":"Create a new transformation object — new_transform","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/new_transform.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new transformation object — new_transform","text":"","code":"new_transform( name, transform, inverse, d_transform = NULL, d_inverse = NULL, breaks = extended_breaks(), minor_breaks = regular_minor_breaks(), format = format_format(), domain = c(-Inf, Inf) ) 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.transform(x) is.trans(x) as.transform(x, arg = deparse(substitute(x))) as.trans(x, arg = deparse(substitute(x)))"},{"path":"https://scales.r-lib.org/dev/reference/new_transform.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new transformation object — new_transform","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/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 = NULL, decimal.mark = NULL, style_positive = NULL, style_negative = NULL, scale_cut = NULL, trim = TRUE, ... ) cut_short_scale(space = FALSE) cut_long_scale(space = FALSE) cut_time_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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. 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\". division creates irrational value (one many digits), cut value tried see improves look final label. 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/number_options.html","id":null,"dir":"Reference","previous_headings":"","what":"Number options — number_options","title":"Number options — number_options","text":"Control settings formatting numbers globally.","code":""},{"path":"https://scales.r-lib.org/dev/reference/number_options.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Number options — number_options","text":"","code":"number_options( decimal.mark = \".\", big.mark = \" \", style_positive = c(\"none\", \"plus\", \"space\"), style_negative = c(\"hyphen\", \"minus\", \"parens\"), currency.prefix = \"$\", currency.suffix = \"\", currency.decimal.mark = decimal.mark, currency.big.mark = setdiff(c(\".\", \",\"), currency.decimal.mark)[1], ordinal.rules = ordinal_english() )"},{"path":"https://scales.r-lib.org/dev/reference/number_options.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Number options — number_options","text":"decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. big.mark Character used every 3 digits separate thousands. default (NULL) retrieves setting number options. 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. default (NULL) retrieves setting number options. style_negative string determines style negative numbers: \"hyphen\" (default): preceded standard hyphen -, e.g. -1. \"minus\", uses proper Unicode minus symbol. typographical nicety ensures - aligns horizontal bar horizontal bar +. \"parens\", wrapped parentheses, e.g. (1). default (NULL) retrieves setting number options. currency.prefix, currency.suffix, currency.decimal.mark, currency.big.mark Settings label_currency() passed without currency.-prefix. ordinal.rules Setting label_ordinal() passed without ordinal.-prefix.","code":""},{"path":"https://scales.r-lib.org/dev/reference/number_options.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Number options — number_options","text":"old options invisibly","code":""},{"path":"https://scales.r-lib.org/dev/reference/number_options.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Number options — number_options","text":"","code":"# Default number formatting x <- c(0.1, 1, 1000) label_number()(x) #> [1] \"0.1\" \"1.0\" \"1 000.0\" # Now again with new options set number_options(style_positive = \"plus\", decimal.mark = \",\") label_number()(x) #> [1] \"+0,1\" \"+1,0\" \"+1 000,0\" # The options are the argument names with a 'scales.'-prefix options(\"scales.style_positive\") #> $scales.style_positive #> [1] \"plus\" #> # Resetting the options to their defaults number_options() label_number()(x) #> [1] \"0.1\" \"1.0\" \"1 000.0\""},{"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 = NULL, rules = NULL, ...) ordinal(x, prefix = \"\", suffix = \"\", big.mark = \" \", rules = NULL, ...)"},{"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. default (NULL) retrieves setting number options. 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/pal_area.html","id":null,"dir":"Reference","previous_headings":"","what":"Area palettes (continuous) — pal_area","title":"Area palettes (continuous) — pal_area","text":"Area palettes (continuous)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_area.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Area palettes (continuous) — pal_area","text":"","code":"pal_area(range = c(1, 6)) area_pal(range = c(1, 6)) abs_area(max)"},{"path":"https://scales.r-lib.org/dev/reference/pal_area.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Area palettes (continuous) — pal_area","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/pal_brewer.html","id":null,"dir":"Reference","previous_headings":"","what":"Colour Brewer palette (discrete) — pal_brewer","title":"Colour Brewer palette (discrete) — pal_brewer","text":"Colour Brewer palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_brewer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Colour Brewer palette (discrete) — pal_brewer","text":"","code":"pal_brewer(type = \"seq\", palette = 1, direction = 1) brewer_pal(type = \"seq\", palette = 1, direction = 1)"},{"path":"https://scales.r-lib.org/dev/reference/pal_brewer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Colour Brewer palette (discrete) — pal_brewer","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/pal_brewer.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Colour Brewer palette (discrete) — pal_brewer","text":"https://colorbrewer2.org","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_brewer.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Colour Brewer palette (discrete) — pal_brewer","text":"","code":"show_col(pal_brewer()(10)) #> Warning: n too large, allowed maximum for palette Blues is 9 #> Returning the palette you asked for with that many colors show_col(pal_brewer(\"div\")(5)) show_col(pal_brewer(palette = \"Greens\")(5)) # Can use with gradient_n to create a continuous gradient cols <- pal_brewer(\"div\")(5) show_col(pal_gradient_n(cols)(seq(0, 1, length.out = 30)))"},{"path":"https://scales.r-lib.org/dev/reference/pal_dichromat.html","id":null,"dir":"Reference","previous_headings":"","what":"Dichromat (colour-blind) palette (discrete) — pal_dichromat","title":"Dichromat (colour-blind) palette (discrete) — pal_dichromat","text":"Dichromat (colour-blind) palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_dichromat.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dichromat (colour-blind) palette (discrete) — pal_dichromat","text":"","code":"pal_dichromat(name) dichromat_pal(name)"},{"path":"https://scales.r-lib.org/dev/reference/pal_dichromat.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dichromat (colour-blind) palette (discrete) — pal_dichromat","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/pal_dichromat.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dichromat (colour-blind) palette (discrete) — pal_dichromat","text":"","code":"if (requireNamespace(\"dichromat\", quietly = TRUE)) { show_col(pal_dichromat(\"BluetoOrange.10\")(10)) show_col(pal_dichromat(\"BluetoOrange.10\")(5)) # Can use with gradient_n to create a continuous gradient cols <- pal_dichromat(\"DarkRedtoBlue.12\")(12) show_col(pal_gradient_n(cols)(seq(0, 1, length.out = 30))) }"},{"path":"https://scales.r-lib.org/dev/reference/pal_div_gradient.html","id":null,"dir":"Reference","previous_headings":"","what":"Diverging colour gradient (continuous). — pal_div_gradient","title":"Diverging colour gradient (continuous). — pal_div_gradient","text":"Diverging colour gradient (continuous).","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_div_gradient.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Diverging colour gradient (continuous). — pal_div_gradient","text":"","code":"pal_div_gradient( low = \"#2B6788\", mid = \"#CBCBCB\", high = \"#90503F\", space = \"Lab\" ) div_gradient_pal( low = \"#2B6788\", mid = \"#CBCBCB\", high = \"#90503F\", space = \"Lab\" )"},{"path":"https://scales.r-lib.org/dev/reference/pal_div_gradient.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Diverging colour gradient (continuous). — pal_div_gradient","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/pal_div_gradient.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Diverging colour gradient (continuous). — pal_div_gradient","text":"","code":"x <- seq(-1, 1, length.out = 100) r <- sqrt(outer(x^2, x^2, \"+\")) image(r, col = pal_div_gradient()(seq(0, 1, length.out = 12))) image(r, col = pal_div_gradient()(seq(0, 1, length.out = 30))) image(r, col = pal_div_gradient()(seq(0, 1, length.out = 100))) pal <- pal_div_gradient(low = \"#2E6A70\") image(r, col = pal(seq(0, 1, length.out = 100)))"},{"path":"https://scales.r-lib.org/dev/reference/pal_gradient_n.html","id":null,"dir":"Reference","previous_headings":"","what":"Arbitrary colour gradient palette (continuous) — pal_gradient_n","title":"Arbitrary colour gradient palette (continuous) — pal_gradient_n","text":"Arbitrary colour gradient palette (continuous)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_gradient_n.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arbitrary colour gradient palette (continuous) — pal_gradient_n","text":"","code":"pal_gradient_n(colours, values = NULL, space = \"Lab\") gradient_n_pal(colours, values = NULL, space = \"Lab\")"},{"path":"https://scales.r-lib.org/dev/reference/pal_gradient_n.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Arbitrary colour gradient palette (continuous) — pal_gradient_n","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/pal_grey.html","id":null,"dir":"Reference","previous_headings":"","what":"Grey scale palette (discrete) — pal_grey","title":"Grey scale palette (discrete) — pal_grey","text":"Grey scale palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_grey.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Grey scale palette (discrete) — pal_grey","text":"","code":"pal_grey(start = 0.2, end = 0.8) grey_pal(start = 0.2, end = 0.8)"},{"path":"https://scales.r-lib.org/dev/reference/pal_grey.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Grey scale palette (discrete) — pal_grey","text":"start grey value low end palette end grey value high end palette","code":""},{"path":[]},{"path":"https://scales.r-lib.org/dev/reference/pal_grey.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Grey scale palette (discrete) — pal_grey","text":"","code":"show_col(pal_grey()(25)) show_col(pal_grey(0, 1)(25))"},{"path":"https://scales.r-lib.org/dev/reference/pal_hue.html","id":null,"dir":"Reference","previous_headings":"","what":"Hue palette (discrete) — pal_hue","title":"Hue palette (discrete) — pal_hue","text":"Hue palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_hue.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Hue palette (discrete) — pal_hue","text":"","code":"pal_hue(h = c(0, 360) + 15, c = 100, l = 65, h.start = 0, direction = 1) hue_pal(h = c(0, 360) + 15, c = 100, l = 65, h.start = 0, direction = 1)"},{"path":"https://scales.r-lib.org/dev/reference/pal_hue.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Hue palette (discrete) — pal_hue","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/pal_hue.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Hue palette (discrete) — pal_hue","text":"","code":"show_col(pal_hue()(4)) show_col(pal_hue()(9)) show_col(pal_hue(l = 90)(9)) show_col(pal_hue(l = 30)(9)) show_col(pal_hue()(9)) show_col(pal_hue(direction = -1)(9)) show_col(pal_hue(h.start = 30)(9)) show_col(pal_hue(h.start = 90)(9)) show_col(pal_hue()(9)) show_col(pal_hue(h = c(0, 90))(9)) show_col(pal_hue(h = c(90, 180))(9)) show_col(pal_hue(h = c(180, 270))(9)) show_col(pal_hue(h = c(270, 360))(9))"},{"path":"https://scales.r-lib.org/dev/reference/pal_identity.html","id":null,"dir":"Reference","previous_headings":"","what":"Identity palette — pal_identity","title":"Identity palette — pal_identity","text":"Leaves values unchanged - useful data already scaled.","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_identity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identity palette — pal_identity","text":"","code":"pal_identity() identity_pal()"},{"path":"https://scales.r-lib.org/dev/reference/pal_linetype.html","id":null,"dir":"Reference","previous_headings":"","what":"Line type palette (discrete) — pal_linetype","title":"Line type palette (discrete) — pal_linetype","text":"Based set supplied Richard Pearson, University Manchester","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_linetype.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Line type palette (discrete) — pal_linetype","text":"","code":"pal_linetype() linetype_pal()"},{"path":"https://scales.r-lib.org/dev/reference/pal_manual.html","id":null,"dir":"Reference","previous_headings":"","what":"Manual palette (discrete) — pal_manual","title":"Manual palette (discrete) — pal_manual","text":"Manual palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_manual.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Manual palette (discrete) — pal_manual","text":"","code":"pal_manual(values, type = NULL) manual_pal(values, type = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/pal_manual.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Manual palette (discrete) — pal_manual","text":"values vector values used palette. type string giving type return values. example strings include \"colour\", \"numeric\", \"linetype\" \"shape\".","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_rescale.html","id":null,"dir":"Reference","previous_headings":"","what":"Rescale palette (continuous) — pal_rescale","title":"Rescale palette (continuous) — pal_rescale","text":"Just rescales input specific output range. Useful alpha, size, continuous position.","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_rescale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rescale palette (continuous) — pal_rescale","text":"","code":"pal_rescale(range = c(0.1, 1)) rescale_pal(range = c(0.1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/pal_rescale.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rescale palette (continuous) — pal_rescale","text":"range Numeric vector length two, giving range possible values. 0 1.","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_seq_gradient.html","id":null,"dir":"Reference","previous_headings":"","what":"Sequential colour gradient palette (continuous) — pal_seq_gradient","title":"Sequential colour gradient palette (continuous) — pal_seq_gradient","text":"Sequential colour gradient palette (continuous)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_seq_gradient.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sequential colour gradient palette (continuous) — pal_seq_gradient","text":"","code":"pal_seq_gradient(low = \"#2B6788\", high = \"#90503F\", space = \"Lab\") seq_gradient_pal(low = \"#2B6788\", high = \"#90503F\", space = \"Lab\")"},{"path":"https://scales.r-lib.org/dev/reference/pal_seq_gradient.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sequential colour gradient palette (continuous) — pal_seq_gradient","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/pal_seq_gradient.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sequential colour gradient palette (continuous) — pal_seq_gradient","text":"","code":"x <- seq(0, 1, length.out = 25) show_col(pal_seq_gradient()(x)) show_col(pal_seq_gradient(\"white\", \"black\")(x)) show_col(pal_seq_gradient(\"white\", \"#90503F\")(x))"},{"path":"https://scales.r-lib.org/dev/reference/pal_shape.html","id":null,"dir":"Reference","previous_headings":"","what":"Shape palette (discrete) — pal_shape","title":"Shape palette (discrete) — pal_shape","text":"Shape palette (discrete)","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_shape.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Shape palette (discrete) — pal_shape","text":"","code":"pal_shape(solid = TRUE) shape_pal(solid = TRUE)"},{"path":"https://scales.r-lib.org/dev/reference/pal_shape.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shape palette (discrete) — pal_shape","text":"solid shapes solid ?","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_viridis.html","id":null,"dir":"Reference","previous_headings":"","what":"Viridis palette — pal_viridis","title":"Viridis palette — pal_viridis","text":"Viridis palette","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_viridis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Viridis palette — pal_viridis","text":"","code":"pal_viridis(alpha = 1, begin = 0, end = 1, direction = 1, option = \"D\") viridis_pal(alpha = 1, begin = 0, end = 1, direction = 1, option = \"D\")"},{"path":"https://scales.r-lib.org/dev/reference/pal_viridis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Viridis palette — pal_viridis","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/pal_viridis.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Viridis palette — pal_viridis","text":"https://bids.github.io/colormap/","code":""},{"path":"https://scales.r-lib.org/dev/reference/pal_viridis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Viridis palette — pal_viridis","text":"","code":"show_col(pal_viridis()(10)) show_col(pal_viridis(direction = -1)(6)) show_col(pal_viridis(begin = 0.2, end = 0.8)(4)) show_col(pal_viridis(option = \"plasma\")(6))"},{"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 = NULL, decimal.mark = NULL, trim = TRUE, ... ) percent( x, accuracy = NULL, scale = 100, prefix = \"\", suffix = \"%\", big.mark = NULL, decimal.mark = NULL, 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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/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 = NULL, prefix = NULL, add_p = FALSE ) pvalue(x, accuracy = 0.001, decimal.mark = NULL, 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. default (NULL) retrieves setting number options. prefix character vector length 3 giving prefixes put front numbers. default values c(\"p<\", \"p=\", \"p>\") add_p TRUE c(\"<\", \"\", \">\") FALSE. add_p Add \"p=\" value?","code":""},{"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 class 'numeric' rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for class 'dist' rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for class 'logical' rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for class 'POSIXt' rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for class 'Date' rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for class 'integer64' rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE), ...) # S3 method for class 'difftime' rescale(x, to = c(0, 1), from = range(x, na.rm = TRUE, finite = TRUE), ...) # S3 method for class '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.21001519 0.41290535 0.66712325 0.50351607 0.65848580 0.50771840 #> [7] 0.83627250 0.70762450 0.87549823 0.00000000 0.88974976 0.99944738 #> [13] 0.49594687 0.35263170 0.77473537 0.58147836 0.63171229 0.85972839 #> [19] 0.56363718 0.24509291 0.92075572 0.86854100 0.24056859 0.39719599 #> [25] 0.76937432 0.10960476 0.18592775 0.15535605 0.66137523 0.85760628 #> [31] 0.92861359 0.54890553 0.57395911 0.68597526 0.23669156 0.03362819 #> [37] 0.91167459 0.06007810 1.00000000 0.60926082 0.16346393 0.91125487 #> [43] 0.02635611 0.59069130 0.22883630 0.90806463 0.81934612 0.69854017 #> [49] 0.21160774 0.72711865 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.217159935 0.456388813 0.332915461 0.568550264 0.252293408 #> [6] 0.464174887 0.917979544 0.973182440 0.819367212 0.903237712 #> [11] 0.581568164 0.773277228 0.995468995 0.711218429 0.215017323 #> [16] 0.291859063 0.722010659 0.866916994 0.238536008 0.004497871 #> [21] 0.943844491 0.438289525 0.750864286 0.668047940 0.408115039 #> [26] 0.351370931 0.738348169 0.664516441 0.085254330 0.856429803 #> [31] 0.077010086 0.853141306 0.106383934 0.484971372 0.247305059 #> [36] 0.686807906 0.163680084 0.953156062 0.321966448 0.361659809 #> [41] 0.888032047 0.828302288 0.100691452 0.906366579 0.772999015 #> [46] 0.383503955 1.000000000 0.349420487 0.947647614 0.216175106 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 class 'numeric' rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for class 'logical' rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for class 'dist' rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for class 'POSIXt' rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid, ...) # S3 method for class 'Date' rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid, ...) # S3 method for class 'integer64' rescale_mid(x, to = c(0, 1), from = range(x, na.rm = TRUE), mid = 0, ...) # S3 method for class '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.0161502545 0.1332311077 0.8664583930 0.2033757852 0.2004404969 #> [6] 0.0238313205 0.9599290915 0.2362372190 0.7907009264 0.2810220225 #> [11] 0.8881470385 0.2887909275 1.0000000000 0.5928984858 0.7679883783 #> [16] 0.8475260042 0.7717742081 0.4144511619 0.1257433910 0.0665635854 #> [21] 0.6612972385 0.6054793165 0.6623449638 0.3235016883 0.9958107811 #> [26] 0.7225179181 0.8853264986 0.9997501052 0.2089739211 0.6701359034 #> [31] 0.3858012835 0.0305971997 0.6208980503 0.6018302169 0.4036799634 #> [36] 0.8705370429 0.5182836151 0.9956238106 0.0005595317 0.6793575095 #> [41] 0.3668838124 0.9322530215 0.6840421328 0.6707795067 0.7647648747 #> [46] 0.5442966948 0.2304051687 0.5091965925 0.4144454177 0.7346814140 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/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 thomas.pedersen@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 = NULL, trim = TRUE, ... ) scientific( x, digits = 3, scale = 1, prefix = \"\", suffix = \"\", decimal.mark = NULL, 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. default (NULL) retrieves setting number options. trim Logical, FALSE, values right-justified common width (see base::format()). ... arguments passed base::format().","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(pal_hue()(9)) show_col(pal_hue()(9), borders = NA) show_col(pal_viridis()(16)) show_col(pal_viridis()(16), labels = FALSE)"},{"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, call = caller_env())"},{"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 call call display error messages","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, fct = NA, call = caller_env() )"},{"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 fct Treat existing came factor (ie. sort range) call call display error messages","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/transform_asinh.html","id":null,"dir":"Reference","previous_headings":"","what":"Inverse Hyperbolic Sine transformation — transform_asinh","title":"Inverse Hyperbolic Sine transformation — transform_asinh","text":"Inverse Hyperbolic Sine transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_asinh.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Inverse Hyperbolic Sine transformation — transform_asinh","text":"","code":"transform_asinh() asinh_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_asinh.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Inverse Hyperbolic Sine transformation — transform_asinh","text":"","code":"plot(transform_asinh(), xlim = c(-1e2, 1e2))"},{"path":"https://scales.r-lib.org/dev/reference/transform_asn.html","id":null,"dir":"Reference","previous_headings":"","what":"Arc-sin square root transformation — transform_asn","title":"Arc-sin square root transformation — transform_asn","text":"variance stabilising transformation binomial distribution.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_asn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arc-sin square root transformation — transform_asn","text":"","code":"transform_asn() asn_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_asn.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Arc-sin square root transformation — transform_asn","text":"","code":"plot(transform_asn(), xlim = c(0, 1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_atanh.html","id":null,"dir":"Reference","previous_headings":"","what":"Arc-tangent transformation — transform_atanh","title":"Arc-tangent transformation — transform_atanh","text":"Arc-tangent transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_atanh.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arc-tangent transformation — transform_atanh","text":"","code":"transform_atanh() atanh_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_atanh.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Arc-tangent transformation — transform_atanh","text":"","code":"plot(transform_atanh(), xlim = c(-1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_boxcox.html","id":null,"dir":"Reference","previous_headings":"","what":"Box-Cox & modulus transformations — transform_boxcox","title":"Box-Cox & modulus transformations — transform_boxcox","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/transform_boxcox.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Box-Cox & modulus transformations — transform_boxcox","text":"","code":"transform_boxcox(p, offset = 0) boxcox_trans(p, offset = 0) transform_modulus(p, offset = 1) modulus_trans(p, offset = 1)"},{"path":"https://scales.r-lib.org/dev/reference/transform_boxcox.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Box-Cox & modulus transformations — transform_boxcox","text":"p Transformation exponent, \\(\\lambda\\). offset Constant offset. 0 Box-Cox type 1, otherwise non-negative constant (Box-Cox type 2). transform_modulus() sets default 1.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_boxcox.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Box-Cox & modulus transformations — transform_boxcox","text":"Box-Cox power transformation (type 1) requires strictly positive values takes following form \\(\\lambda > 0\\): $$y^{(\\lambda)} = \\frac{y^\\lambda - 1}{\\lambda}$$ \\(\\lambda = 0\\), natural log transform used. modulus transformation implements generalisation Box-Cox transformation works data positive negative values. equation takes following forms, \\(\\lambda \\neq 0\\) : $$y^{(\\lambda)} = sign(y) * \\frac{(|y| + 1)^\\lambda - 1}{\\lambda}$$ \\(\\lambda = 0\\): $$y^{(\\lambda)} = sign(y) * \\ln(|y| + 1)$$","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_boxcox.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Box-Cox & modulus transformations — transform_boxcox","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/transform_boxcox.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Box-Cox & modulus transformations — transform_boxcox","text":"","code":"plot(transform_boxcox(-1), xlim = c(0, 10)) plot(transform_boxcox(0), xlim = c(0, 10)) plot(transform_boxcox(1), xlim = c(0, 10)) plot(transform_boxcox(2), xlim = c(0, 10)) plot(transform_modulus(-1), xlim = c(-10, 10)) plot(transform_modulus(0), xlim = c(-10, 10)) plot(transform_modulus(1), xlim = c(-10, 10)) plot(transform_modulus(2), xlim = c(-10, 10))"},{"path":"https://scales.r-lib.org/dev/reference/transform_compose.html","id":null,"dir":"Reference","previous_headings":"","what":"Compose two or more transformations together — transform_compose","title":"Compose two or more transformations together — transform_compose","text":"transformer provides general mechanism composing two transformers together. important use case combine reverse transformations.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_compose.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compose two or more transformations together — transform_compose","text":"","code":"transform_compose(...) compose_trans(...)"},{"path":"https://scales.r-lib.org/dev/reference/transform_compose.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compose two or more transformations together — transform_compose","text":"... One transformers, either specified string individual transformer objects.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_compose.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compose two or more transformations together — transform_compose","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/transform_date.html","id":null,"dir":"Reference","previous_headings":"","what":"Transformation for dates (class Date) — transform_date","title":"Transformation for dates (class Date) — transform_date","text":"Transformation dates (class Date)","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_date.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transformation for dates (class Date) — transform_date","text":"","code":"transform_date() date_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_date.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Transformation for dates (class Date) — transform_date","text":"","code":"years <- seq(as.Date(\"1910/1/1\"), as.Date(\"1999/1/1\"), \"years\") t <- transform_date() 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/transform_exp.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential transformation (inverse of log transformation) — transform_exp","title":"Exponential transformation (inverse of log transformation) — transform_exp","text":"Exponential transformation (inverse log transformation)","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_exp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential transformation (inverse of log transformation) — transform_exp","text":"","code":"transform_exp(base = exp(1)) exp_trans(base = exp(1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_exp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential transformation (inverse of log transformation) — transform_exp","text":"base Base logarithm","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_exp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential transformation (inverse of log transformation) — transform_exp","text":"","code":"plot(transform_exp(0.5), xlim = c(-2, 2)) plot(transform_exp(1), xlim = c(-2, 2)) plot(transform_exp(2), xlim = c(-2, 2)) plot(transform_exp(), xlim = c(-2, 2))"},{"path":"https://scales.r-lib.org/dev/reference/transform_identity.html","id":null,"dir":"Reference","previous_headings":"","what":"Identity transformation (do nothing) — transform_identity","title":"Identity transformation (do nothing) — transform_identity","text":"Identity transformation (nothing)","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_identity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identity transformation (do nothing) — transform_identity","text":"","code":"transform_identity() identity_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_identity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identity transformation (do nothing) — transform_identity","text":"","code":"plot(transform_identity(), xlim = c(-1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_log.html","id":null,"dir":"Reference","previous_headings":"","what":"Log transformations — transform_log","title":"Log transformations — transform_log","text":"transform_log(): log(x) log1p(): log(x + 1) transform_pseudo_log(): smoothly transition linear scale around 0.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_log.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Log transformations — transform_log","text":"","code":"transform_log(base = exp(1)) transform_log10() transform_log2() transform_log1p() log_trans(base = exp(1)) log10_trans() log2_trans() log1p_trans() transform_pseudo_log(sigma = 1, base = exp(1)) pseudo_log_trans(sigma = 1, base = exp(1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_log.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Log transformations — transform_log","text":"base base logarithm sigma Scaling factor linear part pseudo-log transformation.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_log.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Log transformations — transform_log","text":"","code":"plot(transform_log2(), xlim = c(0, 5)) plot(transform_log(), xlim = c(0, 5)) plot(transform_log10(), xlim = c(0, 5)) plot(transform_log(), xlim = c(0, 2)) plot(transform_log1p(), xlim = c(-1, 1)) # The pseudo-log is defined for all real numbers plot(transform_pseudo_log(), xlim = c(-5, 5)) lines(transform_log(), xlim = c(0, 5), col = \"red\") # For large positives numbers it's very close to log plot(transform_pseudo_log(), xlim = c(1, 20)) lines(transform_log(), xlim = c(1, 20), col = \"red\")"},{"path":"https://scales.r-lib.org/dev/reference/transform_probability.html","id":null,"dir":"Reference","previous_headings":"","what":"Probability transformation — transform_probability","title":"Probability transformation — transform_probability","text":"Probability transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_probability.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Probability transformation — transform_probability","text":"","code":"transform_probability(distribution, ...) transform_logit() transform_probit() probability_trans(distribution, ...) logit_trans() probit_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_probability.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Probability transformation — transform_probability","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/transform_probability.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Probability transformation — transform_probability","text":"","code":"plot(transform_logit(), xlim = c(0, 1)) plot(transform_probit(), xlim = c(0, 1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_reciprocal.html","id":null,"dir":"Reference","previous_headings":"","what":"Reciprocal transformation — transform_reciprocal","title":"Reciprocal transformation — transform_reciprocal","text":"Reciprocal transformation","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_reciprocal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reciprocal transformation — transform_reciprocal","text":"","code":"transform_reciprocal() reciprocal_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_reciprocal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reciprocal transformation — transform_reciprocal","text":"","code":"plot(transform_reciprocal(), xlim = c(0, 1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_reverse.html","id":null,"dir":"Reference","previous_headings":"","what":"Reverse transformation — transform_reverse","title":"Reverse transformation — transform_reverse","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/transform_reverse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reverse transformation — transform_reverse","text":"","code":"transform_reverse() reverse_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_reverse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reverse transformation — transform_reverse","text":"","code":"plot(transform_reverse(), xlim = c(-1, 1))"},{"path":"https://scales.r-lib.org/dev/reference/transform_sqrt.html","id":null,"dir":"Reference","previous_headings":"","what":"Square-root transformation — transform_sqrt","title":"Square-root transformation — transform_sqrt","text":"variance stabilising transformation Poisson distribution.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_sqrt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Square-root transformation — transform_sqrt","text":"","code":"transform_sqrt() sqrt_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_sqrt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Square-root transformation — transform_sqrt","text":"","code":"plot(transform_sqrt(), xlim = c(0, 5))"},{"path":"https://scales.r-lib.org/dev/reference/transform_time.html","id":null,"dir":"Reference","previous_headings":"","what":"Transformation for date-times (class POSIXt) — transform_time","title":"Transformation for date-times (class POSIXt) — transform_time","text":"Transformation date-times (class POSIXt)","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_time.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transformation for date-times (class POSIXt) — transform_time","text":"","code":"transform_time(tz = NULL) time_trans(tz = NULL)"},{"path":"https://scales.r-lib.org/dev/reference/transform_time.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Transformation for date-times (class POSIXt) — transform_time","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/transform_time.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Transformation for date-times (class POSIXt) — transform_time","text":"","code":"hours <- seq(ISOdate(2000, 3, 20, tz = \"\"), by = \"hour\", length.out = 10) t <- transform_time() 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/transform_timespan.html","id":null,"dir":"Reference","previous_headings":"","what":"Transformation for times (class hms) — transform_timespan","title":"Transformation for times (class hms) — transform_timespan","text":"transform_timespan() provides transformations data encoding time passed along breaks label formatting showing standard unit time fitting range data. transform_hms() provides using standard hms idioms formatting.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_timespan.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transformation for times (class hms) — transform_timespan","text":"","code":"transform_timespan(unit = c(\"secs\", \"mins\", \"hours\", \"days\", \"weeks\")) timespan_trans(unit = c(\"secs\", \"mins\", \"hours\", \"days\", \"weeks\")) transform_hms() hms_trans()"},{"path":"https://scales.r-lib.org/dev/reference/transform_timespan.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Transformation for times (class hms) — transform_timespan","text":"unit unit used interpret numeric input","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_timespan.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Transformation for times (class hms) — transform_timespan","text":"","code":"# transform_timespan allows you to specify the time unit numeric data is # interpreted in trans_min <- transform_timespan(\"mins\") demo_timespan(seq(0, 100), trans = trans_min) #> scale_x_continuous(trans = trans_min) # Input already in difftime format is interpreted correctly demo_timespan(as.difftime(seq(0, 100), units = \"secs\"), trans = trans_min) #> scale_x_continuous(trans = trans_min) if (require(\"hms\")) { # transform_hms always assumes seconds hms <- round(runif(10) * 86400) t <- transform_hms() 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/transform_yj.html","id":null,"dir":"Reference","previous_headings":"","what":"Yeo-Johnson transformation — transform_yj","title":"Yeo-Johnson transformation — transform_yj","text":"Yeo-Johnson transformation flexible transformation similar Box-Cox, transform_boxcox(), require input values greater zero.","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_yj.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Yeo-Johnson transformation — transform_yj","text":"","code":"transform_yj(p) yj_trans(p)"},{"path":"https://scales.r-lib.org/dev/reference/transform_yj.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Yeo-Johnson transformation — transform_yj","text":"p Transformation exponent, \\(\\lambda\\).","code":""},{"path":"https://scales.r-lib.org/dev/reference/transform_yj.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Yeo-Johnson transformation — transform_yj","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/transform_yj.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Yeo-Johnson transformation — transform_yj","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/transform_yj.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Yeo-Johnson transformation — transform_yj","text":"","code":"plot(transform_yj(-1), xlim = c(-10, 10)) plot(transform_yj(0), xlim = c(-10, 10)) plot(transform_yj(1), xlim = c(-10, 10)) plot(transform_yj(2), xlim = c(-10, 10))"},{"path":"https://scales.r-lib.org/dev/reference/trim_to_domain.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute range of transformed values — trim_to_domain","title":"Compute range of transformed values — trim_to_domain","text":"Silently drops ranges outside domain transform.","code":""},{"path":"https://scales.r-lib.org/dev/reference/trim_to_domain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute range of transformed values — trim_to_domain","text":"","code":"trim_to_domain(transform, x) trans_range(transform, x)"},{"path":"https://scales.r-lib.org/dev/reference/trim_to_domain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute range of transformed values — trim_to_domain","text":"transform 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 = NULL, decimal.mark = NULL, 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. default (NULL) retrieves setting number options. decimal.mark character used indicate numeric decimal point. default (NULL) retrieves setting number options. 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/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/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":"New label_glue() labelling function interpolated strings (#457). fullseq() extension breaks_width() can now deal unsorted ranges (#435). New label_date_short(leading) argument replace leading zeroes (#442) breaks_pretty() return input limit range (#446) transform_exp() now sensible breaks, available breaks_exp() (@teunbrand, #405). scales package now keeps track known palettes. can retrieved using get_palette() registered using set_palette() (#396). label_log() signed argument displaying negative numbers (@teunbrand, #421). New label_dictionary() named lookup labels (#458). New function compose_label() chain together label formatting functions (#462)","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"scales-130","dir":"Changelog","previous_headings":"","what":"scales 1.3.0","title":"scales 1.3.0","text":"CRAN release: 2023-11-28","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"better-type-support-1-3-0","dir":"Changelog","previous_headings":"","what":"Better type support","title":"scales 1.3.0","text":"rescale((x), ...) rescale_mid((x), ...) return (x) unaltered (@teunbrand, #403). Add rescale method difftime objects (#382) 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, transform_timespan() wraps together provides alternative transform_hms() (#212)","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"ranges-1-3-0","dir":"Changelog","previous_headings":"","what":"Ranges","title":"scales 1.3.0","text":"train_continuous() coerces new numeric calculating range (@teunbrand, #369). Training factor data longer sorts range multiple training passes new fct argument train_discrete() used (#383) DiscreteRange class now keeps track whether trained factor data. Attempt make sort behavior range consistent character vectors training. Mixing character factor data make factor level order take precedence matter training starts charactor vector","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"transformations-1-3-0","dir":"Changelog","previous_headings":"","what":"Transformations","title":"scales 1.3.0","text":"Transformation function renamed transform_*-prefixed names instead *_trans-suffixed names. allows better tab-completion search transformations. S3 class transformations renamed \"trans\" \"transform\". new_transform() replaces trans_new() trim_to_domain() replaces trans_range(). old functions kept posterity. transform_sqrt() longer returns inverse values outside domain (#214) Add inverse (area) hyperbolic sine transformation transform_asinh(), provides logarithm-like transformation space, accommodates negative values (#297) Correct domain calculation transform_compose() (@mjskay, #408). Transformation objects can optionally include derivatives transform inverse transform (@mjskay, #322).","code":""},{"path":"https://scales.r-lib.org/dev/news/index.html","id":"misc-1-3-0","dir":"Changelog","previous_headings":"","what":"Misc","title":"scales 1.3.0","text":"scale_cut argument number() now works advertised values lowest cut value (#346) scale_cut now choose appropriate cut case first cut creating irrational-ish number. 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) Palette functions now pal_-prefix. old _pal-suffixed versions kept backward compatibility.","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":""}]