Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

brief

Print Abbreviated Ouput


Description

Print data objects and statistical model summaries in abbreviated form.

Usage

brief(object, ...)

## S3 method for class 'data.frame'
brief(object, rows = if (nr <= 10) c(nr, 0) else c(3, 2),
    cols, head=FALSE, tail=FALSE, elided = TRUE,
    classes = inherits(object, "data.frame"), ...)
## S3 method for class 'matrix'
brief(object, rows = if (nr <= 10) c(nr, 0) else c(3, 2), ...)

## S3 method for class 'numeric'
brief(object, rows = c(2, 1), elided = TRUE, ...)
## S3 method for class 'integer'
brief(object, rows = c(2, 1), elided = TRUE, ...)
## S3 method for class 'character'
brief(object, rows = c(2, 1), elided = TRUE, ...)
## S3 method for class 'factor'
brief(object, rows=c(2, 1), elided=TRUE, ...)

## S3 method for class 'list'
brief(object, rows = c(2, 1), elided = TRUE, ...)

## S3 method for class 'function'
brief(object, rows = c(5, 3), elided = TRUE, ...)

## S3 method for class 'lm'
brief(object,  terms = ~ .,
    intercept=missing(terms), pvalues=FALSE,
    digits=3, horizontal=TRUE, vcov., ...)

## S3 method for class 'glm'
brief(object, terms = ~ .,
    intercept=missing(terms), pvalues=FALSE,
    digits=3, horizontal=TRUE, vcov., dispersion, exponentiate, ...)

## S3 method for class 'multinom'
brief(object, terms = ~ .,
    intercept=missing(terms), pvalues=FALSE,
    digits=3, horizontal=TRUE, exponentiate=TRUE, ...)

## S3 method for class 'polr'
brief(object, terms = ~ .,
    intercept, pvalues=FALSE,
    digits=3, horizontal=TRUE, exponentiate=TRUE, ...)

## Default S3 method:
brief(object, terms = ~ .,
    intercept=missing(terms), pvalues=FALSE,
    digits=3, horizontal=TRUE, ...)

Arguments

object

a data or model object to abbreviate.

rows

for a matrix or data frame, a 2-element integer vector with the number of rows to print at the beginning and end of the display; for a vector or factor, the number of lines of output to show at the beginning and end; for a list, the number of elements to show at the beginning and end; for a function, the number of lines to show at the beginning and end.

cols

for a matrix or data frame, a 2-element integer vector with the number of columns to print at the beginning (i.e., left) and end (right) of the display.

head, tail

alternatives to the rows argument; if TRUE, print the first or last 6 rows; can also be the number of the first or last few rows to print; only one of heads and tails should be specified; ignored if FALSE (the default).

elided

controls whether to report the number of elided elements, rows, or columns; default is TRUE.

classes

show the class of each column of a data frame at the top of the column; the classes are shown in single-character abbreviated form—e.g., [f] for a factor, [i] for an integer variable, [n] for a numeric variable, [c] for a character variable.

terms

a one-sided formula giving the terms to summarize; the default is ~ .—i.e., to summarize all terms in the model.

intercept

whether or not to include the intercept; the default is TRUE unless the terms argument is given, in which case the default is FALSE; ignored for polr models.

pvalues

include the p-value for each coefficient in the table; default is FALSE.

exponentiate

for a "glm" or "glmerMod" model using the log or logit link, or a "polr" or "multinom" model, show exponentiated coefficient estimates and confidence bounds.

digits

significant digits for printing.

horizontal

if TRUE (the default), orient the summary produced by brief horizontally, which typically saves space.

dispersion

see summary.glm

vcov.

either a matrix giving the estimated covariance matrix of the estimates, or a function that when called with object as an argument returns an estimated covariance matrix of the estimates. The default vcov. = vcov(object, complete=FALSE) uses the usual estimated covariance matrix with NA for any row and column with aliased regressors. Other choices include the functions documented at hccm, and a bootstrap estimate vcov.=vcov(Boot(object)); see the documentation for Boot. For the glm method, if the vcov. or dispersion argument is specified, then Wald-based confidence limits are computed; otherwise the reported confidence limits are computed by profiling the likelihood. NOTES: (1) The dispersion and vcov. arguments may not both be specified. (2) Setting vcov.=vcov returns an error if the model includes aliased terms; use vcov.=vcov(object, complete=FALSE). (3) The hccm method will generally return a matrix of full rank even if the model has aliased terms. Similarly vcov.=vcov(Boot(object)) may return a full rank matrix, or it will a matrix with NA corresponding to aliased regressors if same regressors are aliased in every bootstrap sample.

...

arguments to pass down.

Value

Invisibly returns object for a data object, or summary for a model object.

Note

The method brief.matrix calls brief.data.frame.

Author(s)

References

Fox, J. and Weisberg, S. (2019) An R Companion to Applied Regression, Third Edition, Sage.

See Also

Examples

brief(rnorm(100))
brief(Duncan)
brief(OBrienKaiser, elided=TRUE)
brief(matrix(1:500, 10, 50))
brief(lm)

mod.prestige <- lm(prestige ~ education + income + type, Prestige)
brief(mod.prestige, pvalues=TRUE)
brief(mod.prestige, ~ type)
mod.mroz <- glm(lfp ~ ., data=Mroz, family=binomial)
brief(mod.mroz)

car

Companion to Applied Regression

v3.0-10
GPL (>= 2)
Authors
John Fox [aut, cre], Sanford Weisberg [aut], Brad Price [aut], Daniel Adler [ctb], Douglas Bates [ctb], Gabriel Baud-Bovy [ctb], Ben Bolker [ctb], Steve Ellison [ctb], David Firth [ctb], Michael Friendly [ctb], Gregor Gorjanc [ctb], Spencer Graves [ctb], Richard Heiberger [ctb], Pavel Krivitsky [ctb], Rafael Laboissiere [ctb], Martin Maechler [ctb], Georges Monette [ctb], Duncan Murdoch [ctb], Henric Nilsson [ctb], Derek Ogle [ctb], Brian Ripley [ctb], William Venables [ctb], Steve Walker [ctb], David Winsemius [ctb], Achim Zeileis [ctb], R-Core [ctb]
Initial release
2020-09-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.