numeric. Height of the dots (characters) at the base level. By default
y=0.1 thinking on a plot with ylim=c(0,1).
xlim
numeric vector with 2 entries: xmin and xmax. These values determine
the width of the displayed dot plot not necessarily equal to the limits of the plot.
stacked
logical. If TRUE characters are stacked,
otherwise a scatter plot of the data is displayed at y level using character pch.
hmax
numeric. The maximum height in user units. By default
hmax=0.5 thinking on a plot with ylim=c(0,1). See y.
base
logical. If TRUE a horizontal line is displayed at the bottom of the plot.
axes
logical. If TRUE an labelled axis is shown.
pch
numeric or character. Character number or character to be used for the display.
pch.size
numeric. Character to be used to distribute the "dots" (pch).
See Details.
labels
character vector. If NULL (default) each point (dot) is displayed using
character pch, otherwise vector labels is used for the display. See Details.
hcex
numeric. Expansion (shrink) factor for character height. See details.
cex
numeric. Expansion factor used for character display. See par.
cex.axis
numeric. Expansion factor used in case of labelling the axis.
Details
Function dots adds to the current plot a dot plot similar to a
stem-and-leaf plot using characters specified by pch and
labels=NULL. If labels is not NULL then it is
expected to be a character vector and will
will be used to display each of the points. Its use is repeated or cut short if necessary.
The function computes the width and height size using character pch.size calling
strwidth and strheight, but displays pch instead.
Mainly this is used when pch is not given by a quoted character,
for example, pch=21. Also, currently the par("mkh") is ignored so
hcex is used to compute the "working" height of the characters:
hcex*strheight(pch.size,units="user"). If stacked=TRUE,
the base line is divided in subintervals of size strwidth(pch.size)
and computed the number of points in each subinterval. If maximum number
of stacked characters exceed hmax then the characters are overlapped to
adjust their total height to hmax.
Value
Invisible data frame with columns (x,y,labels). ‘x’ and ‘y’ are the coordinates
in user units of each point and ‘labels’ the corresponding character displayed.
Author(s)
Ernesto Barrios
See Also
dotPlot, anovaPlot
Examples
library(BHH2)
set.seed(4)
# Defines the height of the plot area between c(0,1)
dotPlot(rnorm(100),xlab="x")
x <- rnorm(100)
# plots (possibly) overlapping points at y=0.3
dots(x,y=0.3)
# plots (possibly) overlapping points at y=0.4
dots(x,y=0.4,stacked=TRUE,base=FALSE)
# plots (hopefully) stacked points at y=0.5 allowing the dots to as high as 0.9
dots(x,y=0.5,stacked=TRUE,base=FALSE,hmax=.9)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BHH2)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/BHH2/dots.Rd_%03d_medium.png", width=480, height=480)
> ### Name: dots
> ### Title: Dots display
> ### Aliases: dots
> ### Keywords: aplot hplot
>
> ### ** Examples
>
> library(BHH2)
> set.seed(4)
> # Defines the height of the plot area between c(0,1)
> dotPlot(rnorm(100),xlab="x")
>
> x <- rnorm(100)
>
> # plots (possibly) overlapping points at y=0.3
> dots(x,y=0.3)
> # plots (possibly) overlapping points at y=0.4
> dots(x,y=0.4,stacked=TRUE,base=FALSE)
> # plots (hopefully) stacked points at y=0.5 allowing the dots to as high as 0.9
> dots(x,y=0.5,stacked=TRUE,base=FALSE,hmax=.9)
>
>
>
>
>
> dev.off()
null device
1
>