Skip to content
Prev 22028 / 29559 Next

subplots of maps in R using hydroTSM package

Many thanks, Jon.
Just what I wanted.
Zilefac.
On Monday, November 24, 2014 2:48 AM, Jon Skoien <jon.skoien at jrc.ec.europa.eu> wrote:
Hi Zilefac,

Your problem is not really related to hydroTSM, but to the fact that 
hydrokrige uses spplot for plotting, which is again based on the lattice 
package. This does not use the par()-arguments.
Instead there are two other ways for producing multiple plots in one figure:
- Save each of the prediction-results from hydrokrige in a different 
column of a results-object and plot them with spplot later:
res = hydrokrige("1st dataset")
res$var2.pred = hydrokrige("2nd dataset")$var1.pred
res$var3.pred = hydrokrige("2nd dataset")$var3.pred
...
spplot(res, c("var1.pred", "var2.pred", ...))

- Use the location arguments of plot.trellis when you plot the resulting 
objects.
res1 = hydrokrige("1st dataset")
res2 = hydrokrige("2nd dataset")
print(res1, position = c(0,0,.5,.5),more=TRUE)
print(res1, position = c(0,0.5,.5,.5),more=TRUE)
....

You can in both cases turn of the plotting in hydrokrige, as the 
function will not be able to do multiplots by itself.

For your second question, you should be able to transform your 
coordinates with spTransform, if you have the proj4string of your 
coordinates.

Cheers,
Jon
On 11/23/2014 6:13 PM, Zilefac Elvis wrote: