10
A very short introduction to R Pia Wohland

A very short introduction to R Pia Wohland. R is… -A statistical software -Programming language -Free! -Very good in handling and manipulating data sets

Embed Size (px)

Citation preview

Page 1: A very short introduction to R Pia Wohland. R is… -A statistical software -Programming language -Free! -Very good in handling and manipulating data sets

A very shortintroduction to R

Pia Wohland

Page 2: A very short introduction to R Pia Wohland. R is… -A statistical software -Programming language -Free! -Very good in handling and manipulating data sets

R is…

-A statistical software-Programming language-Free!-Very good in handling and manipulating data sets

-very comprehensive, easy to learn

-large community, with many contributors-well supported mailing list-additinal packages written by users

-Works with command linebut some graphical user interfaces (GUI) available: R-Commander, Rpad, SciViews-R

•Info on R http://www.r-project.org/•Download software http://cran.r-project.org/

Page 3: A very short introduction to R Pia Wohland. R is… -A statistical software -Programming language -Free! -Very good in handling and manipulating data sets

http://addictedtor.free.fr/graphiques/Graphics White British White Irish Other White W & B Caribbean

W & B African White and Asian Other Mixed Indian

Pakistani Bangladeshi Other Asian Black Caribbean

Black African Black Other Chinese Other Ethnic Group

Maps

Create your own functionsSee an example in the Practical this afternoon!

Statistics

Manage your data

Page 4: A very short introduction to R Pia Wohland. R is… -A statistical software -Programming language -Free! -Very good in handling and manipulating data sets

R under windows

> Command prompt

Page 5: A very short introduction to R Pia Wohland. R is… -A statistical software -Programming language -Free! -Very good in handling and manipulating data sets

You can type your commands directly at the command prompt (>) or you can use theEditor window. The advantage of the editor is, you can save your script straight away.

Page 6: A very short introduction to R Pia Wohland. R is… -A statistical software -Programming language -Free! -Very good in handling and manipulating data sets

> help() # opens help > help.start() # opens R-Documentation in a browser window> help(command) # shows help on “command”> ?command # shows help on “command”> library() # Shows which packages are loaded?> library(help="graphics") # Shows help for package “graphics”

For example> ?plot

Help youRself....

Page 7: A very short introduction to R Pia Wohland. R is… -A statistical software -Programming language -Free! -Very good in handling and manipulating data sets

Package the command belongs to

How to useWhat arguments, and their default settings

Page 8: A very short introduction to R Pia Wohland. R is… -A statistical software -Programming language -Free! -Very good in handling and manipulating data sets

Always examples at the bottom

Links to related subject

Page 9: A very short introduction to R Pia Wohland. R is… -A statistical software -Programming language -Free! -Very good in handling and manipulating data sets

Essentials:R is case sensitive!

(beware auto correction)

Decimal separator `.´ not`,´Character strings are placed in “ “Where are my data?To find out in which directory R is working: getwd()To change the directory: setwd(“pathname”)Caution:setwd(“C:\\SummerSchoolPracticals“)setwd(“C:/SummerSchoolPracticals“)When importing your own data: best no spaces in header.

2.718282,71828

Page 10: A very short introduction to R Pia Wohland. R is… -A statistical software -Programming language -Free! -Very good in handling and manipulating data sets