README.md

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



biomarble/onekeyMap documentation built on June 1, 2022, 8:35 p.m.