Learn R Programming

⚠️There's a newer version (1.4.0) of this package.Take me there.

scales (version 0.2.5)

Scale Functions for Visualization

Description

Graphical scales map data to aesthetics, and provide methods for automatically determining breaks and labels for axes and legends.

Copy Link

Version

Install

install.packages('scales')

Monthly Downloads

867,944

Version

0.2.5

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Hadley Wickham

Last Published

June 12th, 2015

Functions in scales (0.2.5)

rescale_mid

Rescale numeric vector to have specified minimum, midpoint, and maximum.
dollar_format

Currency formatter: round to nearest cent and display dollar sign.
asn_trans

Arc-sin square root transformation.
boxcox_trans

Box-Cox power transformation.
date_trans

Transformation for dates (class Date).
trans_range

Compute range of transformed values.
expand_range

Expand a range with a multiplicative or additive constant.
dichromat_pal

Dichromat (colour-blind) palette (discrete).
colour_ramp

Fast color interpolation
rescale_pal

Rescale palette (continuous).
cscale

Continuous scale.
date_format

Formatted dates.
atanh_trans

Arc-tangent transformation.
zero_range

Determine if range of vector is close to zero, with a specified tolerance
linetype_pal

Line type palette (discrete).
ordinal_format

Ordinal formatter: add ordinal suffixes (-st, -nd, -rd, -th) to numbers.
shape_pal

Shape palette (discrete).
rescale_max

Rescale numeric vector to have specified maximum.
pretty_breaks

unit_format

Add units to the labels
scientific_format

Scientific formatter.
censor

Censor any values outside of range.
reverse_trans

Reverse transformation.
col_numeric

Color mapping
identity_pal

Identity palette.
div_gradient_pal

Diverging colour gradient (continous).
probability_trans

Probability transformation.
log1p_trans

Log plus one transformation.
hue_pal

Hue palette (discrete).
abs_area

Point area palette (continuous), with area proportional to value.
cbreaks

Compute breaks for continuous scale.
sqrt_trans

Square-root transformation.
comma_format

Comma formatter: format number with commas separating thousands.
as.trans

Convert character string to transformer.
reciprocal_trans

Reciprocal transformation.
log_trans

Log transformation.
log_breaks

Log breaks (integer breaks on log-transformed scales).
trans_format

Format labels after transformation.
rescale_none

Don't peform rescaling
area_pal

Point area palette (continuous).
squish

Squish values into range.
wrap_format

Wrap text to a specified width, adding newlines for spaces if text exceeds the width
col2hcl

Modify standard R colour in hcl colour space.
trans_new

Create a new transformation object.
package-scales

Generic plot scaling methods
seq_gradient_pal

Sequential colour gradient palette (continous).
exp_trans

Exponential transformation (inverse of log transformation).
discard

Discard any values outside of range.
squish_infinite

Squish infinite values to range.
parse_format

Parse a text label to produce expressions for plotmath.
alpha

Modify colour transparency. Vectorised in both colour and alpha.
Range-class

Mutable ranges.
gradient_n_pal

Arbitrary colour gradient palette (continous).
extended_breaks

Extended breaks. Uses Wilkinson's extended breaks algorithm as implemented in the labeling package.
time_trans

Transformation for times (class POSIXt).
muted

Mute standard colour.
format_format

grey_pal

Grey scale palette (discrete).
percent_format

Percent formatter: multiply by one hundred and display percent sign.
manual_pal

Manual palette (manual).
fullseq

Generate sequence of fixed size intervals covering range.
brewer_pal

Color Brewer palette (discrete).
rescale

Rescale numeric vector to have specified minimum and maximum.
math_format

Add arbitrary expression to a label. The symbol that will be replace by the label value is .x.
dscale

Discrete scale.
show_col

Show colours.
trans_breaks

Pretty breaks on transformed scale.
identity_trans

Identity transformation (do nothing).
date_breaks

Regularly spaced dates.