diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2016-02-10 20:19:51 -0500 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2016-02-10 20:19:51 -0500 |
| commit | 6c3d2ff1cb9e7bd3bf1426e1ec4cecd0891ea089 (patch) | |
| tree | 0cf43714e1252ae833e473dc6beed6ddad953663 /R/coef.sparsestep.R | |
| parent | added authors and dependencies (diff) | |
| download | sparsestep-6c3d2ff1cb9e7bd3bf1426e1ec4cecd0891ea089.tar.gz sparsestep-6c3d2ff1cb9e7bd3bf1426e1ec4cecd0891ea089.zip | |
bugfixes, documentation improvements, and generic function agreement
Diffstat (limited to 'R/coef.sparsestep.R')
| -rw-r--r-- | R/coef.sparsestep.R | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/R/coef.sparsestep.R b/R/coef.sparsestep.R index 3a6286c..713bcb2 100644 --- a/R/coef.sparsestep.R +++ b/R/coef.sparsestep.R @@ -2,7 +2,8 @@ #' #' @description Returns the coefficients of the SparseStep model. #' -#' @param obj a "sparsestep" object +#' @param object a "sparsestep" object +#' @param ... further argument are ignored #' #' @return The coefficients of the SparseStep model (i.e. the betas). If the #' model was fitted with an intercept this will be the first value in the @@ -17,12 +18,12 @@ #' fit <- sparsestep(x, y) #' coef(fit) #' -coef.sparsestep <- function(obj, ...) +coef.sparsestep <- function(object, ...) { - if (obj$intercept) { - beta <- rbind(obj$a0, obj$beta) + if (object$intercept) { + beta <- rbind(object$a0, object$beta) } else { - beta <- obj$beta + beta <- object$beta } nbeta <- drop0(Matrix(as.matrix(beta))) |
