Читать книгу The Big R-Book - Philippe J. S. De Brouwer - Страница 294
8.5. Creating an Overview of Data Characteristics
ОглавлениеIn the Chapter 4 “The Basics of R” on page 21, we presented some of the basic functions of R that – of course – include the some of the most important functions to describe data (such as mean and standard deviation).
Mileage may vary, but in many research people want to document what they have done and will need to include some summary statistics in their paper or model documentation. The standard summary
of the relevant object might be sufficient.
N <- 100 t <- data.frame(id = 1:N, result = rnorm(N)) summary(t) ## id result ## Min. : 1.00 Min. :-1.8278 ## 1st Qu.: 25.75 1st Qu.:-0.5888 ## Median : 50.50 Median :-0.0487 ## Mean : 50.50 Mean :-0.0252 ## 3rd Qu.: 75.25 3rd Qu.: 0.4902 ## Max. :100.00 Max. : 2.3215
This already produces a neat summary that can directly be used in most reports.2