Create a vector using R Question 2

R Programming Language / Vector in R Language

314

Program:

# 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)

poker_vector
roulette_vector

Output:

> # 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)
> 
> poker_vector
[1]  140  -50   20 -120  240
> roulette_vector
[1]  -24  -50  100 -350   10

Explanation:

Assign the winnings/losses for roulette to the variable roulette_vector.


This Particular section is dedicated to Programs only. If you want learn more about R Programming Language. Then you can visit below links to get more depth on this subject.