r - Selecting rows using grep vs using == -
i brand new r
i tried select rows dataset using following:
1. completeresults <- results[ results$final_status=="tsicompleted"]
it returned full dataset though (seemingly) logical equivalent works:
2. timestrimmed<-times[times$totaltimemins<60,]
then after doing research, tried following work:
3. completeresults <- results[grep("tsicompleted", results$final_status), ]
why 2 work 1 doesn't work?
thanks
missing comma
completeresults <- results[ results$final_status=="tsicompleted",]
Comments
Post a Comment