
上QQ阅读APP看书,第一时间看更新
Looping in R
Suppose we want to loop through all the values of the aug_price column inside all_prices4 and square them and return them. We can do so in the following way:
jan = all_prices4$jan_price
for(price in jan){
print(price^2)
}
This prints a square of all the prices in January as follows:
