hlabs: hlabs

View source: R/hlab.r

hlabsR Documentation

hlabs

Description

Front-end to ggplot2 labs Function

Usage

hlabs(x, y, html = FALSE)

Arguments

x

a single variable name, unquoted

y

a single variable name, unquoted

html

set to TRUE to render in html (for plotly), otherwise the result is plotmath expressions

Details

Runs x, y, or both through hlab() and passes the constructed labels to the ggplot2::labs function to specify x- and y-axis labels specially formatted for units of measurement

Value

result of ggplot2::labs()

Author(s)

Frank Harrell

Examples

# Name the current dataset d, or specify a name with
# options(curr_ds='...') or run `extractlabs`, then
# ggplot(d, aes(x,y)) + geom_point() + hlabs(x,y)
# to specify only the x-axis label use hlabs(x), or to
# specify only the y-axis label use hlabs(y=...)

harrelfe/Hmisc documentation built on Nov. 21, 2024, 3:47 p.m.