官术网_书友最值得收藏!

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:

主站蜘蛛池模板: 麻城市| 永兴县| 南阳市| 休宁县| 中山市| 枣庄市| 庆云县| 瑞昌市| 呼伦贝尔市| 汕头市| 沐川县| 万宁市| 郁南县| 仁寿县| 海宁市| 星座| 堆龙德庆县| 南陵县| 公主岭市| 磐石市| 金堂县| 岳西县| 禄劝| 邛崃市| 山阴县| 巴中市| 延寿县| 浠水县| 乐都县| 南召县| 鲁甸县| 新河县| 邵阳市| 太保市| 乐平市| 临沭县| 志丹县| 徐水县| 门源| 南丰县| 江川县|