I'm struggling with the best way to apply different predictive models over different geographical areas of a raster stack.
The context of the problem is that different predictive models are developed within different polygonal regions of the overall study area. Each model needs to be used to predict an outcome for just the geographic area for which it was developed. Every pixel has one and only one predictive model, but the model changes across different regions of the landscape. The models come from a "random forest" fit. The problem is that the rasterstack is rather large both in terms of number of pixels and also the number of layers which the predictive model needs to use. If the problem were smaller, there are a number of things I could "get away with" in terms of how I would do this, but given the problem size, I need a more cunning solution. Ideally, I would like to only call predict from the package Raster just once, and have the predict function call the right model based on the geographical location of the pixel. However, not clear that this is possible with the Raster Package, or if it is possible how to implement it efficiently. Any ideas or suggestions greatly appreciated. Cheers! Craig [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list 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.