Manipulation de vecteurs

Introduction à R pour la finance

Lore Dirick

Manager of Data Science Curriculum at Flatiron School

Vecteurs et cie

dan <- 100
rob <- 50
total <- dan + rob
dan <- c(100, 200, 150)
rob <- c(50, 75, 100)

monthly_total <- dan + rob
monthly_total
150 275 250
sum(monthly_total)
675
Introduction à R pour la finance

Autres exemples

a <- c(2.2, 12, 7)
b <- c(11.5, 8, 3.4)

# Soustraction !
c <- a - b
c
-9.3 4.0  3.6
# Multiplication !
d <- a * b
d
25.3 96.0 23.8
# Recyclage !
e <- 2
f <- a * e
f
4.4 24.0 14.0
Introduction à R pour la finance

Passons à la pratique !

Introduction à R pour la finance

Preparing Video For Download...