summary is a generic function used to produce result summaries of the results of various model fitting functions. The function invokes particular methods which depend on the class of the first argument.

# S3 method for qm_cluster
summary(object, ...)

# S3 method for qntmap
summary(object, digits = 2L, ...)

Arguments

object

an object for which a summary is desired.

...

additional arguments affecting the summary produced.

digits

integer, used for number formatting with signif() (for summary.default) or format() (for summary.data.frame). In summary.default, if not specified (i.e., missing(.)), signif() will not be called anymore (since R >= 3.4.0, where the default has been changed to only round in the print and format methods).

Value

The form of the value returned by summary depends on the class of its argument. See the documentation of the particular methods for details of what is produced by that method.

The default method returns an object of class c("summaryDefault", "table") which has specialized format and print methods. The factor method returns an integer vector.

The matrix and data frame methods return a matrix of class "table", obtained by applying summary to each column and collating the results.

Details

For factors, the frequency of the first maxsum - 1 most frequent levels is shown, and the less frequent levels are summarized in "(Others)" (resulting in at most maxsum frequencies).

The functions summary.lm and summary.glm are examples of particular methods which summarize the results produced by lm and glm.

References

Chambers, J. M. and Hastie, T. J. (1992) Statistical Models in S. Wadsworth & Brooks/Cole.

See also

Examples

summary(attenu, digits = 4) #-> summary.data.frame(...), default precision
#> event mag station dist #> Min. : 1.00 Min. :5.000 117 : 5 Min. : 0.50 #> 1st Qu.: 9.00 1st Qu.:5.300 1028 : 4 1st Qu.: 11.32 #> Median :18.00 Median :6.100 113 : 4 Median : 23.40 #> Mean :14.74 Mean :6.084 112 : 3 Mean : 45.60 #> 3rd Qu.:20.00 3rd Qu.:6.600 135 : 3 3rd Qu.: 47.55 #> Max. :23.00 Max. :7.700 (Other):147 Max. :370.00 #> NA's : 16 #> accel #> Min. :0.00300 #> 1st Qu.:0.04425 #> Median :0.11300 #> Mean :0.15422 #> 3rd Qu.:0.21925 #> Max. :0.81000 #>
summary(attenu $ station, maxsum = 20) #-> summary.factor(...)
#> 117 1028 113 112 135 475 1030 1083 1093 1095 #> 5 4 4 3 3 3 2 2 2 2 #> 111 116 1219 1299 130 1308 1377 1383 (Other) NA's #> 2 2 2 2 2 2 2 2 120 16
lst <- unclass(attenu$station) > 20 # logical with NAs ## summary.default() for logicals -- different from *.factor: summary(lst)
#> Mode FALSE TRUE NA's #> logical 28 138 16
summary(as.factor(lst))
#> FALSE TRUE NA's #> 28 138 16