Skip to main content

Introduction to R

R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues. R can be considered as a different implementation of S. There are some important differences, but much code written for S runs unaltered under R.


R provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering, …) and graphical techniques, and is highly extensible. The S language is often the vehicle of choice for research in statistical methodology, and R provides an Open Source route to participation in that activity.


One of R’s strengths is the ease with which well-designed publication-quality plots can be produced, including mathematical symbols and formulae where needed. Great care has been taken over the defaults for the minor design choices in graphics, but the user retains full control.


         R is available as Free Software under the terms of the Free Software Foundation’s  GNU General Public License in source code form. It compiles and runs on a wide variety of UNIX platforms and similar systems (including FreeBSD and Linux), Windows and MacOS.


The R environment

R is an integrated suite of software facilities for data manipulation, calculation and graphical display. It includes an effective data handling and storage facility,a suite of operators for calculations on arrays, in particular matrices,a large, coherent, integrated collection of intermediate tools for data analysis,graphical facilities for data analysis and display either on-screen or on hardcopy, and a well-developed, simple and effective programming language which includes conditionals, loops, user-defined recursive functions and input and output facilities.


The term “environment” is intended to characterize it as a fully planned and coherent system, rather than an incremental accretion of very specific and inflexible tools, as is frequently the case with other data analysis software.


R, like S, is designed around a true computer language, and it allows users to add additional functionality by defining new functions. Much of the system is itself written in the R dialect of S, which makes it easy for users to follow the algorithmic choices made. For computationally-intensive tasks, C, C++ and Fortran code can be linked and called at run time. Advanced users can write C code to manipulate R objects directly.


Many users think of R as a statistics system. We prefer to think of it of an environment within which statistical techniques are implemented. R can be extended (easily) via packages. There are about eight packages supplied with the R distribution and many more are available through the CRAN family of Internet sites covering a very wide range of modern statistics.


R has its own LaTeX-like documentation format, which is used to supply comprehensive documentation, both on-line in a number of formats and in hardcopy.


R/RStudio Setup Guide

Prerequisites for RStudio

§  Any version of R (2.11.1 or higher)

 Installation of R on a Windows 7 operating system

§  Download the latest precompiled binary distributions from CRAN website [http://www.rproject.org/]
§  Only the base package is required for this installation. (At the time of writing the latest version of R is R-2.15.1)
§  Follow the instructions on the website to complete the installation of R
§  Once completed, launch RGui from the shortcut. Or you can locate RGui.exe from your installation path. The default path for Windows is "C:\Program Files\R\R- 2.15.1\bin\x64\Rgui.exe"
§  Type help.start() at the R-Console prompt and press Enter. If you can see the help server page then you have successfully installed and configured your R package (See screenshot below),




Installation of RStudio IDE on Windows 7 operating system

§  Download the latest version of RStudio IDE for your Windows platform from
http://rstudio.org/download/desktop
§  Start the installation and follow the steps required by the Setup Wizard
§  Once completed, launch RStudio IDE from Start -> All Programs-> RStudio -> RStudio.exe or from your custom installation directory. The default installation directory for RStudio IDE is "C:\Program Files\RStudio\bin\rstudio.exe"
§  Type help.start() at the RStudio prompt and press Enter. If you can see the following screen then you have successfully installed and configured RStudio IDE to run with R.
§  Download all R-Scripts from http://r-project.org
§  Extract/Unzip all R-Scripts to a folder location you want. For example "C:\Imran\R\"
§  All R-Scripts make use of the required utility functions implemented by EMTSUtil.R. Make sure that this file exists in your extracted directory and make sure you have installed the required packages/library for the text book exercises.
§  Set your working directory to your R-scripts using the command,
setwd(dir) For example, setwd("C:\Imran\R")

  Alternatively you can use RStudio's Tools Menu: Tools -> Set Working Directory -> Choose Directory...


§  To run a script, open the script in RStudio's script editor and choose "Source" from the menu or
the following command at the Console prompt,
> source('C:/EMTS/R/stsm_simulate.R')
> stsm_simulate()


If you can see the results below then you have successfully configured RStudio IDE with R and the required packages for the exercises of the book. If not, please go through steps 4-9 again.


Installing additional packages with RStudio IDE

The following is a list of the additional packages for the EMTS book,

§  scatterplot3d
§  ks
§  matlab
§  numDeriv
§  nlme
§  KernSmooth

All required packages can be downloaded from the CRAN Repository or installed directly, along with any dependencies, by issuing the following command,

install.packages("scatterplot3d") at the R-Console or RStudio IDE prompts.

For further options please refer to R Documentation (?install.packages).

Alternatively, you can easily install each of these packages using RStudio IDE by clicking the “Install Packages" button of the IDE and you will be asked to create a personal library directory (See screenshot),


Comments

  1. I like your all post. You have done really good work.
    Thank you for the information you provide, it helped me a lot.

    KeepVid Pro Crack

    ScriptCase Crack

    R-Studio Crack

    ReplyDelete
  2. After reading some blog posts on your site,
    Thanks for writing this blog.
    We've added a list of bookmarks and will be back soon.
    Please also visit my website and tell us what you think.
    Thank you for your work, thank you for sharing it.
    Crackurl Full Version softwares
    R-Studio Crack

    ReplyDelete

Post a Comment