Alaska and Hawaii can be found in the 'world' or 'world2' databases of
the 'maps' package. The following is a bit a hack but it works
library(maps)
library(scales)
mergeMaps <- function(...) {
maps <- list(...)
if (length(maps) < 2)
stop("need at least two maps")
map <-
Very nice Adrian. Is there a straightforward way to add Alaska and
Hawaii at the lower left? (without resorting to choroplethr package)
On 12/10/2015 06:09 AM, Adrian Waddell wrote:
Hi,
You can also use the 'maps' package for the map data and the 'scales'
package for the color mapping.
E.g.
Hi,
You can also use the 'maps' package for the map data and the 'scales'
package for the color mapping.
E.g.
library(maps)
library(scales)
m <- map('state', fill=TRUE, plot=FALSE)
s_data <- tolower(rownames(USArrests))
s_map <- tolower(m$names)
mapping <- lapply(s_data, function(state) {
ggplot2 also can do this with
fortify
geom_polygon
Von meinem iPad gesendet
> Am 06.12.2015 um 21:03 schrieb Benjamin Tyner :
>
> Hi
>
> I wish to draw a basic choropleth (US, by state) and am wondering if anyone
> has any recommendations? I've tried the following thus far:
Hi
I wish to draw a basic choropleth (US, by state) and am wondering if
anyone has any recommendations? I've tried the following thus far:
1. choroplethr: this works, but required installation of 30+
dependencies. I would prefer something with fewer dependencies.
2. tmap: this also seems
5 matches
Mail list logo