[R] 4D data acsess

Sarah Goslee sarah.goslee at gmail.com
Wed Jun 29 20:36:06 CEST 2011


Hi Katia,

On Wed, Jun 29, 2011 at 12:50 PM, Katia Smirnova <katiasmirn at gmail.com> wrote:
> Hi, I have a 4D data file from MATLAB, call it X,  that I want to analyze in
> R. The first 3 dimensions are x y z coordinates and the forth is a value in
> time.
>
> If you took a sample vector in matlab it would look like
>
> vec1 = X(x1, y1, z1, :)
> vec2 = X( x2, y2, z2, :)
>
> this would give you all values (I have 300 of them) corresponding to this
> (x1,y1,z1) point of X.
>
> Now I read the MATLAB datafile 4D X into R and want to address vec1 and vec2
> in R and work with the fourth column values only.

How did you import the MATLAB file?

> I tried something like X[ x1, y1, z1, ] to pull out the 4th column values
> but R tells me that X has incorrect dimensions.

We need a description of X. dim(X) and str(X) might be good starts.

You don't really provide enough information to be able to answer.

Sarah

-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list