Creates an identity scale; a special case of a linear scale, where input is mapped to itself (input limits = output range). An identity scale is useful in cases where input data is already expressed in a visual representation (e.g. a line width) and should be used as-is.
Arguments
- col
<
name|string> The name of the column containing data to be scaled. Must be a valid input torlang::ensym(); either a named column (non-standard evaluation), a string. Supports tidy-eval.- na_value
<
number> The output value forNAinput values.- col_label
<
string|function> A template string or a label function for customising the column name in the legend.if
col_labelis a string,{.col}may be used to represent thecolnameif
col_labelis a function, the function must take a single argument: thecolname
- legend
<
boolean> Indicate whether the legend should be displayed for this scale.
Note
Identity scales are almost equivalent to an accessor to a numeric column;
differences are:
NAis replaced withna_valueMay render a numeric legend
See also
Other scales:
rescale_center(),
rescale_diverge(),
scale_category(),
scale_linear(),
scale_log(),
scale_power(),
scale_quantile(),
scale_quantize(),
scale_symlog(),
scale_threshold()