Example: bachelor of science

A guide to Eclipse and the R plug-in StatET

A guide to Eclipse and the R plug-in StatETLonghow LamVersion 23-May-2010 Contents1. Acknowledgments .. Obtaining and installing the software .. The Eclipse system .. The StatET plug-in ..62. The basics of the Eclipse The Workbench and Perspectives .. Projects in Eclipse .. Creating a project .. Adding new resources to a project .. Adding existing resources to a project .. Adding Folders to a project .. Adding Linked Resources .. Working with text files .. Line numbers, Quick diff and Word completion .. The History of a file .. Comparing files .. Bookmarks and task tags .. Text/Code folding .. Searching for text .. A single file .. Multiple files .. Eclipse preferences ..203. The StatET Configuring R .. The new R Console in Eclipse .. Running R code .. The Cmd History and Queue views.

The Eclipse platform can be downloaded from the website www.eclipse.org, the latest version of the StatET works with Eclipse version 3.5.1. For windows, take some time to

Tags:

  Guide, Eclipse, A guide to eclipse and the

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of A guide to Eclipse and the R plug-in StatET

1 A guide to Eclipse and the R plug-in StatETLonghow LamVersion 23-May-2010 Contents1. Acknowledgments .. Obtaining and installing the software .. The Eclipse system .. The StatET plug-in ..62. The basics of the Eclipse The Workbench and Perspectives .. Projects in Eclipse .. Creating a project .. Adding new resources to a project .. Adding existing resources to a project .. Adding Folders to a project .. Adding Linked Resources .. Working with text files .. Line numbers, Quick diff and Word completion .. The History of a file .. Comparing files .. Bookmarks and task tags .. Text/Code folding .. Searching for text .. A single file .. Multiple files .. Eclipse preferences ..203. The StatET Configuring R .. The new R Console in Eclipse .. Running R code .. The Cmd History and Queue views.

2 The Object Browser .. The Outline view .. The StatET preferences and their corresponding features .. Code templates .. Code generation .. Syntax coloring .. R Code formatting .. R Editing Options .. Some StatET shortcuts .. Writing R help files .. R CMD tools .. Converting Rd files .. Building an R package ..37 Appendices37A. Some Eclipse variables38 Bibliography38 Index392 List of The Eclipse workbench.. The install dialog with the StatET libraries to install.. The Eclipse installation details.. A group of tabs that can be customized.. The available perspectives in the Eclipse workbench.. The available project types in the Eclipse .. The new project in the navigator view.. Folders in a project.. Linked resources in a project.. A tab group with different text editors.. Multiple text files visible.

3 The gutter with line numbers and Quick Diff .. The history view that lists all the versions .. The Compare Editor allowing the user to browse through changes betweenversions .. Bookmarks in a text file .. Tasks in a text file help you to remember to finish uncompleted tasks .. Code in a folding area and code that is collapsed.. The Find / Replace dialog .. The search dialog allows the user to search in multiple files .. The search view that displays locations of the search string.. The preferences dialog.. Setting up an R environment .. Adding an R Environment .. The run dialog to configure the internal R console.. The Run As button menu high-lighted on the toolbar.. The R console inside Eclipse , with an extra line to enter R statements.. Little R button on the Eclipse toolbar.. Run function definition. Place the cursor in a function definition and useCtrl+r, Ctrl+F.

4 The History view with previously entered or submitted statements.. The Queue view displaying statements that are waiting to be executed.. The object browser.. The outline view.. The available code templates.. Inserting a new code template .. The preferences dialog for setting syntax coloring .. The preferences dialog for setting syntax coloring .. A project consisting of R help files.. The External Tools dialog to set R command tools.. Quick link on the toolbar to external tools.. Building an R package from the external tools..3741. IntroductionThe open source data analysis system R has gained a lot of attention, not only becauseit is freely available. It has proven to be an effective tool for data manipulation, dataanalysis, creating graphs and developing new (statistical) methods. R has welcomedmany new users (from other systems) over the last years.

5 This guide will not explainhow to use R. See the R manuals [1] or the introduction to R document [2] that can bedownloaded from for a detailed introduction to the R system. Thepurpose of this guide is to introduce the Eclipse Platform and the plug-in StatET for base R system does contain an editor for writing R code. However, users will soonfind out the limited capabilities of the internal editor. In principle any text editor canbe used to write R programs (scripts). However, this document describes Eclipse for thefollowing reasons: Like R, Eclipse is open source. It is freely available from Although it is free, Eclipse does contain many features that a good editor shouldhave. It is more than a text editor, it is an environment that allows you to easily maintainmultiple R scripts in the form of addition, the Eclipse Platform is an open environment that can be extended.

6 Itallows users to write so called plug-ins. Such a plug-in can customize the Eclipse envi-ronment for a certain programming language or for a certain task. The plug-in StatET for R, created by Stephan Wahlbrink ( ) adds the followingfeatures: Run R code in Eclipse by sending it to the R GUI or in a special R consile in theEclipse environment. Syntax coloring of R key words. Browsing for R objects in a dedicated Object Browser. Insert predefined blocks of R code (templates). Supports writing R documentation files (*.Rd files) and Sweave files. Run R CMD tools from 1. ACKNOWLEDGMENTSThe remainder of this guide will first describe the basics of Eclipse and then the featuresof the StatET plug AcknowledgmentsI want to thank Stephan Wahlbrink for giving me Eclipse tips and tricks, descriptionsof his StatET plug-in and for giving me feedback on this Obtaining and installing the The Eclipse systemEclipse is a Java program, so it needs the Java Runtime Environment (JRE) to need JRE version or above, which can be downloaded from Eclipse platform can be downloaded from the website , the latestversion of the StatET works with Eclipse version For windows, take some time todownload the 200 MB zip file.

7 The installation is straight forward no installation wizardhas to be run. Since Eclipse does not alter the Windows registery just unzip the zip fileto any location you want, for example to C:/Program Eclipse by starting During the start Eclipse will ask the user to chooseaworkspace folder. This folder is the default location that Eclipse will use will to storeprojects, see section The StatET plug-inThe StatET plug-in can be installed from within Eclipse . Go the Help menu, then select Install New . In the Install dialog type in in the Workwith field. In the lower part of the Install dialog you will see the libararies that need to beinstalled. Select them all and click Next or Finish. Eclipse will now install theStatET the plug-in is installed Eclipse must be restarted. One way to see if the plug-inis installed is to go to the Help menu and select About Eclipse then click the button Installation details and a list with all the plug-ins will appear as in Figure 1.

8 OBTAINING AND..Figure : The Eclipse 1. OBTAINING AND..Figure : The install dialog with the StatET libraries to : The Eclipse installation The basics of the EclipseEnvironmentBefore explaining the specific R features provided by the StatET plug-in , a few basicEclipse features are explained. You will find these features very handy, not only fordeveloping R programs. For a complete description of all the features of Eclipse , see theonline Eclipse documentation [3]. The Workbench and PerspectivesThe termworkbenchin Eclipse refers to the development environment on the contains different windows, editors and views which are categorized in tab groups, asdisplayed in Figure The views that are organized by tab groups are not staticthey can be dragged to different locations to suit your preferred layout. Select a tab anddrag it to some other : A group of tabs that can be workbench contains one or moreperspectives.

9 A perspective is a set of views andlayout of tab groups, it is designed to facilitate the user to do a specific task. Forexample, the Java perspective helps the user write Java code by displaying certain viewsthat are useful while editing Java the StatET plug-in is installed then the StatET perspective is available withinthe Eclipse workbench. To open this perspective: Go to the Window menu and select Open perspective . A list of perspective (as in Figure ) will appear when Other isselected. Now select StatET .9 CHAPTER 2. THE BASICS OF THE.. PROJECTS IN ECLIPSEF igure : The available perspectives in the Eclipse Projects in Creating a projectThe main structure in Eclipse to organize your work is aproject. To create and edit Rscript files you need at least one project. To create a new project: Go to the File menu and select New>Project.

10 A New Project dialog as in Figure will : The available project types in the Eclipse . Select R-Project in the StatET folder, and click Next . Type a name for the project and choose a location for the project. Eclipse willchoose by default the workspace folder as the location for all new projects. At10 CHAPTER 2. THE BASICS OF THE.. PROJECTS IN Eclipse this location Eclipse will create a new folder (named after the project name), andit will put all relevant project information in this folder. A new project is created and it will be visible in the Project Explorer view or Navigator view, as displayed in Figure : The new project in the navigator a project has been created it acts as a sort of container, new or existingresourcescan be added to the project. These resources could be any type of file, for example ajpeg picture an mp3 music file. In the case of an R project the resources are usually Rscript files, so plain text files with the extension.


Related search queries