If the question is actually a statistical topic disguised as a coding question, then OP should edit the question to clarify this. After the statistical content has been clarified, the question is eligible for reopening.

I am trying to plot the smooths from a GAMMs model that includes a smooth over time, split by condition (s(Time, by=condition)). plot_smooth from itsadug plots all conditions in the same plot โ€” is there a way for me to facet these so each condition smooth is on a different plot (in ggplot style)?

I tried using ggpredict and then ggplot, but the plots look very different from the smooth plots from plot_smooth (a lot more wiggly), I think because of the way random effects are excluded by plot_smooth โ€” this too, I'm not too sure about.

Thanks for your help.