Skip to content
Back to formatted view

Raw Message

Message-ID: <EEBA6CF8-BFC4-4536-AF76-C9745093119D@comcast.net>
Date: 2012-08-30T15:00:59Z
From: David Winsemius
Subject: tapply confusion
In-Reply-To: <1346324541655-4641820.post@n4.nabble.com>

On Aug 30, 2012, at 4:02 AM, andyspeak wrote:

> Hello
> Thankyou for the help.
>
> kruskal.test(Temp, Roof)   is simple but just returns one result for  
> the
> whole temperature dataset organised by roof.
>
> I want to compare the Temp data for each Roof in each Month.  So  
> because i
> have temperature data on the three roofs for 16 different months  
> then i want
> 16 separate kruskal.test results.,
>

lapply( split(dfrm, dfrm$Month), function(xfrm) {
                  kruskal.test(xfrm[["Temp"]], xfrm[["Roof"]] }

Notice that I used an assumed name for the dataframe. You have  
apparently been following unwise advice to use attach. You would be  
advised to disregard that advice.

-- 

David Winsemius, MD
Alameda, CA, USA