Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

First steps in RStudio

9.717 Aufrufe

Veröffentlicht am

RStudio is an integrated development environment (IDE) for R programming. In this short tutorial, you will get to know the key regions in the interface.

Veröffentlicht in: Daten & Analysen
  • Als Erste(r) kommentieren

  • Gehören Sie zu den Ersten, denen das gefällt!

First steps in RStudio

  1. 1. First Steps in RStudio Prof. Dr. Jan Kirenz
  2. 2. Prof. Dr. Jan Kirenz First Steps in RStudio l R code editor l The top left window is where you'll probably do most of your work. l That's the R code editor allowing you to create a file with multiple lines of R code. There you‘ll write your statistical commands. l For example, enter 2+2 and click on the „run“ button (see arrow) l You can use the hashtag character, #, for adding comments. R will not run anything that follows a hashtag on a line. 6 RStudio Source: Machlis, S. (2013). Get started with this popular programming language. Terieved from URL http://www.computerworld.com/article/2497143/business-intelligence/business-intelligence-beginner-s-guide-to-r-introduction.html
  3. 3. Prof. Dr. Jan Kirenz First Steps in RStudio l Interactive Console l Bottom left is the interactive console where you can type in R statements one line at a time. l Any lines of code that are run from the editor window also appear in the console. l The console is R's way of telling you what it's doing. l For example, let's use R like a calculator: try typing in 1+1 in the interactive console. 7 RStudio Source: Machlis, S. (2013). Get started with this popular programming language. Terieved from URL http://www.computerworld.com/article/2497143/business-intelligence/business-intelligence-beginner-s-guide-to-r-introduction.html
  4. 4. Prof. Dr. Jan Kirenz First Steps in RStudio l Workspace l The top right window shows your workspace, which includes a list of objects currently in memory. l There's also a history tab with a list of your prior commands; what's handy there is that you can select one, some or all of those lines of code and one-click to send them either to the console or to whatever file is active in your code editor 8 RStudio Source: Machlis, S. (2013). Get started with this popular programming language. Terieved from URL http://www.computerworld.com/article/2497143/business-intelligence/business-intelligence-beginner-s-guide-to-r-introduction.html
  5. 5. Prof. Dr. Jan Kirenz First Steps in RStudio l Plots l The window at bottom right shows a plot if you've created a data visualization with your R code. l There's a history of previous plots and an option to export a plot to an image file or PDF. l This window also shows external packages (R extensions) that are available on your system, files in your working directory and help files when called from the console. 9 RStudio Source: Machlis, S. (2013). Get started with this popular programming language. Terieved from URL http://www.computerworld.com/article/2497143/business-intelligence/business-intelligence-beginner-s-guide-to-r-introduction.html
  6. 6. Prof. Dr. Jan Kirenz First Steps in RStudio l Installing Packages l R only includes a basic set of functions. It can do much more than this, but not everybody needs everything so we instead make some functions available via packages. l You can easily install packages from within R if you know the name of the packages. l As an example, we are going to install the packages rafalib and downloader. Type this commands into the workspace: > install.packages(“ggplot2") l We can then load the package into our R sessions using the library function: > library(ggplot2) l From now on you will see that we sometimes load packages without installing them. This is because once you install the package, it remains in place and only needs to be loaded with library. If you try to load a package and get an error, it probably means you need to install it first. 10 RStudio Source: Irizarry, R. A. & Love, M. I. (2015). Data Analysis for the Life Sciences. Retrieved from URL https://leanpub.com/dataanalysisforthelifesciences

×