æ¬æ¥ã®æºæï¼dplyrã§sliceããã£ã¨æ´»ç¨ãããã
æºæã§ãã
ä»ã¾ã§ç§ã¯ããåã®æå°å¤ãå«ãè¡ãæ½åºããéãfilter()ãç¨ãã¦ä»¥ä¸ã®ããã«æ¸ãã¦ãã¾ããã
library(dplyr) iris %>% filter(Sepal.Length == min(Sepal.Length))
ãããbaseã®æ¸ãæ¹ã§ããã°which.min()ã使ã£ã¦ä»¥ä¸ã®ããã«æ¸ãã¾ãã
iris[which.min(iris$Sepal.Length), ]
dplyrã§ãwhich.minããããªãã§ãfilterã«ã¯TRUE/FALSEãè¿ãé¢æ°ããæå®ã§ããªãããªãã¨ãç¬ãåç¹ãã¦ããããã§ãã
ã§ãããdplyrã«ã¯è¡çªå·ãå
¥åã«ã¨ãslice()ããããããã使ãã°which.min()ã§ããã
library(dplyr) iris %>% slice(which.min(Sepal.Length))
æçã§æ¸ããç¯å²ã§æºè¶³ã修練ãæ ã£ã¦ããã¾ããã
ããã«æºæã¨ããã¦ããã ãã¾ããZANGE