[R-sig-Geo] [FORGED] Modifying the length of a matrix variable

Rolf Turner r@turner @end|ng |rom @uck|@nd@@c@nz
Sun Mar 31 00:43:23 CET 2019


On 31/03/19 12:30 PM, rain1290 using aim.com wrote:

> Yes, I reproduced the example above and it works just fine (and is what 
> I want!!), but I cannot see why it does not work with my data, as it is 
> a 3-dimensional array (latitude, longitude and time).
> 
> This is what comes from print(Model4):
> 
> 3 variables (excluding dimension variables): double 
> onedaymax[lon,lat,time] (Contiguous storage) units: mm/day double 
> fivedaymax[lon,lat,time] (Contiguous storage) units: mm/day short 
> Year[time] (Contiguous storage) 3 dimensions: time Size:95 lat Size:64 
> units: degree North lon Size:128 units: degree East
> 
> 
> I reviewed it over and over again, but I cannot see why this would not work?

Psigh!  Clearly Model4 is *not* an array!!!  It is an object of some 
"specialised" class (for which there is specialised print() method).  I 
have no idea what that class might be, but *you can tell.  What does

    class(Model4)

return?

Where did this "Model4" object come from?  What are you trying to *do*?

You might be able to get somewhere by searching (e.g. via Google) on
"subsetting objects of class melvin" where "melvin" is what is returned 
by "class(Model4)".

Doing

     str(Model4)

could be enlightening (but given your stubborn refusal to acquire 
insight into the workings of R, I am not optimistic).

This is not magic or religion.  You need to *understand* what you are 
dealing with, and proceed rationally.  Don't just hammer and hope.

cheers,

Rolf

-- 
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276



More information about the R-sig-Geo mailing list