

{"id":12755,"date":"2020-05-19T17:31:39","date_gmt":"2020-05-19T22:31:39","guid":{"rendered":"https:\/\/rud.is\/b\/?p=12755"},"modified":"2020-05-19T17:31:39","modified_gmt":"2020-05-19T22:31:39","slug":"mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/","title":{"rendered":"Mining R 4.0.0 Changelog for Nuggets of Gold: #1 stopifnot()"},"content":{"rendered":"<p>R 4.0.0 has been out for a while, now, and \u2014 apart from a case where <code>merge()<\/code> was slower than dirt \u2014 it&#8217;s been really stable for at least me (I use it daily on macOS, Linux, and Windows). Sure, it came with some headline-grabbing features\/upgrades, but I&#8217;ve started looking at what other useful nuggets might be in the <a href=\"https:\/\/cran.r-project.org\/doc\/manuals\/r-devel\/NEWS.html\">changelog<\/a> and decided to blog them as I find them.<\/p>\n<p>Today&#8217;s nugget is the venerable <code>stopifnot()<\/code> function which was significantly enhanced by <a href=\"https:\/\/bugs.r-project.org\/bugzilla\/show_bug.cgi?id=17688\">this PR by Neil Fultz<\/a>.<\/p>\n<p>Prior to R 4.0.0, if you wanted to use <code>stopifnot()<\/code> to perform some input validation (a.k.a. \u2014 in this case \u2014 [assertions])(https:\/\/en.wikipedia.org\/wiki\/Assertion_(software_development)) you&#8217;d do something like this (I&#8217;m borrowing from Neil&#8217;s example):<\/p>\n<pre><code class=\"language-r\">some_\u0192 &lt;- function(alpha, gradtol, steptol, interlim) {\n\n  stopifnot(\n    (is.numeric(alpha)),\n    (length(alpha) == 1),\n    (alpha &gt; 0),\n    (alpha &lt; 1),\n    (is.numeric(gradtol)),\n    (length(gradtol) == 1),\n    (gradtol &gt; 0),\n    (is.numeric(steptol)),\n    (length(steptol) == 1),\n    (steptol &gt; 0),\n    (is.numeric(interlim)),\n    (length(interlim) == 1),\n    (interlim &gt; 0)\n   )\n\n  message(\"Do something awesome\")\n\n}\n<\/code><\/pre>\n<p>When run with acceptable inputs we get:<\/p>\n<pre><code class=\"language-r\">some_\u0192(0.5, 3, 10, 100)\n## Do something awesome\n<\/code><\/pre>\n<p>But, when run with something out of kilter:<\/p>\n<pre><code class=\"language-r\">some_\u0192(\"a\", 3, 10, 100)\n##  Error in some_\u0192(\"a\", 3, 10, 100) : (is.numeric(alpha)) is not TRUE\n<\/code><\/pre>\n<p>we get a semi-useful, but somewhat unfriendly message back. Sure, it points to the right expression, but we&#8217;re supposed to be the kinder, friendlier data science (and general purpose) language who cares a bit more about our users. To that end, many folks switch to doing something like this:<\/p>\n<pre><code class=\"language-r\">some_\u0192 &lt;- function(alpha, gradtol, steptol, interlim) {\n\n  if (!is.numeric(alpha))   { stop('Error: alpha should be numeric') }\n  if (length(alpha) != 1)   { stop('Error: alpha should be a single value'); }\n  if (alpha &lt; 0)            { stop('Error: alpha is negative'); }\n  if (alpha &gt; 1)            { stop('Error: alpha is greater than one'); }\n  if (!is.numeric(gradtol)) { stop('Error: gradtol should be numeric') }\n  if (length(gradtol) != 1) { stop('Error: gradtol should be a single value'); }\n  if (gradtol &lt;= 0)         { stop('Error: gradtol should be positive'); }\n  if (!is.numeric(steptol)) { stop('Error: steptol should be numeric') }\n  if (length(steptol) != 1) { stop('Error: steptol should be a single value'); }\n  if (steptol &lt;= 0)         { stop('Error: steptol should be positive'); }\n  if (!is.numeric(iterlim)) { stop('Error: iterlim should be numeric') }\n  if (length(iterlim) != 1) { stop('Error: iterlim should be a single value'); }\n  if (iterlim &lt;= 0)         { stop('Error: iterlim should be positive'); }\n\n  message(\"Do something awesome\")\n\n}\n<\/code><\/pre>\n<p>which results in:<\/p>\n<pre><code class=\"language-r\">some_\u0192(\"a\", 3, 10, 100)\n##  Error in some_\u0192(\"a\", 3, 10, 100) : Error: alpha should be numeric\n<\/code><\/pre>\n<p>(you can make even better error messages than that).<\/p>\n<p>Neal thought there had to be a better way, and made one! The <code>...<\/code> expressions can be <em>named<\/em> and those names will become the error message:<\/p>\n<pre><code class=\"language-r\">some_\u0192 &lt;- function(alpha, gradtol, steptol, interlim) {\n\n  stopifnot(\n    'alpha should be numeric'          = (is.numeric(alpha)),\n    'alpha should be a single value'   = (length(alpha) == 1),\n    'alpha is negative'                = (alpha &gt; 0),\n    'alpha is greater than one'        = (alpha &lt; 1),\n    'gradtol should be numeric'        = (is.numeric(gradtol)),\n    'gradtol should be a single value' = (length(gradtol) == 1),\n    'gradtol should be positive'       = (gradtol &gt; 0),\n    'steptol should be numeric'        = (is.numeric(steptol)),\n    'steptol should be a single value' = (length(steptol) == 1),\n    'steptol should be positive'       = (steptol &gt; 0),\n    'iterlim should be numeric'        = (is.numeric(interlim)),\n    'iterlim should be a single value' = (length(interlim) == 1),\n    'iterlim should be positive'       = (interlim &gt; 0)\n   )\n\n  message(\"Do something awesome\")\n\n}\n\nsome_\u0192(\"a\", 3, 10, 100)\n\n##  Error in some_\u0192(\"a\", 3, 10, 100) : alpha should be numeric\n<\/code><\/pre>\n<p>Way easier to write and way more respectful to the caller.<\/p>\n<h3>Gratuitous Statistics<\/h3>\n<p>CRAN has ~2,600 packages that use <code>stopifnot()<\/code> in their package <code>\/R\/<\/code> code with the following selected distributions (charts are all log10 scale):<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"12757\" data-permalink=\"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/stopoifnot-01\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?fit=2400%2C708&amp;ssl=1\" data-orig-size=\"2400,708\" 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=\"stopoifnot-01\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?fit=510%2C150&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?resize=510%2C150&#038;ssl=1\" alt=\"stopifnot usage: files using it per package\" width=\"510\" height=\"150\" class=\"aligncenter size-full wp-image-12757\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?w=2400&amp;ssl=1 2400w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?resize=300%2C89&amp;ssl=1 300w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?resize=530%2C156&amp;ssl=1 530w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?resize=150%2C44&amp;ssl=1 150w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?resize=768%2C227&amp;ssl=1 768w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?resize=1536%2C453&amp;ssl=1 1536w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?resize=2048%2C604&amp;ssl=1 2048w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?resize=500%2C148&amp;ssl=1 500w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?resize=1200%2C354&amp;ssl=1 1200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?resize=400%2C118&amp;ssl=1 400w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?resize=800%2C236&amp;ssl=1 800w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?resize=200%2C59&amp;ssl=1 200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?w=1020&amp;ssl=1 1020w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<p>Here are the packages with 50 or more files using <code>stopifnot()<\/code>:<\/p>\n<pre><code class=\"language-r\">   pkg              n\n   &lt;chr&gt;        &lt;int&gt;\n 1 spatstat       252\n 2 pracma         145\n 3 QuACN           80\n 4 raster          74\n 5 spdep           61\n 6 lavaan          54\n 7 surveillance    53\n 8 copula          50\n<\/code><\/pre>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"12759\" data-permalink=\"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/stopoifnot-02\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?fit=2400%2C708&amp;ssl=1\" data-orig-size=\"2400,708\" 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=\"stopoifnot-02\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?fit=510%2C150&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?resize=510%2C150&#038;ssl=1\" alt=\"stopifnot calls per-file\" width=\"510\" height=\"150\" class=\"aligncenter size-full wp-image-12759\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?w=2400&amp;ssl=1 2400w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?resize=300%2C89&amp;ssl=1 300w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?resize=530%2C156&amp;ssl=1 530w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?resize=150%2C44&amp;ssl=1 150w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?resize=768%2C227&amp;ssl=1 768w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?resize=1536%2C453&amp;ssl=1 1536w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?resize=2048%2C604&amp;ssl=1 2048w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?resize=500%2C148&amp;ssl=1 500w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?resize=1200%2C354&amp;ssl=1 1200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?resize=400%2C118&amp;ssl=1 400w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?resize=800%2C236&amp;ssl=1 800w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?resize=200%2C59&amp;ssl=1 200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-02.png?w=1020&amp;ssl=1 1020w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<p>Here are the packages with one or more files that have 100 or more calls to <code>stopifnot()<\/code> in them:<\/p>\n<pre><code class=\"language-r\">   pkg                 fil                            ct\n   &lt;chr&gt;               &lt;chr&gt;                       &lt;int&gt;\n 1 ff                  ordermerge.R                  278\n 2 OneArmPhaseTwoStudy zzz.R                         142\n 3 bit64               integer64.R                   137\n 4 updog               rflexdog.R                    124\n 5 RNetCDF             RNetCDF.R                     123\n 6 Rlda                rlda.R                        105\n 7 aster2              transform.R                   105\n 8 ads                 fads.R                        104\n 9 georob              georob_exported_functions.R   104\n10 bit64               highlevel64.R                 101\n<\/code><\/pre>\n<p>O_O That&#8217;s quite a bit of checking!<\/p>\n<h3>FIN<\/h3>\n<p>If you&#8217;re working on switching to R 4.0.0 or have switched, this and many other new features await! Drop a note in the comments with your favorite new feature (or, even better, a link to a blog post on said feature!).<\/p>\n<p>As I get time to dig out some more nuggets I&#8217;ll add more posts to this series.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>R 4.0.0 has been out for a while, now, and \u2014 apart from a case where merge() was slower than dirt \u2014 it&#8217;s been really stable for at least me (I use it daily on macOS, Linux, and Windows). Sure, it came with some headline-grabbing features\/upgrades, but I&#8217;ve started looking at what other useful nuggets [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_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":"","jetpack_post_was_ever_published":false},"categories":[91],"tags":[],"class_list":["post-12755","post","type-post","status-publish","format-standard","hentry","category-r"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Mining R 4.0.0 Changelog for Nuggets of Gold: #1 stopifnot() - 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\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mining R 4.0.0 Changelog for Nuggets of Gold: #1 stopifnot() - rud.is\" \/>\n<meta property=\"og:description\" content=\"R 4.0.0 has been out for a while, now, and \u2014 apart from a case where merge() was slower than dirt \u2014 it&#8217;s been really stable for at least me (I use it daily on macOS, Linux, and Windows). Sure, it came with some headline-grabbing features\/upgrades, but I&#8217;ve started looking at what other useful nuggets [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-19T22:31:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2020\\\/05\\\/19\\\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2020\\\/05\\\/19\\\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Mining R 4.0.0 Changelog for Nuggets of Gold: #1 stopifnot()\",\"datePublished\":\"2020-05-19T22:31:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2020\\\/05\\\/19\\\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\\\/\"},\"wordCount\":363,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2020\\\/05\\\/19\\\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/stopoifnot-01.png\",\"articleSection\":[\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2020\\\/05\\\/19\\\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2020\\\/05\\\/19\\\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2020\\\/05\\\/19\\\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\\\/\",\"name\":\"Mining R 4.0.0 Changelog for Nuggets of Gold: #1 stopifnot() - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2020\\\/05\\\/19\\\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2020\\\/05\\\/19\\\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/stopoifnot-01.png\",\"datePublished\":\"2020-05-19T22:31:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2020\\\/05\\\/19\\\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2020\\\/05\\\/19\\\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2020\\\/05\\\/19\\\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/stopoifnot-01.png?fit=2400%2C708&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/stopoifnot-01.png?fit=2400%2C708&ssl=1\",\"width\":2400,\"height\":708,\"caption\":\"stopifnot usage: files using it per package\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2020\\\/05\\\/19\\\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mining R 4.0.0 Changelog for Nuggets of Gold: #1 stopifnot()\"}]},{\"@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":"Mining R 4.0.0 Changelog for Nuggets of Gold: #1 stopifnot() - 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\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/","og_locale":"en_US","og_type":"article","og_title":"Mining R 4.0.0 Changelog for Nuggets of Gold: #1 stopifnot() - rud.is","og_description":"R 4.0.0 has been out for a while, now, and \u2014 apart from a case where merge() was slower than dirt \u2014 it&#8217;s been really stable for at least me (I use it daily on macOS, Linux, and Windows). Sure, it came with some headline-grabbing features\/upgrades, but I&#8217;ve started looking at what other useful nuggets [&hellip;]","og_url":"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/","og_site_name":"rud.is","article_published_time":"2020-05-19T22:31:39+00:00","og_image":[{"url":"https:\/\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png","type":"","width":"","height":""}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Mining R 4.0.0 Changelog for Nuggets of Gold: #1 stopifnot()","datePublished":"2020-05-19T22:31:39+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/"},"wordCount":363,"commentCount":1,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png","articleSection":["R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/","url":"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/","name":"Mining R 4.0.0 Changelog for Nuggets of Gold: #1 stopifnot() - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png","datePublished":"2020-05-19T22:31:39+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?fit=2400%2C708&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2020\/05\/stopoifnot-01.png?fit=2400%2C708&ssl=1","width":2400,"height":708,"caption":"stopifnot usage: files using it per package"},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2020\/05\/19\/mining-r-4-0-0-changelog-for-nuggets-of-gold-1-stopifnot\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Mining R 4.0.0 Changelog for Nuggets of Gold: #1 stopifnot()"}]},{"@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-3jJ","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":6154,"url":"https:\/\/rud.is\/b\/2017\/08\/13\/r%e2%81%b6-exploring-macos-applications-with-codesign-gatekeeper-r\/","url_meta":{"origin":12755,"position":0},"title":"R\u2076 \u2014 Exploring macOS Applications with codesign, Gatekeeper &#038; R","author":"hrbrmstr","date":"2017-08-13","format":false,"excerpt":"(General reminder abt \"R\u2076\" posts in that they are heavy on code-examples, minimal on expository. I try to design them with 2-3 \"nuggets\" embedded for those who take the time to walk through the code examples on their systems. I'll always provide further expository if requested in a comment, so\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":[]},{"id":4501,"url":"https:\/\/rud.is\/b\/2016\/07\/07\/bridging-the-political-polygons-gap-with-ggplot2\/","url_meta":{"origin":12755,"position":1},"title":"Bridging The Political [Polygons] Gap with ggplot2","author":"hrbrmstr","date":"2016-07-07","format":false,"excerpt":"The @pewresearch folks have been collecting political survey data for quite a while, and I noticed the [visualization below](http:\/\/www.people-press.org\/2014\/06\/12\/section-1-growing-ideological-consistency\/#interactive) referenced in a [Tableau vis contest entry](https:\/\/www.interworks.com\/blog\/rrouse\/2016\/06\/24\/politics-viz-contest-plotting-political-polarization): Those are filled [frequency polygons](http:\/\/onlinestatbook.com\/2\/graphing_distributions\/freq_poly.html), which are super-easy to replicate in ggplot2, especially since Pew even _kind of_ made the data available via their\u2026","rel":"","context":"In &quot;Data Visualization&quot;","block_context":{"text":"Data Visualization","link":"https:\/\/rud.is\/b\/category\/data-visualization\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/07\/engfull.png?fit=1200%2C1098&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/07\/engfull.png?fit=1200%2C1098&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/07\/engfull.png?fit=1200%2C1098&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/07\/engfull.png?fit=1200%2C1098&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/07\/engfull.png?fit=1200%2C1098&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":18597,"url":"https:\/\/rud.is\/b\/2024\/03\/23\/get-a-days-schedule-from-fantastical-on-the-command-line-with-shortcuts\/","url_meta":{"origin":12755,"position":2},"title":"Get A Day&#8217;s Schedule From Fantastical On The Command Line With Shortcuts","author":"hrbrmstr","date":"2024-03-23","format":false,"excerpt":"I use Fantastical as it's a much cleaner and native interface than Google Calendar, which I'm stuck using. I do like to use the command line more than GUIs and, while I have other things set up to work with Google Calendar from the CLI, I've always wanted to figure\u2026","rel":"","context":"In &quot;macOS&quot;","block_context":{"text":"macOS","link":"https:\/\/rud.is\/b\/category\/macos\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2024\/03\/Shortcuts.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2024\/03\/Shortcuts.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2024\/03\/Shortcuts.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2024\/03\/Shortcuts.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2024\/03\/Shortcuts.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":12366,"url":"https:\/\/rud.is\/b\/2019\/06\/26\/quick-hit-above-the-fold-hard-wrapping-text-at-n-characters\/","url_meta":{"origin":12755,"position":3},"title":"Quick Hit: Above the Fold; Hard wrapping text at &#8216;n&#8217; characters","author":"hrbrmstr","date":"2019-06-26","format":false,"excerpt":"Despite being on holiday I'm getting in a bit of non-work R coding since the fam has a greater ability to sleep late than I do. Apart from other things I've been working on a PR into {lutz}, a package by @andyteucher that turns lat\/lng pairs into timezone strings. The\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\/2019\/06\/lutz-widths-02.png?fit=1200%2C628&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/lutz-widths-02.png?fit=1200%2C628&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/lutz-widths-02.png?fit=1200%2C628&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/lutz-widths-02.png?fit=1200%2C628&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/lutz-widths-02.png?fit=1200%2C628&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":7149,"url":"https:\/\/rud.is\/b\/2017\/11\/18\/statebins-reimagined\/","url_meta":{"origin":12755,"position":4},"title":"Statebins Reimagined","author":"hrbrmstr","date":"2017-11-18","format":false,"excerpt":"A long time ago, in a github repo far, far away there lived a tiny package that made it possible to create equal area, square U.S. state cartograms in R dubbed statebins?. Three years have come and gone and --- truth be told --- I've never been happy with that\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\/unnamed-chunk-3-1.png?fit=1200%2C857&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/unnamed-chunk-3-1.png?fit=1200%2C857&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/unnamed-chunk-3-1.png?fit=1200%2C857&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/unnamed-chunk-3-1.png?fit=1200%2C857&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/unnamed-chunk-3-1.png?fit=1200%2C857&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":6788,"url":"https:\/\/rud.is\/b\/2017\/10\/22\/a-call-to-tweets-blog-posts\/","url_meta":{"origin":12755,"position":5},"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":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/12755","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=12755"}],"version-history":[{"count":4,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/12755\/revisions"}],"predecessor-version":[{"id":12761,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/12755\/revisions\/12761"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=12755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=12755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=12755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}