An Introduction to GNU-R Image of Manchester Mark 1 used with the kind permission of the School of Computer Science, The University of Manchester
“The best thing about R is that it was developed by statisticians. “The worst thing about R is that… it was developed by statisticians.” Bo Cowgill, Google
What we'll be covering ● What is R? ● Why and when should one use R? ● Programming in R – data structures and methods ● Graphical User Interfaces and Programming Interfaces ● Tour of Packages and Features ● Links/ Further reading ● Questions
What is R? ● System for statistical computation and graphics ● Run-time environment ● Debugger ● System functions ● Script files – batch process ● Copyleft/ Official GNU project ● Functions written in R, S, C++ and Fortran ● Object-oriented
Why and when should one use R? ● Free and open source ● Good support base: documentation/ useRs ● Big data ● Complex or statistical analysis – object orientation ● Batch processes ● Analytical functions ● Pretty graphics ● Spreadsheets are better for basic input and sharing ● Databases are better for non-aggregate manipulation
● Programming in R data structures and methods ● Primitives: character, vector, matrix, data.frame ● Sub-scripts to access variables mylist$item mylist[20, c(“item”) ● Use vectors not loops log(c(23, 67.1)) == c(log(23), log(67.1)) and the apply family
● Graphical User Interfaces and Programming Interfaces RGUI, R-Commander (tcltk), RKWard (kde), JGR (java), Rattle, StatEt (eclipse), RExcel, SWord, RPy (-thon), RJava, RSRuby, Statistics::R (perl), gretl (econometrics), rggobi (visualisation), sage (maths), Rserve (apache), nexusBPM (JBoss), Emacs/ Vim etc
GUI: R Commander Functions/ packages Script/ Commands Output Errors/ Warnings
● Tour of Packages and Features ● GGPlot2 ● XTable ● Statnet/iGraph ● SQLDF ● Spatstat ● ar=all ar=all
GGPlot2
● Links/ Further reading ● Main site: ● Manual: intro.html ● Getting data in/ out: project.org/doc/manuals/R-data.html ● SPSS/ Stata users: ● Packages:
● Questions