

{"id":3158,"date":"2014-12-29T09:35:33","date_gmt":"2014-12-29T14:35:33","guid":{"rendered":"http:\/\/rud.is\/b\/?p=3158"},"modified":"2018-03-07T16:44:05","modified_gmt":"2018-03-07T21:44:05","slug":"making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/","title":{"rendered":"Making Static &#038; Interactive Maps With ggvis (+ using ggvis maps w\/shiny)"},"content":{"rendered":"<p>Even though it&#8217;s still at version `0.4`, the `ggvis` package has quite a bit of functionality and is highly useful for exploratory data analysis (EDA). I wanted to see how geographical visualizations would work under it, so I put together six examples that show how to use various features of `ggvis` for presenting static &#038; interactive cartographic creations. Specifically, the combined exercises demonstrate:<\/p>\n<p>&#8211; basic map creation<br \/>\n&#8211; basic maps with points\/labels<br \/>\n&#8211; dynamic choropleths (with various scales &#038; tooltips)<br \/>\n&#8211; applying projections and custom color fills (w\/tooltips)<br \/>\n&#8211; apply projections and projecting coordinates for plotting (w\/tooltips that handle missing data well)<\/p>\n<p>If you want to skip the post and head straight to the code you can [head on over to github](https:\/\/github.com\/hrbrmstr\/ggvis-maps), [peruse the R markdown file on RPubs](http:\/\/rpubs.com\/hrbrmstr\/ggvis-maps) or play with the [shiny version](https:\/\/hrbrmstr.shinyapps.io\/ggvis-maps\/). You&#8217;ll need that code to actually run any of the snippets below since I&#8217;m leaving out some code-cruft for brevity. Also, all the map graphics below were generated by saving the `ggvis` output as PNG files (for best browser compatibility), right from the `ggvis` renderer popup. Click\/tap each for a larger version.<\/p>\n<p>### Basic Polygons<\/p>\n<p><center><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3167\" data-permalink=\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/attachment\/1\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1.png?fit=496%2C734&amp;ssl=1\" data-orig-size=\"496,734\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1.png?fit=203%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1.png?fit=496%2C734&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1.png?resize=203%2C300&#038;ssl=1\" alt=\"1\" width=\"203\" height=\"300\" class=\"aligncenter size-medium wp-image-3167\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1.png?resize=203%2C300&amp;ssl=1 203w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1.png?resize=101%2C150&amp;ssl=1 101w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1.png?w=496&amp;ssl=1 496w\" sizes=\"auto, (max-width: 203px) 100vw, 203px\" \/><\/a><\/center><\/p>\n<p>Even though we still need the help of `ggplot2`&#8217;s `fortify`, it&#8217;s pretty straightforward to crank out a basic map in `ggvis`:<\/p>\n<pre lang=\"rsplus\">maine <- readOGR(\"data\/maine.geojson\", \"OGRGeoJSON\")\r\n\r\nmap <- ggplot2::fortify(maine, region=\"name\")\r\n\r\nmap %>%\r\n  ggvis(~long, ~lat) %>%\r\n  group_by(group, id) %>%\r\n  layer_paths(strokeOpacity:=0.5, stroke:=\"#7f7f7f\") %>%\r\n  hide_legend(\"fill\") %>%\r\n  hide_axis(\"x\") %>% hide_axis(\"y\") %>%\r\n  set_options(width=400, height=600, keep_aspect=TRUE)<\/pre>\n<p>The code is very similar to one of the ways we render the same image in `ggplot`. We first read in the shapefile, convert it into a data frame we can use for plotting, group the polygons properly, render them with `layer_paths` and get rid of chart junk. Now, `ggvis` (to my knowledge as of this post) has no equivalent of `coord_map`, so we have to rely on the positioning in the projection and work out the proper `height` and `width` parameters to use with a uniform aspect ratio (`keep_aspect=TRUE`). <\/p>\n<p>>For those not familiar with `ggvis` the `~` operator lets us tell `ggivs` which columns (or expressions using columns) to map to function parameters and `:=` operator just tells it to use a raw, un-scaled value. You can find out more about [why the tilde was chosen](https:\/\/github.com\/rstudio\/ggvis\/issues\/173) or about the [various other special operators](http:\/\/ggvis.rstudio.com\/ggvis-basics.html).<\/p>\n<p>### Basic Annotations<\/p>\n<p><center><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/2.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3170\" data-permalink=\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/attachment\/2\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/2.png?fit=640%2C952&amp;ssl=1\" data-orig-size=\"640,952\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/2.png?fit=202%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/2.png?fit=510%2C758&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/2.png?resize=202%2C300&#038;ssl=1\" alt=\"2\" width=\"202\" height=\"300\" class=\"aligncenter size-medium wp-image-3170\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/2.png?resize=202%2C300&amp;ssl=1 202w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/2.png?resize=101%2C150&amp;ssl=1 101w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/2.png?resize=530%2C788&amp;ssl=1 530w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/2.png?resize=535%2C796&amp;ssl=1 535w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/2.png?w=640&amp;ssl=1 640w\" sizes=\"auto, (max-width: 202px) 100vw, 202px\" \/><\/a><\/center><\/p>\n<p>You can annotate maps in an equally straightforward way.<\/p>\n<pre lang=\"rsplus\">\r\ncounty_centers <- maine %>%\r\n  gCentroid(byid=TRUE) %>%\r\n  data.frame %>%\r\n  cbind(name=maine$name %>% gsub(\" County, ME\", \"\", .) )\r\n\r\nmap %>%\r\n  group_by(group, id) %>%\r\n  ggvis(~long, ~lat) %>%\r\n  layer_paths(strokeWidth:=0.25, stroke:=\"#7f7f7f\") %>%\r\n  layer_points(data=county_centers, x=~x, y=~y, size:=8) %>%\r\n  layer_text(data=county_centers,\r\n             x=~x+0.05, y=~y, text:=~name,\r\n             baseline:=\"middle\", fontSize:=8) %>%\r\n  hide_legend(\"fill\") %>%\r\n  hide_axis(\"x\") %>% hide_axis(\"y\") %>%\r\n  set_options(width=400, height=600, keep_aspect=TRUE)<\/pre>\n<p>>Note that the `group_by` works both before or after the `ggvis` call. Consistent pipe idioms FTW!<\/p>\n<p>Here, we&#8217;re making a data frame out of the county centroids and names then using that in a call to `layer_points` and `layer_text`. Note how you can change the data source for each layer (just like in `ggplot)` and use expressions just like in `ggplot` (we moved the text just slightly to the right of the dot).<\/p>\n<p>>Since `ggvis` outputs [vega](http:\/\/trifacta.github.io\/vega\/) and uses [D3](http:\/\/d3js.org\/) for rendering, you should probably take a peek at those frameworks as it will help you understand the parameter name differences between `ggvis` and `ggplot`.<\/p>\n<p>### Basic Choropleths<\/p>\n<p><center><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/3.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3174\" data-permalink=\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/attachment\/3\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/3.png?fit=675%2C799&amp;ssl=1\" data-orig-size=\"675,799\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"3\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/3.png?fit=253%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/3.png?fit=510%2C603&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/3.png?resize=253%2C300&#038;ssl=1\" alt=\"3\" width=\"253\" height=\"300\" class=\"aligncenter size-medium wp-image-3174\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/3.png?resize=253%2C300&amp;ssl=1 253w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/3.png?resize=127%2C150&amp;ssl=1 127w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/3.png?resize=530%2C627&amp;ssl=1 530w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/3.png?resize=535%2C633&amp;ssl=1 535w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/3.png?w=675&amp;ssl=1 675w\" sizes=\"auto, (max-width: 253px) 100vw, 253px\" \/><\/a><\/center><\/p>\n<p>There are actually two examples of this basic state choropleth in the code, but one just uses a different color scale, so I&#8217;ll just post the code for one here. This is also designed for interactivity (it has tooltips and lets you change the fill variable) so you should run it locally or look at the [shiny version](https:\/\/hrbrmstr.shinyapps.io\/ggvis-maps\/).<\/p>\n<pre lang=\"rsplus\"># read in some crime\u00a0& population data for maine counties\r\nme_pop <- read.csv(\"data\/me_pop.csv\", stringsAsFactors=FALSE)\r\nme_crime <- read.csv(\"data\/me_crime.csv\", stringsAsFactors=FALSE)\r\n\r\n# get it into a form we can use (and only use 2013 data)\r\n\r\ncrime_1k <- me_crime %>%\r\n  filter(year==2013) %>%\r\n  select(1,5:12) %>%\r\n  left_join(me_pop) %>%\r\n  mutate(murder_1k=1000*(murder\/population_2010),\r\n         rape_1k=1000*(rape\/population_2010),\r\n         robbery_1k=1000*(robbery\/population_2010),\r\n         aggravated_assault_1k=1000*(aggravated_assault\/population_2010),\r\n         burglary_1k=1000*(burglary\/population_2010),\r\n         larceny_1k=1000*(larceny\/population_2010),\r\n         motor_vehicle_theft_1k=1000*(motor_vehicle_theft\/population_2010),\r\n         arson_1k=1000*(arson\/population_2010))\r\n\r\n# normalize the county names\r\n\r\nmap %<>% mutate(id=gsub(\" County, ME\", \"\", id)) %>%\r\n  left_join(crime_1k, by=c(\"id\"=\"county\"))\r\n\r\n# this is for the tooltip. it does a lookup into the crime data frame and\r\n# then uses those values for the popup\r\n\r\ncrime_values <- function(x) {\r\n  if(is.null(x)) return(NULL)\r\n  y <- me_crime %>% filter(year==2013, county==x$id) %>% select(1,5:12)\r\n  sprintf(\"<table width='100%%'>%s<\/table>\",\r\n          paste0(\"<tr><td style='text-align:left'>\", names(y),\r\n         \":<\/td><td style='text-align:right'>\", format(y), collapse=\"<\/td><\/tr>\"))\r\n}\r\n\r\nmap %>%\r\n  group_by(group, id) %>%\r\n  ggvis(~long, ~lat) %>%\r\n  layer_paths(fill=input_select(label=\"Crime:\",\r\n                                choices=crime_1k %>%\r\n                                  select(ends_with(\"1k\")) %>%\r\n                                  colnames %>% sort,\r\n                                id=\"Crime\",\r\n                                map=as.name),\r\n              strokeWidth:=0.5, stroke:=\"white\") %>%\r\n  scale_numeric(\"fill\", range=c(\"#bfd3e6\", \"#8c6bb1\" ,\"#4d004b\")) %>%\r\n  add_tooltip(crime_values, \"hover\") %>%\r\n  add_legend(\"fill\", title=\"Crime Rate\/1K Pop\") %>%\r\n  hide_axis(\"x\") %>% hide_axis(\"y\") %>%\r\n  set_options(width=400, height=600, keep_aspect=TRUE)<\/pre>\n<p>You can omit the `input_select` bit if you just want to do a single choropleth (just map `fill` to a single variable). The `input_select` tells `ggvis` to make a minimal bootstrap sidebar-layout scaffold around the actual graphic to enable variable interaction. In this case we let the user explore different types of crimes (by 1K population) and we also have a tooltip that shows the #&#8217;s of each crime in each county as we hover.<\/p>\n<p>### Projections and Custom Colors<\/p>\n<p><center><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/4.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3176\" data-permalink=\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/attachment\/4\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/4.png?fit=1024%2C683&amp;ssl=1\" data-orig-size=\"1024,683\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"4\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/4.png?fit=300%2C200&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/4.png?fit=510%2C341&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/4.png?resize=510%2C341&#038;ssl=1\" alt=\"4\" width=\"510\" height=\"341\" class=\"aligncenter size-large wp-image-3176\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/4.png?resize=530%2C354&amp;ssl=1 530w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/4.png?resize=150%2C100&amp;ssl=1 150w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/4.png?resize=300%2C200&amp;ssl=1 300w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/4.png?resize=535%2C357&amp;ssl=1 535w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/4.png?w=1024&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/center><\/p>\n<p>We&#8217;re pretty much (mostly) re-creating a [previous post](http:\/\/rud.is\/b\/2014\/11\/16\/moving-the-earth-well-alaska-hawaii-with-r\/) in this example and making a projected U.S. map with drought data (as of 2014-12-23).<\/p>\n<pre lang=\"rsplus\">us <- readOGR(\"data\/us.geojson\", \"OGRGeoJSON\")\r\nus <- us[!us$STATEFP %in% c(\"02\", \"15\", \"72\"),]\r\n\r\n# same method to change the projection\r\n\r\nus_aea <- spTransform(us, CRS(\"+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs\"))\r\n\r\nmap <- ggplot2::fortify(us_aea, region=\"GEOID\")\r\n\r\ndroughts <- read.csv(\"data\/dm_export_county_20141223.csv\")\r\ndroughts$id <- sprintf(\"%05d\", as.numeric(as.character(droughts$FIPS)))\r\ndroughts$total <- with(droughts, (D0+D1+D2+D3+D4)\/5)\r\n\r\nmap_d <- merge(map, droughts, all.x=TRUE)\r\n\r\n# pre-make custom colors per county\r\n\r\nramp <- colorRampPalette(c(\"white\", brewer.pal(n=9, name=\"YlOrRd\")), space=\"Lab\")\r\n\r\nmap_d$fill_col <- as.character(cut(map_d$total, seq(0,100,10), include.lowest=TRUE, labels=ramp(10)))\r\nmap_d$fill_col <- ifelse(is.na(map_d$fill_col), \"#FFFFFF\", map_d$fill_col)\r\n\r\ndrought_values <- function(x) {\r\n  if(is.null(x) | !(x$id %in% droughts$id)) return(NULL)\r\n  y <- droughts %>% filter(id==x$id) %>% select(1,3,4,6:10)\r\n  sprintf(\"<table width='100%%'>%s<\/table>\",\r\n          paste0(\"<tr><td style='text-align:left'>\", names(y),\r\n         \":<\/td><td style='text-align:right'>\", format(y), collapse=\"<\/td><\/tr>\"))\r\n}\r\n\r\nmap_d %>%\r\n  group_by(group, id) %>%\r\n  ggvis(~long, ~lat) %>%\r\n  layer_paths(fill:=~fill_col, strokeOpacity := 0.5, strokeWidth := 0.25) %>%\r\n  add_tooltip(drought_values, \"hover\") %>%\r\n  hide_legend(\"fill\") %>%\r\n  hide_axis(\"x\") %>% hide_axis(\"y\") %>%\r\n  set_options(width=900, height=600, keep_aspect=TRUE)<\/pre>\n<p>It&#8217;s really similar to the previous code (and you may\/should be familiar with the Albers transform from the previous post).<\/p>\n<p>### World Domination<\/p>\n<p><center><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/5.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3177\" data-permalink=\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/attachment\/5\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/5.png?fit=1800%2C1000&amp;ssl=1\" data-orig-size=\"1800,1000\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"5\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/5.png?fit=300%2C167&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/5.png?fit=510%2C283&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/5.png?resize=510%2C283&#038;ssl=1\" alt=\"5\" width=\"510\" height=\"283\" class=\"aligncenter size-large wp-image-3177\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/5.png?resize=530%2C294&amp;ssl=1 530w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/5.png?resize=150%2C83&amp;ssl=1 150w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/5.png?resize=300%2C167&amp;ssl=1 300w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/5.png?resize=535%2C297&amp;ssl=1 535w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/5.png?w=1800&amp;ssl=1 1800w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/5.png?w=1020&amp;ssl=1 1020w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/5.png?w=1530&amp;ssl=1 1530w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/center><\/p>\n<pre lang=\"rsplus\">\r\nworld <- readOGR(\"data\/ne_50m_admin_0_countries.geojson\", layer=\"OGRGeoJSON\")\r\nworld <- world[!world$iso_a3 %in% c(\"ATA\"),]\r\nworld <- spTransform(world, CRS(\"+proj=wintri\"))\r\n\r\nmap_w <- ggplot2::fortify(world, region=\"iso_a3\")\r\n\r\n# really quick way to get coords from a KML file\r\n\r\nlaunch_sites <- rbindlist(lapply(ogrListLayers(\"data\/launch-sites.kml\")[c language=\"(1:2,4:9)\"][\/c], function(layer) {\r\n  tmp <- readOGR(\"data\/launch-sites.kml\", layer)\r\n  places <- data.table(coordinates(tmp)[,1:2], as.character(tmp$Name))\r\n}))\r\nsetnames(launch_sites, colnames(launch_sites), c(\"lon\", \"lat\", \"name\"))\r\n\r\n# now, project the coordinates we extracted\r\n\r\ncoordinates(launch_sites) <-  ~lon+lat\r\nlaunch_sites <- as.data.frame(SpatialPointsDataFrame(spTransform(\r\n  SpatialPoints(launch_sites, CRS(\"+proj=longlat\")), CRS(\"+proj=wintri\")),\r\n  launch_sites@data))\r\n\r\nmap_w %>%\r\n  group_by(group, id) %>%\r\n  ggvis(~long, ~lat) %>%\r\n  layer_paths(fill:=\"#252525\", stroke:=\"white\", strokeOpacity:=0.5, strokeWidth:=0.25) %>%\r\n  layer_points(data=launch_sites, \r\n               x=~lon, y=~lat, \r\n               fill:=\"#cb181d\", stroke:=\"white\", \r\n               size:=25, fillOpacity:=0.5, strokeWidth:=0.25) %>%\r\n  hide_legend(\"fill\") %>%\r\n  hide_axis(\"x\") %>% hide_axis(\"y\") %>%\r\n  set_options(width=900, height=500, keep_aspect=TRUE)<\/pre>\n<p>The main differences in this example are the re-projection of the data we&#8217;re using. I grabbed a KML file of rocket launch sites from Wikipedia and made it into a data frame then [re]project those points into Winkel-Tripel for use with Winkel-Tripel world map made at the beginning of the example. The `ggplot` `coord_map` handles these transforms for you, so until there&#8217;s a `ggvis` equivalent, you&#8217;ll need to do it this way (though, there&#8217;s not Winkel-Tripel projection in the `mapproject` package so you kinda need to do it this way for `ggplot` as well for this projection).<\/p>\n<p>### Wrapping Up<\/p>\n<p>There&#8217;s <a href=\"https:\/\/github.com\/hrbrmstr\/ggvis-maps\">code up on github<\/a> for the &#8220;normal&#8221;, `Rmd` and Shiny versions of these examples. Give each a go and try tweaking various parameters, changing up the tooltips or using your own data. Don&#8217;t forget to drop a note in the comments with any of your creations and use github for any code issues.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Even though it&#8217;s still at version `0.4`, the `ggvis` package has quite a bit of functionality and is highly useful for exploratory data analysis (EDA). I wanted to see how geographical visualizations would work under it, so I put together six examples that show how to use various features of `ggvis` for presenting static &#038; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[721,673,674,707,706,91,710],"tags":[810],"class_list":["post-3158","post","type-post","status-publish","format-standard","hentry","category-cartography","category-datavis-2","category-dataviz","category-maine","category-maps","category-r","category-shiny","tag-post"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Making Static &amp; Interactive Maps With ggvis (+ using ggvis maps w\/shiny) - rud.is<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Making Static &amp; Interactive Maps With ggvis (+ using ggvis maps w\/shiny) - rud.is\" \/>\n<meta property=\"og:description\" content=\"Even though it&#8217;s still at version `0.4`, the `ggvis` package has quite a bit of functionality and is highly useful for exploratory data analysis (EDA). I wanted to see how geographical visualizations would work under it, so I put together six examples that show how to use various features of `ggvis` for presenting static &#038; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2014-12-29T14:35:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-07T21:44:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1-203x300.png\" \/>\n<meta name=\"author\" content=\"hrbrmstr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"hrbrmstr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Making Static &#038; Interactive Maps With ggvis (+ using ggvis maps w\/shiny)\",\"datePublished\":\"2014-12-29T14:35:33+00:00\",\"dateModified\":\"2018-03-07T21:44:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/\"},\"wordCount\":892,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1-203x300.png\",\"keywords\":[\"post\"],\"articleSection\":[\"cartography\",\"DataVis\",\"DataViz\",\"maine\",\"maps\",\"R\",\"shiny\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/\",\"url\":\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/\",\"name\":\"Making Static & Interactive Maps With ggvis (+ using ggvis maps w\/shiny) - rud.is\",\"isPartOf\":{\"@id\":\"https:\/\/rud.is\/b\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1-203x300.png\",\"datePublished\":\"2014-12-29T14:35:33+00:00\",\"dateModified\":\"2018-03-07T21:44:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1.png?fit=496%2C734&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1.png?fit=496%2C734&ssl=1\",\"width\":496,\"height\":734},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/rud.is\/b\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Making Static &#038; Interactive Maps With ggvis (+ using ggvis maps w\/shiny)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/rud.is\/b\/#website\",\"url\":\"https:\/\/rud.is\/b\/\",\"name\":\"rud.is\",\"description\":\"&quot;In God we trust. All others must bring data&quot;\",\"publisher\":{\"@id\":\"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/rud.is\/b\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886\",\"name\":\"hrbrmstr\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1\",\"url\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1\",\"width\":460,\"height\":460,\"caption\":\"hrbrmstr\"},\"logo\":{\"@id\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1\"},\"description\":\"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7\",\"sameAs\":[\"http:\/\/rud.is\"],\"url\":\"https:\/\/rud.is\/b\/author\/hrbrmstr\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Making Static & Interactive Maps With ggvis (+ using ggvis maps w\/shiny) - rud.is","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/","og_locale":"en_US","og_type":"article","og_title":"Making Static & Interactive Maps With ggvis (+ using ggvis maps w\/shiny) - rud.is","og_description":"Even though it&#8217;s still at version `0.4`, the `ggvis` package has quite a bit of functionality and is highly useful for exploratory data analysis (EDA). I wanted to see how geographical visualizations would work under it, so I put together six examples that show how to use various features of `ggvis` for presenting static &#038; [&hellip;]","og_url":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/","og_site_name":"rud.is","article_published_time":"2014-12-29T14:35:33+00:00","article_modified_time":"2018-03-07T21:44:05+00:00","og_image":[{"url":"https:\/\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1-203x300.png","type":"","width":"","height":""}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Making Static &#038; Interactive Maps With ggvis (+ using ggvis maps w\/shiny)","datePublished":"2014-12-29T14:35:33+00:00","dateModified":"2018-03-07T21:44:05+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/"},"wordCount":892,"commentCount":3,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1-203x300.png","keywords":["post"],"articleSection":["cartography","DataVis","DataViz","maine","maps","R","shiny"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/","url":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/","name":"Making Static & Interactive Maps With ggvis (+ using ggvis maps w\/shiny) - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1-203x300.png","datePublished":"2014-12-29T14:35:33+00:00","dateModified":"2018-03-07T21:44:05+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1.png?fit=496%2C734&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2014\/12\/1.png?fit=496%2C734&ssl=1","width":496,"height":734},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2014\/12\/29\/making-static-interactive-maps-with-ggvis-using-ggvis-maps-wshiny\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Making Static &#038; Interactive Maps With ggvis (+ using ggvis maps w\/shiny)"}]},{"@type":"WebSite","@id":"https:\/\/rud.is\/b\/#website","url":"https:\/\/rud.is\/b\/","name":"rud.is","description":"&quot;In God we trust. All others must bring data&quot;","publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rud.is\/b\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886","name":"hrbrmstr","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","width":460,"height":460,"caption":"hrbrmstr"},"logo":{"@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1"},"description":"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7","sameAs":["http:\/\/rud.is"],"url":"https:\/\/rud.is\/b\/author\/hrbrmstr\/"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p23idr-OW","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":4429,"url":"https:\/\/rud.is\/b\/2016\/06\/12\/on-whether-y-axis-labels-are-always-necessary\/","url_meta":{"origin":3158,"position":0},"title":"On Whether Y-axis Labels Are Always Necessary","author":"hrbrmstr","date":"2016-06-12","format":false,"excerpt":"The infamous @albertocairo [blogged about](http:\/\/www.thefunctionalart.com\/2016\/06\/propublica-visualizes-seasonality-in.html) a [nice interactive piece on German company tax avoidance](https:\/\/projects.propublica.org\/graphics\/dividend) by @ProPublica. Here's a snapshot of their interactive chart: ![](https:\/\/2.bp.blogspot.com\/-S-8bu1UdYWM\/V1rXibnBxrI\/AAAAAAAAGo0\/L940SpU3DvUPX90JK82jrKQN6fWMyn2IACLcB\/s1600\/1prop.png) Dr. Cairo (his PhD is in the bag as far as I'm concerned :-) posited: >_Isn't it weird that the chart doesn't have a scale on\u2026","rel":"","context":"In &quot;Data Visualization&quot;","block_context":{"text":"Data Visualization","link":"https:\/\/rud.is\/b\/category\/data-visualization\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/06\/Plot_Zoom.png?fit=1200%2C1036&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/06\/Plot_Zoom.png?fit=1200%2C1036&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/06\/Plot_Zoom.png?fit=1200%2C1036&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/06\/Plot_Zoom.png?fit=1200%2C1036&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/06\/Plot_Zoom.png?fit=1200%2C1036&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3314,"url":"https:\/\/rud.is\/b\/2015\/03\/15\/simple-lower-us-48-albers-maps-local-no-api-citystate-geocoding-in-r\/","url_meta":{"origin":3158,"position":1},"title":"Simple Lower US 48 Albers Maps &#038; Local (no-API) City\/State Geocoding in R","author":"hrbrmstr","date":"2015-03-15","format":false,"excerpt":"I've been seeing an uptick in static US \"lower 48\" maps with \"meh\" projections this year, possibly caused by a flood of new folks resolving to learn R but using pretty old documentation or tutorials. I've also been seeing an uptick in folks needing to geocode US city\/state to lat\/lon.\u2026","rel":"","context":"In &quot;cartography&quot;","block_context":{"text":"cartography","link":"https:\/\/rud.is\/b\/category\/cartography\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3585,"url":"https:\/\/rud.is\/b\/2015\/08\/04\/achieve-charting-zen-with-taucharts\/","url_meta":{"origin":3158,"position":2},"title":"Achieve Charting Zen With TauCharts","author":"hrbrmstr","date":"2015-08-04","format":false,"excerpt":"There was some chatter on the twitters this week about a relatively new D3-based charting library called [TauCharts](http:\/\/taucharts.com\/) (also @taucharts). The API looked pretty clean and robust, so I started working on an htmlwidget for it and was quickly joined by the Widget Master himself, @timelyportfolio. TauCharts definitely has a\u2026","rel":"","context":"In &quot;Charts &amp; Graphs&quot;","block_context":{"text":"Charts &amp; Graphs","link":"https:\/\/rud.is\/b\/category\/charts-graphs\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3538,"url":"https:\/\/rud.is\/b\/2015\/07\/24\/a-path-towards-easier-map-projection-machinations-with-ggplot2\/","url_meta":{"origin":3158,"position":3},"title":"A Path Towards Easier Map Projection Machinations with ggplot2","author":"hrbrmstr","date":"2015-07-24","format":false,"excerpt":"The $DAYJOB doesn't afford much opportunity to work with cartographic datasets, but I really like maps and tinker with shapefiles and geo-data when I can, plus answer a ton of geo-questions on StackOverflow. R makes it easy\u2014one might even say too easy\u2014to work with maps. All it takes to make\u2026","rel":"","context":"In &quot;cartography&quot;","block_context":{"text":"cartography","link":"https:\/\/rud.is\/b\/category\/cartography\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3563,"url":"https:\/\/rud.is\/b\/2015\/07\/26\/making-staticinteractive-voronoi-map-layers-in-ggplotleaflet\/","url_meta":{"origin":3158,"position":4},"title":"Making Static\/Interactive Voronoi Map Layers In ggplot\/leaflet","author":"hrbrmstr","date":"2015-07-26","format":false,"excerpt":"Despite having shown various ways to overcome D3 cartographic envy, there are always more examples that can cause the green monster to rear it's ugly head. Take the Voronoi Arc Map example. For those in need of a primer, a Voronoi tesslation\/diagram is: \u2026a partitioning of a plane into regions\u2026","rel":"","context":"In &quot;cartography&quot;","block_context":{"text":"cartography","link":"https:\/\/rud.is\/b\/category\/cartography\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10991,"url":"https:\/\/rud.is\/b\/2018\/07\/06\/visualizing-macos-app-usage\/","url_meta":{"origin":3158,"position":5},"title":"Visualizing macOS App Usage with a Little Help from osqueryr &#038; mactheknife","author":"hrbrmstr","date":"2018-07-06","format":false,"excerpt":"Both my osqueryr and macthekinfe packages have had a few updates and I wanted to put together a fun example (it being Friday, and all) for what you can do with them. All my packages are now on GitHub and GitLab and I'll be maintaining them on both so I\u2026","rel":"","context":"In &quot;R&quot;","block_context":{"text":"R","link":"https:\/\/rud.is\/b\/category\/r\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/07\/app-lod-tree-1.png?fit=1200%2C1197&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/07\/app-lod-tree-1.png?fit=1200%2C1197&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/07\/app-lod-tree-1.png?fit=1200%2C1197&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/07\/app-lod-tree-1.png?fit=1200%2C1197&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/07\/app-lod-tree-1.png?fit=1200%2C1197&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/3158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/comments?post=3158"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/3158\/revisions"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=3158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=3158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=3158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}