--2-Vectors
#1-Create a vector
# Define the variable vegas
vegas <- "Go!"#2-Create a vector (2)
numeric_vector <- c(1, 10, 49)
character_vector <- c("a", "b", "c")
# Complete the code for boolean_vector
boolean_vector <-c(TRUE,FALSE,TRUE)#3-Create a vector (3)
#Assign the winnings/losses for roulette to the variable roulette_vector
# Poker winnings from Monday to Friday
poker_vector <- c(140, -50, 20, -120, 240)
# Roulette winnings from Monday to Friday
roulette_vector <-c(-24,-50,100,-350,10)#4-Naming a vector
# Poker winnings from Monday to Friday
poker_vector <- c(140, -50, 20, -120, 240)
# Roulette winnings from Monday to Friday
roulette_vector <- c(-24, -50, 100, -350, 10)
# Assign days as names of poker_vector
names(poker_vector) <- c("Monday", "Tuesday", "Wednesday",
"Thursday", "Friday")
# Assign days as names of roulette_vectors
names(roulette_vector) <- c("Monday", "Tuesday",
"Wednesday", "Thursday", "Friday")#5-Naming a vector (2)
#6-Calculating total winnings
#7-Calculating total winnings (2)
#8-Calculating total winnings (3)
#9-Comparing total winnings
#10-Vector selection: the good times
#11-Vector selection: the good times (2)
#12-Vector selection: the good times (3)
#13-Vector selection: the good times (4)
#14-Selection by comparison - Step 1
#15-Selection by comparison - Step 2
#16-Advanced selection
Last updated