dl.trans: Direct label data transform

Description Usage Arguments Value Author(s) Examples

Description

Make a function that transforms the data. This is for conveniently making a function that calls transform on the data frame, with the arguments provided. See examples.

Usage

1

Arguments

...

Arguments to pass to transform.

Value

A Positioning Function.

Author(s)

Toby Dylan Hocking

Examples

1
2
3
4
5
complicated <- list(dl.trans(x=x+10),
                    gapply.fun(d[-2,]),
                    rot=c(30,180))
library(lattice)
direct.label(dotplot(VADeaths,type="o"),complicated,TRUE)

Example output

[[1]]
function (d, ...) 
do.call("transform", c(list(d), L))
<environment: 0x2d505d0>

          x       groups         y    colour
1  11.55713   Rural Male  1.603718   #0080ff
2  12.85322   Rural Male  4.276581   #0080ff
3  14.63534   Rural Male  6.949444   #0080ff
4  17.49078   Rural Male  9.622308   #0080ff
5  22.55362   Rural Male 12.295171   #0080ff
6  10.94959 Rural Female  1.603718   #ff00ff
7  11.55713 Rural Female  4.276581   #ff00ff
8  13.29875 Rural Female  6.949444   #ff00ff
9  15.44539 Rural Female  9.622308   #ff00ff
10 20.18421 Rural Female 12.295171   #ff00ff
11 12.30643   Urban Male  1.603718 darkgreen
12 14.10880   Urban Male  4.276581 darkgreen
13 16.68073   Urban Male  6.949444 darkgreen
14 20.24497   Urban Male  9.622308 darkgreen
15 23.58644   Urban Male 12.295171 darkgreen
16 10.88883 Urban Female  1.603718   #ff0000
17 11.94190 Urban Female  4.276581   #ff0000
18 13.09623 Urban Female  6.949444   #ff0000
19 16.29595 Urban Female  9.622308   #ff0000
20 19.31340 Urban Female 12.295171   #ff0000
[[1]]
function (d, ...) 
gapply(d, f, ...)
<environment: 0x2d544b0>
attr(,"source")
[1] "gapply.fun(d[-2, ])"

[[1]]
function (d, ...) 
eval(foo)
<environment: 0x2d544b0>

          x       groups         y  colour
6  10.94959 Rural Female  1.603718 #ff00ff
8  13.29875 Rural Female  6.949444 #ff00ff
9  15.44539 Rural Female  9.622308 #ff00ff
10 20.18421 Rural Female 12.295171 #ff00ff
[[1]]
function (d, ...) 
eval(foo)
<environment: 0x2d544b0>

         x     groups         y  colour
1 11.55713 Rural Male  1.603718 #0080ff
3 14.63534 Rural Male  6.949444 #0080ff
4 17.49078 Rural Male  9.622308 #0080ff
5 22.55362 Rural Male 12.295171 #0080ff
[[1]]
function (d, ...) 
eval(foo)
<environment: 0x2d544b0>

          x       groups         y  colour
16 10.88883 Urban Female  1.603718 #ff0000
18 13.09623 Urban Female  6.949444 #ff0000
19 16.29595 Urban Female  9.622308 #ff0000
20 19.31340 Urban Female 12.295171 #ff0000
[[1]]
function (d, ...) 
eval(foo)
<environment: 0x2d544b0>

          x     groups         y    colour
11 12.30643 Urban Male  1.603718 darkgreen
13 16.68073 Urban Male  6.949444 darkgreen
14 20.24497 Urban Male  9.622308 darkgreen
15 23.58644 Urban Male 12.295171 darkgreen
                       x       groups         y    colour
Rural Female.6  10.94959 Rural Female  1.603718   #ff00ff
Rural Female.8  13.29875 Rural Female  6.949444   #ff00ff
Rural Female.9  15.44539 Rural Female  9.622308   #ff00ff
Rural Female.10 20.18421 Rural Female 12.295171   #ff00ff
Rural Male.1    11.55713   Rural Male  1.603718   #0080ff
Rural Male.3    14.63534   Rural Male  6.949444   #0080ff
Rural Male.4    17.49078   Rural Male  9.622308   #0080ff
Rural Male.5    22.55362   Rural Male 12.295171   #0080ff
Urban Female.16 10.88883 Urban Female  1.603718   #ff0000
Urban Female.18 13.09623 Urban Female  6.949444   #ff0000
Urban Female.19 16.29595 Urban Female  9.622308   #ff0000
Urban Female.20 19.31340 Urban Female 12.295171   #ff0000
Urban Male.11   12.30643   Urban Male  1.603718 darkgreen
Urban Male.13   16.68073   Urban Male  6.949444 darkgreen
Urban Male.14   20.24497   Urban Male  9.622308 darkgreen
Urban Male.15   23.58644   Urban Male 12.295171 darkgreen
$rot
[1]  30 180

                       x       groups         y    colour rot
Rural Female.6  10.94959 Rural Female  1.603718   #ff00ff  30
Rural Female.8  13.29875 Rural Female  6.949444   #ff00ff 180
Rural Female.9  15.44539 Rural Female  9.622308   #ff00ff  30
Rural Female.10 20.18421 Rural Female 12.295171   #ff00ff 180
Rural Male.1    11.55713   Rural Male  1.603718   #0080ff  30
Rural Male.3    14.63534   Rural Male  6.949444   #0080ff 180
Rural Male.4    17.49078   Rural Male  9.622308   #0080ff  30
Rural Male.5    22.55362   Rural Male 12.295171   #0080ff 180
Urban Female.16 10.88883 Urban Female  1.603718   #ff0000  30
Urban Female.18 13.09623 Urban Female  6.949444   #ff0000 180
Urban Female.19 16.29595 Urban Female  9.622308   #ff0000  30
Urban Female.20 19.31340 Urban Female 12.295171   #ff0000 180
Urban Male.11   12.30643   Urban Male  1.603718 darkgreen  30
Urban Male.13   16.68073   Urban Male  6.949444 darkgreen 180
Urban Male.14   20.24497   Urban Male  9.622308 darkgreen  30
Urban Male.15   23.58644   Urban Male 12.295171 darkgreen 180
                       x       groups         y    colour rot       col hjust
Rural Female.6  10.94959 Rural Female  1.603718   #ff00ff  30   #ff00ff   0.5
Rural Female.8  13.29875 Rural Female  6.949444   #ff00ff 180   #ff00ff   0.5
Rural Female.9  15.44539 Rural Female  9.622308   #ff00ff  30   #ff00ff   0.5
Rural Female.10 20.18421 Rural Female 12.295171   #ff00ff 180   #ff00ff   0.5
Rural Male.1    11.55713   Rural Male  1.603718   #0080ff  30   #0080ff   0.5
Rural Male.3    14.63534   Rural Male  6.949444   #0080ff 180   #0080ff   0.5
Rural Male.4    17.49078   Rural Male  9.622308   #0080ff  30   #0080ff   0.5
Rural Male.5    22.55362   Rural Male 12.295171   #0080ff 180   #0080ff   0.5
Urban Female.16 10.88883 Urban Female  1.603718   #ff0000  30   #ff0000   0.5
Urban Female.18 13.09623 Urban Female  6.949444   #ff0000 180   #ff0000   0.5
Urban Female.19 16.29595 Urban Female  9.622308   #ff0000  30   #ff0000   0.5
Urban Female.20 19.31340 Urban Female 12.295171   #ff0000 180   #ff0000   0.5
Urban Male.11   12.30643   Urban Male  1.603718 darkgreen  30 darkgreen   0.5
Urban Male.13   16.68073   Urban Male  6.949444 darkgreen 180 darkgreen   0.5
Urban Male.14   20.24497   Urban Male  9.622308 darkgreen  30 darkgreen   0.5
Urban Male.15   23.58644   Urban Male 12.295171 darkgreen 180 darkgreen   0.5
                vjust
Rural Female.6    0.5
Rural Female.8    0.5
Rural Female.9    0.5
Rural Female.10   0.5
Rural Male.1      0.5
Rural Male.3      0.5
Rural Male.4      0.5
Rural Male.5      0.5
Urban Female.16   0.5
Urban Female.18   0.5
Urban Female.19   0.5
Urban Female.20   0.5
Urban Male.11     0.5
Urban Male.13     0.5
Urban Male.14     0.5
Urban Male.15     0.5

directlabels documentation built on Jan. 16, 2021, 5:05 p.m.