 I'm John Little, and you're watching the Introduction to R Instruction series. This series is part of the R Fund Learning Resource Center, sponsored by the Center for Data and Visualization Sciences, a part of the Duke University Libraries. In this section, we will explore how to access R in RStudio. A, how to download the R kernel. B, how to download and run the RStudio IDE. Then we'll follow a step on how to access RStudio in the cloud. And finally, we will briefly consider how to choose a programming language by discussing R and Python on a very superficial level, starting with downloading R in RStudio. You can run these locally on your local file system, or you can run R in RStudio in the cloud. I think you always have more control if you run it on your local file system, so let's cover that first. I have a virtual computer that I'm running here, and I'm going to go and type in download R. I will get to the R project site. It's going to automatically bring me to the Windows version, so I'll download that and just click save file. Going to my file system, in my downloads folder, I'll just double click that. I'm going to choose English and accept the defaults. Now if you're using Mac, the situation will be similar, and you can probably do a quick YouTube search on how to download and install R for Mac. Okay, now that's installed. Now that's just the R kernel. That's the piece you need to program an R. If we access that now, it looks like this. And we can use R just fine this way. We can put in basic math equations or advanced math equations, can program an R in the basic, in the base R kernel. But it's a whole lot easier to use R if you use the RStudio IDE, which happens to be free. So let's get that next. Type in download RStudio, and you'll notice that there are several different versions that you can choose from. The free version is fine for R purposes. And since I'm on Windows machine, I'm going to download Windows and install it. Now this is the RStudio IDE, or integrated desktop environment. I'm just going to accept the defaults. The IDE really is just a mask that sits on top of the base R kernel, and it makes it easier to use R. RStudio is a great company that's put a lot of effort into making R easier to use. They're the primary driver behind the tidyverse set of packages that we'll talk about in a later in the series. And they're the authors of the RStudio IDE, which brings R into a very modern context that makes it really easy to do data science with R and to do reproducible data projects with R. OK, so now that we've downloaded R first and then RStudio, we can go start RStudio, which looks like this. So that's downloading R and RStudio. The same thing that I did in R I can do here, because the kernel really operates inside this section here called the console. And so we did our basic math. We could do more advanced math, but those will be parts of the future series. Now, I just want to bring to your attention that you can also run R in the cloud, OK? So there's a thing called RStudio Cloud that's developed by the RStudio community, the RStudio company. It's free. I highly recommend it. It works very much like the version that Duke is running. In fact, I think the version that Duke is running is the same thing. Since this is for a Duke class, I'm going to use this version to explain the RStudio in the cloud. But the other version works really well and happens to be for everybody. So here is the RStudio console, just like we were talking about before. Again, I can do some basic math and get a response. Another thing that's worth noting is that when you're in the cloud version, you may have to upload some data into the cloud. So from the files tab, there's an upload tab. This upload tab does not exist in the other version. Click upload, and then navigate to the file that you want to upload. Click open, and OK, and that file shows up right there. So now you've uploaded data into the cloud. OK. That's all I wanted to show you about downloading R in RStudio. So now's a good time to go back to the main page where you can advance to the next section or work on exercises. Work on exercises. Good idea. But before I go, the next four minutes or so are a long trailer in which I attempt to give a brief answer to a frequent question. Questions I typically hear in introduction workshops, right? Questions like, what's the best programming language to learn, or should I learn R or Python? My short answer is that R is an elegant data-first programming language that enables your reproducible data science analysis and workflow. Additionally, R, RStudio and the tidyverse are actively engaged in creating a supportive community. So I know that choosing a programming language can feel like a hard question. And my advice is don't be fooled by prescriptive bravado. Pick a good, functional, object-oriented language like R, learn the syntax, and then focus on the analysis. So if you want to hear some longer version of that opinion, stick around for the next four minutes. But feel free to go on to other sections, stay engaged, do the exercises, and learn more R. The last thing I want to do is talk briefly about how to choose a programming language. I get this question quite a bit. I teach workshops on R and how to learn how to use R. And oftentimes I'll get somebody who will want to know, well, should I use R or should I learn Python? I'm going to put some effort into this, which one should I learn? And my answer to you is nine times out of ten, it probably doesn't matter, especially if your goal fits cleanly with what R really does well. R is a data-first programming language. It's good for analyzing data, right? So if you have a data set and you want to use some computational cycles to analyze patterns in the data, R is ready-made for that. Now, it's true that other programming languages have other strengths. For example, JavaScript is really good for web publishing. And Python, as it turns out, is really good for general programming. So what is general programming? Well, maybe you want to make an app. Maybe you want to manipulate all of the files on your local file system. A lot of those things may be, may be easier in Python. But they're also all possible in R. And there are very few people who really need to be multi-lingual. So R is a great programming language for the university and the academy, because a lot of what people are doing is analyzing data. And R is a data-first programming language. Again, Python is a general programming language. It's just fine. Both have lots of libraries and packages. So which programming language has the libraries and packages that are most relevant to you? Well, I would tell you that if you're doing a lot of statistical work, R is the one most likely to have the packages and libraries that are relevant to you. Another question is, is there a supportive programming community? For example, at Duke, or really worldwide, we share this. We have the RFun series. Right? We can go to RFun and find a whole bunch of workshops on how to learn how to use R. There's also the RStudio community, which is a really nice communication board that covers a whole bunch of different topics. Tidyverse, Shiny, R Markdown, teaching RStudio Cloud. If you have a question, machine learning, if you have a question about R or how to use R, this is a great community to start asking your question. They really like reproducible examples. We can talk about that later. Try your best to make the question easy to answer. There's another community called RLadies, which is international. And so here locally in Durham, North Carolina, there's a group called RLadiesRTP. Now, I do want to address this one thing. Many people will tell you that machine learning is best with Python. And maybe if you're doing cutting edge machine learning, that might be true. But again, going back to supportive community, there are plenty of resources for using R with machine learning. Here's a website, just one website, has a bunch of get started information, has a bunch of learn information for their help. It may be that some packages come out really quickly in Python, but they will eventually come out in R as well. And chances are, you are not only a machine learning programmer or analyst. Chances are you're doing lots of different kind of data analysis. So I just want to point out, it is not true that you can only do machine learning with Python. It may be true that they have a bigger community. So if that's your focus, you might want to look into that. But don't discount R for some perception that you're going to do a lot of machine learning when maybe you're not going to do as much as you think. Lastly, I just want to note that there's a really good article right here on Medium called How to Choose a Programming Language, written by Jun Lu. How to Choose a Programming Language for a Project, which questions to ask. This is an excellent article. And then finally, I just want to note that sometimes people get very religious about their programming language. And they are just dying to tell you why their programming language is best. In one way, I'm no different. I'm teaching a workshop series on R. I think R is really elegant. It's a data-first programming language. It leans towards reproducibility, which is really important in the economy. It's really important for battling against the crisis of reproducibility. But generally speaking, when someone tells you only their programming language will do X computation, that probably is not your use case. So if you want to get religious about it, there's one more link here. How to Choose a Religion. And you can run through that section to learn more about how you make difficult choices. Thanks very much for listening. Check back to our other videos in this learning series.