DataChats | Episode 3 | An Interview With Charlotte Wickham

Charlotte Wickham, a statistics professor at the University of Oregon, talks about learning R, writing functions, and her new geospatial data course. She tracked her cat with GPS and visualized it with ggmap, and emphasizes how R is an accessible first programming language for beginners.
Chapters
All right, I'm Nick. I'm a Data Scientist at DataCamp, and I'm here today with Charlotte Wickham. We just finished recording the videos for her new course on working with geospatial data in R, which I'm really excited about. I think she is as well. So welcome.
Thank you.
So maybe to kick things off, I'd like to know, do you consider yourself a statistician, a data scientist, a data analyst, a data miner, whatever. You could rattle off a bunch of different terms and why I think I.
Have to label myself a little bit as a statistician because my PhD was institution and I live in a statistics department at the University of Oregon. Except that what I really love doing is working with data and doing data analysis and programming and making data analysis easier. So I think that makes me a little bit of a data scientist as well.
Okay, fair enough. So you are an R guru. You love programming in R, and that's clear from working with you. What is it about? So how did you first come into contact with R? And what is it about the language that excites you?
So I first came into contact with R at the University of Auckland, where I was doing my undergraduate in first math and physics and then statistics. So Rs home is at the University of Auckland. So it's like in every single statistics class you take. So it was my first exposure not only to R, but also to programming. So I think what got me excited at that point was simply that I hadn't really done any programming before, but this was this way to, like, automate things, to make things easier to record, like, all the steps in what I'm doing. And that was sort of like a revelation for me that, like, I no longer had to point and click to record, like, how I did something. So that's how I got started in R. And then I haven't really stopped. I've sort of been using R, you know, almost every day since then, like, many, many years ago.
Very cool. So I'm really interested in this generation of people who consider R to be their first programming language. So I actually fall into this camp. I did a little bit of programming in my undergraduate studies, but the classes were exceptionally dry and boring, and we weren't working on really any interesting problems. We were just talking, talking about big O notation and programming and C. So I started to learn R and I was using it for cool and interesting stuff. I was getting exciting outputs almost from day one. And that was enough motivation to propel me forward and keep learning. And Then I learned R as a programming language. And I don't think I'm alone. And I'm curious what you think about people like that, and will there be more people like that in the future?
That's a good question. I think, you know, I think that's the way I learned R. So I sort of identify with that, that, you know, my first R classes weren't, you know, weren't really touted as programming. It was just like, look, here's the tool we're going to use to get these results. And I knew so little that it was really like I was copying the code exactly. And, like, making these tiny changes to. To get what I wanted. And I think that's a pretty accessible way to get started. And it's a great way to see these capabilities really, really quickly of what R can get you so that you have that motivation to be like, oh, well, how does this actually work? How is this a language? How do I learn the structure and the principles of this language to start expressing myself rather than just parroting back what somebody else has told me? And I think that will continue. I think so many people are seeing R as sort of the means to the end. They need to get something done, and R is one way to get it done. And I hope that when they see they can get it done, that that sort of inspires them to learn more. And I think we're in a great place now because there were very few resources that sort of helped you move from an R user to an R programmer, and those resources are much better and much more available now. So I think we'll sort of see more people taking that transition as well.
Yeah, sure. Well, at least partly in thanks to you, because the other course that you've done with us to date is that writing functions in R course. And that is really the first step to becoming a programmer. It's like when you stop just being a consumer of other people's functions that they've compiled into R packages, and you realize that, wait a second, people wrote these functions, and I can write my own functions to do things that they don't do in theirs or things that I want to do for myself. And that's a. I think when I started writing my own functions is when I really realized the power of programming, because all of a sudden I could construct my own tools and not rely on other people's. And that course in particular is very exciting for me because that's exactly what we want to do at Data Camp. We want to help people make that jump from consumer of the language to programmer or developer. Okay, cool. So what sorts of things are you most excited about spending your time on over the next few years?
Good question. I mean, I think I want to continue helping people get into R and helping people make this transition to R programmers. So that means I want to continue teaching. And I think I kind of have two ways of doing that now. One is helping out with Data Camp and getting sort of reaching this incredibly broad, remote audience. But I also really love teaching in person and having that kind of one on one instant interaction, which I think can be really useful when you're learning to program, to sort of have someone there to go through things with you. So that's one sort of thing I'm interested in continuing to do. And then I definitely want to get a little bit more involved in the sort of programming in that community, start contributing to more packages and also sort of start. There's definitely a movement to, to kind of open up the communities that are more diverse groups. And I'd like to sort of help people that are interested in getting involved that maybe historically haven't been involved.
Okay, very cool. So one great example of that is like the. Our Ladies group.
Yeah.
So I've been in contact with them recently and they actually recently opened up a chapter here in Boston. And I think that the first meetup might be next month, so I'd love to attend. Yet you don't have to be a woman to attend, which I learned. Yeah. So actually just jumping back to something you said a minute ago about making contributions in the open source community. We were talking about this last night and a great way to start getting involved in the open source community is to look at the GitHub. Go on GitHub GitHub.com and find the repositories where the developers of your favorite packages are keeping their code. And if you're using their packages frequently, you probably become opinionated about them. Some things that they might do differently and you might even occasionally run across a bug. And with the advent of version control and code sharing via places like GitHub, you can poke around and you can find the source code for whatever it is that's causing the problem you're having, or whatever it is that you think could be done differently or better. And you can actually make changes. So you could create your own copy of that software, make changes to the code, and then propose the changes back to the original author in the form of what's called a pull request. And there's no one to tell you that you can't do this. You can go out to any repository on any public repository on GitHub tomorrow and make these suggestions, and it's up to the author to decide whether they approve of those suggestions and merge them into the source code that everyone else will then use. So this is a very long winded way of asking the question like, so what role do you see version control and these code sharing platforms like GitHub having in developing future R developers? And maybe what other suggestions do you have for people who want to get involved in software development or open source? What are some of the things that you're thinking about for yourself even?
Sure, sure. So I think GitHub, this whole idea of version control and then having it all publicly shared is sort of amazing. When I started in R, that wasn't happening. So, sure, it's an open source software, you could dig in and find that source and look at it, but there wasn't really a way where you could ping back to the author and say, hey, I've got this idea for a change. Is it a good idea? Can I make it So? I think GitHub really facilitates that ability for me to grab the code and have a look at it, but also for me to suggest things back. So I think that's been a great benefit to the R community. There still are a few packages that aren't on GitHub, and it's always a little bit frustrating when you come across them because you're like, oh, there's this thing going on. I really want to figure it out and try and suggest a change, but I don't know where the source lives.
Yeah, you can probably still get your hands on the source, but it's maybe a little bit less straightforward or unclear where it's.
And I think one other thing that people are starting to do as package authors is sort of on that GitHub readme, they're kind of keeping track of things that they maybe want help with or how to go about contributing. Are they open to contributions? And I think that makes it a lot easier for people to feel like they can jump in and suggest something when the author's saying, hey, I need help. Help me out by working on this.
Yeah, it's intimidating to think that something that some suggestion that you put forward is going to be evaluated by the person whose software you use on a daily basis and that if those changes actually end up getting merged, that now all of a sudden thousands of people might be using software that you've played a part in developing. So that can all be a little bit scary. So I agree, actually, that's. I love the idea of having the package developers proactively reaching out to would be contributors and telling them how they can contribute in a productive way and hopefully lowering that barrier to entry for people.
Yeah. And it's also nice to see that a lot of packages are sort of implementing automated testing so that at least you feel like, yes, I've made this contribution, I've made this change, but I know it hasn't broken everything.
Can you actually just elaborate a little bit on that for people who might not be familiar with Travis CI and that sort of stuff?
Sure.
Without going into the nitty gritty.
Yeah. Essentially, as part of the package, people will write sort of a sequence of tests that need to pass, that need to be successful before they're going to release the package onto cran and let everybody else use it. So when you make a change, you can kind of rerun all those tests and check that they all, they're all still successful, that they all pass before even that change is even considered as being integrated into the code base.
Cool, cool. So it allows you to do a self assessment maybe before formally proposing changes to the software.
Exactly. And I think it also, if a package is already implementing that, if you're suggesting something new, it forces you to think about what the test should be. And that's sort of a nice way to think about what your code should do and how it should function.
Sure. Yeah. That's really interesting. So maybe just to wrap things up, the course that you've been working on is this geospatial data course, which is a fun combination of manipulating geospatial data, getting it into R, manipulate it, and visualizing it, often in the form of maps. You do a lot of work in spatial statistics. Why should people be interested in spatial stats or working with maps or geospatial data in general? Why do you think this is an interesting field and why should people care about it?
Good question. I think it's a little hard because I find this sort of inherently interesting. As soon as something has location associated with it, I want to stick it on a map. I want to be able to look at a map. And maybe that is because sort of historically, maps were our first visualizations that, you know, we've been sort of working with maps as a human race for, you know, hundreds of years.
Yeah, sure.
And I think, I think sort of naturally we're pretty good at, like, oh, I want to see it on a map, show Me a map. We're pretty good at kind of navigating and exploring them. And then I think, you know, there are just so many sort of spatial type data out there that I think increasingly everything. We're recording so much more location data that people are being tracked with GPSs and their phones almost 24 7. And that kind of tapping into that and exploring it is interesting.
Yeah, yeah, sure. I find it very fascinating. And I agree. I love the visual component, and it was very cool to me the first time I built maps in R, because when I first came to R, it was never something that I really thought about doing in R. I thought, oh, cool, I can build like a linear regression. But as soon as I realized there's an API to Google Maps and you can pull in a map with one line of code and then plot points on it with metadata, I was like, wow, this is extremely powerful. And now there's even tools to make those maps interactive and put them on web pages. It just opens up a lot of possibilities.
Yeah. I think the first GG map map I made, I attached a GPS to my cat for a day because I wanted to know where he was going. So I brought that data back into R and I could put this little trace on the screen in a plot, and I was still like, I have no idea where this is, but one line. You grab that map from GG map and it's in the background and I can say, ok, there's my house. And here he is spending the entire day at somebody else's house.
Yeah, that's really interesting. Cool. A hacker in the truest sense of the word. All right, well, thanks a lot for answering the questions. This is great.
Yeah, great to be here.
All right, cool.
More from Richie

#359 My Best Friend is AI with Valerie Tiberius, Professor of Philosophy at University of Minnesota

How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon

#358 How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon







