Description Usage Arguments Author(s) See Also Examples
a wrapper for the legend command to place the line sizes onto a transBub plot
1 |
Trans |
Transistion matrix full of count data |
x |
x coordinate of the plot |
y |
y coordinate of the plot |
nline |
number of lines to have in plot |
lims.l |
vector of length two representing the min and max counts |
linesize |
vector of length two representing min and max line sizes |
sqrt |
should the count data be square root transformed |
rounddig |
number of digits to round numbers to |
bg |
color of background |
Connor F. White
legend.bub, transbub
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (Trans, x = NULL, y = NULL, nline = 4, lims.l = NULL,
linesize = c(1, 5), sqrt = FALSE, rounddig = 2, bg = "White")
{
if (is.null(x) | is.null(y)) {
coords <- par("usr")
x <- coords[1]
y <- coords[4]
}
counts <- totcount(Trans)
bubCounts <- counts$TransCount
if (is.null(lims.l)) {
llab <- seq(min(bubCounts[bubCounts > 0]), max(bubCounts[bubCounts >
0]), length.out = nline)
}
else {
llab <- seq(lims.l[1], lims.l[2], length.out = nline)
}
lsize <- scal(llab, scal = linesize, lims = lims.l, sqrt = sqrt)
legend(x = x, y = y, legend = round(llab, digits = rounddig),
lty = c(1, 1, 1, 1), lwd = lsize, bg = bg)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.