Resources

Mel Gregory | RStudio Cloud for education | RStudio (2019)

RStudio Cloud aims to take the friction out of doing data science with R, allowing students (and instructors) to skip over installation, setup, and IT challenges and go straight to the good stuff. In this talk, you will learn about RStudio Cloud, how it can streamline the learning process, and how to use it to facilitate teaching classes, workshops, and other learning situations. Additionally, we will highlight some best practices for using RStudio Cloud in an educational setting, and talk about other learning resources available. About the Author Mel Gregory Mel is a software engineer and has been for a while. She likes simplicity

image: thumbnail.jpg

Transcript#

This transcript was generated automatically and may contain errors.

Hi, my name is Mel Gregory, and I am a software engineer at RStudio, and I work on the team that's building RStudio Cloud, which we've heard about a little bit today. And that's what I'm here to talk to you about. So this talk is primarily geared toward people who are teaching data science or statistics or anything else where your students might want to do some data analysis.

And to that end, I'm going to briefly detail a little bit about how RStudio Cloud works for anyone who hasn't yet seen it, and I will spend the rest of my time today demonstrating why and how to use RStudio Cloud in a teaching context, how it can make teaching a course or a workshop easier, and along the way, I will highlight a few best practices for doing this. I will also talk about some current limitations and touch on a few additional learning resources that RStudio Cloud makes available, namely primers.

The installation problem

Okay, so let's imagine that I'm teaching an intro to data science class for our purposes here. So my students will be doing data analysis using R, but probably don't have a ton of prior experience writing code. So to get started, they might do something like this, maybe ahead of time, but probably on the first day.

Install R. Install RStudio. Maybe install some packages, cool. And then they're going to troubleshoot some installation problems, and I might just have to help here. And then finally, they get here, and you know, that's a lot to do before writing any code, and it can be tricky, especially if you're new to this. And given the myriad different systems that my students might bring with them, it's actually a lot for me to potentially troubleshoot, too, if things go sideways.

So on the other hand, the first day could be this. Go to rstudio.cloud in your web browser, log in or sign up, create a new project, and you're there. So there's no installation here, and there's no setup for students to do, aside from signing up for an account, and when using RStudio Cloud, students will all be running the same versions of R and the RStudio IDE automatically, so there's no installation troubleshooting to do there, either. Additionally, with a little bit of prior setup on the instructor side, students will also have the same versions of the same packages installed and loaded already.

So now, this is not to say that students shouldn't have to know how to do all this stuff. They should. Understanding how the various pieces fit together is really important, but it's a lot to understand up front, and maybe it's not the most important thing to learn first. Getting up and running quickly provides an invaluable sense of progress here, and we can come back to these details when they have a bit more context.

Getting up and running quickly provides an invaluable sense of progress here, and we can come back to these details when they have a bit more context.

RStudio Cloud overview

So RStudio Cloud. Briefly, RStudio Cloud is the RStudio IDE, available as a service that you can access from anywhere you have an internet connection and a modern web browser. It doesn't require any IT support or local installation, and you can sign up for an account and you can use it today. We created RStudio Cloud to make it easy to do, share, teach, and learn data science using R, and in support of that mission, we've built a ton of extra features to make it easier to organize work, teach classes, learn R, and share analyses.

So first, a little bit of basic terminology. In RStudio Cloud, the fundamental unit of work is a project. It encapsulates your R code packages and data files and provides isolation from other analyses. So this is analogous to projects in a local installation of the RStudio IDE. A space is a place for a group of people to organize and collaborate on work. In addition to a personal workspace that everyone gets automatically, you can also create spaces with roles and permissions to control project sharing and visibility for space members. So not coincidentally, these spaces work well for courses, sections, and workshops.

Spaces have four different possible roles. The creator of a space is automatically assigned the admin role. This role is recommended for instructors. Admins have total control over the space and can see and edit all projects in it. Next we have moderators. This role works well for TAs if you have them. Like an admin, a moderator can see and edit all projects in a space regardless of visibility. So more on that in just a minute. The contributor role is a good choice for students. Contributors can create new projects in the space. And viewers can see the space, but they can't create new projects in it. So this role could work well for someone who is auditing the class, for example.

Whether or not a project can be seen by someone else is controlled by its visibility. A project can be public, that is, shared with everyone, or private. Private projects in a space can be viewed by the author and also the admins and moderators of the space. Private projects are indicated with a lock icon like that.

Demo: setting up a class space

Okay. So let's take a look at what this might look like in practice. This is a space that I've created for that intro to data science class that I'm teaching this semester. Since I've created this space, my role is admin, which is great because I'm the instructor. And here I'm on the project listing page. This space has a few projects in it already. All of these have been created by me.

I can create more new projects here via this menu. So to get my class started, let's first take a look at how to add students to this space. I'm going to click on this members tab here. And here I'd see a list of all the members of this space, but right now it's just me and my TA, Ravi. Here I can invite new members and set their roles. I could add my students to this space one by one by clicking this button and typing in their email addresses. This kind of takes a little while.

The easiest way to do this, especially if your class is pretty big, is to make your students share it, or make your space shared and let your students join on their own. So in order to do this, I'm going to click on this shared radio option over here. I don't know if you guys in the back can see that, hopefully. And set the initial role. I default the initial role as contributor, which again is great for students. And a little later on in this semester, once everyone has had a chance to join, I can come back in and set this to invite only. And I can always add people one by one here again.

So now that my space is shared, I'm going to copy the link that it generates, and I can send it out. And anyone following that link will automatically join my space. Before I send this link to my students, though, there are a couple of other permissions I might want to consider here.

The first one that's the most important to me is this one right here in the middle. Contributors can make their projects visible to all members. So this setting controls whether contributors can share their projects with everyone. That is, make them public to the space. If you're using your space for homework or exams or any other situation where your students' work shouldn't be viewed by other students, you might want to make sure this setting is unchecked. I'm going to do that now for my class. The other two checkboxes here control whether or not contributors and viewers can see the members list. By default, they can, which is fine by me.

Okay, so I'm going to go back to the projects listing that we saw initially by clicking on this projects tab here. So all projects in a space like this one are not shared by default. This is great for me, because it means my students won't be able to see each other's work. However, this also means that as an instructor, I need to make sure that any projects I want my students to open have been shared with everyone.

So I can tell if a project is private and has not been shared by the lock icon next to it, like this one. To make sure that I'm sharing the projects I want my students to see, I can filter this list to only see the public projects via the shared with everyone option here. Now that I've done that, I can see the list of my shared projects is much smaller, and I'm noticing that my example two project is not in this list. So this means that my students will not be able to open it. I'm going to go back to the listing by all, and I will open example two to see what's going on.

So, this project is loading, but I can actually do this now. I'm going to open this gear menu here and click on this access tab, and I can see that it's only visible by me, so I'm going to switch this to everyone and start 101. Now, if I go back to the listing, it doesn't have the lock icon next to it, and if I go back to shared with everyone, it shows up there too.

Assignments

So, now, if you're creating projects that you want your students to start from and complete, like homework or exams, for example, you want them to have their own copy of the project to work on. This is where assignments come in. So, basically, anyone opening an assignment project will automatically get their own safe copy of it. This is great because it means my students won't have to remember to make a copy themselves, and they will always come back to any work that they've started.

So, looking at this list, some of these projects look a little different from the other ones. I'm going to scroll down here. So, these two homework projects both have an assignment label. Hopefully, you can read that. This big gray box here says assignment, but this one down here doesn't. So, I'm going to open it up. It also has a lock icon. It hasn't been shared yet. So, I'm going to open it up and see what's inside. So, this is a homework assignment that I was still writing up. I hadn't shared it yet, but I'm done with it now, and it's ready for my students to start.

So, once it opens, actually, while it's opening, I can do this. I'm going to rename it. So, I'll take out the work in progress part. This is on our markdown, so I'm going to rename it so we all know. And I'm going to make it into an assignment. So, I do that over here, again, in this gear menu, and I click on this access tab. First, I need to share it with the space, and then I can click here to make the project into an assignment.

The student's view

So, I'm going to leave that for now, and I'm going to switch views to see what it might look like to be a student in this course. Here, I've logged in as another user. My name is Mel, the student. You can hopefully keep us straight, and I'm going to join the space via the link we copied a little bit ago. So, when I follow that link and join the space, I'm going to see a welcome message here, and if I click on the projects tab, I'll see the projects listing for this space. So, as this student, my view looks a little bit different. Right now, I'm only seeing the projects in this space that the instructor has created and shared.

So, first, I'm going to take a look at example number one from the student's point of view. Because this project is not an assignment, if I open it up, I'm going to get what's called a temporary copy. So, in general, when you open a project that's been created by someone else, you get a temporary copy of that project. You can play around with it, but any changes made to a temporary copy will not be persisted unless you take an explicit action to save them. So, this is great for, say, example projects if you want your students to see or run some code in a one-off kind of a way. So, now that it's loaded, I can see that it is, indeed, a temporary copy due to this big red temporary indicator here.

And I can also see all of the packages and files in this project. And I can play around. So, I'm going to start here, and I'm just going to run this code. Awesome.

So, this looks like it's saved, but it's still a temporary copy. So, if I close this and go back to my projects listing, it's going to get lost. If I want to save what I'm doing here and pick it back up later, I can click save a permanent copy. And it's pretty fast. My changes are still here. Everything I've done is persisted. And if I go back over here to the projects listing, there's my copy. So, I can come back to it again.

So, let's compare that with an assignment project from a student's perspective. So, notice this is a little bit different from the instructor's point of view if I scroll down here. These labels are blue to begin with, and the word in here says start. This means that I haven't started any work on these. So, I'm going to open homework number three. Since this project is an assignment, I will get a permanent copy created for me automatically. So, this also, the next time I open it, I'm going to come back to any changes that I've made along the way. I don't have to remember to save a permanent copy. It's already done.

So, it's worth noting here that once someone makes a permanent copy of any project, either directly or automatically via opening an assignment like this, any changes to the original will not be reflected in the copies. So, it's a good reason as an instructor to keep your projects private until they're ready for students to do work on them.

Instructor access to student projects

So, I'm going to switch back over to the instructor's point of view. We'll leave the student to her work, and I'm going to jump quickly into the member's view, and I can see that Mel, the student, has joined. Okay. So, I'm going to go back to the project's view here. I've mentioned before that admins and moderators can view and edit all projects in this space. This means that I can open a student's project directly and see what's going on in there. So, let's see this in action.

Again, this is my instructor's view, and if I scroll down a little bit, here's my student's copy of the assignment. Copies are also grouped under the original project, like this. So, having students create copies of your projects can be a handy way to find them all again later. So, I'm going to click on my student's project here and open it up. Being able to open a student's project like this can be very useful to help them work through bugs in their code, particularly if they're having a hard time describing what the problem is. Like, they just write help.

An important note here. So, opening a student's project like this does not give me a temporary copy. Like, there's no temporary indicator up here. This is actually Mel, the student's project. So, I can see the changes that she's made, and this means that I can also make changes here, but I'm making changes in her project. So, this is powerful, but please be careful.

So, this is powerful, but please be careful.

Reusing a space across semesters

Okay, so I'm going to leave this for a sec and time travel a bit to the end of the semester. I've actually been teaching two courses, STAT101 and STAT204, and I'm going to open up the space for STAT204 and take a look at it. Okay, so this is a little bit more going on in here, and I have a members list. These are all of my students, and so if I go back to here to projects, while RStudio Cloud makes it easy to do a lot of this, like, heavy lifting, this actually represents a fair bit of work for me, and I'd like to use it again next semester, and I can actually do that right here.

So, I can copy this space up here in this menu, copy space. This brings up a dialogue, and I'm going to rename my new space here, and this is for the spring. We're time-traveling. Okay, so copying the space in this way, that was really fast. It copies all of my public projects. None of the members are included, but that's fine, because I'm probably going to have a completely different roster anyway, but it gives me a really good jumping-off point for next semester's coursework. From here, I can go in and set any projects I don't want my students seeing yet to be private or do anything else I need to do before letting them in, so this can be really handy to save time recreating all these projects for the next semester. I can also delete a space to keep this clean via the same menu up here, like this.

Primers and learning resources

Okay, I'm going to pivot away from my classes just a bit and talk about some other learning resources available in RStudio Cloud. So, you can check these out at rstudio.cloud slash learn. They're also available on the left nav here under your list of spaces. The first thing I want to touch on is primers that Carl talked about, too. Primers are interactive sets of tutorials that teach various concepts. So, I'm going to open this one and bring up the visualization basics and get through it, and it's prompting me. I can interact with it. Awesome. I'm learning. This brings up an interactive console here that I can actually type code into and run it. So, if I type that, which is what it wants me to type and run the code, I can see the results, and if I mess it up, I get an error message, so that's really cool.

There are a number of primers here teaching all sorts of things, and these can act as supplementary material for a class, for example. Anyone can use these right now, and they have been built using a package called LearnR. You can learn more about it down here. So, in the same section, we have a link to the guide to tell you about how to use RStudio Cloud if I'm going too fast here, a collection of data camp courses using R, our downloadable cheat sheets all right in here, and a section on what's new in RStudio Cloud. This is a good one to pay attention to. We'll highlight big new changes in here.

Additional features and best practices

Okay, so the workflow that I just described makes good use of copy projects via assignments. However, you might want your students to create new projects themselves. If they're pulling code from an existing Git repository, for example, the new project menu has an option for that. Git is really great. This option will bring up a dialog to enter a repository URL, and RStudio Cloud will create a new project for it. Once the project is created, you may have to log in, but once you do, you'll have all of your source from Git right there.

One final helpful thing, you can set up your space such that all new projects created in it will include a default set of packages and files. This is done by selecting a base project in the space settings. You can actually take advantage of this feature when creating assignments for your class. If your assignments all need the same set of packages, say you want the tidyverse in all of them, you can create a project in your space with those packages installed and set it as the base project. All new projects will have those packages installed automatically. Note that base projects are not retroactive and won't apply to previously created projects. You can learn more about this in the guide.

I'm sorry to tease a tantalizing bit of setup like this, but I'm really short on time. RStudio Cloud currently has a few limits to be aware of. RStudio Cloud is still an alpha product. We do not currently support simultaneous collaborative editing. If your students need to collaborate on work in this way, we suggest using a Git-based repository for code. Using source control is not a terrible idea regardless. Currently projects are limited to one gig of RAM, and by default you can create one additional private space with up to 10 members and 25 projects. If you need extra spaces or extra capacity, please reach out to us, particularly if you want to use RStudio Cloud for teaching, and we will do our best to accommodate you.

Some best practices in summary. First, use RStudio Cloud for teaching. I am biased, but I think it's really great. Second, use spaces to get the helpful features that we've just talked about, like assignments, which takes me to third. Make use of assignments and spaces. This will make sure that your students do not inadvertently lose work because they forgot to create a permanent copy. Also because only public projects can be assignments, this ensures that your students will have access to the project you intended to share with them. Third, take advantage of space rules and permissions to make sure students can only see what they should. And finally, test things out ahead of time. Make sure you're not going to hit RAM limits and that you have the capacity that you need.

So I want to briefly mention that while I've talked a lot about teaching in this talk, RStudio Cloud can be used for other situations too. If you want to use it to share your analyses, for example, please do come and take it for a spin. You can create projects in your personal workspace and share them with others. And while the memory limits apply to all projects, the project capacity limit is much higher in your workspace by default. And unlike in spaces, shared projects created in your workspace can be seen by anyone with a project URL in RStudio Cloud account, so they're a little easier to share out. You can learn more about that in the guide.

So we are actively releasing new features all the time. Please keep an eye out on the What's New section, and we'll highlight big changes there. Also know in addition to the big stuff, we roll out small improvements often. If you have questions or feedback, we'll use RStudio Cloud. Please reach out to us on community via the dedicated RStudio Cloud category. We're pretty active there, and we'd love to know what you think. So feel free to come find me during the little remaining time in the conference. I'd love to talk to you about RStudio Cloud. We hope that RStudio Cloud makes your teaching and learning lives easier. Thank you.

Q&A

If you're interested in going off to the break, don't worry about it, but we'll keep going with questions if you're okay. Yeah, that's fine.

That was great. Thank you. I saw when you were setting some of the permissions, in order to get something flagged as an assignment, it had to be available to everyone. Yes. But at that point, can it still be locked? So if I wanted to create like 20 assignments before the semester starts, and then over the course of the semester, begin to release them to students? No. In order to get the option to set something in an assignment, it has to be public. So you just create a whole bunch of projects, and then as you go, you re-flag as assignment. Yeah. I had mine marked as work in progress. I think find some way to label them, and then you can come back to them as you need to release them and just do both. And since they're in the same spot, just do them both at the same time.

I'm just wondering if there's an easy way for the students to download all the RMD files at the end of the course, because that's one thing I've struggled with, with using RStudio server, because then it feels like they're attached to the server. I think you can export everything. Perfect. Yeah. Thank you.

Is it easy to share data files with students? I think it depends on... So if you wanted all your students to have a data file in, say, a project or something like that, you could create a project, and then they could all make a copy of it. Or if set in an assignment, they all open it, they'll all get their own copies. Is that kind of what you mean? Yeah. Or if it's a larger file, just one file, and then every student can access the same file, because for a deep learning model, that could take 500 megabyte. Yeah. So data sets are something that's on our long-term plan, but we don't have that right now. But maybe come talk to me afterwards.

Is there a feature in assignments that lets them have a deadline, a closing time when students can't work on them anymore? Not yet. Okay. Yeah. That's high on our list. That is a good call.

Probably the best way to do that would be to maybe push your code to get and pull the... Everybody pull the same code down and create four separate projects. We don't have, like, groups or anything like that yet. Something we're considering.

Is there a way for students to knit our markdown documents? Yeah. Okay. And then is there a way... Like, how do you grade your assignments in your course? Do you grade them through this? We don't have a mechanism for that. You can open up all of their projects and see it, but we don't have a way to feed that back in through this.

Using this in, like, a lab-type setting? Yeah. So you can't just make everybody admins and... Not admins, but... Sure. And so everybody can be editing everybody else's and working together. Yeah. So an admin can delete the space. So I wouldn't necessarily make everyone an admin. A moderator would probably work for that. We don't support the simultaneous collaborative editing. So once you do that, you're actually taking over the project. So you can't just, like, willy-nilly do that. That's what I'm saying. Be careful with it. But you could definitely make everybody moderators if you want to.