GNU R,subset()ã®subsetå¼æ°ã®æå³
前回の疑問ã«ã¤ãã¦ã
ã³ã¡ã³ãã§ææããã¦æ°ã¥ãããã ãã©ãsubsetã«æ¸¡ãå¼æ°ã«ã¤ãã¦èª¤è§£ãã¦ããããã ã
subset(data,col1 == 1)
第äºå¼æ°ãè¡ãã¨ã«è©ä¾¡ããã¦ãã£ã«ã¿ã«ä½¿ããããã ããã¨æã£ã¦ãã(Rã¯é
延è©ä¾¡ãªã®ã§ããããè¸å½ããµã¤ãã«ã§ãããã ãâ¦â¦)ããå®éã«ã¯dataã®col1åã¨ãããã¯ãã«ã«å¯¾ãã¦==æ¼ç®åãé©ç¨ãã¦çå½å¤ã®ãã¯ãã«ãè¿ããã®ã ã£ãã¨ããã
第äºå¼æ°ã¯dataãattachãããæèã§è©ä¾¡ããã¦ã
subset(data,data$col1 == 1)
ã¨åçã«ãªããæçµçã«ã¯
subset(data,c(TRUE,FALSE,TRUE,TRUE,...))
ã¨åçããªãã»ã©ãªã¼ã