Skip to content

biomarble/onekeyMap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

onekeyMap - draw China/world Map easily

Installation

General method

if(!requireNamespace('remotes',quietly = T)) install.packages('remotes',update=F)
remotes::install_github('biomarble/onekeyMap',dependencies=T,upgrade = F)

For Users in China

if(!requireNamespace('remotes',quietly = T)) install.packages('remotes',update=F)
if(!requireNamespace('onekeyMap',quietly = T)){
  tryCatch({
    remotes::install_github('biomarble/onekeyMap',dependencies=T,upgrade = F)
  },error = function(e){
    remotes::install_url('https://download.fastgit.org/biomarble/onekeyMap/archive/main.zip',dependencies = T,upgrade = F) 
  })
}

Thanks to fastgit - the mirror speeder for GitHub.com.

Functions

Function Description Demo
mapChina_fill_province color China map according to data in province scale pic
mapChina_point put dots into China map pic
mapChina_pie_province put pie chart into China map pic
mapWorld_fill color world map according to data in country scale pic
mapWorld_point put dots into world map pic

Example

heatFile=system.file('demoChina','Province.heat.csv',package = 'onekeyMap')
data=read.csv(heatFile,header=T,check.names = F,na.strings = "-",encoding = 'UTF-8')
map=mapChina_fill_province(data,label="Production",title="2019 Productions of Cotton",colorTrans="log10")

png('chinaMap1.png',w=3000,h=2000,res=300)
plot(map)
dev.off()

Tips

  • Report bugs/suggestions to Issues

  • 扫码关注微信公众号,不定期发布培训课程:
    qrcode.png