

{"id":3841,"date":"2016-01-03T13:18:08","date_gmt":"2016-01-03T18:18:08","guid":{"rendered":"http:\/\/rud.is\/b\/?p=3841"},"modified":"2018-03-07T16:43:07","modified_gmt":"2018-03-07T21:43:07","slug":"zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/","title":{"rendered":"Zellingenach: A visual exploration of the spatial patterns in the endings of German town and village names in R"},"content":{"rendered":"<p>Moritz Stefaner started off 2016 with a [very spiffy post](http:\/\/truth-and-beauty.net\/experiments\/ach-ingen-zell\/) on _&#8221;a visual exploration of the spatial patterns in the endings of German town and village names&#8221;_. Moritz was [exploring some new data processing &#038; visualization tools](https:\/\/github.com\/moritzstefaner\/ach-ingen-zell) for the post, but when I saw what he was doing I wondered how hard it would be to do something similar in R and also used it as an opportunity to start practicing a new habit in 2016: packages vs projects.<\/p>\n<p>To state more precisely the goals for this homage, the plan was to:<\/p>\n<p>&#8211; use as close to the same data sets Mortiz has in his github repo, _including_ the ones in pure javascript<br \/>\n&#8211; generate an HTML page as output that is as close to the style in Moritz&#8217;s visualization<br \/>\n&#8211; use R for _everything_ (i.e. no &#8220;cheating&#8221; by sneaking in some javascript via `htmlwidgets`)<br \/>\n&#8211; bundle everything into a package to take advantage of all the good stuff that comes with R package validation<\/p>\n<p>You may want to [take a look at the result](http:\/\/rud.is\/zellingenach.html) to see if you want to continue reading (I hope you will!). <\/p>\n<p>### The Setup<br \/>\n<img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"3843\" data-permalink=\"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/rud_is_zellingenach_html\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html.png?fit=597%2C798&amp;ssl=1\" data-orig-size=\"597,798\" 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=\"rud_is_zellingenach_html\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html.png?fit=510%2C682&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html.png?w=510&#038;ssl=1\" alt=\"rud_is_zellingenach_html\"  class=\"alignright size-full wp-image-3843\" \/>By using an R package as the framework for the visualization, it&#8217;s possible to keep the data with the code and also organize and document the code in a way that makes it easy for folks to use and explore without cutting and pasting (our `source`ing) code. It also makes it possible to list all the dependencies for the project and help ensure they&#8217;ll be installed when someone tries to work with it. <\/p>\n<p>While I _could_ have converted Moritz&#8217;s processed data into R data files, I left the CSV intact and the javascript file of suffix groupings also intact to show that R is extremely flexible when it comes to data processing (which is a &#8220;duh&#8221; for most folks by this point but the use of javascript data structures might give some folks ideas as how to reduce data duplication between projects). Both these files get stored in the `inst\/alt` folder of the source package. I also end up using some CSS for the final visualization and placed that into a file in the same directory, which makes the code that generates the HTML a bit cleaner.<\/p>\n<p>Because R processes some things automatically (like `.onAttach`) when it interacts with a package one can have it provide helpful instructions (in this case, how to generate the visualization) in similar fashion to the `ggplot2` loading messages. <\/p>\n<p>Similarly, there both the package itself and the package functions have documentation to help folks understand both what the package and each component is doing.<\/p>\n<p>### The Fun Stuff<br \/>\n<img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"3847\" data-permalink=\"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/rud_is_zellingenach_html-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html-1.png?fit=595%2C796&amp;ssl=1\" data-orig-size=\"595,796\" 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=\"rud_is_zellingenach_html\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html-1.png?fit=510%2C682&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html-1.png?w=510&#038;ssl=1\" alt=\"rud_is_zellingenach_html\"  class=\"alignleft size-full wp-image-3847\" \/>The CSV file of places looks something like this:<\/p>\n<pre style=\"font-size:12px\">name,latitude,longitude\r\nNierskanal,49.01,13.23\r\nZwiefelhof,49.22,11.18\r\nZwiefaltendorf,48.21,9.51\r\nZwiefalten,48.23,9.46\r\nZwiedorf,53.69,13.05\r\nZwickgabel,48.58,8.31\r\nZwickau,50.72,12.48\r\nZwethau,51.58,13.04\r\nZwesten,51.05,9.17<\/pre>\n<p>and, the suffix groupings list looks like this:<\/p>\n<pre lang=\"javascript\">\r\nconst suffixList = [\r\n  [\"ach\", \"a\", \"aa\", \"ah\"],\r\n  [\"ar\", \"ahr\"],\r\n  [\"ate\", \"te\", \"nit\", \"net\"],\r\n  [\"au\", \"aue\", \"oog\", \"ooge\", \"ohe\", \"oie\"],\r\n  [\"bach\", \"bach\", \"bek\", \"beken\", \"beck\", \"bke\"],\r\n  [\"berg\", \"bergen\", \"barg\", \"bargen\"],\r\n  [\"born\", \"bronn\"],\r\n  [\"bruch\", \"broich\", \"brook\", \"brock\", \"brauk\"],\r\n  [\"bruck\", \"br\u00fcck\", \"br\u00fcgge\"],\r\n  ...\r\n];<\/pre>\n<p>While `read.csv` (no need for `readr` as the file is small) can handle the CSV file, we use the `V8` package to source the javascript and convert it to an R object:<\/p>\n<pre lang=\"rsplus\">ct <- v8()\r\nct$source(system.file(\"alt\/suffixlist.js\", package=\"zellingenach\"))\r\nct$get(\"suffixList\")<\/pre>\n<p>We actually turn that into a vector of regular expressions (for town name ending checking) and a list of vectors (for the HTML visualization creation). Check out `suffix_regex()` and `suffix_names()` in the source code.<\/p>\n<p>The `read_places()` function builds a `data.frame` of the places combined with the suffix grouping(s) they belong to:<\/p>\n<pre lang=\"rsplus\">\r\n# read in the file\r\nplc <- read.csv(system.file(\"alt\/placenames_de.tsv\", package=\"zellingenach\"),\r\n                stringsAsFactors=FALSE)\r\n\r\n# iterate over each suffix and identify which place names match the grouping\r\nlapply(suf, function(regex) {\r\n  which(stri_detect_regex(plc$name, regex))\r\n}) -> matched_endings\r\n\r\nplc$found <- \"\"\r\n\r\n# add which grouping(s) the place was found to a new column\r\nfor(i in 1:length(matched_endings)) {\r\n  where_found <- matched_endings[[i]]\r\n  plc$found[where_found] <-\r\n    paste0(plc$found[where_found], sprintf(\"%d|\", i))\r\n}\r\n\r\n# some don't match so get rid of them\r\nmutate(filter(plc, found != \"\"), found=sub(\"\\\\|$\", \"\", found))<\/pre>\n<p>I do something a bit different than Moritz in that in that I allow towns to be part of multiple suffix groups, since: <\/p>\n<p>- I'm neither a historian nor expert in German town naming conventions, and<br \/>\n- the javascript version and this R version both take a naive approach to suffix mapping.<\/p>\n<p>This means my numbers (for the _\"#### places\"_ label) will be different for some of my maps.<\/p>\n<p>R has similar shortcut functions (Mortiz uses D3) to make hexgrids out of shapefiles. Here's the entirety of `create_hexgrid()`:<\/p>\n<pre lang=\"rsplus\">de_shp <- getData(\"GADM\", country=\"DEU\", level=0, path=tempdir())\r\n\r\nde_hex_pts <- spsample(de_shp, type=\"hexagonal\", n=10000, cellsize=0.19,\r\n                       offset=c(0.5, 0.5), pretty=TRUE)\r\n\r\nHexPoints2SpatialPolygons(de_hex_pts)<\/pre>\n<p>You can play with `cellsize` to change the number of hexes. I tried to find a good number to get close to the # in Moritz's maps.<\/p>\n<p>This all gets put together in `make_maps()` where we use `ggplot2` to build 52 gridded heatmaps (one for each suffix grouping). I used a log of the counts to map to a binned viridis color scale, so my colors come out a bit different than Moritz's but the overall patterns are on par with his.<\/p>\n<p>Finally, `display_maps()` takes the list created by `make_maps()` and builds out an HTML page using the `htmltools` package for the page framework and `svglite::htmlSVG` to make SVGs of the ggplot objects). NOTE that you can use the `output_file` option of `display_maps()` to send the HTML to a file as well as display it in the viewer\/browser.<\/p>\n<p>### Fin<br \/>\n<img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"3849\" data-permalink=\"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/rud_is_zellingenach_html-3\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html-2.png?fit=588%2C794&amp;ssl=1\" data-orig-size=\"588,794\" 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=\"rud_is_zellingenach_html\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html-2.png?fit=510%2C689&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html-2.png?w=510&#038;ssl=1\" alt=\"rud_is_zellingenach_html\"  class=\"alignright size-full wp-image-3849\" \/>Because the project is in a pacakge, we can run package checks to see if we're missing anything including other pacakge dependencies, function documentation and other details that the package tools are gleeful to point out. We can also include code to test out our various components to ensure they are behaving as expected (i.e. generating the right data\/output).<\/p>\n<p>Once nice thing about the output is that it's \"responsive\", which means it handles multiple screen sizes quite well. So, if your screen is huge, you'll have many map boxes on one line and if it's small (like the `iframe` below) it will have fewer.<\/p>\n<p>You'll see that my maps are a bit bigger than Moritz's. This is due to both the hex grid size and the fact that the SVG output is just slightly larger overall than the ones made by D3. Of note: I noticed some suffix subtitle components wrapped at the \"-\" so I converted the plain dashes to non-breaking ones `&#8209;`\/\"&#8209;\".<\/p>\n<p>The one downside to using a package for this is that it's harder to post complete code into a blog post, but you can [clone the repo](https:\/\/github.com\/hrbrmstr\/zellingenach) to look at the code and skip the dissection and just generate the visualization locally via:<\/p>\n<pre lang=\"rsplus\">install.packages(\"ggalt\")\r\n# OR: devtools::install_github(\"hrbrmstr\/ggalt\") \r\ndevtools::install_github(\"hrbrmstr\/zellingenach\")\r\ndisplay_maps()<\/pre>\n<p>By targeting SVG &amp; HTML, we can make a cross-platform, crisp and responsive visualization all without leaving RStudio. <\/p>\n<p>If you caught any errors or made something cool with any of the code, please drop an issue on github and a note in the comments (respectively)! <\/p>\n<p>If you prefer a single- `source`-able version, please see [this gist](https:\/\/gist.github.com\/hrbrmstr\/f3d2568ad0f27b2384d3).<\/p>\n<p>Happy New YeaR!<\/p>\n<p><center><iframe loading=\"lazy\" style=\"max-width=100%\" \n        src=\"\/zellingenach.html\" \n        sandbox=\"allow-same-origin \n        allow-scripts\" width=\"100%\" \n        height=\"600\" \n        scrolling=\"yes\" \n        seamless=\"seamless\" \n        frameBorder=\"0\"><\/iframe><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Moritz Stefaner started off 2016 with a [very spiffy post](http:\/\/truth-and-beauty.net\/experiments\/ach-ingen-zell\/) on _&#8221;a visual exploration of the spatial patterns in the endings of German town and village names&#8221;_. Moritz was [exploring some new data processing &#038; visualization tools](https:\/\/github.com\/moritzstefaner\/ach-ingen-zell) for the post, but when I saw what he was doing I wondered how hard it would be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3843,"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,678,673,674,753,91,723],"tags":[810],"class_list":["post-3841","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cartography","category-data-visualization","category-datavis-2","category-dataviz","category-ggplot","category-r","category-svg","tag-post"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Zellingenach: A visual exploration of the spatial patterns in the endings of German town and village names in R - 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\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Zellingenach: A visual exploration of the spatial patterns in the endings of German town and village names in R - rud.is\" \/>\n<meta property=\"og:description\" content=\"Moritz Stefaner started off 2016 with a [very spiffy post](http:\/\/truth-and-beauty.net\/experiments\/ach-ingen-zell\/) on _&#8221;a visual exploration of the spatial patterns in the endings of German town and village names&#8221;_. Moritz was [exploring some new data processing &#038; visualization tools](https:\/\/github.com\/moritzstefaner\/ach-ingen-zell) for the post, but when I saw what he was doing I wondered how hard it would be [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2016-01-03T18:18:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-07T21:43:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html.png?fit=597%2C798&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"597\" \/>\n\t<meta property=\"og:image:height\" content=\"798\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/03\\\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/03\\\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Zellingenach: A visual exploration of the spatial patterns in the endings of German town and village names in R\",\"datePublished\":\"2016-01-03T18:18:08+00:00\",\"dateModified\":\"2018-03-07T21:43:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/03\\\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\\\/\"},\"wordCount\":1112,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/03\\\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/01\\\/rud_is_zellingenach_html.png?fit=597%2C798&ssl=1\",\"keywords\":[\"post\"],\"articleSection\":[\"cartography\",\"Data Visualization\",\"DataVis\",\"DataViz\",\"ggplot\",\"R\",\"svg\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/03\\\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/03\\\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/03\\\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\\\/\",\"name\":\"Zellingenach: A visual exploration of the spatial patterns in the endings of German town and village names in R - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/03\\\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/03\\\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/01\\\/rud_is_zellingenach_html.png?fit=597%2C798&ssl=1\",\"datePublished\":\"2016-01-03T18:18:08+00:00\",\"dateModified\":\"2018-03-07T21:43:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/03\\\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/03\\\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/03\\\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/01\\\/rud_is_zellingenach_html.png?fit=597%2C798&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/01\\\/rud_is_zellingenach_html.png?fit=597%2C798&ssl=1\",\"width\":597,\"height\":798},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/03\\\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Zellingenach: A visual exploration of the spatial patterns in the endings of German town and village names in R\"}]},{\"@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":"Zellingenach: A visual exploration of the spatial patterns in the endings of German town and village names in R - 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\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/","og_locale":"en_US","og_type":"article","og_title":"Zellingenach: A visual exploration of the spatial patterns in the endings of German town and village names in R - rud.is","og_description":"Moritz Stefaner started off 2016 with a [very spiffy post](http:\/\/truth-and-beauty.net\/experiments\/ach-ingen-zell\/) on _&#8221;a visual exploration of the spatial patterns in the endings of German town and village names&#8221;_. Moritz was [exploring some new data processing &#038; visualization tools](https:\/\/github.com\/moritzstefaner\/ach-ingen-zell) for the post, but when I saw what he was doing I wondered how hard it would be [&hellip;]","og_url":"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/","og_site_name":"rud.is","article_published_time":"2016-01-03T18:18:08+00:00","article_modified_time":"2018-03-07T21:43:07+00:00","og_image":[{"width":597,"height":798,"url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html.png?fit=597%2C798&ssl=1","type":"image\/png"}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Zellingenach: A visual exploration of the spatial patterns in the endings of German town and village names in R","datePublished":"2016-01-03T18:18:08+00:00","dateModified":"2018-03-07T21:43:07+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/"},"wordCount":1112,"commentCount":7,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html.png?fit=597%2C798&ssl=1","keywords":["post"],"articleSection":["cartography","Data Visualization","DataVis","DataViz","ggplot","R","svg"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/","url":"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/","name":"Zellingenach: A visual exploration of the spatial patterns in the endings of German town and village names in R - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html.png?fit=597%2C798&ssl=1","datePublished":"2016-01-03T18:18:08+00:00","dateModified":"2018-03-07T21:43:07+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html.png?fit=597%2C798&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html.png?fit=597%2C798&ssl=1","width":597,"height":798},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2016\/01\/03\/zellingenach-a-visual-exploration-of-the-spatial-patterns-in-the-endings-of-german-town-and-village-names-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Zellingenach: A visual exploration of the spatial patterns in the endings of German town and village names in R"}]},{"@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":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/rud_is_zellingenach_html.png?fit=597%2C798&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p23idr-ZX","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":4501,"url":"https:\/\/rud.is\/b\/2016\/07\/07\/bridging-the-political-polygons-gap-with-ggplot2\/","url_meta":{"origin":3841,"position":0},"title":"Bridging The Political [Polygons] Gap with ggplot2","author":"hrbrmstr","date":"2016-07-07","format":false,"excerpt":"The @pewresearch folks have been collecting political survey data for quite a while, and I noticed the [visualization below](http:\/\/www.people-press.org\/2014\/06\/12\/section-1-growing-ideological-consistency\/#interactive) referenced in a [Tableau vis contest entry](https:\/\/www.interworks.com\/blog\/rrouse\/2016\/06\/24\/politics-viz-contest-plotting-political-polarization): Those are filled [frequency polygons](http:\/\/onlinestatbook.com\/2\/graphing_distributions\/freq_poly.html), which are super-easy to replicate in ggplot2, especially since Pew even _kind of_ made the data available via their\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\/07\/engfull.png?fit=1200%2C1098&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/07\/engfull.png?fit=1200%2C1098&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/07\/engfull.png?fit=1200%2C1098&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/07\/engfull.png?fit=1200%2C1098&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/07\/engfull.png?fit=1200%2C1098&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":2782,"url":"https:\/\/rud.is\/b\/2013\/11\/13\/visual-anatomy-of-r-packages-used-in-data-driven-security\/","url_meta":{"origin":3841,"position":1},"title":"Visual Anatomy Of R Packages Used in Data Driven Security","author":"hrbrmstr","date":"2013-11-13","format":false,"excerpt":"Since @jayjacobs & I are down to the home stretch on Data Driven Security, I thought it would be interesting to do some post-writing pseudo-analyses of the book itself. I won't have exact page or word counts for a bit, but I wanted to see how many R packages we\u2026","rel":"","context":"In &quot;Data Analysis&quot;","block_context":{"text":"Data Analysis","link":"https:\/\/rud.is\/b\/category\/data-analysis-2\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3083,"url":"https:\/\/rud.is\/b\/2014\/10\/07\/plot-me-like-a-hurricane-a-k-a-animating-historical-north-atlantic-basin-tropical-storm-tracks\/","url_meta":{"origin":3841,"position":2},"title":"Plot Me Like a Hurricane (a.k.a. animating historical North Atlantic basin tropical storm tracks)","author":"hrbrmstr","date":"2014-10-07","format":false,"excerpt":"Markus Gessman (@MarkusGesmann) did a beautiful job [Visualising the seasonality of Atlantic windstorms](http:\/\/www.magesblog.com\/2014\/10\/visualising-seasonality-of-atlantic.html) using small multiples, which was inspired by both a [post](http:\/\/freakonometrics.hypotheses.org\/17113) by Arthur Charpentier (@freakonometrics) on using Markov spatial processes to \"generate\" hurricanes\u2014which was [tweaked a bit](http:\/\/robertgrantstats.wordpress.com\/2014\/10\/01\/transparent-hurricane-paths-in-r\/) by Robert Grant (@robertstats)\u2014and [Gaston Sanchez](https:\/\/github.com\/gastonstat)'s [Visualizing Hurricane Trajectories](http:\/\/rpubs.com\/gaston\/hurricanes) RPub. I\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":"","width":0,"height":0},"classes":[]},{"id":4225,"url":"https:\/\/rud.is\/b\/2016\/03\/30\/introducing-a-weekly-r-python-js-etc-vis-challenge\/","url_meta":{"origin":3841,"position":3},"title":"Introducing a Weekly R \/ Python \/ JS \/ etc Vis Challenge!","author":"hrbrmstr","date":"2016-03-30","format":false,"excerpt":">UPDATE: Deadline is now 2016-04-05 23:59 EDT; next vis challenge is 2016-04-06! Per a suggestion, I'm going to try to find a neat data set (prbly one from @jsvine) to feature each week and toss up some sample code (99% of the time prbly in R) and offer up 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":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz024.png?fit=1200%2C605&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz024.png?fit=1200%2C605&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz024.png?fit=1200%2C605&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz024.png?fit=1200%2C605&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz024.png?fit=1200%2C605&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":4560,"url":"https:\/\/rud.is\/b\/2016\/07\/26\/use-quick-formula-functions-in-purrrmap-base-vs-tidtyverse-idiom-comparisonsexamples\/","url_meta":{"origin":3841,"position":4},"title":"Use quick formula functions in purrr::map (+ base vs tidtyverse idiom comparisons\/examples)","author":"hrbrmstr","date":"2016-07-26","format":false,"excerpt":"I've converted the vast majority of my *apply usage over to purrr functions. In an attempt to make this a quick post, I'll refrain from going into all the benefits of the purrr package. Instead, I'll show just one thing that's super helpful: formula functions. After seeing this Quartz article\u2026","rel":"","context":"In &quot;R&quot;","block_context":{"text":"R","link":"https:\/\/rud.is\/b\/category\/r\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2793,"url":"https:\/\/rud.is\/b\/2013\/11\/27\/mapping-power-outages-in-maine-with-r\/","url_meta":{"origin":3841,"position":5},"title":"Mapping Power Outages In Maine With R","author":"hrbrmstr","date":"2013-11-27","format":false,"excerpt":"UPDATE: A Shiny (dynamic) version of this is now available. We had yet-another power outage this morning due to the weird weather patterns of the week and it was the final catalyst I needed to crank out some R code to map the affected counties. Central Maine Power provides an\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":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2013\/11\/Plot_Zoom.png?fit=530%2C680&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2013\/11\/Plot_Zoom.png?fit=530%2C680&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2013\/11\/Plot_Zoom.png?fit=530%2C680&ssl=1&resize=525%2C300 1.5x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/3841","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=3841"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/3841\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media\/3843"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=3841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=3841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=3841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}