view default chosen k in mgcv's gam() If using the default k in a smooth, e.g.
gam(y ~ s(age), data=dat, family=binomial)
how can I see which k was chosen ?
thanks !

k isn't chosen; it has to be specified by the user. If the user doesn't specify k then a default value is used. For univariate smooths such as the one you fitted, the value is k = 10. Then one of the basis functions is removed due to identifiability constraints (it is confounded with the model intercept). Hence your smooth could use a maximum of 9 effective degrees of freedom.
If you do
summary(model)

replacing model with your model object you'll see how many EDF are used by the smooth. Look at the edf column in the output.
If you want to know what value {mgcv} set k to, then you need to look at the help page for each type of smooth. The jumping off point is ?smooth.terms and from there select the kind of smooth you are using, the default being a thin plate regression spline (TPRS), which is described at ?tprs. Not all smooths have an alias like this, so it is helpful to know that all smooths are described at help pages of the form ?smooth.construct.XXX.smooth.spec with XXX being replaced by the character string you would pass to the bs argument.
