Re: [R] fun.aggregate=mean in reshape

2008-02-14 Thread hadley wickham
> Of course your reasoning is clear and an in better knowledge about R > will help me to better interpret its error messages in the future. But > for an entry-level R user like me a conflict warning will be quite helpful. The next version of reshape should do better - I check whether fun.aggreg

Re: [R] fun.aggregate=mean in reshape

2008-02-12 Thread Peter Dalgaard
Charilaos Skiadas wrote: > On Feb 12, 2008, at 1:31 PM, [Ricardo Rodriguez] Your XEN ICT Team > wrote: > > >> Sundar Dorai-Raj wrote: >> >> Could it we advisable that cast, melt or whatever function we deal >> with >> throws an more informative error message when this kind of conflicts >> oc

Re: [R] fun.aggregate=mean in reshape

2008-02-12 Thread [Ricardo Rodriguez] Your XEN ICT Team
Charilaos Skiadas wrote: > > It tells you that a call to get was attempted looking for a variable > of mode "function", and such a variable was not found. The problem is > of course that the call tells you the variable is named "fun", while > you expected it to be named "mean". But it alerts to

Re: [R] fun.aggregate=mean in reshape

2008-02-12 Thread Charilaos Skiadas
On Feb 12, 2008, at 1:31 PM, [Ricardo Rodriguez] Your XEN ICT Team wrote: > Sundar Dorai-Raj wrote: > > Could it we advisable that cast, melt or whatever function we deal > with > throws an more informative error message when this kind of conflicts > occur? I am guessing this is a pretty frequ

Re: [R] fun.aggregate=mean in reshape

2008-02-12 Thread [Ricardo Rodriguez] Your XEN ICT Team
Sundar Dorai-Raj wrote: > > Do you have an object called 'mean' that's masking the base::mean > function? I can replicate your error using the following: > > HTH, It did! I had a mean object in the current workspace. Once it was deleted, the argument works without a glitch. Sorry for being late

Re: [R] fun.aggregate=mean in reshape

2008-02-12 Thread Sundar Dorai-Raj
[Ricardo Rodriguez] Your XEN ICT Team said the following on 2/12/2008 12:23 AM: > Hi all, > > We are facing a problem while introducing ourselves to Reshape package > use. Melt seems to work fine, but cast fails when we use mean as > fun.aggregate. As you see here, length and sum work fine, b

Re: [R] fun.aggregate=mean in reshape

2008-02-12 Thread jiho
On 2008-February-12 , at 11:11 , Henrique Dallazuanna wrote: > You can use aggregate: > > aggregate(data[,c("ozone", "solar.r", "wind", "temp")], > list(month=data$month), mean) > > On 12/02/2008, [Ricardo Rodriguez] Your XEN ICT Team <[EMAIL PROTECTED] > > wrote: >> Hi all, >> >> We are facing

Re: [R] fun.aggregate=mean in reshape

2008-02-12 Thread Henrique Dallazuanna
You can use aggregate: aggregate(data[,c("ozone", "solar.r", "wind", "temp")], list(month=data$month), mean) On 12/02/2008, [Ricardo Rodriguez] Your XEN ICT Team <[EMAIL PROTECTED]> wrote: > Hi all, > > We are facing a problem while introducing ourselves to Reshape package > use. Melt seems to w

[R] fun.aggregate=mean in reshape

2008-02-12 Thread [Ricardo Rodriguez] Your XEN ICT Team
Hi all, We are facing a problem while introducing ourselves to Reshape package use. Melt seems to work fine, but cast fails when we use mean as fun.aggregate. As you see here, length and sum work fine, but mean throws this same error whatever dataset we use. > cast(aqm, month ~ variable, leng