[R] Selecting groups with R

jlwoodard john.woodard at wayne.edu
Sat Aug 22 01:03:27 CEST 2009




David Winsemius wrote:
> 
> t.test expects two numeric vectors, not a numeric vector and a  
> grouping indicator.
> 
>  > t.test(dataset[dataset$Color=="RED", "Score"], dataset[dataset 
> $Color=="WHITE", "Score"] )
> 
> 

Thank you again, David!  I also just realized I could have replaced the
comma with a tilde, as in
t.test(Score~Color).  What a difference a character makes!

John
-- 
View this message in context: http://www.nabble.com/Selecting-groups-with-R-tp25088073p25088645.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list