Skip to content

[FORGED] Modifying the length of a matrix variable

3 messages · r@i@1290 m@iii@g oii @im@com, Rolf Turner, Stephen Stewart

#
Model4 <- brick("MaxPrecCCCMACanESM2rcp45.nc", var="onedaymax")
That is how Model4 is derived.?
When trying class(Model4), I receive:
[1] "RasterBrick"
attr(,"package")
[1] "raster"

Meanwhile, I will check on Google to see what I come up with in terms of your suggestion. :)
-----Original Message-----
From: Rolf Turner <r.turner at auckland.ac.nz>
To: rain1290 <rain1290 at aim.com>
Cc: r-sig-geo <r-sig-geo at r-project.org>
Sent: Sat, Mar 30, 2019 7:43 pm
Subject: Re: [FORGED] [R-sig-Geo] Modifying the length of a matrix variable
On 31/03/19 12:30 PM, rain1290 at aim.com wrote:

            
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
#
On 31/03/19 12:56 PM, rain1290 at aim.com wrote:

            
I know nothing about rasters, the brick() function, or the raster 
package, so include me out at this stage.

Others on the list may be able to help you.  Particular if you can force 
yourself to ask a *focussed* question.

cheers,

Rolf
#
The last few messages provided important information which was previously
absent. Try:

subset = Model4[[1:90]]

This will subset the brick to layers 1 through 90.

I would also suggest some further reading around the raster package and
NetCDF files (e.g. the ncdf4 package) would be useful to you.
On Sun, 31 Mar 2019 at 11:06, Rolf Turner <r.turner at auckland.ac.nz> wrote: