smooth_samples() was failing when data was supplied that contained more variables than were used in the smooth that was being sampled. Hence this generally fail unless a single smooth was being sampled from or the model contained only a single smooth. The function never intended to retain all the variables in data but was written in such a way that it would fail when relocating the data columns to the end of the posterior sampling object.
> smooth_samples(m_gam, data = df, seed = 2, n = 1)
Error in `relocate()` at gratia/R/posterior-samples.R:810:5:
! Can't subset columns that don't exist.
✖ Columns `y`, `x1`, `x2`, `x3`, `f`, etc. don't exist.
Run `rlang::last_trace()` to see where the error occurred.
smooth_samples()
was failing whendata
was supplied that contained more variables than were used in the smooth that was being sampled. Hence this generally fail unless a single smooth was being sampled from or the model contained only a single smooth. The function never intended to retain all the variables indata
but was written in such a way that it would fail when relocating the data columns to the end of the posterior sampling object.fails with