It's not every day that we get to dive into a brand new release of R, but we get to do just that in episode 202! We share our takes on the major new features of R 4.5.0. We also preview the re-imagination of the engine powering R-based APIs, and the LLM-powered helper to get some of those R package development chores done.
Episode Links
Episode Links
- This week's curator: Eric Nantz: @[email protected] (Mastodon) & @rpodcast.bsky.social (BlueSky) & @theRcast (X/Twitter)
- What's new in R 4.5.0?
- plumber2
- Introducing chores
- Entire issue available at rweekly.org/2025-W16
- {basepenguins} Convert files that use palmerpenguins to work with datasets https://ellakaye.github.io/basepenguins/
- Upgrading from {plumber} https://posit-dev.github.io/plumber2/articles/migration.html
- {chores} gallery https://simonpcouch.github.io/chores/articles/gallery.html
- {chores} custom helpers https://simonpcouch.github.io/chores/articles/custom.html
- Use the contact page at https://serve.podhome.fm/custompage/r-weekly-highlights/contact to send us your feedback
- R-Weekly Highlights on the Podcastindex.org - You can send a boost into the show directly in the Podcast Index. First, top-up with Alby, and then head over to the R-Weekly Highlights podcast entry on the index.
- A new way to think about value: https://value4value.info
- Get in touch with us on social media
- Eric Nantz: @[email protected] (Mastodon), @rpodcast.bsky.social (BlueSky) and @theRcast (X/Twitter)
- Mike Thomas: @[email protected] (Mastodon), @mike-thomas.bsky.social (BlueSky), and @mike_ketchbrook (X/Twitter)
- Put the lime in the Koopa shell and drink it all up - Mario Party - Mel Decision, darmock, DeLuxDolemite, Siolfor the Jackal - https://ocremix.org/remix/OCR04836
- Watermelon Flava - Breath of Fire III - Joshua Morse, posu yan - https://ocremix.org/remix/OCR01411
[00:00:03]
Eric Nantz:
Hello, friends. We are back at episode 202 of the Our Weekly Highlights podcast. This is The Weekly Show where we talk about the excellent highlights that have been shared on this week's our weekly issue at ourweekly.0rg. My name is Eric Nance, and I'm delighted you joined us wherever you are around the world. And joining me virtually, as always, is my awesome cohost, Mike Thomas. Mike, how are you doing today? Doing great, Eric. Coming off the back of Shiny Conf recently. So it's a a fun time to be, you know, a part of the art community and a lot of exciting things to be looking forward to and talking about. You bet. I felt like I was, definitely drinking from the fire hose those past, last week with Shiny Conf. I did a lot of new things to talk about, and I'll talk about my adventures on that as we get towards the end of the show. But lots of lots of great happenings there, and it goes too quickly. I like all these virtual conferences do. They do, especially when the content is hot and really, really innovative like we saw last week. So certainly, if I don't say already, congratulations to the fine folks at Absolon for running that conference right now. I believe it's the fourth year in its existence, and it went off without a hitch and really, really well done, everybody.
It's no small feat. It it sure is. And I know from organize helping organize the Our Farmer Conference, there is never a dull moment behind the scenes. And at the end, you're kinda like, oh, I can breathe again. So I'm sure they're getting some well deserved rest after that one. But we're not resting here. We're talking about our our current issue. It is, been curated by old check notes. Oh, yeah. Yours truly was a real hustle on because right after my presentation at Shining Comp, I threw this issue together and somehow made it in one piece. So as hopefully, it's a good one. We will find out. But as always, I had tremendous help from our fellow our rookie team members. They They always keep me honest and really straight to the point, as well as our cure as our contributors like all of you around the road of your poll requests and other great suggestions. And it was a pretty clear, quote unquote, winner, so to speak, and who would lead off this section because it's not every day or every week that we get to to talk about a new release in the R language itself.
And what are we talking about? Well, recently, our version four dot five dot o has hit the crayon sources out online, and this code this release is code name, how about a 26. Now you may be wondering what in the world is that all about. So fun fact for those who may not know their R history as well, and I didn't either for a while, all the code names for each R release do have origins with the famous Peanuts comics, I e Charlie Brown and their famous characters. And usually, when I see a code release, I can kind of remember, oh, yeah. I remember reading that script or I remember that from the old Charlie Brown movies. This one, however, I was like, what is that one all about? So yesterday did a little digging last night because it was a a geeky moment. I'm like, I gotta figure this out. What is this all about? So turns out one of the characters named Lucy, who tend to tease Charlie quite a bit, She kinda ran her own, you might call a makeshift psychologist or psychiatry booth where she would charge, I believe, 5¢ for a consultation.
And then Charlie Brown came to her one day and asked for some advice, and she out of boots says, well, how about 26¢? So I don't know what happened after that, but that's where the 26 comes from. The more you know. Very cool. Thank you for that. If I'm useful for one thing, it's the Charlie Brown trivia.
[00:03:45] Mike Thomas:
I remember Lucy's, yes, psychologist or psych psychiatrist booth very fondly, but I didn't remember the 26.
[00:03:54] Eric Nantz:
Yeah. Neither did I until the little of sleuthing last night. So, again, credit to the hardcore team for always finding a new one, the the spring upon us at each of these releases. So let's talk about what's in this release. And first of all, how this was put together. This is an excellent post that comes basically after every release from our friends at Jumping Rivers. And I the author this time is Russ Hyde, who is one of the data scientists at Jumping Rivers, and he's done a fantastic job summarizing a lot of the key points in this release. And we'll go through a few of the ones that caught our attention.
I was, telling Mike before the show that, it was this past weekend. It was the end of my kids spring break, and I ended up taking them to a a zoo over a couple hours away in Cincinnati. My youngest one, his favorite animal is not the one you might expect. It's not like the tigers or the gorillas or anything. It's penguins. He's a penguin fan. Guess what? I'm gonna try to get him to use Linux later, but that's another story. But speaking of penguins here, guess what? In our version four dot five, the Palmer penguins dataset that's made a lot of positive, headlines in the last couple years is now included in base r. This is massive achievement for that team that put this out there.
And the origins of penguins, we don't have time to get into it today, but, nonetheless, one of the motivations was to find a relatable data source that could maybe in the future serve as quote, unquote, the new iris or the new set that you could use for examples of, say, statistical inference, classification, roles that the iris dataset did play. And for all those, you know, textbook examples, examples you find online, the penguins dataset has a lot of interesting features. And now, like I said, it is available in Besar itself. And so I'm really excited for that, and congratulations, for getting that into Besar itself.
So that caught my attention. This other one is another case where you might say other computing languages tend to have an influence in r from time to time. We all know its origins from the s language and, of course, it's, you know, tie ins with c and Fortran and whatnot. This influence, I think, comes from a certain language that might have a snake as a mascot because we are now talking about the use function. This is brand new to r. Albeit, it was quite re released in version four dot four, but I did not get radar of it until now. What does this mean? Well, if you are coming from the world of Python, you may be used to loading your modules or packages with a couple different approaches. You might do the import function, such as, like, import NumPy if you wanna use that, Or you might only want one specific function from that module, and you might say from NumPy import, say, the array function.
In that way, you've only taken what you needed. In r, historically, the way we've done this is that you would do the name spacing trick. Not so much trick. It's a it's a feature. You put the name of the package, colon colon, the name of the function, if you wanna use it in a quote unquote one off setting. That works I get to my muscle memory for years. I I do this a lot, especially when I only need that function once or twice in my overall function. But now with this use function, you can now call the function use, put in the name of the package, and then the next argument is one or more of the functions you want inside, which again will now modify the search path that R uses as it's trying to figure out what are you referencing when you call that function as an alternative to the namespace prefix and as an alternative just doing the library statement on the package itself.
Now, again, I I pride myself on being up to date with this, but this did come out of left field as I would say. But I think for those making the transition to r, this is probably something that many of them were wondering why wasn't something like this out there. So another fun fact is that there have been other packages in the art community that have exposed this kind of functionality. One of which I know from my exploration, especially with the Rhino, framework from Absalon, is the box package. That has been basically replicating this for a while, and you get more control over that than you do even with this use function where you could use this box package to import, say, functions from an arbitrary r script, not just a package. So you do get a little more control there for your needs. But I do find it interesting that the influence of another language has now landed into bazar, and I guess time will tell just how much this is gonna be used in the wild. So I think that that one definitely caught my attention for the future.
And then the last one that caught my attention, especially someone that's kinda, you might say, greedy whenever I install a new package and ends up having a bunch of dependencies. I just wanna get it done quickly. Right? We've seen approaches in the art community, namely the pack, you know, framework offered by posit to help, you know, give you a little more modern way of installing packages using parallel downloads and curl and whatnot. Well, as of our version four dot five dot o, the install dot packages function now lets you download functions and update packages in parallel.
That can be a huge time saver, folks. Like I said, especially if you're installing, you might say, something from the tidy verse or, or another, you know, string processing package and you got it to pull down five, ten, sometimes 15 dependencies, but, you know, how far the rabbit hole lies, this could, you know, may give you a bit of time savings. So I'm I'm I'm I'm happy to have that now land in the base tower itself without you having to do a lot of tricks to make that happen. There is a lot more to this release, and we'll definitely link in the in the show notes to the full post from Russ here as well as the full change log, which has its full assortment of bug fixes, offer new functions, and offer, you know, great developments in this release.
So, Mike, what caught your eye on our version four dot five here?
[00:10:57] Mike Thomas:
You know, a lot caught my eye. It's very exciting to have that palmer penguins package, you know, built in to ours that we don't necessarily need the external package. Although, just a word of warning, it's not a perfect one to one if you just wanna pick up, you know, the base dataset that we have the base R dataset that we have now in your existing scripts that leverage the palmer penguins package previously, some of the column names, I think, are slightly different. So, unfortunately, we love open source. There is another new package that just came out called BasePenguins, and it's authored by Ella Kaye, Heather Turner, and Akeem Zellas. And it allows you to easily convert your script between, references to the quote unquote old Palmer penguins package and leveraging the new palmer penguins dataset that is built into our four dot five dot o. So thank you to the three of them for authoring that package to make our lives easier as we try to convert, to leveraging the new the new built in dataset, which is awesome. Yeah. They use, the use function is really, really interesting to me. I almost can't believe, if you think about all of the function names that exist or namespaces that exist in base r that use was not, you know, previously used. No pun intended.
I guess they were reserving it just for this particular use case, which is which is pretty awesome, very Pythonic. As you mentioned, It looks like based upon some chatter that I've seen on Blue Sky, you know, one word of caution is you can't, have two separate lines that are importing different functions from the same package. Like, you can't have one line that says, you know, use the arrange function from dplyr and then another line that says use the filter function from dplyr. You would actually have to, supply sort of a character vector that says from dplyr, you know, essentially use a range and filter at the same time. Unfortunately, you can't do that downstream the way that you can in Python. So a couple of things to be careful of as you begin to, you know, hopefully try out and experiment this new use function. And then the last thing, you know, that really caught my eye beyond the parallel downloads, which is absolutely awesome, is a new function called grep v. So for any of anyone else, perhaps like myself out there who has always struggled to remember whether we need to use grep or grepo, and grep returns the position and grepo returns a true false, I believe.
And all you want is the actual values that get matched. The new grep v function does exactly that. It's what you've always wanted grep and grapple to do and what you've probably used string r to do. But now we have a a nice base function called grep v that can just you can supply a pattern to, your first argument would be the the strings and then your second argument would be, the pattern. Actually, excuse me. I think I got that backwards because it's base r. The second argument is the string and the first argument is the pattern. But it will return just the matches. The the perfect string matches, not the positions, not a logical, you know, vector of true falses, it'll return exactly what you want. So I'm super excited to have that now in base r for those situations where I need to do some string matching and, you know, it's just a one off use case where I don't necessarily want to, you know, install the entire string r library and try to stick to base r here. It's very very helpful. So I'm excited about that one as well. Yeah. And Russ also concludes the post that
[00:14:41] Eric Nantz:
a lot of the other features and bug fixes that are are called out in in the release notes are also stemming from really successful r dev day events that have been held after, say, various conferences or other, meetup settings. This is a wonderful way that we're seeing those newer to the community, newer to contributions to base are really starting to make a real impact on the language itself. And I think that's only gonna speak volumes to the success and the and the future life of our itself, bringing bringing contributors from all backgrounds, all experience levels to help with the project itself. So really excited to see all that. And I'm not sure of the time this recording of the binary versions of R have landed yet for, say, Windows, Linux, Mac, and whatnot.
But you do have ways of trying this out yourself without messing up your system, so to speak, or or putting into a bind, one of which is that you can use containers of Docker. They'll pull down a new image that has the latest r release from source already built in. You can also utilize the rig utility offered by Gabor Sarty that lets you install our development versions on r 4 5 alongside your r installations. And because I couldn't resist saying this, if you use the RIX package offered by Bruno Rodriguez, RIX now lets you put an r four dot five in your your environment there. So you may hear more about that a bit later. Nonetheless, you've got ways of trying this out. So, yeah, we encourage you to try it out today and and definitely give it give it a good whirl and enjoy those new penguins and all those other great features.
So in our next highlight, it's not every day that we get to talk about one of the more important frameworks that both Mike and I have been utilizing for years and years in our intersections of leveraging R with building custom APIs for our R based services or or analyses. And it's an interesting situation where you can see in the life cycle of a package, there are often two paths to take as new features are requested and maybe infrastructure needs updating. Do you keep building upon what's already there, or do you take that other fork in the road and kind of start from scratch?
Well, this next highlight is kind of that second route here because we are now talking about the plumber two package. Note the two. If you're not aware, there has been a package called plumber offered by Barish Slurkey over at Posit, and it was originally offered by Jeff Allen who was at Posit beforehand. And that's been my go to package for making R become an API. Whether I was doing a statistical output, like analysis, or doing some other utility, R was my way to make an API that then any language, no matter R, Python, JavaScript, whatever you throw at it, if it could compile if it could call an API, it could I could use Plumber to make that API.
Well, now we have plumber two that has hit the GitHub, you know, development, over at Pazza. And this one is authored by Thomas Lynn Peterson, who you might know as the one of the the wizards and maintainers of g g plot two along with many visualization packages. But Thomas has also been pushing the envelope a lot of web based request packaging and API packaging because he has authored in the past a package called Fiery, which was kind of like an alternative take on both, you know, API development and Shiny itself. So he's definitely looked at this mode before.
But there was a recent, I believe, you know, blue sky post or a mastodon post from Thomas asking for feedback on this new Plumber two package. So it's a great time to talk about it and spread the word about it. So what is different about plumber two as opposed to the first plumber? Well, even in the outset of the package site introduction, this is one of those cases where plumber two was born on kind of writing some of the things that they found inefficient from the previous plumber development. And it sounds like it was just easier to kind of start this from scratch instead of trying to extend the existing plumber code base to fix all these holes. And he mentions that there are a few breaking changes if you're coming from the first plumber generation over here as part of this infrastructure improvement.
So we will have a link in the show notes to the the the full, packaged down site, and there is a great article if you want us try plumber two, what you need to do to upgrade from plumber one because that's kind of where I'm coming from on this since I've been using plumber for years and years. First of which is the function itself changes from p r to API, which I guess in retrospect does make more sense. Right? But it sounds like p r was kinda harder to remember, and it was meant to be an acronym for our plumber route. But Thomas says in this documentation that when you build an API, it's much more than just a route. It can be a lot of things under the hood. So they think the API, function name is going to be a lot more easier to remember for the majority of users.
And there are other key changes, one of which is now if you have an argument for your path and your query parameter, if you do, like, slash something, slash name of endpoint, or whatnot, those are now passed as named arguments, and those are the only things that are passed as named arguments, not some of the other parameters, like query parameters or parts of the body of the response that you would have to tweak. Now it's just those path parameters. There is a separate argument called body that's gonna let you have different slots of things to modify in the response that you're returning out. There is a lot more under the hood here in the types of objects such as new objects for both the request and the response.
And they are now explicitly called both request and response. And they're gonna they're gonna really, you know, make things a lot more streamlined there. But I think the key part here is that they are looking for feedback. There is a boatload of existing documentation out there, but they wanna make sure users both that are new to plumber itself as well as those that are coming from the first generation of plumber. They're able to give this a whirl and give them feedback because they are at the stage where they wanna they don't wanna lock anything down yet. They wanna make sure that if there is a better way to word something, a better way to have a function parameter, that this is the time to get in touch with them. So I have looked at the GitHub repo for plumber two. There is a a lot of nice dialogue already on issues on maybe things that soon need to be ported from the first plumber, but this is a a great chance again to have an impact on where plumber two takes you. And, again, we'll have a link to the the package down site with a lot more documentation, where, plumber two is going and the new API, bad pun intended, the new API Plumber two itself as compared to the first generation of Plumber. But as I look through the site, there's lots of great articles on takes on hosting, on how you render output, and like I said, the migration from the first plumber.
But it does look like there's been a lot of thought put into this. Not too dissimilar that I'd imagine many years ago when Hadley Wickham was trying to decide, do I keep building on the original g g plot? It's time for g g plot two instead. It seems like something around those lines. Again, early days. We'll see what happens. But I'm excited to try plumber two out. What do you think, Mike?
[00:23:27] Mike Thomas:
Yeah. Me too. I think that there's some really, really interesting improvements here. You know, I know you touched on quite a few of them, you know, the the parsing blocks themselves because, you know, Plumber and, you know, Plumber two as well, it's a it's a unique RoXygen syntax compared to what you might be used to if you're authoring sort of a regular r package and leveraging RoXygen two documentation. Right? The syntax or or what you stick in these tags and how you author this documentation on top of your API function drives, you know, how it works, which is is pretty interesting and and quite different, right, than just typically how we oxygenize a function in our r package.
So I think it's really interesting the way that they were able to migrate there. I'm really, impressed by the level of documentation that they already have given that this is so early in its development. There's 10 different articles as you you referenced that span from, you know, just routing and input and, runtime and hosting discussions across all sorts of different services, including, you know, Pasa Connect, DigitalOcean, Docker basic and advanced usage. There's discussions on security, great vignette on migrating, as you mentioned, from plumber o g to now plumber two. I thought one additional interesting thing that's sort of at the root of the package downside is that there is a new async tag, I believe, that allows you to convert your handler into an async handler automatically.
I don't know if that leverages, you know, future and and promises and how exactly that works, if there's additional dependencies that get introduced. But it seems like they're trying to make it easier to build APIs that can return responses asynchronously, which is really cool as well for larger workloads that folks might be faced with. So I'm excited to see how this package continues to progress. You know, I would imagine with the amount of effort that's clearly already been put into it that this is the direction that the folks at Posit are looking to go with, you know, Plumber as a concept itself.
So I'm certainly excited to see how this progresses. I know that there are some other, libraries and packages out there that are a little bit more legacy that try to do the same thing, allow you to, create an R based API service. And I imagine that, you know, Posit probably looked over sort of the entire ecosystem of those packages as well as plumber plumber one to try to come up with, you you know, what's the best possible way that we can author an API based, R package. So excited to see how this progresses. I'm sure that this is the result, like you mentioned, of a a lot of lessons learned and, you know, appreciate the effort here in in trying to build something that's going to be easier for us, our developers, to stand up API services.
[00:26:29] Eric Nantz:
Yeah. I'm glad you called out async. That was something that flew under my radar. And as I'm digging into this further, it does let you have two different options for the back end of that asynchronous operation. One of which, as you correctly guessed, is the future package. There is a future async method, but there's another one. Is that what I'm thinking? It is what you're thinking. It is from Mirai, the Mirai async offered by Charlie Gao, who we heard from the shiny comp actually. One of his excellent presentations on how Mirai is is supercharging async and shiny itself. So that seems to be some fruits of flavors there with some recent synergies. But this could be another case where on top of that, you know, implementation, I think the community may have had an influence on this too because I remember hearing about a package called Fawcett, authored by, a former Absalon engineer, that was also letting you leverage plumber with containers to do async as well. And I think all that's kinda converging, and I think that I I think just that need has spit has spoken volumes to make sure that if you're gonna use this as scale, I mean, you and I know we can use r in production. We do it every single day in our respective our daily work lives and then elsewhere.
You you don't want any excuses being thrown at you of, like, yeah. Well, but if you did that thing in r, you're not gonna be able to scale to all these thousands of requests every minute or whatnot. You can now. So I think with Plumber too, I think that's another way of pause and recognizing, you know what? We're gonna make sure there's no excuse left at the table for running this at scale. And then our last highlight today, I admit, as a parent, it's really difficult to get my kids to do the the things around the house that, you know, would make my life easier. I mean, I'm the one that does the dishes every night. I'm okay to do that. That sure would be nice to have a little help around. Like, you know, just clean the table a little bit or, you know, just pick up after yourself a little bit. Things that my wife and I literally joked even last night, when in the world we're gonna have robots do some of this stuff. And we know in the future's not off. Right?
You might have some of these things for your, you know, our development as well, especially as you're filling out, like, boiler plate for, like, your package structure or just trying to get an 80% of the way to something, but you know you gotta type it in manually to do it and whatnot. Well, in the in the vast expanding, landscape of AI development and integrations with data science, our last highlight is, again, one of those situations where as a package author and our developer, there are ways you can help, you know, get a lot farther, a lot quicker with a lot of these manual tasks you might call chores because they end up feeling like chores. Well, that is an apropos description of our last highlight here, which is the new r package offer by posit called chores.
And this is, blog post. The introduction to this is authored by Simon Couch who we featured on previous highlights on his expirations with the Elmer package, which is causing a lot of positive momentum in the art community for interfacing both public available LLMs via these host of services as well as self hosted services. And the ecosystem that seems to be spinning on this. So chores is actually, again, a kind of a new generation of a previous attempt at this called Pals, which is a way for you to leverage as, say, a package developer, ways to help you get to the finish line more quickly on on, you know, the more routine tasks that you have to do.
Such as you're writing a new function for your package, you're writing the function itself, you got some nice parameters, you've got, you know, you got your body of the function all set, then you realize, oh, yeah. I gotta document the thing. So what path what chores will let you do is you will be able to highlight that that function syntax, call up a little add in, and select the type of helper you want. In this case, you would do the helper for r oxygen. You're just talking about in the plumber too, how that uses r oxygen type syntax to call its parameters. You can highlight that text.
If you're a function body, run this add in. So a little keyboard shortcut to run that, press enter, and then the r oxygen documents are gonna stream right into your your current r script. And will it get you a % of the way there? Well, let's face it. Probably not. You're gonna have to fill in more details, especially around the context of your parameters. But just if you have, like, five or 10 of these, obviously, that's gonna save you some time and get you there. And it's gonna try and guess the type of parameter in that, which can be, again, quite helpful.
Now under the hood, how does all this work? This is an interesting approach, but I'm starting to see why they're doing it this way. There is, in the chores package infrastructure, a directory of markdown files, which are, in essence, the instructions that the LLM is being given for these various tasks. We just talked about the documentation tags of our oxygen. There are a couple others as well, such as helping bootstrap, testing framework, as well as perhaps even helping with a CLI conversion, converting some previous tax you might have done in, say, another package to the new CLI syntax. So it comes with those three helpers, but in essence, that markdown file is being parsed and supplied to the LOM every time you run this add in to give it the additional context in place.
They have set this up in such a way that if you like that framework and it's working well for you, you could extend this to any type of task that you like. Chores is just kind of like a a reference type of solution to this, but that's got me intrigued by what other ways could you leverage this paradigm. And at the end of the post, Simon calls out some other, you know, packages in the community that I've been building upon Elmer that kinda have their own take on this. One of which that definitely caught my attention for a potential time waster, I e I need a break from my r code, is this package called Krios, which lets you turn r into a turn based adventure game with characters and other steps along the way. The l m's kinda gotta be the moderator of this game that you play. So that, again, this whole paradigm seems to be leading to similar directions. So chores looks like a great start too, as an r developer, helping automate at least parts of these manual tasks so that you can get to that correct answer. Maybe not correct answer, but that finished product more quickly.
We always throw the caveats. Right? Look at these before you sign off on it, all that. You'd probably sick of me saying it by now, but I come from an industry where I have to say it. So we wanna make sure y'all are aware of the caveats, but I am intrigued by this. And I'm I'm gonna give this a whirl next time I write in our package. If you're gonna use this, please use version control.
[00:34:24] Mike Thomas:
I think we take that for granted, but I could not imagine, utilizing something like chores, which is going to alter your code, right, without so please make sure that you're using version control when you use this. But, yes, it is it is absolutely awesome. And even for the AI, the sometimes AI denialists like myself and perhaps like yourself at times, Eric, I think we can probably all agree that things like, you know, roxygen documentation certainly do feel like a chore. And sometimes it doesn't exist because it feels like like a chore and it gets left behind. It because, you know, priorities and, timelines and deadlines and things like that, hinder our ability to, you know, write good documentation.
So I would say that even if it's generated by an LLM, that's probably better than not having any documentation at all for your function. And ideally, right, the the the real concept here is that the LLM will generate that documentation and you'll it'll save you a whole lot of time from, you know, some of the the boiler plate that comes back, and you might be able to edit it a little bit to make it more perfect. Right? But it'll still save you maybe 80 to 90% of the work. And maybe some of just the mental work of actually scaffolding out the roxgen on top of your your function, which if you're just starting with a blank cursor, can feel perhaps a little daunting.
I know we have some keyboard shortcuts in our studio that that help us do that, which have been fantastic. But I think this can be another way to facilitate that process and and expedite the ability for us to, document our functions. And there's a really nice gallery of, these different utilities from the chores package besides just, perhaps the three that are in the video and the blog post, which are convert error in code to use CLI, which I think is really cool because I love the CLI package. Convert your unit test to migrate to test that, third edition.
And then template function documentation with roxygen, which is the one that we've been talking about. But there are also four others. One is for migrating to quarto style chunk headers. So that's the the pound sign with the vertical pipe after it as opposed to having those particular chunk headers, you know, within the the curly braces in the old r markdown style formatting. There's the ability to format news files. That one was authored by Hadley Wickham. There's one for adding or modifying reveal. Js SCSS theming, which is fantastic, especially for perhaps others like me who really don't know much about SCSS theming, but would love to beautify our reveal JS slide decks. And then there's a a ggplot two assistant as well. So a really nice gallery here in the packaged down site for chores. And, yeah, I I think it's a fantastic resource that, Posit has put together because I I do feel like they're taking a targeted approach to bringing AI into workflows in really constructive ways for us data scientists out there. So I appreciate all the work that's been done on this by Simon Couch and and all the other folks at Pawsit who've contributed.
[00:37:41] Eric Nantz:
Oh goodness. I coulda used that reveal JSSCSS one a week ago when I was putting together my slides for a shiny cup, and was filming my way through it. So I will be taking note of this for sure. But this is this is really intriguing part to me, right, is this community aspect of sharing these additional helpers that are out there. And so on top of this great gallery that you you mentioned, Mike, I'm gonna also link to the vignette on building these custom helpers because I that is a potential to take this, you know, in many, many different directions. Yeah. That's a that's a good preview of what's possible, but I could see even if it stays within your respective firewall, if this is gonna help you do a proprietary automation in your company, having this, you know, within your organization, this set of helpers out there. I'm oh, boy. I I I see lots of lots of potential here. So the the sky's the limit as they say.
And and like you, version control, if you're not using Aphrodis, oh, you're probably gonna pay for it. I can just tell you that much, and I think Simon would tell you the exact same thing. So nothing bad will happen to you if you version control. Even though it may seem tedious at first, I had a situation at the day job where I put in a new thing by accidentally uploaded or tried to upload a hundred megabyte or more dataset in GitHub, and it didn't like that. Yeah. That says, oh, that's too big. You gotta wipe that outside. I'll go clean my history and then cherry pick commits that were without that. That was a fun afternoon. But if I didn't have Git, I would have been absolutely hosed without that. So don't put yourself in those situations. Use Git, and then that way, you can commit it when it looks good. So we shall see.
[00:39:35] Mike Thomas:
Absolutely. Yeah. And as you mentioned, these like we like to say, these prompts that you can create yourself, these templates,
[00:39:42] Eric Nantz:
all marked down all the time. It is. It is. If you can speak markdown, you can speak the language of these helpers as well as what's built with our weekly itself. So you set that up, and I knocked that out. My goal of our weekly is built with markdown because everything is transparent. We wanna make it as easy as possible for all of you that contribute to these issues. We're running a bit well on time, so we probably won't get into a huge amount of of additional fines here. But I will give a shout out to, Bruno Rodriguez and Philip Bowman for giving me excellent material to talk about at the recent shiny comp. You know, my presentation was called in the nicks of time, a new approach to shiny development with nicks and ricks.
It was a bit too much for twenty minutes. I do have that one regret, but, hopefully, when that recording comes out, you'll enjoy it. But thanks to them for putting Rix out there because I I it's definitely inspired me, and I've got a lot more to say about it as I push this in many different directions. I even saw something with Plumber too I could do with Nicks that I'm really intrigued about that I may, touch on in a future episode. But, nonetheless, there's a lot more to this issue, so we invite you to check it out at rwicked.0rg. And put that in your bookmarks if you haven't already.
And as always, you can also get in touch with us on social media. I am at [email protected] blue sky. I am at [email protected]
[00:41:12] Mike Thomas:
for your Mastodon lovers out there. And I'm on LinkedIn. You can search my name, and you'll find me there. And, Mike, where can the listeners find you? You can find me on blue sky at mike dash thomas dot b s k y dot social or on LinkedIn if you search Ketchbrooke Analytics, k e t c h b r o o k. You can see what I'm up to.
[00:41:33] Eric Nantz:
Absolutely. Always love and follow what you're up to there. And as always, we thank you so much for listening wherever you are. We'd love to hear from you. If you like us to cover some additional things besides the issues, we're always happy to hear your feedback. But that's gonna put a bow on episode 202 of our weekly highlights, and we will be back with another edition of our weekly highlights next week.
Hello, friends. We are back at episode 202 of the Our Weekly Highlights podcast. This is The Weekly Show where we talk about the excellent highlights that have been shared on this week's our weekly issue at ourweekly.0rg. My name is Eric Nance, and I'm delighted you joined us wherever you are around the world. And joining me virtually, as always, is my awesome cohost, Mike Thomas. Mike, how are you doing today? Doing great, Eric. Coming off the back of Shiny Conf recently. So it's a a fun time to be, you know, a part of the art community and a lot of exciting things to be looking forward to and talking about. You bet. I felt like I was, definitely drinking from the fire hose those past, last week with Shiny Conf. I did a lot of new things to talk about, and I'll talk about my adventures on that as we get towards the end of the show. But lots of lots of great happenings there, and it goes too quickly. I like all these virtual conferences do. They do, especially when the content is hot and really, really innovative like we saw last week. So certainly, if I don't say already, congratulations to the fine folks at Absolon for running that conference right now. I believe it's the fourth year in its existence, and it went off without a hitch and really, really well done, everybody.
It's no small feat. It it sure is. And I know from organize helping organize the Our Farmer Conference, there is never a dull moment behind the scenes. And at the end, you're kinda like, oh, I can breathe again. So I'm sure they're getting some well deserved rest after that one. But we're not resting here. We're talking about our our current issue. It is, been curated by old check notes. Oh, yeah. Yours truly was a real hustle on because right after my presentation at Shining Comp, I threw this issue together and somehow made it in one piece. So as hopefully, it's a good one. We will find out. But as always, I had tremendous help from our fellow our rookie team members. They They always keep me honest and really straight to the point, as well as our cure as our contributors like all of you around the road of your poll requests and other great suggestions. And it was a pretty clear, quote unquote, winner, so to speak, and who would lead off this section because it's not every day or every week that we get to to talk about a new release in the R language itself.
And what are we talking about? Well, recently, our version four dot five dot o has hit the crayon sources out online, and this code this release is code name, how about a 26. Now you may be wondering what in the world is that all about. So fun fact for those who may not know their R history as well, and I didn't either for a while, all the code names for each R release do have origins with the famous Peanuts comics, I e Charlie Brown and their famous characters. And usually, when I see a code release, I can kind of remember, oh, yeah. I remember reading that script or I remember that from the old Charlie Brown movies. This one, however, I was like, what is that one all about? So yesterday did a little digging last night because it was a a geeky moment. I'm like, I gotta figure this out. What is this all about? So turns out one of the characters named Lucy, who tend to tease Charlie quite a bit, She kinda ran her own, you might call a makeshift psychologist or psychiatry booth where she would charge, I believe, 5¢ for a consultation.
And then Charlie Brown came to her one day and asked for some advice, and she out of boots says, well, how about 26¢? So I don't know what happened after that, but that's where the 26 comes from. The more you know. Very cool. Thank you for that. If I'm useful for one thing, it's the Charlie Brown trivia.
[00:03:45] Mike Thomas:
I remember Lucy's, yes, psychologist or psych psychiatrist booth very fondly, but I didn't remember the 26.
[00:03:54] Eric Nantz:
Yeah. Neither did I until the little of sleuthing last night. So, again, credit to the hardcore team for always finding a new one, the the spring upon us at each of these releases. So let's talk about what's in this release. And first of all, how this was put together. This is an excellent post that comes basically after every release from our friends at Jumping Rivers. And I the author this time is Russ Hyde, who is one of the data scientists at Jumping Rivers, and he's done a fantastic job summarizing a lot of the key points in this release. And we'll go through a few of the ones that caught our attention.
I was, telling Mike before the show that, it was this past weekend. It was the end of my kids spring break, and I ended up taking them to a a zoo over a couple hours away in Cincinnati. My youngest one, his favorite animal is not the one you might expect. It's not like the tigers or the gorillas or anything. It's penguins. He's a penguin fan. Guess what? I'm gonna try to get him to use Linux later, but that's another story. But speaking of penguins here, guess what? In our version four dot five, the Palmer penguins dataset that's made a lot of positive, headlines in the last couple years is now included in base r. This is massive achievement for that team that put this out there.
And the origins of penguins, we don't have time to get into it today, but, nonetheless, one of the motivations was to find a relatable data source that could maybe in the future serve as quote, unquote, the new iris or the new set that you could use for examples of, say, statistical inference, classification, roles that the iris dataset did play. And for all those, you know, textbook examples, examples you find online, the penguins dataset has a lot of interesting features. And now, like I said, it is available in Besar itself. And so I'm really excited for that, and congratulations, for getting that into Besar itself.
So that caught my attention. This other one is another case where you might say other computing languages tend to have an influence in r from time to time. We all know its origins from the s language and, of course, it's, you know, tie ins with c and Fortran and whatnot. This influence, I think, comes from a certain language that might have a snake as a mascot because we are now talking about the use function. This is brand new to r. Albeit, it was quite re released in version four dot four, but I did not get radar of it until now. What does this mean? Well, if you are coming from the world of Python, you may be used to loading your modules or packages with a couple different approaches. You might do the import function, such as, like, import NumPy if you wanna use that, Or you might only want one specific function from that module, and you might say from NumPy import, say, the array function.
In that way, you've only taken what you needed. In r, historically, the way we've done this is that you would do the name spacing trick. Not so much trick. It's a it's a feature. You put the name of the package, colon colon, the name of the function, if you wanna use it in a quote unquote one off setting. That works I get to my muscle memory for years. I I do this a lot, especially when I only need that function once or twice in my overall function. But now with this use function, you can now call the function use, put in the name of the package, and then the next argument is one or more of the functions you want inside, which again will now modify the search path that R uses as it's trying to figure out what are you referencing when you call that function as an alternative to the namespace prefix and as an alternative just doing the library statement on the package itself.
Now, again, I I pride myself on being up to date with this, but this did come out of left field as I would say. But I think for those making the transition to r, this is probably something that many of them were wondering why wasn't something like this out there. So another fun fact is that there have been other packages in the art community that have exposed this kind of functionality. One of which I know from my exploration, especially with the Rhino, framework from Absalon, is the box package. That has been basically replicating this for a while, and you get more control over that than you do even with this use function where you could use this box package to import, say, functions from an arbitrary r script, not just a package. So you do get a little more control there for your needs. But I do find it interesting that the influence of another language has now landed into bazar, and I guess time will tell just how much this is gonna be used in the wild. So I think that that one definitely caught my attention for the future.
And then the last one that caught my attention, especially someone that's kinda, you might say, greedy whenever I install a new package and ends up having a bunch of dependencies. I just wanna get it done quickly. Right? We've seen approaches in the art community, namely the pack, you know, framework offered by posit to help, you know, give you a little more modern way of installing packages using parallel downloads and curl and whatnot. Well, as of our version four dot five dot o, the install dot packages function now lets you download functions and update packages in parallel.
That can be a huge time saver, folks. Like I said, especially if you're installing, you might say, something from the tidy verse or, or another, you know, string processing package and you got it to pull down five, ten, sometimes 15 dependencies, but, you know, how far the rabbit hole lies, this could, you know, may give you a bit of time savings. So I'm I'm I'm I'm happy to have that now land in the base tower itself without you having to do a lot of tricks to make that happen. There is a lot more to this release, and we'll definitely link in the in the show notes to the full post from Russ here as well as the full change log, which has its full assortment of bug fixes, offer new functions, and offer, you know, great developments in this release.
So, Mike, what caught your eye on our version four dot five here?
[00:10:57] Mike Thomas:
You know, a lot caught my eye. It's very exciting to have that palmer penguins package, you know, built in to ours that we don't necessarily need the external package. Although, just a word of warning, it's not a perfect one to one if you just wanna pick up, you know, the base dataset that we have the base R dataset that we have now in your existing scripts that leverage the palmer penguins package previously, some of the column names, I think, are slightly different. So, unfortunately, we love open source. There is another new package that just came out called BasePenguins, and it's authored by Ella Kaye, Heather Turner, and Akeem Zellas. And it allows you to easily convert your script between, references to the quote unquote old Palmer penguins package and leveraging the new palmer penguins dataset that is built into our four dot five dot o. So thank you to the three of them for authoring that package to make our lives easier as we try to convert, to leveraging the new the new built in dataset, which is awesome. Yeah. They use, the use function is really, really interesting to me. I almost can't believe, if you think about all of the function names that exist or namespaces that exist in base r that use was not, you know, previously used. No pun intended.
I guess they were reserving it just for this particular use case, which is which is pretty awesome, very Pythonic. As you mentioned, It looks like based upon some chatter that I've seen on Blue Sky, you know, one word of caution is you can't, have two separate lines that are importing different functions from the same package. Like, you can't have one line that says, you know, use the arrange function from dplyr and then another line that says use the filter function from dplyr. You would actually have to, supply sort of a character vector that says from dplyr, you know, essentially use a range and filter at the same time. Unfortunately, you can't do that downstream the way that you can in Python. So a couple of things to be careful of as you begin to, you know, hopefully try out and experiment this new use function. And then the last thing, you know, that really caught my eye beyond the parallel downloads, which is absolutely awesome, is a new function called grep v. So for any of anyone else, perhaps like myself out there who has always struggled to remember whether we need to use grep or grepo, and grep returns the position and grepo returns a true false, I believe.
And all you want is the actual values that get matched. The new grep v function does exactly that. It's what you've always wanted grep and grapple to do and what you've probably used string r to do. But now we have a a nice base function called grep v that can just you can supply a pattern to, your first argument would be the the strings and then your second argument would be, the pattern. Actually, excuse me. I think I got that backwards because it's base r. The second argument is the string and the first argument is the pattern. But it will return just the matches. The the perfect string matches, not the positions, not a logical, you know, vector of true falses, it'll return exactly what you want. So I'm super excited to have that now in base r for those situations where I need to do some string matching and, you know, it's just a one off use case where I don't necessarily want to, you know, install the entire string r library and try to stick to base r here. It's very very helpful. So I'm excited about that one as well. Yeah. And Russ also concludes the post that
[00:14:41] Eric Nantz:
a lot of the other features and bug fixes that are are called out in in the release notes are also stemming from really successful r dev day events that have been held after, say, various conferences or other, meetup settings. This is a wonderful way that we're seeing those newer to the community, newer to contributions to base are really starting to make a real impact on the language itself. And I think that's only gonna speak volumes to the success and the and the future life of our itself, bringing bringing contributors from all backgrounds, all experience levels to help with the project itself. So really excited to see all that. And I'm not sure of the time this recording of the binary versions of R have landed yet for, say, Windows, Linux, Mac, and whatnot.
But you do have ways of trying this out yourself without messing up your system, so to speak, or or putting into a bind, one of which is that you can use containers of Docker. They'll pull down a new image that has the latest r release from source already built in. You can also utilize the rig utility offered by Gabor Sarty that lets you install our development versions on r 4 5 alongside your r installations. And because I couldn't resist saying this, if you use the RIX package offered by Bruno Rodriguez, RIX now lets you put an r four dot five in your your environment there. So you may hear more about that a bit later. Nonetheless, you've got ways of trying this out. So, yeah, we encourage you to try it out today and and definitely give it give it a good whirl and enjoy those new penguins and all those other great features.
So in our next highlight, it's not every day that we get to talk about one of the more important frameworks that both Mike and I have been utilizing for years and years in our intersections of leveraging R with building custom APIs for our R based services or or analyses. And it's an interesting situation where you can see in the life cycle of a package, there are often two paths to take as new features are requested and maybe infrastructure needs updating. Do you keep building upon what's already there, or do you take that other fork in the road and kind of start from scratch?
Well, this next highlight is kind of that second route here because we are now talking about the plumber two package. Note the two. If you're not aware, there has been a package called plumber offered by Barish Slurkey over at Posit, and it was originally offered by Jeff Allen who was at Posit beforehand. And that's been my go to package for making R become an API. Whether I was doing a statistical output, like analysis, or doing some other utility, R was my way to make an API that then any language, no matter R, Python, JavaScript, whatever you throw at it, if it could compile if it could call an API, it could I could use Plumber to make that API.
Well, now we have plumber two that has hit the GitHub, you know, development, over at Pazza. And this one is authored by Thomas Lynn Peterson, who you might know as the one of the the wizards and maintainers of g g plot two along with many visualization packages. But Thomas has also been pushing the envelope a lot of web based request packaging and API packaging because he has authored in the past a package called Fiery, which was kind of like an alternative take on both, you know, API development and Shiny itself. So he's definitely looked at this mode before.
But there was a recent, I believe, you know, blue sky post or a mastodon post from Thomas asking for feedback on this new Plumber two package. So it's a great time to talk about it and spread the word about it. So what is different about plumber two as opposed to the first plumber? Well, even in the outset of the package site introduction, this is one of those cases where plumber two was born on kind of writing some of the things that they found inefficient from the previous plumber development. And it sounds like it was just easier to kind of start this from scratch instead of trying to extend the existing plumber code base to fix all these holes. And he mentions that there are a few breaking changes if you're coming from the first plumber generation over here as part of this infrastructure improvement.
So we will have a link in the show notes to the the the full, packaged down site, and there is a great article if you want us try plumber two, what you need to do to upgrade from plumber one because that's kind of where I'm coming from on this since I've been using plumber for years and years. First of which is the function itself changes from p r to API, which I guess in retrospect does make more sense. Right? But it sounds like p r was kinda harder to remember, and it was meant to be an acronym for our plumber route. But Thomas says in this documentation that when you build an API, it's much more than just a route. It can be a lot of things under the hood. So they think the API, function name is going to be a lot more easier to remember for the majority of users.
And there are other key changes, one of which is now if you have an argument for your path and your query parameter, if you do, like, slash something, slash name of endpoint, or whatnot, those are now passed as named arguments, and those are the only things that are passed as named arguments, not some of the other parameters, like query parameters or parts of the body of the response that you would have to tweak. Now it's just those path parameters. There is a separate argument called body that's gonna let you have different slots of things to modify in the response that you're returning out. There is a lot more under the hood here in the types of objects such as new objects for both the request and the response.
And they are now explicitly called both request and response. And they're gonna they're gonna really, you know, make things a lot more streamlined there. But I think the key part here is that they are looking for feedback. There is a boatload of existing documentation out there, but they wanna make sure users both that are new to plumber itself as well as those that are coming from the first generation of plumber. They're able to give this a whirl and give them feedback because they are at the stage where they wanna they don't wanna lock anything down yet. They wanna make sure that if there is a better way to word something, a better way to have a function parameter, that this is the time to get in touch with them. So I have looked at the GitHub repo for plumber two. There is a a lot of nice dialogue already on issues on maybe things that soon need to be ported from the first plumber, but this is a a great chance again to have an impact on where plumber two takes you. And, again, we'll have a link to the the package down site with a lot more documentation, where, plumber two is going and the new API, bad pun intended, the new API Plumber two itself as compared to the first generation of Plumber. But as I look through the site, there's lots of great articles on takes on hosting, on how you render output, and like I said, the migration from the first plumber.
But it does look like there's been a lot of thought put into this. Not too dissimilar that I'd imagine many years ago when Hadley Wickham was trying to decide, do I keep building on the original g g plot? It's time for g g plot two instead. It seems like something around those lines. Again, early days. We'll see what happens. But I'm excited to try plumber two out. What do you think, Mike?
[00:23:27] Mike Thomas:
Yeah. Me too. I think that there's some really, really interesting improvements here. You know, I know you touched on quite a few of them, you know, the the parsing blocks themselves because, you know, Plumber and, you know, Plumber two as well, it's a it's a unique RoXygen syntax compared to what you might be used to if you're authoring sort of a regular r package and leveraging RoXygen two documentation. Right? The syntax or or what you stick in these tags and how you author this documentation on top of your API function drives, you know, how it works, which is is pretty interesting and and quite different, right, than just typically how we oxygenize a function in our r package.
So I think it's really interesting the way that they were able to migrate there. I'm really, impressed by the level of documentation that they already have given that this is so early in its development. There's 10 different articles as you you referenced that span from, you know, just routing and input and, runtime and hosting discussions across all sorts of different services, including, you know, Pasa Connect, DigitalOcean, Docker basic and advanced usage. There's discussions on security, great vignette on migrating, as you mentioned, from plumber o g to now plumber two. I thought one additional interesting thing that's sort of at the root of the package downside is that there is a new async tag, I believe, that allows you to convert your handler into an async handler automatically.
I don't know if that leverages, you know, future and and promises and how exactly that works, if there's additional dependencies that get introduced. But it seems like they're trying to make it easier to build APIs that can return responses asynchronously, which is really cool as well for larger workloads that folks might be faced with. So I'm excited to see how this package continues to progress. You know, I would imagine with the amount of effort that's clearly already been put into it that this is the direction that the folks at Posit are looking to go with, you know, Plumber as a concept itself.
So I'm certainly excited to see how this progresses. I know that there are some other, libraries and packages out there that are a little bit more legacy that try to do the same thing, allow you to, create an R based API service. And I imagine that, you know, Posit probably looked over sort of the entire ecosystem of those packages as well as plumber plumber one to try to come up with, you you know, what's the best possible way that we can author an API based, R package. So excited to see how this progresses. I'm sure that this is the result, like you mentioned, of a a lot of lessons learned and, you know, appreciate the effort here in in trying to build something that's going to be easier for us, our developers, to stand up API services.
[00:26:29] Eric Nantz:
Yeah. I'm glad you called out async. That was something that flew under my radar. And as I'm digging into this further, it does let you have two different options for the back end of that asynchronous operation. One of which, as you correctly guessed, is the future package. There is a future async method, but there's another one. Is that what I'm thinking? It is what you're thinking. It is from Mirai, the Mirai async offered by Charlie Gao, who we heard from the shiny comp actually. One of his excellent presentations on how Mirai is is supercharging async and shiny itself. So that seems to be some fruits of flavors there with some recent synergies. But this could be another case where on top of that, you know, implementation, I think the community may have had an influence on this too because I remember hearing about a package called Fawcett, authored by, a former Absalon engineer, that was also letting you leverage plumber with containers to do async as well. And I think all that's kinda converging, and I think that I I think just that need has spit has spoken volumes to make sure that if you're gonna use this as scale, I mean, you and I know we can use r in production. We do it every single day in our respective our daily work lives and then elsewhere.
You you don't want any excuses being thrown at you of, like, yeah. Well, but if you did that thing in r, you're not gonna be able to scale to all these thousands of requests every minute or whatnot. You can now. So I think with Plumber too, I think that's another way of pause and recognizing, you know what? We're gonna make sure there's no excuse left at the table for running this at scale. And then our last highlight today, I admit, as a parent, it's really difficult to get my kids to do the the things around the house that, you know, would make my life easier. I mean, I'm the one that does the dishes every night. I'm okay to do that. That sure would be nice to have a little help around. Like, you know, just clean the table a little bit or, you know, just pick up after yourself a little bit. Things that my wife and I literally joked even last night, when in the world we're gonna have robots do some of this stuff. And we know in the future's not off. Right?
You might have some of these things for your, you know, our development as well, especially as you're filling out, like, boiler plate for, like, your package structure or just trying to get an 80% of the way to something, but you know you gotta type it in manually to do it and whatnot. Well, in the in the vast expanding, landscape of AI development and integrations with data science, our last highlight is, again, one of those situations where as a package author and our developer, there are ways you can help, you know, get a lot farther, a lot quicker with a lot of these manual tasks you might call chores because they end up feeling like chores. Well, that is an apropos description of our last highlight here, which is the new r package offer by posit called chores.
And this is, blog post. The introduction to this is authored by Simon Couch who we featured on previous highlights on his expirations with the Elmer package, which is causing a lot of positive momentum in the art community for interfacing both public available LLMs via these host of services as well as self hosted services. And the ecosystem that seems to be spinning on this. So chores is actually, again, a kind of a new generation of a previous attempt at this called Pals, which is a way for you to leverage as, say, a package developer, ways to help you get to the finish line more quickly on on, you know, the more routine tasks that you have to do.
Such as you're writing a new function for your package, you're writing the function itself, you got some nice parameters, you've got, you know, you got your body of the function all set, then you realize, oh, yeah. I gotta document the thing. So what path what chores will let you do is you will be able to highlight that that function syntax, call up a little add in, and select the type of helper you want. In this case, you would do the helper for r oxygen. You're just talking about in the plumber too, how that uses r oxygen type syntax to call its parameters. You can highlight that text.
If you're a function body, run this add in. So a little keyboard shortcut to run that, press enter, and then the r oxygen documents are gonna stream right into your your current r script. And will it get you a % of the way there? Well, let's face it. Probably not. You're gonna have to fill in more details, especially around the context of your parameters. But just if you have, like, five or 10 of these, obviously, that's gonna save you some time and get you there. And it's gonna try and guess the type of parameter in that, which can be, again, quite helpful.
Now under the hood, how does all this work? This is an interesting approach, but I'm starting to see why they're doing it this way. There is, in the chores package infrastructure, a directory of markdown files, which are, in essence, the instructions that the LLM is being given for these various tasks. We just talked about the documentation tags of our oxygen. There are a couple others as well, such as helping bootstrap, testing framework, as well as perhaps even helping with a CLI conversion, converting some previous tax you might have done in, say, another package to the new CLI syntax. So it comes with those three helpers, but in essence, that markdown file is being parsed and supplied to the LOM every time you run this add in to give it the additional context in place.
They have set this up in such a way that if you like that framework and it's working well for you, you could extend this to any type of task that you like. Chores is just kind of like a a reference type of solution to this, but that's got me intrigued by what other ways could you leverage this paradigm. And at the end of the post, Simon calls out some other, you know, packages in the community that I've been building upon Elmer that kinda have their own take on this. One of which that definitely caught my attention for a potential time waster, I e I need a break from my r code, is this package called Krios, which lets you turn r into a turn based adventure game with characters and other steps along the way. The l m's kinda gotta be the moderator of this game that you play. So that, again, this whole paradigm seems to be leading to similar directions. So chores looks like a great start too, as an r developer, helping automate at least parts of these manual tasks so that you can get to that correct answer. Maybe not correct answer, but that finished product more quickly.
We always throw the caveats. Right? Look at these before you sign off on it, all that. You'd probably sick of me saying it by now, but I come from an industry where I have to say it. So we wanna make sure y'all are aware of the caveats, but I am intrigued by this. And I'm I'm gonna give this a whirl next time I write in our package. If you're gonna use this, please use version control.
[00:34:24] Mike Thomas:
I think we take that for granted, but I could not imagine, utilizing something like chores, which is going to alter your code, right, without so please make sure that you're using version control when you use this. But, yes, it is it is absolutely awesome. And even for the AI, the sometimes AI denialists like myself and perhaps like yourself at times, Eric, I think we can probably all agree that things like, you know, roxygen documentation certainly do feel like a chore. And sometimes it doesn't exist because it feels like like a chore and it gets left behind. It because, you know, priorities and, timelines and deadlines and things like that, hinder our ability to, you know, write good documentation.
So I would say that even if it's generated by an LLM, that's probably better than not having any documentation at all for your function. And ideally, right, the the the real concept here is that the LLM will generate that documentation and you'll it'll save you a whole lot of time from, you know, some of the the boiler plate that comes back, and you might be able to edit it a little bit to make it more perfect. Right? But it'll still save you maybe 80 to 90% of the work. And maybe some of just the mental work of actually scaffolding out the roxgen on top of your your function, which if you're just starting with a blank cursor, can feel perhaps a little daunting.
I know we have some keyboard shortcuts in our studio that that help us do that, which have been fantastic. But I think this can be another way to facilitate that process and and expedite the ability for us to, document our functions. And there's a really nice gallery of, these different utilities from the chores package besides just, perhaps the three that are in the video and the blog post, which are convert error in code to use CLI, which I think is really cool because I love the CLI package. Convert your unit test to migrate to test that, third edition.
And then template function documentation with roxygen, which is the one that we've been talking about. But there are also four others. One is for migrating to quarto style chunk headers. So that's the the pound sign with the vertical pipe after it as opposed to having those particular chunk headers, you know, within the the curly braces in the old r markdown style formatting. There's the ability to format news files. That one was authored by Hadley Wickham. There's one for adding or modifying reveal. Js SCSS theming, which is fantastic, especially for perhaps others like me who really don't know much about SCSS theming, but would love to beautify our reveal JS slide decks. And then there's a a ggplot two assistant as well. So a really nice gallery here in the packaged down site for chores. And, yeah, I I think it's a fantastic resource that, Posit has put together because I I do feel like they're taking a targeted approach to bringing AI into workflows in really constructive ways for us data scientists out there. So I appreciate all the work that's been done on this by Simon Couch and and all the other folks at Pawsit who've contributed.
[00:37:41] Eric Nantz:
Oh goodness. I coulda used that reveal JSSCSS one a week ago when I was putting together my slides for a shiny cup, and was filming my way through it. So I will be taking note of this for sure. But this is this is really intriguing part to me, right, is this community aspect of sharing these additional helpers that are out there. And so on top of this great gallery that you you mentioned, Mike, I'm gonna also link to the vignette on building these custom helpers because I that is a potential to take this, you know, in many, many different directions. Yeah. That's a that's a good preview of what's possible, but I could see even if it stays within your respective firewall, if this is gonna help you do a proprietary automation in your company, having this, you know, within your organization, this set of helpers out there. I'm oh, boy. I I I see lots of lots of potential here. So the the sky's the limit as they say.
And and like you, version control, if you're not using Aphrodis, oh, you're probably gonna pay for it. I can just tell you that much, and I think Simon would tell you the exact same thing. So nothing bad will happen to you if you version control. Even though it may seem tedious at first, I had a situation at the day job where I put in a new thing by accidentally uploaded or tried to upload a hundred megabyte or more dataset in GitHub, and it didn't like that. Yeah. That says, oh, that's too big. You gotta wipe that outside. I'll go clean my history and then cherry pick commits that were without that. That was a fun afternoon. But if I didn't have Git, I would have been absolutely hosed without that. So don't put yourself in those situations. Use Git, and then that way, you can commit it when it looks good. So we shall see.
[00:39:35] Mike Thomas:
Absolutely. Yeah. And as you mentioned, these like we like to say, these prompts that you can create yourself, these templates,
[00:39:42] Eric Nantz:
all marked down all the time. It is. It is. If you can speak markdown, you can speak the language of these helpers as well as what's built with our weekly itself. So you set that up, and I knocked that out. My goal of our weekly is built with markdown because everything is transparent. We wanna make it as easy as possible for all of you that contribute to these issues. We're running a bit well on time, so we probably won't get into a huge amount of of additional fines here. But I will give a shout out to, Bruno Rodriguez and Philip Bowman for giving me excellent material to talk about at the recent shiny comp. You know, my presentation was called in the nicks of time, a new approach to shiny development with nicks and ricks.
It was a bit too much for twenty minutes. I do have that one regret, but, hopefully, when that recording comes out, you'll enjoy it. But thanks to them for putting Rix out there because I I it's definitely inspired me, and I've got a lot more to say about it as I push this in many different directions. I even saw something with Plumber too I could do with Nicks that I'm really intrigued about that I may, touch on in a future episode. But, nonetheless, there's a lot more to this issue, so we invite you to check it out at rwicked.0rg. And put that in your bookmarks if you haven't already.
And as always, you can also get in touch with us on social media. I am at [email protected] blue sky. I am at [email protected]
[00:41:12] Mike Thomas:
for your Mastodon lovers out there. And I'm on LinkedIn. You can search my name, and you'll find me there. And, Mike, where can the listeners find you? You can find me on blue sky at mike dash thomas dot b s k y dot social or on LinkedIn if you search Ketchbrooke Analytics, k e t c h b r o o k. You can see what I'm up to.
[00:41:33] Eric Nantz:
Absolutely. Always love and follow what you're up to there. And as always, we thank you so much for listening wherever you are. We'd love to hear from you. If you like us to cover some additional things besides the issues, we're always happy to hear your feedback. But that's gonna put a bow on episode 202 of our weekly highlights, and we will be back with another edition of our weekly highlights next week.