while 반복문

금융을 위한 R 중급

Lore Dirick

Manager of Data Science Curriculum at Flatiron School

while 반복문

i <- 0
while(i < 3) {
    print(i)
    i <- i + 1
}
0
1
2
금융을 위한 R 중급

조건이 참인지 확인

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!"
금융을 위한 R 중급

실습해 봅시다!

금융을 위한 R 중급

Preparing Video For Download...