Re: [R] splitting data matrix into submatrices

2022-01-06 Thread Avi Gross via R-help
,] workweek <- mymat[!weekends,] Is this any better? -Original Message- From: Avi Gross via R-help To: r-help@r-project.org Sent: Wed, Jan 5, 2022 12:52 pm Subject: Re: [R] splitting data matrix into submatrices Faheem seems to reply to people in private and I replid to him in private bu

Re: [R] splitting data matrix into submatrices

2022-01-05 Thread Avi Gross via R-help
rom: Faheem Jan To: Avi Gross Sent: Tue, Jan 4, 2022 11:44 pm Subject: Re: [R] splitting data matrix into submatrices First I will thank you for your interest and time. As my first day is Sunday, in my data matrix 24 are hourly demand of electricity. As electricity demand is different is working

Re: [R] splitting data matrix into submatrices

2022-01-05 Thread Stephen H. Dawson, DSL via R-help
Hi, Please post the data structure so it is more clear what data is being massaged. Thanks, *Stephen Dawson, DSL* /Executive Strategy Consultant/ Business & Technology +1 (865) 804-3454 http://www.shdawson.com On 1/4/22 10:52 PM, Faheem Jan via R-help wrote: I

Re: [R] splitting data matrix into submatrices

2022-01-05 Thread PIKAL Petr
at[which(fac==2), ] [,1] [,2] [,3] [,4] [1,]27 12 17 [2,]49 14 19 Cheers Petr > -Original Message- > From: R-help On Behalf Of Jeff Newmiller > Sent: Wednesday, January 5, 2022 8:57 AM > To: Faheem Jan ; R-help > Subject: Re: [R] splittin

Re: [R] splitting data matrix into submatrices

2022-01-04 Thread Jeff Newmiller
Please reply all so the mailing list is included in the discussion. I don't do 1:1 tutoring and others can chime in if I make a mistake. I would say you don't understand what my example did, since it doesn't care how many columns are in your data frame. If you are in fact working with a matrix,

Re: [R] splitting data matrix into submatrices

2022-01-04 Thread Jeff Newmiller
A lot of new R users fail to grasp what makes data frames more useful than matrices, or use data frames without even realizing they are not using matrices. This is important because there are more tools for manipulating data frames than matrices. One tool is the split function... if you have a

Re: [R] splitting data matrix into submatrices

2022-01-04 Thread Avi Gross via R-help
logical index wants.  If I have misunderstood the problem, ignore. -Original Message- From: Faheem Jan via R-help To: R-help Mailing List Sent: Tue, Jan 4, 2022 10:52 pm Subject: [R] splitting data matrix into submatrices I have data in a matrix form of order 1826*24 where 1826 represents

[R] splitting data matrix into submatrices

2022-01-04 Thread Faheem Jan via R-help
I have data in a matrix form of order 1826*24 where 1826 represents the days and 24 hourly observations on each data. My objective is to split the matrix into working (Monday to Friday) and non-working (Saturday and Sunday) submatrices. Can anyone help me that how I will do that splitting using