Training on R-language Mārtiņš Liberts Central Statistical Bureau of Latvia.

Slides:



Advertisements
Similar presentations
What is an operating system? Is it software?
Advertisements

Training on R For 3 rd and 4 th Year Honours Students, Dept. of Statistics, RU Empowered by Higher Education Quality Enhancement Project (HEQEP) Department.
Introduction to Matlab Workshop Matthew Johnson, Economics October 17, /13/20151.
R: A Statistics Program For Teaching & Research Josué Guzmán 11 Nov. 2007
Introduction to Graphics in R Department of Statistical Sciences and Operations Research Computation Seminar Series Speaker: Edward Boone
 Statistics package  Graphics package  Programming language  Can be used to share/reproduce analyses  Many new packages being created - can be downloaded.
Example of multivariate data What is R? R is available as Free Software under the terms of the Free Software Foundation'sFree Software Foundation GNU General.
R for Research Data Analysis using R Day1: Basic R Baburao Kamble University of Nebraska-Lincoln.
MATLAB ME1107 Y Yan Reference: MATLAB for Engineers by Holly Moore (Pearson Prentice Hall)
Introduction to MATLAB 3 November Instructor: Andy Newman Office Hours: Stop by room 306 (main building) whenever
R – a brief introduction Johannes Freudenberg Cincinnati Children’s Hospital Medical Center
Dr. Jie Zou PHY Welcome to PHY 3320 Computational Methods in Physics and Engineering.
EGR 105 Foundations of Engineering I Session 3 Excel – Basics through Graphing Fall 2008.
Introduction to SAS Math 3200 Jan Jimin Ding.
What is R By: Wase Siddiqui. Introduction R is a programming language which is used for statistical computing and graphics. “R is a language and environment.
MATLAB Lecture One Monday 4 July Matlab Melvyn Sim Department of Decision Sciences NUS Business School
Nonparametric Econometrics1 Intro to Matlab for Data Analysis and Statistical Modeling.
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.
Math 15 Lecture 7 University of California, Merced Scilab A “Very” Short Introduction.
Sébastien Lê Agrocampus Rennes A very short introduction to “R” The “Rcmdr” package and its environment.
Intro to R Zhi Wei.
Introduction to Engineering MATLAB – 1 Introduction to MATLAB Agenda Introduction Arithmetic Operations MATLAB Windows Command Window Defining Variables.
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.
Eng Ship Structures 1 Introduction to Matlab.
Matlab Basics Tutorial. Vectors Let's start off by creating something simple, like a vector. Enter each element of the vector (separated by a space) between.
Introduction to Engineering MATLAB – 2 Introduction to MATLAB - 2 Agenda Defining Variables MATLAB Windows.
Scientific Computing Introduction to Matlab Programming.
STAT 251 Lab 1. Outline Lab Accounts Introduction to R.
MA/CS 375 Fall 2002 Lecture 3. Example 2 A is a matrix with 3 rows and 2 columns.
Team #6 Date:03/02/2010. TEAM Haritha Rani Jadcherla Vikram Sriram Saloti Annapurna Venkat Narasimha MENTORS Dr. Yue Kwon Mr. Ravi Ganta.
Lec-10 Manipulations of Matlab Matrices. Built-in functions The chapter will be covered quickly There are quite a few built-in functions in MATLAB – If.
An Introduction to R Statistical Computing AMS 597 Stony Brook University Spring 2009 By Tianyi Zhang.
Introduction to R Introductions What is R? RStudio Layout Summary Statistics Your First R Graph 17 September 2014 Sherubtse Training.
STAT 534: Statistical Computing Hari Narayanan
Introduction to MATLAB Session 2 Simopekka Vänskä, THL Department of Mathematics and Statistics University of Helsinki 2010.
MA/CS 375 Fall 2003 Lecture 3. .* Multiplication We can use the.* operator to perform multiplication entry by entry of two matrices:
© 2015 by Wade Rogers Introduction to R Cytomics Workshop December, 2015.
MA/CS 375 Fall 2002 Lecture 2. Motivation for Suffering All This Math and Stuff Try the Actor demo from
PROGRAMMING IN R Introduction to R. In this session I will: Introduce you to the R program and windows Show how to install R Write basic programs in R.
R tutorial Stat 140 Linjuan Qian
Matlab Tutorial Iman Moazzen First Session – September 11, 2013.
Lecture 11 Introduction to R and Accessing USGS Data from Web Services Jeffery S. Horsburgh Hydroinformatics Fall 2013 This work was funded by National.
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
1 Programming and problem solving in C, Maxima, and Excel.
Jake Blanchard University of Wisconsin Spring 2006.
Introduction to R Dr. Satish Nargundkar. What is R? R is a free software environment for statistical computing and graphics. It compiles and runs on a.
Block 1: Introduction to R
Matlab Programming for Engineers
R Brown-Bag Seminar 2.1 Topic: Introduction to R Presenter: Faith Musili ICRAF-Geoscience Lab.
Lecture 2: Introduction to R
Programming in R Intro, data and programming structures
R programming language
Introduction to R Samal Dharmarathna.
Computer Fundamentals 1
R Programming.
INTRODUCTION TO BASIC MATLAB
MATLAB DENC 2533 ECADD LAB 9.
Lab 1 Introductions to R Sean Potter.
Introduction to R.
MATH 493 Introduction to MATLAB
Software.
R basics workshop for REU students
Communication and Coding Theory Lab(CS491)
R basics mini-workshop for REU students
Introduction to Matlab
May 31-June 2, 2016, Missouri Botanical Garden
MIS2502: Data Analytics Introduction to R and RStudio
R Course 1st Lecture.
Matlab Basics Tutorial
Presentation transcript:

Training on R-language Mārtiņš Liberts Central Statistical Bureau of Latvia

Outline Introduction with R Practical examples with R Sampling package Practical examples with Sampling package

R — a language and environment R ( is an advanced statistical computing system with very high quality graphics that is freely available for most computing platforms. The S language is often the vehicle of choice for research in statistical methodology and R provides a free software route to participation in that activity.

R R is being developed for the Unix, Windows and Mac families of operating systems. It is a system available as source code (at project.org) that compiles on almost all current Unix and Linux systems, and has binary versions for the major Linux distributions, FreeBSD, MacOS X and Windows. It is distributed under GPL2 (the “GNU Public Licence”). The core system is fairly small but can be extended by packages, several ‘recommended’ ones ship with R and about 300 (and growing) are available from CRAN (CRAN.R-project.org and mirrors).

Work with R Console R prompt > Input Output Scripts Input Workspace Storage of the objects created during work sessions

Work with R

Running commands from console Type in the commands and execute by Enter Running commands from script Select commands for running and execute by Ctrl+R It is possible to select only the part of command and execute this part Whole line where the cursor is positioned will be executed if nothing is selected

Work with R 2+4 pi sin(pi/2) S=0 for (i in 1:10) S=S+i S

Help in R help.start() ?sin help.search("sin")

R objects Numbers and vectors Matrices Lists Data frames Logical values Missing values Factors The function is.*

Numbers and vectors a=5 Y=c(1,3,6,8) Y+a Y[3]

Arithmetic operators and functions Operators: + - * / ^ %*% %/% % : Functions: abs exp gamma lgamma log log10 sign sqrt sin cos tan sinh asin asinh max min range length sum prod sort order rank rev cumsum cumprod var mean...

Generating sequences of numbers Using : 1:5 5:1 Using seq seq(from=0,to=3,length=6) Using rep rep(1,5)

matrix, data.frames matrix M=cbind(1:5,6:10,11:15) M[1,2] M[1,] M[,3] M[1,2] data.frame treeframe=data.frame (diameter=c(10, 15, 20, 25), height=c(1.5,1.6,1.2,2.1)) treeframe[,1] treeframe$diameter

Logical values Logical operators == != > >= < <= & | ! Examples X=seq(from=0,to=10,length=21) X<5 X[X<5] treeframe[treeframe$diameter<20,2]

Packages CRAN.R-project.org library(foreign) read.spss

The sampling package Version 0.3 Date Title Sampling survey Author Yves Till é Alina Matei Maintainer Yves Till é Description The sampling package contains a set of tools to select and to calibrate samples. Depends MASS, lpSolve License GPL version 2 or later.

Functions regressionestimator boundedregressionestimator checkcalibration Other functions