Re: [R] expand gridded matrix to higher resolution

2017-07-05 Thread Anthoni, Peter (IMK)
Hi Jeff, thanks, the raster package disaggregate will do the trick as well. library(raster) rmm <- raster(ncols=5, nrows=3) rmm[] <- matrix(1:15,nrow=3,byrow = T) xrmm <- disaggregate(rmm, fact=c(3, 3)) > > as.matrix(rmm) > [,1] [,2] [,3] [,4] [,5] > [1,]12345 > [2,]6

Re: [R] expand gridded matrix to higher resolution

2017-07-05 Thread Jeff Newmiller
You probably ought to be using the raster package. See the CRAN Spatial Task View. -- Sent from my phone. Please excuse my brevity. On July 5, 2017 12:20:28 AM PDT, "Anthoni, Peter (IMK)" wrote: >Hi all, >(if me email goes out as html, than my email client don't do as told, >and I apologies al

Re: [R] expand gridded matrix to higher resolution

2017-07-05 Thread Anthoni, Peter (IMK)
Hi Jim, thanks that works like a charm. cheers Peter > On 5. Jul 2017, at 12:01, Jim Lemon wrote: > > Hi Peter, > > apply(t(apply(mm,1,rep,each=3)),2,rep,each=3) > > Jim > > On Wed, Jul 5, 2017 at 5:20 PM, Anthoni, Peter (IMK) > wrote: >> Hi all, >> (if me email goes out as html, than

Re: [R] expand gridded matrix to higher resolution

2017-07-05 Thread Jim Lemon
Hi Peter, apply(t(apply(mm,1,rep,each=3)),2,rep,each=3) Jim On Wed, Jul 5, 2017 at 5:20 PM, Anthoni, Peter (IMK) wrote: > Hi all, > (if me email goes out as html, than my email client don't do as told, and I > apologies already.) > > We need to downscale climate data and therefore first need t

[R] expand gridded matrix to higher resolution

2017-07-05 Thread Anthoni, Peter (IMK)
Hi all, (if me email goes out as html, than my email client don't do as told, and I apologies already.) We need to downscale climate data and therefore first need to expand the climate from 0.5deg to the higher resolution 10min, before we can add high resolution deviations. We basically need to