aboutsummaryrefslogtreecommitdiff
path: root/R/coef.sparsestep.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/coef.sparsestep.R')
-rw-r--r--R/coef.sparsestep.R11
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)))