cnmap: To Plot China Map

Description Usage Arguments Value Examples

View source: R/cnmap.R

Description

To Plot China Map

Usage

1
2
3
4
5
6
7
8
9
cnmap(data, shapename, choice = NULL, heat.variable = NULL,
  heat.color = c("gray", "red"), bubble.size.variable = NULL,
  bubble.color.variable = NULL, bubble.color = c("#8f62ff", "#0000ff"),
  bubble.size = 4, lgd.bubble.color.title = NULL,
  lgd.bubble.size.title = NULL, lgd.heat.title = NULL,
  lgd.title.size = 13, lgd.text.size = 10, text.show = TRUE,
  text.alpha = 1, text.size = 5, text.color = "black",
  border.color = "gray", border.size = 0.5, segment.min.length = 0,
  family = "sans", face = "plain", force = 0.5)

Arguments

data

dataframe

shapename

one string, name of shapes in data

choice

(optional) choice for shape names

heat.variable

string, variable name for heat map

heat.color

colors for heat map

bubble.size.variable

string, variable name for bubble size map

bubble.color.variable

string, variable name for bubble color map

bubble.color

colors for bubble map

bubble.size

size for all bubbles in bubble map

lgd.bubble.color.title

title for legend bubble color map

lgd.bubble.size.title

title for legend bubble size map

lgd.heat.title

title for legend heat map

lgd.title.size

size for legend title

lgd.text.size

size for legend text

text.show

logical. Whether to show map text

text.alpha

map text alpha, default is 1

text.size

map text size, default is 5

text.color

map text color, default is black

border.color

map border color, default is grey

border.size

map border size, default is 0.5

segment.min.length

see geom_label_repel

family

see family

face

plain, bold or italic

force

see geom_label_repel

Value

a ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(tmcn)

pose=toUTF8(c('\u6B66\u6C49\u5E02','\u5B5D\u611F\u5E02'))
gdp=c(500,100)
data=data.frame(pose,gdp)

cnmap(data = data,shapename = 'pose')

cnmap(data = data,shapename = 'pose',
       heat.variable = 'gdp')
cnmap(data = data,shapename = 'pose',
      bubble.color.variable = 'gdp')

yikeshu0611/cnmap documentation built on Feb. 9, 2020, 12:18 a.m.