

{"id":11812,"date":"2019-01-24T15:03:42","date_gmt":"2019-01-24T20:03:42","guid":{"rendered":"https:\/\/rud.is\/b\/?p=11812"},"modified":"2019-01-25T11:26:53","modified_gmt":"2019-01-25T16:26:53","slug":"quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/","title":{"rendered":"Quick Hit: Automating Production Graphics Uploads in R Markdown Documents with googledrive"},"content":{"rendered":"<p>As someone who measures all kinds of things on the internet as part of his $DAYJOB, I can say with some authority that huge swaths of organizations are using cloud-services such as Google Apps, Dropbox and Office 365  as part of their business process workflows. For me, one regular component that touches the &#8220;cloud&#8221; is when I have to share R-generated charts with our spiffy production team for use in reports, presentations and other general communications.<\/p>\n<p>These are typically project-based tasks and data science team members typically use git- and AWS-based workflows for gathering data, performing analyses and generating output. While git is great at sharing code and ensuring the historical integrity of our analyses, we don&#8217;t expect the production team members to be or become experts in git to use our output. They live in Google Drive and thanks to the <a href=\"https:\/\/googledrive.tidyverse.org\/\"><code>googledrive<\/code>?<\/a> package we can bridge the gap between code and output with just a few lines of R code.<\/p>\n<p>We use &#8220;<a href=\"https:\/\/support.rstudio.com\/hc\/en-us\/articles\/200526207-Using-Projects\">R projects<\/a>&#8221; to organize things and either use <a href=\"https:\/\/deanattali.com\/2015\/03\/24\/knitrs-best-hidden-gem-spin\/\">spinnable<\/a> R scripts or R markdown documents inside those projects to gather, clean and analyze data.<\/p>\n<p>For 2019, we&#8217;re using new, work-specific R markdown templates that have one new YAML header parameter:<\/p>\n<pre><code class=\"language-plain\">params:\n  gdrive_folder_url: \"https:\/\/drive.google.com\/drive\/u\/2\/SOMEUSELESSHEXSTRING\"\n<\/code><\/pre>\n<p>which just defines the Google Drive folder URL for the final output directory in the \u2601\ufe0f.<\/p>\n<p>Next is a new pre-configured <code>knitr<\/code> chunk call at the start of these production chart-generating documents:<\/p>\n<pre><code class=\"language-r\">knitr::opts_chunk$set(\n  message = FALSE,\n  warning = FALSE, dev = c(\"png\", \"cairo_pdf\"),\n  echo = FALSE,\n  fig.retina = 2,\n  fig.width = 10,\n  fig.height = 6,\n  fig.path = \"prod\/charts\/\"\n)\n<\/code><\/pre>\n<p>since the production team wants PDF so they can work with it in their tools. Our testing showed that <code>cairo_pdf<\/code> produces the best\/most consistent output, but PNGs show up better in the composite HTML documents so we use that order deliberately.<\/p>\n<p>The real change is the consistent naming of the <code>fig.path<\/code> directory. By doing this, all we have to do is add a few lines (again, automatically generated) to the bottom of the document to have all the output automagically go to the proper Google Drive folder:<\/p>\n<pre><code class=\"language-r\"># Upload to production ----------------------------------------------------\n\ngoogledrive::drive_auth()\n\n# locate the folder\ngdrive_prod_folder &lt;- googledrive::as_id(params$gdrive_folder_url)\n\n# clean it out\ngdrls &lt;- googledrive::drive_ls(gdrive_prod_folder)\nif (nrow(gdrls) &gt; 0) {\n  dplyr::pull(gdrls, id) %&gt;%\n    purrr::walk(~googledrive::drive_rm(googledrive::as_id(.x)))\n}\n\n# upload new\nlist.files(here::here(\"prod\/charts\"), recursive = TRUE, full.names = TRUE) %&gt;%\n  purrr::walk(googledrive::drive_upload, path = gdrive_prod_folder)\n<\/code><\/pre>\n<p>Now, we never have to remember to drag documents into a browser and don&#8217;t have to load invasive Google applications onto our systems to ensure the right folks have the right files at the right time. We just have to use the new R markdown document type to generate a starter analysis document with all the necessary boilerplate baked in. Plus, <code>.httr-oauth<\/code> file is automatically ignored in <code>.gitignore<\/code> so there&#8217;s no information leakage to shared git repositories.<\/p>\n<h3>FIN<\/h3>\n<p>If you want to experiment with this, you can find a <a href=\"https:\/\/git.sr.ht\/%7Ehrbrmstr\/markdowntemplates\/tree\/master\/inst\/rmarkdown\/templates\/gdriveupload\/skeleton\/skeleton.Rmd\">pre-configured template<\/a> in the <code>markdowntemplates<\/code> package over at <a href=\"https:\/\/git.sr.ht\/~hrbrmstr\/markdowntemplates\">sr.ht<\/a>, <a href=\"https:\/\/gitlab.com\/hrbrmstr\/markdowntemplates\">GitLab<\/a>, or <a href=\"https:\/\/github.com\/hrbrmstr\/markdowntemplates\">GitHub<\/a>.<\/p>\n<p>If you install the package you&#8217;ll be able to select this output type right from the new document dialog:<\/p>\n<p><a href=\"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/gdrive-auto-upload\/\" rel=\"attachment wp-att-11813\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"11813\" data-permalink=\"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/gdrive-auto-upload\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/01\/gdrive-auto-upload.png?fit=1066%2C944&amp;ssl=1\" data-orig-size=\"1066,944\" 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=\"gdrive-auto-upload\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/01\/gdrive-auto-upload.png?fit=510%2C452&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/01\/gdrive-auto-upload.png?resize=510%2C452&#038;ssl=1\" alt=\"\" width=\"510\" height=\"452\" class=\"aligncenter size-full wp-image-11813\" \/><\/a><\/p>\n<p>and new template will be ready to go with no copying, cutting or pasting.<\/p>\n<p>Plus, since the Google Drive folder URL is an R markdown parameter, you can also use this in script automation (provided that you&#8217;ve wired up oauth correctly for those scripts).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As someone who measures all kinds of things on the internet as part of his $DAYJOB, I can say with some authority that huge swaths of organizations are using cloud-services such as Google Apps, Dropbox and Office 365 as part of their business process workflows. For me, one regular component that touches the &#8220;cloud&#8221; is [&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":[91],"tags":[],"class_list":["post-11812","post","type-post","status-publish","format-standard","hentry","category-r"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Quick Hit: Automating Production Graphics Uploads in R Markdown Documents with googledrive - 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\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quick Hit: Automating Production Graphics Uploads in R Markdown Documents with googledrive - rud.is\" \/>\n<meta property=\"og:description\" content=\"As someone who measures all kinds of things on the internet as part of his $DAYJOB, I can say with some authority that huge swaths of organizations are using cloud-services such as Google Apps, Dropbox and Office 365 as part of their business process workflows. For me, one regular component that touches the &#8220;cloud&#8221; is [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-24T20:03:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-01-25T16:26:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/rud.is\/b\/wp-content\/uploads\/2019\/01\/gdrive-auto-upload.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\\\/2019\\\/01\\\/24\\\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/01\\\/24\\\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Quick Hit: Automating Production Graphics Uploads in R Markdown Documents with googledrive\",\"datePublished\":\"2019-01-24T20:03:42+00:00\",\"dateModified\":\"2019-01-25T16:26:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/01\\\/24\\\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\\\/\"},\"wordCount\":496,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/01\\\/24\\\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/gdrive-auto-upload.png\",\"articleSection\":[\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/01\\\/24\\\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/01\\\/24\\\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/01\\\/24\\\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\\\/\",\"name\":\"Quick Hit: Automating Production Graphics Uploads in R Markdown Documents with googledrive - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/01\\\/24\\\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/01\\\/24\\\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/gdrive-auto-upload.png\",\"datePublished\":\"2019-01-24T20:03:42+00:00\",\"dateModified\":\"2019-01-25T16:26:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/01\\\/24\\\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/01\\\/24\\\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/01\\\/24\\\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/gdrive-auto-upload.png?fit=1066%2C944&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/gdrive-auto-upload.png?fit=1066%2C944&ssl=1\",\"width\":1066,\"height\":944},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/01\\\/24\\\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quick Hit: Automating Production Graphics Uploads in R Markdown Documents with googledrive\"}]},{\"@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":"Quick Hit: Automating Production Graphics Uploads in R Markdown Documents with googledrive - 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\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/","og_locale":"en_US","og_type":"article","og_title":"Quick Hit: Automating Production Graphics Uploads in R Markdown Documents with googledrive - rud.is","og_description":"As someone who measures all kinds of things on the internet as part of his $DAYJOB, I can say with some authority that huge swaths of organizations are using cloud-services such as Google Apps, Dropbox and Office 365 as part of their business process workflows. For me, one regular component that touches the &#8220;cloud&#8221; is [&hellip;]","og_url":"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/","og_site_name":"rud.is","article_published_time":"2019-01-24T20:03:42+00:00","article_modified_time":"2019-01-25T16:26:53+00:00","og_image":[{"url":"https:\/\/rud.is\/b\/wp-content\/uploads\/2019\/01\/gdrive-auto-upload.png","type":"","width":"","height":""}],"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\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Quick Hit: Automating Production Graphics Uploads in R Markdown Documents with googledrive","datePublished":"2019-01-24T20:03:42+00:00","dateModified":"2019-01-25T16:26:53+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/"},"wordCount":496,"commentCount":6,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2019\/01\/gdrive-auto-upload.png","articleSection":["R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/","url":"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/","name":"Quick Hit: Automating Production Graphics Uploads in R Markdown Documents with googledrive - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2019\/01\/gdrive-auto-upload.png","datePublished":"2019-01-24T20:03:42+00:00","dateModified":"2019-01-25T16:26:53+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/01\/gdrive-auto-upload.png?fit=1066%2C944&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/01\/gdrive-auto-upload.png?fit=1066%2C944&ssl=1","width":1066,"height":944},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2019\/01\/24\/quick-hit-automating-production-graphics-uploads-in-r-markdown-documents-with-googledrive\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Quick Hit: Automating Production Graphics Uploads in R Markdown Documents with googledrive"}]},{"@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-34w","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":7756,"url":"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/","url_meta":{"origin":11812,"position":0},"title":"A bookdown &#8220;Hello World&#8221; : Twenty-one (minus two) Recipes for Mining Twitter with rtweet","author":"hrbrmstr","date":"2018-01-05","format":false,"excerpt":"The new year begins with me being on the hook to crank out a book on advanced web-scraping in R by July (more on that in a future blog post). The bookdown? package seemed to be the best way to go about doing this but I had only played with\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\/01\/07_graph-1.png?fit=1024%2C1024&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=1024%2C1024&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=1024%2C1024&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=1024%2C1024&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":12586,"url":"https:\/\/rud.is\/b\/2020\/01\/01\/writing-frictionless-r-package-wrappers-introduction\/","url_meta":{"origin":11812,"position":1},"title":"Writing Frictionless R Package Wrappers \u2014 Introduction","author":"hrbrmstr","date":"2020-01-01","format":false,"excerpt":"The R language and RStudio IDE are a powerful combination for \"getting stuff done\", and one aspect of R itself that makes it especially useful is the ability to use it with other programming languages via a robust foreign language interface capability1. The term \"foreign language\" refers to another programming\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":13549,"url":"https:\/\/rud.is\/b\/2022\/08\/20\/ohq2quarto-rust-based-cli-for-turning-observable-notebooks-into-quarto-projects\/","url_meta":{"origin":11812,"position":2},"title":"ohq2quarto \u2014 Rust-Based CLI For Turning Observable Notebooks Into Quarto Projects","author":"hrbrmstr","date":"2022-08-20","format":false,"excerpt":"The previous post had some hacky R code to grab seekrit JSON data in ObservableHQ (OHQ) Notebooks and spit out a directory with a Quarto qmd and any associated FileAttachments. Holding firm to my \"no more generic public R packages\" decree, that's as far as the R code for that\u2026","rel":"","context":"In &quot;Quarto&quot;","block_context":{"text":"Quarto","link":"https:\/\/rud.is\/b\/category\/quarto\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3141,"url":"https:\/\/rud.is\/b\/2014\/11\/27\/power-outage-impact-choropleths-in-5-steps-in-r-featuring-rvest-rstudio-projects\/","url_meta":{"origin":11812,"position":3},"title":"Power Outage Impact Choropleths In 5 Steps in R (featuring rvest &#038; RStudio &#8220;Projects&#8221;)","author":"hrbrmstr","date":"2014-11-27","format":false,"excerpt":"I and @awpiii were trading news about the power outages in Maine & New Hampshire last night and he tweeted the link to the @PSNH [Outage Map](http:\/\/www.psnh.com\/outage\/). As if the Bing Maps tiles weren't bad enough, the use of a categorical color scale instead of a sequential one[[1](http:\/\/earthobservatory.nasa.gov\/blogs\/elegantfigures\/2011\/05\/20\/qualitative-vs-sequential-color-scales\/)] caused sufficient\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":11597,"url":"https:\/\/rud.is\/b\/2018\/09\/28\/quick-hit-using-the-new-equal-earth-projection-in-r\/","url_meta":{"origin":11812,"position":4},"title":"Quick Hit: Using the New Equal Earth Projection in R","author":"hrbrmstr","date":"2018-09-28","format":false,"excerpt":"In my semi-daily run of brew update I noticed that proj4 had been updated to 5.2. I kinda \"squeee\"'d since (as the release notes show) the Equal Earth projection was added to it (+proj=eqearth). As the team who created the projection describes it: \"The Equal Earth map projection is a\u2026","rel":"","context":"In &quot;cartography&quot;","block_context":{"text":"cartography","link":"https:\/\/rud.is\/b\/category\/cartography\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/09\/eqearth.png?fit=1200%2C720&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/09\/eqearth.png?fit=1200%2C720&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/09\/eqearth.png?fit=1200%2C720&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/09\/eqearth.png?fit=1200%2C720&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/09\/eqearth.png?fit=1200%2C720&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":12645,"url":"https:\/\/rud.is\/b\/2020\/02\/06\/prying-r-script-files-away-from-xcode-et-al-on-macos\/","url_meta":{"origin":11812,"position":5},"title":"Prying &#8220;.R&#8221; Script Files Away from Xcode (et al) on macOS","author":"hrbrmstr","date":"2020-02-06","format":false,"excerpt":"As the maintainer of RSwitch --- and developer of my own (for personal use) macOS, iOS, watchOS, iPadOS and tvOS apps --- I need the full Apple Xcode install around (more R-focused macOS folk can get away with just the command-line tools being installed). As an Apple Developer who insanely\u2026","rel":"","context":"In &quot;macOS&quot;","block_context":{"text":"macOS","link":"https:\/\/rud.is\/b\/category\/macos\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/11812","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=11812"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/11812\/revisions"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=11812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=11812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=11812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}