Intermediate R for Finance
Lore Dirick
Manager of Data Science Curriculum at Flatiron School
i <- 0
while(i < 3) {
print(i)
i <- i + 1
}
0
1
2
stock_price <- 52.1 while(stock_price <= 52.5) { stock_price <- stock_price * runif(1, .99, 1.01) print(stock_price) }
print("Stock price is above 52.5! Sell!")
52.01159
52.46679
52.00211
52.48659
52.99241
"Stock price is above 52.5! Sell!"
Intermediate R for Finance