sfROse: Simple feature style Rose Map

Description Usage Arguments Format Value Examples

Description

Simple feature style Rose Map

Usage

1
2
3
4
5
6
sf_rose(mapping = aes(petal = NULL), data = NULL, translate = c(0,
  0), rotate = 0, mirror = NULL, mirror_h = NULL, mirror_v = NULL,
  zoom = 1, position = "identity", na.rm = FALSE, show.legend = NA,
  inherit.aes = TRUE, ...)

StatSfRose

Arguments

mapping

mapping

data

data

translate

translate, must be two numbers. The first number is given to move along x-axis, the other is y-axis

rotate

rotate

mirror

mirror, must be two numbers. The first number is slope, the other is intercept

mirror_h

one number, mirror refelct by horizontal line

mirror_v

one number, mirror refelct by vertical line

zoom

one number

position

position

na.rm

na.rm

show.legend

show.legend

inherit.aes

inherit.aes

...

passed to params

Format

An object of class StatSf (inherits from Stat, ggproto, gg) of length 4.

Value

Simple feature picture

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
librar(ggrose)
dd=nCov2019()
dd2=rose_data(dd)

# original data
ggplot(data = dd2)+
    sf_rose()


# add petal
ggplot(data = dd2)+
    sf_rose(aes(petal=diagnose))

# add petal
# transform diagnose to log10
ggplot(data = dd2)+
    sf_rose(aes(petal=log10(diagnose)))


# add color
ggplot(data = dd2)+
    sf_rose(aes(fill=log10(diagnose)))

# use color and petal together
ggplot(data = dd2)+
    sf_rose(aes(fill=log10(diagnose),
                petal=log10(diagnose)))

# plot two roses and translate the second 1.6 anlong x-axis
ggplot(data = dd2)+
    sf_rose(aes(petal=log10(diagnose)))+
    sf_rose(aes(petal=log10(diagnose)),
            translate = c(1.6,0))

# rotate
ggplot(data = dd2)+
    sf_rose(aes(fill=log10(diagnose),
                petal=log10(diagnose)),
            rotate = 90)


# mirror reflecte
ggplot(data = dd2)+
    sf_rose(aes(petal=log10(diagnose)))+
    sf_rose(aes(petal=log10(diagnose)),
            translate = c(1.6,0),fill='blue',
            mirror_v = 2)

# zoom
ggplot(data = dd2)+
    sf_rose(aes(petal=log10(diagnose)))+
    sf_rose(aes(petal=log10(diagnose)),
            translate = c(1.6,0),fill='blue',
            zoom=0.5
            )

# mirror reflecte and regulate start angle
ggplot(data = dd2)+
    sf_rose(aes(petal=log10(diagnose)),rotate = -30)+
    sf_rose(aes(petal=log10(diagnose)),rotate = -30,
            translate = c(2,0),fill='blue',
            mirror_v = 2)

yikeshu0611/ggrose documentation built on March 20, 2020, 9:56 p.m.