Learn R Programming

DescTools (version 0.99.7)

PlotDesc: Display descriptive plots

Description

Specific descriptive plots depending on the class of x.

Usage

PlotDesc(x, ..., wrd = NULL)

## S3 method for class 'default':
PlotDesc(x, ...)

## S3 method for class 'integer':
PlotDesc(x, main = deparse(substitute(x)),  
         ord = c("val_asc","val_desc","frq_asc","frq_desc"), 
         maxrows = 10, ... , wrd = NULL)
## S3 method for class 'numeric':
PlotDesc(x, main = deparse(substitute(x)), ..., 
         wrd = NULL)
## S3 method for class 'factor':
PlotDesc(x, main = deparse(substitute(x)), 
         ord = c("desc", "level", "name", "asc", "none"), 
         maxrows = 10, lablen = 25, type = c("bar","dot"), 
         col = hblue, ..., wrd = NULL)
## S3 method for class 'table':
PlotDesc(x, col0 = hred, col1=hblue, 
         horiz = TRUE,  main="", ..., wrd = NULL)
## S3 method for class 'ordered':
PlotDesc(x, ..., wrd = NULL)
## S3 method for class 'data.frame':
PlotDesc(x, ..., wrd = NULL)
## S3 method for class 'logical':
PlotDesc(x, xlab = "", col0 = hblue, col1 = hred, ..., 
         wrd = NULL)
## S3 method for class 'Date':
PlotDesc(x, breaks = "month", ..., wrd = NULL)

PlotDescNumFact(formula, data, main=deparse(formula), notch=FALSE,
                add_ni = TRUE, ..., wrd = NULL)
PlotDescNumNum(form1, form2, data, ..., wrd = NULL)

Arguments

x
the vector to be plotted.
main
the main title of the plot.
ord
the row order of a frequency table to be chosen. Is used for factors and integers.
maxrows
the maximum number of rows to be displayed for a factor.
lablen
the maximum numbe of characters for a factor level to be displayed, before the level is truncated and ... are added.
type
the type of plot to be used for describing factors. Can be "bar" for a horizontal barchart or "dot" for a dotchart.
col0, col1
two colors to be chosen for doing mosaicplots.
col
color of the points used in a dotchart, typically for integers. Defaults to lightblue.
xlab
the xlab for the logical plot.
breaks
vector of limits to bin a date.
horiz
logical, indicating if the two mosaicplots should be arranged horizontally (default is TRUE).
formula
a formula, such as y ~ grp, where y is a numeric vector of data values to be split into groups according to the grouping variable grp (usually a factor).
data
a data.frame (or list) from which the variables in formula should be taken.
notch
if notch is TRUE, a notch is drawn in each side of the boxes. If the notches of two plots do not overlap this is 'strong evidence' that the two medians differ.
add_ni
logical. Indicates if the group length should be displayed in the boxplot.
form1, form2
the formula used for calculating the smoother.
wrd
the pointer to a word instance. Can be a new one, created by GetNewWrd() or an existing one, created by GetCurrWrd(). Default is the last created pointer stored in getOption("lastWord").
...

Value

  • no value returned

Details

See the detailed description for informations about specific plots.

See Also

Desc

Examples

Run this code
PlotDesc(x=na.omit(d.pizza$delivery_min))    # numeric
PlotDesc(x=na.omit(d.pizza$week))                         # integer
PlotDesc(x=na.omit(d.pizza$driver))                       # factor
PlotDesc(x=na.omit(d.pizza$quality))                      # ordered factor
PlotDesc(x=na.omit(d.pizza$wrongpizza))      # logical
PlotDesc(x=na.omit(d.pizza$date))            # Date

d.frm <- d.pizza[,c("price","operator")]
d.frm <- d.frm[complete.cases(d.frm),]
PlotDescNumFact(temperature ~ driver, data=d.pizza)       # numeric ~ factor

PlotDesc(table(d.pizza$driver, d.pizza$operator))         # factor ~ factor

Run the code above in your browser using DataLab