

{"id":3898,"date":"2016-01-13T12:35:23","date_gmt":"2016-01-13T17:35:23","guid":{"rendered":"http:\/\/rud.is\/b\/?p=3898"},"modified":"2018-03-07T16:43:07","modified_gmt":"2018-03-07T21:43:07","slug":"cobble-xpath-interactively-with-the-xmlview-package","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/","title":{"rendered":"Cobble XPath Interactively with the xmlview Package"},"content":{"rendered":"<p>(If you don&#8217;t know what XML is, you should probably [read a primer](https:\/\/en.wikipedia.org\/wiki\/XML) before reading this post,)<\/p>\n<p>When working with data, one inevitably comes across things encoded in XML. I&#8217;m in the &#8220;anti-XML&#8221; camp, but deal with my fair share of XML in &#8220;cyber&#8221; and help out enough people who have to work with XML that I&#8217;ve become pretty proficient when slicing &#038; dicing it.<\/p>\n<p>R has two main packages to deal with XML: the original `XML` package and the more lightweight and modern `xml2` package. If you really need all the power of `libxml2` (the C library that powers both packages) or are _creating_ XML from R, then you probably know your way around the `XML` package and are pretty self-sufficient.<\/p>\n<p>Most folks can get by with the `xml2` package if their goal is to work with XML data. By &#8220;work with&#8221; I mean read in files or data from APIs that come in XML format and have to find nuggets of gold in between all those `<` and `>` tags. To do so requires finding what you need and that means using a query language called `XPath` to pinpoint the node(s) you are after. Working with `XPath` can be pretty daunting for those who went to school to ultimately cure diseases, build high-performing stock portfolios, target advertising to everyone or perform a host of other real work. Becoming an expert in `XPath` was not something on the bucket list but to work with XML you will need to be familiar with it.<\/p>\n<p>The [`xmlview`](https:\/\/github.com\/hrbrmstr\/xmlview) package provides a way to visually inspect XML and interactively test out `XPath` expressions. It&#8217;s as simple to use as:<\/p>\n<pre lang=\"rsplus\">devtools::install_github(\"ramnathv\/htmlwidgets\") # we use some bleeding edge features\r\ndevtools::install_github(\"hrbrmstr\/xmlview\")\r\nlibrary(xml2)\r\nlibrary(xmlview)\r\n\r\n# plain text XML\r\nxml_view(\"<note><to>Tove<\/to><from>Jani<\/from><heading>Reminder<\/heading><body>Don't forget me this weekend!<\/body><\/note>\")\r\n\r\n# read-in XML document\r\ndoc <- read_xml(\"http:\/\/www.npr.org\/rss\/rss.php?id=1001\")\r\nxml_view(doc, add_filter=TRUE)<\/pre>\n<p>(There's also an experimental `xml_tree_view()` in there by @timelyportfolio that we'll be adding features to at a pretty rapid pace.)<\/p>\n<p>Here's a screenshot of it in action:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3903\" data-permalink=\"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/rstudioscreensnapz003\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/RStudioScreenSnapz003.png?fit=865%2C523&amp;ssl=1\" data-orig-size=\"865,523\" 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=\"RStudioScreenSnapz003\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/RStudioScreenSnapz003.png?fit=510%2C308&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/RStudioScreenSnapz003.png?resize=510%2C308&#038;ssl=1\" alt=\"RStudioScreenSnapz003\" width=\"510\" height=\"308\" class=\"alignright size-full wp-image-3903\" style=\"padding-bottom:10px\"\/><\/p>\n<p>There are options to change the CSS styling for the formatted code. Yep, it will format and highlight XML for you so it's easier to work with. There's an animated gif of a screencast over [on github](https:\/\/github.com\/hrbrmstr\/xmlview) as well.<\/p>\n<p>Once you perfect your `XPath` expression, hit the \"R\" button and it will generate the code you can copy back into RStudio. It understands namespaces but try not to stuff a huge XML document in there as browsers don't work well with large data elements (the viewer is an `htmlwidget` and is, hence, browser-based). <\/p>\n<p>It works with plain character XML\/HTML, and many `xml2` data types. I have no current plans for `XML` package object support but toss up an issue on github if you really need it (or, better yet, a PR). If there are other desired features (especially from educators), please post a request in github issue as well.<\/p>\n<p>Watch for more features in the coming weeks and a CRAN release once the bleeding edge `htmlwidgets` packages makes it to CRAN.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(If you don&#8217;t know what XML is, you should probably [read a primer](https:\/\/en.wikipedia.org\/wiki\/XML) before reading this post,) When working with data, one inevitably comes across things encoded in XML. I&#8217;m in the &#8220;anti-XML&#8221; camp, but deal with my fair share of XML in &#8220;cyber&#8221; and help out enough people who have to work with XML [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3903,"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":[764,765,91,732],"tags":[810],"class_list":["post-3898","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-wrangling","category-htmlwidgets","category-r","category-xml","tag-post"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Cobble XPath Interactively with the xmlview Package - 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\/13\/cobble-xpath-interactively-with-the-xmlview-package\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cobble XPath Interactively with the xmlview Package - rud.is\" \/>\n<meta property=\"og:description\" content=\"(If you don&#8217;t know what XML is, you should probably [read a primer](https:\/\/en.wikipedia.org\/wiki\/XML) before reading this post,) When working with data, one inevitably comes across things encoded in XML. I&#8217;m in the &#8220;anti-XML&#8221; camp, but deal with my fair share of XML in &#8220;cyber&#8221; and help out enough people who have to work with XML [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2016-01-13T17:35:23+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\/RStudioScreenSnapz003.png?fit=865%2C523&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"865\" \/>\n\t<meta property=\"og:image:height\" content=\"523\" \/>\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=\"2 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\\\/13\\\/cobble-xpath-interactively-with-the-xmlview-package\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/13\\\/cobble-xpath-interactively-with-the-xmlview-package\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Cobble XPath Interactively with the xmlview Package\",\"datePublished\":\"2016-01-13T17:35:23+00:00\",\"dateModified\":\"2018-03-07T21:43:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/13\\\/cobble-xpath-interactively-with-the-xmlview-package\\\/\"},\"wordCount\":507,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/13\\\/cobble-xpath-interactively-with-the-xmlview-package\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/01\\\/RStudioScreenSnapz003.png?fit=865%2C523&ssl=1\",\"keywords\":[\"post\"],\"articleSection\":[\"data wrangling\",\"htmlwidgets\",\"R\",\"xml\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/13\\\/cobble-xpath-interactively-with-the-xmlview-package\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/13\\\/cobble-xpath-interactively-with-the-xmlview-package\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/13\\\/cobble-xpath-interactively-with-the-xmlview-package\\\/\",\"name\":\"Cobble XPath Interactively with the xmlview Package - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/13\\\/cobble-xpath-interactively-with-the-xmlview-package\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/13\\\/cobble-xpath-interactively-with-the-xmlview-package\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/01\\\/RStudioScreenSnapz003.png?fit=865%2C523&ssl=1\",\"datePublished\":\"2016-01-13T17:35:23+00:00\",\"dateModified\":\"2018-03-07T21:43:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/13\\\/cobble-xpath-interactively-with-the-xmlview-package\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/13\\\/cobble-xpath-interactively-with-the-xmlview-package\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/13\\\/cobble-xpath-interactively-with-the-xmlview-package\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/01\\\/RStudioScreenSnapz003.png?fit=865%2C523&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/01\\\/RStudioScreenSnapz003.png?fit=865%2C523&ssl=1\",\"width\":865,\"height\":523},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/01\\\/13\\\/cobble-xpath-interactively-with-the-xmlview-package\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cobble XPath Interactively with the xmlview Package\"}]},{\"@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":"Cobble XPath Interactively with the xmlview Package - 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\/13\/cobble-xpath-interactively-with-the-xmlview-package\/","og_locale":"en_US","og_type":"article","og_title":"Cobble XPath Interactively with the xmlview Package - rud.is","og_description":"(If you don&#8217;t know what XML is, you should probably [read a primer](https:\/\/en.wikipedia.org\/wiki\/XML) before reading this post,) When working with data, one inevitably comes across things encoded in XML. I&#8217;m in the &#8220;anti-XML&#8221; camp, but deal with my fair share of XML in &#8220;cyber&#8221; and help out enough people who have to work with XML [&hellip;]","og_url":"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/","og_site_name":"rud.is","article_published_time":"2016-01-13T17:35:23+00:00","article_modified_time":"2018-03-07T21:43:07+00:00","og_image":[{"width":865,"height":523,"url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/RStudioScreenSnapz003.png?fit=865%2C523&ssl=1","type":"image\/png"}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Cobble XPath Interactively with the xmlview Package","datePublished":"2016-01-13T17:35:23+00:00","dateModified":"2018-03-07T21:43:07+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/"},"wordCount":507,"commentCount":1,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/RStudioScreenSnapz003.png?fit=865%2C523&ssl=1","keywords":["post"],"articleSection":["data wrangling","htmlwidgets","R","xml"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/","url":"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/","name":"Cobble XPath Interactively with the xmlview Package - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/RStudioScreenSnapz003.png?fit=865%2C523&ssl=1","datePublished":"2016-01-13T17:35:23+00:00","dateModified":"2018-03-07T21:43:07+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/RStudioScreenSnapz003.png?fit=865%2C523&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/01\/RStudioScreenSnapz003.png?fit=865%2C523&ssl=1","width":865,"height":523},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2016\/01\/13\/cobble-xpath-interactively-with-the-xmlview-package\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Cobble XPath Interactively with the xmlview Package"}]},{"@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\/RStudioScreenSnapz003.png?fit=865%2C523&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p23idr-10S","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":11427,"url":"https:\/\/rud.is\/b\/2018\/08\/24\/friday-rstats-twofer-finding-macos-32-bit-apps-processing-data-from-system-commands\/","url_meta":{"origin":3898,"position":0},"title":"Friday #rstats twofer: Finding macOS 32-bit apps &#038; Processing Data from System Commands","author":"hrbrmstr","date":"2018-08-24","format":false,"excerpt":"Apple has run the death bell on 32-bit macOS apps and, if you're running a recent macOS version on your Mac (which you should so you can get security updates) you likely see this alert from time-to-time: If you're like me, you click through that and keep working but later\u2026","rel":"","context":"In &quot;Apple&quot;","block_context":{"text":"Apple","link":"https:\/\/rud.is\/b\/category\/apple\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":12951,"url":"https:\/\/rud.is\/b\/2021\/02\/14\/extracting-heart-rate-data-from-apple-health-xml-export-files-using-r-a-k-a-the-least-romantic-valentines-day-r-post\/","url_meta":{"origin":3898,"position":1},"title":"Extracting Heart Rate Data (Two Ways!) from Apple Health XML Export Files Using R (a.k.a. The Least Romantic Valentine&#8217;s Day R Post Ever)","author":"hrbrmstr","date":"2021-02-14","format":false,"excerpt":"? Expand for EKG code library(hrbrthemes) library(elementalist) # remotes::install_github(\"teunbrand\/elementalist\") library(ggplot2) read_csv( file = \"~\/Data\/apple_health_export\/electrocardiograms\/ecg_2020-09-24.csv\", # this is extracted below skip = 12, col_names = \"\u00b5V\" ) %>% mutate( idx = 1:n() ) -> ekg ggplot() + geom_line_theme( data = ekg %>% tail(3000) %>% head(2500), aes(idx, \u00b5V), size = 0.125, color\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\/2021\/02\/ekg.png?fit=1200%2C437&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/02\/ekg.png?fit=1200%2C437&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/02\/ekg.png?fit=1200%2C437&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/02\/ekg.png?fit=1200%2C437&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/02\/ekg.png?fit=1200%2C437&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":10287,"url":"https:\/\/rud.is\/b\/2018\/05\/18\/lmx-ot-nosj-interchanging-classic-data-formats-with-single-blackmagic-incantations\/","url_meta":{"origin":3898,"position":2},"title":"&#8220;LMX ot NOSJ!&#8221; Interchanging Classic Data Formats With Single blackmagic Incantations","author":"hrbrmstr","date":"2018-05-18","format":false,"excerpt":"The D.C. Universe magic hero Zatanna used spells (i.e. incantations) to battle foes and said spells were just sentences said backwards, hence the mixed up jumble in the title. But, now I'm regretting not naming the package zatanna and reversing the function names to help ensure they're only used deliberately\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":3558,"url":"https:\/\/rud.is\/b\/2015\/07\/25\/roll-your-own-gist-comments-notifier-in-r\/","url_meta":{"origin":3898,"position":3},"title":"Roll Your Own Gist Comments Notifier in R","author":"hrbrmstr","date":"2015-07-25","format":false,"excerpt":"As I was putting together the [coord_proj](https:\/\/rud.is\/b\/2015\/07\/24\/a-path-towards-easier-map-projection-machinations-with-ggplot2\/) ggplot2 extension I had posted a (https:\/\/gist.github.com\/hrbrmstr\/363e33f74e2972c93ca7) that I shared on Twitter. Said gist received a comment (several, in fact) and a bunch of us were painfully reminded of the fact that there is no built-in way to receive notifications from said comment\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":3633,"url":"https:\/\/rud.is\/b\/2015\/08\/23\/using-r-to-get-data-out-of-word-docs\/","url_meta":{"origin":3898,"position":4},"title":"Using R To Get Data *Out Of* Word Docs","author":"hrbrmstr","date":"2015-08-23","format":false,"excerpt":"NOTE: after reading this post head on over to this new one as it has wrapped this functionality (and more!) into a package. Also: docxtractr is now on CRAN This was asked on twitter recently: Is it possible to import data entered in MS Word into R - I have\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":3898,"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\/3898","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=3898"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/3898\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media\/3903"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=3898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=3898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=3898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}