Hi All. I'm very new in R. I'd like to import data of the form MxMxT, i.e., MxM array in T distinct points. Any ideas how to do that? Regards, Veni? [[alternative HTML version deleted]]
> On Dec 27, 2015, at 11:49 PM, veni arakelian via R-help <r-help at r-project.org> wrote: > > > > Hi All. > > I'm very new in R. I'd like to import data of the form MxMxT, i.e., MxM array in T distinct points. > Any ideas how to do that?It will depend on the form in which this data is represented as a file object. Can you show the appearance of the first two or three MxM items as they would be viewed in a text editor. And PLEASE post in plain text.> Regards, > Veni > > > [[alternative HTML version deleted]]Postin in HTML is generally a sign that you have not read the posting-guide page.> > ______________________________________________ > R-help at 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.David Winsemius Alameda, CA, USA
Welcome to r-help. There are multiple ways to import various kinds of data, but they tend to be organized around how the data are represented in disk files, but you have given no hints about what you have on disk to work with. Also, such data are sometimes represented in memory in so-called "sparse" or "data frame" format, depending on the types of calculations you plan to perform on that data. The best way to clarify how much you need to know is to provide a reproducible example that illustrates how much you already know how to do, with sample data representing both your input and your desired output. You should read about what makes an example clear by reading e.g. [1]. You should also read the Posting Guide mentioned at the bottom of every message on this list. One bit of advice mentioned there that is crucial is sending questions in plain text rather than HTML (as you did this time), since the mailing list usually tries to remove the formatting which tends to damage R code. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example -- Sent from my phone. Please excuse my brevity. On December 27, 2015 11:49:42 PM PST, veni arakelian via R-help <r-help at r-project.org> wrote:> > >Hi All. > >I'm very new in R. I'd like to import data of the form MxMxT, i.e., MxM >array in T distinct points. >Any ideas how to do that? >Regards, >Veni? > > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at 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.[[alternative HTML version deleted]]
Dear David The first three arrays are of the formval(:,:,1) ? ? ?1 ? ? 1 ? ? 1? ? ?1 ? ? 1 ? ? 1? ? ?1 ? ? 1 ? ? 1 val(:,:,2) ? ? ?1 ? ? 0 ? ? 0? ? ?0 ? ? 1 ? ? 1? ? ?0 ? ? 1 ? ? 1 val(:,:,3) ? ? ?1 ? ? 0 ? ? 0? ? ?0 ? ? 1 ? ? 1? ? ?0 ? ? 1 ? ? 1 So I plan to import them in R as a single time series (i.e., 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 0 1 1 1 0 0 0 1 1 0 1 1) and 'reshape' it in the form val[ , , t].? If there is another way more efficient, please let me know. Kind regards,Veni From: David Winsemius <dwinsemius at comcast.net> To: veni arakelian <veniarakelian at yahoo.com> Cc: "r-help at r-project.org" <r-help at r-project.org> Sent: Monday, December 28, 2015 9:24 PM Subject: Re: [R] Multidimensional array> On Dec 27, 2015, at 11:49 PM, veni arakelian via R-help <r-help at r-project.org> wrote: > > > > Hi All. > > I'm very new in R. I'd like to import data of the form MxMxT, i.e., MxM array in T distinct points. > Any ideas how to do that?It will depend on the form in which this data is represented as a file object. Can you show the appearance of the first two or three MxM items as they would be viewed in a text editor. And PLEASE post in plain text.> Regards, > Veni > > > ??? [[alternative HTML version deleted]]Postin in HTML is generally a sign that you have not read the posting-guide page.> > ______________________________________________ > R-help at 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.David Winsemius Alameda, CA, USA [[alternative HTML version deleted]]