2. Vector

  1. Create a vector(2)

numeric_vector ← c(1, 2, 3)

character_vector ← c(”a”, “b”, “c”)

boolean_vector ← c(TRUE, FALSE, TRUE)

  1. Create a vector(3)

Winnings/losses for roulette to the variable

poker_vector ← c(24, -50, 100, -350, 10)

  1. Naming a vector(1)

Some_vector ← c(”John Doe”, “poker player”)

names(some_vector) ← c(”Name, “profession)

<aside> <img src="/icons/chart_gray.svg" alt="/icons/chart_gray.svg" width="40px" /> Name Profession ”John Doe” “poker player

</aside>

  1. Naming a vector(2)

Variable

names(poker_vector) ← (days_vector)

  1. Calculating total winnings(1)