The keyboard shortcut for running a line or a selection of lines of code is: Those packages will always be available to you, every time you open R-Studio, provided you load them at the start of your session. and watch the console show you R installing the packages you have requested. … or (in Windows) press the buttons CTRL-enter together, alternatively (in Mac OS) press the cmd-enter buttons together … to highlight the command, hold down the left mouse button, drag the cursor from the start to the finish of the command Highlight the command in the script window … Install.packages("ggplot2", "reshape2", "plyr", "languageR", packages for drawing plots ( ggplot2) or for modelling data ( lme4).Ĭopy then paste the following command into the script window in R-studio: We install packages of functions that we will be using e.g. We can start by adding some capacity to the version of R we have installed. Install then load a library of functions (ggplot2) I look at the Workspace a lot when using R-Studio, and no longer look at (but did once use) History much.Ģ. History shows you the commands you execute as you execute them. plots, models) that you are creating in your R session.Ģ. Workspace will show you the functions, data files and other objects (e.g. If you look on the top right of the R-Studio window, you can see two tabs, Workspace and History: these windows (they can be resized by dragging their edges) also reflect what you do:ġ. The console reflects your actions in the script window. You can type and execute commands in it but mostly you will see unfolding here what happens when you write and execute commands in the script window, circled below: It is what you would see if you open R directly, not using R-Studio. This circled bit you see in the picture below: the second move is a keyboard shortcut for the first, I prefer keyboard short cuts to mouse moves in Windows, just press the buttons ctrl-shift-N at the same time or in Mac OS, press the buttons command-shift-N together –move the cursor to file – then – new – then – R script and then click on the left mouse button What you will need to do next is go to the file menu and create a new R script: To get started, in Windows, double click (left mouse button) on the R-Studio icon. use it to draw a plot.ĭepending on what you did at installation, you can expect to find shortcut links to R (a blue R) and to R-Studio (a shiny blue circle with an R) in the Windows start menu, or as icons on the desktop. install then load a library of functions (ggplot2) and 3. Start a new script in R-studio, install packages, draw a plot Now we are ready to get things done in R. We won’t be using R directly, we will be using it through RStudio.Ĭlick on the R-studio icon – it will pick up the R installation for you. Go ahead and click on the R icon, check it out, then go to the R menu and click on ‘Quit R’ to leave it, don’t save the workspace image (you’ll be asked if you want to or not). R console, version 3.0.1, as seen on an iMac If you click on the R icon you will get to see bare R, the console, which will look like this: In Mac OS, you will see the R and RStudio icons appear in the applications shown by Launchpad. Depending on what you said in the installation process, you might also have icons on your desktop. Having installed R and R-studio, in Windows you will see these applications now listed as newly installed programs at the start menu. I believe you can install R-studio without such rights using the zip/tarball dowload. What happens next depends on whether you have administrative/root privileges on your computer. You can just click on the link to the installer recommended for your computer. If you google “R-studio” you will get to this window:Ĭlick on the “Download now” button and you will see this window:Ĭlick on the “Download RStudio desktop” and you will see this window: Having installed R, the next thing we will want to do is install R-studio, a popular and useful interface for writing scripts and using R. at “install R for the first time”).Īnthony Damico has produced some great video tutorials on using R, here is his how-to guide:Īnd moonheadsing at Learning Omics has got a blog post with a series of screen-shots showing you how to install R with pictures. How do you download and install R? Google “CRAN” and click on the download link, then follow the instructions (e.g. Revise how to install R, as previously discussed here and here.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |