R for the Rest of Us Podcast Episode 7: Silvia Canelón
In this episode, I talk with Silvia Canelón, a postdoctoral research scientist in the Department of Biostatistics, Epidemiology, and Informatics at the University of Pennsylvania. Silvia why she loves using xaringan to create captivating, audience-friendly presentations directly from R markdown. Making presentations with R Markdown not only saves her time, but also eases the stress associated with updating and distributing presentations.
Learn more about Silvia by visiting her website.
Learn More
If you want to receive emails when we publish new podcast episodes, sign up for the R for the Rest of Us newsletter. And if you're ready to learn R, check out our courses.
Audio Version
Video Version
In the video version Silvia demonstrates how to use xaringan to create captivating, audience-friendly presentations in R.
Resources Discussed
I wrote about using making slides with the xaringan package in Chapter 8 of R Without Statistics.
Xaringanthemer: https://pkg.garrickadenbuie.com/xaringanthemer/
Transcript
[00:00:00] David: Hi, I'm David Keyes and I run R for the Rest of Us. You may think of R as a tool for complex statistical analysis, but it's much more than that. From data visualization to efficient reporting, to improving your workflow - R can do it all. On this podcast, I talk with people about how they use R in unique and creative ways.
[00:00:18] Join me and learn how R can help you.
[00:00:22] Well, I'm delighted today to be joined by Silvia Canelón. Um, a post in biostats, epidemiology, and informatics at the university of Pennsylvania. Uh, Silvia, thanks for joining me today. I appreciate it.
[00:00:35] Silvia: Sure. Thanks for having.
[00:00:37] David: Um, so I'm excited to talk to you today.
[00:00:41] You have done a lot of work on, um, the sh gun package, which is, um, one way that you can actually make presentations directly from our, from our markdown specifically. Um, but before we get into that, I'd like to know just kind of a little bit about your background. If you don't mind, just kind of giving us your brief background and then, um, specifically kind of give the overview, but then also talk about your, your introduction to R and kind of how you use R today.
[00:01:12] Silvia: Sure. So I think to start, I'll just say I'm a biomedical engineer by training. That's what I did my bachelor's and my doctorate in and, uh, during graduate school, I was doing like cell culture work and collecting my own data. And that's why I really didn't have like large data sets. That I was having to wrangle.
[00:01:33] Um, but when I switched to my current position as a postdoc at Penn, I specifically wanted to get trained in working with large medical data sets. And, um, so when I took this job, one of the first things I had to do was learn how to use R and, um, in order to access the dataset securely through a secure server and then be able to wrangle them.
[00:01:55] And sometimes these data sets can have, you know, millions of different medical records for different patients at the Penn medicine hospital system. Um, so that's, that was my introduction to art was through this job, which I started three and a half years ago. And I was learning through code snippets and like scripts that my manager would share with me.
[00:02:16] So I could kind of get started and know how to do some basic functions and then kept learning, um, on my own, through, you know, stack overflow and different. Online videos and R for data science and all these different resources.
[00:02:32] David: So you didn't, it sounds like you didn't actually use R uh, in your, in grad school yourself. Is that, is that.
[00:02:39] Silvia: Yeah, that's correct. Yeah. I was just using Excel during graduate school and then used R when I transitioned
[00:02:45] David: Okay. Oh, that's good. I, another, uh, Excel to, uh, our person that, that was my background as well. It's interesting cuz I, I kind of assume people, your work is way outside of my, um, area, cuz I'm, I'm an anthropologist by training. So I just assume everybody in your area uses, you know, SAS or data or, or R. Um, so that's interesting to hear that you were, um, using Excel.
[00:03:10] What, what were some of the things, I mean, you talked about how switching to R allowed you to work with larger data sets, you know, work directly with, um, databases in is in a secure way. I'm curious if there are other things that have changed for you since you made that transition to R.
[00:03:29] Silvia: Uh, yeah, I think it's been really nice to have that the programming component of it and being able to automate tasks has been really nice. And I know that people who, um, people can program and Excel and have, you know, be able to do pretty complex things, but that's never something I spent much time on.
[00:03:46] Um, and yeah, and I do have some programming in my background through MATLAB, but even that I didn't really use during graduate school. Um, but I've always liked that aspect of, of working with numbers and being able to automate things and just have, have that blueprint to come back to whenever I wanna revisit an analysis or something that's.
[00:04:10] Been really helpful. And, um, and yeah, and I think since learning R there's just so much that it can do, and even just with data visualizations and the different packages available to run different analysis and even just wrangle the data and figure out what what's in the data set, um, and do some exploratory analysis.
[00:04:29] That's been really, really, really beneficial with our,
[00:04:32] David: Yeah. I wonder if you could give an example of some task, um, that you've been able to automate something you do kind of, you. I don't know, weekly or monthly or whatever it is that R has helped you to, to automate. And because I don't know anything about, you know, the area you work in. Um, maybe explain it to me.
[00:04:54] Like I'm, what's, what's the subreddit, like, explain it to me. Like I'm five or something like that. Um, so.
[00:05:01] Silvia: I guess I would say one example of something cool. And it was one of my first projects when I started was that we had all these different like patient encounters or visits. So every time somebody goes for any kind of medical visit, there is a record of their visit.
[00:05:17] That's, um, you know, entered into their like patient history. And so in our particular lab, uh, I work with someone named Mary Regina Boland and our focus is on studying pregnancy related outcomes. And so we had data for all of the female patients at Penn between a certain period of time, like certain period of years.
[00:05:39] And we needed to identify which patients. Um, had delivered babies at Penn, cuz it was just sort of everybody, but not everybody had delivered. And so I ended up using R to, to try to tease out one patient from another and then to tease out different pregnancies between within one patient. And so there's just the way to be able to use functions in art really makes that, um, a lot easier and to be able to look at trends over time and do different analyses for example, of different, um, different outcome rates.
[00:06:15] So for example, preterm birth or stillbirth, those kind of things that you'd wanna attract to do population health research it, our makes it so easy to just be able to look at one year, you know, across like a year, a whole sequence of years, or to look at. The entire period of time and see how things change.
[00:06:34] Those kind of things were really helpful. Cause I remember when I, when I first started wrangling an R I would have separate analyses for each year, and then being able to understand how to use DLI, to make those things a lot easier and to do the summaries that I needed. Um, it was a total game changer.
[00:06:52] Mm-hmm
[00:06:53] David: Yeah, definitely. And I always tell people, you know, I mean, since you came from Excel as well, like I know R can be intimidating and what I like to. Tell people is that our, like the code is really just the series of steps of things that you would of points and clicks that you would do in Excel. And, you know, I always, when I worked in Excel, people would always say, oh yeah, you should like document what you're doing.
[00:07:19] Like have a word document or whatever, where you lay out, you know, every time we get this data, this, these are the steps we do.
[00:07:25] And it's like, yeah, I know I should do that. But like, let's be real, very few people actually do that. Or at least do that in any kind of comprehensive way. Whereas with R by it's not just that you can automate it, but by having that code, you have that record of everything that's done.
[00:07:43] So you can see not only, yeah, yeah. Not only automate it, but like see it at any point. And if there's a mistake, you know, right away, as opposed to Excel where it's like, I don't know which point or click was, was the thing that I did wrong. So.
[00:07:56] Silvia: Yes, totally. I can definitely relate to that. I remember because the data are living in a secure database. Um, I, I wanted to be able to confirm that I had pulled in what I thought I'd pulled in to R and I remember it with our markdown. It was so nice to be able to see, to have the little chunk of code that was bringing in the data and then to be able to just look at it, um, and the output and, and confirm that I had done what I needed to.
[00:08:22] And then with each step, like you're saying, be able to confirm that I completed the task that I was hoping to. Um, our, our markdown is really great for that.
[00:08:30] David: Yeah, definitely. Um, so let's talk a bit about Shagan. So Shagan is a package to make, um, slides directly from our markdown. Uh, I'm curious what your introduction to Shagan was.
[00:08:47] Silvia: Yeah. I was trying to, in anticipation for this, I was trying to remember exactly where I first dipped my toes into sharing in. Um, I had been using PowerPoint before and I think I had. I think I had made a slide show using slides.com and that was like my first experience making HTML slides. And I really liked it.
[00:09:10] And I really liked that I could share a link to the audience members and they could follow along and have all the resources, just there anything I had linked in there they had, they would already have access to. Um, and so I think at some point I had been exposed to a, a slide deck that someone had made using R and it
[00:09:31] seemed like very much the same, you know, had the same kind of features that I enjoyed from slides.com.
[00:09:36] And so I think that's when I first started looking into it and I learned from Allison Hills, , I think it's called making slides with our markdown and that, that workshop, the set of slides that she made for a workshop for our studio comp. Um, some years ago I learned all of, um, Yeah, how to get started and how to format everything through that resource.
[00:10:00] And then that's what I based other teaching resources that I made off of
[00:10:07] David: Um, so it sounds like before you switched to showing you used PowerPoint, which of course will be familiar, uh, to many folks slides.com. Um, so I'm curious when you made the switch, what kind of benefits you saw, um, what, what it allowed you to do maybe that you weren't able to do previously?
[00:10:27] Silvia: mm-hmm I think one of the things I
[00:10:29] really enjoyed was that I, everything was in markdown, you know, I could, I could use my IDE and just, um, I was already familiar with our markdown, so that format felt really nice being able to use, um, you know, a hash for headings and, um, all those little things that we enjoy about markdown.
[00:10:48] I could just use to make slides and I didn't have to think about.
[00:10:54] Placement of things like my process with PowerPoint was always like, okay, generate a new slide. And then you might fill in the title if you're using like some kind of template. And then, um, you know, sometimes the PowerPoint templates will give you boxes for you to put things, but then you oftentimes have to like move them.
[00:11:13] And, um, and so there was something nice about not having to, to really think about that. And just knowing that the, the, boxes are kind of gonna be in the same place. If I was starting off with, um, with code that was like reproducing something. Um, but also just that piece about sharing the. The resources like is, it's very common as I'm sure a lot of people are familiar with this for you to give a presentation in PowerPoint and for somebody to ask, oh, are you gonna share the slides?
[00:11:44] Or, oh, can I get
[00:11:45] a copy of those? And like, could you email them to me? Um, but if everybody has a link to the HTML slides and it's so easy, you know, and they can follow along at their own pace, they can revisit it. Um, I can update things pretty, you know, right up until I present, if I really, really want
[00:12:01] to, which is not a great practice, but
[00:12:03] you know, you can, um, and, and just update them later.
[00:12:07] If you feel like, you know, your audience just always has access to the presentation you just gave, which is really nice. Hm.
[00:12:14] David: That's really interesting. I had, I hadn't thought about. That, because I know when I have introduced people to Shagan people who have never used HTML slides, they're like, what, what HTML, like, no, I want some, you know, PowerPoint or maybe PDF, but the idea that it would be an HTML is kind of foreign, but I hadn't thought about, I mean, for me, I just say, well, you know, it's fine.
[00:12:40] Like you just put it in a browser and you show it the same as you show anything else. But being able to then post things online really easily as a secondary benefit is, is huge. I hadn't thought about that explicit. I mean, I do that, but I hadn't thought that about that explicitly as a benefit.
[00:12:57] Silvia: Yeah. It's a nice one for sure. And then of course there's like the really nice aspects of using sharing again about using code and then being able to produce a figure and have that
[00:13:05] already be in your slides and not having to worry about which version of this table or figure. Did I make and what do I need to edit?
[00:13:13] And you
[00:13:14] know, all that mental work you don't have to do if you are just using, if you're generating the output using code, which is awesome also
[00:13:22] David: well, definitely. And I mean, I was working recently with a client who we produced a, like a PDF based report, but then she needs to also give a presentation. And so I haven't, I haven't followed up to confirm. Um, but my hope was that she would just basically take a bunch of the code that we had written, you know, to make the figures and tables in the report and just put those straight into sharing gun slides and, and share those, which is a huge time saver.
[00:13:52] Silvia: yes, absolutely. Especially tables. Like I only just now was realizing how much time it takes to fill in those pre-made tables and PowerPoint, you know, but. And then if you, you know, obviously if you change the analysis and numbers are all different, then you have to
[00:14:07] go and edit all those again. Um, but yeah, it's, it's such a time saver for sure.
[00:14:11] Hmm. Um,
[00:14:13] David: um, So just outta curiosity, like, cuz I know our markdown can, um, export to PowerPoint for example, and there are packages of course that can do that. So I'm curious. Um, I mean you talked about the benefit, like of having an HTML file, but I'm curious why you like Charing gun versus, you know, using that approach to cuz that would still give you the advantage of working in our markdown.
[00:14:37] It would just export to a different format. So what, what is it about, why do you like to, to export, to, to Shing gun as, as your output format?
[00:14:48] Silvia: Well, you know, that's a good question. I mean, now where I am right now, I would say the biggest reason would be. Um, accessibility sharing, good slides are very accessible to people that use screen readers. And,
[00:15:02] and so audience members have in general and, you know, obviously not just people that use screen readers, but audience members, when they have that HTML version of the slides, they have some control over what it looks like.
[00:15:14] You know, sometimes if somebody has preset styling that they like to see on websites, you know, font, sizes, that sort of thing. Um, those can carry over to sharing in slides too. Like there's, there's a little bit of control that people have, which I think is really nice. Um, but also there's, if I were to share as a PowerPoint, there's still that, like, it's still a snapshot.
[00:15:38] It's a snapshot of my presentation. And, and so there's something that I really like about having it live, living on the web somewhere. and at any point in time, somebody could look at it and then at any point in time, I could make an update to it if I wanted to. Um, yeah, that feels nice for some reason to be able to just have it living online.
[00:16:02] David: Yeah, definitely. And that accessibility piece is, is really important. I know. I mean, that's something you do a lot of work on as well.
[00:16:11] So you talked about PowerPoint, you know, it has obviously like templates you can use, um, which as you said, can be in some ways distracting, cuz if you're anything like me, I imagine you kind of spend a bunch of time like, oh, I need to just move this over here. And then you spend all your time, like moving things around, not actually think about the content, Tim, but a lot of times people, um, will find sharing gun a little bit more intimidating at first because it, um, they're like, how do I edit this?
[00:16:41] Can you talk a bit about kind of like in general, the, the, the process of making or, or even using existing themes and, and, and how that works to kind of style your, your presentations.
[00:16:55] Silvia: Okay. So there are some themes that are already built in to xaringan And, um, one of them being like the RLadies theme, for example, that Alison hill designed and then got wrapped up into the xaringan package.
[00:17:08] And so those themes can be really nice. Um,
[00:17:12] David: Yeah.
[00:17:12] Silvia: because I think the ones that are built in. Most of them are, are built around some kind of central idea or something like style guide or something. So with the, RLadies theme, Alison was guided by colors that, you know, the, R-Ladies organization uses and, um, which makes it really a really popular choice for people that wanna make presentations in that context to just have something that's already themed.
[00:17:36] And there, I think a handful of other themes built in also that people have designed for their own universities or institutions. And so it gives it some in that context, it gives it like a little bit more of like a professional vibe if you're not presenting your research or something. Um, and you know, if it has a logo in there somewhere, you know, there's some niceties to having those built-in themes ready to go. And, um, and then as I'm sure we'll chat about, um, soon is there's also other sharing in packages that help make, or like companion packages that. help make xaringan slides, themed exactly the way that you want them to, without having to learn too much CSS,
[00:18:22] which is what's used to style HTML pages.
[00:18:24] Yeah, definitely. /Well, Silvia, thank you so much for coming on for sharing about sharing, about sharing gun. Um, and I think this is, uh, gonna be really helpful for folks who are interested in learning to make their presentations within our, uh, if folks wanna learn more about you connect with you, what would be the best places to do that?
[00:18:47] Silvia: best place would be my personal website, which is also made with R and it's https://silviacanelon.com.
[00:18:54] David: Okay, great. Uh, well thanks Silvia. Appreciate it. Have a good rest of your day.
[00:18:58] Silvia: Thank you. You too. Thanks again for inviting me to participate in this,
[00:19:02] Thanks again for listening. I hope you found this conversation. Interesting. If you have any feedback, I'd love to hear it, David, at our, for the rest of us.com. Thanks.
Sign up for the newsletter
Get blog posts like this delivered straight to your inbox.
You need to be signed-in to comment on this post. Login.