Introduction to R and Statistics Thomas INGICCO G. Courbet, Le désespéré (Autoportrait) G. Courbet, The desperate man (Self-portrait)

Slides:



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

R for Macroecology Aarhus University, Spring 2011.
Data in R. General form of data ID numberSexWeightLengthDiseased… 112m … 256f3.61 NA1… 3……………… 4……………… n91m5.1711… NOTE: A DATASET IS NOT A MATRIX!
Basics of Using R Xiao He 1. AGENDA 1.What is R? 2.Basic operations 3.Different types of data objects 4.Importing data 5.Basic data manipulation 2.
Introduction to Unix – CS 21 Lecture 11. Lecture Overview Shell Programming Variable Discussion Command line parameters Arithmetic Discussion Control.
Information Technology Center Hany Abdelwahab Computer Specialist.
MATLAB Cell Arrays Greg Reese, Ph.D Research Computing Support Group Academic Technology Services Miami University.
JavaScript, Third Edition
How to Use the R Programming Language for Statistical Analyses Part I: An Introduction to R Jennifer Urbano Blackford, Ph.D. Department of Psychiatry Kennedy.
Introduction to Array The fundamental unit of data in any MATLAB program is the array. 1. An array is a collection of data values organized into rows and.
Introduction to R: The Basics Rosales de Veliz L., David S.L., McElhiney D., Price E., & Brooks G. Contributions from Ragan. M., Terzi. F., & Smith. E.
Introduction to R Data Structure June Introduction to R: Data structure Karim & Maria June
Baburao Kamble (Ph.D) University of Nebraska-Lincoln Data Analysis Using R Week2: Data Structure, Types and Manipulation in R.
Applied Bioinformatics Introduction to Linux and R Bing Zhang Department of Biomedical Informatics Vanderbilt University
Spreadsheets Objective 6.02
2 Explain advanced spreadsheet concepts and functions Advanced Calculations 1 Sabbir Saleh_Lecture_17_Computer Application_BBA.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Introduction to R, Statistics, and the grammar of graphics Thomas INGICCO E. Delacroix, Dante et Virgile aux Enfers E. Delacroix, Dante and Virgile in.
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.
Matlab Programming, part 1 M-files It is generally more convenient to program in Matlab using m-files, ascii text files containing a set of Matlab commands.
Scheme & Functional Programming. ( ) >> 64 ( ) >> 666 (* ) >> 1200 (+ (* 3 5) (- 10 6)) >> 19.
ENGR 1320 Final Review - Programming Major Topics: – Functions and Scripts – Vector and Matrix Operations in Matlab Dot product Cross product – Plotting.
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.
DHTML AND JAVASCRIPT Genetic Computer School LESSON 5 INTRODUCTION JAVASCRIPT G H E F.
What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation tools. Others include Maple Mathematica MathCad.
# 1# 1 Error Messages, VLookup, Practical Tips What use is VLookup? How do you error check in Excel? CS 105 Spring 2010.
Introduction to R. Why use R Its FREE!!! And powerful, fairly widely used, lots of online posts about it Uses S -> an object oriented programing language.
COP4020 Programming Languages Functional Programming Prof. Xin Yuan.
S-PLUS Lecture 2 Jaeyong Lee Department of Statistics Pennsylvania State University.
Example 1 Solve an Equation with Variables on Each Side Solve 8 + 5c = 7c – 2. Check your solution c = 7c – 2Original equation Answer: c = 5Simplify.
Introduction to MATLAB ENGR 1181 MATLAB 1. Opening MATLAB  Students, please open MATLAB now.  CLICK on the shortcut icon → Alternatively, select… start/All.
Introduction to Computer Programming
INTRODUCTION TO MATLAB MATLAB is a software package for computation in engineering, science, and applied mathemat-ics. It offers a powerful programming.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
Digital Image Processing Lecture 6: Introduction to M- function Programming.
4. Javascript M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer (C-307) Desain.
STAT 534: Statistical Computing Hari Narayanan
Introduction to Engineering MATLAB – 4 Arrays Agenda Creating arrays of numbers  Vectors: 1-D Arrays  Arrays: 2-D Arrays Array Addressing Strings & String.
Learn R Toolkit D Kelly O'DayExcel & R WorldsMod 2 - Excel & R Worlds: 1 Module 2 Moving Between Excel & R Worlds Do See & HearRead Learning PowerPoint.
S-PLUS Lecture 4 Jaeyong Lee Pennsylvania State University.
Data & Graphing vectors data frames importing data contingency tables barplots 18 September 2014 Sherubtse Training.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
Descriptive Statistics using R. Summary Commands An essential starting point with any set of data is to get an overview of what you are dealing with You.
FUNCTIONS The parts of a function In order to work correctly, a function must be written a specific way, which is called the syntax. The basic syntax for.
Introduction to R Chris Free. Introduction to R Free! Superior (if not comparable) to commercial alternatives Available on all platforms Not just for.
Review > x[-c(1,4,6)] > Y[1:3,2:8] > island.data fishData$weight[1] > fishData[fishData$weight < 20 & fishData$condition.
16BIT IITR Data Collection Module If you have not already done so, download and install R from download.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Working with data in R 2 Fish 552: Lecture 3. Recommended Reading An Introduction to R (R Development Core Team) –
Introduction to R.
Programming in R Intro, data and programming structures
Naomi Altman Department of Statistics (Based on notes by J. Lee)
Single Table Queries in SQL
Graphing Lab.
Use of Mathematics using Technology (Maltlab)
ADD YOUR TITLE HERE Your Name
Communication and Coding Theory Lab(CS491)
Vectors and DataFrames
Spreadsheets 2 Explain advanced spreadsheet concepts and functions
JavaScript.
Spreadsheets Objective 6.02
R Course 1st Lecture.
Data analysis with R and the tidyverse
Spreadsheets Objective 6.02
Research Paper Rough Draft 3
Introduction to MATLAB
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Introduction to R and Statistics Thomas INGICCO G. Courbet, Le désespéré (Autoportrait) G. Courbet, The desperate man (Self-portrait)

R is a freeware…

… but before all it is a language with its own grammar made of:

To create an object which will contain data or informations, we use "<-" : aa <- NULL aa <- "A sentence" bb <- 10:34 cc <- matrix(10:34, nc=5, nr=5) To see the content of the object, we type its name: aa Hash symbol (#) allows you to comment your script: aa # This is a comment Semicolon allows you to separate the commands on the same line: aa ; bb ; cc # We look at the content of the three objects R is case sensitive aa Aa # R being a language, when you make a mistake, it tells you Spaces are not important bbb<-10 : 34

… but R is also a calculator: 25/5 5^2 25^0.5 sqrt(25) # This is a function sqrt ?sqrt help(sqrt)

… but R is also a calculator: 25/5 5^2 25^0.5 sqrt(25) # This is a function sqrt ?sqrt help(sqrt) sqrt(sum(bb)) # Functions are matriochkas

… but R is also a calculator: 25/5 5^2 25^0.5 sqrt(25) # This is a function sqrt ?sqrt help(sqrt) sqrt(sum(bb)) # Functions are matriochkas bb[-3] bb+bb bb+bb[-3] bb+cc

… but before all it is a language with its own grammar made of:

Modes – nature of your data - Numeric – numbers (51, 32, 47mm) -Character – chain of characters (« y », « a+b+c ») -Factor – qualitative values (« Red », « Orange ») -Logical – specific attributes (TRUE, FALSE, NA) Special arguments - NA – Not Available, absence of data -NULL – Empty object -TRUE or T – Logical argument -FALSE or F– Logical argument … but before all it is a language with its own grammar made of:

Classes – how you present your data - Vector – series of values of 1 dimension -Matrix – series of values of 2 dimensions -Arrays – series of values of n dimensions -Data Frame – series of values in columns -List – series of objects -Table – Contingency table … but before all it is a language with its own grammar made of: ls() # Check the list of the created objects # Vector is.vector(bb)

Classes – how you present your data - Vector – series of values of 1 dimension -Matrix – series of values of 2 dimensions -Arrays – series of values of n dimensions -Data Frame – series of values in columns -List – series of objects -Table – Contingency table … but before all it is a language with its own grammar made of: # Matrix class(cc) cc <- matrix(10:34, nc=5, nr=5) # Remember ccc <- c(10:34) ccc

Classes – how you present your data - Vector – series of values of 1 dimension -Matrix – series of values of 2 dimensions -Arrays – series of values of n dimensions -Data Frame – series of values in columns -List – series of objects -Table – Contingency table … but before all it is a language with its own grammar made of: # Matrix class(cc) cc <- matrix(10:34, nc=5, nr=5) # Remember ccc <- c(10:34) ccc is.vector(ccc) dim(ccc)<-c(5,5) ccc

Classes – how you present your data - Vector – series of values of 1 dimension -Matrix – series of values of 2 dimensions -Arrays – series of values of n dimensions -Data Frame – series of values in columns -List – series of objects -Table – Contingency table … but before all it is a language with its own grammar made of: # Matrix class(cc) cc <- matrix(10:34, nc=5, nr=5) # Remember ccc <- c(10:34) ccc is.vector(ccc) dim(ccc)<-c(5,5) ccc is.matrix(ccc)

Classes – how you present your data - Vector – series of values of 1 dimension -Matrix – series of values of 2 dimensions -Arrays – series of values of n dimensions -Data Frame – series of values in columns -List – series of objects -Table – Contingency table … but before all it is a language with its own grammar made of: # Matrix class(cc) cc <- matrix(10:34, nc=5, nr=5) # Remember ccc <- c(10:34) ccc is.vector(ccc) dim(ccc)<-c(5,5) ccc is.matrix(ccc) matrix(1:6, 3, 2) matrix(1:6, 3, 2, byrow=T)

Classes – how you present your data - Vector – series of values of 1 dimension -Matrix – series of values of 2 dimensions -Arrays – series of values of n dimensions -Data Frame – series of values in columns -List – series of objects -Table – Contingency table … but before all it is a language with its own grammar made of: # Data.frame dd<-read.table("K:/Cours/Philippines/Statistics-210/Lecture-4/Ceramics.txt", header=TRUE) # Opening Data; return is possible in a function; a function has arguments class(dd) dd$Type dd[,9] dd[3,8:11]