Learn R Programming

spareg (version 1.1.1)

print.coefspar: Print Method for 'coefspar' Object

Description

Print method showing the basic components of a 'coefspar' object.

Usage

# S3 method for coefspar
print(x, digits = 4L, show = 6L, ...)

Value

Invisibly returns the input object x.

Arguments

x

An object of class 'coefspar', typically created by a custom model function.

digits

integer digits to be printed, defaults to 4L.

show

integer number of coefficients to be shown, defaults to 6L.

...

Additional arguments passed to or from other methods (ignored here).

Examples

Run this code
example_data <- simulate_spareg_data(n = 100, p = 2000, ntest = 100)
spar_res <- spareg(example_data$x, example_data$y, xval = example_data$xtest,
  yval = example_data$ytest, nummods=c(5, 10))
coef(spar_res)
coef(spar_res, aggregate = "median")
coef(spar_res, aggregate = "none")
print(coef(spar_res), show = 10L, digits = 6L)

Run the code above in your browser using DataLab