This function attempts to summarize an object using the standard base::summary()
function. The original object is attached as an attribute to the result for
reference.
summary_(object, ...)
An object to be summarized.
Additional arguments passed to the summary()
function.
A summary object with an additional "object"
attribute containing
the original input.
is_lm <- lm(data = iris, Petal.Length ~ Sepal.Length)
summary(is_lm)
#>
#> Call:
#> lm(formula = Petal.Length ~ Sepal.Length, data = iris)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -2.47747 -0.59072 -0.00668 0.60484 2.49512
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) -7.10144 0.50666 -14.02 <2e-16 ***
#> Sepal.Length 1.85843 0.08586 21.65 <2e-16 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Residual standard error: 0.8678 on 148 degrees of freedom
#> Multiple R-squared: 0.76, Adjusted R-squared: 0.7583
#> F-statistic: 468.6 on 1 and 148 DF, p-value: < 2.2e-16
#>
summary_(is_lm)
#>
#> Call:
#> lm(formula = Petal.Length ~ Sepal.Length, data = iris)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -2.47747 -0.59072 -0.00668 0.60484 2.49512
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) -7.10144 0.50666 -14.02 <2e-16 ***
#> Sepal.Length 1.85843 0.08586 21.65 <2e-16 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Residual standard error: 0.8678 on 148 degrees of freedom
#> Multiple R-squared: 0.76, Adjusted R-squared: 0.7583
#> F-statistic: 468.6 on 1 and 148 DF, p-value: < 2.2e-16
#>
attr(summary_(is_lm), "object")
#>
#> Call:
#> lm(formula = Petal.Length ~ Sepal.Length, data = iris)
#>
#> Coefficients:
#> (Intercept) Sepal.Length
#> -7.101 1.858
#>