Learn R Programming

lessR (version 2.1.1)

dots: Data Based Density Curves with Color and Histogram

Description

Plots a dots, also called a stip chart, and identifies outliers.

Usage

dots(x, dframe=mydata, 
         col.bg="ghostwhite", col.grid="grey85", 
         col.pts="midnightblue", pt.reg=21, pt.out=19, 
         col.out30="firebrick2", col.out15="firebrick4",
         xlab=NULL, main=NULL, text.out=TRUE, new=TRUE, ...)

Arguments

x
Variable for which to construct the histogram and density plots.
dframe
Data frame that contains the variable of interest, default is mydata.
col.bg
Color of the plot background.
col.grid
Color of the grid lines.
col.pts
Color of regular (non-outlier) points.
pt.reg
Type of regular (non-outlier) point. See help for points for more information. Default is 21, a circle with no fill.
pt.out
Type of point for outliers. Default is 19, a filled circle.
col.out30
Color of severe outliers.
col.out15
Color of potential outliers.
xlab
Label for x-axis.
main
Title of graph.
text.out
If TRUE, then display text output in console.
new
If TRUE, then add the dots to an existing graph.
...
Other parameters, such as from stripchart and par.

Details

Results are based on the standard stripchart function. Colors are provided by default and can also be specified.

The input data frame has the assumed name of mydata. If this data frame is named something different, then specify the name with the dframe option. Regardless of its name, the data frame need not be attached to reference the variable directly by its name without having to invoke the mydata$name notation. Any missing data values are removed and the effecive sample size and number of missing values reported.

A labels data frame named mylabels, obtained from the rad function, can list the label for some or all of the variables in the data frame that contains the data for the analysis. If this labels data frame exists, then the corresponding variable label is listed as the title of the resulting plot, unless a specific label is listed with the main option.

See Also

stripchart.

Examples

Run this code
# generate 100 random normal data values
y <- rnorm(100)

# default dots
dots(y)

# dots with diamonds as points
dots(y, pt.reg=23)

# dots with custom colors for outliers
dots(y, pt.reg=23, col.out15="blue", col.out30="red")


# dots with built-in data set
dots(breaks, dframe=warpbreaks)

Run the code above in your browser using DataLab