[R] Mean absolute error from data matrix

PIKAL Petr petr@p|k@| @end|ng |rom prechez@@cz
Thu Jun 24 08:34:47 CEST 2021


First, please do not post in HTML. It usually scrambles any posted code.

Second, as you did not post any code or data your message was not scrambled 
but I wonder what are columns and what are rows and what do you actually 


Suppose the ist column of the
> second matrix is Sunday then we choose each column of the first matrix
> having Sunday

I deduct that you have 24 rows and 1827 or 365 columns.

It sems to me that you will have easier situation if you transpose matrix, set 
column with dates. From that you can choose all dates fulfilling criteria 
(being Sunday)
See help page for Date

and you can do any calculation for each row
See tapply, aggregate, ...


> -----Original Message-----
> From: R-help <r-help-bounces using r-project.org> On Behalf Of Faheem Jan via
> R-help
> Sent: Wednesday, June 23, 2021 8:03 PM
> To: R-help Mailing List <r-help using r-project.org>
> Subject: [R] Mean absolute error from data matrix
> I have data matrix of order 24*2192 where 2192 are the days and 24 are
> hour's of a single day,so simple words I have 2192 days and each day having
> 24 observations.the data matrix is divided into two matrix,the ist matrix is 
> of
> order 24*1827 and second is of order 24*365. Suppose the ist column of the
> second matrix is Sunday then we choose each column of the first matrix
> having Sunday. The takeing the first column of data matrix is converted into
> vector and all the Sunday columns are converted into vectors. Then we
> calculate mean absolute errors for different pairs of the first vector of 
> the
> second matrix with each vector of first matrix. Similarly process is 
> repeated
> for the rest of the week days. It clear that such process is quite time
> consuming and hard if perform manually. Can any one provides the easiest
> way to do such problem.Regard
> Sent from Yahoo Mail on Android
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list