DescTools (version 0.99.8.1)

Desc: Describe Data

Description

Produce summaries of various types of variables. Calculate descriptive statistics for x and use Word as reporting tool for the numeric results and for descriptive plots. The appropriate statistics are chosen depending on the class of x. The general intention is to simplify the description process for lazy typers and return a quick, but rich summary.

Usage

Desc(x, ..., wrd = NULL)
## S3 method for class 'default':
Desc(x, \dots)

Arguments

x
the object to be described.
wrd
a pointer to a running Word instance. If this is NULL then output will be directed to console, else to Word.
...
the dots are passed to the specific function.

Value

  • partly results are returned

Details

Desc is a generic function. It dispatches to one of the methods above depending on the class of its first argument. Typing ?Desc + TAB at the prompt should present a choice of links: the help pages for each of these Desc methods (at least if you're using RStudio, which anyway is recommended). You don't need to use the full name of the method although you may if you wish; i.e., Desc(x) is idiomatic R but you can bypass method dispatch by going direct if you wish: Desc.numeric(x). More details about the results of the methods can be found in the type-specific help texts.

See Also

See the specific object methods: Desc.logical, Desc.factor, Desc.ordered, Desc.integer, Desc.numeric, Desc.Date, Desc.table, Desc.data.frame, Desc.list, Desc.formula, DescFactFact, DescNumFact, DescNumNum

Examples

Run this code
# implemented classes:
Desc(d.pizza$wrongpizza)     # logical
Desc(d.pizza$driver)         # factor
Desc(d.pizza$quality)        # ordered factor
Desc(d.pizza$week)           # integer
Desc(d.pizza$delivery_min)   # numeric
Desc(d.pizza$date)           # Date

Desc(d.pizza$wrongpizza, main="The wrong pizza delivered", digits=5)  

    
# just selected bivariate analysis on the console
Desc( price ~ operator, data=d.pizza)                  # numeric ~ factor
Desc( driver ~ operator, data=d.pizza)                 # factor ~ factor 
Desc( driver ~ area + operator, data=d.pizza)          # factor ~ several factors
Desc( driver + area ~ operator, data=d.pizza)          # several factors ~ factor
Desc( driver ~ week, data=d.pizza )                    # factor ~ integer will be changed 
                                                       #   into:   week (int) ~ driver (fact)

Desc( driver ~ operator, data=d.pizza, rfrq=("111"))   # alle rel. frequencies
# Desc( driver ~ operator, data=d.pizza
#  , rfrq=("000"), show.mutinf=TRUE)                   # no rel. frequencies, but mutual information

Desc( price ~ delivery_min, data=d.pizza )             # numeric ~ numeric
Desc( price + delivery_min ~ operator + driver + wrongpizza
  , data=d.pizza, digits=c(2,2,2,2,0,3,0,0) ) 

Desc( week ~ driver, data=d.pizza, digits=c(2,2,2,2,0,3,0,0) )   # define digits

Desc( delivery_min + weekday ~ driver, data=d.pizza ) 


# without defining data-parameter
Desc( d.pizza$delivery_min ~ d.pizza$driver)           


# with functions and interactions
Desc( sqrt(price) ~ operator : factor(wrongpizza), data=d.pizza) 
Desc( log(price+1) ~ cut(delivery_min, breaks=seq(10,90,10))  
  , data=d.pizza, digits=c(2,2,2,2,0,3,0,0)) 


# internal functions (not meant to be used by the enduser):
Desc.factor( d.pizza$driver, ord="n" )  # ordered by name
Desc.factor( d.pizza$driver, ord="l" )  # ordered by level
Desc.logical(d.pizza$wrongpizza)
Desc.integer( d.pizza$weekday)
Desc.integer( d.pizza$weekday, maxlevels=3 )
Desc.numeric( d.pizza$count, highlow=FALSE )
Desc.numeric( d.pizza$count, highlow=TRUE )
 
DescNumFact( x=d.pizza$delivery_min, grp=d.pizza$operator )
DescFactFact( x=d.pizza$driver, grp=d.pizza$operator)
DescNumNum( x=d.pizza$delivery_min, y=d.pizza$price )

Run the code above in your browser using DataCamp Workspace