You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
draw() returns the following error when asked to plot a model with an ordered factor as a random effect: Error in .subset2(x, i, exact = exact) : attempt to select less than one element in integerOneIndex
I'm using gratia 0.5.1.9002, and I have updated all packages after updating R to 4.0.4.
The error occurs with both the github version and the CRAN version of gratia.
Reproducible example below:
library(mgcv)
library(gratia)
library(dplyr)
# re with ordered factors causes an error
gam(uptake ~ s(conc, Type, bs = 'fs', k = 5) + s(Plant, bs = 're'),
family = Gamma('log'),
data = CO2) %>%
draw()
# re with unordered factor is ok
gam(uptake ~ s(Plant, bs = 're'),
family = Gamma('log'),
data = mutate(CO2, Plant = factor(Plant, ordered = FALSE))) %>%
draw()
The text was updated successfully, but these errors were encountered:
StefanoMezzini
changed the title
cannot draw() a model with order factor as a random effect
cannot draw() a model with ordered factor as a random effect
Mar 19, 2021
draw() returns the following error when asked to plot a model with an ordered factor as a random effect:
Error in .subset2(x, i, exact = exact) : attempt to select less than one element in integerOneIndex
I'm using gratia 0.5.1.9002, and I have updated all packages after updating R to 4.0.4.
The error occurs with both the github version and the CRAN version of gratia.
Reproducible example below:
The text was updated successfully, but these errors were encountered: