createdefaultmappinganddata: Creates a canonical mapping and its associated data base

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/createdefaultmapping.r

Description

This function transforms the mapping and the data base to get a canonical mapping where the aesthetic variables are equal to the names of the data base.

Usage

1
createdefaultmappinganddata(mapping, data, mandatoryarguments=c("x","y"))

Arguments

mapping

Set of aesthetics.

data

Default data frame. It is expected that all layers are included in the data set.

mandatoryarguments

Arguments that must appear in the mapping

Details

It creates an aesthetic layer with the default names. If it is necessary, it changes the names of the data base.

Value

A list with a mapping of aesthetics and a data frame.

Note

Internal use.

Author(s)

Emilio Torres Manzanera

See Also

aes_string

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data <- data.frame(x1=1,y1=2)
mapping <- aes(x = x1 + y1, y = y1) # default names: x and y
mapping
## List of 2
##  $ x: language x1 + y1
##  $ y: symbol y1

createdefaultmappinganddata(mapping,data)
## $mapping
## List of 2
##  $ x: symbol x
##  $ y: symbol y

## $data
##   x y x1 y1
## 1 3 2  1  2

xkcd documentation built on May 2, 2019, 4:47 p.m.