Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Introduction to R Programming

Selva Prabhakaran

Section 3

R Essentials

www.packtpub.com
In this Section, we are going to take a look at…
• Lists

• Set operations

• Sampling and sorting operations

• Conditional statements

• For-Loops
Introduction to R Programming

Selva Prabhakaran

Video 3.1

Lists
In this Video, we are going to take a look at…
• What are lists?

• How to create a list?

• How to access the elements in a list?

• How to flatten a list?

• Challenge
R slide
Summary
Challenge
Create the list ‘m’ shown below. From list ‘m’, get the number from
object ‘y’ that correspond to the letter ‘r’ in the 'x' object.

## Code to create list ‘m’


set.seed(100)
x <- letters
y <- 1:26
z <- round(runif(26, 1, 26))
m <- list(x, y, z)

You might also like