Chris Knight Beginners’ workshop.

Slides:



Advertisements
Similar presentations
Introduction to R Brody Sandel. Topics Approaching your analysis Basic structure of R Basic programming Plotting Spatial data.
Advertisements

Introduction to Programming using Matlab Session 2 P DuffourJan 2008.
Introduction to Matlab Workshop Matthew Johnson, Economics October 17, /13/20151.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
1 Computing for Todays Lecture 22 Yumei Huo Fall 2006.
Russell Taylor Lecturer in Computing & Business Studies.
FIRST COURSE Creating Web Pages with Microsoft Office 2007.
AGENDA Tools used in SQL Server 2000 Graphical BOL Enterprise Manager Service Manager CLI Query Analyzer OSQL BCP.
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
Every week: Sign in at the door If you are new: Fill in Registration Form Ask a Mentor how to get started Make sure you are on the Athenry Parents/Kids.
Lab 1: The Stroop Effect (1935) Measuring interference effects
TC2-Computer Literacy Mr. Sencer February 8, 2010.
CS110/CS119 Introduction to Computing (Java)
SAS Workshop Lecture 1 Lecturer: Annie N. Simpson, MSc.
The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.
 Overview of SPSS  Interface  Getting Started  Managing Data  Descriptive Statistics  Basic Analysis  Additional Resources.
732A44 Programming in R.  Self-studies of the course book  2 Lectures (1 in the beginning, 1 in the end)  Labs (computer). Compulsory submission of.
Data, graphics, and programming in R 28.1, 30.1, Daily:10:00-12:45 & 13:45-16:30 EXCEPT WED 4 th 9:00-11:45 & 12:45-15:30 Teacher: Anna Kuparinen.
Lecture 4 MATLAB Windows Arithmetic Operators Maintenance Functions
Intro to R R is a free version of S-plus R is a free version of S-plus Can be used interactively but script or syntax files are commonly used to record.
Introduction to R Lecture 1: Getting Started Andrew Jaffe 8/30/10.
Client Side Programming with JavaScript Why use client side programming? Web sides built on CGI programs can rapidly become overly complicated to maintain,
August 29, 2005ICP: Chapter 1: Introduction to Python Programming 1 Introduction to Computer Programming Chapter 1: Introduction to Python Programming.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Tutorial 10 Programming with JavaScript
Done by: Hanadi Muhsen1 Tutorial 1.  Learn the history of JavaScript  Create a script element  Write text to a Web page with JavaScript  Understand.
Piotr Wolski Introduction to R. Topics What is R? Sample session How to install R? Minimum you have to know to work in R Data objects in R and how to.
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
A Brief Introduction to R Programming Darren J. Fitzpatrick, PhD The Bioinformatics Support Team 27/08/2015.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Web software. Two types of web software Browser software – used to search for and view websites. Web development software – used to create webpages/websites.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
Introduction to JavaScript CS101 Introduction to Computing.
Introduction to R Introductions What is R? RStudio Layout Summary Statistics Your First R Graph 17 September 2014 Sherubtse Training.
The Department of Engineering Science The University of Auckland Welcome to ENGGEN 131 Engineering Computation and Software Development Lecture 2 Debugging,
Introductory Data Analysis F73DA2. Contact Times (Spring Term 2008) Monday 4: : Lecture in LT3 Tuesday 2: : Lecture in LT3 Wednesday
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
Lecture 11 Introduction to R and Accessing USGS Data from Web Services Jeffery S. Horsburgh Hydroinformatics Fall 2013 This work was funded by National.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Introduction to R Chris Free. Introduction to R Free! Superior (if not comparable) to commercial alternatives Available on all platforms Not just for.
XP Creating Web Pages with Microsoft Office
Searching the Web for academic information Ruth Stubbings.
The Department of Engineering Science The University of Auckland Welcome to ENGGEN 131 Engineering Computation and Software Development Lecture 2 Debugging,
R Brown-Bag Seminar 2.1 Topic: Introduction to R Presenter: Faith Musili ICRAF-Geoscience Lab.
Data Tools: R and RStudio
Operating System Concepts
Tutorial 10 Programming with JavaScript
Getting started with Stata
JavaScript is a programming language designed for Web pages.
Matlab Training Session 4: Control, Flow and Functions
Installing R and R Studio
Lab 1 Introductions to R Sean Potter.
Introduction to R.
Use of Mathematics using Technology (Maltlab)
Crash course in R – short introduction
Macrosystems EDDIE: Getting Started + Troubleshooting Tips
CSCI N207 Data Analysis Using Spreadsheet
Tutorial 10: Programming with javascript
JavaScript Basics What is JavaScript?
R Course 1st Lecture.
JavaScript: Introduction to Scripting
Macrosystems EDDIE: Getting Started + Troubleshooting Tips
Macrosystems EDDIE: Getting Started + Troubleshooting Tips
Web Application Development Using PHP
Intro to Programming (in JavaScript)
Presentation transcript:

Chris Knight Beginners’ workshop

What is R? Statistics package General modelling tool Data visualisation and analysis tool Programming language Glorified pocket calculator “Environment for statistical computing and graphics”

Why use R? Lots of help available Free Big user base Increasingly used for doing science Jobs! Cutting edge and growing functionality If you learn only one new piece of computing software after Excel, learn R

What’s in this workshop Basic interaction with R Where to turn for help Moving rapidly to more complex analyses Where to learn more

What’s not in this workshop Advanced programming See e.g. ?Control, ?"function" and resources (later) ‘How do I analyse X?’ Google (e.g. ‘time series R’) and resources (later) The fundamentals of statistics See resources given later, esp. Crawley books Working in R environments other than Rstudio ( Default Windows GUIDefault Mac GUI R commander Command line

R as a calculator > [1] 10 > 5*0.5 [1] 2.5 > 27/3 [1] 9 > 9^2 [1] 81 > 9^(1/2) [1] 3 > sqrt(9) [1] 3 > log(5) [1]

R help documentation > log(5) [1] Check what the log() function is doing (e.g. which base?) > ?log General information Package Arguments and defaults What those arguments need to be What’s covered

> log(5) [1] Check what the log() function is doing (e.g. which base?) > ?log If you really care Where it’s come from Sometimes very useful, sometimes not Run from here or use example(log) What you get back Useful link R help documentation

> log(5) [1] Check what the log() function is doing (e.g. which base?) > ?log

R as a calculator > log(5) [1] Check what the log() function is doing (e.g. which base?) > ?log > log(5, base=10) [1] > log10(5) [1] What happens if you get it wrong? > log("Fred") Error in log(“Fred") : non-numeric argument to mathematical function > log function (x, base = exp(1)).Primitive("log") So if natural log isn’t ln(5), what is ln used for? > ?ln

R as a calculator Comparisons > 54 > 45 Greater than [1] TRUE > 2 < 1 Less than [1] FALSE > 15 == 15 Exactly equal [1] TRUE > 50 >= 50 Greater than or equal [1] TRUE > 5 > 1 & 9 <= 15 Are both statements true? [1] TRUE > 24 == 3 | 1 == 1 Is either statement true? [1] TRUE > ?Comparison > ?Syntax

Keeping track of what you’re doing Store code in a text file (.R) Write in comments #like this Run commands a line at a time Ctl R (Windows) ⌘↵ (Mac) Highlight code and run in the same way Run a whole file using the source() function Navigate history using arrows

Keeping track of what you’re doing Try running the first 32 lines one at a time or in one go url.show(“ s.Knight/docs/RbeginnersWorkshop14.R”) Try saving the file somewhere useful Try writing some more commented and uncommented lines Use R as a web browser to see the file containing this workshop’s code: Copy it to a new R script file (.R)

Further sections Assign values to a variable<- Create vectorsc() Simple statistics Extracting bits of variables [] loopfor (var in seq){} Data framesread.table(); write.table(); [,] Simple plotsplot(y~x); pairs(), hist() Build linear modelslm(y~x); anova() Modelling exerciserpart(y~x); randomForest(y~x)

Statistics Crawley Books Courses Masters’ lectures now! Places to go for more information Task views Specific books Many online with UoM access e.g. 43 in UseR! series: Data manipulation with R by Phil Spector very broadly useful R programming R site documents (start with ‘Documents with fewer than 100 pages’) Courses

Places to go for help R help list archives > Mailing lists > R-help web interface > Searchable archives R help documentation ? ?? help(package="base") demo() example("function") vignette() R support groups FLS (FLSRGROUP listerv) or Manchester R User group Google