Re: [R] Data in Array
Thank you - Original Message From: jim holtman jholt...@gmail.com To: FMH kagba2...@yahoo.com Cc: Schalk Heunis schalk.heu...@enerweb.co.za; r-help@r-project.org Sent: Tuesday, September 8, 2009 3:45:09 PM Subject: Re: [R] Data in Array Not sure what you mean by 'store', but you can use a list: a - matrix(1, nrow = 5, ncol = 1) b - matrix(2, nrow = 10, ncol = 1) c - matrix(3, nrow = 15, ncol = 1) myList - list(a, b, c) str(myList) List of 3 $ : num [1:5, 1] 1 1 1 1 1 $ : num [1:10, 1] 2 2 2 2 2 2 2 2 2 2 $ : num [1:15, 1] 3 3 3 3 3 3 3 3 3 3 ... myList[[2]] [,1] [1,] 2 [2,] 2 [3,] 2 [4,] 2 [5,] 2 [6,] 2 [7,] 2 [8,] 2 [9,] 2 [10,] 2 On Tue, Sep 8, 2009 at 8:14 AM, FMHkagba2...@yahoo.com wrote: Yes, but what actually i want to have is an array that might store these different matrices. - Original Message From: Schalk Heunis schalk.heu...@enerweb.co.za To: FMH kagba2...@yahoo.com Cc: r-help@r-project.org Sent: Tuesday, September 8, 2009 11:16:29 AM Subject: Re: [R] Data in Array have you tried rbind? On Tue, Sep 8, 2009 at 11:16 AM, FMHkagba2...@yahoo.com wrote: Dear All, I have some data which were stored in few matrices with different orders. Let have three different matrices a, b and c, which have the same number of column but different number of row. a - matrix(1, nrow = 5, ncol = 1) b - matrix(2, nrow = 10, ncol = 1) c - matrix(3, nrow = 15, ncol = 1) How could i put all these matrices in an array? Thank you Kagba __ R-help@r-project.org mailing list 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. __ R-help@r-project.org mailing list 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. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? __ R-help@r-project.org mailing list 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.
[R] Data in Array
Dear All, I have some data which were stored in few matrices with different orders. Let have three different matrices a, b and c, which have the same number of column but different number of row. a - matrix(1, nrow = 5, ncol = 1) b - matrix(2, nrow = 10, ncol = 1) c - matrix(3, nrow = 15, ncol = 1) How could i put all these matrices in an array? Thank you Kagba __ R-help@r-project.org mailing list 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.
Re: [R] Data in Array
have you tried rbind? On Tue, Sep 8, 2009 at 11:16 AM, FMHkagba2...@yahoo.com wrote: Dear All, I have some data which were stored in few matrices with different orders. Let have three different matrices a, b and c, which have the same number of column but different number of row. a - matrix(1, nrow = 5, ncol = 1) b - matrix(2, nrow = 10, ncol = 1) c - matrix(3, nrow = 15, ncol = 1) How could i put all these matrices in an array? Thank you Kagba __ R-help@r-project.org mailing list 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. __ R-help@r-project.org mailing list 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.
Re: [R] Data in Array
Yes, but what actually i want to have is an array that might store these different matrices. - Original Message From: Schalk Heunis schalk.heu...@enerweb.co.za To: FMH kagba2...@yahoo.com Cc: r-help@r-project.org Sent: Tuesday, September 8, 2009 11:16:29 AM Subject: Re: [R] Data in Array have you tried rbind? On Tue, Sep 8, 2009 at 11:16 AM, FMHkagba2...@yahoo.com wrote: Dear All, I have some data which were stored in few matrices with different orders. Let have three different matrices a, b and c, which have the same number of column but different number of row. a - matrix(1, nrow = 5, ncol = 1) b - matrix(2, nrow = 10, ncol = 1) c - matrix(3, nrow = 15, ncol = 1) How could i put all these matrices in an array? Thank you Kagba __ R-help@r-project.org mailing list 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. __ R-help@r-project.org mailing list 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.
Re: [R] Data in Array
Not sure what you mean by 'store', but you can use a list: a - matrix(1, nrow = 5, ncol = 1) b - matrix(2, nrow = 10, ncol = 1) c - matrix(3, nrow = 15, ncol = 1) myList - list(a, b, c) str(myList) List of 3 $ : num [1:5, 1] 1 1 1 1 1 $ : num [1:10, 1] 2 2 2 2 2 2 2 2 2 2 $ : num [1:15, 1] 3 3 3 3 3 3 3 3 3 3 ... myList[[2]] [,1] [1,]2 [2,]2 [3,]2 [4,]2 [5,]2 [6,]2 [7,]2 [8,]2 [9,]2 [10,]2 On Tue, Sep 8, 2009 at 8:14 AM, FMHkagba2...@yahoo.com wrote: Yes, but what actually i want to have is an array that might store these different matrices. - Original Message From: Schalk Heunis schalk.heu...@enerweb.co.za To: FMH kagba2...@yahoo.com Cc: r-help@r-project.org Sent: Tuesday, September 8, 2009 11:16:29 AM Subject: Re: [R] Data in Array have you tried rbind? On Tue, Sep 8, 2009 at 11:16 AM, FMHkagba2...@yahoo.com wrote: Dear All, I have some data which were stored in few matrices with different orders. Let have three different matrices a, b and c, which have the same number of column but different number of row. a - matrix(1, nrow = 5, ncol = 1) b - matrix(2, nrow = 10, ncol = 1) c - matrix(3, nrow = 15, ncol = 1) How could i put all these matrices in an array? Thank you Kagba __ R-help@r-project.org mailing list 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. __ R-help@r-project.org mailing list 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. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? __ R-help@r-project.org mailing list 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.