12
PROGRAMMING IN R Introduction to R

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

Embed Size (px)

DESCRIPTION

Introduction to R R is available at the following website: You can download R by clicking on the “Down Load” link. We will demonstrate this later in this video.

Citation preview

Page 1: 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

PROGRAMMING IN R

Introduction to R

Page 2: 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

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

Page 3: 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

Introduction to R• R is available at the following

website:http://www.r-project.org/

• You can download R by clicking on the “Down Load” link.

• We will demonstrate this later in this video.

Page 4: 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

Introduction to R• There is an introduction to R

available on the CRAN R-project website.

http://cran.r-project.org/doc/manuals/R-intro.pdf• I recommend downloading this

document and getting acquainted with it.

Page 5: 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

Introduction to R

•R is an environment for statistical computing, data analysis, and graphics•We will use R for describing and analyzing data•Being proficient in using R for statistical computing and analysis a skill that is highly valued in multiple arenas

Page 6: 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 Environment

• R is an extremely capable environment.• The differences between R and SAS are too enumerable to describe. •R is similar to the S language developed at Bell Laboratories. •R can be challenging to learn but practice will make it easier.

Page 7: 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 Environment• There are three basic components

to the R environment or R console.

• R Commands window or Prompt– executes the commands.

• Script Window – a program editor provided by R.

• Graphics Window – an output window that displays graphics.

Page 8: 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 Environment• R is an expression language• It is case sensitive

– A and a are two different symbols– Refer to different variables.

• Elementary commands consist of either expressions or assignments.

Page 9: 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 Environment• Expressions

– Given as a command, is evaluated, printed, and the value is lost.

• Assignments– Evaluates the expression and passes

the value to a variable – The result is not printed.

Page 10: 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 Environment• The R environment also has many

different ways to store data.• R is an object oriented language

so everything is stored as an object.

• In this session, we will define the various types of objects but we will only use 2 of these types.

Page 11: 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 variables. • There are different types of

objects or ways to store variables.• Vectors• Lists• Functions• For now, we will only work with

Vectors.

Page 12: 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

Introduction to R• Let’s install R.