Closed Aariq closed 2 years ago
Definitely not common but something I want to handle. If smooth_estimates()
can generate the right output then it should be trivial to fix draw()
to handle it correctly; I'm, probably just making a wrong assumption somewhere about what the tensor smooth plotting code should handle...
My guess is the problem comes about when trying to plot the raw data points. Maybe a data =
argument to that geom_point()
layer would fix it. Alternatively, you could just not allow plotting of data points when the model frame contains things other than vectors. mgcv
has a few places where when you try to do something you ordinarily can do, but the dimensions of te()
are matrixes, it just gives an informative error.
That's 100% right, the processing that attaches the raw data points for the rug plots wasn't expecting matrices in the input data. I've fixed this code to flatten the elements of the input data just like {mgcv} treats them. I should have a fix pushed today once I've finished running through all the unit tests to make sure this hasn't broken anything else.
Thanks for the quick fix!
This is maybe an uncommon way to parameterize GAMs, so this is probably an edge case. If the dimensions in, say
te()
are each matrixes, thendraw.gam()
errors when other methods still work.Reprex:
Created on 2021-09-22 by the reprex package (v2.0.1)