 Welcome back everyone. So today we're going to be installing RStudio which is kind of like a program that lets us do statistical programming. So we're going to use the R language which is pretty much the standard language and RStudio is one of the standard semi-standard pseudo-standard programs for doing statistical programming. A lot of very big organizations use RStudio now or R language and yeah just it's becoming very very popular. So we're going to go ahead and install it because that's what we're going to be using in this course to do statistical programming and actual real statistics not just the theory okay. So the first thing you need to do is get R and R itself is just a programming language that you need to download and install on your computer. I'm running on a Windows computer for this example but you can just go to cloud.r-project.org and then at the top of that page they have different downloads for Linux OS X and Windows. So since I'm on Windows I'm just going to click and then we want to download base base. So it says binaries for the base distribution. If you are installing R for the first time this is what you want okay. So just click on base and then at the top download version 3.6.3 and if you click that then the download will start immediately. So you want to download that and I already have downloaded it here. It just looks like a normal installer like you would normally have okay. So actually I'm going to go ahead and install that now. So the installation process is pretty much like normal for Windows. Say yes and then choose the language you want to use. The language doesn't really matter that much. I'm putting it in the program files folder the w signs are for the one symbol this is just like a backslash. I'm going to include all of the files. I don't need to include 32-bit files because my system is 64-bit. Yours is probably also 64-bit but let's just keep everything. It's not that much space and then accept defaults and then click next and then yeah click next. So basically you can accept all of the defaults for that. Now the thing that I have seen a couple times is if your Windows username is in Hangar then sometimes R can have trouble running. I'm not really sure why but if your username is in Hangar instead of English characters there could be an issue. I don't know if that's been fixed. I saw the problem a couple years ago. So click finish and then now we have R installed. So you can see R 64-bit and R these are the two different versions. If you click on it you get this little R window. So for example we can type demo and then that will give us some things. But this interface is really inconvenient to use let's say. You can program everything you want inside the R interface this way but it's much more difficult. So instead of using this directly we will use R studio to do our our programming. But now we know that R has been installed because it's running. I don't need to save the work piece. So now that we have R for Windows or Linux or whatever operating system you're running the next thing we need is R studio. So R studios at rstudio.com. Now all of these are free. You don't need to pay anything for any of these packages. So if you're asked for a credit card or anything you do not need to pay for it don't pay. So you can see the pricing there. They do have a paid version but we're not going to use that. So we want products and under open source we want R studio. So click R studio and then we want R studio desktop and we want the open source addition. So community pricing free and then download R studio desktop and then again choose your version and whenever you choose R studio desktop click download and then you'll finally get to the install R. So yeah so we've already installed R previously so this is done. Now we and downloaded R studio desktop by clicking here and then once that's done we can install. If you're on Mac OS X or Linux different installer packages exist for other operating systems as well. So you can use both R and R studio on Windows OS X and Linux. So you should be able to you should be able to get it working no problem. Okay so for most people you just want to click on this download R studio for Windows click on it and then it will start downloading this package manager. Now I've already downloaded it so I have R studio 125 EXE. So once the download is finished just double click on that and then you can install like normal click next program files R studio okay install okay then click finish and then you can get rid of the browser. Okay so now whenever you click on your start menu you should have R and R studio installed whenever you click on R studio you want to use the round R studio circle. We never need to open the R X 64 or I 386 icons. You do need them installed because they're kind of in the background but we won't really use them directly. So click on R studio and then it should just open up like this and you know that R is working. If you see this command like in the console you can see R version 363. If you don't see this or if R pops up with a message that says that it is looking for the version of R on your computer if that message pops up it means that you probably don't have R language installed properly so go back and do the first R install again. If this pops up then you are basically good to go. While we're in here I'll just talk a little bit about the different windows we'll start doing projects next week or later but the different windows basically we have the console this is for running different commands so let's see license so I'm running an R command license or this actually could be an R studio. I don't know this is an R command so I'm running an R command license that just shows the little software license that we have here this console is where we could type in different tasks or different commands and make R do what we want. Terminal is kind of the same deal except this is a windows terminal so we can type windows commands in here this lets us do things like create folders and files and modify things from the windows command this is not for statistical programming it's more for file management than anything okay and then jobs whenever we have a script that we want to run an R script the jobs panel shows what's currently running okay I wonder if clear works no okay so the environment so whenever we start making scripts and we start loading data into our studio the environment will tell us what variables exist and what values those variables have been set to it's really useful for trying to program to have a list of all your variables and their current values history is the commands that you've ran so for example if you want to run something over and over again let's say I want to run the license again I can just double click it and then press enter and it'll go again so then I can see exactly the commands that I've ran before um yep and then connections we'll talk about later so R is a statistical programming language but what that really means is that we use it to do statistics on something so whenever we are doing statistics we have some sort of data set normally like something we want to analyze and some question that we want to answer based on that so you'll use this files folder so for example we have this R this R folder but it doesn't have anything in it so in this files tab basically you'll keep track of your projects so R is a statistical programming language and what that means is that we're doing statistics on some sort of data set and we're trying to answer some sort of question well the data set itself is probably a file or multiple files that we need to keep track of the questions and the documentation or files we need to keep track of and then of course the results and any scripts that we make we also need to keep track of and then with our studio we can create for example graphics based on the data that we are analyzing and we need to keep track of those too so the files folder basically creates a working directory where all of your data can sit and you can access it very easily we'll talk more about that later and then for plotting whenever something is plotted basically you're creating the graphs based on your data packages R has a lot of packages created by contributors to the project you can write your own packages for doing a lot of different types of analysis and just basically adding additional support for things so we'll talk about those two and then the help of course our studio has quite a bit of help there's lots of tutorials also on using R and using our studio and then the viewer yeah for viewer okay so one of them I guess the two most important areas that I tend to work on is the home folder where I put all my scripts and have my projects directories all planned out and then I look at my environment variables quite often and then everything else is basically writing a script so for example if we go to file new file and I go to a new script or very often I use new markdown but let's do a new R script so now I have my script and I can just start typing whatever whatever I want for the programming then I can run my script and then it will run underneath and I can see my variables okay so we'll talk all about this but those are kind of the four main areas that you would use and we'll start scripting in R for some basic examples of how to do real statistics not just reading the book and doing theory right so that's it for today and installing R and installing R studio so please get those programs installed on your computer so you can follow along with the examples okay thank you very much