Now that we have RStudio installed, we should familiarize ourselves with the various components and functionality of it. RStudio provides a cheat sheet of the RStudio environment that you should definitely check out. Rstudio can be roughly divided into four quadrants, each with specific and varied functions plus a main menu bar. When you first open RStudio, you should see a window that looks roughly like this. You may be missing the upper-left quadrant and instead have the left side of the screen with just one region, console. If this is the case, go to "File" then "New File" then "RScript" and now it should more closely resemble the image. You can change the sizes of each of the various quadrants by hovering your mouse over the spaces between quadrants and click dragging the divider to resize this sections. We will go through each of the regions and describe some of their main functions. It would be impossible to cover everything that RStudio can do. So, we urge you to explore RStudio on your own too. The menu bar runs across the top of your screen and should have two rows. The first row should be a fairly standard menu starting with file and edit. Below that there was a row of icons that are shortcuts for functions that you'll frequently use. To start, let's explore the main sections of the menu bar that you will use. The first being the file menu. Here we can open new or saved files, open new or saved projects. We'll have an entire lesson in the future about our projects, so stay tuned. Save our current document or close RStudio. If you mouse over a new file, a new menu will appear that suggests the various file formats available to you. RScript and RMarkdown files are the most common file types for use, but you can also generate RNotebooks, web apps, websites or slide presentations. If you click on any one of these, a new tab in the source quadrant will open. We'll spend more time in a future lesson on RMarkdown files and their use. The Session menu has some RSpecific functions in which you can restart, interrupt or terminate R. These can be helpful if R isn't behaving or is stuck and you want to stop what it is doing and start from scratch. The Tools menu is a treasure trove of functions for you to explore. For now, you should know that this is where you can go to install new packages, see you next lecture, set up your version control software, see future lesson, linking GitHub and RStudio and set your options and preferences for how RStudio looks and functions. For now, we will leave this alone, but be sure to explore these menus on your own once you have a bit more experience with RStudio and see what you can change to best suit your preferences. The console region should look familiar to you. When you opened R, you were presented with the console. This is where you type in execute commands and where the output of said command is displayed. To execute your first command, try typing 1 plus 1 then enter at the greater than prompt. You should see the output one surrounded by square brackets followed by a two below your command. Now copy and paste the code on screen into your console and hit "Enter." This creates a matrix with four rows and two columns with the numbers one through eight. To view this matrix, first look to the environment quadrant where you should see a data set called example. Click anywhere on the example line and a new tab on the source quadrant should appear showing the matrix you created. Any dataframe or matrix that you create in R can be viewed this way in RStudio. Rstudio also tells you some information about the object in the environment. Like whether it is a list or a dataframe or if it contains numbers, integers or characters. This is very helpful information to have as some functions only work with certain classes of data and knowing what kind of data you have is the first step to that. The quadrant has two other tabs running across the top of it. We'll just look at the history tab now. Your history tab should look something like this. Here you will see the commands that we have run in this session of R. If you click on any one of them, you can click to console or to source and this will either rerun the command in the console or will move the command to the source, respectively. Do so now for your example matrix and send it to source. The Source panel is where you will be spending most of your time in RStudio. This is where you store the R commands that you want to save it for later, either as a record of what you did or as a way to rerun the code. We'll spend a lot of time in this quadrant when we discuss RMarkdown. But for now, click the "Save" icon along the top of this quadrant and save this script is my_first_R_Script.R. Now you will always have a record of creating this matrix. The final region we'll look at occupies the bottom right of the RStudio window. In this quadrant, five tabs run across the top, Files, Plots, Packages, Help, and Viewer. In files, you can see all of the files in your current working directory. If this isn't where you want to save or retrieve files from, you can also change the current working directory in this tab using the ellipsis at the far right, finding the desired folder and then under the More cog wheel, setting this new folder as the working directory. In the plots tab, if you generate a plot with your code, it will appear here. You can use the arrows to navigate to previously generated plots. The zoom function will open the plot in a new window that is much larger than the quadrant. "Export" is how you save the plot. You can either save it as an image or as a PDF. The broom icon clears all plots from memory. The "Packages" tab will be explored more in depth in the next lesson on R packages. Here you can see all the packages you have installed, load and unload these packages and update them. The "Help" tab is where you find the documentation for your R packages in various functions. In the upper right of this panel, there is a search function for when you have a specific function or package in question. In this lesson, we took a tour of the RStudio software. We became familiar with the main menu and its various menus. We looked at the console where our code is input and run. We then moved onto the environment panel that lists all of the objects that had been created within an R session and allows you to view these objects in a new tab and source. In this same quadrant, there is a history tab that keeps a record of all commands that have been run. It also presents the option to either rerun the command in the console or send the command to source to be saved. Source is where you save your R commands. The bottom-right quadrant contains a listing of all the files in your working directory, displays generated plots, lists your installed packages, and supplies help files for when you need some assistance. Take some time to explore RStudio on your own.