

{"id":7756,"date":"2018-01-05T08:58:44","date_gmt":"2018-01-05T13:58:44","guid":{"rendered":"https:\/\/rud.is\/b\/?p=7756"},"modified":"2018-03-10T07:54:16","modified_gmt":"2018-03-10T12:54:16","slug":"a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/","title":{"rendered":"A bookdown &#8220;Hello World&#8221; : Twenty-one (minus two) Recipes for Mining Twitter with rtweet"},"content":{"rendered":"<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"7763\" data-permalink=\"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/07_graph-1\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=1024%2C1024&amp;ssl=1\" data-orig-size=\"1024,1024\" 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=\"07_graph-1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=300%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=510%2C510&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?resize=510%2C510&#038;ssl=1\" alt=\"\" width=\"510\" height=\"510\" class=\"aligncenter size-full wp-image-7763\" \/><\/a><\/p>\n<p>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 <a href=\"https:\/\/bookdown.org\/home\/\"><code>bookdown<\/code>?<\/a> package seemed to be the best way to go about doing this but I had only played with the toy\/default examples of it and wanted to test out the platform with a <a href=\"https:\/\/en.wikipedia.org\/wiki\/%22Hello,_World!%22_program\">&#8220;Hello, World&#8221;<\/a>-like example of a &#8220;real&#8221; book to iron out issues and avoid more refactoring later on than I know I will have to do. I&#8217;ve been on an <code>rtweet<\/code> kick as of late (I have no idea why) and had an e-copy of O&#8217;Reilly&#8217;s <a href=\"http:\/\/shop.oreilly.com\/product\/0636920018261.do\">21 Recipes for Mining Twitter<\/a> in the their synced Dropbox folder (it was a free giveaway a few years ago) and decided to make an <code>rtweet<\/code> version of it in a <code>bookdown<\/code> project.<\/p>\n<p>You can find the GitHub repo for it <a href=\"https:\/\/github.com\/hrbrmstr\/21-recipes\">here<\/a> and the rendered version <a href=\"https:\/\/rud.is\/books\/21-recipes\/\">here<\/a>. NOTE: I will likely not finish the remaining two chapters (I need to spend the time on the real book :-) but will gladly add <em>you<\/em> as a co-author if you shoot over a PR.<\/p>\n<p>I began with Sean Kross&#8217; <a href=\"http:\/\/seankross.com\/2016\/11\/17\/How-to-Start-a-Bookdown-Book.html\">quick start<\/a> and decided to work primarily in Sublime Text and use a <code>Makefile<\/code> to manage the build process. Since the goal was to iron out kinks for a real production book, here&#8217;s a bullet list of some tips as a result of figuring out what worked for me:<\/p>\n<ul>\n<li>Get Yihui Xie&#8217;s <a href=\"https:\/\/bookdown.org\/yihui\/bookdown\/\">book<\/a>. I have a physical copy but having either will help you when things get frustrating (and they do get frustrating at times)\n<\/li>\n<li>Use <code>git<\/code>. However you instantiate the project, use <code>git<\/code> source control so you don&#8217;t lose your hard work. <strong>However<\/strong> some directories are not tracked in <code>git<\/code>! You may want to modify the line with <code>*.rds<\/code> in <code>.gitignore<\/code> to be a bit less brutal if you happen to generate <code>rds<\/code> files outside of the project but use them in chapter examples. <strong>Also<\/strong>, make sure to put other, sensitive items (like <code>.httr-oauth<\/code>) in that <code>.gitignore<\/code> to avoid having to reset credentials.\n<\/li>\n<li>Use a <code>Makefile<\/code>. I like RStudio, but have far more editing tools in Sublime Text for book-ish work. Plus it has an easy build system manager, and I find it easier to navigate files.\n<\/li>\n<li>Make liberal use of code chunks. <a href=\"https:\/\/raw.githubusercontent.com\/hrbrmstr\/21-recipes\/master\/16-Crawling-Followers-to-Approximate-Potential-Influence.Rmd\">Chapter 16<\/a> has a structure that I used in many of the chapters. One block for <code>library calls<\/code> (no caching); load fonts (hidden, and primarily for PDF rendering); named, <em>cached<\/em> logical sections that go with the flow of the chapter text; custom figure dimensions to ensure they come out as desired. Caching will speed up rendering time immensely.\n<\/li>\n<li>Use saved data and a mixture of <code>echo=FALSE, eval=TRUE<\/code>, <code>echo=TRUE, eval=FALSE<\/code> for things you generated outside of the book source code (because they may be long running things you don&#8217;t want to wait for even once in rendering) but want to show in the book (perhaps with slightly modified source).\n<\/li>\n<li>Despite using <code>git<\/code>, create a daily compressed archive of the directory tree and stick it on Dropbox (that can be part of the <code>Makefile<\/code>). Your work is valuable and you need to make sure it&#8217;s backed up.\n<\/li>\n<li>Learn about references. Yihui Xie&#8217;s book shows how to deal with in- and cross-chapter references, read and use them!\n<\/li>\n<li>Use a <code>bookdown::word_document2<\/code> vs PDF and make a custom Word template for it. The default PDF output is fine for basic things, but you&#8217;ll want to generate a better one from Word.\n<\/li>\n<li>When things stop rendering properly save your recently edited files and go back in time with <code>git<\/code> to a working start. This happened to me a few times as I worked across different machines. <code>git<\/code> makes glitches almost stress free.\n<\/li>\n<li>Use <code>rsync<\/code> for publishing. I need to add this to the <code>Makefile<\/code> but one, short command-line call can publish your work in seconds to a web server.<\/li>\n<\/ul>\n<p>I&#8217;ll likely have more tips as the year goes on and will have a follow-up post for using web server access logs to generate &#8220;kindle-like&#8221; reading statistics for your tomes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 the toy\/default examples of it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7763,"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":[810],"class_list":["post-7756","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","tag-post"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>A bookdown &quot;Hello World&quot; : Twenty-one (minus two) Recipes for Mining Twitter with rtweet - 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\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A bookdown &quot;Hello World&quot; : Twenty-one (minus two) Recipes for Mining Twitter with rtweet - rud.is\" \/>\n<meta property=\"og:description\" content=\"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 the toy\/default examples of it [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2018-01-05T13:58:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-10T12:54:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=1024%2C1024&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\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\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"A bookdown &#8220;Hello World&#8221; : Twenty-one (minus two) Recipes for Mining Twitter with rtweet\",\"datePublished\":\"2018-01-05T13:58:44+00:00\",\"dateModified\":\"2018-03-10T12:54:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/\"},\"wordCount\":680,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=1024%2C1024&ssl=1\",\"keywords\":[\"post\"],\"articleSection\":[\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/\",\"url\":\"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/\",\"name\":\"A bookdown \\\"Hello World\\\" : Twenty-one (minus two) Recipes for Mining Twitter with rtweet - rud.is\",\"isPartOf\":{\"@id\":\"https:\/\/rud.is\/b\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=1024%2C1024&ssl=1\",\"datePublished\":\"2018-01-05T13:58:44+00:00\",\"dateModified\":\"2018-03-10T12:54:16+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=1024%2C1024&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=1024%2C1024&ssl=1\",\"width\":1024,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/rud.is\/b\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A bookdown &#8220;Hello World&#8221; : Twenty-one (minus two) Recipes for Mining Twitter with rtweet\"}]},{\"@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":"A bookdown \"Hello World\" : Twenty-one (minus two) Recipes for Mining Twitter with rtweet - 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\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/","og_locale":"en_US","og_type":"article","og_title":"A bookdown \"Hello World\" : Twenty-one (minus two) Recipes for Mining Twitter with rtweet - rud.is","og_description":"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 the toy\/default examples of it [&hellip;]","og_url":"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/","og_site_name":"rud.is","article_published_time":"2018-01-05T13:58:44+00:00","article_modified_time":"2018-03-10T12:54:16+00:00","og_image":[{"width":1024,"height":1024,"url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=1024%2C1024&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\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"A bookdown &#8220;Hello World&#8221; : Twenty-one (minus two) Recipes for Mining Twitter with rtweet","datePublished":"2018-01-05T13:58:44+00:00","dateModified":"2018-03-10T12:54:16+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/"},"wordCount":680,"commentCount":0,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=1024%2C1024&ssl=1","keywords":["post"],"articleSection":["R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/","url":"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/","name":"A bookdown \"Hello World\" : Twenty-one (minus two) Recipes for Mining Twitter with rtweet - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=1024%2C1024&ssl=1","datePublished":"2018-01-05T13:58:44+00:00","dateModified":"2018-03-10T12:54:16+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=1024%2C1024&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/07_graph-1.png?fit=1024%2C1024&ssl=1","width":1024,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2018\/01\/05\/a-bookdown-hello-world-twenty-one-minus-two-recipes-for-mining-twitter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"A bookdown &#8220;Hello World&#8221; : Twenty-one (minus two) Recipes for Mining Twitter with rtweet"}]},{"@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\/2018\/01\/07_graph-1.png?fit=1024%2C1024&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p23idr-216","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":6788,"url":"https:\/\/rud.is\/b\/2017\/10\/22\/a-call-to-tweets-blog-posts\/","url_meta":{"origin":7756,"position":0},"title":"A Call to Tweets (&#038; Blog Posts)!","author":"hrbrmstr","date":"2017-10-22","format":false,"excerpt":"Way back in July of 2009, the first version of the twitteR package was published by Geoff Jentry in CRAN. Since then it has seen 28 updates, finally breaking the 0.x.y barrier into 1.x.y territory in March of 2013 and receiving it's last update in July of 2015. For a\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":7803,"url":"https:\/\/rud.is\/b\/2018\/01\/15\/cant-stop-at-21-twitter-recipe-22-tying-up-loose-threads\/","url_meta":{"origin":7756,"position":1},"title":"Can&#8217;t Stop at 21: Twitter Recipe #22 \u2014 Tying Up Loose Threads","author":"hrbrmstr","date":"2018-01-15","format":false,"excerpt":"NOTE: The likelihood of this recipe being added to the recent practice bookdown book is slim, but I'll try to keep the same format for the blog post. Problem You want to collect all the tweets in a Twitter tweet thread Solution Use a few key functions in rtweet to\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\/Screen-Shot-2018-01-15-at-3.01.13-PM.png?fit=962%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/Screen-Shot-2018-01-15-at-3.01.13-PM.png?fit=962%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/Screen-Shot-2018-01-15-at-3.01.13-PM.png?fit=962%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/01\/Screen-Shot-2018-01-15-at-3.01.13-PM.png?fit=962%2C1200&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":12510,"url":"https:\/\/rud.is\/b\/2019\/09\/14\/twitter-account-analysis-in-r\/","url_meta":{"origin":7756,"position":2},"title":"Twitter &#8220;Account Analysis&#8221; in R","author":"hrbrmstr","date":"2019-09-14","format":false,"excerpt":"This past week @propublica linked to a really spiffy resource for getting an overview of a Twitter user's profile and activity called accountanalysis. It has a beautiful interface that works as well on mobile as it does in a real browser. It also is fully interactive and supports cross-filtering (zoom\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":7108,"url":"https:\/\/rud.is\/b\/2017\/11\/13\/twitter-outer-limits-seeing-how-far-have-folks-fallen-down-the-slippery-slope-to-280-with-rtweet\/","url_meta":{"origin":7756,"position":3},"title":"Twitter Outer Limits : Seeing How Far Have Folks Fallen Down The Slippery Slope to &#8220;280&#8221; with rtweet","author":"hrbrmstr","date":"2017-11-13","format":false,"excerpt":"By now, virtually every major media outlet has covered the \"280 Apocalypse\"\u2122. For those still not \"in the know\", Twitter recently moved the tweet character cap to 280 after a \"successful\" beta test (some of us have different ideas of what \"success\" looks like). I had been on a hiatus\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\/2017\/11\/plot_zoom_png-2.png?fit=1200%2C1061&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/plot_zoom_png-2.png?fit=1200%2C1061&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/plot_zoom_png-2.png?fit=1200%2C1061&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/plot_zoom_png-2.png?fit=1200%2C1061&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/plot_zoom_png-2.png?fit=1200%2C1061&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":7733,"url":"https:\/\/rud.is\/b\/2017\/12\/30\/r%e2%81%b6-capture-tweets-with-tweet_shot\/","url_meta":{"origin":7756,"position":4},"title":"R\u2076 \u2014 Capture Tweets with tweet_shot()","author":"hrbrmstr","date":"2017-12-30","format":false,"excerpt":"(You can find all R\u2076 posts here) UPDATE 2018-01-01 --- this has been added to rtweet (GH version). A Twitter discussion: I'm going to keep my eyes out for this one! Would love to have an easy way to embed tweets in Rmd talks!\u2014 Jeff Hollister (@jhollist) December 30, 2017\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\/2017\/12\/preview.png?fit=517%2C899&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":12749,"url":"https:\/\/rud.is\/b\/2020\/05\/16\/attach-your-r-code-to-charts-you-tweet-for-reproducible-r-tweets\/","url_meta":{"origin":7756,"position":5},"title":"Attach Your R Code To Charts You Tweet For Reproducible R Tweets!","author":"hrbrmstr","date":"2020-05-16","format":false,"excerpt":"I caught this tweet by Terence Eden about using Twitter image alt-text to \"PGP sign\" tweet and my mind immediately went to \"how can I abuse this for covert communications, malicious command-and-control, and embedding R code in tweets?\". When you paste or upload an image to tweet (web interface, at\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":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/7756","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=7756"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/7756\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media\/7763"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=7756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=7756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=7756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}