[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,

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 work fine, but

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 the fact

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 frequent

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 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 occur? I am

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, but

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 a problem while