Use and calculation of conditional and marginal R2 in generalized additive mixed models In Nakagawa et al. the conditional and marginal R2 are defined for linear mixed models to disentangle the ~variance explained by the fixed and random effects .
Nakagawa, S., Johnson, P. C. D., & Schielzeth, H. (2017). The coefficient of determination R2 and intra-class correlation coefficient from generalized linear mixed-effects models revisited and expanded. Journal of The Royal Society Interface, 14(134), 20170213. doi: 10.1098/rsif.2017.0213
When fitting a generalized additive mixed model (GAMM) via the mgcv package in R with normal errors and identity link, the fit is done via the nlme package here. Is it possible to estimate marginal and conditional R2 for this non linear regression in the same way as for lme, e.g. via the r.squaredGLMM() function from the MuMIn package and if yes why?
Update: What if I rewrite my gam model and use polynomials and lme instead, say
lme(Y~ poly(x1,2):fac+poly(x2,2):fac, random=~1|a/b/d)

does this reduce to:
lme(Y~ I(x1^2):fac+I(x1):fac+I(x2^2):fac+I(x2):fac+fac, random=~1|a/b/d)

so that this reduces to a linear mixed model instead?

The R squared for a non-linear function should be the same as that for a linear function. The reason is that it explains the amount of variance explained by the fitted line of best fit. When you have GAM model, this is the same case. You can think of this as the functional summation of each of the spline basis function terms in the model. The combined summation of best fit line can then be analysed using the exact same variance explained principle as a linear function.
