When plotting 3d and 4d smooths, we could do better than currently by being a bit selective about what we plot on the surface with geom_raster() and what we assign to the facets.
With a smooth like te(year, long, lat, d = c(1, 2), bs = c("cr", "tp")) say, currently we would plot lat on the facets as it is the third covariate we identify in the smooth definition. instead, we could identify that there is a natural decomposition of this smooth into a series of spatial surfaces, and we should identify if there is a multi-d marginal smooth and if so select the covariates for the other marginal smooth(s) to be the facetting variables.
See the Galveston Bay example for a specific example.
Note that if that example uses bam(..., discrete = TRUE) then the ti() terms will get reordered (as per ?bam) and this makes it impossible to rearrange the order of covariates to "trick" draw() into drawing the right variable(s) as facets. Hence we need to fix finding the 2d smooth.
When plotting 3d and 4d smooths, we could do better than currently by being a bit selective about what we plot on the surface with
geom_raster()
and what we assign to the facets.With a smooth like
te(year, long, lat, d = c(1, 2), bs = c("cr", "tp"))
say, currently we would plotlat
on the facets as it is the third covariate we identify in the smooth definition. instead, we could identify that there is a natural decomposition of this smooth into a series of spatial surfaces, and we should identify if there is a multi-d marginal smooth and if so select the covariates for the other marginal smooth(s) to be the facetting variables.See the Galveston Bay example for a specific example.
Note that if that example uses
bam(..., discrete = TRUE)
then theti()
terms will get reordered (as per?bam
) and this makes it impossible to rearrange the order of covariates to "trick"draw()
into drawing the right variable(s) as facets. Hence we need to fix finding the 2d smooth.