getMapping: extract variable name from mapping, aes

Description Usage Arguments Value Examples

View source: R/addLabelDf.R

Description

extract variable name from mapping, aes

Usage

1
getMapping(mapping, varname)

Arguments

mapping

aesthetic mapping

varname

variable name to extract

Value

variable name in character

Examples

1
2
3
4
require(ggplot2)
mapping=aes(colour=sex)
getMapping(mapping,"colour")
getMapping(mapping,"x")

Example output

Loading required package: ggplot2
[1] "sex"
NULL

moonBook documentation built on Jan. 13, 2021, 6:43 a.m.