[情報] Hadley新套件 purrr

看板R_Language作者 (天)時間10年前 (2015/10/02 14:05), 10年前編輯推噓4(400)
留言4則, 4人參與, 最新討論串1/1
[關鍵字]: Hadley, purrr [出處]: http://www.r-bloggers.com/purrr-0-1-0/ https://github.com/hadley/purrr [重點摘要]: Installation: Get the released version from CRAN: install.packages("purrr") Or the development version from github with: # install.packages("devtools") devtools::install_github("hadley/purrr") example: library(purrr) mtcars %>% split(.$cyl) %>% map(~ lm(mpg ~ wt, data = .)) %>% map(summary) %>% map_dbl("r.squared") # 4 6 8 # 0.5086326 0.4645102 0.4229655 # 依照cyl不同做不同的回歸,print每一個模型的R^2 更多例子請參考上方連結 r-blogger那篇的Purrr and dplyr 那個cv code變的很漂亮XD dplyr不足的地方都被補足了! 有空要來做新的教學了XDD -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.109.73.190 ※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1443765922.A.4AB.html ※ 編輯: celestialgod (140.109.73.190), 10/02/2015 14:22:42

10/02 18:36, , 1F
感謝分享
10/02 18:36, 1F

10/02 18:59, , 2F
有用有用!
10/02 18:59, 2F

10/02 19:34, , 3F
這取名是@@
10/02 19:34, 3F

10/06 07:44, , 4F
感謝分享
10/06 07:44, 4F
文章代碼(AID): #1M3XwYIh (R_Language)
文章代碼(AID): #1M3XwYIh (R_Language)