describe takes vectors and data.frames and returns a data.frame containing important descriptive statistics.

describe(.x)

# S3 method for numeric
describe(.x)

# S3 method for character
describe(.x)

# S3 method for data.frame
describe(.x)

# S3 method for default
describe(.x)

Arguments

.x

a vector or data.frame to be described.

Value

a data.frame containing important descriptive statistics.

Methods (by class)

  • numeric: Method for numeric.

  • character: Method for character.

  • data.frame: Method for data.frames.

  • default: Method for default.

Examples

# Example describe(mtcars)
#> .column_name .count_elements .mean_value .sd_value .q0_value .q25_value #> 1 mpg 32 20.090625 6.0269481 10.400 15.42500 #> 2 cyl 32 6.187500 1.7859216 4.000 4.00000 #> 3 disp 32 230.721875 123.9386938 71.100 120.82500 #> 4 hp 32 146.687500 68.5628685 52.000 96.50000 #> 5 drat 32 3.596563 0.5346787 2.760 3.08000 #> 6 wt 32 3.217250 0.9784574 1.513 2.58125 #> 7 qsec 32 17.848750 1.7869432 14.500 16.89250 #> 8 vs 32 0.437500 0.5040161 0.000 0.00000 #> 9 am 32 0.406250 0.4989909 0.000 0.00000 #> 10 gear 32 3.687500 0.7378041 3.000 3.00000 #> 11 carb 32 2.812500 1.6152000 1.000 2.00000 #> .q50_value .q75_value .q100_value #> 1 19.200 22.80 33.900 #> 2 6.000 8.00 8.000 #> 3 196.300 326.00 472.000 #> 4 123.000 180.00 335.000 #> 5 3.695 3.92 4.930 #> 6 3.325 3.61 5.424 #> 7 17.710 18.90 22.900 #> 8 0.000 1.00 1.000 #> 9 0.000 1.00 1.000 #> 10 4.000 4.00 5.000 #> 11 2.000 4.00 8.000
describe(iris)
#> .column_name .count_elements .mean_value .sd_value .q0_value .q25_value #> 1 Sepal.Length 150 5.843333 0.8280661 4.3 5.1 #> 2 Sepal.Width 150 3.057333 0.4358663 2 2.8 #> 3 Petal.Length 150 3.758000 1.7652982 1 1.6 #> 4 Petal.Width 150 1.199333 0.7622377 0.1 0.3 #> 5 Species 150 NA NA setosa NA #> .q50_value .q75_value .q100_value #> 1 5.80 6.4 7.9 #> 2 3.00 3.3 4.4 #> 3 4.35 5.1 6.9 #> 4 1.30 1.8 2.5 #> 5 NA NA virginica
describe(state.name)
#> .count_elements .mean_value .sd_value .q0_value .q25_value .q50_value #> 1 50 NA NA Alabama NA NA #> .q75_value .q100_value #> 1 NA Wyoming