{"categories":["R","\u4f7f\u3044\u65b9\u30e1\u30e2(\u4e0d\u4fbf\u89e3\u6c7a)"],"blog_url":"https://knknkn.hatenablog.com/","author_name":"chito_ng","published":"2020-06-23 11:34:55","description":"\u3084\u308a\u305f\u3044\u3053\u3068 mutate\u3067\u306f\u3001\u95a2\u6570\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u9069\u7528\u3092\u9069\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002 library(tidyverse) iris %>% group_by(Species) %>% mutate(Sepal.Length_lag2 = lag(Sepal.Length,2)) # Sepal.Length Sepal.Width Petal.Length Petal.Width Species Sepal.Length_lag2 # <dbl> <dbl> <dbl> <dbl> <fct> <dbl> # 1 5.1 3.5 1.4 0.2 setosa NA # 2 4.9 3 1.4 0.\u2026","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fknknkn.hatenablog.com%2Fentry%2F2020%2F06%2F23%2F113455\" title=\"mutate_at\u3067\u5f15\u6570\u4ed8\u304d\u95a2\u6570\u3092\u4f7f\u3046 - \u307e\u305a\u306f\u874b\u306e\u7ffc\u304b\u3089\u3002\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/chito_ng/","provider_url":"https://hatena.blog","image_url":null,"height":"190","provider_name":"Hatena Blog","blog_title":"\u307e\u305a\u306f\u874b\u306e\u7ffc\u304b\u3089\u3002","title":"mutate_at\u3067\u5f15\u6570\u4ed8\u304d\u95a2\u6570\u3092\u4f7f\u3046","width":"100%","version":"1.0","type":"rich","url":"https://knknkn.hatenablog.com/entry/2020/06/23/113455"}