Create a vector (3)

After one week in Las Vegas and still zero Ferraris in your garage, you decide that it is time to start using your data analytical superpowers.

Before doing a first analysis, you decide to first collect all the winnings and losses for the last week:

For poker_vector:

For roulette_vector:

You only played poker and roulette, since there was a delegation of mediums that occupied the craps tables. To be able to use this data in R, you decide to create the variables poker_vector and roulette_vector.

Instruction

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 <- # 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) test_object("poker_vector", incorrect_msg = "Make sure that you assign the correct values to `poker_vector`.") test_object("roulette_vector", incorrect_msg = "Make sure that you assign the correct values to `roulette_vector`. Make sure to adopt the correct order!") success_msg("Very good! To check out the contents of your vectors, remember that you can always simply type the variable in the console and hit Enter. Proceed to the next exercise!")

To help you with this step, the editor already contains the code for creating poker_vector. Assign the correct values to roulette_vector based on the numbers in the assignment. Do not forget that losses are negative numbers.

Previous: 2-2 | Create a vector (2)

Next: 2-4 | Naming a vector

Back to Main