Skip to Content
R Programming Fundamentals
book

R Programming Fundamentals

by Kaelen Medeiros
September 2018
Beginner
206 pages
4h 27m
English
Packt Publishing
Content preview from R Programming Fundamentals

Activity: Creating Vectors, Lists, Matrices, and Dataframes

  1. Create vectors using the following code:
vec1 <- c(1:10)vec2 <- c(LETTERS)vec3 <- c(1, "A", 2, "B", 3, "C", 4, "D")
  1. Create lists using the following code:
list1 <- list(1:10)list2 <- list(LETTERS)list3 <- list(list("popcorn", "kale"), list("the Blacklist", "This is Us", "The X-Files"), list("run", "listen to podcasts", "paint my nails", "learn data science"))
  1. When you've created the lists, go and look in the environment and hit View to see the third list. Expand each list in the list of lists to see your answers and the types, as shown in the following screenshot:

  1. Create matrices ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

R Programming Fundamentals

R Programming Fundamentals

Samik Sen, Marcin Dubel
Python for Programmers

Python for Programmers

Paul Deitel, Harvey Deitel

Publisher Resources

ISBN: 9781789612998Supplemental Content