質問

I have used a generalized additive model to analyse some data and now wish to plot the outcome.

library(mgcv)
set.seed(2) ## simulate some data... 
dat <- gamSim(1,n=400,dist="normal",scale=2)
b <- gam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat)
plot(b,pages=1)

From the example above, how is it possible to save the individual plots into different pdf files?

役に立ちましたか?

解決

?plot.gam tells you that there is a select argument

library(mgcv)
set.seed(2) ## simulate some data... 
dat <- gamSim(1,n=400,dist="normal",scale=2)
b <- gam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat)
plot(b,pages=1)
plot(b, select = 1)
plot(b, select = 2)
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top