

{"id":12866,"date":"2021-01-04T17:29:36","date_gmt":"2021-01-04T22:29:36","guid":{"rendered":"https:\/\/rud.is\/b\/?p=12866"},"modified":"2021-01-04T17:29:36","modified_gmt":"2021-01-04T22:29:36","slug":"bringing-r-to-swift-on-macos","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2021\/01\/04\/bringing-r-to-swift-on-macos\/","title":{"rendered":"Bringing R to Swift on macOS"},"content":{"rendered":"<p>Over Christmas break I teased some screencaps:<\/p>\n<blockquote class=\"twitter-tweet\">\n<p lang=\"en\" dir=\"ltr\">A more refined <a href=\"https:\/\/twitter.com\/hashtag\/rstats?src=hash&amp;ref_src=twsrc%5Etfw\">#rstats<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/swift?src=hash&amp;ref_src=twsrc%5Etfw\">#swift<\/a> &quot;SwiftR&quot; example. Simple Image view + some text views, a color picker and a button that runs <\/p>\n<p>R-in-Swift code (like {reticulate} does for Python in R)<\/p>\n<p>Note no ssd\/hd storage round-trip for the plot.<\/p>\n<p>Code snippet: <a href=\"https:\/\/t.co\/fWaHnztUgd\">https:\/\/t.co\/fWaHnztUgd<\/a> <a href=\"https:\/\/t.co\/y5m1I16tCB\">pic.twitter.com\/y5m1I16tCB<\/a><\/p>\n<p>&mdash; Caliban&#39;s War (@hrbrmstr) <a href=\"https:\/\/twitter.com\/hrbrmstr\/status\/1343622147772735488?ref_src=twsrc%5Etfw\">December 28, 2020<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<blockquote class=\"twitter-tweet\">\n<p lang=\"en\" dir=\"ltr\">Final teaser for <a href=\"https:\/\/twitter.com\/hashtag\/rstats?src=hash&amp;ref_src=twsrc%5Etfw\">#rstats<\/a> R-in-Swift (SwiftR) since I _think_ I&#39;ve \u274c&#39;d all memory leaks and refined the example project. The displayed 10,\u2026 numbers come right from sample()&#39;d R vector and the fill color live refreshes fast b\/c {magick} is magical. Shld have repo up Thu. <a href=\"https:\/\/t.co\/boGa5ej9FZ\">pic.twitter.com\/boGa5ej9FZ<\/a><\/p>\n<p>&mdash; Caliban&#39;s War (@hrbrmstr) <a href=\"https:\/\/twitter.com\/hrbrmstr\/status\/1344036731855769600?ref_src=twsrc%5Etfw\">December 29, 2020<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p>of some almost-natural &#8220;R&#8221; looking code (this is a snippet):<\/p>\n<pre><code class=\"language-swift\">Button(\"Run\") {\n  do { \/\/ calls to R can fail so there are lots of \"try\"s; poking at less ugly alternatives\n\n    \/\/ handling dots in named calls is a WIP\n    _  = try R.evalParse(\"options(tidyverse.quiet = TRUE )\")\n\n    \/\/ in practice this wld be called once in a model\n    try R.library(\"ggplot2\")\n    try R.library(\"hrbrthemes\")\n    try R.library(\"magick\")\n\n    \/\/ can mix initialiation of an R list with Swift and R objects\n    let mvals: RObject = [\n      \"month\": [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\" ],\n      \"value\": try R.sample(100, 6)\n    ]\n\n    \/\/ ggplot2! `mvals` is above, `col.hexValue` comes from the color picker\n    \/\/ can't do R.as.data.frame b\/c \"dots\" so this is a deliberately exposed alternate call\n    let gg = try R.ggplot(R.as_data_frame(mvals)) +\n      R.geom_col(R.aes_string(\"month\", \"value\"), fill: col.hexValue) + \/\/ supports both [un]named\n      R.scale_y_comma() +\n      R.labs(\n        x: rNULL, y: \"# things\",\n        title: \"Monthly Bars\"\n      ) +\n      R.theme_ipsum_gs(grid: \"Y\")\n\n    \/\/ an alternative to {magick} could be getting raw SVG from {svglite} device\n    \/\/ we get Image view width\/height and pass that to {magick}\n    \/\/ either beats disk\/ssd round-trip\n    let fig = try R.image_graph(\n      width: Double(imageRect.width), \n      height: Double(imageRect.height), \n      res: 144\n    )\n\n    try R.print(gg)\n    _ = R.dev_off() \/\/ can't do R.dev.off b\/c \"dots\" so this is a deliberately exposed alternate call\n\n    let res = try R.image_write(fig, path: rNULL, format: \"png\")\n\n    imgData = Data(res) \/\/ \"imgData\" is a reactive SwiftUI bound object; when it changes Image does too\n\n  } catch {\n  }\n\n}\n<\/code><\/pre>\n<p>that works in Swift as part of a SwiftUI app that displays a ggplot2 plot inside of a macOS application.<\/p>\n<p>It doesn&#8217;t shell out to R, but uses Swift 5&#8217;s native abilities to interface with R&#8217;s C interface.<\/p>\n<p>I&#8217;m not ready to reveal that SwiftR code\/library just yet (break&#8217;s over and the core bits still need some tweaking) but I <em>can<\/em> provide some interim resources with an online book about working with R&#8217;s C interface from Swift on macOS. It is uninspiringly called <a href=\"https:\/\/rud.is\/books\/swiftr\/\">SwiftR \u2014 Using R from Swift<\/a>.<\/p>\n<p>There are, at present, six chapters that introduce the Swift+R concepts via command line apps. These aren&#8217;t terribly useful (shebanged R scripts work <em>just<\/em> fine, #tyvm) in and of themselves, but command line machinations are a much lower barrier to entry than starting right in with SwiftUI (that starts in chapter seven).<\/p>\n<h3>FIN<\/h3>\n<p>If you&#8217;ve wanted a reason to burn ~20GB of drive space with an Xcode installation and start to learn Swift (or learn more about Swift) then this is a resource for you.<\/p>\n<p>The topics in the chapters are also a fairly decent (albeit incomplete) overview of R&#8217;s C interface and also how to work with C code from Swift in general.<\/p>\n<p>So, take advantage of the remaining pandemic time and give it a ?.<\/p>\n<p>Feedback is welcome in the comments or the book code repo (book source repo is in progress).<\/p>\n<p>Hope everyone has a  safe and strong new year!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over Christmas break I teased some screencaps: A more refined #rstats #swift &quot;SwiftR&quot; 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 &mdash; Caliban&#39;s War (@hrbrmstr) December [&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":[663,780,91,830],"tags":[],"class_list":["post-12866","post","type-post","status-publish","format-standard","hentry","category-apple","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>Bringing R to Swift on macOS - 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\/01\/04\/bringing-r-to-swift-on-macos\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bringing R to Swift on macOS - rud.is\" \/>\n<meta property=\"og:description\" content=\"Over Christmas break I teased some screencaps: A more refined #rstats #swift &quot;SwiftR&quot; 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 &mdash; Caliban&#039;s War (@hrbrmstr) December [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2021\/01\/04\/bringing-r-to-swift-on-macos\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-04T22:29:36+00:00\" \/>\n<meta name=\"author\" content=\"hrbrmstr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"hrbrmstr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/01\\\/04\\\/bringing-r-to-swift-on-macos\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/01\\\/04\\\/bringing-r-to-swift-on-macos\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Bringing R to Swift on macOS\",\"datePublished\":\"2021-01-04T22:29:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/01\\\/04\\\/bringing-r-to-swift-on-macos\\\/\"},\"wordCount\":392,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"articleSection\":[\"Apple\",\"macOS\",\"R\",\"Swift\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/01\\\/04\\\/bringing-r-to-swift-on-macos\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/01\\\/04\\\/bringing-r-to-swift-on-macos\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/01\\\/04\\\/bringing-r-to-swift-on-macos\\\/\",\"name\":\"Bringing R to Swift on macOS - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"datePublished\":\"2021-01-04T22:29:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/01\\\/04\\\/bringing-r-to-swift-on-macos\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/01\\\/04\\\/bringing-r-to-swift-on-macos\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/01\\\/04\\\/bringing-r-to-swift-on-macos\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bringing R to Swift on macOS\"}]},{\"@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":"Bringing R to Swift on macOS - 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\/01\/04\/bringing-r-to-swift-on-macos\/","og_locale":"en_US","og_type":"article","og_title":"Bringing R to Swift on macOS - rud.is","og_description":"Over Christmas break I teased some screencaps: A more refined #rstats #swift &quot;SwiftR&quot; 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 &mdash; Caliban&#39;s War (@hrbrmstr) December [&hellip;]","og_url":"https:\/\/rud.is\/b\/2021\/01\/04\/bringing-r-to-swift-on-macos\/","og_site_name":"rud.is","article_published_time":"2021-01-04T22:29:36+00:00","author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2021\/01\/04\/bringing-r-to-swift-on-macos\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2021\/01\/04\/bringing-r-to-swift-on-macos\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Bringing R to Swift on macOS","datePublished":"2021-01-04T22:29:36+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2021\/01\/04\/bringing-r-to-swift-on-macos\/"},"wordCount":392,"commentCount":1,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"articleSection":["Apple","macOS","R","Swift"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2021\/01\/04\/bringing-r-to-swift-on-macos\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2021\/01\/04\/bringing-r-to-swift-on-macos\/","url":"https:\/\/rud.is\/b\/2021\/01\/04\/bringing-r-to-swift-on-macos\/","name":"Bringing R to Swift on macOS - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"datePublished":"2021-01-04T22:29:36+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2021\/01\/04\/bringing-r-to-swift-on-macos\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2021\/01\/04\/bringing-r-to-swift-on-macos\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2021\/01\/04\/bringing-r-to-swift-on-macos\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Bringing R to Swift on macOS"}]},{"@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-3lw","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":12866,"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":12438,"url":"https:\/\/rud.is\/b\/2019\/08\/22\/quick-hit-a-new-64-bit-swift-5-rswitch-app\/","url_meta":{"origin":12866,"position":1},"title":"Quick Hit: A new 64-bit Swift 5 RSwitch App","author":"hrbrmstr","date":"2019-08-22","format":false,"excerpt":"At the bottom of the R for macOS Developer's Page there's mention of an \"other binary\" called \"RSwitch\" that is \"a small GUI that allows you to switch between R versions quickly (if you have multiple versions of R framework installed).\" Said switching requires you to use the \"tar.gz\" versions\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":12891,"url":"https:\/\/rud.is\/b\/2021\/01\/23\/swiftr-switcheroo-calling-compiled-swift-from-r\/","url_meta":{"origin":12866,"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":12459,"url":"https:\/\/rud.is\/b\/2019\/08\/26\/rswitch-1-4-0-released\/","url_meta":{"origin":12866,"position":3},"title":"RSwitch 1.4.0 Released","author":"hrbrmstr","date":"2019-08-26","format":false,"excerpt":"Swift 5 has been so much fun to hack on that there's a new update to macOS R-focused mebubar utility RSwitch available. Along with the app comes a new dedicated RSwitch landing page and a new user's guide since it has enough features to warrant such documentation. Here's the new\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":12866,"position":4},"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":[]},{"id":11427,"url":"https:\/\/rud.is\/b\/2018\/08\/24\/friday-rstats-twofer-finding-macos-32-bit-apps-processing-data-from-system-commands\/","url_meta":{"origin":12866,"position":5},"title":"Friday #rstats twofer: Finding macOS 32-bit apps &#038; Processing Data from System Commands","author":"hrbrmstr","date":"2018-08-24","format":false,"excerpt":"Apple has run the death bell on 32-bit macOS apps and, if you're running a recent macOS version on your Mac (which you should so you can get security updates) you likely see this alert from time-to-time: If you're like me, you click through that and keep working but later\u2026","rel":"","context":"In &quot;Apple&quot;","block_context":{"text":"Apple","link":"https:\/\/rud.is\/b\/category\/apple\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/12866","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=12866"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/12866\/revisions"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=12866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=12866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=12866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}