ns(x, df=4, knots=NULL)
and
ns(x, df=4)
produce different results despite the fact that
> args(ns)
function (x, df = NULL, knots = NULL, intercept = FALSE, Boundary.knots = range(x))
This is because ns() is testing knots using missing(knots) rather than is.null(knots). This caused a bug in my code that took some head scratching to locate. Is this desired behavior or a bug?