我使用的是rworldmap,我想将聚合的国家/地区数据绘制为区域。我看到有名为mapbyregion和country2Region的函数,但如果我没理解错的话,区域是预先定义的,例如斯特恩区域。我想使用我自己选择的区域?这个是可能的吗?可以用另一个包来完成吗?
我有一个带有iso3代码的数据帧,我可以在其中声明一个国家所属的地区(我可以对其进行编辑以进行自己的分组。例如欧盟国家、高收入国家等)。
发布于 2018-02-05 02:39:28
其中一个应该会有帮助。
library(leaflet)
library(htmltools)
# example from ?leaflet
m = leaflet() %>% addTiles()
# there are two approaches to the custom css problem
# 1. the easy but less robust way
browsable(
tagList(list(
tags$head(
# you'll need to be very specific
tags$style("p{font-size:200%;}")
# could also use url
#tags$link(href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css",rel="stylesheet")
),
m
))
)
# 2. you can add dependencies to your leaflet map
# this mechanism will smartly handle duplicates
# but carries a little more overhead
str(m$dependencies) # should be null to start
#
m$dependencies <- list(
htmlDependency(
name = "font-awesome"
,version = "4.3.0"
# if local file use file instead of href below
# with an absolute path
,src = c(href="http://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css")
,stylesheet = "font-awesome.min.css"
)
)
mhttps://stackoverflow.com/questions/48459616
复制相似问题