R - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

R

Description:

A data handling graphics system with particular emphasis ... concatenate' Assignment. operators. Plotting. Arguments. Type help (' whatever ') Eg. help('rnorm' ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 16
Provided by: RogerB99
Category:

less

Transcript and Presenter's Notes

Title: R


1
R
  • Roger Barlow
  • HEP Computing seminar
  • 21st February 2008

2
What is R?
  • A data handlinggraphics system with particular
    emphasis on statistical tools
  • Compare and contrast PAW, Root, Easyplot, Matlab

3
Getting hold of R
  • Google R download and follow instructions
  • Quite painless
  • Windows and unix versions exist

4
Philosophy
  • 1.1 The R environment
  • R is an integrated suite of software facilities
    for data manipulation, calculation and graphical
    display. Among other things it has
  • 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 directly at the computer or on
    hardcopy,
  • and
  • a well developed, simple and effective
    programming language (called S) which includes
    conditionals, loops, user defined recursive
    functions and input and output facilities.
    (Indeed most of the system supplied functions are
    themselves written in the S language.)
  • 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.

5
What do you get?
Help button Gives help And manuals
Command line for entering instructions
Screen where plots appear
6
Example simple stuff
7
Assignment and vectors
c means concatenate
Assignment operators
8
Plotting
9
Arguments
  • Type help
  • (ltwhatevergt)
  • Eg
  • help(rnorm)

10
More plotting
11
Other plots
12
Functions and scripts
13
What was in the source file
  • print("Loading Fourier routines")
  • PIBY2lt-asin(1) PIlt-2piby2 TWOPI2PI
    ROOT2PIsqrt(TWOPI)
  • alternationlt-function(n) 2(seq(1n) 2)- 1
  • fourierlt-function(data,lo,hi)
  • nbins lt- length(data)
  • nnround(nbins/2)
  • W lt- hi-lo
  • delta lt- W /nbins
  • iilt-seq(1,nbins)-1
  • xlt-deltaiilo
  • thetalt-xtwopi/W
  • fclt-seq(1,nn)
  • fslt-seq(1,nn)
  • for(i in seq(1,nn))
  • fcilt- sum(cos(itheta)data)
  • fsilt- sum(sin(itheta)data)
  • fcnnfcnn/2
  • fsnn0

14
Files and stuff
  • For hardcopy
  • gtpostscript(ltfilenamegt)
  • gt plotting
  • gtdev.off()
  • Also png(ltfilenamegt) and others
  • File input
  • gtsread.table(ltfilenamegt")
  • gtprint(sV1)
  • gtplot(sV1,sV2)
  • etc
  • Or read.table(ltfilenamegt,HEADERTRUE)
  • And first line of file will be taken as names
    used instead of V1, V2

15
Interested?
  • Type demo() at the prompt
Write a Comment
User Comments (0)
About PowerShow.com