diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2016-02-08 14:19:09 -0500 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2016-02-08 14:19:09 -0500 |
| commit | 67f05f68ce525200dc70b27f36fc985a7f2fc87a (patch) | |
| tree | c70c922bb426923ff86bc0f34db4e0b83854db01 /R/print.sparsestep.R | |
| download | sparsestep-67f05f68ce525200dc70b27f36fc985a7f2fc87a.tar.gz sparsestep-67f05f68ce525200dc70b27f36fc985a7f2fc87a.zip | |
initial commit
Diffstat (limited to 'R/print.sparsestep.R')
| -rw-r--r-- | R/print.sparsestep.R | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/R/print.sparsestep.R b/R/print.sparsestep.R new file mode 100644 index 0000000..1de1370 --- /dev/null +++ b/R/print.sparsestep.R @@ -0,0 +1,24 @@ +#' @title Print the fitted SparseStep model +#' +#' @description Prints a short text of a fitted SparseStep model +#' +#' @param obj a "sparsestep" object to print +#' +#' @export +#' +#' @examples +#' data(diabetes) +#' attach(diabetes) +#' object <- sparsestep(x, y) +#' print(object) +#' detach(diabetes) +#' +print.sparsestep <- function(obj, ...) +{ + cat("\nCall:\n") + dput(obj$call) + cat("R-squared:", format(round(rev(obj$R2)[1], 3)), "\n") + zeros <- length(which(obj$beta == 0))/length(obj$beta)*100.0 + cat("Percentage coeff zero:", format(round(zeros, 2)), "\n") + invisible(obj) +} |
