MATT DENNY: Hi, everyone.This is your instructor Matt Denny,and welcome to this lecture on setting upRStudio's appearance, and more generally,just getting sort of acquainted with RStudio.So we've now downloaded R, and thenwe've downloaded RStudio, which I've mentioned,is an integrated development environment for R. Ithas a lot of this add-on functionality
MATT DENNY [continued]: and now I'm going to talk you through some of the settingsin a series of two videos that I'm going to do.I'm going to talk you through some of the settingsthat I have set in RStudio that I find make it morehelpful to me as a tool to write good R codeand understand what's going on and be an efficient programmer,and make it also easier to learn how to program.
MATT DENNY [continued]: So we're going to cover setting up the appearance of RStudio--primarily, to make it look cool of course.Just kidding.But not really kidding, actually.It is cool to make your programminginterface, your IDE, look cool, but also to makeit a lot more efficient to use.And so we're going to cover thingslike themes and formatting and window layout
MATT DENNY [continued]: that I have found over the years to be at least whatworks for me the best in terms of how to set up RStudio.So with that, let's get into the nitty-gritty.I'm going to head over to my desktop,and we're going to open up RStudio.OK, so I'm over here on my desktop,and I've got RStudio set up and ready to go.
MATT DENNY [continued]: Now, the first time that you open RStudio, particularlyon a Mac, it might say, hey, you've downloaded this thingfrom the internet.Click on this button to allow yourself to open it.And it might do something similar on Windows.Say yes.RStudio is good, clean, not buggy--well, sometimes buggy, but certainly notvirus-infested software.
MATT DENNY [continued]: You can trust it.The folks that make it are really goodand really diligent.And so we're going to open up RStudio.And you're going to get somethingthat does not look like this.So try as I might, I've actually found it very hardto make RStudio revert back to the waythat it looked when I got it the very first time right outof the box.
MATT DENNY [continued]: This is how I set up RStudio.And I'm going to talk you through how I set up RStudio.So one of the first things you're going to noticeare these little gray lines here.You can actually adjust these around.They're called panes in RStudio, and you'regoing to have access to four different panes in RStudio.
MATT DENNY [continued]: And so I'm going to talk you through each of these.But before I do, I'm going to show youhow to actually make your panes look the same way that mine do.And so to do that on either Windows, Linux, or a Mac,you're going to click on the Tools tab up topand then select Global Options.
MATT DENNY [continued]: So that's your first goal right there,is to select Global Options.And this is going to take you to the options, the setupoptions for RStudio.Now, I haven't really told you what RStudio does yet,but just so that we're all on the same pagethat everything looks good, I wantto start by taking you through the pane layouts.So you're going to click on this little button herefor the pane layout.And it's going to give you these little drop-down menu where
MATT DENNY [continued]: you can change what goes in each of these fourpanes, corresponding to one, two, three, and four paneshere.So the source is what I'd like to put in the top left.So what source is--the way that RStudio works, it's like a text editor put nextto just the vanilla R console.
MATT DENNY [continued]: So if we were to open up just base R, what we'd getis, we get just this big white box.And we can type stuff into it, and it willand it will return us answers.It's just a console.It's like a portal to send commands to the R language,and then R will return answers to us in this portal.
MATT DENNY [continued]: What this R console here that comeswith the base version of R--that is what lives over here in the console window, whichI tend to find works well on the top right,and then I put source on the top left.And I give source the most space.Source is like a text editor.And what that means is that we'regoing to actually write all of our R commandsin the source window.
MATT DENNY [continued]: So we're going to actually write down commandsthat we want to then later enter into our R console.But whereas commands that we entered into the Rconsole-- they're just gone into the void.You enter them, and then you can't get them back.It doesn't save them for you.If we save them in something called an R script file,which is kind of like a Word document or an Excel
MATT DENNY [continued]: spreadsheet or anything else--it's a type of file.It's actually closest to a plain text file.It has a .R, a dot capital R extension,instead of a .txt or a .docx extension.And what it is--it's basically a plain text file that your computer says,
MATT DENNY [continued]: oh, this contains R commands.And so that's actually where we'regoing to be storing a lot of our commandsSo I like to put the source here,because this is the biggest window, the one that Iwork in the most often.And then my console in the top right.So this is where we're going to enter in our R commands.Oftentimes, we don't actually need that much space for it.The next thing that I would definitely suggest you do is--
MATT DENNY [continued]: so you have all of these other panes that will thenpop up in the bottom two slots.And these are just other useful add-on things that RStudiogives you that you can see.I would suggest putting in the bottom-right paneyour environment, your plot, your help, and your viewerwindow.So check these boxes here, and then check
MATT DENNY [continued]: the rest of the boxes in your bottom left.So these six boxes are honestly onesthat I don't use very much, and so I oftentimeswill hide this pane or make it very small.It's not something that I use a whole lot.Whereas the environment in particular,but also your plots and help files--I want those big, and I want them to pop up.I want to be able to see those at the same time
MATT DENNY [continued]: as I'm entering in my R commands into the consoleand then I'm actually editing R scripts overin my source window.So if you click Apply, you're goingto get out something that looks kind of the same as whatI have here.And so I just want to quickly touchon what all of these different parts do.So what your environment window will do is,it will actually show you the variables
MATT DENNY [continued]: that you're going to create R. Areand this is something we're going to get into.But in R, you're going to be creating the objects thatwill hold data for you, also the different data structures.And you'll be able to see them.You'll be able to physically see or visually seea list, an inventory of all the different things you've created
MATT DENNY [continued]: here in the Environment window.If you create plots, they'll show up in this little panehere in the Plots window.And it even has a button to export plots.Also, help.So here we are.I've got some help files pulled upfor connecting to the Twitter streaming API, whichis something that we're going to actually do laterin this course.
MATT DENNY [continued]: And the viewer window is another thingthat will help you view objects in R.But these are really useful.Again, the R console.It's the basic console.It's the place where we're going to enter the commands And thenover here, this big thing right hereis where we're going to type R commands.
MATT DENNY [continued]: And there will actually be some cool waysthat we can actually get these commands from hereover into the R console automatically.And we'll go over those in the next video.So the next thing I want to do-- so let'sgo back to Tools and Global Options.And just quickly, before we move on,we're going to ignore all the panes down here.They'll have some uses that we might go over
MATT DENNY [continued]: in the later videos.But in general, they're not ones that Iuse very often, so I hide them.And again, you can adjust the size of these windowsall you want.So the next thing we're going to do-- we'regoing to go back to Tools, Global Options,and we're going to click on Appearance.And so what Appearance will let you do
MATT DENNY [continued]: is let you do three things.It'll let you select your font.So I'm using Monaco as a font, but you can pickwhatever kind of font you want.It will let you select your font size.So I'm using a pretty big font size right now.I'm actually recording this on a pretty large 4K monitor,but in order to make the code viewable for you,especially if you're viewing this on a smaller screen,
MATT DENNY [continued]: I am setting my font size to 16.The coolest thing, the most useful thing here, the most funthing, is that you can select the colors that you wantto be displayed in your code.So for example, you can get a cool, dark one.So I like Pastel on Dark.
MATT DENNY [continued]: Vibrant Ink.Vibrant Ink is kind of cool.What are the other ones I've used?I don't know.You can just play around through all these different themes.Again, if you want maximum coolness factor,I definitely suggest something like Pastel on Dark.Or what was the other one that I really liked?
MATT DENNY [continued]: Cobalt's a little weird for my taste.I guess it is Pastel on Dark.And so if I were to apply this, what will happen is it,will turn everything black and.This will make you look more imposing and coolerif you're using R somewhere.The functions and commands and other things you writewill show up in different colors.This is just some example of what the colors will look like.
MATT DENNY [continued]: I am going to be using the Chrome theme, because that'sa very benign, basic theme that should be easy to read.But in general, you can pick a theme if you want,which can be really, really handy.And so the goal here is just to go oversome of the basics of setting up RStudio
MATT DENNY [continued]: so you can figure out how to make it look like mine does,change up your color themes however you want,your fonts, your font sizes.Get something that works for you.And so in our next video, I'm actuallygoing to go into some more of these other options,particularly related to the code and packages and someof the other stuff like that.
MATT DENNY [continued]: And we're actually going to get into how to make RStudiobe the most useful for you.One other point again.So this is our first time using RStudio.We haven't actually entered any R commands.And that might seem funny.But I think that spending the time setting up RStudiocorrectly, even if you're not totally sure why you'redoing it, will actually be very helpful to youas you're going to actually learn R, learn
MATT DENNY [continued]: how to use R and RStudio.So again, these are my settings for how RStudio should appearI would suggest you try them out at least at first,and you can always come back and change how things look later,depending on what optimizes your workflow.But thanks for watching this video,and I'll see you back for a part two in the next lecture.
Series Name: Practical Data Management with R
Publisher: SAGE Publications Ltd
Publication Year: 2017
Segment Num.: 1
Matt Denny explains how to setup and configure RStudio panes and appearance for maximum productivity.
Looks like you do not have access to this content.
Matt Denny explains how to setup and configure RStudio panes and appearance for maximum productivity.