

{"id":13094,"date":"2021-05-22T10:01:35","date_gmt":"2021-05-22T15:01:35","guid":{"rendered":"https:\/\/rud.is\/b\/?p=13094"},"modified":"2021-05-22T10:01:35","modified_gmt":"2021-05-22T15:01:35","slug":"a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/","title":{"rendered":"A {swiftr} Brief Interlude While Awaiting {cdcfluview} CRAN Checks"},"content":{"rendered":"<p>My {cdcfluview} package started tossing erros on CRAN just over a week ago when the CDC added an extra parameter to one of the hidden API endpoints that the package wraps. After a fairly hectic set of days since said NOTE came, I had time this morning to poke at a fix. There are <em>alot<\/em> of tests, so after successful debugging session I was awaiting CRAN checks on various remotes as well as README builds and figured I&#8217;d keep up some practice with another, nascent, package of mine, {swiftr}, which makes it dead simple to build R functions from Swift code, in similar fashion to what <code>Rcpp::cppFunction()<\/code> does for C\/C++ code.<\/p>\n<p>macOS comes with a full set of machine learning\/AI libraries\/frameworks that definitely have &#8220;batteries included&#8221; (i.e. you can almost just make one function call to get 90-95% what you want without even training new models). One of which is <a href=\"https:\/\/developer.apple.com\/documentation\/vision\/vnrecognizetextrequest\">text extraction from Apple&#8217;s computer <code>Vision<\/code> framework<\/a>. I thought it&#8217;d be a fun and quick &#8220;wait mode&#8221; distraction to wrap the <code>VNRecognizeTextRequest()<\/code> function and use it from R.<\/p>\n<p>To show how capable the default model is, I pulled a semi-complex random image from DDG&#8217;s image search:<\/p>\n<p><center><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"13095\" data-permalink=\"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/signs\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg?fit=525%2C328&amp;ssl=1\" data-orig-size=\"525,328\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Getty Images\/iStockphoto&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;Yellow street signs against clear blue sky pointing different directions. Each plate on the street sign has a specific term like unsure, muddled, coonfused and so on. Dilemma and confusion concept. horizontal composition with copy space. Clipping path is included.&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;1&quot;}\" data-image-title=\"signs\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Yellow street signs against clear blue sky pointing different directions. Each plate on the street sign has a specific term like unsure, muddled, coonfused and so on. Dilemma and confusion concept. horizontal composition with copy space. Clipping path is included.&lt;\/p&gt;\n\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg?fit=510%2C319&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg?resize=510%2C319&#038;ssl=1\" alt=\"Yellow street signs against clear blue sky pointing different directions. Each plate on the street sign has a specific term like unsure, muddled, coonfused and so on. Dilemma and confusion concept. horizontal composition with copy space. Clipping path is included.\" width=\"510\" height=\"319\" class=\"size-full wp-image-13095\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg?resize=300%2C187&amp;ssl=1 300w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg?resize=150%2C94&amp;ssl=1 150w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg?resize=500%2C312&amp;ssl=1 500w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg?resize=400%2C250&amp;ssl=1 400w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg?resize=200%2C125&amp;ssl=1 200w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/center><\/p>\n<p>Let&#8217;s build the function (you need to be on macOS for this; exposition inine):<\/p>\n<pre><code class=\"language-r\">library(swiftr) # github.com\/hrbrmstr\/swiftr\n\nswift_function(\n  code = '\nimport Foundation\nimport CoreImage\nimport Cocoa\nimport Vision\n\n@_cdecl (\"detect_text\")\npublic func detect_text(path: SEXP) -&gt; SEXP {\n\n   \/\/ turn R string into Swift String so we can use it\n   let fileName = String(cString: R_CHAR(STRING_ELT(path, 0)))\n\n   var res: String = \"\"\n   var out: SEXP = R_NilValue\n\n  \/\/ get image into the right format\n  if let ciImage = CIImage(contentsOf: URL(fileURLWithPath:fileName)) {\n\n    let context = CIContext(options: nil)\n    if let img = context.createCGImage(ciImage, from: ciImage.extent) {\n\n      \/\/ setup comptuer vision request\n      let requestHandler = VNImageRequestHandler(cgImage: img)\n\n      \/\/ start recognition\n      let request = VNRecognizeTextRequest()\n      do {\n        try requestHandler.perform([request])\n\n        \/\/ if we have results\n        if let observations = request.results as? [VNRecognizedTextObservation] {\n\n          \/\/ paste them together\n          let recognizedStrings = observations.compactMap { observation in\n            observation.topCandidates(1).first?.string\n          }\n          res = recognizedStrings.joined(separator: \"\\\\n\")\n        }\n      } catch {\n        debugPrint(\"\\\\(error)\")\n      }\n    }\n  }\n\n  res.withCString { cstr in out = Rf_mkString(cstr) }\n\n  return(out)\n}\n')\n<\/code><\/pre>\n<p>The <code>detect_text()<\/code> is now available in R, so let&#8217;s see how it performs on that image of signs:<\/p>\n<pre><code class=\"language-r\">detect_text(path.expand(\"~\/Data\/signs.jpeg\")) %&gt;% \n  stringi::stri_split_lines() %&gt;% \n  unlist()\n##  [1] \"BEWILDERED\" \"UNCLEAR\"    \"nAZEU\"      \"UNCERTAIN\"  \"VISA\"       \"INSURE\"    \n##  [7] \"ATED\"       \"MUDDLED\"    \"LOsT\"       \"DISTRACTED\" \"PERPLEXED\"  \"CONFUSED\"  \n## [13] \"PUZZLED\" \n<\/code><\/pre>\n<p>It works super-fast and gets far more correct than I would have expected.<\/p>\n<p>Toy examples aside, it also works pretty well (as one would expect) on &#8220;real&#8221; text images, such as this example from the Tesseract test suite:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"13097\" data-permalink=\"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/8200_006-3b\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?fit=3312%2C1343&amp;ssl=1\" data-orig-size=\"3312,1343\" 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=\"8200_006.3B\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?fit=510%2C207&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?resize=510%2C207&#038;ssl=1\" alt=\"tesseract project newspaper clipping example text image\" width=\"510\" height=\"207\" class=\"aligncenter size-large wp-image-13097\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?resize=530%2C215&amp;ssl=1 530w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?resize=300%2C122&amp;ssl=1 300w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?resize=150%2C61&amp;ssl=1 150w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?resize=768%2C311&amp;ssl=1 768w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?resize=1536%2C623&amp;ssl=1 1536w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?resize=2048%2C830&amp;ssl=1 2048w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?resize=500%2C203&amp;ssl=1 500w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?resize=1200%2C487&amp;ssl=1 1200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?resize=400%2C162&amp;ssl=1 400w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?resize=800%2C324&amp;ssl=1 800w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?resize=200%2C81&amp;ssl=1 200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/8200_006.3B.png?w=1020&amp;ssl=1 1020w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<pre><code class=\"language-r\">detect_text(path.expand(\"~\/Data\/tesseract\/news.3B\/0\/8200_006.3B.tif\")) %&gt;% \n  stringi::stri_split_lines() %&gt;% \n  unlist()\n##  [1] \"Tobacco chiefs still refuse to see the truth abou\"                           \n##  [2] \"even of America's least conscionable\"                                        \n##  [3] \"The tobacco industry would like to promote\"                                  \n##  [4] \"men sat together in Washington last\"                                         \n##  [5] \"under the conditions they are used.'\"                                        \n##  [6] \"week to do what they do best: blow\"                                          \n##  [7] \"the specter of prohibition.\"                                                 \n##  [8] \"panel\\\" of toxicologists as \\\"not hazardous\"                                 \n##  [9] \"smoke at the truth about cigarettes.\"                                        \n## [10] \"'If cigarettes are too dangerous to be sold,\"                                \n## [11] \"then ban them. Some smokers will obey the\"                                   \n## [12] \"People not paid by the tobacco companies\"                                    \n## [13] \"aren't so sure. The list includes several\"                                   \n## [14] \"The CEOs of the nation's largest tobacco\"                                    \n## [15] \"firms told congressional panel that nicotine\"                                \n## [16] \"law, but many will not. People will be selling\"                              \n## [17] \"iS not addictive, that they are unconvinced\"                                 \n## [18] \"cigarettes out of the trunks of cars, cigarettes\"                            \n## [19] \"substances the government does not allow in\"                                 \n## [20] \"foods or classifies as potentially toxic. They\"                              \n## [21] \"that smoking causes lung cancer or any other\"                                \n## [22] \"made by who knows who, made of who knows include ammonia, a pesticide called\"\n## [23] \"illness, and that smoking is no more harmful\"                                \n## [24] \"what,\\\" said James Johnston of R.J. Reynolds.\"                               \n## [25] \"than drinking coffee or eating Twinkies.\"                                    \n## [26] \"It's a ruse. He knows cigarettes are not\"                                    \n## [27] \"methoprene, and ethyl furoate, which has\"                                    \n## [28] \"They said these things with straight taces.\"                                 \n## [29] \"going to be banned, at leasi not in his lifetime.\"                           \n## [30] \"caused liver damage in rats.\"                                                \n## [31] \"The list \\\"begs a number of important\"                                       \n## [32] \"They said them in the face of massive\"                                       \n## [33] \"STEVE WILSON\"                                                                \n## [34] \"What he really fears are new taxes, stronger\"                                \n## [35] \"questions about the safety of these additives,\\\"\"                            \n## [36] \"scientific evidence that smoking is responsible\"                             \n## [37] \"anti-smoking campaigns, further smoking\"                                     \n## [38] \"said a joint statement from the American\"                                    \n## [39] \"for more than 400,000 deaths every year.\"                                    \n## [40] \"restrictions, limits on secondhand smoke and\"                                \n## [41] \"Rep. Henry Waxman, D-Calif., put that\"                                       \n## [42] \"Republic Columnist\"                                                          \n## [43] \"Lung, Cancer and Heart associations. The\"                                    \n## [44] \"limits on tar and nicotine.\"                                                 \n## [45] \"statement added that substances safe to eat\"                                 \n## [46] \"frightful statistic another way:\"                                            \n## [47] \"Collectively, these steps can accelerate the\"                                \n## [48] \"\\\"Imagine our nation's outrage if two fully\"                                 \n## [49] \"He and the others played dumb for the\"                                       \n## [50] \"current 5 percent annual decline in cigarette\"                               \n## [51] \"aren't necessarily safe to inhale.\"                                          \n## [52] \"The 50-page list can be obtained free by\"                                    \n## [53] \"loaded jumbo jets crashed each day, killing all\"                             \n## [54] \"entire six hours, but really didn't matter.\"                                 \n## [55] \"use and turn the tobacco business from highly\"                               \n## [56] \"calling 1-800-852-8749.\"                                                     \n## [57] \"aboard. That's the same number of Americans\"                                 \n## [58] \"The game i nearly over, and the tobacco\"                                     \n## [59] \"profitable to depressed.\"                                                    \n## [60] \"Johnson's comment about cigarettes \\\"made\"                                   \n## [61] \"Here are just the 44 ingredients that start\"                                 \n## [62] \"that cigarettes kill every 24 hours.'\"                                       \n## [63] \"executives know it.\"                                                         \n## [64] \"with the letter \\\"A\\\":\"                                                      \n## [65] \"The CEOs were not impressed.\"                                                \n## [66] \"The hearing marked a turning point in the\"                                   \n## [67] \"of who knows what\\\" was comical.\"                                            \n## [68] \"Acetanisole, acetic acid, acetoin,\"                                          \n## [69] \"\\\"We have looked at the data.\"                                               \n## [70] \"It does\"                                                                     \n## [71] \"nation's growing aversion to cigarettes. No\"                                 \n## [72] \"The day before the hearing, the tobacco\"                                     \n## [73] \"acetophenone,6-acetoxydihydrotheaspirane,\"                                   \n## [74] \"not convince me that smoking causes death,\\\"\"                                \n## [75] \"2-acetyl-3-ethylpyrazine, 2-acetyl-5-\"                                       \n## [76] \"said Andrew Tisch of the Lorillard Tobacco\"                                  \n## [77] \"longer hamstrung by tobacco-state seniority\"                                 \n## [78] \"companies released a long-secret list of 599\"                                \n## [79] \"Co.\"                                                                         \n## [80] \"and the deep-pocketed tobacco lobby,\"                                        \n## [81] \"methylfuran, acetylpyrazine, 2-acetylpyridine,\"                              \n## [82] \"Congress is taking aim at cigarette makers.\"                                 \n## [83] \"additives used in cigarettes. The companies\"                                 \n## [84] \"said all are certified by an \\\"independent\"                                  \n## [85] \"3-acetylpyridine, 2-acetylthiazole, aconitic\"   \n<\/code><\/pre>\n<p>(You can compare that on your own with <a href=\"https:\/\/rud.is\/dl\/8200-006-3b.txt\">the Tesseract results<\/a>.)<\/p>\n<h3>FIN<\/h3>\n<p>{cdcfluview} checks are done, and the fixed functions are back on CRAN! Just in time to close out this post.<\/p>\n<p>If you&#8217;re on macOS, definitely check out the various ML\/AI frameworks Apple has to offer via Swift and have some fun playing with integrating them into R (or build some small, command line utilities if you want to keep Swift and R apart).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My {cdcfluview} package started tossing erros on CRAN just over a week ago when the CDC added an extra parameter to one of the hidden API endpoints that the package wraps. After a fairly hectic set of days since said NOTE came, I had time this morning to poke at a fix. There are alot [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[780,91,830],"tags":[],"class_list":["post-13094","post","type-post","status-publish","format-standard","hentry","category-macos","category-r","category-swift"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>A {swiftr} Brief Interlude While Awaiting {cdcfluview} CRAN Checks - 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\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A {swiftr} Brief Interlude While Awaiting {cdcfluview} CRAN Checks - rud.is\" \/>\n<meta property=\"og:description\" content=\"My {cdcfluview} package started tossing erros on CRAN just over a week ago when the CDC added an extra parameter to one of the hidden API endpoints that the package wraps. After a fairly hectic set of days since said NOTE came, I had time this morning to poke at a fix. There are alot [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-22T15:01:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg\" \/>\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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/05\\\/22\\\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/05\\\/22\\\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"A {swiftr} Brief Interlude While Awaiting {cdcfluview} CRAN Checks\",\"datePublished\":\"2021-05-22T15:01:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/05\\\/22\\\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\\\/\"},\"wordCount\":358,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/05\\\/22\\\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/signs.jpeg\",\"articleSection\":[\"macOS\",\"R\",\"Swift\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/05\\\/22\\\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/05\\\/22\\\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/05\\\/22\\\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\\\/\",\"name\":\"A {swiftr} Brief Interlude While Awaiting {cdcfluview} CRAN Checks - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/05\\\/22\\\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/05\\\/22\\\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/signs.jpeg\",\"datePublished\":\"2021-05-22T15:01:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/05\\\/22\\\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/05\\\/22\\\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/05\\\/22\\\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/signs.jpeg?fit=525%2C328&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/signs.jpeg?fit=525%2C328&ssl=1\",\"width\":525,\"height\":328,\"caption\":\"Yellow street signs against clear blue sky pointing different directions. Each plate on the street sign has a specific term like unsure, muddled, coonfused and so on. Dilemma and confusion concept. horizontal composition with copy space. Clipping path is included.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/05\\\/22\\\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A {swiftr} Brief Interlude While Awaiting {cdcfluview} CRAN Checks\"}]},{\"@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 {swiftr} Brief Interlude While Awaiting {cdcfluview} CRAN Checks - 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\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/","og_locale":"en_US","og_type":"article","og_title":"A {swiftr} Brief Interlude While Awaiting {cdcfluview} CRAN Checks - rud.is","og_description":"My {cdcfluview} package started tossing erros on CRAN just over a week ago when the CDC added an extra parameter to one of the hidden API endpoints that the package wraps. After a fairly hectic set of days since said NOTE came, I had time this morning to poke at a fix. There are alot [&hellip;]","og_url":"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/","og_site_name":"rud.is","article_published_time":"2021-05-22T15:01:35+00:00","og_image":[{"url":"https:\/\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg","type":"","width":"","height":""}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"A {swiftr} Brief Interlude While Awaiting {cdcfluview} CRAN Checks","datePublished":"2021-05-22T15:01:35+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/"},"wordCount":358,"commentCount":1,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg","articleSection":["macOS","R","Swift"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/","url":"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/","name":"A {swiftr} Brief Interlude While Awaiting {cdcfluview} CRAN Checks - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg","datePublished":"2021-05-22T15:01:35+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg?fit=525%2C328&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/05\/signs.jpeg?fit=525%2C328&ssl=1","width":525,"height":328,"caption":"Yellow street signs against clear blue sky pointing different directions. Each plate on the street sign has a specific term like unsure, muddled, coonfused and so on. Dilemma and confusion concept. horizontal composition with copy space. Clipping path is included."},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2021\/05\/22\/a-swiftr-brief-interlude-while-awaiting-cdcfluview-cran-checks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"A {swiftr} Brief Interlude While Awaiting {cdcfluview} CRAN Checks"}]},{"@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-3pc","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":12826,"url":"https:\/\/rud.is\/b\/2020\/10\/13\/short-sweet-cdcfluview-0-9-2-is-on-its-way-to-cran-mirrors\/","url_meta":{"origin":13094,"position":0},"title":"Short &#038; Sweet: {cdcfluview} 0.9.2 Is On Its Way to CRAN Mirrors","author":"hrbrmstr","date":"2020-10-13","format":false,"excerpt":"The CDC continues to \"deliver\" in 2020, this time by changing the JSON response of one of the hidden APIs that my {cdcfluview} package wraps. CDC: So helpful! It was a quick fix, and version 0.9.2 passed automated CRAN checks in ~9.42 minutes! ? the CRAN team! Plus, a special\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":3610,"url":"https:\/\/rud.is\/b\/2015\/08\/09\/cdcfluview-on-the-way-to-cran-7k\/","url_meta":{"origin":13094,"position":1},"title":"cdcfluview &#8211; On The Way to &#8220;CRAN 7K&#8221;","author":"hrbrmstr","date":"2015-08-09","format":false,"excerpt":"I like to turn coincidence into convergence whenever possible. This weekend, a user of [cdcfluview](http:\/\/github.com\/hrbrmstr\/cdcfluview) had a question that caused me to notice a difference in behaviour between the package was interacting with CDC FluView API, so I updated the package to accommodate the change and the user. Around the\u2026","rel":"","context":"In &quot;Data Analysis&quot;","block_context":{"text":"Data Analysis","link":"https:\/\/rud.is\/b\/category\/data-analysis-2\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":12891,"url":"https:\/\/rud.is\/b\/2021\/01\/23\/swiftr-switcheroo-calling-compiled-swift-from-r\/","url_meta":{"origin":13094,"position":2},"title":"SwiftR Switcheroo: Calling [Compiled] Swift from R!","author":"hrbrmstr","date":"2021-01-23","format":false,"excerpt":"I've been on a Swift + R bender for a while now, but have been envious of the pure macOS\/iOS (et al) folks who get to use Apple's seriously ++good machine learning libraries, which are even more robust on the new M1 hardware (it's cool having hardware components dedicated to\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":12866,"url":"https:\/\/rud.is\/b\/2021\/01\/04\/bringing-r-to-swift-on-macos\/","url_meta":{"origin":13094,"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":12878,"url":"https:\/\/rud.is\/b\/2021\/01\/16\/new-swiftr-chapter-up-building-an-r-backed-swiftui-macos-app\/","url_meta":{"origin":13094,"position":4},"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":13026,"url":"https:\/\/rud.is\/b\/2021\/04\/14\/avoiding-the-mdls-command-line-round-trip-with-swiftrswift_function\/","url_meta":{"origin":13094,"position":5},"title":"Avoiding The mdls Command Line Round Trip With swiftr::swift_function()","author":"hrbrmstr","date":"2021-04-14","format":false,"excerpt":"The last post showed how to work with the macOS mdls command line XML output, but with {swiftr} we can avoid the command line round trip by bridging the low-level Spotlight API (which mdls uses) directly in R via Swift. If you've already played with {swiftr} before but were somewhat\u2026","rel":"","context":"In &quot;macOS&quot;","block_context":{"text":"macOS","link":"https:\/\/rud.is\/b\/category\/macos\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/13094","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=13094"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/13094\/revisions"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=13094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=13094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=13094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}