

{"id":855,"date":"2012-03-14T02:30:14","date_gmt":"2012-03-14T07:30:14","guid":{"rendered":"http:\/\/rud.is\/b\/?p=855"},"modified":"2017-03-27T09:40:25","modified_gmt":"2017-03-27T14:40:25","slug":"thinkstats-in-r-examplechapter-2-example-2-1-2-3","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/","title":{"rendered":"ThinkStats \u2026 in R :: Example\/Chapter 2 :: Example 2.1-2.3"},"content":{"rendered":"<p>As promised, this post is a bit more graphical, but I feel the need to stress the importance of the first few points in chapter 2 of the book (i.e. the difference between <i>mean<\/i> and <i>average<\/i> and why <i>variance<\/i> is meaningful). These are fundamental concepts for future work.<\/p>\n<p>The &#8220;pumpkin&#8221; example (2.1) gives us an opportunity to do some very basic R:<\/p>\n<pre lang=\"rsplus\" line=\"1\">pumpkins <- c(1,1,1,3,3,591) #build an array\r\nmean(pumpkins) #mean (average)\r\nvar(pumpkins) #variance\r\nsd(pumpkins) #deviation\r\n<\/pre>\n<p><i>(as you can see, I'm still trying to find the best way to embed R source code)<\/i><\/p>\n<p>We move from pumpkins to babies for Example 2.2 (you'll need the <a href=\"https:\/\/rud.is\/b\/wp-content\/uploads\/2012\/03\/example-2.1.r\">whole bit of source<\/a> from previous examples (that includes all the solutions in this example) to make the rest of the code snippets work). Here, we can quickly compute and compare the standard deviations (with difference) and the means (with difference) to help us analyze the statistical significane questions in the chapter:<\/p>\n<pre lang=\"rsplus\" line=\"1\">sd(firstbabies$prglength)\r\nsd(notfirstbabies$prglength)\r\nsd(firstbabies$prglength) - sd(notfirstbabies$prglength)\r\n\r\nmean(firstbabies$prglength)\r\nmean(notfirstbabies$prglength)\r\nmean(firstbabies$prglength) - mean(notfirstbabies$prglength)<\/pre>\n<p>You'll see the power of R's <code>hist<\/code> function in a moment, but you should be a bit surprised when you see the output if you enter to solve Example 2.3:<\/p>\n<pre lang=\"rsplus\" line=\"1\">mode(firstbabies$prglength)<\/pre>\n<p>That's right, R does not have a built-in <code>mode<\/code> function. It's pretty straightforward to compute, tho:<\/p>\n<pre lang=\"rsplus\" line=\"1\">names(sort(-table(firstbabies$prglength))[1])<\/pre>\n<p>(notice how \"straightforward\" != \"simple\")<\/p>\n<p>We have to use the <code>table<\/code> function to generate a table of value frequencies. It's a two-dimensional structure with the actual value associated with the frequency represented as a string indexed at the same position. Using \"<code>-<\/code>\" inverts all the values (but keeps the two-dimensional indexing consistent) and <code>sort<\/code> orders the structure so we can use index \"<code>[1]<\/code>\" to get to the value we're looking for. By using the <code>names<\/code> function, we get the string representing the value at the highest frequency. You can see this iteratively by breaking out the code:<\/p>\n<pre lang=\"rsplus\" line=\"1\">table(firstbabies$prglength)\r\nstr(table(firstbabies$prglength))\r\nsort(table(firstbabies$prglength))\r\nsort(table(firstbabies$prglength))[1] #without the \"-\"\r\nsort(-table(firstbabies$prglength))[1]\r\nnames(sort(-table(firstbabies$prglength))[1])\r\n<\/pre>\n<p>There are a plethora of other ways to compute the <code>mode<\/code>, but this one seems to work well for my needs.<\/p>\n<h3>Pictures Or It Didn't Happen<\/h3>\n<p>I did debate putting the rest of this post into a separate example, but if you've stuck through this far, you deserve some stats candy. It's actually pretty tricky to do what the book does here:<\/p>\n<p><center><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/rud.is\/skitch\/bookhist-20120313-151021.png?w=510&#038;ssl=1\"\/><\/center><\/p>\n<p>So, we'll start off with simple histogram plots of each set being compared:<\/p>\n<pre lang=\"rsplus\" line=\"1\">hist(firstbabies$prglength)<\/pre>\n<p><center><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/rud.is\/skitch\/Quartz_2_%5B%2A%5D-20120313-160023.png?w=510&#038;ssl=1\"\/><\/center><\/p>\n<pre lang=\"rsplus\" line=\"1\">hist(notfirstbabies$prglength)<\/pre>\n<p><center><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/rud.is\/skitch\/Quartz_2_%5B%2A%5D-20120313-160106.png?w=510&#038;ssl=1\"\/><\/center><\/p>\n<p>I separated those out since <code>hist<\/code> by default displays the histogram and if you just paste the lines consecutively, you'll only see the last histogram. What does display is, well, <i>ugly<\/i> and charts should be beautiful. It will take a bit to explain the details (in another post) but this should get you started:<\/p>\n<pre lang=\"rsplus\" line=\"1\">par(mfrow=c(1,2))par(mfrow=c(1,2))\r\nhist(firstbabies$prglength, cex.lab=0.8, cex.axis=0.6, cex.main=0.8, las=1, col=\"white\", ylim=c(0,3000),xlim=c(17,max(firstbabies$prglength)), breaks=\"Scott\", main=\"Histogram of first babies\", xlab=\"Weeks\")\r\nhist(notfirstbabies$prglength, cex.lab=0.8, cex.axis=0.6, cex.main=0.8, las=1, col=\"blue\", ylim=c(0,3000),xlim=c(17,max(notfirstbabies$prglength)), breaks=\"Scott\", main=\"Histogram of other babies\", xlab=\"Weeks\")\r\npar(mfrow=c(1,1))<\/pre>\n<p>In the above code, we're telling R to setup a canvas that will have one row and two plot areas. This makes it very easy to have many graphs on one canvas.<\/p>\n<p>Next, the first <code>hist<\/code> sets up up some label proportions (the <code>cex<\/code> parameters), tells R to make Y labels horizontal (<code>las=1<\/code>), makes the bars white, sets up sane values for the X & Y axes, instructs R to use the \"Scott\" algorithm for calculating sane bins (we'll cover this in more details next post) and sets up sane titles and X axis labels. Finally, we reset the canvas for the next plot.<\/p>\n<p>There's quite a bit to play with there and you can use the \"<code>help()<\/code>\" command to get information on the <code>hist<\/code> function and <code>plot<\/code> function. You can setup your own bin size by substituting an array for \"Scott\". If you have specific questions, shoot a note in the comments, but I'll explain more about what's going on in the next post as we add in probability histograms and start looking at the data in more detail.<\/p>\n<p><center><a href=\"https:\/\/i0.wp.com\/rud.is\/skitch\/Quartz_2_%5B%2A%5D-20120313-160811.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/rud.is\/skitch\/Quartz_2_%5B%2A%5D-20120313-160811.png?w=510&#038;ssl=1\" \/><\/a><br \/><smaller>Click for larger image<\/smaller><\/center><\/p>\n<p><a href=\"https:\/\/rud.is\/b\/wp-content\/uploads\/2012\/03\/example-2.1.r\">Download R Source of Examples 2.1-2.3<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As promised, this post is a bit more graphical, but I feel the need to stress the importance of the first few points in chapter 2 of the book (i.e. the difference between mean and average and why variance is meaningful). These are fundamental concepts for future work. The &#8220;pumpkin&#8221; example (2.1) gives us an [&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":true,"_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":[24,640,91],"tags":[],"class_list":["post-855","post","type-post","status-publish","format-standard","hentry","category-charts-graphs","category-python-2","category-r"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ThinkStats \u2026 in R :: Example\/Chapter 2 :: Example 2.1-2.3 - 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\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ThinkStats \u2026 in R :: Example\/Chapter 2 :: Example 2.1-2.3 - rud.is\" \/>\n<meta property=\"og:description\" content=\"As promised, this post is a bit more graphical, but I feel the need to stress the importance of the first few points in chapter 2 of the book (i.e. the difference between mean and average and why variance is meaningful). These are fundamental concepts for future work. The &#8220;pumpkin&#8221; example (2.1) gives us an [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2012-03-14T07:30:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-03-27T14:40:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/rud.is\/skitch\/bookhist-20120313-151021.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<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2012\\\/03\\\/14\\\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2012\\\/03\\\/14\\\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"ThinkStats \u2026 in R :: Example\\\/Chapter 2 :: Example 2.1-2.3\",\"datePublished\":\"2012-03-14T07:30:14+00:00\",\"dateModified\":\"2017-03-27T14:40:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2012\\\/03\\\/14\\\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\\\/\"},\"wordCount\":610,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2012\\\/03\\\/14\\\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rud.is\\\/skitch\\\/bookhist-20120313-151021.png\",\"articleSection\":[\"Charts &amp; Graphs\",\"Python\",\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2012\\\/03\\\/14\\\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2012\\\/03\\\/14\\\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2012\\\/03\\\/14\\\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\\\/\",\"name\":\"ThinkStats \u2026 in R :: Example\\\/Chapter 2 :: Example 2.1-2.3 - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2012\\\/03\\\/14\\\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2012\\\/03\\\/14\\\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rud.is\\\/skitch\\\/bookhist-20120313-151021.png\",\"datePublished\":\"2012-03-14T07:30:14+00:00\",\"dateModified\":\"2017-03-27T14:40:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2012\\\/03\\\/14\\\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2012\\\/03\\\/14\\\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2012\\\/03\\\/14\\\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\\\/#primaryimage\",\"url\":\"https:\\\/\\\/rud.is\\\/skitch\\\/bookhist-20120313-151021.png\",\"contentUrl\":\"https:\\\/\\\/rud.is\\\/skitch\\\/bookhist-20120313-151021.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2012\\\/03\\\/14\\\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ThinkStats \u2026 in R :: Example\\\/Chapter 2 :: Example 2.1-2.3\"}]},{\"@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":"ThinkStats \u2026 in R :: Example\/Chapter 2 :: Example 2.1-2.3 - 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\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/","og_locale":"en_US","og_type":"article","og_title":"ThinkStats \u2026 in R :: Example\/Chapter 2 :: Example 2.1-2.3 - rud.is","og_description":"As promised, this post is a bit more graphical, but I feel the need to stress the importance of the first few points in chapter 2 of the book (i.e. the difference between mean and average and why variance is meaningful). These are fundamental concepts for future work. The &#8220;pumpkin&#8221; example (2.1) gives us an [&hellip;]","og_url":"https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/","og_site_name":"rud.is","article_published_time":"2012-03-14T07:30:14+00:00","article_modified_time":"2017-03-27T14:40:25+00:00","og_image":[{"url":"https:\/\/rud.is\/skitch\/bookhist-20120313-151021.png","type":"","width":"","height":""}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"ThinkStats \u2026 in R :: Example\/Chapter 2 :: Example 2.1-2.3","datePublished":"2012-03-14T07:30:14+00:00","dateModified":"2017-03-27T14:40:25+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/"},"wordCount":610,"commentCount":0,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/skitch\/bookhist-20120313-151021.png","articleSection":["Charts &amp; Graphs","Python","R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/","url":"https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/","name":"ThinkStats \u2026 in R :: Example\/Chapter 2 :: Example 2.1-2.3 - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/skitch\/bookhist-20120313-151021.png","datePublished":"2012-03-14T07:30:14+00:00","dateModified":"2017-03-27T14:40:25+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/#primaryimage","url":"https:\/\/rud.is\/skitch\/bookhist-20120313-151021.png","contentUrl":"https:\/\/rud.is\/skitch\/bookhist-20120313-151021.png"},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2012\/03\/14\/thinkstats-in-r-examplechapter-2-example-2-1-2-3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"ThinkStats \u2026 in R :: Example\/Chapter 2 :: Example 2.1-2.3"}]},{"@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-dN","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":12878,"url":"https:\/\/rud.is\/b\/2021\/01\/16\/new-swiftr-chapter-up-building-an-r-backed-swiftui-macos-app\/","url_meta":{"origin":855,"position":0},"title":"New SwiftR Chapter Up: Building an R-backed SwiftUI macOS App","author":"hrbrmstr","date":"2021-01-16","format":false,"excerpt":"Last week I introduced a new bookdown series on how to embed R into a macOS Swift application. The initial chapters focused on core concepts and showed how to build a macOS compiled, binary command line application that uses embedded R for some functionality. This week, a new chapter is\u2026","rel":"","context":"In &quot;Apple&quot;","block_context":{"text":"Apple","link":"https:\/\/rud.is\/b\/category\/apple\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":12586,"url":"https:\/\/rud.is\/b\/2020\/01\/01\/writing-frictionless-r-package-wrappers-introduction\/","url_meta":{"origin":855,"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":833,"url":"https:\/\/rud.is\/b\/2012\/03\/04\/thinkstats-in-r-including-example-1-2\/","url_meta":{"origin":855,"position":2},"title":"ThinkStats \u2026 in R (including Example 1.2)","author":"hrbrmstr","date":"2012-03-04","format":false,"excerpt":"ThinkStats (by Allen B. Downey) is a good book to get you familiar with statistics (and even Python, if you've done some scripting in other languages). I thought it would be interesting to present some of the examples & exercises in the book in R. Why? Well, once you've gone\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":12866,"url":"https:\/\/rud.is\/b\/2021\/01\/04\/bringing-r-to-swift-on-macos\/","url_meta":{"origin":855,"position":3},"title":"Bringing R to Swift on macOS","author":"hrbrmstr","date":"2021-01-04","format":false,"excerpt":"Over Christmas break I teased some screencaps: A more refined #rstats #swift \"SwiftR\" example. Simple Image view + some text views, a color picker and a button that runs R-in-Swift code (like {reticulate} does for Python in R)Note no ssd\/hd storage round-trip for the plot.Code snippet: https:\/\/t.co\/fWaHnztUgd pic.twitter.com\/y5m1I16tCB\u2014 Caliban's War\u2026","rel":"","context":"In &quot;Apple&quot;","block_context":{"text":"Apple","link":"https:\/\/rud.is\/b\/category\/apple\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"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":855,"position":4},"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":6685,"url":"https:\/\/rud.is\/b\/2017\/10\/09\/enabling-concerned-visitors-ethical-security-researchers-with-security-txt-web-security-policies-plus-analyze-them-at-scale-with-r\/","url_meta":{"origin":855,"position":5},"title":"Enabling Concerned Visitors &#038; Ethical Security Researchers with security.txt Web Security Policies (plus analyze them at-scale with R)","author":"hrbrmstr","date":"2017-10-09","format":false,"excerpt":"I've blogged a bit about robots.txt --- the rules file that documents a sites \"robots exclusion\" standard that instructs web crawlers what they can and cannot do (and how frequently they should do things when they are allowed to). This is a well-known and well-defined standard, but it's not mandatory\u2026","rel":"","context":"In &quot;Information Security&quot;","block_context":{"text":"Information Security","link":"https:\/\/rud.is\/b\/category\/information-security\/"},"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\/855","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=855"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/855\/revisions"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=855"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}