The value of community and sustainability in full view at UserR 2026, a new tool ready to equip reproducibility and more for command-line utilities built with R, and the conclusion to LLM-prompting black magic that draws upon the awesome glue package. Episode Links This week's curator: Colin Fay - @colinfay@fosstodon.org (Mastodon) & @colinfay.bsky.social (Bluesky) & [@_ColinFay]](https://twitter.com/_ColinFay) (X/Twitter) What Makes R Strong: Reflections from useR! 2026 ir 0.1.0: self-describing R scripts and Quarto documents Building our own glue with R Entire issue available at rweekly.org/2026-W31 Supplement Resources Matrix operators in R https://019b2dbc-0ac6-3185-aa9f-0bea50e3da6d.share.connect.posit.cloud/matrix-operators.html {golem} 1.0.0 is here https://golemverse.org/news/golem-1.0.0-release-on-cran/ Package Tools with ir https://r-lib.github.io/ir/tools.html Supporting the show 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: @rpodcast@podcastindex.social (Mastodon), @rpodcast.bsky.social (BlueSky) and @theRcast (X/Twitter) Mike Thomas: @mike_thomas@fosstodon.org (Mastodon), @mike-thomas.bsky.social (BlueSky), and @mike_ketchbrook (X/Twitter) Music credits powered by OCRemix Snow Cone Heaven - Ice Climber - Mazedude - https://ocremix.org/remix/OCR01176 Salut Voisin! - Final Fantasy IV - Colorado Weeks, Aeroprism - https://ocremix.org/remix/OCR04553
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
Hello, friends. We are back of episode 236 of the Our Weekly Highlights podcast. This is the usually weekly podcast where we talk about the excellent highlights and other great information and resources that have been shared on this week's issue of R Weekly, which you can find at rweekly.org. My name is Eric Nance. I'm delighted you joined us from wherever you are around the world. Well, were kind of joking about it last week, but now this week it really is the end of July literally. So the month has flown by quick. I've been doing a lot of interesting dev work lately, as I was joking with Mike in the pre show, having a bit of a identity crisis of sorts, but I'm sorting through it. But speaking of the esteemed individual that's joining me on the virtual bridge here, let's bring in my awesome co host Mike Thomas. Mike, how are you doing today?
Doing well, Eric. Just finished up a giant refactor of, one of our clients, our code bases. Was able to slim down the code to like 20% of its original footprint. Kinda love Per. And for the state transition type of mathematics, linear algebra folks out there, the handy matrix multiplication operator can save you from giant nested for loops. Just throwing that out there for the real nerds.
I've been there. I've been there. I remember my very early days of r doing double, sometimes triple loops on these, and then I realized, oh, these operators are here. They work. They're vectorized and all that fun stuff. It is fantastic. Yes. You definitely wanna do yourself a favor, look up how these operators work if you're dealing with the lower level mathematics that Mike just mentioned. That that is cool stuff. And just like the rest of this issue, we got a lot of cool stuff to talk about on the highlights today, and our curator this week is the one and only Colin Fae,
author of the very powerful Golem package. And speaking of which, huge congratulations to Colin and the rest of his team at THINK R for the recent release of Golem 1.0, which has not just a bunch of great enhancements, but some I've been using a lot in my refactoring adventures this week. New, the latest version of Golem comes with built in skills, folks, that you can plug in to your favorite agent of choice,
and I am gonna be the one of the first ones to say, maybe in audio form, they work and they are fantastic. So if you haven't if you're a Golem user, you'll wanna update to 1.o, it is well worth it. Absolutely love it. Great hot tip for the shiny folks out there. Thank you for that one, Eric. Yeah. Well, again, thanks to Collin. He's he's making waves as he always does and it did get my juices going about, gee, I got myself a humble little shiny state package. Maybe I need to make a skill for that. Stay tuned for later on how I might do that, but let's talk about this awesome issue that Colin has curated
and as always he has had tremendous help from our fellow RWQ team members and contributors like all of you around the world of your poll requests and other suggestions. Well, we were joking last week or so and it feels like conference season is upon us and one of the OGs, the originators of how the R community can get together and share their knowledge just had their recent edition for 2026. I am speaking about the Use R Conference.
It has been in existence for many years. I should have fact checked that, I know it's been at least ten years, probably longer than that. And this year, it took place in early July, July 6 to be exact, in the beautiful Warsaw, Poland, and I have never been there yet. Maybe someday in a European trip I will go because as we'll see in the post here, it looks like a fantastic area. And as far as a recap of how this conference went,
our first highlight here is covering just that. It is authored by another good friend of mine that happens to be named Mike. Mike Smith, our consortium board chair, he is also a senior director at Pfizer. We have crossed paths many times, it has been an absolute pleasure to share our, tips and tricks both in life sciences and our geekery and everything in between, and yes, he often calls himself a self professed professional geek. Right there with you, Mike. I like that too.
And so he has done this terrific post here and will cover some of the key takeaways from this and it does give me a little FOMO. I always say it's on my bucket list to get to use R eventually, and I will make that happen someday. So he leads off with what was a very awesome talk by one of the longtime R Core members themselves, Peter Dahlgaard, and he gave both an overview of the history of the R Project.
We have a lot of new members in the community, right? You may not know exactly how ours started, so Peter covered that. Also, the workings of CRAN itself, the release process, and how they approach governance. And also, this is a wonderful time for them to give this recap because it was in the context of something we covered that was a major achievement for the R project and the R Core team, was they were the twenty twenty six winners of the Rousseau
Russo Prize or statistics in computing. So again, listen to two thirty two of this podcast if you want to get a recap on that terrific award. But Mike says, was very refreshing to hear Peter's take on this because we often take R for granted, at least I do, although I'm definitely very appreciative of everything they've done, but it's really nice to get that lens into just what is going into how R is architected,
the release process, as Mike calls it here in the post how the cake is made, and it is certainly delicious from an open source point of view. And it is also important to hear, you know, reinforced by Peter, our core takes it extremely seriously to not introduce any breaking changes unlike some other languages that tend to do that from time to time, cough, cough, python, but you didn't hear that from me. Nonetheless,
there's definitely much more to the conference than just that presentation. There was also a panel discussion on digital sovereignty and open source, which is very important these days because whether it's in the new world of AI we live in or just general policies that are happening out there in our various governments, having access to open source is more important than ever. I do not want any of our key infrastructure
in the world to be locked down by a handful of companies. Certainly there are some warning signs of that happening in other parts of software development, but at least in terms of data science, R has always been, you know, first class in making sure we have that worldwide access to highly powerful, highly innovative statistical computing. Speaking of community and how R is impacting the community, there are a couple of great highlights about this as well in the post, one of which was a great talk by Kari Jordan from The Software Carpentries,
talking about how they are building resilient communities and making sure that everyone is aware that even in this world where AI is transforming a lot of our daily work, whether we like it or even sometimes not, it does not replace the human element in this and the value of how we can learn from each other and learn from our communities to that stuff that AI can't teach, right? The interpersonal relationships, I can speak just from our community involvement I've been in, especially networking with people at POSICONF and the other various conferences.
Yeah, no bot's gonna replace that. Never, never. And then last but certainly not least, another talk that he highlights here is from Daria Mikhailashina. I probably didn't get that right. She is from the Kyiviv School of Economics over in Ukraine. As we well know, Ukraine is still very much mired into a war and no sugarcoating it. And she mentioned that despite these many challenges,
our community in Ukraine is alive and strong, sharing their knowledge, building and supporting each other, and having at least this framework of R and data science to, you know, maybe give them an escape of sorts and bring some real innovation where it is desperately needed. That community spirit is alive and well. She even has a quote here that Mike highlights here. We are still here and we are still coding. So yeah, we are very supportive of y'all's efforts to, you know, keep data science going
across the world. And the post concludes with some really interesting looking pictures of the city of Warsaw, some of the landscapes around there, and the conference venue, which looks absolutely amazing to look at. So yeah, I hope to visit there someday, but I know Mike himself gave a great talk as well. We'll have to see if we can dig up the slides for that if they're available, but great reflections on you, Zaar. Again, I want to be there someday, but it's great to see the world of R continuing alive and well,
even with these rapidly changing times that we are in as we speak. Definitely powerful words from Daria there. We are still here. We are still coding. That's super inspiring and a reminder that, you know, R is such a broad community. It goes well beyond, you know, you and I here in The States, Eric and I think one thing that's been, I think, nice in the past few years, it's been highlighted at least more than years past from at least my recollection
is sort of the work that the beginning founders of the R project like Peter have done to stand up the language. If you think about the concept of building a programming language and not having over, what is it? Twenty, thirty, maybe more years now that R has been alive. You know, essentially not having any hardly breaking changes. Like, that's an incredible feat and must really speak to the expertise of the group who originally, you know, worked on developing the language as well as, you know, just the the care and the design of the language itself.
One thing that would be super interesting is that I wonder how those maintaining the language are maybe leveraging AI nowadays to take a look, you know, the the fables of the world maybe, whatever you feel about that. If it's hyped, overhyped, underhyped, but maybe throwing something like that at the language to identify potential security concerns and close gaps and things like that. At least we have potential positive uses for those tools in context like that. So that would be interesting. But really appreciate Mike taking the time to put this post together for obviously those of us that were not able to attend and it's in this blog post is a bunch of phenomenal pictures as well of the venue, the event, some of the talks that were given. Looks like it was fantastic.
Definitely having a lot of fun out here, but a great recap. Yeah, absolutely. And it does remind me as you bring up, you know, how is R and development evolving in this new landscape? I know from certainly podcasts I've been listening to from Linux in general and the Linux community, there has been a shift even among the Linux, you know, kernel maintainers and even Mr. Linus Torvalds himself. He used to be very skeptical about the utility of AI and kernel development,
calling it mostly 90% fluff. He may not have been too much wrong on that back in the early days, but now even he uses it, even he has said very clearly, if, you know, there are people that just aren't willing to at least have an open mind with this, go ahead and fork it, baby. That's very blunt words from him. I don't know if there are core teams that are gonna have anything near that blunt, but I think, as you said, there is a shift now into tailoring these
for the common good of the project, but there is a lot of different opinions on this. Maybe someday we'll hear more about, you know, the R Core team's take on this particular aspect of it. But at the very least, like you said, Mike, the attention to detail, do not break at all. I can count on maybe one hand and maybe even two digits on my hands, the number of times that a breaking change did occur, but they were very transparent about that communication. You were given a way to have an escape hatch if you didn't want to opt into that right away. So that is something that, again, you can't teach. That takes
serious skills, serious practice, and we are very appreciative of that attention to detail. Absolutely. Yeah. And the last thing that sort of strikes me just about this conference and the blog post is just the representation from so many different communities within, you know, R and software engineering. You obviously have Peter there from the R Core team. You have Carrie from the Carpentries which is a fantastic organization. If you're not familiar with it, I don't think it's R specific. It's more, you know, best practices around software development,
a great, great organization, and then, obviously, you have other folks like, you know, practitioners and folks in academia like Daria. So, it's a seems like a a great community of different perspectives around the R language and software to be able to come together in a great conference like this. Yeah. And use R is, yes, they do get funding from the consortium, but it is very much a community driven event. So again, someday I'll be there, Mike. Just gotta convince the the powers that be to let me go someday. We'll find out.
Me and you both. And up next, speaking of, you know, valuing the R languages, attention to detail on compatibility and such, well, one area in software development and especially in the world of statistics and data science that we put alongside that is reproducibility as well across all the things we build.
We know about the mainstays in the R community for maintaining things such as package environment reproducibility with the highly regarded RMV. We also know in the worlds of other software, languages, they have their own take on that framework. But what if you can kind of have your cake and eat it too, so to speak, where maybe you're not building a very sophisticated, you know, multi file project or even a multi, you know, architected report.
You just have a simple set of analyses. Yeah, they probably do depend on some packages, but you want to run it in a batch kind of setting. You may want to run it as a command line utility of sorts. There hasn't been to date, in my opinion, a great attempt to mirror these two concepts together of these very low footprint, the very powerful utilities that you can make in a language like R, but with that reproducibility aspect literally baked into it.
This next highlight seems to be an attempt to address this, just that, and it is the new public release of a utility called IR, and it's version O. 1.0 and this is coming to us from the POSIT open source suite and this blog post is the announcement of the said utility authored by a trio of very talented engineers from POSIT, Tomas Kalyniewski, Christophe DeVeuw, and Charlie Gao. That's certainly a who's who in engineering prowess
and this is, if you're like me, you probably haven't heard of this before. Although if your eyes were sharp, there was about a few weeks ago, I think on this show, we had covered what was a very quick reference to it that somebody watching the developments in PASA caught wind of. Well, this is the formal announcement as such. So what IR is meant to do, it is meant to be a command line tool in of itself that can help run R scripts and render even portal documents,
how, but it can import the runtime requirements, which you might say is package dependencies, and much more using clever annotation in the file you're actually trying to run. So in this post, mentioned that they are very much inspired by other efforts in the community, in the software development community in general, such as PEP seven twenty three, which if you're not sure what that means, that stands for Python enhancement proposal,
which was for inline script metadata, I. E. Putting some, you know, delimited type of metadata at the top to tell Python, I need these kind of modules or this, you know, this set of Python version to make sure that anybody can run this, and when it's run the first time, it actually grabs those utilities for you. This is very much just like that. So with that as inspiration, it has got two main workflows
that it supports here, one of which is self describing R scripts and documents, like I said, R scripts, portal documents, but also running command line utilities that are distributed built with R, and that has got its own set of commands, and we'll talk about how this works. So what this can do is with these annotations, it can you can, in these annotations of your file, tell which packages your script needs or your report needs,
which version of R should be used to run it, whether, you know, you want to show or hide libraries, and whether you want to get to a specific date, snapshot, if you will, of packages on CRAN. So this seems like a lot. You're probably wondering, there are parts of that that seem familiar. You're exactly right. It is building on top of utilities that are already established, one of which is Rig, which I use daily on my work machine
to maintain different versions of R, in that case, Mac OS, but it works just well with Windows and Linux. So it'll call this IR utility will call rig on the spot to install a version of R if you don't have it on your system. Then you get to the packages, right? So it relies on two mainstays in the R community for this one, which is PAC, P A K, which gives you that very performant way to install packages, resolving dependencies and such.
And then rm, we mentioned rm earlier, to help build an isolated package environment for those packages that are installed for the utility. So in the rest of this post, have a very quick example that has a dplyr inspired pipeline and we have reshaping and summarization, and at the top of the script, they make this so that it is able to be distributed as a command line utility, but in these annotations, it's literally the pound sign
and the what's it called? The vertical pipe. I forget the the name of it. But the first line is the bat is a path to, in most shell environments, an ENV utility, but then you put IR run, which is what in Linux and Mac OS you can do as a convenience for your shell script to tell what is the actual shell you want to run. In this case, it's a tool. And then the rest of that has some YAML type metadata that's delimited in the front,
such as a packages list, and it says dplyr, not just dplyr, but dplyr greater than equal version 1.0, you can put that annotation in, And then the tidyr package, you can say whether this should be isolated. I think that defaults to true. And then the exclude newer flag, which says do not install any packages from a date later than, in this case, twenty twenty four January fifteenth.
So in essence, that's like your snapshot date. Once you have that, you just either run IR run if you're on Windows, the name of the script, or if you're on Linux and Mac, you can just do the executable permission bit to it and then say dot slash, your name of the script, and it'll take over from there. The first run of it is going to cache the installation and the second runs thereafter, it'll run much faster because it's going to use that same cache for the package and environment installation.
So that is really neat, and it even has a little shorthand utility called rx, which is shorthand for irtool run, so you literally can run an executable. And they have an example of that from the BTW package, which comes bundled with such a utility, but IR can make it easy to run that. And there is also ways, as I mentioned, to do this with Cortal Docs too. So in your Cortal YAML front matter,
you put in a new section that's labeled IR, and then the rest of the syntax is exactly the same as you would have in a general R script that you would put with IR capability. And yes, for the Python users out there, it supports Python as well. It looks like it builds on reticulate a little bit to do this, but then there's a separate section called Python packages where you can put obviously your favorite packages like matplotlib or whatnot. You can say which Python version to use,
and then also like the earlier parameter, exclude newer for the snapshot date. So that is building on reticulate. So R is still the driver of it, but it uses reticulate to bind to even things like UV, for example, that handle that Python installation side of things. So it's all available on their GitHub repo. It's a binary that you can install on your system. And you may not be surprised when I tell you the language that was used to build this. Yes, this is over 95%
Rust. Rust is everywhere these days. That may be why it's so blazing fast after it gets past the initial package installation. It's a new release, right? They're welcome to feedback just like anything in open source. They got an issue board. You can read the documentation itself on the documentation site. Very intriguing. I can see lots of utility for this because in the past, even since the before pandemic times, I did experiment with making
command line R scripts using packages like Optparse. I want to say I used one or two others. It was fine, but like I said, it never handled the package installation reproducibility. This comes all in one. I'll be very interested to see what the community does with this. It definitely gave me some to think about and yeah, really great to see IR now available for us to use. I have to imagine that this isn't necessarily a coincidence in terms of like where we are in software development right now. If you're, you Cloud Code or
Codex user, you know that most of the time when you're working with those tools, they are running our code via like bash and shell scripts that they're executing which usually means that you're seeing them kind of have to spit out our script before they actually run any R code, probably a lot of semicolons, you know, in terms of trying to stitch multiple different R functions together in one single call to return some output. And
that's because, you know, R isn't natively like, the the way that you probably work with R on a day to day development project is not necessarily through sort of the R command line interface, if you will. And it it's it makes a whole lot of sense because it's a lot cleaner looking to write R scripts. And then under the hood, those will get invoked with, you know, r in the R script, executables. But if we had a command line interface
that was a little bit of prettier of a way to do this as well as, more elegant in terms of how it handles some of the underlying dependencies. Maybe, that sort of dichotomy between your development scripts and sort of what actually gets executed under the hood and what's useful for the Claude codes of the world would be a lot closer together. Well, it seems like IR might be bridging that gap. And we're getting a lot of CLI tools I'm seeing coming out of software development nowadays because
of that fact. That's my guess. And I'm pretty confident that's the case. And the way architected that IR here is, in in my opinion, brilliant. I think it's it's fantastic, Eric. You gave a a great rundown of the sort of metadata specifications are prefixed by the pound sign and then a vertical pipe. That's very kind of akin to how you might set some of the metadata settings if you are a Quarto user in terms of like the label or your figure captions or your table captions within an R chunk inside of a quarter of documents, that same exact type of syntax. So I have to imagine that the fact that this
IR CLI tool allows you to execute quarter documents means that that's not going to collide when those documents get rendered if you do have R chunks that have sort of that same type of syntax in there. I would hope I would hope not. I'm sure they've done their homework on that, but I will have to try. I'm pretty confident. Yeah. If you look at the folks who put this utility together, I'm pretty confident that they thought they thought through that. You got your own instance. You've got Christophe Dervo and Charlie Gao and Thomas Kolonowski. So that is a pretty
serious in terms of our firepower and software development firepower group to be putting something like this together. At the bottom of the blog post, there is a link to different sources, including the GitHub repository and the IR utility website, which is r-lib.github.io-ir. And maybe one of the most useful things you might have there is this reference page, which has all of the I think it's only about 10 or so sort of different major commands that
IR off the IRCR CLI tool offers, IR run, IR render, preview, and a bunch more. One of the flags that I'm not sure if we touched on or skipped over was this flag that is called let me see if I could find it quick. It's called isolated, and you could set that as true or false. Not exactly sure what the default is, but what that does is it can tell IR whether or not you want to use any of the packages that you already have installed on your system. So if you're looking for, like, total reproducibility
and for for it to not use any of the packages that you currently have installed on your system and and sort of bring all the our package dependencies in fresh. You can set that isolated true flag in the file, or you can actually throw a, dash dash isolated flag at the command line at the time that you run that CLI call to run that without using the user's library at all. So this is also another tool that allows us to get closer
to more fully reproducible, right, artifacts in R and and scripts to be able to hand off from user to user with the idea that things should not break as often as they would if you were just to hand off a a regular old R script and not give any information on the dependencies that were required, or that you used when you developed it and it ran well on your machine. So really interesting, really exciting, I think, for the community, and I'm excited to see how this evolves.
And one thing that in my first read of it, I probably took a bit for granted. I I sped through that when I was given the initial recap here. The idea of packages themselves providing the underpinnings of what IR could run as a tool from that package itself. This kind of, was, when I first read this, I wondered, well, yeah, the IR is going be great for those smaller scripts. And what if I have something more sophisticated? There's your answer folks, make a package. The package will of course encapsulate its dependencies that it needs and you could build a script and that this is where I'll link in the show notes to, as you mentioned, Mike, the the great documentation site. They have a section literally called tools.
Now not to be confused with tools that AI uses, although maybe that could be a little mix here and there, but that's where you if you wanna try this of your package, it gives you a way that, you know, a little starting, you know, guide of sorts for creating these. And with that, you could basically, you know, very powerfully turn your package into a command line utility. Oh goodness, wouldn't that be cool to put as like the back end of some kind of tool call in your AI agent
instead of having it try, as you were saying earlier, these very haphazard sometimes calls that are and trying to guess where things are and then doing, I've literally in the session I have next to me, doing a bunch of debugging sessions on its own and weird stuff like that. I could see tremendous value in arming your package with this command line like utility. So not just a human could just run a quick shell with it, but your agent could too. I think there is a lot of meat to that bone, so to speak, of why this is here and it might be interesting to
see the authors of this at the upcoming posit conf and get more takes on this, but I'm intrigued by the potential this has, not just for the smaller stuff, but potentially for the bigger stuff too. Absolutely. And one thing that I was a little bit confused at, in my first read of this blog post was sort of what is baked into IR and what does it handle for you and what does it not handle for you. So in order to get IR to work, you will need R and R script, those executables installed. So you're going to have to have R installed on your machine.
If you are going to use the metadata flags that allow you to select a specific R by its version or if you wanna use that exclude newer flag, you're gonna need rig to be installed on your system as well. And then if you are using IR to render Quarto documents, you're going to need Quarto to be installed as well. But I think pretty much everything else will be handled for you by IR. Yeah. I'm I I am intrigued to try this out. I'll have to see a lot of times with these newer tools out there. Am I, extremely overengineered
setup with Knicks, how I can get it installed there? And maybe as a NICS user, if everybody else is using NICS, I might not need IR, but we're not in that world, right? So it's good to have utilities that can be easy to install on the main operating systems, but I will play with this. I could definitely see if for all of you in various industries out there, even in academia for that matter, the idea of not only distributing the product or I might say the output of a report from Quarto, but with this, you could potentially distribute the QMD itself
in a way that if the end user wants to tweak something or see how the sausage is made, so to speak, put this through IR. I think that could be a very powerful thing for distributing Cortal and even R Markdown for that matter, a lot of great ways to tap into that reproducibility aspect. So, creative juices are going buddy, I have to see how far I can take it. You and me both.
And last but certainly not least, it's not often that we leave a particular highlight and a summary of our highlight into what you might say is a cliffhanger, but we kind of did that last time, but we're going to rectify that because we're going to bring it back all the way, so to speak, And we are speaking about what Albert Rapp has put together for us, continuing what he's talked about last week with an intelligent way to add some R specific, you know, information
into your next LLM prompt. We left off, if you didn't listen to our last episode, we left off with a pretty handy way to inject a variety of R objects into a given string, and it was quite powerful. The examples that he had was a collection of vectors, lists, and data frames, and we left with this very cleverly called function GluePrompt that had placeholders for these,
and then it just magically extracted or printed out those objects in a friendly notation for certainly an LLM agent to ingest, and that was just the tip of the iceberg, so to speak. There's a lot more about how you mix that into other text that would obviously go into the prompt itself, and you would want to use things at the GLUE package that we spend kindly about, principles around that. So that's what this post is going to cover. So
the first step is let's take a journey into how the GLUE package actually works to pull off what that can do under the TIN. I still remember when Glu came out, I was like, thank you, thank you, thank you. Because, yes, pace zero gets me pretty far, pace gets me pretty far, sprintf is, you know, the main say in base r. It's got its own little quirks of syntax, but Glue is just like, put your variable in a curly bracket in your text,
have that variable in your environment, and bam, it's right in there. So he has a demonstration of what Glu does. He's got links to other of his posts that talk about that. And both Glu and a derivative built on top of Glu called epoxy, which I that one was offered by Garik Aidenbuoy. Glue itself was offered by Jim Hester, so I did fact check myself on the fly there. That if you go into their internals, you will see that in the case of glue, it has a handy function called identity
transformer. Transformers, more than meets the eye. Getting vibes of my eighties cartoon watching on that one, but I digress. What does identity transformer actually do? It takes the input text that you give it, it feeds it into the base r's parse function, and then takes that part, pass it into the eval function in base r, and then give some air handling with some synthetic sugar it gives on top with a with glue air function.
But that brings memories of what I did in the past. Under the hood, Glu is using eval parse text equals something. Oh my goodness, did I use that all the time in my early days of our development. Well, Glu just made it a lot more saner to use apparently with some good air checking to off top of that. So back to what Albert's trying to build here, he wanted to use that identity transform
kind of, logic and that kind of paradigm and use that inside of this generate prompt that he's building in series of posts here. So he's got, a function here in the post called prompt transformer, which in essence is going to literally call the Glue's package's, identity transformer function, passing in the text and the environment that prompt transformer has,
and then using that to get the evaluated variable of interest, and then feeding that into the generate prompt function that he built already. And so you can check out how this transformer works manually. He does an example of a vector of numbers, and boom, you get what you expect, the vector of numbers back. But that's not how you really wanna use it. You wanna put it in glue itself. So you do your glue call. You have placeholder for, like, there will be a set of numbers here, maybe a data frame, and then a list of things.
And what glue the glue function has is a parameter that typically isn't used, but it can be if you are on this side of the fence, called dot transformer, where you can feed in your custom transformer instead of relying on Glu's identity transformer. So with that, you start to see, hey, guess what? It's got the number there. It's got the data frame there of the of the rows and JSON notation and the list of stuff using that clever way of each
list element having its name and whatever was printed next to it. That is really cool. So we gotta take it home, so to speak. Let's make a more intelligent function out of this that you can just simply take that prefilled transformer argument but have all the other arguments that Glu would expose. The way he builds this is pretty clever. In fact, Mike, you and I, I think, were even joking in the pre show, not even joking, that packages like Per are
really, really awesome. Yes, we were. They sure are. And one of the hidden gems in that, hidden to me anyway, but not hidden because it's exported, is a function called partial where you can use that to basically take an existing function and then feed in the default to an argument of that function and then have that new function be the result of that. So now his gluPrompt function that Albert puts here can just have the string that you want with a placeholder,
and that transformer will be already baked in, that custom transformer that he builds here. There is, so he's got even another function that does a similar thing called pre fill args. They get even more, more easy to use. This is really interesting how you can compose all this together, take existing functions, take existing functions, existing processes, and mold it into
a very fit for purpose now gluprompt function, and that is the deliverable, if you will, of this post, which may make it easier for you, especially if you're building with Elmer and the like, to put in these dynamic elements in your prompt and have a very low friction way of having the agent really understand more context behind your environment. Really interesting stuff here.
I've always been dabbling into string processing, but only just, you know, knowing enough to be dangerous. There's a lot of magic you can compose here with some clever use of glue principles and making some, you know, building on top of functions to make your own processing function work really, really well here. Couldn't agree more. And I feel like this is maybe one of the first blog posts that we've seen really take a deep dive on trying to help data scientists
talk to large language models in a way that allows us to communicate, you know, data frames and the other types of our objects that we create to these large language models that don't necessarily like it when you supply it with a data frame, right? You have to sort of structure those inputs in a way that they understand to get the most accuracy as possible out of those tools and if, yeah, this is the deepest of deep dives. It's absolutely fantastic. Per partial is a function that I had come across in the past but hadn't seen in a while and totally
totally forgot about it and this is a great reminder. To me, sort of the analogy that I'll draw on per per partial for those who aren't with it. It's almost as if the per partial function is playing a game of operation with one of some other R function they have out there and it's dissecting one little part of that function, you know, an argument, taking it out, and putting something different in there, putting whatever you want in there. And there this was a a great use case, a really sort of, you know, clear, transparent,
applied use case for using that per partial function to to modify, you know, some of the underlying, glue function in turn into this glue underscore prompt, you know, final function that, Albert then uses along the way. Some throwbacks there as he was looking into the internals of the Glue function itself and how Glue works, eval, and parse. We've all been there before trying to essentially use strings
as some of that nonstandard evaluation and pass things back and forth between strings and nonstring objects. So this is a great, great deep dive under the hood look. And if you're someone who fights this fight on a regular basis of trying to communicate the R objects that you're creating for data science analysis purposes to the large language models, you know, that you wanna assist want to have assist in your analysis. I think this is potentially a great place to start.
Yeah, I have a lot to learn by how these things were built, but when you just kind of take a look at the source, if you will, of these favorite packages of yours, you do get a lot of great ideas. So I know for my you know, agent adventures with our development, there's only been a handful of times I've had it, you know, look at the environment and of course it really also depends on what environment that the agent has access to. A lot of times it'll just do R script and then do things to look at things.
We are well aware that packages like MCP tools from POSIT give you a way to have like an RMCP server. There have been some recent enhancements to that if those of you are in the enterprise, especially in a POSI workbench environment, this is a bit of a tangent, I had a colleague at the day job actually get their PR merged in because there was some fun stuff that could have happened if you're on a shared infrastructure environment. I'll just say if you know, you know. Probably not worth talking about here, but you can guess. Anyway, that's been patched. So that's another way to give your agent access to R itself, but that may not be the full story, right? Could be having this intelligent prompting
and interloping or interpolating, sorry, interpolating these different parameters in and being able to, you know, be efficient with that for that context that the LM needs. Still have a lot to learn in this space, but it's good to see Albert being a pioneer on how he can make this experience easier. And my journey with Velmer is still somewhat early, but I could definitely see this being a building block for some custom agents I build with Elmer and the like.
And with that, there's a lot more you can build in the world of R. It doesn't have to be Elmer. It can be all sorts of things, and that's where R Weekly has you covered to inspire you of what you can build or analyze in your data science adventures. There's a lot more to unpack in this issue. We don't have time to go over all the details, but there was even additional recaps of Uzar from various workshops, as well as some new packages in the world of testing and clever uses of mutations. It's a fun read too, and much more.
So what can you do to keep our weekly going? Well, getting in touch with us, that great new resource, that blog post we should be showcasing, those additional packages that are out there. We're poll requests away. Everything's in the open. No matter where you are around the world, you can send a poll request. Just get yourself a Github account, send that PR, and you are all set. We have all the details at rweekly.org and we also love hearing from you and you can find me on the various social medias out there I am rpodcasts
silly me I even lost track of my socials for a second there I'm human after all I am on blue sky folks. I am rpodcastbsky. Social. I am on Mastodon with rpodcasts at podcastindex. Social. That's the one I tried to say. And I'm also on LinkedIn. Search my name and you will find me there. And, Mike, where can the listeners find you? You're making me double check my social handle. You can find me you can find me on blue sky at mike dash thomas dot b s k y dot social or on LinkedIn if you search catch brook analytics, k e t c h b r o o k, you can see what I'm up to. It is literally staring at me in front of my screen. Sometimes when I get in the flow, I don't look at my screen, Mike. That's the joy of a podcaster sometimes.
Write the notes. Oh, wait. I forgot to check. Little inside baseball for you out there any event we are we're glad that you know we're not taken over by machines just yet so with that we will close-up episode on two twenty six of or about February of our weekly highlights yeah I really need to close this out we definitely thank you so much for joining us and we will hopefully see you and have you listen to another episode of our weekly highlights next week
Our takes on the increasing removal of friction in good and not-so-good ways thanks to AI, a visual tour of hot air balloon accident data, and a case study of novel image recognition with the rplatipus package. Episode...
The flow of both data and analytical jobs just got smoother with mizu, opening the door for multiple agent harnesses in Positron, and an optimal statistical model tailored to complex experimental designs with a friendly...
What happens when that online data set isn't so easy to download anymore? We learn of two packages to ease the pain of obtaining these files and then some. Plus a visit to the visualization corner with a handy way to...
The celebration of rOpenSci's 15-year anniversary continues with the community sharing their perspectives, and a fun Shiny app that could be quite useful during celebrations on a weekend or the holidays. If you ever...
We learn about the variety of ways you can contribute back to the core of R, a roundup of the excellent choices available for package and environment reproducibility, and an amazing collection of Shiny applications and...