- Hands-On Geospatial Analysis with R and QGIS
- Shammunul Islam
- 54字
- 2021-06-10 18:44:24
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:
