On Sat, 8 Sep 2018, Rui Barradas wrote:
Like Bert said, your data is a data.frame so there is no need to call
aggregate.ts. Besides, R will call the right method so unless you want to
change the standard behaviour, it would be enough to call aggregate and let
the methods dispatch code to its j
Hello,
Like Bert said, your data is a data.frame so there is no need to call
aggregate.ts. Besides, R will call the right method so unless you want
to change the standard behaviour, it would be enough to call aggregate
and let the methods dispatch code to its job.
As for the problem, first a
On Fri, 7 Sep 2018, Bert Gunter wrote:
Well, let's see:
"monthly.rain <- aggregate.ts(x = dp['sampdate','prcp'], by = list(month = \
substr(dp$sampdate, 1, 7)), FUN = sum, na.rm = TRUE)"
1. x is a data frame, so why are you using the time series method?
Perhaps you need to study S3 method usage
Clarification: When using the formula interface, no subscripting is needed.
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Fri, Sep 7, 2018 at 3:25 PM Bert Gunt
Well, let's see:
"monthly.rain <- aggregate.ts(x = dp['sampdate','prcp'], by = list(month = \
substr(dp$sampdate, 1, 7)), FUN = sum, na.rm = TRUE)"
1. x is a data frame, so why are you using the time series method?
Perhaps you need to study S3 method usage in R.
2. You have improperly subscripted
I've read ?aggregate and several blog posts on using aggregate() yet I
still haven't applied it correctly to my dataframe. The sample data are:
structure(list(sampdate = c("2005-01-01", "2005-01-02", "2005-01-03",
"2005-01-04", "2005-01-05", "2005-01-06", "2005-01-07", "2005-01-08",
"2005-01-
6 matches
Mail list logo