From 5b2eb581676479aaa80122fb43cfa71b99c9c141 Mon Sep 17 00:00:00 2001 From: chiffon Date: Mon, 24 Apr 2017 10:11:29 +0800 Subject: [PATCH] fix bug issue2 --- R/utils.R | 13 ++++++++++++- data/leafletcn.map.names.rda | Bin 3879 -> 3916 bytes data/triList.rda | Bin 107 -> 134 bytes 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index d194ed4..58e8309 100644 --- a/R/utils.R +++ b/R/utils.R @@ -40,7 +40,18 @@ toLabel = function(city){ labels = sapply(city, function(x){ if(tolower(substr(x,1,1)) %in% letters){ return(tolower(x)) - } else if(grepl(.triList[[1]], x)| + }else if(x == .triList[[5]] | grepl(paste0(.triList[[5]],.triList[[7]][1]), x)){ + warning("Using Jilin Province instead of Jilin City!") + return(.triList[[5]]) + } else if(grepl(.triList[[5]], x) & !grepl(paste0(.triList[[5]],.triList[[7]][1]), x)){ + return(paste0(.triList[[5]],.triList[[7]][2])) + } + else if(x == .triList[[6]] | grepl(paste0(.triList[[6]],.triList[[7]][1]), x)){ + warning("Using Hainan Province instead of Hainan City!") + return(.triList[[6]]) + }else if(grepl(.triList[[6]], x) & !grepl(paste0(.triList[[6]],.triList[[7]][1]), x)){ + return(paste0(.triList[[6]],.triList[[7]][2])) + }else if(grepl(.triList[[1]], x)| grepl(.triList[[2]], x)| grepl(.triList[[3]], x)| grepl(.triList[[4]], x) diff --git a/data/leafletcn.map.names.rda b/data/leafletcn.map.names.rda index cc879df87369c7e7d479101252935ba53cb3f835..362429d7c61fa975bb0c1dd318c6c4a92ca427c2 100644 GIT binary patch delta 3915 zcmV-R547;79?TvRABzY80000000!+`S#KNH6=snVD1Rx5TCBxOtc|23E)t0XedjXny^x&&^w(-%2DB?BcrWqZ z4f^rsd-R{5ByJ`K=>H!-xHt6WgL_Z!KD_Owg(=$k|mb_(WElq>J1=a#5WDx4IIU zJ>ch;X*SoQ+H6%exFDN$H~A8`Sdy8DfHsW?ynphUyx8P>oSsH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