clusterR (fun=aggregate) error "number of items to replace is not a multiple of replacement length"

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

clusterR (fun=aggregate) error "number of items to replace is not a multiple of replacement length"

Nevil Amos
I am getting the above  error with clusterR and aggregate:

works fine without parralell:

library(raster)
r<-raster(matrix(data = sample(c(1:10,NA),10000,replace=T),100,100),xmn=0,
xmx=1000,ymn=0,ymx=1000)
beginCluster()
Parr_agg<-clusterR(r,fun=aggregate,args=list(fact=3,fun=modal,expand=TRUE,na.rm=TRUE))
endCluster()
agg<-aggregate(r,3,fun=modal,na.rm=TRUE)
plot(agg)

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: clusterR (fun=aggregate) error "number of items to replace is not a multiple of replacement length"

Nevil Amos
Apoligies.  did not read help properly it states:
"Among other functions, it does _not_ work with ... (dis)aggregate"

On Mon, Apr 20, 2015 at 4:54 PM, nevil amos <[hidden email]> wrote:

> I am getting the above  error with clusterR and aggregate:
>
> works fine without parralell:
>
> library(raster)
> r<-raster(matrix(data = sample(c(1:10,NA),10000,replace=T),100,100),xmn=0,
> xmx=1000,ymn=0,ymx=1000)
> beginCluster()
>
> Parr_agg<-clusterR(r,fun=aggregate,args=list(fact=3,fun=modal,expand=TRUE,na.rm=TRUE))
> endCluster()
> agg<-aggregate(r,3,fun=modal,na.rm=TRUE)
> plot(agg)
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.