8
s <- function(x, df=4, spar=0, ...)
12
ans <- as.character(xs)
14
stop("x argument must be of length one")
16
call <- deparse(sys.call())
18
if (ncol(as.matrix(x)) > 1)
19
stop("x must be a vector")
20
if (!is.null(levels(x))) {
21
x <- if (inherits(x, "ordered")) codes(x) else
22
stop("unordered factors cannot be used as smoothing variables")
24
attr(x, "spar") <- spar
26
attr(x, "call") <- call
27
attr(x, "class") <- "smooth"
28
attr(x, "s.xargument") <- ans # Needed for prediction and constraints
8
s <- function(x, df = 4, spar = 0, ...) {
11
ans <- as.character(xs)
13
stop("x argument must be of length one")
15
call <- deparse(sys.call())
17
if (ncol(as.matrix(x)) > 1)
18
stop("x must be a vector")
19
if (!is.null(levels(x))) {
20
x <- if (is.ordered(x)) {
23
stop("unordered factors cannot be used as smoothing variables")
25
attr(x, "spar") <- spar
27
attr(x, "call") <- call
28
attr(x, "class") <- "smooth"
29
attr(x, "s.xargument") <- ans # Needed for prediction and constraints
33
attr(x, "NAs") <- seq(along = x)[a]
34
attr(x, "NAs") <- seq(along = x)[a]