diff --git a/.Rbuildignore b/.Rbuildignore deleted file mode 100644 index 0095337..0000000 --- a/.Rbuildignore +++ /dev/null @@ -1,9 +0,0 @@ -^.*\.Rproj$ -^\.Rproj\.user$ -^cran-comments\.md$ -^CRAN-SUBMISSION$ -^_pkgdown\.yml$ -^docs$ -^pkgdown$ -^README\.Rmd$ -^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore deleted file mode 100644 index 2d19fc7..0000000 --- a/.github/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml deleted file mode 100644 index a3ac618..0000000 --- a/.github/workflows/R-CMD-check.yaml +++ /dev/null @@ -1,49 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - -name: R-CMD-check - -jobs: - R-CMD-check: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: - - {os: macos-latest, r: 'release'} - - {os: windows-latest, r: 'release'} - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} - - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_KEEP_PKG_SOURCE: yes - - steps: - - uses: actions/checkout@v3 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - r-version: ${{ matrix.config.r }} - http-user-agent: ${{ matrix.config.http-user-agent }} - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::rcmdcheck - needs: check - - - uses: r-lib/actions/check-r-package@v2 - with: - upload-snapshots: true diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml deleted file mode 100644 index ed7650c..0000000 --- a/.github/workflows/pkgdown.yaml +++ /dev/null @@ -1,48 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - release: - types: [published] - workflow_dispatch: - -name: pkgdown - -jobs: - pkgdown: - runs-on: ubuntu-latest - # Only restrict concurrency for non-PR jobs - concurrency: - group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - permissions: - contents: write - steps: - - uses: actions/checkout@v3 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::pkgdown, local::. - needs: website - - - name: Build site - run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) - shell: Rscript {0} - - - name: Deploy to GitHub pages 🚀 - if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.4.1 - with: - clean: false - branch: gh-pages - folder: docs diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 434c868..0000000 --- a/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.Rproj.user -.Rhistory -.Rdata -.httr-oauth -.DS_Store -.quarto -docs -CRAN-SUBMISSION diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.nojekyll @@ -0,0 +1 @@ + diff --git a/404.html b/404.html new file mode 100644 index 0000000..5f87827 --- /dev/null +++ b/404.html @@ -0,0 +1,74 @@ + + + + + + + +Page not found (404) • plotrix + + + + + + + + Skip to contents + + +
+
+
+ +Content not found. Please use links in the navbar. + +
+
+ + + +
+ + + + + + + diff --git a/404.md b/404.md new file mode 100644 index 0000000..5107f89 --- /dev/null +++ b/404.md @@ -0,0 +1,3 @@ +Content not found. Please use links in the navbar. + +# Page not found (404) diff --git a/DESCRIPTION b/DESCRIPTION deleted file mode 100755 index cf3518d..0000000 --- a/DESCRIPTION +++ /dev/null @@ -1,46 +0,0 @@ -Package: plotrix -Version: 3.8-14 -Title: Various Plotting Functions -Authors@R: c( - person("Jim", "Lemon", role = "aut"), - person("Ben", "Bolker", role = "ctb"), - person("Sander", "Oom", role = "ctb"), - person("Eduardo", "Klein", role = "ctb"), - person("Barry", "Rowlingson", role = "ctb"), - person("Hadley", "Wickham", role = "ctb"), - person("Anupam", "Tyagi", role = "ctb"), - person("Olivier", "Eterradossi", role = "ctb"), - person("Gabor", "Grothendieck", role = "ctb"), - person("Michael", "Toews", role = "ctb"), - person("John", "Kane", role = "ctb"), - person("Rolf", "Turner", role = "ctb"), - person("Carl", "Witthoft", role = "ctb"), - person("Julian", "Stander", role = "ctb"), - person("Thomas", "Petzoldt", role = "ctb"), - person("Remko", "Duursma", role = "ctb"), - person("Elisa", "Biancotto", role = "ctb"), - person("Ofir", "Levy", role = "ctb"), - person("Christophe", "Dutang", role = "ctb"), - person("Peter", "Solymos", role = "ctb"), - person("Robby", "Engelmann", role = "ctb"), - person("Michael", "Hecker", role = "ctb"), - person("Felix", "Steinbeck", role = "ctb"), - person("Hans", "Borchers", role = "ctb"), - person("Henrik", "Singmann", role = "ctb"), - person("Ted", "Toal", role = "ctb"), - person("Derek", "Ogle", role = "ctb"), - person("Darshan", "Baral", role = "ctb"), - person("Ulrike", "Groemping", role = "ctb"), - person("Bill", "Venables", role = "ctb"), - person(family = "The CRAN Team", role = "ctb"), - person("Duncan", "Murdoch", email = "murdoch.duncan@gmail.com", - role = c("ctb", "cre"))) -Imports: grDevices, graphics, stats, utils -Description: Lots of plots, various labeling, axis and color scaling functions. The author/maintainer died in September 2023. -License: GPL (>= 2) -NeedsCompilation: no -Depends: R (>= 3.5.0) -Repository: CRAN -Date/Publication: 2023-11-02 15:17:47 UTC -URL: https://plotrix.github.io/plotrix/, https://github.com/plotrix/plotrix -BugReports: https://github.com/plotrix/plotrix/issues diff --git a/NAMESPACE b/NAMESPACE deleted file mode 100755 index 33c4e4c..0000000 --- a/NAMESPACE +++ /dev/null @@ -1,184 +0,0 @@ -# created 5/9/2011 - Jim Lemon - importFrom("grDevices", "boxplot.stats", "col2rgb", "colors", - "dev.cur", "dev.list", "dev.size", "gray", "heat.colors", - "palette", "rainbow", "rgb", "trans3d", "xy.coords") - importFrom("graphics", "abline", "arrows", "axTicks", "axis", - "axis.POSIXct", "barplot", "barplot.default", "box", - "boxplot", "clip", "hist", "hist.default", "layout", - "legend", "lines", "locator", "matplot", "mtext", "par", - "persp", "plot", "plot.new", "plot.window", "points", - "polygon", "rect", "segments", "strheight", - "strwidth", "symbols", "text", "title", "xinch", "yinch") - importFrom("stats", "aggregate", "approx", "as.formula", - "complete.cases", "cor", "density", "dist", "model.frame", - "na.omit", "bw.nrd0", "qnorm", "rnorm", "sd", "t.test", "terms") - importFrom("utils", "combn", "modifyList") -export( - ablineclip, - addtable2plot, - add.ps, - arctext, - axis.break, - axis.mult, - barlabels, - barNest, - barp, - battleship.plot, - bin.wind.records, - binciW, - binciWl, - binciWu, - box.heresy, - boxed.labels, - brkdn.plot, - brkdnNest, - bumpchart, - categoryReshape, - centipede.plot, - clean.args, - clock24.plot, - clplot, - cluster.overplot, - clustered.dotplots, - color.axis, - color.gradient, - color.id, - color.legend, - color.scale, - color.scale.lines, - color2D.matplot, - corner.label, - count.overplot, - cylindrect, - dendroPlot, - densityGrid, - diamondplot, - dispersion, - dotplot.mtb, - draw.arc, - draw.circle, - draw.ellipse, - draw.radial.line, - draw.tilted.sector, - drawNestedBars, - drawSectorAnnulus, - ehplot, - election, - emptyspace, - fan.plot, - feather.plot, - fill.corner, - find_max_cell, - floating.pie, - fullaxis, - gantt.chart, - gap_barp, - gap.barplot, - gap.boxplot, - gap.plot, - get.breaks, - get.gantt.info, - get.segs, - get.soil.texture, - get.tablepos, - get.triprop, - getFigCtr, - getIntersectList, - getMarginWidth, - getYmult, - gradient.rect, - hexagon, - histStack, - intersectDiagram, - jiggle, - joyPlot, - kiteChart, - labbePlot, - ladderplot, - ladderplot.default, - legendg, - lengthKey, - makeDensityMatrix, - makeIntersectList, - maxEmptyRect, - mtext3d, - multhist, - multivari, - multsymbolbox, - oz.windrose, - oz.windrose.legend, - p2p_arrows, - panes, - pasteCols, - paxis3d, - perspx, - pie.labels, - pie3D, - pie3D.labels, - placeLabels, - plot_bg, - plotCI, - plotH, - polar.plot, - polygon.shadow, - propbrk, - psegments3d, - ptext3d, - pyramid.plot, - radial.grid, - radial.pie, - radial.plot, - radial.plot.labels, - radialtext, - raw.means.plot, - raw.means.plot2, - rectFill, - remove.args, - rescale, - revaxis, - ruginv, - seats, - size_n_color, - sizeplot, - sizetree, - sliceArray, - smoothColors, - soil.texture, - soil.texture.uk, - spread.labels, - spreadout, - stackpoly, - staircase.plot, - staircasePlot, - starPie, - staxlab, - std.error, - sumbrk, - symbolbarplot, - symbolbox, - tab.title, - taylor.diagram, - textbox, - thigmophobe, - thigmophobe.labels, - triax.abline, - triax.fill, - triax.frame, - triax.plot, - triax.points, - tsxpos, - twoord.plot, - twoord.stackplot, - valid.n, - vectorField, - violin_plot, - weighted.hist, - zoomInPlot -) -# methods -S3method(print,brklist) -S3method(histStack,default) -S3method(histStack,formula) -S3method(plotH,formula) -S3method(plotH,default) -S3method(ladderplot,default) diff --git a/NEWS b/NEWS deleted file mode 100755 index ce10d22..0000000 --- a/NEWS +++ /dev/null @@ -1,593 +0,0 @@ -Changes in version 3.8.14 (2026-02-13) - - - Fixed mis-handling of `labels = ""` in `polar.plot()` (issue #19). - -Changes in version 3.8-13 (2025-11-14) - - - Fixed warnings in `gap.plot()` when there were 2 gaps. - - - Fixed `pie3D()` which skipped very small slices (issue #9). - - Fixed `polar.plot()` which put labels in the wrong place (PR #8). - - - Fixed `plotCI()` to allow `pch` to be a vector (PR #11). - - - Added arguments to `gap.plot()` to support non-standard - box types (PR #17). - -Changes in version 3.8-6 (2023-11-13) - - - Added pkgdown site at https://plotrix.github.io/plotrix/ - - - Changed `Authors` to more descriptive `Authors@R`. - -Changes in version 3.8-4 (2023-11-09) - - - Duncan Murdoch has taken over as maintainer. - - - Source has been moved to Github. - - - A bug in the labels in `pyramid.plot()` reported by `biohisham` - has been fixed. - -Changes in version 3.8-3 (2023-11-02) - - - Prepared by the CRAN team: the package has been orphaned. - - - Dr Jim Lemon passed away in September 2023. - - - man/plotrix-package contained old version information - duplicating the DESCRIPTION, so this has been commented out. - - - panes.Rd attempted to plot symbols not available to the pdf() - device used for R CMD check, which should have been in \donttest{}. - - - This file was not in a documented format for a NEWS file. - - - barlabels.Rd, draw.radial.line.Rd, textbox.Rd, thigmophobe.labels.Rd - had 'samp' or 'link' where '\samp' or '\link' was meant, or - '\samp' was missing before braces. - - - soil.texture.Rd contained defunct URLs. - - - Markup in CITATION has been modernized. - -Changes in version 3.8-2 - - - fixed showcount option in sizetree - - log10 plotting added to radial.plot family (thanks to Keziah Conroy) - - added X and Y axis labels in gap.boxplot - -Changes in version 3.8-1 - - - dropped makeDendrite, plotDendrite and sumDendrite functions - -Changes in version 3.7-8 - - - Either axis in barp can now be omitted using the stax* arguments - - HH:MM to decimal hour conversion with hm2dec argument in clock24.plot - - Improved the placement of top.labels in pyramid.plot - - Fixed color problem in floating.pie when zero or NA present - (thanks to Christoffer Flensburg) - - Fixed label problem in radial.plot.labels - (thanks to Fabio Parracho Silva) - - Added gap_barp function that will eventually replace gap.barplot - (thanks to Pamela Rueda-Cediel) - -Changes in version 3.7-7 - - - twoord.plot now calls axis.POSIXct for the x-axis if appropriate - fixed problem with conditional statements using "class" - -Changes in version 3.7-6 - - - fixed color.axis when "at" values are outside the plot limits - -Changes in version 3.7-5 - - - fixed the "empty list" bug in listDepth (thanks to Tingting Zhan) - - new and elegant thigmophobe function (thanks to Bill Venables) - - adjusted text size and placement in taylor.diagram for pos.cor=FALSE - - added makeDensityMatrix and densityGrid functions - - fixed functions that called 'barplot' (thanks to Martin Maechler) - -Changes in version 3.7-4 - - - fixed the dimension loss in color.scale when xrange specified - -Changes in version 3.7-3 - - - enhancement for gradient.rect function (thanks to Rod Lamming) - - fix for gantt.chart function (thanks to Andrius Getzinis) - - improvement to thigmophobe (thanks to Duncan Murdoch) - - fixed specified legend position in the barp function - -Changes in version 3.7-2 - - - align plotrix-package.Rd with DESCRIPTION file - - added user-specified labels to bumpchart - -Changes in version 3.7-1 - - - fix for the multivari function (thanks to Ulrike Groemping) - - added the plotH function (thanks to Derek Ogle) - -Changes in version 3.7 - - - fixed brkdnNest due to changes arriving in R-3.4.3 - - added the joyPlot function - - multivari plot function added (thanks to Ulrike Groemping) - -Changes in version 3.6-6 - - - added fill arguments to draw.circle (thanks to David Winsemius) - - color2D.matplot now adds trailing zeros to values (thanks to Yuan Zhou) - - a few ehancements to gantt.chart (thanks to Suman Khanal) - - fixed the problem of asking for "l" type in polar.plot (thanks to Alex Pal) - - improved version of violin_plot (thanks to Darshan Baral) - -Changes in version 3.6-5 - - - added the clustered.dotplots and violin_plot functions - - fixed the extra call to plot in soil.texture (thanks to Dylan Beaudette) - - added an option to radial.grid to allow it to display a blank grid - - fixed a mysterious problem with equating one argument to another - in the box.heresy function - -Changes in version 3.6-4 - - - fixed a typo in twoord.plot that caused an error when the range - of the right axis went negative - - added the jiggle function - - changed the show.nulls argument in intersectDiagram to the nulls label - - fixed the "fill" problem in textbox (thanks to Kohleth Chia) - - added the placeLabels function - - enhancement to raw.means.plot (thanks to Henrik Singmann) - - added the binciW function, which fixes an error (thanks to Marc Girondot) - - fixed the bug with displaying dispersion in barNest - -Changes in version 3.6-3 - - - fixed the errant y label in radial.pie - - fixed the problem with degrees/radians in draw.ellipse (thanks to Wouter vander Bijl) - -Changes in version 3.6-2 - - - fixed the call to clip in rectFill (thanks to Cheng Zhou) - - fixed the incorrect placing of some text in arctext (thanks to Mark Heckmann) - - fixed the misbehaving y axis in brkdn.plot - - improved the circumferential labels in clock24.plot - -Changes in version 3.6-1 - - - updated ehplot function (thanks to Robby Englemann) - - pyramid.plot now displays trailing zeros (thanks to Simon Thornley) - - problem with time/date x values in vectorField fixed - - colors and staggering added to plot.dendrite (thanks to Marna Wagley) - -Changes in version 3.6 - - - fixed the missing left axis ticks in pyramid.plot (thanks to Jacob Clark) - - corrected addtable2plot for log y plots (thanks to Andrew Metcalfe) - - made the axis label and axis tick expansions the same in twoord.plot (thanks to wxj) - - made the axis label and tick labels the same color as the axis in twoord.plot - - added stack labels to the sizetree function - - added imports now necessary for R CMD check - -Changes in version 3.5-12 - - - added choice of time axis (1 or 3) to gantt.chart (thanks to Mathias Collins) - - added outlined error bars to the dispersion function (thanks to Michael Eisenring) - - added a check for no variation in values to color.scale and color2D.matplot (thanks to Diego Calzolari) - -Changes in version 3.5-11 - - - changed my email address - -Changes in version 3.5-10 - - - added calculation method for SD in taylor.diagram (thanks to Melanie Moeller) - - added the assembly seat distribution functions "seats" and "election" - (thanks to Barry Rowlingson and Duncan Murdoch) - - fixed the rectangle border problem in legendg (thanks to Christian Graul) - -Changes in version 3.5-9 - - - added tangential labels to radial.plot - -Changes in version 3.5-8 - - - fixed the line length bug in feather.plot (thanks to Dr. Kazama) - -Changes in version 3.5-6 - - - added optional radial lines to the radial.grid function (thanks to Darren Obbard) - -Changes in version 3.5-5 - - - fixed the radial label bug in the radial.* functions (thanks to Mayeul Kauffmann) - - changed the circumferential label suppress value in the radial.* functions to NULL - - added the color.axis function - - added log correction for boxed.labels (thanks to Flemming Skjøth) - - fixed the breaks bug in histStack.default (thanks to Derek Ogle) - - added scaled bar widths to barNest - -Changes in version 3.5-3 - - - fixed the problems with data frames and margins in battleship.plot (thanks to David Carlson) - - set xpd=TRUE for the boxed.labels function (thanks to Francois Rousseu) - - changed the pie.labels function to call text and adjust in x and y - - added plain text labelling to pie.labels - - tested for a current device in cluster.overplot and count.overplot (thanks to Markus Elze) - -Changes in version 3.5-2 - - - added the get.tablepos function (thanks to Peter Murakami) - - passed the ... argument(s) to points and dispersion in brkdn.plot (thanks to Peter Mandeville) - - added text adjustment for the circumferential labels to radial.plot - - added the fill.corner function to do waffle plots (thanks to Zhao Jin) - -Changes in version 3.5-1 - - - added the tsxpos function (thanks to Prof J C Nash) - - added a warning for off-axis labels to staxlab (thanks again to Prof Nash) - - added the arrows argument to bumpchart (thanks to Jie) - - added the axes argument to gap.boxplot (thanks to Shane Carey) - -Changes in version 3.4-8 - - - fixed a minor bug in the ylim argument of gap.plot - - twoord.plot had some bugs cleaned up and now has a do.first argument - - fixed the missing background colors in addtable2plot - - allowed floating.pie to ignore zero and NA values (thanks to Jose deSantos) - - added the "stax" argument to gap.plot (thanks to Zheng Lu) - - fixed the problem with "yaxlab" in gap.barplot (thanks to Giorgio Galetti) - - added the "histStack" and "plotH" functions (thanks to Derek Ogle) - -Changes in version 3.4-7 - - - added automatic spreading out to pie.labels - - fixed the "priorities extremes" bug in gantt.chart (thanks to Michael Motta) - - pyramid.plot now accepts NA values (thanks to Susumu Tanimura) - - radial.plot now does a rank clock plot (thanks to Don Dennerline) - -Changes in version 3.4-6 - - - fixed the kite line positioning in kiteChart (thanks to Justin Dellinger) - -Changes in version 3.4-5 - - - fixed the upside down character bug in arctext - - fixed the typo in the demo function for kite chart - -Changes in version 3.4-4 - - - added the radial.grid function to the NAMESPACE - -Changes in version 3.4-3 - - - minor bug that counted NAs in the propbrk function fixed - -Changes in version 3.4-2 - - - Character spacing and placement improved in draw.arc and arctext (thanks to Ted Toal) - - radialtext and draw.radial.line functions added (also thanks to Ted Toal) - - weighted.hist now allows a custom X axis to be displayed (thanks to Ben Graf) - - Added the barlabels function - -Changes in version 3.4-1 - - - Fixed the alignment problem in pie3D and rationalized angle increments - - Added the raw.means.plot functions contributed by Henrik Singmann - - vastly improved the speed of the sizetree function - - added the "varpos" argument to the kiteChart function - thanks to Nikolaus Lampardariou) - -Changes in version 3.4 - - - added the border argument to the sizetree function - - multhist now returns all values from hist - thanks to John Muccigrosso - - fixed a bug in addtable2plot that appeared on plots with a log x axis - - fixed an almost invisible bug in drawSectorAnnulus - thanks to Denes - - added the "mar" argument to pie3D - thanks to Qinghua Zhao - -Changes in version 3.3-9 - - - Fixed the bug in centipede.plot that I introduced in v3.3-8 - -Changes in version 3.3-8 - - - added the horizontal grid argument to centipede plot (thanks to Colin Wahl) - -Changes in version 3.3-7 - - - Fixed a color bug in plotCI (thanks to Daniel Wollschlaeger) - -Changes in version 3.3-6 - - - Added the battleship plot (or Ford curve) thanks to Adam Maltese - - Added the box.heresy function - thanks to Gianni Lavaredo - -Changes in version 3.3-4 - - - Added the display.na argument to the dispersion function (thanks to Lasse Jacobsen) - - Removed the "Overall" bar in barNest when counts are being displayed - -Changes in version 3.3-3 - - - Fixed a bug in the Hinton diagram option (thanks to Xavier Fernández i Marín) - -Changes in version 3.3-2 - - - color2D.matplot will now display a Hinton diagram - - added padding for negative values in twoord.plot (thanks to Hans Borcher) - - added the maxEmptyRect function (thanks again to Hans Borchers) - -Changes in version 3.3-1 - - - expanded the color options and added top labels in sizetree - - returned the frequency calculation in weighted.hist to what it used to be - -Changes in version 3.3 - - - fixed the vertical lines color in addtable2plot - - fixed the frequency calculation in weighted.hist (thanks to Jarad Niemi) - - added the size_n_color plot - -Changes in version 3.2-8 - - - added partitioning of intersections to intersectDiagram - -Changes in version 3.2-7 - - - bug fix for the examples in ladderplot - -Changes in version 3.2-6 - - - added the ruginv function after fixing some encoding problems - -Changes in version 3.2-5 - - - fixed a color assignment problem in plotCI - - added automatic color assignment in sizetree where all levels use the same colors - -Changes in version 3.2-4 - - - Fixed the missing "shade" argument in pie3D (thanks to Jesse Brown) - - Added specifiable priority legend label and extreme descriptors - (thanks to Pedro Reis) - - Added the (experimental) radial.pie function - -Changes in version 3.2-3 - - - Fixed a few warnings from CRAN check (dotplot.mtb, gap.boxplot, symbolbarplot) - - Added the ruginv function (thanks to Peter Solymos) - -Changes in version 3.2-2 - - - Added the labbePlot function (thanks to Whitney Melroy) - - Fixed the showall argument problem in the barNest function - - Fixed the problem with data frame input in the intersectDiagram function - -Changes in version 3.2-1 - - - Added the sumbrk function to brkdnNest (thanks to Kevin Burnham) - - The dispbars function (just a call to dispersion) is now gone - - Added user specified text colors to boxed.labels (thanks to Thorn Thaler) - - Added the ehplot function (thanks to Robby, Michael & Felix) - -Changes in version 3.2 - - - Rewrote intersectDiagram to use equidistant spacing - - Fixed a warning in oz.windrose.legend - - Fixed default ordinate scaling in twoord.plot - - Major rewrite of brkdnNest, barNest and drawNestedBars functions - - Major rewrite of color.scale function - - Added sliceArray function for barNest due to the above rewrite - -Changes in version 3.1-2 - - - Fixed a minor bug in intersectDiagram - -Changes in version 3.1-1 - - - Border colors added to gantt.chart (thanks to Brandon Fessler) - - Extensive rewrite of the intersectDiagram function and helpers - - Rewrite of the dendroPlot function - - categoryReshape function added - -Changes in version 3.1 - - - intersectDiagram zero instance levels fixed - - intersectDiagram now invisibly returns the list of intersections - - Spacing within levels in intersectDiagram simplified - - makeIntersectList now discards empty levels of intersection - - makeIntersectList color assignment fixed - - dendroPlot function added - -Changes in version 3.0-9 - - - Fixed the priority coloring problem in gantt.chart - - Added optional vertical lines to addtable2plot (thanks to Bill Sperry) - - Fixed the overshooting y axis for certain values of y in barp - -Changes in version 3.0-8 - - - Added semi-intelligent cell labelling to the color2D.matplot function - -Changes in version 3.0-7 - - - Fixed the right ordinate alignment in twoord.plot - -Changes in version 3.0-6 - - - Added the "barlabels" argument to drawNestedBars - - big fix for the makeDendrite, furc and plot.dendrite functions - -Changes in version 3.0-5 - - - added Christophe Dutang's fix for the twoord.stackpoly function - - fixed the confidence limit problem in barNest (I sincerely hope) - -Changes in version 3.0-4 - - - added semi-intelligent bar labelling to the sizetree function - - added yaxs="i" to the empty plot in twoord.plot (thanks to Giles Crane) - - added the Wilson binomial CI functions for brkdnNest - -Changes in version 3.0-3 - - - added the ladderplot function (thanks to Peter Solymos) - -Changes in version 3.0-2 - - - rewrote intersectDiagram to better display missing intersections - - added a correction for character expansion to boxed.labels - - fixed the count method for barNest - -Changes in version 3.0-1 - - - competely rewrote the barNest family of functions - - removed labels for empty sets in intersectDiagram - -Changes in version 3.0 - - - fixed some minor problems with oz.windrose (thanks to Brad Evans) - - added a 'locator' option to zoomInPlot (thanks to Greg Snow) - - added the 'padj' argument to stackpoly for more tick label control - - made the 'srt' argument work for both x and y axes in staxlab - - fixed two little bugs in thigmophobe (thanks to Stephen Milborrow) - - added the 'add' argument to radial.plot (thanks to Evan Daugharthy) - -Changes in version 2.9-5 - - - added the kiteChart function - - added the "pos" argument to the getFigCtr function - -Changes in version 2.9-4 - - - added a calculated default vector of axis tick positions to twoord.plot - - added a "mar" argument to the taylor.diagram function - -Changes in version 2.9-3 - - - added the gamma.col argument to taylor.diagram (thanks to Julian Arnold) - - added the radial.labels function (thanks to Tali Vardi) - - added the multiple colors per labels to gantt.chart (thanks to Nicolas Immelman) - - added the rectFill function - - added an option to the barp function to use rectFill - -Changes in version 2.9-2 - - - fixed the margin problem in staircase.plot - - fixed the default y-axis tick placement in barp - -Changes in version 2.9-1 - - - fixed the "big gap" problem in the gap.plot function - - added the twoord.stackplot function (thanks to Christophe Dutang) - -Changes in version 2.9 - - - added the panes function - - fixed the border bug in color2D.matplot - - fixed the indexing bug in drawNestedBars - -Changes in version 2.8-4 - - - added the triax.fill function which necessitated... - - changed the initial plot call from triax.frame to triax.plot - - removed the "main" argument from triax.frame - - added brkdnNest to replace hierobrk - - rewrote barNest to suit brkdnNest - - added drawNestedBars for the display of barNest - - changed all remaining hierobarp functions to barNest - -Changes in version 2.8-3 - - - radical rewrite of the pyramid.plot function - - fixed up barp example mistake - - fixed the title position in zoomInPlot - - rewrote the hierobarp function as barNest - -Changes in version 2.8-2 - - - added the label.cex argument to the gantt.chart function - - changed the name of the hierobarp function to barNest - -Changes in version 2.8-1 - - - added the calculation of proportions to hierobarp - -Changes in version 2.8 - - - added the cex argument to the staircase.plot function - - added a bit to the plotCI function examples - - changed \code tags to \samp and removed formatting from \link tags - - added the ylog argument to the barp function (thanks to Fatima Kreusch) - - added the legendg function (thanks to Primoz Peterlin) - - removed the Piper diagram functions until they run correctly - -Changes in version 2.7-2 - - - added the axislab.cex argument to the twoord.plot function - -Changes in version 2.7-1 - - - added the getMarginWidth function - - added the bracketing lines and labels to hierobarp - - added the hierobarp.svymean and hierobarp.svyprop functions - - added the lwd argument to stackpoly (thanks to Vaclav Varvarovsky) - - included an example to show how to use gantt.chart without dates - - included an example of histogram + density curve in twoord.plot - -Changes in version 2.7 - - - added the getFigCtr function - - removed the final grouping lines from hierobarp - -Changes in version 2.6-4 - - - fixed the bug in hierobrk and hierobarp that got the order of - breakdown factors wrong - -Changes in version 2.6-3 - - - fixed the bug in gap.plot that lost the high values - -Changes in version 2.6-2 - - - complete rewrite of the hierobarp and hierobrk functions - - rewrite of barhier function and name changed to sizetree - -Changes in version 2.6-1 - - - Minor bug fix in the gap.plot function. - -ChangesiIn Version 2.6 - - - Improved bar/line plotting in the twoord.plot function. - - Added the fullaxis function. - -Changes in version 2.5-5 - - - Changed the default symbol in count.overplot to "1". - - Added bar plotting to the twoord.plot function. - - Added fill between the confidence lines to the dispersion function. - - Added the bumpchart function. - (Thanks to Andreas Christofferson for the idea) - - Added the spreadout function to spread out cramped labels. - - Added table cell size correction for the cex argument. - (Thanks to Brian Diggs for the patch) - -Changes in version 2.5-4 - - - Fixed the bug in dotplot.mtb function. - -Changes in version 2.5-3 - - - Introduced the hierobarp function. - - Introduced the zoomInPlot function. - - New version of dotplot.mtb (with bug) - -Changes in version 2.5-2 - - - and earlier. You don't expect me to remember all that, do you? diff --git a/R/ablineclip.R b/R/ablineclip.R deleted file mode 100644 index 029c790..0000000 --- a/R/ablineclip.R +++ /dev/null @@ -1,17 +0,0 @@ -ablineclip<-function(a=NULL,b=NULL,h=NULL,v=NULL,reg=NULL, - coef=NULL,untf=FALSE,x1=NULL,x2=NULL,y1=NULL,y2=NULL,...) { - - if(!is.null(c(x1,x2,y1,y2))) { - oldclip<-par("usr") - # if any clipping perimeters are not supplied, use the existing plot edges - if(is.null(x1)) x1<-oldclip[1] - if(is.null(x2)) x2<-oldclip[2] - if(is.null(y1)) y1<-oldclip[3] - if(is.null(y2)) y2<-oldclip[4] - clip(x1,x2,y1,y2) - abline(h=oldclip[4]+1) - clip(x1,x2,y1,y2) - } - abline(a=a,b=b,h=h,v=v,reg=reg,coef=coef,untf=untf,...) - if(!is.null(c(x1,x2,y1,y2))) do.call("clip",as.list(oldclip)) -} diff --git a/R/add.ps.R b/R/add.ps.R deleted file mode 100755 index d9d7347..0000000 --- a/R/add.ps.R +++ /dev/null @@ -1 +0,0 @@ -add.ps<-function(data,col.id,col.offset,col.x,col.value,fun.aggregate="mean", ref.offset=1,prefixes,alternative=c("two.sided","less","greater"),mu=0, paired=FALSE,var.equal=FALSE,lty=0,...) { round.ps<-function(x) { as.character(ifelse(x < 0.001,"<.001", ifelse(x < 0.01,paste0("=",substr(round(x,3),2,5)), ifelse(x < 0.05 && round(x,2) == 0.05,"<.05", ifelse(round(x,2) == 1,">.99",paste0("=",substr(round(x,2),2,4))))))) } if(!is.data.frame(data)) stop("data must be a data.frame") columns <- c(col.id, col.offset, col.x, col.value) if (any(!(columns %in% colnames(data)))) stop("column not matching the data") formula.agg <- as.formula(paste(col.value, "~", col.id, "+", col.offset, "+", col.x)) d.new <- aggregate(formula.agg, data = data, FUN = fun.aggregate) #so far same as in rm.plot2 l.offset <- levels(factor(d.new[,col.offset])) l.offset.test <- l.offset[-ref.offset] if (missing(prefixes)) prefixes <- paste("p(", l.offset.test, ")", sep = "") l.x <- levels(factor(d.new[,col.x])) for (c.offset in seq_along(l.offset.test)) { tmp.ps <- vector("numeric", length(l.x)) for (c.x in seq_along(l.x)) { tmpx <- d.new[d.new[,col.offset] == l.offset[ref.offset] & d.new[,col.x] == l.x[c.x], ] tmpx <- tmpx[order(tmpx[,col.id]),] tmpy <- d.new[d.new[,col.offset] == l.offset.test[c.offset] & d.new[,col.x] == l.x[c.x], ] tmpy <- tmpy[order(tmpy[,col.id]),] tmp.ps[c.x] <- t.test(tmpx[,col.value], tmpy[,col.value], alternative = alternative, mu = mu, paired = paired, var.equal = var.equal)$p.value } tmp.labels <- paste(prefixes[c.offset], round.ps(tmp.ps), sep = "") axis(1,seq_along(l.x), labels = tmp.labels, line = c.offset, lty = lty, ...) } } \ No newline at end of file diff --git a/R/addtable2plot.R b/R/addtable2plot.R deleted file mode 100644 index b4af0ac..0000000 --- a/R/addtable2plot.R +++ /dev/null @@ -1,119 +0,0 @@ -addtable2plot<-function(x,y=NULL,table,lwd=par("lwd"),bty="n", - bg=par("bg"),cex=1,xjust=0,yjust=1,xpad=0.1,ypad=0.5,box.col=par("fg"), - text.col=par("fg"),display.colnames=TRUE,display.rownames=FALSE, - hlines=FALSE,vlines=FALSE,title=NULL) { - - # make sure that there is a graphics device open - if(dev.cur() == 1) - stop("Cannot add table unless a graphics device is open") - # check for an xy.coords structure - if(is.null(y)) { - if(is.character(x)) { - tablepos<-get.tablepos(x) - x<-tablepos$x - y<-tablepos$y - xjust<-tablepos$xjust - yjust<-tablepos$yjust - } - else { - if(is.null(x$y)) stop("both x and y coordinates must be given") - y<-x$y - x<-x$x - } - } - droptop<-ifelse(any(c("topleft","top","topright") %in% x),1,0) - tabdim<-dim(table) - if(tabdim[1] == 1) hlines<-FALSE - if(tabdim[2] == 1) vlines<-FALSE - # cat(tabdim,vlines,hlines,"\n") - if(is.null(dim(bg))) bg<-matrix(bg,nrow=tabdim[1],ncol=tabdim[2]) - column.names<-colnames(table) - if(is.null(column.names) && display.colnames) - column.names<-1:tabdim[2] - row.names<-rownames(table) - if(is.null(row.names) && display.rownames) - row.names<-1:tabdim[1] - if(par("xlog")) x<-log10(x) - cellwidth<-rep(0,tabdim[2]) - # assume that the column names will be at least as wide as the entries - if(display.colnames) { - for(column in 1:tabdim[2]) - cellwidth[column]<-max(strwidth(c(column.names[column], - format(table[,column])),cex=cex))*(1+xpad) - nvcells<-tabdim[1]+1 - } - else { - nvcells<-tabdim[1] - for(column in 1:tabdim[2]) - cellwidth[column]<-max(strwidth(format(table[,column]),cex=cex))*(1+xpad) - } - if(display.rownames) { - nhcells<-tabdim[2]+1 - rowname.width<-max(strwidth(row.names,cex=cex))*(1+xpad) - } - else { - nhcells<-tabdim[2] - rowname.width<-0 - } - # cat(cellwidth,"\n") - if(par("ylog")) y<-log10(y) - cellheight<- - max(strheight(c(column.names,row.names,as.vector(unlist(table))), - cex=cex))*(1+ypad) - if(!is.null(title) & droptop) y<-y-cellheight - ytop<-y+yjust*nvcells*cellheight - # adjust for logarithmic plotting and allow the table to extend beyond the plot - oldpar<-par(xlog=FALSE,ylog=FALSE,xpd=TRUE) - if(display.colnames) { - xleft<-x+display.rownames*rowname.width-xjust*(sum(cellwidth)+rowname.width) - for(column in 1:tabdim[2]) { - text(xleft+cellwidth[column]*0.5, - ytop-0.5*cellheight,column.names[column],cex=cex,col=text.col) - xleft<-xleft+cellwidth[column] - } - } - for(row in 1:tabdim[1]) { - # start at the left edge of the table - xleft<-x-xjust*(sum(cellwidth)+rowname.width) - if(display.rownames) { - text(xleft+0.5*rowname.width, - ytop-(row+display.colnames-0.5)*cellheight, - row.names[row],cex=cex,col=text.col) - xleft<-xleft+rowname.width - } - for(column in 1:tabdim[2]) { - rect(xleft,ytop-(row+display.colnames-1)*cellheight, - xleft+cellwidth[column],ytop-(row+display.colnames)*cellheight, - col=bg[row,column],border=bg[row,column]) - text(xleft+0.5*cellwidth[column], - ytop-(row+display.colnames-0.5)*cellheight, - table[row,column],cex=cex,col=text.col) - xleft<-xleft+cellwidth[column] - } - } - if(vlines) { - xleft<-x+display.rownames*rowname.width-xjust*(sum(cellwidth)+rowname.width) - segments(xleft+cumsum(cellwidth[-tabdim[2]]), - ytop-display.colnames*cellheight, - xleft+cumsum(cellwidth[-tabdim[2]]), - ytop-(display.colnames+tabdim[1])*cellheight) - } - if(hlines) { - xleft<-x+display.rownames*rowname.width-xjust*(sum(cellwidth)+rowname.width) - segments(xleft, - ytop-display.colnames*cellheight-cumsum(rep(cellheight,tabdim[1]-1)), - xleft+sum(cellwidth), - ytop-display.colnames*cellheight-cumsum(rep(cellheight,tabdim[1]-1))) - } - if(!is.null(title)) { - xleft<-x-xjust*(sum(cellwidth)+rowname.width) - text(xleft+(rowname.width+sum(cellwidth))/2,ytop+cellheight/2,title, - cex=cex,col=text.col) - } - if(bty == "o") { - xleft<-x+display.rownames*rowname.width-xjust*(sum(cellwidth)+rowname.width) - rect(xleft,ytop-(tabdim[1]+display.colnames)*cellheight, - xleft+sum(cellwidth),ytop-display.colnames*cellheight) - } - par(oldpar) -} diff --git a/R/arctext.R b/R/arctext.R deleted file mode 100644 index b4c7ac9..0000000 --- a/R/arctext.R +++ /dev/null @@ -1,41 +0,0 @@ -arctext<-function(x,center=c(0,0),radius=1,start=NULL,middle=pi/2,end=NULL, - stretch=1,clockwise=TRUE,cex=NULL, ...) { - - oldcex <- par("cex") - # have to do this to get strwidth to work - if(is.null(cex)) cex <- oldcex - par(cex = cex) - xvec <- strsplit(x, "")[[1]] - lenx <- length(xvec) - xwidths <- stretch * strwidth(xvec) - charangles <- xwidths/radius - # make really narrow characters wider - changrang <- range(charangles) - charangles[charangles < changrang[2]/2] <- changrang[2]/2 - if(!is.null(end)) { - if(clockwise) start <- end + sum(charangles) - else start <- end - sum(charangles) - } - if(is.null(start)) { - if (clockwise) start <- middle + sum(charangles)/2 - else start <- middle - sum(charangles)/2 - } - if(clockwise) { - charstart <- c(start, start - cumsum(charangles)[-lenx]) - charpos <- charstart - charangles/2 - } - else { - charstart <- c(start, start + cumsum(charangles)[-lenx]) - charpos <- charstart + charangles/2 - } - xylim <- par("usr") - plotdim <- par("pin") - ymult <- (xylim[4] - xylim[3])/(xylim[2] - xylim[1]) * plotdim[1]/plotdim[2] - for(xchar in 1:lenx) { - srt <- 180 * charpos[xchar]/pi - 90 - text(center[1] + radius * cos(charpos[xchar]), center[2] + - radius * sin(charpos[xchar]) * ymult, xvec[xchar], - adj = c(0.5, 0.5), srt = srt + 180 * (!clockwise),...) - } - par(cex = oldcex) -} diff --git a/R/axis.break.R b/R/axis.break.R deleted file mode 100644 index 72b00cd..0000000 --- a/R/axis.break.R +++ /dev/null @@ -1,124 +0,0 @@ -# axis.break places a break marker at the position "breakpos" -# in user coordinates on the axis nominated - see axis(). - -axis.break<-function(axis=1,breakpos=NULL,pos=NULL,bgcol="white",breakcol="black", - style="slash",brw=0.02) { - - # get the coordinates of the outside of the plot - figxy<-par("usr") - # flag if either axis is logarithmic - xaxl<-par("xlog") - yaxl<-par("ylog") - # calculate the x and y offsets for the break - xw<-(figxy[2]-figxy[1])*brw - yw<-(figxy[4]-figxy[3])*brw - if(!is.null(pos)) figxy<-rep(pos,4) - # if no break position was given, put it just off the plot origin - if(is.null(breakpos)) - breakpos<-ifelse(axis%%2,figxy[1]+xw*2,figxy[3]+yw*2) - if(xaxl && (axis == 1 || axis == 3)) breakpos<-log10(breakpos) - if(yaxl && (axis == 2 || axis == 4)) breakpos<-log10(breakpos) - # set up the "blank" rectangle (left, bottom, right, top) - switch(axis, - br<-c(breakpos-xw/2,figxy[3]-yw/2,breakpos+xw/2,figxy[3]+yw/2), - br<-c(figxy[1]-xw/2,breakpos-yw/2,figxy[1]+xw/2,breakpos+yw/2), - br<-c(breakpos-xw/2,figxy[4]-yw/2,breakpos+xw/2,figxy[4]+yw/2), - br<-c(figxy[2]-xw/2,breakpos-yw/2,figxy[2]+xw/2,breakpos+yw/2), - stop("Improper axis specification.")) - # get the current setting of xpd - old.xpd<-par("xpd") - # don't cut the break off at the edge of the plot - par(xpd=TRUE) - # correct for logarithmic axes - if(xaxl) br[c(1,3)]<-10^br[c(1,3)] - if(yaxl) br[c(2,4)]<-10^br[c(2,4)] - if(style == "gap") { - if(xaxl) { - figxy[1]<-10^figxy[1] - figxy[2]<-10^figxy[2] - } - if(yaxl) { - figxy[3]<-10^figxy[3] - figxy[4]<-10^figxy[4] - } - # blank out the gap area and calculate the line segments - if(axis == 1 || axis == 3) { - rect(breakpos,figxy[3],breakpos+xw,figxy[4],col=bgcol,border=bgcol) - xbegin<-c(breakpos,breakpos+xw) - ybegin<-c(figxy[3],figxy[3]) - xend<-c(breakpos,breakpos+xw) - yend<-c(figxy[4],figxy[4]) - if(xaxl) { - xbegin<-10^xbegin - xend<-10^xend - } - } - else { - rect(figxy[1],breakpos,figxy[2],breakpos+yw,col=bgcol,border=bgcol) - xbegin<-c(figxy[1],figxy[1]) - ybegin<-c(breakpos,breakpos+yw) - xend<-c(figxy[2],figxy[2]) - yend<-c(breakpos,breakpos+yw) - if(xaxl) { - xbegin<-10^xbegin - xend<-10^xend - } - } - # clip the lines - par(xpd=TRUE) - } - else { - # draw the "blank" rectangle - rect(br[1],br[2],br[3],br[4],col=bgcol,border=bgcol) - if(style == "slash") { - # calculate the slash ends - if(axis == 1 || axis == 3) { - xbegin<-c(breakpos-xw,breakpos) - xend<-c(breakpos,breakpos+xw) - ybegin<-c(br[2],br[2]) - yend<-c(br[4],br[4]) - if(xaxl) { - xbegin<-10^xbegin - xend<-10^xend - } - } - else { - xbegin<-c(br[1],br[1]) - xend<-c(br[3],br[3]) - ybegin<-c(breakpos-yw,breakpos) - yend<-c(breakpos,breakpos+yw) - if(yaxl) { - ybegin<-10^ybegin - yend<-10^yend - } - } - } - else { - # calculate the zigzag ends - if(axis == 1 || axis == 3) { - xbegin<-c(breakpos-xw/2,breakpos-xw/4,breakpos+xw/4) - xend<-c(breakpos-xw/4,breakpos+xw/4,breakpos+xw/2) - ybegin<-c(ifelse(yaxl,10^figxy[3+(axis==3)],figxy[3+(axis==3)]),br[4],br[2]) - yend<-c(br[4],br[2],ifelse(yaxl,10^figxy[3+(axis==3)],figxy[3+(axis==3)])) - if(xaxl) { - xbegin<-10^xbegin - xend<-10^xend - } - } - else { - xbegin<-c(ifelse(xaxl,10^figxy[1+(axis==4)],figxy[1+(axis==4)]),br[1],br[3]) - xend<-c(br[1],br[3],ifelse(xaxl,10^figxy[1+(axis==4)],figxy[1+(axis==4)])) - ybegin<-c(breakpos-yw/2,breakpos-yw/4,breakpos+yw/4) - yend<-c(breakpos-yw/4,breakpos+yw/4,breakpos+yw/2) - if(yaxl) { - ybegin<-10^ybegin - yend<-10^yend - } - } - } - } - # draw the segments - segments(xbegin,ybegin,xend,yend,col=breakcol,lty=1) - # restore xpd - par(xpd=FALSE) -} diff --git a/R/axis.mult.R b/R/axis.mult.R deleted file mode 100644 index 6a40dec..0000000 --- a/R/axis.mult.R +++ /dev/null @@ -1,37 +0,0 @@ -axis.mult<-function(side=1,at=NULL,labels,mult=1,mult.label="",mult.line, - mult.labelpos=NULL,...) { - if(is.null(at)) at<-axTicks(side) - if(missing(labels)) labels<-at/mult - axis(side,at,labels,...) - mult.label<-paste(mult.label," (* ",mult," )",sep="",collapse="") - # multiplier position defaults to centered on the outside - if(is.null(mult.labelpos)) mult.labelpos<-side - edges<-par("usr") - if(side %% 2) { - # either top or bottom - if(mult.labelpos %% 2) { - adj<-0.5 - at<-(edges[1]+edges[2])/2 - if(missing(mult.line)) mult.line<-ifelse(mult.labelpos == side,3,0) - } - else { - adj<-ifelse(mult.labelpos == 2,1,0) - at<-ifelse(mult.labelpos == 2,edges[1],edges[2]) - if(missing(mult.line)) mult.line<-1 - } - } - else { - # either left or right - if(mult.labelpos %% 2) { - adj<-ifelse(mult.labelpos == 1,1,0) - at<-ifelse(mult.labelpos == 1,edges[3],edges[4]) - if(missing(mult.line)) mult.line<-1 - } - else { - adj<-0.5 - at<-(edges[3]+edges[4])/2 - if(missing(mult.line)) mult.line=ifelse(mult.labelpos == side,3,0) - } - } - mtext(mult.label,side,mult.line,at=at,adj=adj,...) -} diff --git a/R/barNest.R b/R/barNest.R deleted file mode 100755 index 792e9fc..0000000 --- a/R/barNest.R +++ /dev/null @@ -1,61 +0,0 @@ -barNest<-function (formula = NULL, data = NULL, FUN = c("mean", "sd", - "sd", "valid.n"), ylim = NULL, main = "", xlab = "", ylab = "", - shrink = 0.1, errbars = FALSE, col = NA, labelcex = 1, lineht = NULL, - showall = TRUE, Nwidths = FALSE, barlabels = NULL, showlabels = TRUE, - mar = NULL, arrow.cap = NULL, trueval = TRUE) { - - if(inherits(data,"brklist")) x<-data - else x <- brkdnNest(formula = formula, data = data, FUN = FUN, - trueval = trueval) - getBreakListNames <- function(x) { - blnames <- list(names(x[[1]][[1]])) - for (level in 2:length(x[[1]])) blnames[[level]] <- dimnames(x[[1]][[level]])[[level - - 1]] - return(blnames) - } - if (is.null(barlabels)) barlabels <- getBreakListNames(x) - xnames <- names(x) - nbn <- length(as.character(attr(terms(formula), "variables")[-1])) - if (FUN[1] == "valid.n" || FUN[1] == "sumbrk" || FUN[1] == - "sum") { - if (is.null(ylim)) - ylim <- c(0, 1.04 * max(unlist(x[[1]][[2]]), na.rm = TRUE)) - if (FUN[1] == "valid.n" || FUN[1] == "sum") - barlabels[[1]] <- "" - } - intervals <- xnames[2] == xnames[3] - if (is.null(ylim)) { - if (errbars) { - if (intervals) - ylim <- c(min(unlist(x[[1]]), na.rm = TRUE) - - max(unlist(x[[3]]), na.rm = TRUE), max(unlist(x[[1]]), - na.rm = TRUE) + max(unlist(x[[2]]), na.rm = TRUE)) - else ylim <- c(min(unlist(x[[3]]), na.rm = TRUE), - max(unlist(x[[2]]), na.rm = TRUE)) - } - else ylim <- range(unlist(x[[1]]), na.rm = TRUE) - } - if (is.null(arrow.cap)) - arrow.cap <- 0.25/length(unlist(x[[1]])) - ylim <- ylim + c(ifelse(ylim[1] < 0, -0.04, 0), 0.04) * diff(ylim) - if (ylim[1] != 0) - ylim[1] <- 0 - if (!is.null(mar)) - oldmar <- par(mar = mar) - plot(0, xlim = c(0, 1), ylim = ylim, main = main, xlab = xlab, - ylab = ylab, xaxt = "n", yaxs = "i", type = "n") - parusr <- par("usr") - if (is.null(lineht)) - lineht <- 1.05 * labelcex * diff(parusr[3:4]) * (par("mai")[1]/par("pin")[2])/par("mar")[1] - nlevels = length(x[[1]]) - drawNestedBars(x, start = 0, end = 1, shrink = shrink, errbars = errbars, - intervals = intervals, col = col, labelcex = labelcex, - lineht = lineht, showall = showall, Nwidths = Nwidths, - barlabels = barlabels, showlabels = showlabels, arrow.cap = arrow.cap) - abline(h = 0) - if (FUN[1] == "valid.n") - box() - if (!is.null(mar)) - par(mar = oldmar) - invisible(x) -} diff --git a/R/barlabels.R b/R/barlabels.R deleted file mode 100755 index 851e00b..0000000 --- a/R/barlabels.R +++ /dev/null @@ -1,26 +0,0 @@ -barlabels<-function(xpos,ypos,labels=NULL,cex=1,prop=0.5,miny=0,offset=0, - nobox=FALSE,...) { - - if(is.data.frame(ypos)) ypos<-as.matrix(ypos) - if(is.null(labels)) labels<-ypos - # usually don't want to display zero labels - display<-ypos > miny - if(is.matrix(ypos)) { - # prop is within the scope of the current environment - cumcenter<-function(x,pos) return(cumsum(x)-x*prop) - stacked<-length(xpos) < length(ypos) - if(stacked) { - # replicate the x positions one by one, but the offsets group by group - xpos<-rep(xpos,each=length(ypos)/length(xpos))+ - rep(c(-offset,offset),length(ypos)/(2*length(xpos))) - ypos<-apply(ypos,2,cumcenter) - } - else ypos<-ypos*prop - } - else ypos<-ypos*prop - # allow labels to extend beyond the plot area - par(xpd=TRUE) - if(nobox) text(xpos[display],ypos[display],labels[display],cex=cex,...) - else boxed.labels(xpos[display],ypos[display],labels[display],cex=cex,...) - par(xpd=FALSE) -} diff --git a/R/barp.R b/R/barp.R deleted file mode 100755 index a3d1c65..0000000 --- a/R/barp.R +++ /dev/null @@ -1,136 +0,0 @@ -barp<-function(height,width=0.4,names.arg=NULL,legend.lab=NULL,legend.pos=NULL, - col=NULL,border=par("fg"),main=NULL,xlab="",ylab="",xlim=NULL,ylim=NULL,x=NULL, - staxx=FALSE,staxy=FALSE,height.at=NULL,height.lab=NULL,cex.axis=par("cex.axis"), - pch=NULL,cylindrical=FALSE,shadow=FALSE,do.first=NULL,ylog=FALSE,srt=NULL,...) { - - height.class<-attr(height,"class") - if(!is.null(height.class)) { - if(inherits(height.class,"dstat")) { - md1<-length(height) - md2<-dim(height[[1]])[2] - meanmat<-matrix(NA,nrow=md1,ncol=md2) - colnames(meanmat)<-colnames(height[[1]]) - for(row in 1:md1) meanmat[row,]<-height[[row]][1,] - height<-meanmat - } - if(inherits(height.class,"freq")) height<-height[[1]] - } - if(is.data.frame(height)) its_ok<-is.numeric(unlist(height)) - else its_ok<-is.numeric(height) - if(!its_ok) stop("barp can only display bars with numeric heights") - hdim<-dim(height) - if(is.null(x)) x<-1:length(height) - if(is.null(hdim) || length(hdim) == 1) { - ngroups<-length(height) - barcol<-col - barpinfo<-list(x=x,y=height) - hdim<-NULL - } - else { - ngroups<-hdim[2] - x<-1:ngroups - if(!is.matrix(col) && length(col)==hdim[1]) - barcol<-matrix(rep(col,each=ngroups),nrow=hdim[1],byrow=TRUE) - else barcol<-col - if(!is.matrix(pch) && length(pch)==hdim[1]) - pch<-matrix(rep(pch,ngroups),nrow=hdim[1]) - barpinfo<-list(x=matrix(rep(1:ngroups,each=hdim[1]),ncol=hdim[2]), - y=as.matrix(height)) - } - if(is.null(xlim)) xlim<-range(x)+c(-0.6,0.6) - negy<-any(height<0,na.rm=TRUE) - if(is.null(ylim)) { - if(negy) miny<-min(height,na.rm=TRUE)*1.05 - else miny<-ifelse(ylog,min(height)/10,0) - ylim<-c(miny,max(height,na.rm=TRUE)*1.05) - } - else miny<-ylim[1] - plot(ylim[1],type="n",main=main,xlab=xlab,ylab=ylab,axes=FALSE,xlim=xlim, - ylim=ylim,xaxs="i",yaxs="i",log=ifelse(ylog,"y",""),...) - if(!is.null(do.first)) eval(parse(text=do.first)) - if(negy) abline(h=0) - if(is.null(names.arg)) names.arg<-x - # staxx=NA omits x axis - if(!is.na(staxx)) { - if(staxx) { - axis(1,at=x,labels=rep("",ngroups),cex.axis=cex.axis) - staxlab(1,at=x,labels=names.arg,cex=cex.axis,srt=srt) - } - else axis(1,at=x,labels=names.arg,cex.axis=cex.axis) - if(is.null(height.at)) { - if(ylog) height.at<-axTicks(2,log=TRUE) - else height.at<-pretty(ylim) - if(max(height.at) > max(height,na.rm=TRUE)) - height.at<-height.at[-length(height.at)] - } - if(is.null(height.lab)) height.lab<-height.at - } - if(!is.na(staxy)) { - if(staxy) { - axis(2,at=height.at,labels=rep("",length(height.lab)),cex.axis=cex.axis) - staxlab(2,at=height.at,labels=height.lab,cex=cex.axis,srt=srt) - } - else axis(2,at=height.at,labels=height.lab,cex.axis=cex.axis) - } - bottoms<-ifelse(negy,0,miny) - if(is.null(hdim)) { - if(shadow) { - for(bar in 1:ngroups) - polygon.shadow(c(x[bar]-width,x[bar]-width,x[bar]+width,x[bar]+width), - c(bottoms,height[bar],height[bar],bottoms), - offset=c(0.2*width,0.05*(height[bar]-ylim[2]))) - } - if(cylindrical) - cylindrect(x-width,bottoms,x+width,height,col=barcol, - border=border) - else { - if(is.null(pch)) - rect(x-width,bottoms,x+width,height,col=barcol,border=border) - else - rectFill(x-width,bottoms,x+width,height,bg="white",fg="black", - pch=pch) - } - } - else { - bottoms<-matrix(bottoms,nrow=hdim[1],ncol=hdim[2]) - barwidth<-2*width/hdim[1] - for(subgroup in 1:hdim[1]) { - barpinfo$x[subgroup,]<-1:ngroups-width+(subgroup-0.5)*barwidth - if(shadow) { - for(bar in 1:ngroups) { - barleft<-bar-width+(subgroup-1)*2*width/hdim[1] - barright<-barleft+2*width/hdim[1] - polygon.shadow(c(barleft,barleft,barright,barright), - c(bottoms[bar],height[subgroup,bar],height[subgroup,bar],bottoms[bar]), - offset=c(0.2*width,0.05*(height[subgroup,bar]-ylim[2]))) - } - } - if(cylindrical) - cylindrect(1:ngroups-width+(subgroup-1)*barwidth,bottoms[subgroup,], - 1:ngroups-width+(subgroup)*barwidth,height[subgroup,], - col=barcol[subgroup,],border=border) - else { - if(is.null(pch)) - rect(1:ngroups-width+(subgroup-1)*barwidth,bottoms[subgroup,], - 1:ngroups-width+(subgroup)*barwidth,height[subgroup,], - col=barcol[subgroup,],border=border) - else - rectFill(1:ngroups-width+(subgroup-1)*barwidth,bottoms[subgroup,], - 1:ngroups-width+(subgroup)*barwidth,height[subgroup,], - bg="white",fg="black",pch=pch[subgroup,]) - } - } - } - if(!is.null(legend.lab)) { - xjust<-0 - yjust<-1 - if(is.null(legend.pos)) { - cat("Click at the upper left corner of the legend\n") - legend.pos<-locator(1) - } - legend(list(x=legend.pos[1],y=legend.pos[2]),legend=legend.lab, - fill=col,xjust=xjust,yjust=yjust) - } - box() - invisible(barpinfo) -} diff --git a/R/battleship.plot.R b/R/battleship.plot.R deleted file mode 100644 index e37784c..0000000 --- a/R/battleship.plot.R +++ /dev/null @@ -1,32 +0,0 @@ -battleship.plot<-function(x,mar=c(2,5,5,1),col="white",border="black", - main="",xlab="",ylab="",xaxlab=NULL,yaxlab=NULL,cex.labels=1, - maxxspan=0.45,maxyspan=0.45) { - - dimx<-dim(x) - if(length(dimx) != 2) - stop("battleship.plot(x) where x is a 2 dimensional matrix or data frame") - if(is.data.frame(x)) x<-as.matrix(x) - oldmar<-par("mar") - par(mar=mar) - plot(0,xlim=c(0.5,dimx[2]+0.5),ylim=c(0.5,dimx[1]+0.5),axes=FALSE, - type="n",xlab="",ylab="") - title(main=main,line=mar[3]-2) - mtext(xlab,side=1,line=0) - if(is.null(xaxlab)) { - xaxlab<-colnames(x) - if(is.null(xaxlab)) xaxlab<-1:dimx[2] - } - staxlab(side=3,at=1:dimx[2],labels=xaxlab,srt=45,adj=0,top.line=0, - ticklen=0,cex=cex.labels) - if(is.null(yaxlab)) { - yaxlab<-rownames(x) - if(is.null(yaxlab)) yaxlab<-1:dimx[1] - } - staxlab(side=2,at=dimx[1]:1,labels=yaxlab,nlines=1,srt=0,adj=1, - top.line=0,ticklen=0,cex=cex.labels) - normx<-maxxspan*x/max(x,na.rm=TRUE) - rect(rep(1:dimx[2],each=dimx[1])-normx,rep(dimx[1]:1,dimx[2])-maxyspan, - rep(1:dimx[2],each=dimx[1])+normx,rep(dimx[1]:1,dimx[2])+maxyspan, - col=col,border=border) - par(mar=oldmar) -} diff --git a/R/box.heresy.R b/R/box.heresy.R deleted file mode 100644 index e65d0e1..0000000 --- a/R/box.heresy.R +++ /dev/null @@ -1,41 +0,0 @@ -box.heresy<-function(x,y,uinner,linner,ulim,llim=ulim, - boxwidth=NULL,intervals=FALSE,arrow.cap=NULL,pch=22,main="",xlab="", - ylab="",xaxlab=NULL,col="white",do.first=NULL,...) { - - if(missing(y)) { - y<-x - x<-1:length(y) - } - if(missing(llim)) llim<-ulim - if(missing(linner)) linner<-uinner - if(is.null(xaxlab)) xaxlab<-x - # if dispersion is specified in intervals, convert to absolute values - if(intervals) { - ulim<-y+ulim - llim<-y-llim - uinner<-y+uinner - linner<-y-linner - } - if(is.null(boxwidth)) { - if(length(x) > 1) xrange<-range(x) - else xrange<-c(0.5,1.5) - boxwidth<-diff(xrange)/(4*length(x)) - xspace<-diff(xrange)/10 - xlim<-c(xrange[1]-xspace,xrange[2]+xspace) - } - else { - nboxes<-length(y) - xspace<-min(boxwidth)/4 - x<-cumsum(boxwidth*2)+cumsum(rep(xspace,nboxes)) - xlim<-c(xspace+boxwidth[1]/2,x[nboxes]+boxwidth[nboxes]+xspace) - } - plot(x,y,xlim=xlim,ylim=range(c(llim,ulim)),main=main, - xlab=xlab,ylab=ylab,type="n",xaxt="n") - if(!is.null(do.first)) eval(parse(text=do.first)) - axis(1,at=x,labels=xaxlab) - if(is.null(arrow.cap)) arrow.cap<-boxwidth/diff(par("usr")[1:2]) - # upper and lower limits have already been converted - dispersion(x,y,ulim,llim,intervals=FALSE,arrow.cap=arrow.cap,...) - rect(x-boxwidth,linner,x+boxwidth,uinner,col=col) - points(x,y,pch=pch) -} diff --git a/R/boxed.labels.R b/R/boxed.labels.R deleted file mode 100644 index cc44a21..0000000 --- a/R/boxed.labels.R +++ /dev/null @@ -1,50 +0,0 @@ -boxed.labels<-function (x, y = NULL, labels, - bg = ifelse(match(par("bg"), "transparent", 0), "white", par("bg")), - border = TRUE, xpad = 1.2, ypad = 1.2, - srt = 0, cex = 1, adj = 0.5, xlog=FALSE, ylog=FALSE, ...) { - - oldpars <- par(c("cex", "xpd")) - par(cex = cex, xpd = TRUE) - if (is.null(y) && is.list(x)) { - y <- unlist(x[[2]]) - x <- unlist(x[[1]]) - } - box.adj <- adj + (xpad - 1) * cex * (0.5 - adj) - if (srt == 90 || srt == 270) { - bheights <- strwidth(labels) - theights <- bheights * (1 - box.adj) - bheights <- bheights * box.adj - lwidths <- rwidths <- strheight(labels) * 0.5 - } - else { - lwidths <- strwidth(labels) - rwidths <- lwidths * (1 - box.adj) - lwidths <- lwidths * box.adj - bheights <- theights <- strheight(labels) * 0.5 - } - args <- list(x = x, y = y, labels = labels, srt = srt, adj = adj, - col = ifelse(colSums(col2rgb(bg) * c(1, 1.4, 0.6)) < - 350, "white", "black")) - args <- modifyList(args, list(...)) - if(xlog){ - xpad<-xpad*2 - xr<-exp(log(x) - lwidths * xpad) - xl<-exp(log(x) + lwidths * xpad) - } - else{ - xr<-x - lwidths * xpad - xl<-x + lwidths * xpad - } - if(ylog){ - ypad<-ypad*2 - yb<-exp(log(y) - bheights * ypad) - yt<-exp(log(y) + theights * ypad) - } - else{ - yb<-y - bheights * ypad - yt<-y + theights * ypad - } - rect(xr, yb, xl, yt, col = bg, border = border) - do.call(text, args) - par(oldpars) -} diff --git a/R/brkdn.plot.R b/R/brkdn.plot.R deleted file mode 100755 index 0d55bbe..0000000 --- a/R/brkdn.plot.R +++ /dev/null @@ -1,142 +0,0 @@ -brkdn.plot<-function(vars,groups=NULL,obs=NULL,data,mct="mean",md="std.error", - stagger=NULL,dispbar=TRUE,main="Breakdown plot",xlab=NULL,ylab=NULL,xaxlab=NA, - ylim=NA,type="b",pch=1,lty=1,col=par("fg"),staxx=FALSE,yat=NULL,...) { - - if(inherits(vars,"formula")) { - formbits<-all.vars(vars) - vars<-formbits[1] - groups<-formbits[2] - obs<-formbits[3] - } - if(is.null(obs)) { - if(is.null(groups[1])) - stop("Must have at least one factor to subset data") - bygroup<-as.factor(data[[groups]]) - grouplevels<-levels(bygroup) - ngroups<-length(grouplevels) - nobs<-length(vars) - obs.pos<-1:nobs - obslevels<-1:nobs - } - else { - if(is.numeric(data[[obs]])) { - obs.pos<-obslevels<-sort(unique(data[[obs]])) - nobs<-length(obslevels) - } - else { - byobs<-as.factor(data[[obs]]) - obslevels<-levels(byobs) - nobs<-length(obslevels) - obs.pos<-1:nobs - } - if(is.null(groups)) { - ngroups<-length(vars) - grouplevels<-1:ngroups - } - else { - bygroup<-as.factor(data[[groups]]) - grouplevels<-levels(bygroup) - ngroups<-length(grouplevels) - if(length(vars) > 1) { - warning("Group and observation factors are present, only vars[1] is plotted") - vars<-vars[1] - } - } - } - brkdn<-list(matrix(NA,nrow=ngroups,ncol=nobs), - matrix(NA,nrow=ngroups,ncol=nobs)) - if(is.null(groups)) { - if(is.null(xlab)) xlab<-"Observation" - xat<-1:nobs - if(is.na(xaxlab[1])) xaxlab<-obslevels - for(group in 1:ngroups) { - for(ob in 1:nobs) { - thisbit<-data[[vars[group]]][data[[obs]] == obslevels[ob]] - if(length(thisbit)) { - if(length(thisbit) > 1) { - brkdn[[1]][group,ob]<-do.call(mct,list(thisbit,na.rm=TRUE)) - if(!is.null(md)) - brkdn[[2]][group,ob]<-do.call(md,list(thisbit,na.rm=TRUE)) - } - else brkdn[[1]][group,ob]<-thisbit - } - } - } - } - else { - if(is.na(obs)) { - if(is.na(xlab)) xlab<-"Variable" - xat<-1:length(vars) - if(is.na(xaxlab[1])) xaxlab<-vars - for(group in 1:ngroups) { - for(ob in 1:nobs) { - thisbit<-data[[vars[ob]]][data[[groups]] == grouplevels[group]] - if(length(thisbit)) { - if(length(thisbit) > 1) { - brkdn[[1]][group,ob]<-do.call(mct,list(thisbit,na.rm=TRUE)) - if(!is.null(md)) - brkdn[[2]][group,ob]<-do.call(md,list(thisbit,na.rm=TRUE)) - } - else brkdn[[1]][group,ob]<-thisbit - } - } - } - } - else { - if(is.null(xlab)) xlab<-"Observation" - xat<-obs.pos - if(is.na(xaxlab[1])) xaxlab<-obslevels - for(group in 1:ngroups) { - for(ob in 1:nobs) { - thisbit<-data[[vars]][data[[groups]] == grouplevels[group] & - data[[obs]] == obslevels[ob]] - if(length(thisbit)) { - if(length(thisbit) > 1) { - brkdn[[1]][group,ob]<-do.call(mct,list(thisbit,na.rm=TRUE)) - if(!is.null(md)) - brkdn[[2]][group,ob]<-do.call(md,list(thisbit,na.rm=TRUE)) - } - else brkdn[[1]][group,ob]<-thisbit - } - } - } - } - } - if(is.na(ylim[1])) { - ylim<-range(brkdn[[1]],na.rm=TRUE) - if(!is.null(md)) { - dlim<-c(min(brkdn[[1]]-brkdn[[2]],na.rm=TRUE), - max(brkdn[[1]]+brkdn[[2]],na.rm=TRUE)) - ylim<-c(min(c(ylim[1],dlim[1])),max(c(ylim[2],dlim[2]))) - } - } - groupdiv<-ifelse(ngroups < 3,1,ngroups-2) - if(is.null(stagger)) stagger<-0.025-groupdiv*0.0025 - if(is.null(ylab)) { - if(length(vars) == 1) ylab<-vars[1] - else ylab<-paste(vars,collapse=" and ") - } - plot(0,xlim=c(obs.pos[1]-0.5,obs.pos[nobs]+0.5),main=main, - xlab=xlab,ylab=ylab,ylim=ylim,type="n",axes=FALSE,...) - box() - if(staxx) staxlab(at=xat,labels=xaxlab) - else axis(1,at=xat,labels=xaxlab) - if(is.null(yat)) axis(2) - else axis(2,at=yat) - if(length(pch) < ngroups) pch<-rep(pch,length.out=ngroups) - if(length(col) < ngroups) col<-rep(col,length.out=ngroups) - if(length(lty) < ngroups) lty<-rep(lty,length.out=ngroups) - offinc<-stagger*diff(par("usr")[c(1,2)]) - offset<-0 - arrow.cap<-0.01-(groupdiv*0.001) - for(group in 1:ngroups) { - points(obs.pos+offset,brkdn[[1]][group,],type=type,col=col[group], - pch=pch[group],lty=lty[group],...) - if(dispbar) - dispersion(obs.pos+offset,brkdn[[1]][group,],brkdn[[2]][group,], - arrow.cap=arrow.cap,col=col[group],...) - offset<-ifelse(offset<0,-offset,-offset-offinc) - } - names(brkdn)<-c(mct,md) - return(brkdn) -} diff --git a/R/brkdnNest.R b/R/brkdnNest.R deleted file mode 100644 index 7669510..0000000 --- a/R/brkdnNest.R +++ /dev/null @@ -1,123 +0,0 @@ -jiggle<-function(n,range=c(-1,1)) return(rescale(sample(1:n,n),range)) - -valid.n<-function(x,na.rm=TRUE) return(if(na.rm) sum(!is.na(x)) else length(x)) - -propbrk<-function(x,trueval=TRUE,na.rm=TRUE) { - if(anyNA(x) || length(x) == 0) return(0) - else return(sum(x==trueval,na.rm=TRUE)/ - (if(na.rm) valid.n(x) else length(x))) -} - -sumbrk<-function(x,trueval=TRUE,na.rm=TRUE) { - return(sum(x==trueval,na.rm=TRUE)) -} - -binciW<-function(x,n,alpha=0.05,cc=FALSE) { - p<-x/n - q<-1-p - z<-qnorm(1-alpha/2) - z2<-z*z - if(cc) { - cil<-(2*n*p+z2-(z*sqrt(z2-1/n+4*n*p*q+(4*p-2))+1))/(2*(n+z2)) - ciu<-(2*n*p+z2+(z*sqrt(z2-1/n+4*n*p*q+(4*p-2))+1))/(2*(n+z2)) - } else { - cil<-(1/(1+z2/n))*(p+z2/(2*n)-z*sqrt((p/n*q)+z2/(4*n*n))) - ciu<-(1/(1+z2/n))*(p+z2/(2*n)+z*sqrt((p/n*q)+z2/(4*n*n))) - } - if(cil < 0) cil<-0 - if(ciu > 1) ciu<-1 - return(c(cil,ciu)) -} - -binciWu<-function(x,n,alpha=0.05,trueval=TRUE,na.rm=TRUE) { - if(missing(n)) n<-ifelse(na.rm,valid.n(x),length(x)) - x<-sum(x==trueval,na.rm=TRUE) - return(binciW(x,n,alpha=alpha)[2]) -} - -binciWl<-function(x,n,alpha=0.05,trueval=TRUE,na.rm=TRUE) { - if(missing(n)) n<-ifelse(na.rm,valid.n(x),length(x)) - x<-sum(x==trueval,na.rm=TRUE) - return(binciW(x,n,alpha=alpha)[1]) -} - -brkdnNest<-function(formula, data, FUN = c("mean", "sd", "sd", "valid.n"), - label1 = "Overall", trueval = TRUE) { - - if(missing(data) || missing(formula)) stop("brkdnNest(formula,data,...") - bn<-as.character(attr(terms(formula), "variables")[-1]) - nbn<-length(bn) - nFUN<-length(FUN) - brklist<-vector("list", nFUN) - truevalFUN<-c("propbrk","binciWu","binciWl","sumbrk") - brklevels<-list() - for(brk in 1:nbn) - if(is.factor(data[,bn[brk]])) brklevels[[brk]]<-levels(data[,bn[brk]]) - else brklevels[[brk]]<-sort(unique(data[,bn[brk]])) - for(brkfun in 1:nFUN) { - brklist[[brkfun]] <- vector("list", nbn) - if(FUN[brkfun] %in% truevalFUN) - brklist[[brkfun]][[1]] <- do.call(FUN[brkfun], list(data[[bn[1]]], - trueval = trueval, na.rm = TRUE)) - else brklist[[brkfun]][[1]] <- do.call(FUN[brkfun], list(data[[bn[1]]], - na.rm = TRUE)) - names(brklist[[brkfun]][[1]]) <- label1 - for(brk in 2:nbn) { - if(FUN[brkfun] %in% truevalFUN) - brklist[[brkfun]][[brk]] <- tapply(data[[bn[1]]], - data[bn[2:brk]], FUN = match.fun(FUN[brkfun]), - trueval = trueval) - else brklist[[brkfun]][[brk]] <- tapply(data[[bn[1]]], - data[bn[2:brk]], FUN = match.fun(FUN[brkfun]), - na.rm = TRUE) - names(brklist[[brkfun]][[brk]]) <- brklevels[[brk]] - } - if(FUN[brkfun] == "valid.n") - brklist[[brkfun]]<- - rapply(brklist[[brkfun]],function(x) ifelse(is.na(x),0,x),how="replace") - } - if(trueval == "prop") { - brklist[[1]][[2]]<-brklist[[1]][[2]]/brklist[[1]][[1]] - for(column in 1:ncol(brklist[[1]][[3]])) { - brklist[[1]][[3]][,column]<- - brklist[[1]][[3]][,column]/sum(brklist[[1]][[3]][,column]) - } - brklist[[1]][[1]]<-1 - } - attr(brklist, "class") <- "brklist" - names(brklist) <- FUN - return(brklist) -} - -sliceArray<-function(x,slice) { - dimx<-dim(x) - if(is.null(dimx)) return(x[slice]) - else { - ndim<-length(dimx) - slicestring<- - paste("x[",slice,paste(rep(",",ndim-1),collapse=""),"]",sep="",collapse="") - newx<-eval(parse(text=slicestring)) - return(newx) - } -} - -print.brklist<-function(x,...) { - - crawlBreakList<-function(x,depth=1) { - if(length(x)>1) { - if(depth==1) cat(names(x[[1]]),unlist(x[[1]]),"\n") - x[[1]]<-NULL - for(nextbit in 1:length(x[[1]])) { - newx<-lapply(x,sliceArray,nextbit) - cat(rep("\t",depth),names(x[[1]][nextbit]),unlist(x[[1]][nextbit]),"\n") - crawlBreakList(newx,depth=depth+1) - } - } - } - - xnames<-names(x) - for(func in 1:length(x)) { - cat(xnames[func],"\n") - crawlBreakList(x[[func]]) - } -} diff --git a/R/bumpchart.R b/R/bumpchart.R deleted file mode 100644 index 1437fd9..0000000 --- a/R/bumpchart.R +++ /dev/null @@ -1,35 +0,0 @@ -bumpchart<-function(y,top.labels=colnames(y),labels=rep(rownames(y),2), - rank=TRUE,mar=c(2,8,5,8),pch=19,col=par("fg"),lty=1,lwd=1,arrows=FALSE, - ...) { - - if(missing(y)) stop("Usage: bumpchart(y,top.labels,labels,...)") - ydim<-dim(y) - if(is.null(ydim)) stop("y must be a matrix or data frame") - oldmar<-par("mar") - par(mar=mar) - if(rank) y<-apply(y,2,rank) - # to get things the right way round, reverse the order of everything - labels<-rev(labels) - pch=rev(pch) - col=rev(col) - lty=rev(lty) - lwd=rev(lwd) - y<-apply(y,2,rev) - if(arrows) { - matplot(t(y),ylab="",type="p",pch=pch,col=col,axes=FALSE) - for(row in 1:(ydim[2]-1)) - p2p_arrows(rep(row,ydim[1]),y[,row],rep(row+1,ydim[1]),y[,row+1], - col=col,lty=lty,lwd=lwd,...) - } - else - matplot(t(y),ylab="",type="b",pch=pch,col=col,lty=lty,lwd=lwd,axes=FALSE,...) - par(xpd=TRUE) - xylim<-par("usr") - minspacing<-strheight("M")*1.5 - text(1:ydim[2],xylim[4]+(xylim[4]-xylim[3])/20,top.labels) - labelpos<-spreadout(y[,1],minspacing) - text(xylim[1],labelpos,labels[1:ydim[1]],adj=1) - labelpos<-spreadout(y[,ydim[2]],minspacing) - text(xylim[2],labelpos,labels[(ydim[1]+1):(2*ydim[1])],adj=0) - par(mar=oldmar,xpd=FALSE) -} diff --git a/R/centipede.plot.R b/R/centipede.plot.R deleted file mode 100755 index 5f9046e..0000000 --- a/R/centipede.plot.R +++ /dev/null @@ -1,101 +0,0 @@ -# in general, get.segs expects a list with varying lengths of numeric values -# it returns a 4xn matrix of midpoints, upper and lower limits and Ns -# where N is the number of valid elements in the list or columns in a -# data frame. - -get.segs<-function(x,mct="mean",lower.limit="std.error", - upper.limit=lower.limit) { - - xlen<-length(x) - segs<-matrix(0,nrow=4,ncol=xlen) - for(i in 1:xlen) { - segs[1,i]<-do.call(mct,list(x[[i]],na.rm=TRUE)) - segs[2,i]<-segs[1,i]-do.call(lower.limit,list(x[[i]],na.rm=TRUE)) - segs[3,i]<-segs[1,i]+do.call(upper.limit,list(x[[i]],na.rm=TRUE)) - segs[4,i]<-sum(!is.na(x[[i]])) - } - rownames(segs)<-c(mct,lower.limit,upper.limit,"valid.n") - colnames(segs)<-names(x) - return(segs) -} - -centipede.plot<-function(segs,mct="mean",lower.limit="std.error", - upper.limit=lower.limit,left.labels=NULL,right.labels=NULL,sort.segs=TRUE, - main="",xlab=NA,pch=21,vgrid=NA,hgrid=NA,gridcol="lightgray",mar=NA,col=par("fg"), - bg="green",...) { - - if(missing(segs)) { - cat("Usage: centipede.plot(segs,...)\n\twhere segs is a dstat object") - stop("or a matrix of midpoints and limits") - } - if(is.list(segs)) { - if(all(lapply(segs,is.numeric))) - segs<-get.segs(segs,mct=mct,lower.limit=lower.limit, - upper.limit=upper.limit) - else stop("If segs is a list, all the components must be numeric") - } - if(inherits(segs,"dstat")) { - midpoint<-"mean" - if(lower.limit == "var") { - if(rownames(segs)[2] == "var") ll<-segs[1,]-segs[2,] - if(rownames(segs)[2] == "sd") ll<-segs[1,]-segs[2,]*segs[2,] - } - if(upper.limit == "var") { - if(rownames(segs)[2] == "var") ul<-segs[1,]+segs[2,] - if(rownames(segs)[2] == "sd") ul<-segs[1,]+segs[2,]*segs[2,] - } - if(lower.limit == "sd") { - if(rownames(segs)[2] == "var") ll<-segs[1,]-sqrt(segs[2,]) - if(rownames(segs)[2] == "sd") ll<-segs[1,]-segs[2,] - } - if(upper.limit == "sd") { - if(rownames(segs)[2] == "var") ul<-segs[1,]+sqrt(segs[2,]) - if(rownames(segs)[2] == "sd") ul<-segs[1,]+segs[2,] - } - if(lower.limit == "std.error") { - if(rownames(segs)[2] == "var") ll<-segs[1,]-sqrt(segs[2,])/sqrt(segs[3,]) - if(rownames(segs)[2] == "sd") ll<-segs[1,]-segs[2,]/sqrt(segs[3,]) - } - if(upper.limit == "std.error") { - if(rownames(segs)[2] == "var") ul<-segs[1,]+sqrt(segs[2,])/sqrt(segs[3,]) - if(rownames(segs)[2] == "sd") ul<-segs[1,]+segs[2,]/sqrt(segs[3,]) - } - segs<-rbind(segs[1,],ll,ul,segs[3,]) - } - segdim<-dim(segs) - if (sort.segs) { - seg.order<-order(segs[1,]) - segs<-segs[,seg.order] - } - else seg.order<-1:segdim[2] - oldpar<-par("mar") - if(is.na(mar[1])) mar<-c(4,6,1+2*(nchar(main)>0),5) - par(mar=mar) - plot(x=c(min(segs[2,]),max(segs[3,])),y=c(1,segdim[2]), - main=main,xlab="",ylab="",type="n",axes=FALSE,...) - box() - if(!is.na(vgrid[1])) abline(v=vgrid,lty=1,col=gridcol) - if(is.null(hgrid)) abline(h=1:segdim[2],lty=2,col=gridcol) - else if(!is.na(hgrid[1])) abline(h=hgrid,lty=2,col=gridcol) - axis(1) - arrows(segs[2,],1:segdim[2],segs[3,],1:segdim[2],length=0.05, - angle=90,code=3,col=col) - points(segs[1,],1:segdim[2],pch=pch,col=col,bg=bg) - if(is.null(left.labels)) { - left.labels<-colnames(segs) - if(is.null(left.labels)) left.labels<-paste("V",seg.order,sep="") - } - else left.labels<-left.labels[seg.order] - plot.limits<-par("usr") - mtext(left.labels,2,line=0.2,at=1:segdim[2],adj=1,las=1) - if(is.null(right.labels)) - right.labels<-paste(round(segs[1,],2),"(",segs[4,],")",sep="") - else right.labels<-right.labels[seg.order] - mtext(right.labels,4,line=0.2,at=1:segdim[2],adj=0,las=1) - if(is.na(xlab)) - xlab<-paste("| -",rownames(segs)[2],"-",rownames(segs)[1],"-", - rownames(segs)[3],"- |") - if (nchar(xlab)) mtext(xlab,1,line = 2) - par(oldpar) - invisible(segs) -} diff --git a/R/clean.args.R b/R/clean.args.R deleted file mode 100644 index 2339e40..0000000 --- a/R/clean.args.R +++ /dev/null @@ -1,21 +0,0 @@ -clean.args<-function(argstr,fn,exclude.repeats=FALSE,exclude.other=NULL, - dots.ok=TRUE) { - - fnargs<-names(formals(fn)) - if(length(argstr) > 0 && !("..." %in% fnargs && dots.ok)) { - badargs<-names(argstr)[!sapply(names(argstr),"%in%",c(fnargs,""))] - for(i in badargs) argstr[[i]]<-NULL - } - if(exclude.repeats) { - ntab<-table(names(argstr)) - badargs<-names(ntab)[ntab > 1 & names(ntab) != ""] - for (i in badargs) argstr[[i]]<-NULL - } - for(i in exclude.other) argstr[[i]]<-NULL - argstr -} - -remove.args<-function(argstr,fn) { - fnargs <- names(formals(fn)) - argstr[!(names(argstr) %in% fnargs)] -} diff --git a/R/clplot.R b/R/clplot.R deleted file mode 100644 index b963bef..0000000 --- a/R/clplot.R +++ /dev/null @@ -1,138 +0,0 @@ -# CLPLOT -# Jan 2014 - Fixed a semibug in the way min/max cut levels are -# generated, also cleaned up some random stuff. -# 20 Oct. 2008 Now plots even pathological data sets without gaps -# Parameters: -# levels-- vector of desired cutpoints. Program will sort them. -# cols-- vector of desired color sequence (strings or numeric references) -# x, y-- The data, of course. -# '...' is intended for arguments to pass to PLOT or LINES calls -# lty-- plot parameter lty (see par() ) -# showcuts-- Set to TRUE to plot gridlines at color cut levels -# -clplot<-function(x,y, ylab=deparse(substitute(y)), xlab=deparse(substitute(x)), -levels=seq(min(y)+(max(y)-min(y))/5, max(y)-(max(y)-min(y))/5, length.out=4), -cols=c("black", "blue", "green", "orange", "red"), lty=1, showcuts=FALSE, ...) -{ -if(missing(y)){ - ylab=xlab # no reason to recalc "deparse(substitute(x))" - y<-as.numeric(x) - x<-seq(1,length(y)) -# should have done this long ago: fix xlabel - xlab<-'index' - } -xx<-as.numeric(x) -yy<-as.numeric(y) -levels<-sort(as.numeric(levels)) - -# Jan 2014: Bugfix here: if levels has values outside min or max of data, -# we do NOT want to creat cuts at the min,max values! And this needs to be done -# PRIOR to checking lengths of levels vs colors; and check against cuts, -# not against levels. -#### new code -cuts<-sort(levels) -if(min(yy)< min(levels) ) cuts<- c(min(yy),cuts) -if(max(yy)> max(levels) ) cuts <- c(cuts, max(yy)) -# set cols length to fit with number of cuts. (number of colors to be used) -if (length(cuts)> length(cols)+1) { - cat("Warning: not enough colors. Will repeat.\n") - } -#notice this will also truncate cols if it's longer than number of slices. -cols<-rep(cols,length.out=length(cuts)-1) -#build 'empty' graph -plot(xx,yy,type='n', xlab=xlab, ylab=ylab, ...) -# initialize the list variable which will hold all modded slices -modslice<-list() -newxx<-xx -newyy<-yy -# newxx/yy will add new points as generated for each slice -for(jj in 1 : (length(cuts)-1)) - { - botsl<-(cuts[jj]>newyy) - topsl<-(cuts[jj+1]1 ) - { - for (i in 1:(length(runs$lengths)-1)) - { - thepos<-thepos+runs$lengths[i] - # "add" interp point at the end of each run - # whichway chooses which 'side' of interval to interpolate towards - whichway<-slicelog[thepos] - #pick correct cut value - is subslice is going up or down - #whichcut chooses the cut to use - whichcut<-as.logical(newyy[thepos]>=cuts[j]&newyy[thepos+1]>=cuts[j]) - #note the interpolation is TO x FROM y - xint3<-approx(c(newyy[thepos:(thepos+1)]),c(newxx[thepos:(thepos+1)]),cuts[j+whichcut]) - newx <-xint3$y - newy <-cuts[j+whichcut] - # adding in "i-1" to the splitpoint to get correct location - slx<-c(slx[1:(thepos+(i-1))],newx,slx[(thepos+1+(i-1)):length(slx)]) - sly<-c(sly[1:(thepos+(i-1))],newy,sly[(thepos+1+(i-1)):length(sly)]) - } #end of for (runs) loop; all necessary points have been added - } # end of if (length(runs)) - modslice<-c(modslice,list(cbind(slx,sly))) - names(modslice)<-c(names(modslice)[1:(length(names(modslice))-1)],paste("newsl",j,sep="")) - } # end of j loop. - -# modslice will have one list element for each slice, empty or not -mapply(function(x,y) suppressWarnings(lines(x[,1],x[,2], col=y, type='l', lty=lty,...)), modslice,cols) -#suppression lets me pass '...' to both plot and lines calls, e.g. titles to plot() above -if(showcuts==TRUE) - { - lnx<-c(min(newxx),max(newxx)) - lncut<-cuts[2:(length(cuts)-1)] - mapply(function(rrr,sss) lines(lnx,c(rrr,sss),lty='dotted', col='black'),lncut,lncut) - } #end of showcuts IF -#save interesting stuff -stuff<-list(xin=x,yin=y,cuts=cuts) -stuff<-c(stuff,modslice) -names(stuff)<-c('xin','yin','cuts',names(modslice)) -return(invisible(stuff)) -} diff --git a/R/cluster.overplot.R b/R/cluster.overplot.R deleted file mode 100644 index 650a296..0000000 --- a/R/cluster.overplot.R +++ /dev/null @@ -1,34 +0,0 @@ -cluster.overplot<-function(x,y,away=NULL,tol=NULL,...) { - if(missing(x)) stop("Usage: cluster.overplot(x,y,away=NULL,tol=NULL)") - dimx<-dim(x) - if(missing(y) && !is.null(dimx)) { - y<-x[,2] - x<-x[,1] - } - xlen<-length(x) - if(xlen != length(y)) stop("x and y must be the same length.") - if(dev.cur() == 1) plot(x,y,main="",xlab="",ylab="",axes=FALSE,type="n") - if(is.null(away)) away<-c(strwidth("o"),5*strheight("o")/8) - if(is.null(tol)) tol<-c(strwidth("o")/2,strheight("o")/2) - away.x<-c(0,-away[1],away[1],0,0,-away[1],away[1],-away[1],away[1]) - away.y<-c(0,0,0,-away[2],away[2],-away[2],away[2],away[2],-away[2]) - flags<-1:xlen - for(i in 1:xlen) { - if(!is.na(flags[i])) { - overplots<-abs(x-x[i]) <= tol[1] & abs(y - y[i]) <= tol[2] - if(sum(overplots) > 1) { - away.index<-1 - for(j in 1:xlen) { - if(overplots[j]) { - x[j]<-x[j]+away.x[away.index] - y[j]<-y[j]+away.y[away.index] - away.index<-away.index+1 - if(away.index > 9) away.index<-1 - } - } - } - } - flags[overplots] <- NA - } - return(list(x=x,y=y,...)) -} diff --git a/R/clustered.dotplots.R b/R/clustered.dotplots.R deleted file mode 100644 index 1cce62b..0000000 --- a/R/clustered.dotplots.R +++ /dev/null @@ -1,68 +0,0 @@ -clustered.dotplots<-function(xgroup, ygroup, freq, type = "circles", - main="",xlab="",ylab="",x_las=1,y_las=1,axes=TRUE,size=1,...) { - - dfx = data.frame(xgroup = xgroup, ygroup = ygroup, freq = freq) - if(any(duplicated(dfx[,1:2]))){ - stop("There can be only one 'frequency' for each pair of 'xgroup' and 'ygroup'") - } - - x_unique <- unique(xgroup) - y_unique <- unique(ygroup) - - plot(1, 1, asp = 1, xlim = c(0.5, 0.5+length(x_unique)), - ylim = c(0.5, 0.5+length(y_unique)), type = "n", - main=main,xlab = xlab, ylab = ylab, axes = FALSE) - - if(axes == TRUE){ - box() - axis(1, at = seq_along(x_unique), labels = x_unique, las = x_las) - axis(2, at = seq_along(y_unique), labels = y_unique, las = y_las) - } - - spacing <- (1-0.10)/ceiling(sqrt(max(freq))) * size - #size can go from 0 to 1, 1 being the maximum spacing - - for (i in 1:length(y_unique)){ - #Subset dfx corresponding to first 'ygroup' - freq_subset <- subset(dfx, dfx$ygroup == y_unique[i]) - - for (j in 1:length(freq_subset$xgroup)){ - #Determine the size of square matrix that can accomodate the frequency - matrix_sz <- ceiling(sqrt(freq_subset$freq[j])) - #Initialize y matrix - matrix_y <- matrix(rep(0, matrix_sz^2), nrow = matrix_sz) - #Determine 'relative' y-co-ordinates - matrix_y <- (NROW(matrix_y)+1)/2 - row(matrix_y) - - #Initiate x matrix - matrix_x <- matrix(rep(0, matrix_sz^2), nrow = matrix_sz) - #Determine 'relative' x-co-ordinates - matrix_x <- col(matrix_x) - (NCOL(matrix_x)+1)/2 - - #Determine the co-ordinate of the center of the square matrix grid - x_center <- j - y_center <- i - #To keep track of symbols plotted - flag <- 1 - - # Plot circles around the center based on relative co-ordinates - for (rows in 1:matrix_sz){ - for (columns in 1:matrix_sz){ - if (flag > freq_subset$freq[j]){ - #Break when the necessary number of points have been plotted - break - } - xx <- x_center + spacing * matrix_x[rows, columns] - yy <- y_center + spacing * matrix_y[rows, columns] - flag <- flag + 1 - - if(type == "circles"){ - draw.circle(x = xx, y = yy, radius = spacing/2.05, ...) #Uses draw.circle of plotrix. Can be replaced with 'symbol' - }else if(type == "points"){ - points(x = xx, y = yy, ...) - } - } - } - } - } -} diff --git a/R/color.gradient.R b/R/color.gradient.R deleted file mode 100644 index dd09ae4..0000000 --- a/R/color.gradient.R +++ /dev/null @@ -1,3 +0,0 @@ -color.gradient<-function(reds,greens,blues,nslices=50) { - return(color.scale(1:nslices,reds,greens,blues)) -} diff --git a/R/color.id.R b/R/color.id.R deleted file mode 100644 index 66f36de..0000000 --- a/R/color.id.R +++ /dev/null @@ -1,6 +0,0 @@ -color.id<-function(col) { - c2 <- col2rgb(col) - coltab <- col2rgb(colors()) - cdist <- apply(coltab, 2, function(z) sum((z - c2)^2)) - colors()[which(cdist == min(cdist))] -} diff --git a/R/color.legend.R b/R/color.legend.R deleted file mode 100644 index 45c1af8..0000000 --- a/R/color.legend.R +++ /dev/null @@ -1,36 +0,0 @@ -color.legend<-function (xl,yb,xr,yt,legend,rect.col,cex=1,align="lt", - gradient="x",...) { - - oldcex<-par("cex") - par(xpd=TRUE,cex=cex) - gradient.rect(xl,yb,xr,yt,col=rect.col,nslices=length(rect.col), - gradient=gradient) - if(gradient == "x") { - xsqueeze<-(xr-xl)/(2*length(rect.col)) - textx<-seq(xl+xsqueeze,xr-xsqueeze,length.out=length(legend)) - if(match(align,"rb",0)) { - texty<-yb-0.2*strheight("O") - textadj<-c(0.5,1) - } - else { - # assume it's the default - texty<-yt+0.2*strheight("O") - textadj<-c(0.5,0) - } - } - else { - ysqueeze<-(yt-yb)/(2*length(rect.col)) - texty<-seq(yb+ysqueeze,yt-ysqueeze,length.out=length(legend)) - if(match(align,"rb",0)) { - textx<-xr+0.2*strwidth("O") - textadj<-c(0,0.5) - } - else { - # assume it's the default - textx<-xl-0.2*strwidth("O") - textadj<-c(1,0.5) - } - } - text(textx,texty,labels=legend,adj=textadj,...) - par(xpd=FALSE,cex=oldcex) -} diff --git a/R/color.scale.R b/R/color.scale.R deleted file mode 100755 index 20e08a1..0000000 --- a/R/color.scale.R +++ /dev/null @@ -1,96 +0,0 @@ -color.scale<-function(x,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1),alpha=1, - extremes=NA,na.color=NA,xrange=NULL,color.spec="rgb") { - - xdim<-dim(x) - if (diff(range(x, na.rm = TRUE)) == 0) x<-x/max(x,na.rm=TRUE) - naxs<-is.na(x) - if(!is.na(extremes[1])){ - # calculate the color ranges from the extremes - only for rgb - colmat<-col2rgb(extremes) - cs1<-colmat[1,]/255 - cs2<-colmat[2,]/255 - cs3<-colmat[3,]/255 - color_spec<-"rgb" - } - maxcs1<-ifelse(color.spec=="hcl",360,1) - maxcs2<-ifelse(color.spec=="hcl",100,1) - maxcs3<-ifelse(color.spec=="hcl",100,1) - maxalpha<-1 - ncolors<-length(x) - if(is.null(xrange)) { - xrange<-range(x,na.rm=TRUE) - drop.extremes<-FALSE - } - else { - if(xrange[1] > min(x,na.rm=TRUE) || xrange[2] < max(x,na.rm=TRUE)) - stop("An explicit range for x must include the range of x values.") - x<-c(xrange,x) - drop.extremes=TRUE - } - ncs1<-length(cs1) - if(ncs1>1) { - cs1s<-rep(cs1[ncs1],ncolors) - xstart<-xrange[1] - xinc<-diff(xrange)/(ncs1-1) - for(seg in 1:(ncs1-1)){ - segindex<-which((x >= xstart) & (x <= (xstart+xinc))) - cs1s[segindex]<-rescale(x[segindex],cs1[c(seg,seg+1)]) - xstart<-xstart+xinc - } - if(min(cs1s,na.rm=TRUE) < 0 || max(cs1s,na.rm=TRUE) > maxcs1) - cs1s<-rescale(cs1s,c(0,maxcs1)) - } - else cs1s<-rep(cs1,ncolors) - ncs2<-length(cs2) - if(ncs2>1) { - cs2s<-rep(cs2[ncs2],ncolors) - xstart<-xrange[1] - xinc<-diff(xrange)/(ncs2-1) - for(seg in 1:(ncs2-1)){ - segindex<-which((x >= xstart) & (x <= (xstart+xinc))) - cs2s[segindex]<-rescale(x[segindex],cs2[c(seg,seg+1)]) - xstart<-xstart+xinc - } - if(min(cs2s,na.rm=TRUE) < 0 || max(cs2s,na.rm=TRUE) > maxcs2) - cs2s<-rescale(cs2s,c(0,maxcs2)) - } - else cs2s<-rep(cs2,ncolors) - ncs3<-length(cs3) - if(ncs3>1) { - cs3s<-rep(cs3[ncs3],ncolors) - xstart<-xrange[1] - xinc<-diff(xrange)/(ncs3-1) - for(seg in 1:(ncs3-1)){ - segindex<-which((x >= xstart) & (x <= (xstart+xinc))) - cs3s[segindex]<-rescale(x[segindex],cs3[c(seg,seg+1)]) - xstart<-xstart+xinc - } - if(min(cs3s,na.rm=TRUE) < 0 || max(cs3s,na.rm=TRUE) > maxcs3) - cs3s<-rescale(cs3s,c(0,maxcs3)) - } - else cs3s<-rep(cs3,ncolors) - nalpha<-length(alpha) - if(nalpha>1) { - alphas<-rep(alpha[nalpha],ncolors) - xstart<-xrange[1] - xinc<-diff(xrange)/(nalpha-1) - for(seg in 1:(nalpha-1)){ - segindex<-which((x >= xstart) & (x <= (xstart+xinc))) - alphas[segindex]<-rescale(x[segindex],alpha[c(seg,seg+1)]) - xstart<-xstart+xinc - } - if(min(alphas,na.rm=TRUE) < 0 || max(alphas,na.rm=TRUE) > maxalpha) - alphas<-rescale(alphas,c(0,maxalpha)) - } - else alphas<-rep(alpha,ncolors) - if(drop.extremes) { - # drop the first two (extreme) values in each vector - cs1s<-cs1s[-(1:2)] - cs2s<-cs2s[-(1:2)] - cs3s<-cs3s[-(1:2)] - } - colors<-do.call(color.spec,list(cs1s,cs2s,cs3s,alphas)) - if(!is.null(xdim)) colors<-matrix(colors,nrow=xdim[1]) - if(length(naxs)) colors[naxs]<-na.color - return(colors) -} diff --git a/R/color.scale.lines.R b/R/color.scale.lines.R deleted file mode 100644 index c1a98ea..0000000 --- a/R/color.scale.lines.R +++ /dev/null @@ -1,24 +0,0 @@ -color.scale.lines<-function(x,y,reds,greens,blues,col=NA,colvar=NA,...) { - - if(is.list(x) && missing(y)) { - y<-x$y - x<-x$x - } - lenx<-length(x) - leny<-length(y) - nseg<-lenx-1 - if(lenx != leny) { - warning("x and y are different lengths - some values will be ignored") - if(lenx>leny) nseg<-leny-1 - } - if(is.na(col[1])) { - # if colors are not supplied - if(is.na(colvar[1])) - # if a separate variable is not supplied, use running average of y pairs - lcol<-color.scale((y[1:nseg]+y[2:(nseg+1)])/2,reds,greens,blues) - # assume that colvar refers to the intervals, not the x/y points - else lcol<-color.scale(colvar,reds,greens,blues) - } - else lcol=col - segments(x[1:nseg],y[1:nseg],x[2:(nseg+1)],y[2:(nseg+1)],col=lcol,...) -} diff --git a/R/color2D.matplot.R b/R/color2D.matplot.R deleted file mode 100755 index 35f862f..0000000 --- a/R/color2D.matplot.R +++ /dev/null @@ -1,148 +0,0 @@ -hexagon<-function(x,y,unitcell=1,col=NA,border="black") { - polygon(c(x,x,x+unitcell/2,x+unitcell,x+unitcell,x+unitcell/2), - c(y+unitcell*0.125,y+unitcell*0.875,y+unitcell*1.125,y+unitcell*0.875, - y+unitcell*0.125,y-unitcell*0.125),col=col,border=border) -} - -fill.corner<-function(x,nrow,ncol,na.value=NA) { - xlen<-length(x) - ncells<-ifelse(nrow*ncol < xlen,nrow*ncol,xlen) - newmat<-matrix(na.value,nrow=nrow,ncol=ncol) - xside<-1 - while(xside*xside < ncells) xside<-xside+1 - row=1 - col=1 - for(xindex in 1:ncells) { - newmat[row,col]<-x[xindex] - if(row == xside) { - col<-col+1 - row<-1 - } - else row<-row+1 - } - return(newmat) -} - -# returns a plot.coord list of the indices of the maximum -# or minimum value in a matrix -find_max_cell<-function(x,max=TRUE) { - if(max) - return(list(x=which.max(apply(x,2,max)),y=which.max(apply(x,1,max)))) - else - return(list(x=which.min(apply(x,2,min)),y=which.min(apply(x,1,min)))) -} - -color2D.matplot<-function(x,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1), - extremes=NA,cellcolors=NA,show.legend=FALSE,nslices=10,xlab="Column", - ylab="Row",do.hex=FALSE,axes=TRUE,show.values=FALSE,vcol=NA,vcex=1, - border="black",na.color=NA,xrange=NULL,color.spec="rgb",yrev=TRUE, - xat=NULL,yat=NULL,Hinton=FALSE,add=FALSE,...) { - - if(diff(range(x,na.rm=TRUE)) == 0) { - if(Hinton) stop("No differences to display in Hinton plot.") - x<-x/max(x,na.rm=TRUE) - } - if(is.matrix(x) || is.data.frame(x)) { - xdim<-dim(x) - if(is.data.frame(x)) x<-unlist(x) - else x<-as.vector(x) - oldpar<-par("xaxs","yaxs","xpd","mar") - par(xaxs="i",yaxs="i") - if(do.hex) par(mar=c(5,4,4,4)) - if(!add) - plot(c(0,xdim[2]),c(0,xdim[1]),xlab=xlab,ylab=ylab,type="n",axes=FALSE,...) - oldpar$usr<-par("usr") - if(!do.hex) { - box() - pos<-0 - } - else pos<- -0.3 - if(axes && !add) { - if(is.null(xat)) xat<-pretty(0:xdim[2])[-1] - axis(1,at=xat-0.5,labels=xat,pos=pos) - if(is.null(yat)) yat<-pretty(0:xdim[1])[-1] - axis(2,at=xdim[1]-yat+0.5,labels=yat) - } - if(all(is.na(cellcolors))) { - if(Hinton) { - if(is.na(extremes[1])) extremes<-c("black","white") - cellcolors<-extremes[(x > 0) + 1] - } - else cellcolors<-color.scale(x,cs1,cs2,cs3,extremes=extremes, - na.color=na.color,color.spec=color.spec) - } - # this sets the color for overprinted text to black or white - # depending upon what color will be the background for the text - if(is.na(vcol)) - vcol<-ifelse(colSums(col2rgb(cellcolors)*c(1,1.4,0.6))<350,"white","black") - # if it's a Hinton diagram,cellsize = x, rescaling to 0.1,1 if necessary - if(Hinton) { - if(any(x < 0 | x > 1)) - cellsize<-matrix(rescale(abs(x),c(0.03,1)),nrow=xdim[1]) - } - else cellsize<-matrix(1,nrow=xdim[1],ncol=xdim[2]) - # start from the top left - isomorphic with the matrix layout - if(do.hex) { - par(xpd=TRUE) - offset<-0 - if(length(border) < xdim[1]*xdim[2]) - border<-rep(border,length.out=xdim[1]*xdim[2]) - for(row in 1:xdim[1]) { - for(column in 0:(xdim[2]-1)) { - hexagon(column+offset,xdim[1]-row,unitcell=cellsize[row,column+1], - col=cellcolors[row+xdim[1]*column], - border=border[row+xdim[1]*column]) - if(show.values) - text(column+offset+0.5,xdim[1]-row+0.5,x[row+column*xdim[1]], - col=vcol[row+xdim[1]*column],cex=vcex) - } - offset<-ifelse(offset,0,0.5) - } - par(xpd=FALSE) - } - else { - if(Hinton) inset<-(1-cellsize)/2 - else inset<-0 - if(yrev) { - y0<-rep(seq(xdim[1]-1,0,by=-1),xdim[2])+inset - y1<-rep(seq(xdim[1],1,by=-1),xdim[2])-inset - } - else { - y0<-rep(0:(xdim[1]-1),xdim[2])+inset - y1<-rep(1:xdim[1],xdim[2])-inset - } - rect(sort(rep((1:xdim[2])-1,xdim[1]))+inset,y0, - sort(rep(1:xdim[2],xdim[1]))-inset,y1, - col=cellcolors,border=border) - if(show.values) { - if(yrev) texty<-rep(seq(xdim[1]-0.5,0,by=-1),xdim[2]) - else texty<-rep(seq(0.5,xdim[1]-0.5,by=1),xdim[2]) - text(sort(rep((1:xdim[2])-0.5,xdim[1])), texty, - formatC(round(x,show.values),format="f",digits=show.values), - col=vcol,cex=vcex) - } - } - naxs<-which(is.na(x)) - xy<-par("usr") - plot.din<-par("din") - plot.pin<-par("pin") - bottom.gap<-(xy[3]-xy[4])*(plot.din[2]-plot.pin[2])/(2*plot.pin[2]) - grx1<-xy[1] - gry1<-bottom.gap*0.95 - grx2<-xy[1]+(xy[2]-xy[1])/4 - gry2<-bottom.gap*0.8 - if(length(cellcolors) > 1) { - colmat<-col2rgb(c(cellcolors[which.min(x)],cellcolors[which.max(x)])) - cs1<-colmat[1,]/255 - cs2<-colmat[2,]/255 - cs3<-colmat[3,]/255 - color.spec<-"rgb" - } - rect.col<-color.scale(1:nslices,cs1,cs2,cs3,color.spec=color.spec) - if(show.legend) - color.legend(grx1,gry1,grx2,gry2,round(range(x,na.rm=TRUE),show.legend), - rect.col=rect.col) - par(oldpar) - } - else cat("x must be a data frame or matrix\n") -} diff --git a/R/corner.label.R b/R/corner.label.R deleted file mode 100755 index e1cad20..0000000 --- a/R/corner.label.R +++ /dev/null @@ -1,22 +0,0 @@ -corner.label<-function(label=NULL,x=-1,y=1,xoff=NA,yoff=NA,figcorner=FALSE,...) { - - if(is.na(xoff)) xoff<-strwidth("m")/2 - if(is.na(yoff)) yoff<-strheight("m")/2 - par.usr<-par("usr") - xpos<-par.usr[(3+x)/2] - ypos<-par.usr[(3+y)/2+2] - if(figcorner) { - par.pin<-par("pin") - xplotrange<-par.usr[2]-par.usr[1] - yplotrange<-par.usr[4]-par.usr[3] - par.mai<-par("mai") - xmar<-xplotrange*par.mai[3+x]/par.pin[1] - ymar<-yplotrange*par.mai[2+y]/par.pin[2] - xpos<-xpos+x*xmar - ypos<-ypos+y*ymar - } - if(!is.null(label)) { - text(xpos-x*xoff,ypos-y*yoff,label,adj=c((1+x)/2,(1+y)/2),xpd=TRUE,...) - } - return(list(x=xpos,y=ypos)) -} diff --git a/R/count.overplot.R b/R/count.overplot.R deleted file mode 100644 index 6d0eb18..0000000 --- a/R/count.overplot.R +++ /dev/null @@ -1,60 +0,0 @@ -count.overplot<-function(x,y,tol=NULL,col=par("fg"),pch="1",...) { - if(missing(x)) stop("Usage: count.overplot(x,y,tol=NULL,...)") - dimx<-dim(x) - if(missing(y)) { - if(is.list(x) && names(x)[1] == "x") { - y<-x[[2]] - x<-x[[1]] - } - else { - if(!is.null(dimx)) { - y<-x[,2] - x<-x[,1] - } - } - } - if(any(is.na(x) | is.na(y))) { - indices<-!is.na(x) & !is.na(y) - x<-x[indices] - y<-y[indices] - } - xlim<-range(x) - ylim<-range(y) - xlen<-length(x) - if(xlen != length(y)) stop("x and y must be the same length.") - if(is.null(tol)) { - if(dev.cur() == 1 ) plot(x,y,type="n",axes=FALSE,xlab="",ylab="") - tol<-c(strwidth("o")/2,strheight("o")/2) - } - else { - if (length(tol) == 1) tol <- rep(tol,2) - } - if(length(col) < xlen) col<-rep(col,xlen) - if(length(pch) < xlen) pch<-rep(pch,xlen) - flags<-1:xlen - xsep<-ysep<-xdup<-ydup<-xydup<-sepcol<-seppch<-rep(0,xlen) - nsep<-ndup<-0 - for(i in 1:xlen) { - if(!is.na(flags[i])) { - dups<-abs(x - x[i]) <= tol[1] & abs(y - y[i]) <= tol[2] - ndups<-sum(dups) - if(ndups > 1) { - ndup<-ndup + 1 - xydup[ndup]<-ndups - xdup[ndup]<-x[i] - ydup[ndup]<-y[i] - } - else { - nsep<-nsep + 1 - xsep[nsep]<-x[i] - ysep[nsep]<-y[i] - sepcol[nsep]<-col[i] - seppch[nsep]<-pch[i] - } - } - flags[dups]<-NA - } - plot(xsep[1:nsep],ysep[1:nsep],xlim=xlim,ylim=ylim, - col=sepcol[1:nsep],pch=seppch[1:nsep],...) - text(xdup[1:ndup],ydup[1:ndup],xydup[1:ndup],...) -} diff --git a/R/cylindrect.R b/R/cylindrect.R deleted file mode 100644 index 3c9cc7d..0000000 --- a/R/cylindrect.R +++ /dev/null @@ -1,16 +0,0 @@ -cylindrect<-function(xleft,ybottom,xright,ytop,col,border=NA,gradient="x", - nslices=50) { - - rgbval<-col2rgb(col)/255 - maxrgb<-max(rgbval) - cols<-matrix(0,nrow=3,ncol=6) - for(i in 1:3) { - if(rgbval[i] == maxrgb) delta<-1-rgbval[i] - else delta<-(1-0.2*(maxrgb-rgbval[i])/sum(maxrgb-rgbval))-rgbval[i] - cols[i,]<-c(rgbval[i]+0.3*delta,rgbval[i]+0.6*delta,rgbval[i]+0.9*delta, - rgbval[i]+0.6*delta,rgbval[i]+0.3*delta,rgbval[i]) - } - gradient.rect(xleft,ybottom,xright,ytop,cols[1,],cols[2,],cols[3,], - gradient=gradient,nslices=nslices,border=border) - invisible(cols) -} diff --git a/R/dendroPlot.R b/R/dendroPlot.R deleted file mode 100644 index 9c66b73..0000000 --- a/R/dendroPlot.R +++ /dev/null @@ -1,49 +0,0 @@ -dendroPlot<-function(x,breaks=list(10,10,10),pch=1,col=par("fg"),cex=1,nudge=NA, - setlabels=NA,...) { - - plot(c(0.5,length(x)+0.5),range(unlist(sapply(x,as.numeric))), - type="n",xaxt="n",...) - lenx<-length(x) - if(is.na(setlabels[1])) setlabels<-paste("Group",1:lenx) - axis(1,at=1:lenx,labels=setlabels) - if(is.na(nudge[1])) nudge<-strwidth("o") - if(length(pch) < lenx) pch<-rep(pch,length.out=lenx) - if(length(col) < lenx) col<-rep(col,length.out=lenx) - for(list_element in 1:length(x)) { - if(is.character(x[[list_element]])) - x[[list_element]]<-factor(x[[list_element]]) - if(is.factor(x[[list_element]])) nbins<-length(levels(x[[list_element]])) - else { - xbreaks<-cut(x[[list_element]],breaks=breaks[[list_element]]) - nbins<-length(levels(xbreaks)) - } - for(bin in 1:nbins) { - if(is.factor(x[[list_element]])) { - thisbin<-which(as.numeric(x[[list_element]])==bin) - npoints<-length(thisbin) - } - else { - thisbin<-which(as.numeric(xbreaks)==bin) - npoints<-length(thisbin) - } - if(npoints) { - if(npoints==1) offsetx<-offsety<-0 - else { - offsetx<-(c(0,trunc(seq(1,npoints/2,by=0.5)))*nudge[1])[1:npoints] - # only apply the vertical nudge for factors - if(length(nudge) > 1 && is.factor(x[[list_element]])) - offsety<-c(0,rep(c(nudge[2],nudge[2],-nudge[2],-nudge[2]), - length.out=npoints-1)) - else offsety<-rep(0,length(offsetx)) - } - if(length(offsetx) > 3 ) - offsetx[seq(2,length(offsetx),by=2)]<- - -offsetx[seq(2,length(offsetx),by=2)] - else if(length(offsetx) == 3 ) offsetx[2]<--offsetx[2] - points(list_element+offsetx, - sort(as.numeric(x[[list_element]][thisbin]))+offsety, - pch=pch[list_element],col=col[list_element]) - } - } - } -} diff --git a/R/densityGrid.R b/R/densityGrid.R deleted file mode 100644 index 4d1be31..0000000 --- a/R/densityGrid.R +++ /dev/null @@ -1,99 +0,0 @@ -# incoming data frame must be latitude, longitude and optionally intensity -# as individual vectors or a list or data frame containing these -makeDensityMatrix<-function(x,y,z=NULL,nx=100,ny=50,zfun=c("mean","sum"), - xlim=c(-180,180),ylim=c(-90,90),geocoord=TRUE) { - - if(is.list(x)) { - y<-x[[1]] - # if there is a third column, it's intensity - if(length(x) > 2) z<-x[[3]] - x<-x[[2]] - } - xbreaks<-seq(xlim[1],xlim[2],length.out=nx+1) - ybreaks<-seq(ylim[1],ylim[2],length.out=ny+1) - xcells<-as.numeric(cut(x,xbreaks,include.lowest=TRUE)) - # reverse the y (latitude) limits as the matrix displays from the top down - ycells<-(ny+1)-as.numeric(cut(y,ybreaks,include.lowest=TRUE)) - # discard any NA values resulting from observations outside the lat/lon limits - notNA<-!is.na(xcells) & !is.na(ycells) - xcells<-xcells[notNA] - ycells<-ycells[notNA] - # need two matrices, one for counts, one for intensities - densmat<-matrix(0,nrow=ny,ncol=nx) - # midpoints of the y (latitude) cells to correct for shrinkage of area - # abs is needed to prevent negative secants in southern latitudes - if(geocoord) ymult<-1/cos(pi*abs(ybreaks[1:ny]+ybreaks[1:ny+1])/360) - else ymult<-rep(1,ny) - # equivalent to "table" except that it preserves zero cell counts - for(i in 1:ny) densmat[i,]<-tabulate(xcells[ycells==i],nx)*ymult[i] - if(is.null(z)) { - cat("Range of density (>0) -",range(densmat[densmat > 0]),"\n") - return(densmat) - } else { - intensmat<-matrix(0,nrow=ny,ncol=nx) - # accumulates the 'z' values in the appropriate grid cells - for(i in 1:length(xcells)) - intensmat[ycells[i],xcells[i]]<-intensmat[ycells[i],xcells[i]]+z[i] - # calculate the mean intensity of all non-zero density cells - if(zfun[1] == "mean") - intensmat[densmat > 0]<-intensmat[densmat > 0]/densmat[densmat > 0] - cat("Range of density (>0) -",range(densmat[densmat > 0]),"\n") - cat("Range of intensity (>0) -",range(intensmat[intensmat > 0]),"\n") - return(list(densmat,intensmat)) - } -} - -# x is either a matrix of cell frequencies or a list containing matrices of -# cell frequencies and cell intensities -densityGrid<-function(x,z=NULL,xrange=NA,zrange=NA,range.cex=c(1,10), - xlim=c(-180,180),ylim=c(-90,90),red=c(0,1),green=c(0,1),blue=c(0,1),alpha=1, - pch=".",geocoord=TRUE) { - - # if x is a list of two matrices, the second will be intensity values - if(is.list(x)) { - z<-x[[2]] - if(is.na(zrange[1])) { - zrange<-pretty(range(z[z>0])) - zrange<-zrange[c(1,length(zrange))] - } - x<-x[[1]] - } - if(is.na(xrange[1])) { - xrange<-pretty(range(x[x>0])) - xrange<-xrange[c(1,length(xrange))] - } - # get the dimensions of the matrix x - dimx<-dim(x) - # calculate the half grid increments in user units on the plot - posinc1<-0.5*diff(ylim)/dimx[1] - posinc2<-0.5*diff(xlim)/dimx[2] - # calculate the positions of the centers of the cells - xpos<-rep((seq(xlim[1],xlim[2],length.out=dimx[2]+1)-posinc2)[-1],each=dimx[1]) - ypos<-rep((seq(ylim[2],ylim[1],length.out=dimx[1]+1)+posinc1)[-1],dimx[2]) - # get the order of ascending counts in the matrix - m2v<-order(x) - if(is.null(z)) { - # calculate the expansion for the symbols - areas proportional to counts - if(length(range.cex) > 1) cexs<-rescale(x,range.cex) - else cexs<-rep(range.cex[1],dimx[1]) - # color repeats cell count - cols<-x - cols[x>0]<-color.scale(x[x>0],cs1=red,cs2=green,cs3=blue,alpha=alpha, - xrange=xrange) - } else { - # areas proportional to cell count - if(length(range.cex) > 1) { - cexs<-x - cexs[x>0]<-rescale(x[x>0],range.cex) - } - else cexs<-rep(range.cex[1],dimx[1]) - # color is cell intensity - cols<-z - cols[x>0]<-color.scale(z[x>0],cs1=red,cs2=green,cs3=blue,alpha=alpha, - xrange=zrange) - } - # display the points - don't display anything in cells with zero counts - for(i in m2v) { - if(x[i] > 0) points(xpos[i],ypos[i],pch=pch,cex=cexs[i],col=cols[i]) - } -} diff --git a/R/diamondplot.R b/R/diamondplot.R deleted file mode 100644 index 772a9ba..0000000 --- a/R/diamondplot.R +++ /dev/null @@ -1,85 +0,0 @@ -diamondplot<-function(x, bg=gray(0.6), col=rainbow,name="", ...) { - - if(!is.data.frame(x)) stop("Argument has to be a data frame") - - ## read original graphical parms - opar<-par(no.readonly = TRUE) - - ## set background - par(bg=bg) - - prop<-0.8 - scale<-5 - - ## define aux. functions - - ## degrees to radiants - deg2rad<-function(alfa) { - (alfa*pi)/180 - } - - ## normalize data w.r.t. maximum - normalizza<-function(x){ - x/max(x) - } - - ## find points' coordinates - coord<-function(x, prop=17) { - n<-length(x) - alfa<-rep(NA,n) - for (i in 1:n) { - alfa[i]<-360/n*i - } - c.x<-sin(deg2rad(alfa))*x*prop - c.y<-cos(deg2rad(alfa))*x*prop - list(x=c.x,y=c.y) - } - - ## plot n segments originating from the origin(!) - segmenti<-function(n, prop=1, labels=NULL,scale=5) { - plot(0,0,axes=FALSE,xlab="",ylab="",main=name,...) - for(i in 1:n) { - alfa<-360/n*i - x1<-c(0,sin(deg2rad(alfa))*prop) - y1<-c(0,cos(deg2rad(alfa))*prop) - polygon(x1,y1) - text(sin(deg2rad(alfa)),cos(deg2rad(alfa)),labels[i],cex=0.8) - } - for (i in 1:n) { - alfa<-360/n*i - for( j in 1:scale) { - xa<-(sin(deg2rad(alfa))*(1/scale)*j*prop) - ya<-(cos(deg2rad(alfa))*(1/scale)*j*prop) - - points(xa,ya,pch=19) - et<-round((1/scale)*j*17) - text(sin(deg2rad(0))+0.1,cos(deg2rad(0))*(1/scale)*j*prop,et,cex=0.8) - } - - } - } - - n<-dim(x)[[1]] - - k<-dim(x)[[2]] - - segmenti(n, prop=prop, labels=rownames(x)) - - for (j in 1:k) { - polygon(coord(normalizza(x[,j]), prop=prop), lty=j, border=col(k)[j]) - } - - legend(-1.05,1.05,legend=dimnames(x)[[2]],lty=1:k,col=col(k),cex=0.8) - - ## ripristinate original graph parms - par(opar) -} - - - - - - - - - diff --git a/R/dispersion.R b/R/dispersion.R deleted file mode 100755 index 173d9da..0000000 --- a/R/dispersion.R +++ /dev/null @@ -1,93 +0,0 @@ -dispersion<-function(x,y,ulim,llim=ulim,intervals=TRUE, - arrow.cap=0.01,arrow.gap=NA,type="a",fill=NA,lty=NA,pch=NA, - border=NA,col=par("fg"),display.na=TRUE,...) { - - if(is.list(x) && length(x[[1]]) == length(x[[2]])) { - y <- x$y - x <- x$x - } - if(missing(y) && !missing(x)) { - y <- x - x <- 1:length(x) - } - if(intervals) { - llim <- y - llim - ulim <- y + ulim - } - plotlim <- par("usr") - npoints <- length(x) - if(is.na(arrow.gap)) arrow.gap <- strheight("O")/1.5 - if(length(col) < npoints) { - if(is.matrix(x) && length(col) == dim(x)[2]) - col<-rep(col,each=dim(x)[1]) - else col <- rep(col, npoints) - } - for(i in 1:npoints) { - if(toupper(type) == "A") { - if(!is.na(llim[i])) { - if(arrow.gap >= (y[i] - llim[i]) * 0.9) { - caplen <- arrow.cap * diff(par("usr")[1:2]) - x0 <- x[i] - caplen - x1 <- x[i] + caplen - y0 <- y1 <- llim[i] - segments(x0, y0, x1, y1, col = col[i], ...) - } - else { - caplen <- arrow.cap * par("pin")[1] - x0 <- x1 <- x[i] - y0 <- y[i] - arrow.gap - y1 <- llim[i] - arrows(x0,y0,x1,y1,length=caplen,angle=90,col=col[i],...) - } - } - else { - if(display.na) { - x0 <- x1 <- x[i] - y0 <- y[i] - arrow.gap - y1 <- plotlim[3] - segments(x0, y0, x1, y1, col = col[i], ...) - } - } - if(!is.na(ulim[i])) { - if(arrow.gap >= (ulim[i] - y[i]) * 0.9) { - caplen <- arrow.cap * diff(par("usr")[1:2]) - x0 <- x[i] - caplen - x1 <- x[i] + caplen - y0 <- y1 <- ulim[i] - segments(x0, y0, x1, y1, col = col[i], ...) - } - else { - caplen <- arrow.cap * par("pin")[1] - x0 <- x1 <- x[i] - y0 <- y[i] + arrow.gap - y1 <- ulim[i] - arrows(x0,y0,x1,y1,length=caplen,angle=90,col=col[i],...) - } - } - else { - if(display.na) { - x0 <- x1 <- x[i] - y0 <- y[i] + arrow.gap - y1 <- plotlim[4] - segments(x0, y0, x1, y1, col = col[i], ...) - } - } - } - } - if(toupper(type) == "L") { - if(!is.na(fill)) { - polygon(c(x,rev(x)),c(ulim,rev(llim)),col=fill,border = NA) - if(!is.na(pch)) { - if(is.na(lty)) points(x, y, pch = pch) - else lines(x, y, lty = lty, pch = pch, type = "b") - } - else { - if(!is.na(lty)) lines(x, y, lty = lty) - } - } - if(!is.na(border)) { - lines(x, ulim, lty = border, ...) - lines(x, llim, lty = border, ...) - } - } -} diff --git a/R/display.overplot.R b/R/display.overplot.R deleted file mode 100644 index 33fe46a..0000000 --- a/R/display.overplot.R +++ /dev/null @@ -1,76 +0,0 @@ -find_overplots<-function(x,y,tol) { - xlen<-length(x) - flags<-1:xlen - xsep<-ysep<-xdup<-ydup<-xydup<-rep(NA,xlen) - nsep<-ndup<-0 - for(i in 1:xlen) { - if(!is.na(flags[i])) { - dups<-abs(x - x[i]) <= tol[1] & abs(y - y[i]) <= tol[2] - ndups<-sum(dups,na.rm=TRUE) - if(ndups > 1) { - ndup<-ndup + 1 - xydup[ndup]<-ndups - xdup[ndup]<-x[i] - ydup[ndup]<-y[i] - } - else { - nsep<-nsep + 1 - xsep[nsep]<-x[i] - ysep[nsep]<-y[i] - } - } - flags[dups]<-NA - } - return(list(xsep=xsep,ysep=ysep,xdup=xdup,ydup=ydup,xydup=xydup)) -} - -display.overplots<-function(x,y,tol=NULL,how=c("count","cluster","size"), - xlim=NULL,ylim=NULL,col=rep(par("fg"),2),pch=c("1",1),spc=NULL,...) { - - if(missing(x)) stop("display.overplots must have xy coordinates") - dimx<-dim(x) - if(missing(y)) { - if(is.list(x) && names(x)[1] == "x") { - y<-x[[2]] - x<-x[[1]] - } - else { - if(!is.null(dimx)) { - y<-x[,2] - x<-x[,1] - } - } - } - if(any(is.na(x) | is.na(y))) { - indices<-!is.na(x) & !is.na(y) - x<-x[indices] - y<-y[indices] - } - if(is.null(xlim)) xlim<-range(x) - if(is.null(ylim)) ylim<-range(y) - xlen<-length(x) - if(xlen != length(y)) stop("x and y must be the same length.") - plot(x,y,type="n",axes=FALSE,xlab="",ylab="") - xylim<-par("usr") - if(is.null(tol)) tol<-c(diff(xylim[1:2]/100),diff(xylim[3:4]/100)) - else if(length(tol) == 1) tol <- rep(tol,2) - if(length(col) < xlen) col<-rep(col,xlen) - if(length(pch) < xlen) pch<-rep(pch,xlen) - if(is.null(spc)) spc<-c(diff(xylim[1:2])/100,diff(xylim[3:4]/100)) - xy<-find_overplots(x,y,tol) - plot(xy$xsep,xy$ysep,xlim=xlim,ylim=ylim,col=col[1],pch=pch[1],...) - if(how[1] == "count") text(xy$xdup,xy$ydup,xy$xydup,col=col[2],...) - if(how[1] == "cluster") { - xshifts<-c(0,-spc[1],spc[1],0,0,-spc[1],spc[1],-spc[1],spc[1]) - yshifts<-c(0,0,0,-spc[2],spc[2],-spc[2],spc[2],spc[2],-spc[2]) - for(dup in 1:sum(!is.na(xy$xdup))) { - for(ndups in 1:min(c(xy$xydup[dup],9))) { - points(xy$xdup[dup]+xshifts[ndups],xy$ydup[dup]+yshifts[ndups], - pch=pch[2],col=col[2],...) - } - if(xy$xydup[dup] > 9) points(xy$xdup[dup],xy$ydup[dup],pch=4,cex=2) - } - } - if(how[1] == "size") - points(xy$xdup,xy$ydup,pch=pch[2],col=col[2],cex=sqrt(xy$xydup)) -} diff --git a/R/dotplot.mtb.R b/R/dotplot.mtb.R deleted file mode 100644 index de4c1d9..0000000 --- a/R/dotplot.mtb.R +++ /dev/null @@ -1,60 +0,0 @@ -dotplot.mtb <- function (x, xlim = NULL, main = NULL, xlab = NULL, ylab=NULL, - pch = 19, hist=FALSE, yaxis=FALSE, mtbstyle=TRUE) -{ - if (is.null(xlim)) - xlim <- range(pretty(range(x,na.rm=TRUE))) - if (is.null(main)) - main <- "" - if (is.null(xlab)) - xlab <- "" - if (is.null(ylab)) - ylab <- "" - x <- sort(x) - w <- table(x) - if(hist) { - x <- as.numeric(names(w)) - w <- unname(unclass(w)) - } else w <- unlist(lapply(w, function(n) { 1:n })) - mw <- max(w) - Nmax <- floor(par()$pin[2]/strheight("o",units="inches")) - top <- if(mtbstyle) Nmax/2 else Nmax - if(mw <= top & !hist) { - plot(range(x, na.rm = TRUE), c(0, 1), type = "n", xlab = "", - ylab = "", xlim = xlim, main = main, axes = FALSE) - yr <- if(mtbstyle) c(-Nmax/2,Nmax/2) else c(0,Nmax) - par(usr = c(par()$usr[1:2], yr[1], yr[2])) - y <- strheight("o") * w - points(x, y, pch = pch) - axis(side = 1, pos = 0) - if(xlab!="") axis(side=1,at=0.5*sum(xlim),pos=-2,labels=xlab,tick=FALSE) - if(ylab!="") axis(side=2,at=0.5*yr[2],line=2,labels=ylab,tick=FALSE) - if(yaxis) { - b <- max(1,ceiling(top/10)) - ll <- 1+floor(top/b) - at <- seq(0,by=b,length=ll) - axis(side = 2,at=at) - } - } else { - nt <- mw+1 - yr <- if(mtbstyle) c(-nt,nt) else c(0,nt) - if(hist) plot(x,w,type="h",xlab="",ylab="",xlim=xlim, - ylim=yr,main=main,axes=FALSE) - else plot(x,w,pch=pch,xlab="",ylab="",xlim=xlim, - ylim=yr,main=main,axes=FALSE) - pos <- if(mtbstyle) -0.02*mw else 0 - axis(side = 1,pos = pos) - if(mtbstyle) { - if(xlab!="") axis(side=1,at=0.5*sum(xlim),pos=-2,labels=xlab,tick=FALSE) - if(ylab!="") axis(side=2,at=0.5*yr[2],line=2,labels=ylab,tick=FALSE) - } else { - if(xlab!="") title(xlab=xlab) - if(ylab!="") title(ylab=ylab) - } - if(yaxis) { - b <- max(1,ceiling(nt/10)) - ll <- 1+floor(nt/b) - at <- seq(0,by=b,length=ll) - axis(side = 2,at=at) - } - } -} diff --git a/R/draw.arc.R b/R/draw.arc.R deleted file mode 100755 index de3b360..0000000 --- a/R/draw.arc.R +++ /dev/null @@ -1,47 +0,0 @@ -draw.arc <- function(x=1, y=NULL, radius=1, angle1=deg1*pi/180, - angle2=deg2*pi/180, deg1=0, deg2=45, n=0.05, col=NA, lwd=NA, ...) { - - if (all(is.na(col))) - col <- par("col") - if (all(is.na(lwd))) - lwd <- par("lwd") - xylim<-par("usr") - ymult <- getYmult() - devunits <- dev.size("px") - draw.arc.0 <- function(x, y, radius, angle1, angle2, n, col, lwd, ...) - { - delta.angle <- (angle2 - angle1) - if (n != as.integer(n)) - n <- as.integer(1+delta.angle/n) # Divide total angle by desired segment angle to get number of segments - delta.angle <- delta.angle/n - angleS <- angle1 + seq(0, length=n) * delta.angle - angleE <- c(angleS[-1], angle2) - # Move segment starts/ends so that segments overlap enough to make wide segments - # not have an open slice in them. The slice is open by delta.angle*half.lwd.user. - # That subtends an angle of that/(radius+half.lwd.user) radians, from center. - # Move segment endpoints by half of that, so together they equal that. - if (n > 1) - { - half.lwd.user <- (lwd/2)*(xylim[2]-xylim[1])/devunits[1] - adj.angle = delta.angle*half.lwd.user/(2*(radius+half.lwd.user)) - angleS[2:n] = angleS[2:n] - adj.angle - angleE[1:(n-1)] = angleE[1:(n-1)] + adj.angle - } - p1x <- x + radius * cos(angleS) - p1y <- y + radius * sin(angleS) * ymult - p2x <- x + radius * cos(angleE) - p2y <- y + radius * sin(angleE) * ymult - segments(p1x, p1y, p2x, p2y, col=col, lwd=lwd, ...) - } - xy <- xy.coords(x, y) - x <- xy$x - y <- xy$y - a1 <- pmin(angle1, angle2) - a2 <- pmax(angle1, angle2) - angle1 <- a1 - angle2 <- a2 - args <- data.frame(x, y, radius, angle1, angle2, n, col, lwd, stringsAsFactors=FALSE) - for (i in 1:nrow(args)) - do.call("draw.arc.0", c(args[i, ], ...)) - invisible(args) - } diff --git a/R/draw.circle.R b/R/draw.circle.R deleted file mode 100644 index c3f8802..0000000 --- a/R/draw.circle.R +++ /dev/null @@ -1,18 +0,0 @@ -draw.circle<-function(x,y,radius,nv=100,border=NULL,col=NA, - lty=1,density=NULL,angle=45,lwd = 1) { - - xylim<-par("usr") - plotdim<-par("pin") - ymult<-getYmult() - angle.inc<-2*pi/nv - angles<-seq(0,2*pi-angle.inc,by=angle.inc) - if(length(col)= 1 || length(x[[1]]) == 1)) - rect(start, 0, end, unlist(x[[1]][[1]]), col = barcol) - if(showlabels && !is.null(x[[1]][[1]]) && showall >= 1) { - if(!is.null(barlabels)) barlabel <- barlabels[[1]] - else barlabel <- names(x[[1]][[1]]) - labely <- -lineht * length(x[[1]]) - if (nchar(barlabels[[1]][1])) { - par(xpd = TRUE) - segments(c(start, end, start), c(0, 0, labely), c(start, - end, end), rep(labely, 3)) - boxed.labels((start + end)/2, labely, barlabel, ypad = 1.4, - bg = ifelse(is.na(barcol), "white", barcol), cex = labelcex) - par(xpd = FALSE) - } - } - if (errbars && length(x[[1]]) == 1) - dispersion((start + end)/2, x[[1]][[1]], x[[2]][[1]], - x[[3]][[1]], intervals = intervals, arrow.cap = arrow.cap) - for (xcomp in 1:length(x)) x[[xcomp]][[1]] <- NULL - if (length(x[[1]])) { - nvalues <- length(unlist(x[[1]][[1]])) - if (is.list(col)) col[[1]] <- NULL - if (!is.null(barlabels) && length(barlabels) > 1) barlabels[[1]] <- NULL - barspace <- (end - start) * shrink - if(Nwidths) barwidth<-((end-start)-barspace)*x[[4]][[1]]/sum(x[[4]][[1]]) - else barwidth <- rep(((end-start)-barspace)/nvalues,nvalues) - barspace <- barspace/(nvalues + 1) - for (nextval in 1:nvalues) { - newx <- list() - for (xcomp in 1:length(x)) - newx[[xcomp]] <- lapply(x[[xcomp]], sliceArray, nextval) - newbarlabels <- barlabels - start <- start + barspace - newcol <- col - if(is.list(col)) newcol[[1]] <- col[[1]][nextval] - if(!is.null(barlabels)) newbarlabels[[1]]<-barlabels[[1]][nextval] - drawNestedBars(newx, start, start + barwidth[nextval], - shrink = shrink, errbars = errbars, col = newcol, - labelcex = labelcex, lineht = lineht, showall = showall + 1, - Nwidths = Nwidths, barlabels = newbarlabels, - showlabels = showlabels, arrow.cap = arrow.cap,intervals = intervals) - start <- start + barwidth[nextval] - } - } -} diff --git a/R/ehplot.R b/R/ehplot.R deleted file mode 100644 index 5af488e..0000000 --- a/R/ehplot.R +++ /dev/null @@ -1,52 +0,0 @@ -ehplot <- -function (data, groups, intervals = 50, offset = 0.1, log = FALSE, - median = TRUE, box = FALSE, boxborder = "grey50", xlab = "groups", - ylab = "values", col = "black", add = FALSE, sort = TRUE, - ...) -{ - stopifnot(length(data) == length(groups), is.numeric(data), - intervals > 0, offset < 0.4) - grps <- split(data, groups, drop = TRUE) - if (sort) { - grouporder <- 1:length(grps) - } - else { - grouporder <- rank(unique(groups)) - } - dr <- range(data, finite = TRUE) - if (log) { - seps <- dr[1] * exp((0:intervals) * log(dr[2]/dr[1])/intervals) - } - else { - seps <- (0:intervals) * (diff(dr)/intervals) + dr[1] - } - inc <- rep(1:(0.4/offset), each = 2) - xshift <- list(even = c((inc - 0.5) * offset * (-1)^(1:length(inc))), - odd = c(0, inc * offset * (-1)^(1:length(inc)))) - pnts_a <- list() - for (i in 1:length(grps)) { - tgrp <- grps[[grouporder[i]]] - histo <- hist(tgrp, breaks = seps, plot = FALSE)$counts - ixof <- unlist(sapply(histo, function(j) { - rep(xshift[[j%%2 + 1]], length.out = j) - })) - pnts_a[[i]] <- i + ixof[rank(tgrp, ties.method = "first")] - if (anyDuplicated(na.omit(cbind(tgrp, pnts_a[[i]])))) - warning("Some points are overplotted in group ", - names(grps)[grouporder[i]], ". Please consider using a lower offset-value.") - } - if (!add) { - plot(data, xlim = c(0.5, length(grps) + 0.5), xaxt = "n", - type = "n", xlab = xlab, ylab = ylab, log = ifelse(log, - "y", ""), ...) - axis(1, at = grouporder, labels = names(grps), ...) - } - if (box) - boxplot(data ~ groups, border = boxborder, at = grouporder, - add = TRUE, axes = FALSE, outline = FALSE) - points(unsplit(pnts_a[grouporder], groups, drop = TRUE), - data, col = col, ...) - if (median) - lines(rep(grouporder, each = 3) + c(-0.4, 0.4, NA), rep(sapply(grps, - median, na.rm = TRUE), each = 3) + c(0, 0, NA), lwd = 3) -} diff --git a/R/election.R b/R/election.R deleted file mode 100644 index dd6b689..0000000 --- a/R/election.R +++ /dev/null @@ -1,27 +0,0 @@ -seats<-function (N, M, r0 = 2.5) { - radii <- seq(r0, 1, len = M) - counts <- numeric(M) - pts <- do.call(rbind, lapply(1:M, - function(i) { - counts[i] <<- round(N * radii[i]/sum(radii[i:M])) - theta <- seq(0, pi, len = counts[i]) - N <<- N - counts[i] - data.frame(x = radii[i] * cos(theta), y = radii[i] * - sin(theta), r = i, theta = theta) - } - ) - ) - pts <- pts[order(-pts$theta, -pts$r), ] - pts -} - -election<-function (seats, result, formula, - colours = sample(rainbow(length(counts)))) { - - result <- model.frame(formula, result) - counts <- result[, 2] - stopifnot(sum(counts) == nrow(seats)) - seats$party <- factor(rep(result[, 1], counts)) - seats$colour <- colours[as.numeric(seats$party)] - seats -} diff --git a/R/emptyspace.R b/R/emptyspace.R deleted file mode 100644 index 6f31127..0000000 --- a/R/emptyspace.R +++ /dev/null @@ -1,79 +0,0 @@ -emptyspace<-function(x,y=NULL) { - xlim<-par("usr")[1:2] - ylim<-par("usr")[3:4] - if(is.null(y)) { - if(is.list(x)) { - # trust me, I'm a list - y<-as.vector(x[[2]]) - x<-as.vector(x[[1]]) - } - else stop("both x and y values must be supplied") - } - xyna<-which(is.na(x) | is.na(y)) - if(any(xyna)) { - # get rid of any NAs - x<-x[-xyna] - y<-y[-xyna] - } - # check for negative values and offset them out - xoffset<-yoffset<-0 - if(any(x < 0)) { - xoffset<-min(x) - x<-x-xoffset - xlim<-xlim-xoffset - } - if(any(y < 0)) { - yoffset<-min(y) - y<-y-yoffset - ylim<-ylim-yoffset - } - # here begins Ray Brownrigg's code - ox<-order(x) - x<-x[ox] - y<-y[ox] - x<-c(xlim[1],x,xlim[2]) - y<-c(ylim[1],y,ylim[2]) - omaxa<-0 - halfxspan<-diff(xlim)/2 - halfyspan<-diff(ylim)/2 - # added braces here for clarity - for(i in 1:(length(x)-1)) { - for(j in (i+1):length(x)) { - x1<-x[i] - x2<-x[j] - XX<-x2 - x1 - # if(XX > halfxspan) break - yy<-c(ylim[1],y[(i+1):(j-1)],ylim[2]) - oyy<-order(yy) - yy<-yy[oyy] - dyy<-diff(yy) - # whichdyy<-(dyy <= halfyspan) & (dyy >= 0.5*XX) & (dyy <= 2*XX) - # the next line fixes the problem with very large empty spaces - whichdyy<-(dyy >= 0.5*XX) & (dyy <= 2*XX) - wy1<-yy[whichdyy] - if(length(wy1) > 0) { - wy2<-yy[(1:length(dyy))[whichdyy]+1] - k<-which.max(dyy[whichdyy]) - maxa<-(x2-x1)*(wy2[k]-wy1[k]) - if(maxa > omaxa) { - omaxa<-maxa - mx1<-x1 - mx2<-x2 - my1<-wy1[k] - my2<-wy2[k] - } - } - } - } - # if offsets were used, remove them from the final values - if(xoffset < 0) { - mx1<-mx1+xoffset - mx2<-mx2+xoffset - } - if(yoffset < 0) { - my1<-my1+yoffset - my2<-my2+yoffset - } - # return the center of the rectangle - return(list(x=(mx1+mx2)/2,y=(my1+my2)/2)) -} diff --git a/R/fan.plot.R b/R/fan.plot.R deleted file mode 100644 index 907cc1a..0000000 --- a/R/fan.plot.R +++ /dev/null @@ -1,114 +0,0 @@ -fan.plot<-function (x,edges=200,radius=1,col=NULL,align.at=NULL, - max.span=NULL,labels=NULL,labelpos=NULL,label.radius=1.2,align="left", - shrink=0.02,main="",ticks=NULL,include.sumx=FALSE,...) { - - if(!is.numeric(x) || any(is.na(x) | x <= 0)) - stop("fan.plot: x values must be positive numbers.") - nticks<-ifelse(ticks==1,sum(x),ticks) - if(include.sumx) x<-c(x,sum(x)) - xorder<-order(x,decreasing=TRUE) - oldmar<-par("mar") - # convert values into angular extents summing to 2*pi - if (align == "center") x<-pi*x/sum(x) - else x<-2*pi*x/sum(x) - # stretch or shrink the values to fit into max.span if specified - if(!is.null(max.span)) x<-x*max.span/max(x) - if(is.null(align.at)) { - if(align == "center") align.at<-pi/2 - if(align == "right") align.at<-(pi - x[xorder[1]])/2 - if(align == "left") align.at<-(pi + x[xorder[1]])/2 - } - nx<-length(x) - tempradius<-radius - if(is.null(col)) col<-rainbow(nx) - else if(length(col) < nx) col<-rep(col,length = nx) - # center should be 0,0 - if(align == "left") lowpoint<-min(sin(align.at-x)) - else lowpoint<-min(sin(align.at+x)) - if(lowpoint > 0) lowpoint<-0 - par(mar=c(5,2,1,2),xpd=TRUE) - xspan<-max(label.radius+0.012*max(nchar(labels))) - plot(0,xlim=c(-xspan,xspan),ylim=c(lowpoint,xspan), - xlab="",ylab="",type="n",axes=FALSE) - xy<-par("usr") - pinxy<-par("pin") - ymult<-(xy[4]-xy[3])/(xy[2]-xy[1])*(pinxy[1]/pinxy[2]) - if(nchar(main)) - text(0,(max(label.radius)+0.2)*ymult,main,cex=1.5,adj=c(0.5,1)) - for(i in 1:nx) { - n<-edges*x[xorder[i]]/pi - if(align == "center") - t2p<-seq(align.at-x[xorder[i]],align.at+x[xorder[i]],length=n) - if (align == "right") - t2p<-seq(align.at,align.at+x[xorder[i]],length=n) - if(align=="left") - t2p<-seq(align.at-x[xorder[i]],align.at,length=n) - xc<-c(cos(t2p)*tempradius,0) - yc<-c(sin(t2p)*tempradius*ymult,0) - polygon(xc,yc,col=col[xorder[i]],...) - tempradius<-tempradius-shrink - } - if(!is.null(ticks)) { - if(align == "left") - tickles<-seq(align.at,align.at-x[xorder[1]],by=-sum(x)/ticks) - if(align == "right") - tickles<-seq(align.at,align.at+x[xorder[1]],by=sum(x)/ticks) - if(align == "center") - tickles<-c(seq(align.at,align.at+x[xorder[1]],by=sum(x)/(2*ticks)), - seq(align.at,align.at-x[xorder[1]],by=-sum(x)/(2*ticks))) - stickout<-rep(c(0.04,rep(0.02,4),0.03,rep(0.02,4)), - length.out=length(tickles)) - xpos1<-cos(tickles) * (radius + stickout) - ypos1<-sin(tickles) * ymult * (radius + stickout) - xpos2<-cos(tickles) * radius - ypos2<-sin(tickles) * ymult * radius - segments(xpos1, ypos1, xpos2, ypos2) - } - if(!is.null(labels)) { - par(xpd=TRUE) - if(align == "center") { - labelside<-rep(c(1, -1),length.out=nx-1) - lpos<-c(align.at+labelside*(x[xorder[1:(nx-1)]]+ - (x[xorder[2:nx]]-x[xorder[1:(nx-1)]])/2),align.at) - } - if(align == "right") { - lpos<-align.at+(x[xorder]-c((x[xorder[1:(nx-1)]]- - x[xorder[2:nx]])/2,x[xorder[nx]]/2)) - labelside<-rep(1,nx) - } - if(align == "left") { - lpos<-align.at-(x[xorder]-c((x[xorder[1:(nx-1)]]- - x[xorder[2:nx]])/2,x[xorder[nx]]/2)) - labelside<-rep(-1,nx) - } - if(is.null(labelpos)) { - labelpos<-lpos - ldiff<-abs(diff(labelpos)) - squeezers<-which(ldiff<0.15) - if(length(squeezers)) { - for(squeeze in squeezers) { - labelpos[1:squeeze]<-labelpos[1:squeeze]+ - (0.15-ldiff[squeeze]) * labelside[1:squeeze] - labelpos[(squeeze+1):nx]<-labelpos[(squeeze+1):nx]- - (0.15-ldiff[squeeze]) * labelside[(squeeze+1):nx] - } - } - } - innerend<-seq(0.98,by=-shrink,length=nx) - endpos<-lpos - if(length(label.radius) < nx) - label.radius<-rep(label.radius,length.out=nx) - xpos1<-cos(labelpos)*label.radius[xorder] - ypos1<-sin(labelpos)*ymult*label.radius[xorder] - for(i in 1:nx) - boxed.labels(xpos1[i],ypos1[i],labels[xorder[i]], - border=FALSE,xpad=0,ypad=0.1,adj=c(0.5-cos(labelpos[i])/2.5,0.5)) - xpos1<-cos(labelpos)*(label.radius[xorder]+radius)/2 - ypos1<-sin(labelpos)*ymult*(label.radius[xorder]+radius)/2 - xpos2<-cos(endpos)*radius*innerend - ypos2<-sin(endpos)*ymult*radius*innerend - segments(xpos1,ypos1,xpos2,ypos2) - } - par(mar=oldmar,xpd=FALSE) - invisible(labelpos) -} diff --git a/R/feather.plot.R b/R/feather.plot.R deleted file mode 100644 index 29da964..0000000 --- a/R/feather.plot.R +++ /dev/null @@ -1,25 +0,0 @@ -feather.plot<-function(r,theta,xpos,yref=0,use.arrows=TRUE, - col.refline="lightgray",fp.type="s",main="",xlab="",ylab="", - xlabels=NULL,...) { - - if(missing(xpos)) xpos<-1:length(theta) - # reverse the angles and start at 12 o'clock - if(fp.type == "m") theta<-5*pi/2-theta - x<-r*cos(theta) - y<-r*sin(theta) - xmult<-diff(range(xpos))/(diff(range(y))*2) - x<-x*xmult - xlim<-range(c(xpos,x+xpos)) - ylim<-range(c(y,yref)) - oldpin<-par("pin") - xdiff<-xlim[2]-xlim[1] - ydiff<-ylim[2]-ylim[1] - plot(0,xlim=xlim,ylim=ylim,type="n",main=main,xlab=xlab,ylab=ylab,axes=FALSE) - box() - if(is.null(xlabels)) axis(1) - else axis(1,at=xpos,labels=xlabels) - abline(h=yref,col=col.refline) - if(use.arrows) arrows(xpos,yref,xpos+x,y,length=0.1,...) - else segments(xpos,yref,xpos+x,y,...) - par(pin=oldpin) -} diff --git a/R/floatpie.R b/R/floatpie.R deleted file mode 100755 index 27b1e96..0000000 --- a/R/floatpie.R +++ /dev/null @@ -1,78 +0,0 @@ -# display a pie chart at an arbitrary location on an existing plot - -floating.pie<-function(xpos=0,ypos=0,x,edges=200,radius=1,col=NULL, - startpos=0,shadow=FALSE,shadow.col=c("#ffffff","#cccccc"), - explode=0,...) { - - # if no grahics device available, start one - if(is.null(dev.list)) - plot(0,xlim=c(-1.5,1.5)*radius+xpos,ylim=c(-1.5,1.5)*radius+ypos, - type="n",axes=FALSE,xlab="",ylab="") - if (!is.numeric(x)) stop("floating.pie: x values must be numeric.") - validx<-which(!is.na(x) & x > 0) - col<-col[validx] - # scale the values of x 0 to 1 - x<-c(0,cumsum(x[validx])/sum(x[validx])) - dx<-diff(x) - nx<-length(dx) - if (is.null(col)) col<-rainbow(nx) - else if(length(col) < nx) col<-rep(col,nx) - # scale the y radius so that it's a circle - xylim<-par("usr") - plotdim<-par("pin") - yradius<- - radius*(xylim[4]-xylim[3])/(xylim[2]-xylim[1])*plotdim[1]/plotdim[2] - # get the bisecting angles in radians - bc<-2*pi*(x[1:nx]+dx/2)+startpos - # don't dislay a shadow if any sectors are exploded - if(shadow && all(explode == 0)) { - xc<-c(cos(seq(0,2*pi,length=edges))*radius+xpos) - yc<-c(sin(seq(0,2*pi,length=edges))*yradius+ypos) - polygon.shadow(xc,yc,col=shadow.col) - } - if(length(explode) < nx) explode<-rep(explode,nx) - for(i in 1:nx) { - n<-max(2,floor(edges*dx[i])) - t2p<-2*pi*seq(x[i],x[i+1],length=n)+startpos - # calculate the positions of the arc plus the center - xc<-c(cos(t2p)*radius+xpos,xpos) - yc<-c(sin(t2p)*yradius+ypos,ypos) - if(explode[i]) { - xc<-xc + cos(bc[i]) * explode[i] - yc<-yc + sin(bc[i]) * explode[i] - } - polygon(xc,yc,col=col[i],...) - t2p<-2*pi*mean(x[i+0:1])+startpos - xc<-cos(t2p)*radius - yc<-sin(t2p)*radius - } - invisible(bc) -} - -# place plain or boxed labels at the specified distance from x,y on the -# radial lines specified by angles. - -pie.labels<-function(x=0,y=0,angles,labels,radius=1.05,bg="white", - border=TRUE,minangle=NA,boxed=FALSE,explode=0,...) { - - if(missing(angles) || missing(labels)) - stop("Angles and labels must be specified.") - # turn off clipping - par(xpd=TRUE) - # scale the y radius - xylim<-par("usr") - plotdim<-par("pin") - yradius<-radius*(xylim[4]-xylim[3])/(xylim[2]-xylim[1])*plotdim[1]/plotdim[2] - if(!is.na(minangle)) angles<-spreadout(angles,minangle) - xc<-cos(angles)*(radius+explode)+x - yc<-sin(angles)*(yradius+explode)+y - for(label in 1:length(labels)) { - label.adj<-c(abs(1-cos(angles[label]))/2,abs(1-sin(angles[label]))/2) - if(boxed) - boxed.labels(xc[label],yc[label],labels[label],adj=label.adj, - border=border,...) - else text(xc[label],yc[label],labels[label],adj=label.adj,...) - } - # turn clipping back on - par(xpd=FALSE) -} diff --git a/R/fullaxis.R b/R/fullaxis.R deleted file mode 100644 index 5d5d412..0000000 --- a/R/fullaxis.R +++ /dev/null @@ -1,18 +0,0 @@ -fullaxis<-function(side=1,at=NULL,labels=TRUE,line=NA,pos=NA,outer=FALSE, - font=NA,lty="solid",lwd=1,lwd.ticks=lwd,col=NULL,col.ticks=NULL, - hadj=NA,padj=NA,...) { - - xylim<-par("usr") - if(!is.na(pos)) xylim[c(3,1,4,2)[side]]<-pos - par(xpd=TRUE) - switch(side, - segments(xylim[1],xylim[3],xylim[2],xylim[3],col=col,lty=lty,lwd=lwd), - segments(xylim[1],xylim[3],xylim[1],xylim[4],col=col,lty=lty,lwd=lwd), - segments(xylim[1],xylim[4],xylim[2],xylim[4],col=col,lty=lty,lwd=lwd), - segments(xylim[2],xylim[3],xylim[2],xylim[4],col=col,lty=lty,lwd=lwd)) - par(xpd=FALSE) - axpos<-axis(side=side,at=at,labels=labels,line=line,pos=pos,outer=outer, - font=font,lty=lty,lwd=lwd,col=col,col.ticks=col.ticks, - hadj=hadj,padj=padj,...) - invisible(axpos) -} diff --git a/R/gantt.R b/R/gantt.R deleted file mode 100644 index 89157d4..0000000 --- a/R/gantt.R +++ /dev/null @@ -1,125 +0,0 @@ -get.gantt.info<-function(format="%Y/%m/%d") { - cat("Enter the label, start and finish time for each task.\n") - cat("Default format for time is year/month/day e.g. 2005/2/22\n") - cat("Enter a blank label to end.\n") - nextlabel<-"dummy" - tasklabels<-NA - taskstarts<-NA - taskends<-NA - priorities<-NA - while(nchar(nextlabel)) { - nextlabel<-readline("Task label - ") - if(nchar(nextlabel)) { - if(is.na(tasklabels[1])) tasklabels<-nextlabel - else tasklabels<-c(tasklabels,nextlabel) - nextstart<-as.POSIXct(strptime(readline("Task begins - "),format=format)) - if(is.na(taskstarts[1])) taskstarts<-nextstart - else taskstarts<-c(taskstarts,nextstart) - nextend<-nextstart-1 - while(nextend < nextstart) { - nextend<-as.POSIXct(strptime(readline("Task ends - "),format=format)) - if(nextend < nextstart) cat("Task cannot end before it starts!\n") - else { - if(is.na(taskends[1])) taskends<-nextend - else taskends<-c(taskends,nextend) - } - } - nextpriority<-0 - while (nextpriority < 1 || nextpriority > 10) { - nextpriority <- as.numeric(readline("Task priority (1-10) - ")) - if(is.na(nextpriority)) { - cat("Task priority must be a number between 1 and 10!\n") - next.priority<-0 - } - } - if(is.na(priorities[1])) priorities<-nextpriority - else priorities<-c(priorities,nextpriority) - } - } - return(list(labels=tasklabels,starts=taskstarts,ends=taskends, - priorities=priorities)) -} - -gantt.chart<-function (x=NULL,format="%Y/%m/%d",xlim=NULL, - taskcolors=NULL,priority.legend=FALSE,vgridpos=NULL,vgridlab=NULL, - vgrid.format="%Y/%m/%d",half.height=0.25,hgrid=FALSE,main="",xlab="", - cylindrical=FALSE,label.cex=1,border.col=NA,priority.label="Priorities", - priority.extremes=c("High","Low"),time.axis=3) { - - oldpar <- par("mai", "omi", "xpd", "xaxs", "yaxs") - if(is.null(x)) x<-get.gantt.info(format=format) - if(any(x$starts > x$ends)) - stop("Can't have a start date after an end date") - tasks<-unique(x$labels) - ntasks<-length(tasks) - if(is.null(x$priorities)) x$priorities<-rep(1,ntasks) - if (is.null(dev.list())) plot.new() - charheight<-strheight("M",units="inches") - oldcex<-par(cex=label.cex) - maxwidth<-max(strwidth(x$labels,units="inches")) + 0.3 - par(oldcex) - if(is.null(xlim)) xlim<-range(c(x$starts,x$ends)) - npriorities<-max(x$priorities) - if(is.null(taskcolors)) taskcolors<-barcolors<-rainbow(npriorities) - else barcolors <- taskcolors - if(length(barcolors) < ntasks) barcolors<-barcolors[x$priorities] - nlabels<-length(x$labels) - bottom.margin <- ifelse(time.axis == 3, 0.8, 1.3) - if(length(barcolors) < nlabels) - barcolors<-barcolors[as.numeric(factor(x$labels))] - par(mai=c(bottom.margin,maxwidth,charheight*4*(1+(nchar(main) > 0)),0.1)) - par(omi=c(0.1,0.1,0.1,0.1),xaxs="i",yaxs="i") - plot(range(x$starts),c(1,ntasks),xlim=xlim,ylim=c(0.5,ntasks+0.5), - main="",xlab="",ylab="",axes=FALSE,type = "n") - box() - if(nchar(main)) mtext(main,side=3,line=2.5,cex=par("cex.main"), - col=par("col.main")) - if(nchar(xlab)) mtext(xlab,1,1) - if(is.na(vgrid.format)) { - if(is.null(vgridlab)) vgridlab<-vgridpos - axis(time.axis,at=vgridpos,labels=vgridlab,padj=0) - tickpos<-vgridpos - } - else { - if(is.null(vgridpos)) - tickpos<-axis.POSIXct(3,xlim,format=vgrid.format) - else tickpos<-vgridpos - if(is.null(vgridlab) && !is.null(vgridpos)) - vgridlab<-format.POSIXct(vgridpos,vgrid.format) - if(is.null(vgridlab)) - axis.POSIXct(3,xlim,format=vgrid.format) - else axis(time.axis,at=tickpos,labels=vgridlab,padj=0) - } - topdown<-seq(ntasks,1) - axis(2,at=topdown,labels=tasks,las=2,cex.axis=label.cex) - abline(v=tickpos,col="darkgray",lty=3,lwd=2) - for(i in 1:ntasks) { - if(cylindrical) - cylindrect(x$starts[x$labels==tasks[i]],topdown[i] - - half.height,x$ends[x$labels==tasks[i]],topdown[i] + - half.height,col=barcolors[i],gradient="y") - else rect(x$starts[x$labels==tasks[i]],topdown[i] - - half.height,x$ends[x$labels==tasks[i]],topdown[i]+half.height, - col=barcolors[x$labels==tasks[i]],border=border.col) - } - if(hgrid) - abline(h=(topdown[1:(ntasks-1)]+topdown[2:ntasks])/2, - col="darkgray",lty=3,lwd=2) - if(priority.legend) { - par(xpd=TRUE) - plim<-par("usr") - plot.width<-diff(plim[1:2]) - line.height<-strheight("W") - color.legend(plim[1]+2*plot.width/5, - plim[3]-(6.5-time.axis)*line.height, - plim[1]+3*plot.width/5,plim[3]-(5.5-time.axis)*line.height, - legend=c(priority.extremes[1],rep("",length(taskcolors)-2), - priority.extremes[2]),rect.col=taskcolors) - par(xpd=NA) - text(plim[1]+plot.width/2,plim[3]-(7-time.axis)*line.height, - priority.label,adj=c(0.5,1)) - par(xpd = FALSE) - } - par(oldpar) - invisible(x) -} diff --git a/R/gap.barplot.R b/R/gap.barplot.R deleted file mode 100755 index d86960e..0000000 --- a/R/gap.barplot.R +++ /dev/null @@ -1,60 +0,0 @@ -gap.barplot<-function (y,gap,xaxlab,xtics,yaxlab,ytics,xlim=NA,ylim=NA, - xlab=NULL,ylab=NULL,horiz=FALSE,col=NULL,...) { - if (missing(y)) stop("y values required") - if(missing(xtics)) xtics <- 1:length(y) - if (missing(gap)) stop("gap must be specified") - if (is.null(ylab)) ylab <- deparse(substitute(y)) - if (is.null(col)) col <- color.gradient(c(0,1),c(0,1,0),c(1,0),length(y)) - else if(length(col) < length(y)) rep(col,length.out=length(y)) - littleones <- which(y <= gap[1]) - bigones <- which(y >= gap[2]) - valid.y<-y[!is.na(y)] - if(any(valid.y > gap[1] & valid.y < gap[2])) - warning("gap includes some values of y") - gapsize <- gap[2] - gap[1] - if(missing(xaxlab)) xaxlab <- as.character(xtics) - if(is.na(xlim[1])) xlim <- range(xtics) - if(is.na(ylim[1])) ylim <- c(min(valid.y)-gapsize,max(valid.y)-gapsize) - cat("ylim",ylim,"\n") - #if(ylim[1] < 0) ylim[1]<-0 - if(missing(ytics)) ytics <- pretty(y) - if(any(ytics<0)) ytics<-ytics[ytics >= 0] - if(missing(yaxlab)) yaxlab <- ytics - littletics <- which(ytics < gap[1]) - bigtics <- which(ytics >= gap[2]) - halfwidth <- min(diff(xtics))/2 - if(horiz) { - if(!is.null(xlab)) { - tmplab<-xlab - xlab<-ylab - ylab<-tmplab - } - plot(0,xlim=ylim,ylim=xlim,xlab=xlab,ylab=ylab,axes=FALSE,type="n",...) - plot.lim <- par("usr") - botgap<-ifelse(gap[1]<0,gap[1],ylim[1]) - box() - axis(2,at=xtics,labels=xaxlab,...) - axis(1,at=c(ytics[littletics],ytics[bigtics]-gapsize), - labels=c(yaxlab[littletics],yaxlab[bigtics]),...) - rect(botgap,xtics[y gap$top[2]) - gap$top <- rev(gap$top) - if (!is.na(gap$bottom[1])) - if (gap$bottom[1] > gap$bottom[2]) - gap$bottom <- rev(gap$bottom) - if (is.na(ylim[1])) { - bxpt <- boxplot(x, ..., range = range, plot = FALSE) - ylim <- range(c(bxpt$stats, bxpt$out)) - } - else bxpt <- boxplot(x, ..., ylim = ylim, range = range, - plot = FALSE) - bxgap <- bxpt - if (!is.na(gap$top[1])) { - bxgap$stats[bxgap$stats > gap$top[1] & bxgap$stats < - gap$top[2]] <- NA - if (any(is.na(bxgap$stats))) - stop("gap cannot include the median, interquartiles or the staples") - topdiff <- diff(gap$top) - bxgap$stats[bxgap$stats > gap$top[2]] <- bxgap$stats[bxgap$stats > - gap$top[2]] - topdiff - intopgap <- bxgap$out > gap$top[1] & bxgap$out < gap$top[2] - bxgap$out[intopgap] <- NA - abovetop <- which(bxgap$out > gap$top[2]) - bxgap$out[abovetop] <- bxgap$out[abovetop] - topdiff - rangetop <- gap$top[1] - ylim[2] <- ylim[2] - topdiff - } - else rangetop <- ylim[2] - if (!is.na(gap$bottom[1])) { - bxgap$stats[bxgap$stats > gap$bottom[1] & bxgap$stats < - gap$bottom[2]] <- NA - if (any(is.na(bxgap$stats))) - stop("gap cannot include the median, interquartiles or the staples") - bottomdiff <- diff(gap$bottom) - bxgap$stats[bxgap$stats < gap$bottom[1]] <- bxgap$stats[bxgap$stats < - gap$bottom[1]] + bottomdiff - bxgap$out[bxgap$out > gap$bottom[1] & bxgap$out < gap$bottom[2]] <- NA - belowbottom <- which(bxgap$out < gap$bottom[1]) - bxgap$out[belowbottom] <- bxgap$out[belowbottom] + bottomdiff - rangebottom <- gap$bottom[2] - ylim[1] <- ylim[1] + bottomdiff - } - else rangebottom <- ylim[1] - if (any(is.na(bxgap$out))) - warning("At least one outlier falls into a gap") - nboxes <- dim(bxgap$stats)[2] - if (is.na(xlim[1])) { - xlim <- c(0.5, nboxes + 0.5) - at <- 1:nboxes - } - bxgap$group <- at - plot(0, xlim = xlim, ylim = ylim, type = "n", axes = FALSE, - main = main,xlab=xlab, ylab=ylab) - plotlim <- par("usr") - box() - if (axes) - axis(1, labels = bxpt$names, at = at) - midticks <- pretty(c(rangebottom, rangetop)) - if (axes) - axis(2, at = midticks[midticks > rangebottom & midticks < - rangetop]) - if (is.null(width)) - width <- pars$boxwex - rect(at - width/2, bxgap$stats[2, ], at + width/2, bxgap$stats[4, - ], border = border, col = col) - if (notch) { - ymult <- getYmult() - if (is.null(col)) - boxcol <- "white" - else boxcol <- col - rect(at - width/1.95, bxgap$conf[1, ], at + width/1.95, - bxgap$conf[2, ], border = NA, col = boxcol) - insets <- (bxgap$conf[2, ] - bxgap$conf[1, ]) * pars$boxwex/ymult - median.left <- ((at - width/2) + insets) - median.right <- ((at + width/2) - insets) - segments(at - width/2, bxgap$conf[1, ], median.left, - bxgap$stats[3, ], col = border) - segments(at - width/2, bxgap$conf[2, ], median.left, - bxgap$stats[3, ], col = border) - segments(median.right, bxgap$stats[3, ], at + width/2, - bxgap$conf[1, ], col = border) - segments(median.right, bxgap$stats[3, ], at + width/2, - bxgap$conf[2, ], col = border) - } - else { - median.left <- at - width/2 - median.right <- at + width/2 - } - segments(median.left, bxgap$stats[3, ], median.right, bxgap$stats[3, - ], lwd = 2, col = border) - segments(at, bxgap$stats[1, ], at, bxgap$stats[2, ], lty = 2, - col = border) - segments(at, bxgap$stats[4, ], at, bxgap$stats[5, ], lty = 2, - col = border) - segments(at - pars$staplewex * width/2, bxgap$stats[1, ], - at + pars$staplewex * width/2, bxgap$stats[1, ], col = border) - segments(at - pars$staplewex * width/2, bxgap$stats[5, ], - at + pars$staplewex * width/2, bxgap$stats[5, ], col = border) - if (!is.na(gap$top[1])) - topadjust <- diff(gap$top) - else topadjust <- 0 - if (!is.na(gap$bottom[1])) - bottomadjust <- diff(gap$bottom) - else bottomadjust <- 0 - if (!is.null(axis.labels)) - axis(2, labels = axis.labels, at = c(axis.labels[1] + - bottomadjust, axis.labels[2] - topadjust)) - if (!is.na(gap$top[1])) - axis.break(2, gap$top[1], style = "gap") - if (!is.na(gap$bottom[1])) - axis.break(2, gap$bottom[2] - diff(plotlim[3:4]) * 0.02, - style = "gap") - points(bxpt$group,bxgap$out) - invisible(bxgap) -} diff --git a/R/gap.plot.R b/R/gap.plot.R deleted file mode 100644 index 07aa462..0000000 --- a/R/gap.plot.R +++ /dev/null @@ -1,174 +0,0 @@ -# Try to rewrite this for an arbitrary number of gaps - -# It works by modifying the x or y values so that values -# to the right of the gap are reduced appropriately. Then -# it draws the plot in one call per section, skipping values that are -# in the gap. - -gap.plot<-function(x,y,gap,gap.axis="y",bgcol="white",breakcol="black", - brw=0.02,xlim=range(x),ylim=range(y),xticlab,xtics=NA,yticlab,ytics=NA, - lty=rep(1,length(x)),col=rep(par("col"),length(x)),pch=rep(1,length(x)), - add=FALSE,stax=FALSE,style="gap",bty=par("bty"),xaxt=par("xaxt"),yaxt=par("yaxt"),...) { - - if(missing(y) && !missing(x)) { - y<-x - x<-1:length(y) - } - if(missing(gap)) stop("gap must be specified") - gapsize<-diff(gap) - xaxl<-par("xlog") - yaxl<-par("ylog") - if(gap.axis == "y") { - if(length(gap) > 3) ylim[2]<-ylim[2] - (gapsize[1] + gapsize[3]) - else ylim[2]<-ylim[2]-gapsize[1] - } - if(gap.axis == "x") { - if(length(gap) > 3) xlim[2]<-xlim[2] - (gapsize[1] + gapsize[3]) - else xlim[2]<-xlim[2]-gapsize[1] - } - rangexy <- c(range(xlim),range(ylim)) - # gapsize is the size of the single gap in data units - # For two gaps, it is 3 numbers: the size of the first - # gap, the size of the middle section, then the size of the - # second gap. - # brw is the size of the break relative to the size - # of the plot - # ygw for single gap: - xgw<-(rangexy[2]-(rangexy[1]+gapsize))*brw - ygw<-(rangexy[4]-(rangexy[3]+gapsize))*brw - if(is.na(xtics[1])) xtics<-pretty(x) - if(is.na(ytics[1])) ytics<-pretty(y) - if(missing(xticlab)) xticlab<-xtics - if(missing(yticlab)) yticlab<-ytics - if(length(col) < length(y)) col<-rep(col,length.out=length(y)) - if(gap.axis == "y") { - littleones<-which(y < gap[1]) - if(length(gap) > 3) { - middleones<-which(y >= gap[2] + ygw[1] & y < gap[3]) - bigones<-which(y >= gap[4] + ygw[1] + ygw[3]) - lostones<-sum(c(y > gap[1] & y < gap[2] + ygw[1], - y > gap[3] & y < gap[4] + ygw[1] + ygw[3])) - } - else { - middleones<-NA - bigones<-which(y >= gap[2] + ygw) - lostones<-sum(y > gap[1] & y < gap[2] + ygw) - } - if(lostones) warning("some values of y may not be displayed") - } - else { - littleones<-which(x < gap[1]) - if(length(gap) > 3) { - middleones<-which(x >= gap[2] + xgw[1] & x < gap[3]) - bigones<-which(x >= gap[4] + xgw[1] + xgw[3]) - lostones<-sum(c(x > gap[1] & x < gap[2] + xgw[1], - x > gap[3] & x < gap[4] + xgw[1] + xgw[3])) - if(missing(xlim)) xlim<-c(min(x),max(x) - (gapsize[1] + gapsize[3])) - } - else { - middleones<-NA - bigones<-which(x >= gap[2]) - lostones<-sum(x > gap[1] & x < gap[2] + xgw) - if(missing(xlim)) xlim<-c(min(x),max(x) - gapsize[1]) - } - if(lostones) warning("some values of x will not be displayed") - if(missing(ylim)) ylim<-range(y) - } - if(length(lty) < length(x)) lty<-rep(lty,length.out=length(x)) - if(length(col) < length(x)) col<-rep(col,length.out=length(x)) - if(length(pch) < length(x)) pch<-rep(pch,length.out=length(x)) - if(add) { - points(x[littleones],y[littleones],lty=lty[littleones], - col=col[littleones],pch=pch[littleones],...) - if(gap.axis == "y") { - if(length(gapsize) > 2) { - points(x[middleones],y[middleones]-gapsize[1], - lty=lty[middleones],col=col[middleones],pch=pch[middleones],...) - points(x[bigones],y[bigones] - (gapsize[1] + gapsize[3]), - lty=lty[bigones],col=col[bigones],pch=pch[bigones],...) - } - else points(x[bigones],y[bigones]-gapsize[1], - lty=lty[bigones],col=col[bigones],pch=pch[bigones],...) - } - else { - if(length(gapsize) > 2) { - points(x[middleones] - gapsize[1],y[middleones], - lty=lty[middleones],col=col[middleones],pch=pch[middleones],...) - points(x[bigones] - (gapsize[1] + gapsize[3]),y[bigones], - lty=lty[bigones],col=col[bigones],pch=pch[bigones],...) - } - else points(x[bigones]-gapsize[1],y[bigones], - lty=lty[bigones],col=col[bigones],pch=pch[bigones],...) - } - } - else { - plot(x[littleones],y[littleones],xlim=xlim,ylim=ylim,axes=FALSE, - lty=lty[littleones],col=col[littleones],pch=pch[littleones],...) - box(bty=bty) - if(gap.axis == "y") { - if(!is.na(xtics[1])) axis(1,at=xtics,labels=xticlab,xaxt=xaxt) - littletics<-which(ytics < gap[1]) - if(length(gapsize) > 2) { - middletics<-which(ytics >= gap[2]+ygw[1] & ytics <= gap[3]) - bigtics<-which(ytics >= gap[4]+ygw[1]+ygw[3]) - show.at<-c(ytics[littletics],ytics[middletics] - gapsize[1], - ytics[bigtics]-(gapsize[1] + gapsize[3])) - show.labels<-c(yticlab[littletics],yticlab[middletics],yticlab[bigtics]) - } - else { - bigtics<-which(ytics >= gap[2]) - show.at<-c(ytics[littletics],ytics[bigtics] - gapsize[1]) - show.labels<-c(yticlab[littletics],yticlab[bigtics]) - } - if(stax) { - axis(2,at=show.at,labels=rep("",length(show.labels))) - staxlab(2,at=show.at,labels=show.labels) - } - else axis(2,at=show.at,labels=show.labels) - axis.break(2,gap[1],style=style,bgcol=bgcol, - breakcol=breakcol,brw=brw) - if(length(gapsize) > 2) { - axis.break(2,gap[3]-gapsize[1],style=style,bgcol=bgcol, - breakcol=breakcol,brw=brw) - points(x[middleones],y[middleones]-gapsize[1], - lty=lty[middleones],col=col[middleones],pch=pch[middleones],...) - points(x[bigones],y[bigones]-(gapsize[1]+gapsize[3]), - lty=lty[bigones],col=col[bigones],pch=pch[bigones],...) - } - else points(x[bigones],y[bigones]-gapsize[1], - lty=lty[bigones],col=col[bigones],pch=pch[bigones],...) - } - # x gaps need to be fixed - else { - if(!is.na(ytics[1])) axis(2,at=ytics,labels=yticlab,yaxt=yaxt) - littletics<-which(xtics < gap[1]) - if(length(gapsize) > 2) { - middletics<-which(xtics >= gap[2] + xgw[1] & xtics <= gap[3]) - bigtics<-which(xtics > gap[4]+xgw[1]+xgw[3]) - show.at<-c(xtics[littletics],xtics[middletics]-gapsize[1], - xtics[bigtics]-(gapsize[1]+gapsize[3])) - show.labels<-c(xticlab[littletics],xticlab[middletics],xticlab[bigtics]) - } - else { - bigtics<-which(xtics > gap[2]+xgw) - show.at<-c(xtics[littletics],xtics[bigtics]-gapsize[1]) - show.labels<-c(xticlab[littletics],xticlab[bigtics]) - } - if(stax) { - axis(1,at=show.at,labels=rep("",length(show.labels))) - staxlab(1,at=show.at,labels=show.labels) - } - else axis(1,at=show.at,labels=show.labels) - axis.break(1,gap[1],style=style) - if(length(gapsize) > 2) { - axis.break(1,gap[3]-gapsize[1],style=style) - points(x[middleones]-gapsize[1],y[middleones], - lty=lty[middleones],col=col[middleones],pch=pch[middleones],...) - points(x[bigones]-(gapsize[1]+gapsize[3]),y[bigones], - lty=lty[bigones],col=col[bigones],pch=pch[bigones],...) - } - else points(x[bigones]-gapsize[1],y[bigones], - lty=lty[bigones],col=col[bigones],pch=pch[bigones],...) - } - } -} diff --git a/R/gap_barp.R b/R/gap_barp.R deleted file mode 100755 index 8cc5d75..0000000 --- a/R/gap_barp.R +++ /dev/null @@ -1,45 +0,0 @@ -gap_barp<-function (height,gap,width=0.4,names.arg=names(height), - col=NULL,main="",xlab="",ylab="",xlim=NULL,ylim=NULL,x=NULL, - height.at=pretty(height),height.lab=NULL,...) { - - if (missing(height)) stop("height values required") - hdim<-dim(height) - if(is.data.frame(height)) height<-as.matrix(height) - if(is.null(height.lab)) height.lab<-height.at - if(missing(gap)) stop("gap must be specified") - if(gap[1] > gap[2]) { - temp<-gap[2] - gap[2]<-gap[1] - gap[2]<-temp - } - if (length(ylab) == 0) ylab <- deparse(substitute(height)) - if (is.null(col)) { - col<-color.gradient(c(0,1),c(0,1,0),c(1,0),length(height)) - if(!is.null(dim(height))) col<-matrix(col,ncol=hdim[2]) - } - else if(length(col) < length(height)) rep(col,length.out=length(height)) - if(mean(gap) < 0) to_gap<-which(height < min(gap)) - else to_gap<-which(height > max(gap)) - if(length(to_gap) == 0) stop("no values outside gap") - if(any(height > gap[1] & height < gap[2])) { - warning("some heights within gap") - height[height > gap[1] & height < gap[2]]<-gap[2-(mean(gap) < 0)] - } - if(is.null(height.lab)) height.lab<-height.at - if(mean(gap) < 0) { - height[to_gap]<-height[to_gap] + diff(gap) - height.at[height.at < gap[1]]<-height.at[height.at < gap[1]] + diff(gap) - } - else { - height[to_gap]<-height[to_gap] - diff(gap) - height.at[height.at > gap[2]]<-height.at[height.at > gap[2]] - diff(gap) - } - if(is.null(hdim)) colnam<-names(height) - else colnam<-colnames(height) - barpinfo<-barp(height=height,names.arg=colnam,col=col, - main=main,xlab=xlab,ylab=ylab, - height.at=height.at,height.lab=height.lab, - xlim=xlim,ylim=ylim,x=x,...) - axis.break(2,gap[ifelse(mean(gap) > 0,1,2)],style="gap") - invisible(barpinfo) -} diff --git a/R/get.tablepos.R b/R/get.tablepos.R deleted file mode 100644 index 9146bf6..0000000 --- a/R/get.tablepos.R +++ /dev/null @@ -1,60 +0,0 @@ -get.tablepos<-function(x) { - plotlim<-par("usr") - tablepos<-list() - if(x == "bottomleft") { - tablepos$x<-plotlim[1] - tablepos$y<-plotlim[3] - tablepos$xjust<-0 - tablepos$yjust<-1 - } - if(x == "bottom") { - tablepos$x<-(plotlim[2]+plotlim[1])/2 - tablepos$y<-plotlim[3] - tablepos$xjust<-0.5 - tablepos$yjust<-1 - } - if(x == "bottomright") { - tablepos$x<-plotlim[2] - tablepos$y<-plotlim[3] - tablepos$xjust<-1 - tablepos$yjust<-1 - } - if(x == "left") { - tablepos$x<-plotlim[1] - tablepos$y<-(plotlim[3]+plotlim[4])/2 - tablepos$xjust<-0 - tablepos$yjust<-0.5 - } - if(x == "right") { - tablepos$x<-plotlim[2] - tablepos$y<-(plotlim[3]+plotlim[4])/2 - tablepos$xjust<-1 - tablepos$yjust<-0.5 - } - if(x == "topleft") { - tablepos$x<-plotlim[1] - tablepos$y<-plotlim[4] - tablepos$xjust<-0 - tablepos$yjust<-0 - } - if(x == "top") { - tablepos$x<-(plotlim[2]+plotlim[1])/2 - tablepos$y<-plotlim[4] - tablepos$xjust<-0.5 - tablepos$yjust<-0 - } - if(x == "topright") { - tablepos$x<-plotlim[2] - tablepos$y<-plotlim[4] - tablepos$xjust<-1 - tablepos$yjust<-0 - } - # if no recognizable position was passed, put it in the center - if(x == "center" || length(tablepos)==0) { - tablepos$x<-(plotlim[1]+plotlim[2])/2 - tablepos$y<-(plotlim[3]+plotlim[4])/2 - tablepos$xjust<-0.5 - tablepos$yjust<-0.5 - } - return(tablepos) -} diff --git a/R/getFigCtr.R b/R/getFigCtr.R deleted file mode 100644 index 891e018..0000000 --- a/R/getFigCtr.R +++ /dev/null @@ -1,12 +0,0 @@ -getFigCtr<-function(pos=c(0.5,0.5)) { - pars<-par(c("usr","mar","fin","pin")) - pxspan<-diff(pars$usr[1:2]) - fxspan<-pxspan*pars$fin[1]/pars$pin[1] - figxctr<- - pars$usr[1]-(fxspan-pxspan)*pars$mar[2]/(pars$mar[2]+pars$mar[4]) + fxspan*pos[1] - pyspan<-diff(pars$usr[3:4]) - fyspan<-pyspan*pars$fin[2]/pars$pin[2] - figyctr<- - pars$usr[1]-(fyspan-pyspan)*pars$mar[1]/(pars$mar[1]+pars$mar[3]) + fyspan*pos[2] - return(c(figxctr,figyctr)) -} diff --git a/R/getIntersectList.R b/R/getIntersectList.R deleted file mode 100644 index 25d1244..0000000 --- a/R/getIntersectList.R +++ /dev/null @@ -1,31 +0,0 @@ -getIntersectList<-function(nelem,xnames=NULL,sep="+") { -if(is.null(xnames)) xnames<-LETTERS[1:nelem] -xnamelen<-length(xnames) -if(xnamelen < nelem) { - extranames<-paste("extra",1:(nelem-xnamelen),sep=sep) - cat("Not enough names in",xnames,"adding",extranames,"\n") - xnames<-c(xnames,extranames) -} -intersectList<-vector("list",nelem+2) -total_n<-0 -for(comb in 1:nelem) { - nn<-choose(nelem,comb) - intersectList[[comb]]<-rep(0,nn) - currentnames<-names(intersectList[[comb]])<- - pasteCols(combn(xnames,comb),sep=sep) - for(intersect in 1:nn) { - cat("Number of elements in",currentnames[intersect],"- ") - current_n<-scan(nmax=1,quiet=TRUE) - intersectList[[comb]][intersect]<-current_n - total_n<-total_n+current_n - } -} -cat("Total number of elements (press Enter for ",total_n,") - ", - sep="") -intersectList[[nelem + 1]]<-scan(nmax=1,quiet=TRUE) -if(length(intersectList[[nelem+1]])==0) - intersectList[[nelem+1]]<-total_n -intersectList[[nelem+2]]<-xnames -class(intersectList) <- "intersectList" -return(intersectList) -} diff --git a/R/getMarginWidth.R b/R/getMarginWidth.R deleted file mode 100644 index 4cf4c62..0000000 --- a/R/getMarginWidth.R +++ /dev/null @@ -1,22 +0,0 @@ -getMarginWidth<-function(side=4,labels,is.legend=FALSE) { - currentmar<-par("mar") - currentpin<-par("pin")[1] - currentfin<-par("fin")[1] - currentusr<-par("usr") - if(is.legend) marwidth<-1.2*legend(0,0,labels,fill=NA,plot=FALSE)$rect$w - else marwidth<-1.1*max(strwidth(labels)) - marprop<-ifelse(side==2,currentmar[2]/(currentmar[2]+currentmar[4]), - currentmar[4]/(currentmar[2]+currentmar[4]))*(currentfin-currentpin)/currentfin - plotprop<-currentpin/currentfin - plotwidth<-currentusr[2]-currentusr[1] - marusr<-(marprop/plotprop)*plotwidth - newmar<-ifelse(side==2,currentmar[2],currentmar[4])*marwidth/marusr - cat("plotprop",plotprop,"marprop",marprop,"plotwidth", - plotwidth,"marwidth",marwidth,"\n") - marcenter<-currentusr[2]+marwidth/2 - if(marwidth>plotwidth) { - warning("figure size too small for new margin!") - newmar<-ifelse(side==2,currentmar[2],currentmar[4]) - } - return(list(newmar=newmar,marcenter=marcenter)) -} diff --git a/R/getYmult.R b/R/getYmult.R deleted file mode 100644 index 0603a0b..0000000 --- a/R/getYmult.R +++ /dev/null @@ -1,14 +0,0 @@ -getYmult<-function() { - if(dev.cur() == 1) { - warning("No graphics device open.") - ymult<-1 - } - else { - # get the plot aspect ratio - xyasp<-par("pin") - # get the plot coordinate ratio - xycr<-diff(par("usr"))[c(1,3)] - ymult<-xyasp[1]/xyasp[2]*xycr[2]/xycr[1] - } - return(ymult) -} diff --git a/R/gradient.rect.R b/R/gradient.rect.R deleted file mode 100644 index d481751..0000000 --- a/R/gradient.rect.R +++ /dev/null @@ -1,35 +0,0 @@ -gradient.rect<-function(xleft,ybottom,xright,ytop,reds,greens,blues, - col=NULL,nslices=50,gradient="x",border=par("fg")) { - - if(is.null(col)) col<-color.gradient(reds, greens, blues, nslices) - else nslices<-length(col) - nrect<-max(unlist(lapply(list(xleft,ybottom,xright,ytop),length))) - oldxpd<-par(xpd=NA) - if(nrect > 1) { - if(length(xleft) < nrect) xleft<-rep(xleft,length.out=nrect) - if(length(ybottom) < nrect) ybottom<-rep(ybottom,length.out=nrect) - if(length(xright) < nrect) xright<-rep(xright,length.out=nrect) - if(length(ytop) < nrect) ytop<-rep(ytop,length.out=nrect) - for(i in 1:nrect) - gradient.rect(xleft[i],ybottom[i],xright[i],ytop[i], - reds,greens,blues,col,nslices,gradient,border=border) - } - else { - if (gradient == "x") { - xinc <- (xright - xleft)/nslices - xlefts <- seq(xleft, xright - xinc, length = nslices) - xrights <- xlefts + xinc - rect(xlefts,ybottom,xrights,ytop,col=col,lty=0) - rect(xlefts[1],ybottom,xrights[nslices],ytop,border=border) - } - else { - yinc <- (ytop - ybottom)/nslices - ybottoms <- seq(ybottom, ytop - yinc, length = nslices) - ytops <- ybottoms + yinc - rect(xleft,ybottoms,xright,ytops,col=col,lty=0) - rect(xleft,ybottoms[1],xright,ytops[nslices],border=border) - } - } - par(oldxpd) - invisible(col) -} diff --git a/R/histStack.R b/R/histStack.R deleted file mode 100644 index ee22222..0000000 --- a/R/histStack.R +++ /dev/null @@ -1,37 +0,0 @@ -histStack<-function(x,...) { - UseMethod("histStack") -} - -histStack.formula<-function(x,data,breaks="Sturges",col="rainbow",right=TRUE, - main="",xlab=NULL,legend.pos=NULL,cex.legend=0.75,...) { - - mf<-model.frame(x,data=data) - if(is.null(xlab)) xlab<-names(mf)[1] - histStack.default(mf[,1],mf[,2],breaks=breaks,col=col,right=right, - main=main,xlab=xlab,legend.pos=legend.pos,cex.legend=cex.legend,...) -} - -histStack.default<-function(x,z,breaks="Sturges",col="rainbow",right=TRUE, - main="",xlab=NULL,legend.pos=NULL,cex.legend=0.75,...) { - - if(!is.factor(z)) { - z<-factor(z) - warning("z was converted to a factor") - } - seps=levels(z) - numseps<-length(seps) - if(length(col) == 1) col<-do.call(col,list(n=numseps)) - if(length(col) < numseps) col<-rep(col,length.out=numseps) - if(!is.numeric(x)) stop("x must be numeric",call.=FALSE) - # plot the histogram of all x - hS<-hist(x,breaks=breaks,col=col[1],right=right,main=main,xlab=xlab,...) - # plot the remaining - for(i in 1:(numseps-1)) - hist(x[z %in% seps[-(1:i)]],breaks=hS$breaks,col=col[i+1], - right=right,add=TRUE) - if(!is.null(legend.pos)) { - if(length(legend.pos > 1)) - legend(legend.pos[1],legend.pos[2],seps,fill=col,cex=cex.legend) - else legend(legend.pos,seps,fill=col,cex=cex.legend) - } -} diff --git a/R/intersectDiagram.R b/R/intersectDiagram.R deleted file mode 100755 index 0f28dcd..0000000 --- a/R/intersectDiagram.R +++ /dev/null @@ -1,138 +0,0 @@ -intersectDiagram<-function(x,pct=FALSE,show.nulls=FALSE,xnames=NULL, - sep="+",mar=c(0,0,3,0),main="Intersection Diagram",cex=1,col=NULL, - minspacing=NA,all.intersections=FALSE,include=NULL, - null.label="Non-set") { - - matchParts<-function(x,table,ignore.case=TRUE) { - for(pattern in 1:length(x)) { - match_index<-grep(x[pattern],table,ignore.case=ignore.case) - if(length(match_index)) return(match_index) - } - return(0) - } - if(!inherits(x,"intersectList")) { - if(is.matrix(x) || is.data.frame(x)) { - if(is.data.frame(x)) - x<-as.matrix(x) - x<-makeIntersectList(x,xnames=xnames,sep=sep) - } - if(!inherits(x,"intersectList")) - stop("x must be a matrix, data frame or intersectList") - } - oldmar<-par("mar") - par(mar=mar) - # attribute labels - attributes<-x[[length(x)]] - # get all the names for the individual attributes - if(is.null(include)) include<-attributes - # total number of attributes - nattributes<-length(attributes) - # peel off the number of objects and the attributes for display - x[[length(x)]]<-NULL - nobjects<-x[[length(x)]] - x[[length(x)]]<-NULL - # number of intersection levels with at least one object - nlevels<-length(x) - # if no colors specified, use rainbow - if(is.null(col)) col<-c(rainbow(nattributes),NA) - else - if(length(col) < nattributes) col<-rep(col,length.out=nattributes) - # total number of objects for each intersection level - objectsums<-sapply(x,sum) - # index of level with the most objects - maxlevel<-which.max(objectsums) - nNonZero<-function(x) return(sum(x > 0)) - # number of intersections with at least one member for each - # intersection level or all intersections if the somewhat dangerous - # "show everything" option is TRUE - if(all.intersections) nintersects<-sapply(x,length) - else nintersects<-sapply(x,nNonZero) - # maximum number of intersections in a given level - maxintersections<-max(nintersects) - # largest intersection set in x - maxn<-max(unlist(x)) - # default to a minimum spacing of one tenth of the largest intersection set - if(is.na(minspacing)) minspacing<-0.1 * maxn - # x limit that will hold the maximum number of objects and allow - # spacing for the maximum number of intersections in units of objects - maxx<-ifelse(nobjects > objectsums[maxlevel], - nobjects,objectsums[maxlevel] + minspacing * maxintersections) - # have to escape the separator in case it is "+" (default) or - # some other character that means something to some function - attsep<-paste("[",sep,"]",sep="") - # display the empty plot - plot(0,xlim=c(0,maxx),ylim=c(0,nlevels+show.nulls), - main=main,xlab="",ylab="",type="n",axes=FALSE) - # step through each level of intersections - for(level in 1:nlevels) { - # determine the intersect level by the number of elements in the first name - intersectLevel<-length(unlist(strsplit(names(x[[level]][1]),attsep))) - # indices of intersections with at least one object in this level - # or just all of the intersections - if(all.intersections) intersections<-1:nintersects[[level]] - else intersections<-which(x[[level]] > 0) - # get all the names in this level with at least one object - blocknames<-names(x[[level]])[intersections] - # spacing between intersection sets in object units - spacing<-(maxx - objectsums[level])/nintersects[level] - # left edges of the rectangles in x positions - leftx<-c(0,cumsum(x[[level]][intersections] + spacing)) + spacing/2 - # now step through the intersections in this level - for(intersect in 1:length(intersections)) { - # check if this intersection is to be displayed - if(matchParts(include,blocknames[intersect])) { - # make the label for the intersection - cellqnt<-ifelse(pct, - paste(round(100*x[[level]][intersections[intersect]]/nobjects,1), - "%",sep=""),x[[level]][intersections[intersect]]) - # indices of the colors to use for this rectangle - colindex<- - which(attributes %in% unlist(strsplit(blocknames[intersect],attsep))) - # number of colors - ncol<-length(colindex) - # width of each color slice - xinc<-x[[level]][intersections[intersect]]/ncol - # colors for the slices - slicecol<-col[colindex] - # start at the left edge of the sliced rectangle - offset<-0 - # step through the slices - for(slice in 1:ncol) { - # first draw the rectangle with no border - rect(leftx[intersect]+offset,nlevels-level+show.nulls+0.1, - leftx[intersect]+offset+xinc,nlevels-level+show.nulls+0.9, - col=slicecol[slice],border=NA) - # move to the left edge of the next slice - offset<-offset+xinc - } - # draw a box around the sliced rectangle - rect(leftx[intersect],nlevels-level+show.nulls+0.1, - leftx[intersect]+x[[level]][intersections[intersect]], - nlevels-level+show.nulls+0.9) - # display the label for this rectangle - boxed.labels(leftx[intersect]+x[[level]][intersections[intersect]]/2, - nlevels-level+show.nulls+0.5, - paste(blocknames[intersect],cellqnt,sep="\n"),cex=cex) - } - } - } - if(show.nulls) { - # number of objects with no set membership or no attributes - nonset<-as.numeric(nobjects - sum(objectsums)) - # left edge of the rectangle - leftnulls<-sum(par("usr")[1:2])/2-nonset/2 - # draw the rectangle - if(nonset) rect(leftnulls,0.1,leftnulls+nonset,0.9) - # center of the rectangle - xpos<-leftnulls+nonset/2 - # display the label - if(pct) nonset<-paste(round(100*nonset/nobjects,1),"%",sep="") - boxed.labels(xpos,0.5,paste(null.label,nonset,sep="\n"),cex=cex) - } - # restore the original plot parameters - par(mar=oldmar) - # stick the number of objects and attributes back on - x[[length(x) + 1]]<-nobjects - x[[length(x) + 1]]<-attributes - invisible(x) -} diff --git a/R/joyPlot.R b/R/joyPlot.R deleted file mode 100644 index 283ce02..0000000 --- a/R/joyPlot.R +++ /dev/null @@ -1,41 +0,0 @@ -joyPlot<-function(x,mar=c(5,4,4,2),newrange=c(0,1),border=NA,fill=NULL, - main="",xlab="",ylab="",xlim=NA,line_labels=names(x),xat=NULL, - xaxlab=NULL) { - - oldmar<-par(mar=mar) - nlines<-length(x) - xmin<-min(x[[1]]$x,na.rm=TRUE) - xmax<-max(x[[1]]$x,na.rm=TRUE) - ymax<-max(x[[1]]$y,na.rm=TRUE) - for(i in 2:nlines) { - thisxmin<-min(x[[i]]$x,na.rm=TRUE) - if(thisxmin < xmin) xmin<-thisxmin - thisxmax<-max(x[[i]]$x,na.rm=TRUE) - if(thisxmax < xmax) xmax<-thisxmax - ymax<-c(ymax,max(x[[i]]$y,na.rm=TRUE)) - } - if(is.na(xlim[1])) xlim<-c(xmin,xmax) - oaymax<-max(ymax) - if(is.na(border[1])) border<-rainbow(nlines) - else if(length(border) < nlines) border=rep(border,length.out=nlines) - if(!is.null(fill)) if(length(fill) < nlines) - fill<-rep(fill,length.out=nlines) - plot(0,type="n",xlim=xlim,ylim=c(0,nlines+newrange[2]-1), - main=main,xlab=xlab,ylab=ylab,xaxt="n",yaxt="n") - if(is.null(xat)) axis(1) - else { - if(is.null(xaxlab)) xaxlab<-xat - axis(1,at=xat,labels=xaxlab) - } - abline(h=0:(nlines-1),col="lightgray") - if(is.null(line_labels)) line_labels<-1:nlines - axis(2,at=0:(nlines-1)+0.5,labels=line_labels,las=1) - for(i in nlines:1) { - thisrange<-c(newrange[1],newrange[2]*ymax[i]/oaymax) - x[[i]]$y<-rescale(x[[i]]$y,thisrange)+i-1 - if(is.null(fill[i])) lines(x[[i]],col=border[i]) - else polygon(x[[i]],border=border[i],col=fill[i]) - } - box() - par(mar=oldmar) -} diff --git a/R/kiteChart.R b/R/kiteChart.R deleted file mode 100644 index 32c046d..0000000 --- a/R/kiteChart.R +++ /dev/null @@ -1,87 +0,0 @@ -kiteChart<-function(x,xlim=NA,ylim=NA,timex=TRUE,main="Kite chart", - xlab=ifelse(timex,"Time","Groups"),ylab=ifelse(timex,"Groups","Time"), - border=par("fg"),col=NULL,varpos=NA,varlabels=NA,varscale=FALSE, - timepos=NA,timelabels=NA,mar=c(5,4,4,4),axlab=c(1,2,3,4), - normalize=FALSE,shownorm=TRUE,...) { - - # leave a bit more space on top if there is an axis - if(varscale || normalize) mar<-mar+c(0,0,!timex,timex) - dimx<-dim(x) - if(normalize) { - if(is.na(varpos[1])) varpos<-1:dimx[2] - kitewidths<-rep(1,dimx[2]) - kitemax<-1 - } - else { - if(is.na(varpos[1])) { - kitewidths<-apply(as.matrix(x),1,max,na.rm=TRUE) - varpos<-rep(0,length(kitewidths)-1) - varpos[1]<-1.1*kitewidths[1]/2 - for(kite in 2:length(kitewidths)) - varpos[kite]<-varpos[kite-1]+1.1*(kitewidths[kite-1]+kitewidths[kite])/2 - kitemax<-1.1*sum(kitewidths) - } - else { - kitemax<-max(diff(varpos)) - kitewidths<-apply(as.matrix(x),1,max,na.rm=TRUE) - } - } - oldmar<-par(mar=mar) - if(is.na(xlim[1])) { - if(timex) xlim<-c(1,dimx[2]) - else { - if(normalize) xlim<-c(0.5,dimx[1]+0.5) - else xlim<-c(0,kitemax) - } - } - if(is.na(ylim[1])) { - if(timex) { - if(normalize) ylim<-c(0.5,dimx[1]+0.5) - else ylim<-c(0,kitemax) - } - else ylim<-c(1,dimx[2]) - } - plot(0,xlim=xlim,ylim=ylim,main=main,xlab=xlab,ylab=ylab,type="n", - axes=FALSE,...) - if(is.na(varpos[1])) varpos<-1:dimx[1] - if(is.na(varlabels[1])) { - if(is.null(rownames(x))) varlabels<-varpos[1:dimx[1]] - else varlabels<-rownames(x) - } - axis(ifelse(timex,axlab[2],axlab[1]),at=varpos[1:dimx[1]],labels=varlabels) - if(is.na(timepos[1])) timepos<-1:dimx[2] - if(is.na(timelabels[1])) { - if(is.null(colnames(x))) timelabels<-timepos - else timelabels<-colnames(x) - } - axis(ifelse(timex,axlab[1],axlab[2]),at=timepos,labels=timelabels) - if(varscale && !normalize) { - plotlim<-par("usr") - mtext(round(kitewidths,1),side=3+timex,at=varpos) - axis(3+timex,at=c(varpos-kitewidths/2,varpos+kitewidths/2), - labels=rep("",2*length(varpos))) - } - box() - if(is.null(col)) col<-rainbow(dimx[1]) - if(length(col) < dimx[1]) col<-rep(col,length.out=dimx[1]) - for(krow in 1:dimx[1]) { - if(normalize) { - if(shownorm) - mtext(paste("*",signif(1/max(x[krow,]),digits=3)), - ifelse(timex,axlab[4],axlab[3]),at=varpos[krow],las=1) - x[krow,]<-x[krow,]/(max(x[krow,])) - } - xpos<-1:length(x[krow,]) - if(timex) - polygon(c(xpos,rev(xpos)), - c(varpos[krow]+x[krow,]/2, - varpos[krow]-rev(x[krow,])/2), - col=col[krow],border=border) - else - polygon(c(varpos[krow]+x[krow,]/2, - varpos[krow]-rev(x[krow,])/2), - c(xpos,rev(xpos)), - col=col[krow],border=border) - } - invisible(oldmar) -} diff --git a/R/labbePlot.R b/R/labbePlot.R deleted file mode 100644 index 36f2a64..0000000 --- a/R/labbePlot.R +++ /dev/null @@ -1,44 +0,0 @@ -# labbePlot reads a list of comparison trial results between two conditions, -# typically "placebo" and "intervention" for clinical trials, -# and plots each result as a circle centered at the percentage of successes -# for each condition, with radius proportional to the square root of the -# number of observations (multiplied by "circle.mag" for very small or large -# numbers of observations), with optional fill colors. - -labbePlot<-function(x,main="L'Abbe plot", - xlab="Percent positive response with placebo", - ylab="Percent positive response with treatment", - labels=NULL,col=NA,circle.mag=0.5,add=FALSE,...) { - - if(is.list(x)) { - if(!add) - plot(0,xlim=c(0,100),ylim=c(0,100),main=main,xlab=xlab, - ylab=ylab,type="n",...) - for(trial in 1:length(x)) { - if(is.matrix(x[[trial]])) { - sum_treat<-sum(x[[trial]][1,]) - sum_interv<-sum(x[[trial]][2,]) - xpos<-100*x[[trial]][1,1]/sum_treat - ypos<-100*x[[trial]][2,1]/sum_interv - rad<-circle.mag*sqrt(sum_treat+sum_interv) - } - else { - xpos<-x[[trial]][1] - ypos<-x[[trial]][2] - rad<-circle.mag*sqrt(x[[trial]][3]) - } - circle.col<-ifelse(is.list(col),col[[trial]],col) - draw.circle(xpos,ypos,rad,col=circle.col) - if(!is.null(labels[[trial]])) { - textcol<-ifelse(colSums(col2rgb(circle.col)*c(1,1.4,0.6)) < 350, - "white", "black") - text(xpos,ypos,labels[[trial]],col=textcol) - } - } - segments(0,0,100,100) - } - else { - cat("labbePlot: x must be a list of 2x2 tables OR\n") - cat("3 element numeric vectors of percent, percent, N (see help page)\n") - } -} diff --git a/R/ladderplot.R b/R/ladderplot.R deleted file mode 100644 index 95adce2..0000000 --- a/R/ladderplot.R +++ /dev/null @@ -1,4 +0,0 @@ -ladderplot <- -function (x, ...) - UseMethod("ladderplot") - diff --git a/R/ladderplot.default.R b/R/ladderplot.default.R deleted file mode 100644 index 9ac0751..0000000 --- a/R/ladderplot.default.R +++ /dev/null @@ -1,37 +0,0 @@ -ladderplot.default <- -function(x, scale=FALSE, col=1, pch=19, lty=1, xlim=c(0.5, ncol(x)+0.5), ylim=range(x), vertical = TRUE, ordered=FALSE, ...) -{ - x <- as.data.frame(x) - if (scale) - x <- apply(x, 2, function(x) (x - min(x, na.rm = TRUE))/(max(x, - na.rm = TRUE) - min(x, na.rm = TRUE))) - if (NCOL(x) < 2) - stop("'x' must have at least 2 columns") - nr <- nrow(x) - if (length(col) < nr) - col <- rep(col, nr)[1:nr] - if (length(pch) < nr) - pch <- rep(pch, nr)[1:nr] - if (length(lty) < nr) - lty <- rep(lty, nr)[1:nr] - if (ordered) - x <- x[,order(colnames(x))] - y <- data.frame(values=array(unlist(x)), - ind=factor(rep(1:ncol(x), each=nrow(x)), labels=colnames(x))) - - id <- match(colnames(x),levels(y$ind)) - if (vertical) { - with(y, stripchart(values ~ ind, pch=pch, ylim=ylim, xlim=xlim, vertical=vertical, col="white", ...)) - lapply(1:ncol(x), function(i) points(cbind(rep(i,nr), x[,id[i]]), col=col, pch=pch)) - lapply(1:nr, function(i) lines(cbind(id, as.matrix(x)[i,]), col=col[i], lty=lty[i])) - } else { - tmp <- xlim - xlim <- ylim - ylim <- tmp - with(y, stripchart(values ~ ind, pch=pch, ylim=ylim, xlim=xlim, vertical=vertical, col="white", ...)) - lapply(1:ncol(x), function(i) points(cbind(x[,id[i]], rep(i,nr)), col=col, pch=pch)) - lapply(1:nr, function(i) lines(cbind(as.matrix(x)[i,], id), col=col[i], lty=lty[i])) - } - invisible(NULL) -} - diff --git a/R/legendg.R b/R/legendg.R deleted file mode 100644 index a298eb1..0000000 --- a/R/legendg.R +++ /dev/null @@ -1,83 +0,0 @@ -legendg<-function (x, y = NULL, legend, fill = NULL, col = par("col"), - border = list("black"), lty, lwd, pch = NULL, angle = 45, - density = NULL, bty = "o", bg = par("bg"), box.lwd = par("lwd"), - box.lty = par("lty"), box.col = par("fg"), pt.bg = NA, cex = 1, - pt.cex = cex, pt.lwd = lwd, pt.space = 1, xjust = 0, yjust = 1, - x.intersp = 1, y.intersp = 1, adj = c(0, 0.5), text.width = NULL, - text.col = par("col"), merge = FALSE, trace = FALSE, plot = TRUE, - ncol = 1, horiz = FALSE, title = NULL, inset = 0, xpd, title.col = text.col) { - - if (missing(legend) && !is.null(y)) { - legend <- y - y <- NULL - } - if (is.list(x)) { - y <- x$y - x <- x$x - } - if (is.null(y)) { - if (is.character(x)) { - tablepos <- get.tablepos(x) - x <- tablepos$x - y <- tablepos$y - xjust <- tablepos$xjust - yjust <- tablepos$yjust - } - } - if (!missing(xpd)) { - oldxpd <- par("xpd") - par(xpd = xpd) - } - legend.info <- legend(x = x, y = y, legend = legend, col = par("bg"), - lty = 1, bty = bty, bg = bg, box.lwd = box.lwd, box.lty = box.lty, - box.col = par("fg"), pt.bg = NA, cex = cex, pt.cex = pt.cex, - pt.lwd = pt.lwd, xjust = xjust, yjust = yjust, x.intersp = x.intersp, - y.intersp = y.intersp, adj = adj, text.width = text.width, - text.col = text.col, merge = merge, trace = trace, plot = plot, - ncol = ncol, horiz = horiz, title = title, inset = inset, - title.col = title.col) - if (!is.null(fill)) { - if (length(border) < length(fill)) - border <- rep(border, length(fill)) - rectheight <- strheight("Q", cex = cex) - if (length(adj) > 1) - yadj <- adj[2] - else yadj <- 0.5 - for (nel in 1:length(fill)) { - nrect <- length(fill[[nel]]) - rectspace <- (legend.info$text$x[nel] - legend.info$rect$left) - lefts <- cumsum(c(legend.info$rect$left + rectspace * - 0.1, rep(0.8 * rectspace/nrect, nrect - 1))) - rights <- lefts + 0.7 * rectspace/nrect - bottoms <- rep(legend.info$text$y[nel] - yadj * rectheight, - nrect) - rect(lefts, bottoms, rights, bottoms + rectheight, - col = fill[[nel]], border = ifelse(is.na(fill[[nel]]), - NA, border[[nel]])) - } - } - if (!is.null(pch)) { - if (!is.list(col)) { - mycol <- pch - if (length(col) < length(mycol[[1]])) - col <- rep(col, length.out = length(mycol[[1]])) - for (nel in 1:length(col)) mycol[[nel]] <- rep(col, - length.out = length(mycol[[nel]])) - } - else mycol <- col - lenpch <- length(pch) - xright <- legend.info$text$x[1] - (legend.info$text$x[1] - - legend.info$rect$left) * 0.15 - for (nel in 1:lenpch) { - npch <- length(pch[[nel]]) - pchwidth <- strwidth(pch[[nel]]) * pt.space - xpos <- rev((xright + pchwidth/2) - cumsum(pchwidth)) - ypos <- rep(legend.info$text$y[nel], npch) - points(xpos, ypos, pch = pch[[nel]], col = mycol[[nel]], - cex = pt.cex) - } - } - if (!missing(xpd)) - par(xpd = oldxpd) - invisible(legend.info) -} diff --git a/R/lengthKey.R b/R/lengthKey.R deleted file mode 100644 index 863ac96..0000000 --- a/R/lengthKey.R +++ /dev/null @@ -1,12 +0,0 @@ -lengthKey<-function(x,y,tickpos,scale) { - par(xpd=TRUE) - nticks<-length(tickpos) - segments(x,y,x+tickpos[nticks]*scale,y) - for(tick in 1:nticks) { - segments(x+tickpos[tick]*scale,y, - x+tickpos[tick]*scale,y+tickpos[nticks]*scale/20) - text(x+tickpos[tick]*scale,y+tickpos[nticks]*scale/15, - tickpos[tick],adj=c(0.5,0)) - } - par(xpd=FALSE) -} diff --git a/R/makeIntersectList.R b/R/makeIntersectList.R deleted file mode 100644 index 224d4f5..0000000 --- a/R/makeIntersectList.R +++ /dev/null @@ -1,66 +0,0 @@ -pasteCols<-function(x,sep="") { - pastestring<-paste("list(",paste("x","[",1:dim(x)[1],",]", - sep="",collapse=","),")",sep="") - return(do.call(paste,c(eval(parse(text = pastestring)),sep=sep))) -} - -# converts a two column matrix of object identifiers [,1] and attributes [,2] -# into a data frame of TRUE/FALSE values where each row is an object and -# each column is an attribute - -categoryReshape<-function(x) { - dimx<-dim(x) - if(is.null(dimx) || dimx[2]==1) - stop("Can only reshape a matrix or data frame with at least two columns") - row_values<-sort(unique(x[,1])) - column_values<-sort(unique(x[,2])) - newx<- - as.data.frame(matrix(0,nrow=length(row_values),ncol=length(column_values))) - for(row in 1:dimx[1]) { - row_index<-which(row_values %in% x[row,1]) - column_index<-which(column_values %in% x[row,2]) - newx[row_index,column_index]<-1 - } - names(newx)<-column_values - return(newx) -} - -# makes an intersectList object from a matrix or data frame of TRUE/FALSE -# values where each row represents an object and each column an attribute -# TRUE indicates that the object has that attribute, FALSE that it does not -# add a "weight" vector that allows a count of objects to be read directly - -makeIntersectList<-function(x,xnames=NULL,sep="+") { - # If any entries in x are not 1/0 OR TRUE/FALSE, assume that x - # is a two column matrix of object identifiers [,1] and attributes [,2] - if(any(!(x %in% c(TRUE,FALSE)))) x<-categoryReshape(x) - if(is.null(xnames)) xnames <- colnames(x) - dimx<-dim(x) - if(is.null(xnames)) xnames<-LETTERS[1:dimx[2]] - intersectList<-vector("list",dimx[2]+2) - for(intersect in 1:dimx[2]) - intersectList[[1]][intersect]<-sum(rowSums(x)==1 & x[,intersect]) - names(intersectList[[1]])<-xnames - for(comb in 2:dimx[2]) { - nn<-choose(dimx[2],comb) - intersectList[[comb]]<-rep(0,nn) - currentnames<- - names(intersectList[[comb]])<-pasteCols(combn(xnames,comb),sep) - currentcombs<-combn(1:dimx[2],comb,simplify=TRUE) - for(intersect in 1:nn) { - combvec<-rep(0,dimx[2]) - combvec[currentcombs[,intersect]]<-1 - intersectList[[comb]][intersect]<- - sum(colSums(apply(x,1,"==",combvec))==dimx[2]) - } - } - intersectList[[dimx[2]+1]]<-dimx[1] - names(intersectList[[dimx[2] + 1]])<-"Total" - intersectList[[dimx[2]+2]]<-xnames - names(intersectList[[dimx[2] + 2]])<-"attributes" - # drop any empty intersection levels - for(comb in dimx[2]:1) - if(sum(intersectList[[comb]])==0) intersectList[[comb]]<-NULL - class(intersectList)<-"intersectList" - return(intersectList) -} diff --git a/R/maxEmptyRect.R b/R/maxEmptyRect.R deleted file mode 100644 index 4fea521..0000000 --- a/R/maxEmptyRect.R +++ /dev/null @@ -1,61 +0,0 @@ -# function to find the largest rectangle not containing any of the points -# specified by x and y -# adapted by Hans Borchers from -# A. Naamad, D. T. Lee, and W.-L. Hsu (1984). On the Maximum Empty -# Rectangle Problem. Discrete Applied Mathematics, Vol. 8, pp. 267--277. - -maxEmptyRect <- function(ax, ay, x, y) { - n <- length(x) - d <- sort(c(ax, x)) - D <- diff(d) - m <- which.max(D) - # check vertical slices - mgap <- D[m] - maxr <- mgap * (ay[2] - ay[1]) - maxR <- c(d[m], ay[1], d[m+1], ay[2]) - o <- order(y) - X <- x[o]; Y <- y[o] - for (i in 1:n) { - tl <- ax[1]; tr <- ax[2] - if (i < n) { - for (j in (i+1):n) { - if (X[j] > tl && X[j] < tr) { - # check horizontal slices (j == i+1) - # and (all) rectangles above (X[i], Y[i]) - area <- (tr-tl)*(Y[j]-Y[i]) - if (area > maxr) { - maxr <- area - maxR <- c(tl, Y[i], tr, Y[j]) - } - if (X[j] > X[i]) tr <- X[j] - else tl <- X[j] - } - } - } - # check open rectangles above (X[i], Y[i]) - area <- (tr-tl)*(ay[2]-Y[i]) - if (area > maxr) { - maxr <- area - maxR <- c(tl, Y[i], tr, ay[2]) - } - } - for (i in 1:n) { - # check open rectangles above (X[i], Y[i]) - ri <- min(ax[2], X[Y > Y[i] & X > X[i]]) - li <- max(ax[1], X[Y > Y[i] & X < X[i]]) - area <- (ri-li)*(ay[2]-Y[i]) - if (area > maxr) { - maxr <- area - maxR <- c(li, Y[i], ri, ay[2]) - } - # check open rectangles below (X[i], Y[i]) - ri <- min(ax[2], X[Y < Y[i] & X > X[i]]) - li <- max(ax[1], X[Y < Y[i] & X < X[i]]) - area <- (ri-li)*(Y[i]-ay[1]) - if (area > maxr) { - maxr <- area - maxR <- c(li, ay[1], ri, Y[i]) - } - } - return(list(area = maxr, rect = maxR)) -} diff --git a/R/multhist.R b/R/multhist.R deleted file mode 100644 index f6e40c3..0000000 --- a/R/multhist.R +++ /dev/null @@ -1,32 +0,0 @@ -multhist <- function (x, beside=TRUE, freq=NULL, probability=!freq, - plot.it=TRUE, ...) { - - ## sort out histogram arguments - hist.args <- formals(hist.default) - args <- list(...) - hargs <- names(args)[names(args) %in% names(hist.args)] - hist.args[hargs] <- args[hargs] - hist.args$plot<-FALSE - allhist <- hist(unlist(x),hist.args$breaks,plot=FALSE) - ## sort out barplot arguments - if(plot.it) { - barplot.args <- formals(barplot.default) - bargs <- names(args)[names(args) %in% names(barplot.args)] - barplot.args[bargs] <- args[bargs] - barplot.args$beside <- beside - if("ann" %in% names(barplot.args)) - barplot.args$ann<-eval(barplot.args$ann,envir=barplot.args) - ## prevent warnings - barplot.args$"..." <- barplot.args$inside <- NULL - if (!"names.arg" %in% bargs) - barplot.args$names.arg <- signif(allhist$mids, 2) - if (is.null(freq)) { - freq<-if(!missing(probability)) !as.logical(probability) else TRUE - } - comp <- if(freq) "counts" else comp<-"density" - combhist <- - t(sapply(x,function(z) hist(z,breaks=allhist$breaks,plot=FALSE)[[comp]])) - if(plot.it) do.call("barplot", c(list(combhist),barplot.args)) - invisible(list(allhist,combhist)) - } -} diff --git a/R/multivari.R b/R/multivari.R deleted file mode 100644 index a0ca870..0000000 --- a/R/multivari.R +++ /dev/null @@ -1,245 +0,0 @@ -multivari <- function(var, fac1, fac2, fac3=NULL, fac4=NULL, data, - sort=FALSE, fun=mean, pch=list(15, 16, 17), - col=list("black", "blue","red"), col0="black", - cex=1, fac.cex=2, xlab.depth=3, legend=FALSE, - main=paste("multivari chart of", var), add=FALSE, ...){ - ## if fac4 is given, make two separate multivaricharts for fac1 to fac3 - ## on the same y scale - ## fac4 only allowed if there is also fac3 - ## x a data frame - ## fac1 to fac4 character strings as names of categorical variables - ## these are coerced to factor, if they are not factors yet - ## if sort=FALSE, the order of appearance in unique() is used for level order, - ## else levels are ordered in the default way of factor - ## nfac (calculated) is the number of non-NULL factors - ## pch and col are lists of length 2 or 3 - ## (depending on the number of factors) - ## elements can be unique symbol/color specifications - ## or vectors of symbol/color specifications for the levels of - ## fac1, fac2, or fac3 resp. (fac4 is in separate charts) - ## Usually, one would need to specify a pch vector for the last factor, - ## in case of more than two factors. - ## line colors are taken from the symbol colors of the previous level - ## (try out whether this makes sense) - ## fac.cex is a factor to enlarge the points versus the text - ## xlab.depth gives the highest level for which the horizontal axis - ## carries labels for the factor levels - - ## Changes Dec 8: - ## bug fix: colors and symbols did not work correctly, - ## if some levels do not occur in the data; - ## now, colors and symbols are always picked according to factor levels - ## added extra space for legend on horizontal axis - ## added an add option (for adding to otherwise prepared plotting template) - ## modified initial plot call: - ## more logical choice for x and y, which should not change anything - ## added cex.axis=cex and cex.lab=cex, - ## so that y-axis labeling is also affected by cex - ## added/modified/removed some comment text - - stopifnot(is.data.frame(data)) - nc <- ncol(data) - if (is.numeric(fac1)) { - stopifnot(fac1 %in% 1:nc) - fac1 <- names(data)[fac1] - } - if (is.numeric(var)){ - stopifnot(var %in% 1:nc) - var <- names(data)[var] - } - if (is.numeric(fac2)){ - stopifnot(fac2 %in% 1:nc) - fac2 <- names(data)[fac2] - } - if (is.numeric(fac3)){ - stopifnot(fac3 %in% 1:nc) - fac3 <- names(data)[fac3] - } - if (is.numeric(fac4)){ - stopifnot(fac4 %in% 1:nc) - fac4 <- names(data)[fac4] - } - stopifnot(is.character(var)) - stopifnot(var %in% names(data)) - stopifnot(is.numeric(data[[var]])) - fn <- c(fac1, fac2, fac3, fac4) - if (any(!is.character(fn))) stop("fac1 to fac4 must be character or NULL") - if (any(!fn %in% names(data))) stop("fac1 to fac4 must be variable names in data") - ## all factors are columns of data or NULL - - ## make non-factors into factors - ## if (!sort), respect level ordering as encountered in the data - ## sort does not touch level ordering in factors - nfac <- 2 - if (!sort){ - if (!is.factor(data[[fac1]])) data[[fac1]] <- factor(data[[fac1]], levels=unique(data[[fac1]])) - if (!is.factor(data[[fac2]])) data[[fac2]] <- factor(data[[fac2]], levels=unique(data[[fac2]])) - if (!is.null(fac3)){ - nfac <- 3 - if (!is.factor(data[[fac3]])) data[[fac3]] <- factor(data[[fac3]], levels=unique(data[[fac3]])) - if (!is.null(fac4)){ - nfac <- 4 - if (!is.factor(data[[fac4]])) data[[fac4]] <- factor(data[[fac4]], levels=unique(data[[fac4]])) - } - } - } - else{ - if (!is.factor(data[[fac1]])) data[[fac1]] <- factor(data[[fac1]]) - if (!is.factor(data[[fac2]])) data[[fac2]] <- factor(data[[fac2]]) - if (!is.null(fac3)){ - nfac <- 3 - if (!is.factor(data[[fac3]])) data[[fac3]] <- factor(data[[fac3]]) - if (!is.null(fac4)){ - nfac <- 4 - if (!is.factor(data[[fac4]])) data[[fac4]] <- factor(data[[fac4]]) - } - } - } - stopifnot(is.list(col)) - stopifnot(is.list(pch)) - stopifnot(length(col)>=min(3, nfac)) - stopifnot(length(pch)>=min(3, nfac)) - - ## the number of observations behind the aggregated values - aggrn <- as.data.frame(table(data[fn][!is.na(data[[var]]),])) - aggrn <- aggrn[!aggrn$Freq==0,] - - ## for ylim and lowest level - aggr <- aggregate(data[var], data[fn], fun) - names(aggr)[nfac+1] <- var - aggr <- merge(aggr, aggrn, by=fn) - ylim <- range(aggr[[var]]) ## for all chunks of the chart - ## now we have the data structure, nfac factors and one value - - if (nfac==4) { - dat_split <- split(data, data[[fac4]]) - } - else { - dat_split <- list(data) - } - - - npanel <- length(dat_split) - xlim <- c(0.5, (nlevels(data[[fac1]])+1)*npanel+legend) - - ## within each panel, use x positions 1 to nlevels(dat[[fac1]]) - ## continue from these with x positions at most +/-0.25 - ## and then with x positions at most +/- 0.1 - - aggrlists <- lapply(dat_split, function(obj){ - hilf <- list(aggregate(obj[var], obj[fac1], fun), - aggregate(obj[var], obj[c(fac1, fac2)], fun)) - if (nfac >= 3) hilf[[3]] <- aggregate(obj[var], obj[c(fac1, fac2, fac3)], fun) - hilf - }) - - nlevs <- sapply(data[fn], nlevels) - poscalc <- function(i){ - ## calculate x positions - ## i is the panel - pos3 <- NULL - pos1 <- 1:nlevs[1] + (nlevs[1] + 1) * (i - 1) - pos2 <- rep(pos1, nlevs[2]) + - 0.5*rep((0:(nlevs[2]-1) - (nlevs[2]-1)/2)/(nlevs[2] - 1), - each=length(pos1)) - if (nfac >= 3) pos3 <- rep(pos2, nlevs[3]) + - 0.2*rep((0:(nlevs[3]-1) - (nlevs[3]-1)/2)/(nlevs[3] - 1), - each=length(pos2)) - ## take care of missing levels - ## the number of observations behind the aggregated values - aggrn1 <- as.data.frame(table(dat_split[[i]][fac1][!is.na(data[[var]]),])) - pos1 <- pos1[aggrn1$Freq>0] - aggrn2 <- as.data.frame(table(dat_split[[i]][c(fac1,fac2)][!is.na(data[[var]]),])) - pos2 <- pos2[aggrn2$Freq>0] - if (nfac>=3){ - aggrn3 <- as.data.frame(table(dat_split[[i]][c(fac1,fac2,fac3)][!is.na(data[[var]]),])) - pos3 <- pos3[aggrn3$Freq>0] - } - mapply(cbind, aggrlists[[i]], list(pos1=pos1,pos2=pos2,pos3=pos3)[1:min(nfac, 3)]) - } - - ## functions to draw each element of aggrlists in its place - linesfun <- function(x, ...){ - lines() - } - - pch <- as.list(pch) - col <- as.list(col) - for (i in 1:min(3, nfac)) - if (length(pch[[i]]) < nlevs[i]) pch[[i]] <- rep(pch[[i]],nlevs[i]) - for (i in 1:min(3, nfac)) - if (length(col[[i]]) < nlevs[i]) col[[i]] <- rep(col[[i]],nlevs[i]) - ## now, pch and col are lists with a level for each - - calcresults <- lapply(1:npanel, function(obj){ - hilf <- poscalc(obj) - hilf <- lapply(hilf, function(obj) { - names(obj)[ncol(obj)] <- "x" - obj - } - ) - hilf - }) - - ## prepare plot - if (!add) plot(xlim,ylim,type="n", xaxt="n", xlab="", ylab=var, tcl=0.5, - xlim=xlim, ylim=ylim, main=main, cex.axis=cex, cex.lab=cex, ...) - for (i in 1:npanel){ - plotlist <- calcresults[[i]] - ## last column of each list element holds x-position - ## last but one column (name var) holds y value - tit <- "" - if (nfac==4) tit <- paste(fac4, "=", levels(data[[fac4]])[i]) - for (j in 1:length(plotlist)){ - ## jth hierarchy level - dd <- plotlist[[j]] - if (j==1) { - lines(dd$x, dd[[var]], col=col0, ...) - points(dd$x, dd[[var]], col=col[[1]][as.numeric(dd[[fac1]])], - pch=pch[[1]][as.numeric(dd[[fac1]])], cex=fac.cex*cex, ...) - mtext(side=3, at=mean(dd$x), text=tit, line=0, cex=1.5*cex, ...) - mtext(side=1, at=dd$x, line=0, levels(data[[fac1]]), cex=cex, ...) - mtext(side=1, at=xlim[2], line=0, fac1, cex=cex, adj=1, ...) - } - else { - ## not first level of hierarchy - ## hilf contains separate portions for each level of fac1 to facj-1 - hilf <- split(dd, dd[fn[1:(j-1)]]) - if (xlab.depth >= j){ - mtext(side=1, at=dd$x, line=j-1, dd[[fn[j]]], cex=cex, ...) - mtext(side=1, at=xlim[2], line=j-1, fn[j], cex=cex, adj=1, ...) - } - for (ii in 1:length(hilf)){ - dd <- hilf[[ii]] - ## color from previous hierarchy level - lines(dd$x, dd[[var]], - col=col[[j-1]][as.numeric(dd[[fn[j-1]]])[1]], ...) - ## point symbol and color from current hierarchy level - points(dd$x, dd[[var]], cex=fac.cex*cex, - col=col[[j]][as.numeric(dd[[fn[j]]])], - pch=pch[[j]][as.numeric(dd[[fn[j]]])], ...) - } - } - } - } - if (legend){ - ## check whether legend makes sense - ## (col and/or pch for last level defined as vector) - ## add legend at the bottom right - pick <- 3 - if (nfac<3) pick <- 2 - if (length(col[[pick]])==1 && length(pch[[pick]])==1) - warning("no legend created, because symbols are not distinct") - else{ - lastval <- dd[[var]][which.max(dd$x)] - lpos <- "bottomright" - if (lastval < mean(ylim)) lpos <- "topright" - legend(lpos, legend=levels(data[[fn[pick]]]), - pch=pch[[pick]], col=col[[pick]], cex=0.5*fac.cex*cex, - title=fn[pick]) - } - } - invisible(calcresults) -} - - diff --git a/R/multsymbolbox.R b/R/multsymbolbox.R deleted file mode 100644 index b23b295..0000000 --- a/R/multsymbolbox.R +++ /dev/null @@ -1,15 +0,0 @@ -multsymbolbox<-function(x1,y1,x2,y2,tot,relw=0.8,fg=par("fg"),bg=par("bg"), - box=TRUE,debug=FALSE,...) { - - x1 <- rep(x1, length(tot)) - y1 <- rep(y1, length(tot)) - x2 <- rep(x2, length(tot)) - y2 <- rep(y2, length(tot)) - fg <- rep(fg, length(tot)) - bg <- rep(bg, length(tot)) - for (i in 1:length(tot)) { - if (tot[i] > 0) - symbolbox(x1[i],y1[i],x2[i],y2[i],tot[i],relw=relw, - fg=fg[i],bg=bg[i],box=box,debug=debug,...) - } -} diff --git a/R/p2p_arrows.R b/R/p2p_arrows.R deleted file mode 100644 index 71683e4..0000000 --- a/R/p2p_arrows.R +++ /dev/null @@ -1,5 +0,0 @@ -p2p_arrows<-function(x1,y1,x2,y2,space=0.05,col=par("fg"),...) { - xspace<-(x2-x1)*space - yspace<-(y2-y1)*space - arrows(x1+xspace,y1+yspace,x2-xspace,y2-yspace,...) -} diff --git a/R/panes.R b/R/panes.R deleted file mode 100644 index 75fbfb1..0000000 --- a/R/panes.R +++ /dev/null @@ -1,8 +0,0 @@ -panes<-function(mat=NULL,widths=rep(1,ncol(mat)),heights=rep(1,nrow(mat)), - nrow=2,ncol=2,mar=c(0,0,1.6,0),oma=c(2.5,1,1,1)) { - - oldpar<-par("mar","mfrow","oma") - if(is.null(mat)) par(mfrow=c(nrow,ncol),mar=mar,oma=oma) - else layout(mat,widths=widths,heights=heights) - return(oldpar) -} diff --git a/R/paxis3d.R b/R/paxis3d.R deleted file mode 100644 index 66c36b7..0000000 --- a/R/paxis3d.R +++ /dev/null @@ -1,138 +0,0 @@ -# 'enhanced' persp -- return value has attributes containing -# x,y,z ranges -perspx <- function(x,y,z,...) { - if (missing(z)) { - if (!missing(x)) { - if (is.list(x)) { - z <- x$z - y <- x$y - x <- x$x - } - else { - z <- x - x <- seq.int(0, 1, length.out = nrow(z)) - } - } - else stop("no 'z' matrix specified") - } - else if (is.list(x)) { - y <- x$y - x <- x$x - } - p <- persp(x,y,z,...) - attr(p,"ranges") <- list(x=range(x),y=range(y),z=range(z)) - p -} - -psegments3d <- function(x, y = NULL, z = NULL, pmat, ...) { - if (is.null(y) && is.null(z)) { - z <- x$z - y <- x$y - x <- x$x - } - xy <- trans3d(x,y,z,pmat) - # translate from 'segments3d' (successive pairs) to - # 'segments' (x0,x1,y0,y1) format - n <- length(xy$x) - x0 <- xy$x[seq(1,n,by=2)] - x1 <- xy$x[seq(2,n,by=2)] - y0 <- xy$y[seq(1,n,by=2)] - y1 <- xy$y[seq(2,n,by=2)] - segments(x0=x0,x1=x1,y0=y0,y1=y1,...) -} - -ptext3d <- function(x, y = NULL, z = NULL, texts, pmat, ...) { - if (is.null(y) && is.null(z)) { - z <- x$z - y <- x$y - x <- x$x - } - do.call(text,c(trans3d(x,y,z,pmat),list(label=texts,...))) -} - -if (FALSE) { - pp <- persp(x=1:3,y=1:3,z=matrix(1:9,nrow=3),col="gray") - ptext3d(2,2,5,"a",pp,col="red") -} - -get_axispos3d <- function(edge,pmat,at,pos=NULL, dist=0) { - ranges <- attr(pmat,"ranges") - edge <- c(strsplit(edge, "")[[1]], "-", "-")[1:3] - coord <- match(toupper(edge[1]), c("X", "Y", "Z")) - if (coord == 2) - edge[1] <- edge[2] - else if (coord == 3) - edge[1:2] <- edge[2:3] - mpos <- matrix(NA, 3, length(at)) - if (edge[1] == "+") - mpos[1, ] <- ranges$x[2] - else mpos[1, ] <- ranges$x[1] - if (edge[2] == "+") - mpos[2, ] <- ranges$y[2] - else mpos[2, ] <- ranges$y[1] - if (edge[3] == "+") - mpos[3, ] <- ranges$z[2] - else mpos[3, ] <- ranges$z[1] - offset <- dist * (mpos[, 1] - c(mean(ranges$x), mean(ranges$y), - mean(ranges$z))) - offset[coord] <- 0 - mpos <- sweep(mpos,1,offset,"+") - if (!is.null(pos)) - mpos <- matrix(pos, 3, length(at)) - mpos[coord, ] <- at - mpos -} - -mtext3d <- function (edge, pmat, labels = TRUE, at = NULL, dist=0.3, xpd=NA, ...) { - ranges <- attr(pmat,"ranges") - edge.orig <- edge # hack - edge <- c(strsplit(edge, "")[[1]], "-", "-")[1:3] - coord <- match(toupper(edge[1]), c("X", "Y", "Z")) - range <- ranges[[coord]] - if (is.null(at)) { - at <- mean(range) - } - mpos <- get_axispos3d(edge.orig,pmat,at,dist=dist) - ptext3d(mpos[1, ],mpos[2,],mpos[3,], - labels, pmat, xpd=xpd, ...) -} - -paxis3d <- -function (edge, pmat, - at = NULL, labels = TRUE, tick = TRUE, - pos = NULL, nticks = 5, ticklen=0.05,labdist=0.15, - xpd=NA, ...) -{ - ranges <- attr(pmat,"ranges") - edge.orig <- edge # hack - edge <- c(strsplit(edge, "")[[1]], "-", "-")[1:3] - coord <- match(toupper(edge[1]), c("X", "Y", "Z")) - range <- ranges[[coord]] - if (is.null(at)) { - at <- pretty(range, nticks) - at <- at[at >= range[1] & at <= range[2]] - } - if (is.logical(labels)) { - if (labels) - labels <- format(at) - else labels <- NA - } - mpos <- get_axispos3d(edge.orig,pmat,at,pos,dist=0) - # draw axes - x <- c(mpos[1, 1], mpos[1, length(at)]) - y <- c(mpos[2, 1], mpos[2, length(at)]) - z <- c(mpos[3, 1], mpos[3, length(at)]) - psegments3d(x,y,z,pmat, xpd=xpd, ...) - if (tick) { - mpos_tick <- get_axispos3d(edge.orig,pmat,at,dist=ticklen) - x <- c(as.double(rbind(mpos[1, ], mpos_tick[1, ]))) - y <- c(as.double(rbind(mpos[2, ], mpos_tick[2, ]))) - z <- c(as.double(rbind(mpos[3, ], mpos_tick[3, ]))) - psegments3d(x,y,z,pmat, xpd=xpd, ...) - } - if (!is.null(labels)) { - mpos_lab <- get_axispos3d(edge.orig,pmat,at,dist=labdist) - ptext3d(mpos_lab[1, ],mpos_lab[2,],mpos_lab[3,], - labels, pmat, xpd=xpd, ...) - } -} diff --git a/R/pie3D.R b/R/pie3D.R deleted file mode 100644 index f9193d9..0000000 --- a/R/pie3D.R +++ /dev/null @@ -1,137 +0,0 @@ -pie3D.labels<-function(radialpos,radius=1,height=0.1,theta=pi/6, - labels,labelcol=par("fg"),labelcex=1.5,labelrad=1.25,minsep=0.3){ - - oldcex<-par("cex") - nlab<-length(labels) - par(cex=labelcex,xpd=TRUE) - for (i in 1:nlab) { - if(i < nlab) { - labelsep<-radialpos[i+1] - radialpos[i] - if(labelsep < minsep) { - radialpos[i]<-radialpos[i]+(labelsep-minsep)/2 - radialpos[i+1]<-radialpos[i+1]-(labelsep-minsep)/2 - } - } - xpos<-labelrad * radius * cos(radialpos[i]) - offset<-(radialpos[i] > pi && radialpos[i] < 2 * pi) * height - ypos<-labelrad * radius * sin(radialpos[i]) * 2 * theta/pi + - sin(radialpos[i]) * height - text(xpos,ypos,labels[i],col=labelcol, - adj=c(0.5,abs(0.5-sin(radialpos[i])/2))) - } - par(cex=oldcex,xpd=FALSE) -} - -draw.tilted.sector<-function(x=0,y=0,edges=NA,radius=1,height=0.1, - theta=pi/6,start=0,end=pi*2,border=par("fg"),col=par("bg"),explode=0, - shade=0.8) { - - if(is.na(edges)) edges<-max(1, trunc(20*(end-start))) - angleinc<-(end-start)/edges - angles<-c(seq(start,end,by=angleinc),end) - viscurve<-(angles>=pi)&(angles<=2*pi) - nv<-length(angles) - bisector<-(start+end)/2 - if(explode){ - # calculate the x and y offsets for the explode - x<-x+cos(bisector)*explode - y<-y+sin(bisector)*(1-sin(theta))*explode - } - if(shade>0 && shade<1){ - # calculate the shade color for the sides of the sector - rgbcol<-col2rgb(col) - shadecol<-rgb(shade*rgbcol[1]/255,shade*rgbcol[2]/255, - shade*rgbcol[3]/255) - } - else shadecol<-col - xp<-cos(angles) * radius + x - # this is the top of the sector - yp<-sin(angles) * 2 * theta/pi * radius + y - if(start > 3*pi/2) { - # the 'left' side will be visible in this quadrant - if(explode > 0) - # display the 'right' side just in case it goes beyond pi/2 - polygon(c(xp[nv],x,x,xp[nv],xp[nv]),c(yp[nv]-height,y-height, - y+height,yp[nv]+height,yp[nv]+height),border=border, - col=shadecol) - # display the 'outside' of the sector - polygon(c(xp[viscurve],rev(xp[viscurve])),c(yp[viscurve]-height, - rev(yp[viscurve])+height),border=border,col=shadecol) - if(explode > 0) - # display the 'left' (front) side - polygon(c(xp[1],x,x,xp[1],xp[1]),c(yp[1]-height,y-height, - y+height,yp[1]+height,yp[1]),border=border, - col=shadecol) - } - else { - if(start > pi/2) { - if(explode > 0) { - polygon(c(xp[1],x,x,xp[1],xp[1]),c(yp[1]-height,y-height, - y+height,yp[1]+height,yp[1]),border=border, - col=shadecol) - polygon(c(xp[nv],x,x,xp[nv],xp[nv]),c(yp[nv]-height, - y-height,y+height,yp[nv]+height,yp[nv]+height), - border=border,col=shadecol) - } - if(end > pi) - polygon(c(xp[viscurve],rev(xp[viscurve])),c(yp[viscurve]-height, - rev(yp[viscurve])+height),border=border, - col=shadecol) - } - else { - if(end > pi || start<2*pi) - polygon(c(xp[viscurve],rev(xp[viscurve])),c(yp[viscurve]-height, - rev(yp[viscurve])+height),border=border, - col=shadecol) - if(end > pi/2 && end < 3*pi/2 && explode > 0){ - polygon(c(xp[nv],x,x,xp[nv],xp[nv]),c(yp[nv]-height, - y-height,y+height,yp[nv]+height,yp[nv]+height), - border=border,col=shadecol) - } - if(explode > 0) - polygon(c(xp[1],x,x,xp[1],xp[1]),c(yp[1]-height,y-height, - y+height,yp[1]+height,yp[1]+height),border=border, - col=shadecol) - } - } - #display the top - polygon(c(xp,x),c(yp+height,y+height),border=border,col=col) - return(bisector) -} - -pie3D<-function(x,edges=NA,radius=1,height=0.1,theta=pi/6, - start=0,border=par("fg"),col=NULL,labels=NULL,labelpos=NULL, - labelcol=par("fg"),labelcex=1.5,sector.order=NULL,explode=0, - shade=0.8,mar=c(4,4,4,4),pty="s",...) { - - if(!is.numeric(x) || any(x < 0)) - stop("pie3D: x values must be positive numbers") - # drop NAs - if(any(is.na(x))) x<-x[!is.na(x)] - oldmar<-par("mar") - par(pty=pty,mar=mar,xpd=TRUE) - x<-c(0, cumsum(x)/sum(x))*2*pi+start - nsectors<-length(x)-1 - if(is.null(col)) col <- rainbow(nsectors) - else if(length(col) < nsectors) col<-rep(col,length.out=nsectors) - if(is.null(sector.order)) - # get the order of drawing sectors - sector.order<- - order(sin((x[2:(nsectors+1)]+x[1:nsectors])/2),decreasing=TRUE) - bc<-rep(0,nsectors) - # set up an empty plot - plot(0,xlab="",ylab="",xlim=c(-1,1),ylim=c(-1,1),type="n",axes=FALSE,...) - for(i in sector.order) { - bc[i]<-draw.tilted.sector(radius=radius,height=height, - theta=theta,start=x[i],end=x[i+1],edges=edges, - border=border,col=col[i],explode=explode,shade=shade) - } - if(!is.null(labels)) { - if(!is.null(labelpos)) - bc<-labelpos - pie3D.labels(bc,height=height,theta=theta, - labels=labels,labelcol=labelcol,labelcex=labelcex) - } - par(mar=oldmar,xpd=FALSE,pty="m") - invisible(bc) -} diff --git a/R/placeLabels.R b/R/placeLabels.R deleted file mode 100644 index de3be40..0000000 --- a/R/placeLabels.R +++ /dev/null @@ -1,27 +0,0 @@ -placeLabels<-function(x,y=NA,labels,pointer=TRUE,cex=1,labelcol=par("fg"), - labelbg="white",border=par("fg"),pointercol=par("fg"), - pch=1,col=1,bg="white",flagcol="red") { - - if(is.na(y) && is.list(x)) { - y<-unlist(x[[2]]) - x<-unlist(x[[1]]) - } - nlabels<-length(labels) - if(length(labelcol) < nlabels) labelcol<-rep(labelcol,length.out=nlabels) - if(length(labelbg) < nlabels) labelbg<-rep(labelbg,length.out=nlabels) - if(length(border) < nlabels) border<-rep(border,length.out=nlabels) - if(length(pointercol) < nlabels) pointercol<-rep(pointercol,length.out=nlabels) - if(length(pch) < nlabels) pch<-rep(pch,length.out=nlabels) - if(length(col) < nlabels) col<-rep(col,length.out=nlabels) - if(length(bg) < nlabels) bg<-rep(bg,length.out=nlabels) - for(i in 1:nlabels) { - points(x[i],y[i],pch=19,col=flagcol) - labelxy<-locator(1) - if(pointer) - segments(x[i],y[i],labelxy$x,labelxy$y,col=pointercol[i]) - boxed.labels(labelxy$x,labelxy$y,labels[i], - col=labelcol[i],bg=labelbg[i],border=border[i]) - points(rep(x[i],2),rep(y[i],2),pch=c(19,pch[i]), - col=c("white",col[i]),bg=c(NA,bg[i])) - } -} diff --git a/R/plotCI.R b/R/plotCI.R deleted file mode 100644 index 001af98..0000000 --- a/R/plotCI.R +++ /dev/null @@ -1,90 +0,0 @@ -plotCI <- function (x, y = NULL, uiw, liw = uiw, ui = NULL, li = NULL, - err = "y", sfrac = 0.01, gap = 0, slty = par("lty"), add = FALSE, - scol = NULL, pt.bg = par("bg"), ...) -{ - arglist <- list(...) - if (is.list(x)) { - y <- x$y - x <- x$x - } - if (is.null(y)) { - if (is.null(x)) - stop("both x and y NULL") - y <- as.numeric(x) - x <- seq(along = x) - } - if (missing(uiw) && (is.null(ui) || is.null(li))) - stop("must specify either relative limits or both lower and upper limits") - if (!missing(uiw)) { - if (err == "y") - z <- y - else z <- x - ui <- z + uiw - li <- z - liw - } - if (is.null(arglist$xlab)) - arglist$xlab <- deparse(substitute(x)) - if (is.null(arglist$ylab)) - arglist$ylab <- deparse(substitute(y)) - if (err == "y" && is.null(arglist$ylim)) - arglist$ylim <- range(c(y, ui, li), na.rm = TRUE) - if (err == "x" && is.null(arglist$xlim)) - arglist$xlim <- range(c(x, ui, li), na.rm = TRUE) - if (missing(scol)) { - if (!is.null(arglist$col)) - scol <- arglist$col - else scol <- par("col") - } - plotpoints <- TRUE - if (!is.null(arglist$pch) && any(is.na(arglist$pch))) { - arglist$pch <- 1 - plotpoints <- FALSE - } - if (!add) - do.call("plot", c(list(x, y, type = "n"), clean.args(arglist, - plot))) - if (gap == TRUE) - gap <- 0.01 - ul <- c(li, ui) - pin <- par("pin") - usr <- par("usr") - x.to.in <- pin[1]/diff(usr[1:2]) - y.to.in <- pin[2]/diff(usr[3:4]) - if (err == "y") { - gap <- rep(gap, length(x)) * diff(par("usr")[3:4]) - smidge <- par("fin")[1] * sfrac - nz <- abs(li - pmax(y - gap, li)) * y.to.in > 0.001 - scols <- rep(scol, length.out = length(x))[nz] - arrow.args <- c(list(lty = slty, angle = 90, length = smidge, - code = 1, col = scols), clean.args(arglist, arrows, - exclude.other = c("col", "lty", "axes"))) - do.call("arrows", c(list(x[nz], li[nz], x[nz], pmax(y - - gap, li)[nz]), arrow.args)) - nz <- abs(ui - pmin(y + gap, ui)) * y.to.in > 0.001 - scols <- rep(scol, length.out = length(x))[nz] - arrow.args$col <- scols - do.call("arrows", c(list(x[nz], ui[nz], x[nz], pmin(y + - gap, ui)[nz]), arrow.args)) - } - else if (err == "x") { - gap <- rep(gap, length(x)) * diff(par("usr")[1:2]) - smidge <- par("fin")[2] * sfrac - nz <- abs(li - pmax(x - gap, li)) * x.to.in > 0.001 - scols <- rep(scol, length.out = length(x))[nz] - arrow.args <- c(list(lty = slty, angle = 90, length = smidge, - code = 1, col = scols), clean.args(arglist, arrows, - exclude.other = c("col", "lty", "axes"))) - do.call("arrows", c(list(li[nz], y[nz], pmax(x - gap, - li)[nz], y[nz]), arrow.args)) - nz <- abs(ui - pmin(x + gap, ui)) * x.to.in > 0.001 - scols <- rep(scol, length.out = length(x))[nz] - arrow.args$col <- scols - do.call("arrows", c(list(ui[nz], y[nz], pmin(x + gap, - ui)[nz], y[nz]), arrow.args)) - } - if (plotpoints) - do.call("points", c(list(x, y, bg = pt.bg), clean.args(arglist, - points, exclude.other = c("xlab", "ylab", "xlim", - "ylim", "axes")))) - invisible(list(x = x, y = y)) -} diff --git a/R/plotH.R b/R/plotH.R deleted file mode 100644 index 932d2aa..0000000 --- a/R/plotH.R +++ /dev/null @@ -1,45 +0,0 @@ -plotH <- function (x,...) { - UseMethod("plotH") -} - -plotH.formula <- function(x,data=NULL,xlab=names(mf)[2],ylab=names(mf)[1],...) { - mf <- model.frame(x,data=data) # get model frame - if (ncol(mf)>2) stop("Function currently only accepts one variable on RHS of formula") - plotH.default(mf[,2],mf[,1],xlab=xlab,ylab=ylab,...) -} - -plotH.default <- function(x,y,xlab=paste(deparse(substitute(x))), - ylab=paste(deparse(substitute(y))),width=0.6,ylim=NULL,col="gray",...) { - plotHq <- function(x,y,xlab,ylab,width,ylim,col,...) { - if (is.null(width)) width <- min(diff(x)) - xleft <- x-width/2 - xright <- x+width/2 - ytop <- y - ynegs <- y[is.finite(y)]<0 - if (all(ynegs)) { - ## All values negative: tops must be bottoms, bottom is top of ylim - ybottom <- ytop - if (is.null(ylim)) ylim <- c(min(y[is.finite(y)]),0) - ytop <- ylim[2] - } else if (any(ynegs)) { - # Some values negative: tops are fine, make bottoms =0 - ybottom <- 0 - if (is.null(ylim)) ylim <- range(y[is.finite(y)]) - } else { - # All values positive: tops are fine, bottom is bottom of ylim - if (is.null(ylim)) ylim <- c(0,max(y[is.finite(y)])) - ybottom <- ylim[1] - } - plot(x,y,type="n",ylim=ylim,xlab=xlab,ylab=ylab,...) - rect(xleft,ybottom,xright,ytop,col=col,...) - } # end plotHq internal function - - plotHc <- function(x,y,xlab,ylab,width,ylim,col,...) { - names(y) <- x - barplot(y,xlab=xlab,ylab=ylab,width=width,ylim=ylim,col=col,...) - } # end plotHc internal function - ## Start of main function - if (!is.numeric(y)) stop("Y (or LHS) variable must be quantitative.") - if (is.numeric(x)) plotHq(x,y,xlab,ylab,width,ylim,col,...) - else plotHc(x,y,xlab,ylab,width,ylim,col,...) -} diff --git a/R/plot_bg.R b/R/plot_bg.R deleted file mode 100644 index 6e6e1c6..0000000 --- a/R/plot_bg.R +++ /dev/null @@ -1,4 +0,0 @@ -plot_bg<-function(col="lightgray") { - plim<-par("usr") - rect(plim[1],plim[3],plim[2],plim[4],col=col) -} diff --git a/R/polygon.shadow.R b/R/polygon.shadow.R deleted file mode 100644 index 33cdb7a..0000000 --- a/R/polygon.shadow.R +++ /dev/null @@ -1,24 +0,0 @@ -polygon.shadow<-function(x,y=NULL,offset=NA,inflate=NA, - col=c("#ffffff","#cccccc")) { - - if(is.null(y)) { - if(is.null(x$y)) stop("both x and y coordinates must be given") - y<-x$y - x<-x$x - } - xcenter<-mean(x) - ycenter<-mean(y) - if(is.na(offset[1])) offset<-c((max(x)-min(x))/20,-(max(y)-min(y))/20) - if(length(col) == 2) col<-smoothColors(col[1],8,col[2]) - if(is.na(inflate[1])) { - multx<-seq(offset[1],0,length=10) - multy<-seq(offset[2],0,length=10) - } - else { - multx<-seq(inflate[1],0,length=10) - multy<-seq(inflate[2],0,length=10) - } - for(i in 1:10) - polygon(x+multx[i]*(x-xcenter)+offset[1],y+multy[i]*(y-ycenter)+offset[2], - col=col[i],border=NA) -} diff --git a/R/pyramid.plot.R b/R/pyramid.plot.R deleted file mode 100755 index 606d606..0000000 --- a/R/pyramid.plot.R +++ /dev/null @@ -1,127 +0,0 @@ -pyramid.plot<-function (lx, rx, labels = NULL, top.labels = c("Male", "Age", - "Female"), main = "", laxlab = NULL, raxlab = NULL, unit = "%", - lxcol, rxcol, gap = 1, space = 0.2, ppmar = c(4, 2, 4, 2), - labelcex = 1, add = FALSE, xlim, show.values = FALSE, ndig = 1, - do.first = NULL) { - - if (any(c(lx, rx) < 0, na.rm = TRUE)) - stop("Negative quantities not allowed") - lxdim <- dim(lx) - rxdim <- dim(rx) - ncats <- ifelse(!is.null(lxdim), dim(lx)[1], length(lx)) - if ( !length(labels) ) - labels <- 1:ncats - ldim <- length(dim(labels)) - nlabels <- ifelse(ldim, length(labels[, 1]), length(labels)) - if (nlabels != ncats) - stop("lx and labels must all be the same length") - if (missing(xlim)) - xlim <- rep(ifelse(!is.null(lxdim), ceiling(max(c(rowSums(lx), - rowSums(rx)), na.rm = TRUE)), ceiling(max(c(lx, rx), - na.rm = TRUE))), 2) - if (!is.null(laxlab) && xlim[1] < max(laxlab)) - xlim[1] <- max(laxlab) - if (!is.null(raxlab) && xlim[2] < max(raxlab)) - xlim[2] <- max(raxlab) - oldmar <- par("mar") - if (!add) { - par(mar = ppmar, cex.axis = labelcex) - plot(0, xlim = c(-(xlim[1] + gap), xlim[2] + gap), ylim = c(0, - ncats + 1), type = "n", axes = FALSE, xlab = "", - ylab = "", xaxs = "i", yaxs = "i", main = main) - if (!is.null(do.first)) - eval(parse(text = do.first)) - if (is.null(laxlab)) { - laxlab <- seq(xlim[1] - gap, 0, by = -1) - axis(1, at = -xlim[1]:-gap, labels = laxlab) - } - else axis(1, at = -(laxlab + gap), labels = laxlab) - if (is.null(raxlab)) { - raxlab <- 0:(xlim[2] - gap) - axis(1, at = gap:xlim[2], labels = raxlab) - } - else axis(1, at = raxlab + gap, labels = raxlab) - if (gap > 0) { - if (!is.null(lxdim)) - axis(2, at = 1:ncats, labels = rep("", ncats), - pos = gap, tcl = -0.25) - else axis(2, at = 1:ncats * as.logical(rx + 1), labels = rep("", - ncats), pos = gap, tcl = -0.25) - if (!is.null(lxdim)) - axis(4, at = 1:ncats, labels = rep("", ncats), - pos = -gap, tcl = -0.25) - else axis(4, at = 1:ncats * as.logical(lx + 1), labels = rep("", - ncats), pos = -gap, tcl = -0.25) - } - if (is.null(dim(labels))) { - if (gap) - text(0, 1:ncats, labels, cex = labelcex) - else { - text(xlim[1], 1:ncats, labels, cex = labelcex, - adj = 0) - text(xlim[2], 1:ncats, labels, cex = labelcex, - adj = 1) - } - } - else { - if (gap) { - lpos <- -gap - rpos <- gap - } - else { - lpos <- -xlim[1] - rpos <- xlim[2] - } - text(lpos, 1:ncats, labels[, 1], pos = 4, cex = labelcex, - adj = 0) - text(rpos, 1:ncats, labels[, 2], pos = 2, cex = labelcex, - adj = 1) - } - cat(xlim,"\n") - mtext(top.labels,side=3,line=0, - at=c(-(xlim[1]+gap)/2,0,(xlim[2]+gap)/2), - adj = 0.5, cex = labelcex) - if(length(unit) == 1) mtext(unit,1,2.5,at=0,cex=labelcex) - else - mtext(c(unit,unit),1,2.5,at=c(-(xlim[1]+gap)/2,(xlim[2]+gap)/2), - cex=labelcex) - } - halfwidth <- 0.5 - space/2 - if (is.null(lxdim)) { - if (missing(lxcol)) - lxcol <- rainbow(ncats) - if (missing(rxcol)) - rxcol <- rainbow(ncats) - rect(-(lx + gap), 1:ncats - halfwidth, rep(-gap, ncats), - 1:ncats + halfwidth, col = lxcol) - rect(rep(gap, ncats), 1:ncats - halfwidth, (rx + gap), - 1:ncats + halfwidth, col = rxcol) - if (show.values) { - par(xpd = TRUE) - lxt <- formatC(lx, format = "f", digits = ndig) - rxt <- formatC(rx, format = "f", digits = ndig) - text(-(gap + lx), 1:ncats, lxt, pos = 2, cex = labelcex) - text(gap + rx, 1:ncats, rxt, pos = 4, cex = labelcex) - par(xpd = FALSE) - } - } - else { - nstack <- dim(lx)[2] - if (missing(lxcol)) - lxcol <- rainbow(nstack) - if (missing(rxcol)) - rxcol <- rainbow(nstack) - lxstart <- rxstart <- rep(gap, ncats) - for (i in 1:nstack) { - lxcolor <- rep(lxcol[i], ncats) - rxcolor <- rep(rxcol[i], ncats) - rect(-(lx[, i] + lxstart), 1:ncats - halfwidth, -lxstart, - 1:ncats + halfwidth, col = lxcolor) - rect(rxstart, 1:ncats - halfwidth, rx[, i] + rxstart, - 1:ncats + halfwidth, col = rxcolor) - lxstart <- lx[, i] + lxstart - rxstart <- rx[, i] + rxstart - } - } - return(oldmar) -} diff --git a/R/radial.grid.R b/R/radial.grid.R deleted file mode 100755 index aa1af18..0000000 --- a/R/radial.grid.R +++ /dev/null @@ -1,50 +0,0 @@ -radial.grid<-function(labels=NA,label.pos=NULL,radlab=FALSE,radial.lim=NULL, - start=0,clockwise=FALSE,label.prop=1.1,grid.pos=seq(0.25,1,0.25), - rad.col="gray",grid.col="gray",grid.bg="transparent",show.radial.grid=TRUE, - start.plot=FALSE) { - - if(start.plot) { - radial.span<-diff(radial.lim) - plot(0,type="n",xlim=c(-1.2*radial.span,1.2*radial.span), - ylim=c(-1.2*radial.span,1.2*radial.span),xlab="",ylab="",axes=FALSE) - } - par(xpd=TRUE) - if(is.null(label.pos)) label.pos<-seq(0,1.8*pi,length=9) - if(!is.null(labels)) { - if(is.na(labels[1])) labels<-as.character(round(label.pos,2)) - } - if(clockwise) label.pos<--label.pos - if(start) label.pos<-label.pos+start - # display the circumferential grid - angles<-seq(0,1.96*pi,by=0.04* pi) - for(i in seq(length(grid.pos),1,by=-1)) { - xpos<-cos(angles)*(grid.pos[i]-radial.lim[1]) - ypos<-sin(angles)*(grid.pos[i]-radial.lim[1]) - polygon(xpos,ypos,border=grid.col,col=grid.bg) - } - maxlength<-max(grid.pos)-radial.lim[1] - # display the radial grid - if(show.radial.grid) { - xpos<-cos(label.pos)*maxlength - ypos<-sin(label.pos)*maxlength - segments(0,0,xpos,ypos,col=rad.col) - xpos<-cos(label.pos)*maxlength - ypos<-sin(label.pos)*maxlength - } - # display the circumferential labels - if(!is.null(labels)) { - xpos<-cos(label.pos)*maxlength*label.prop - ypos<-sin(label.pos)*maxlength*label.prop - if(radlab) { - for(label in 1:length(labels)) { - labelsrt<-(180*label.pos[label]/pi)+180* - (label.pos[label] > pi/2 && label.pos[label] < 3*pi/2) - text(xpos[label],ypos[label],labels[label], - cex=par("cex.axis"),srt=labelsrt) - } - } - else - boxed.labels(xpos,ypos,labels,ypad=0.7,border=FALSE,cex=par("cex.axis")) - } - par(xpd = FALSE) -} diff --git a/R/radial.pie.R b/R/radial.pie.R deleted file mode 100644 index 1800653..0000000 --- a/R/radial.pie.R +++ /dev/null @@ -1,121 +0,0 @@ -drawSectorAnnulus<-function(angle1,angle2,radius1,radius2,col,angleinc=0.03) { - if(angle1 > angle2) { - temp<-angle1 - angle1<-angle2 - angle2<-temp - } - if(radius1 > radius2) { - temp<-radius1 - radius1<-radius2 - radius2<-temp - } - angles<-seq(angle1,angle2,by=angleinc) - angles[length(angles)]<-angle2 - xpos<-c(cos(angles)*radius1,cos(rev(angles))*radius2) - ypos<-c(sin(angles)*radius1,sin(rev(angles))*radius2) - polygon(xpos,ypos,col=col,border=col) -} - -# plots sectors composed of one or more sectors of annuli on a circular grid. -# radial.extents are the radial extents of the sectors (a vector), -# optionally with sub-extents that define the annuli -# (a matrix with each sector a column) -# sector.edges are the positions of the radii that define the sectors, -# defaulting to n equal sectors filling the circle where -# n is the number of radial extents. -# sector.values are the values in each sector of an annulus that -# will be represented by colors and must be the same data type and -# dimension as radial.extents. -# If a list of sector colors is passed, it will take precedence -# and sector.colors will not be scaled from sector.values - -radial.pie<-function(radial.extents,sector.edges=NULL, - sector.colors=NULL,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1),alpha=1, - labels=NA,label.pos=NULL,radlab=FALSE,start=0,clockwise=FALSE, - label.prop=1.1,radial.lim=NULL,main="",xlab="",ylab="",mar=c(2,2,3,2), - show.grid=TRUE,show.grid.labels=4,show.radial.grid=TRUE, - grid.col="gray",grid.bg="transparent",grid.unit=NULL, - radial.labels=NULL,boxed.radial=TRUE,add=FALSE,...) { - - if(is.null(radial.lim)) radial.lim<-range(radial.extents) - if(is.null(sector.edges)) { - if(clockwise) - sector.edges<-seq(2*pi+start,start,length.out=length(radial.extents)+1) - else - sector.edges<-seq(start,2*pi+start,length.out=length(radial.extents)+1) - } - if(is.null(label.pos)) - label.pos<-sector.edges[-length(sector.edges)]+diff(sector.edges)/2 - if(show.grid) { - if(length(radial.lim) < 3) grid.pos<-pretty(radial.lim) - else grid.pos<-radial.lim - if(grid.pos[1] < radial.lim[1]) grid.pos<-grid.pos[-1] - maxlength<-max(grid.pos-radial.lim[1]) - } - else { - grid.pos<-NA - maxlength<-diff(radial.lim) - } - oldpar<-par("xpd","mar","pty") - if(!add) { - par(mar=mar,pty="s") - maxrad<-max(unlist(radial.extents)) - plot(0,xlim=c(-maxrad,maxrad),ylim=c(-maxrad,maxrad),type="n", - axes=FALSE,xlab=xlab,ylab=ylab) - if(show.grid) - radial.grid(labels=labels,label.pos=label.pos,radlab=radlab, - radial.lim=radial.lim,start=start,clockwise=clockwise, - label.prop=label.prop,grid.pos=grid.pos, - grid.col=grid.col,grid.bg=grid.bg) - } - fadeColor<-function(col,nfades) { - rgbcol<-col2rgb(col) - redinc<-(255-rgbcol[1])/nfades - reds<-(rgbcol[1]+0:nfades*redinc)/255 - greeninc<-(255-rgbcol[2])/nfades - greens<-(rgbcol[2]+0:nfades*greeninc)/255 - blueinc<-(255-rgbcol[3])/nfades - blues<-(rgbcol[3]+0:nfades*blueinc)/255 - return(rgb(reds[1:nfades],greens[1:nfades],blues[1:nfades])) - } - nsectors<-length(radial.extents) - if(is.list(radial.extents)) { - if(is.null(sector.colors)) sector.colors<-rainbow(nsectors) - for(sector in 1:nsectors) { - annuli<-radial.extents[[sector]] - annulus.colors<-fadeColor(sector.colors[[sector]],length(annuli)) - for(annulus in 1:(length(annuli)-1)) { - drawSectorAnnulus(sector.edges[[sector]],sector.edges[[sector+1]], - annuli[annulus],annuli[annulus+1],annulus.colors[annulus]) - } - } - } - else { - if(is.null(sector.colors)) sector.colors<-rainbow(nsectors) - for(sector in 1:nsectors) { - drawSectorAnnulus(sector.edges[sector],sector.edges[sector+1], - 0,radial.extents[sector],sector.colors[sector]) - } - } - if(show.grid.labels) { - if(show.grid.labels%%2) { - ypos<-grid.pos-radial.lim[1] - xpos<-rep(0,length(grid.pos)) - if(show.grid.labels==1) ypos<--ypos - } - else { - xpos<-grid.pos-radial.lim[1] - ypos<-rep(0,length(grid.pos)) - if(show.grid.labels==2) xpos<--xpos - } - if(is.null(radial.labels)) radial.labels<-grid.pos - if(!is.null(grid.unit)) - radial.labels[length(grid.pos)]<- - paste(radial.labels[length(grid.pos)],grid.unit) - if(boxed.radial) - boxed.labels(xpos,ypos,radial.labels,border=FALSE, - cex=par("cex.lab")) - else text(xpos,ypos,radial.labels,cex=par("cex.lab")) - } - invisible(oldpar) -} diff --git a/R/radial.plot.R b/R/radial.plot.R deleted file mode 100755 index b9c15a4..0000000 --- a/R/radial.plot.R +++ /dev/null @@ -1,241 +0,0 @@ -# plots data as radial lines or a polygon on a 24 hour "clockface" going -# clockwise. clock.pos should be in decimal hours between 0 and 24. -# use hm2dec=TRUE to convert hour/minute values to hour/decimal values. -# example: clock24.plot(rnorm(16)+3,seq(5.5,20.5,length.out=16)) - -clock24.plot<-function(lengths,clock.pos,labels=0:23,minutes=FALSE, - hm2dec=FALSE,label.pos=NULL,rp.type="r",loglen=FALSE,explab=FALSE,...) { - - npos<-length(lengths) - # if no positions are given, spread the lines out over the circle - if(missing(clock.pos)) clock.pos<-seq(0,24-24/(npos+1),length=npos) - else { - if(hm2dec) { - splittime<-strsplit(clock.pos,":") - hm2dh<-function(x) return(as.numeric(x[1])+as.numeric(x[2])/60) - clock.pos<-sapply(splittime,hm2dh) - } - } - # start at "midnight" and go clockwise - radial.pos<-pi*(clock.pos*15)/180 - if(minutes) labels<-paste(labels,"00",sep=":") - if(is.null(label.pos)) label.pos<-seq(0,pi*1.917,length.out=24) - invisible(radial.plot(lengths,radial.pos,labels=labels,label.pos=label.pos, - rp.type=rp.type,start=pi/2,clockwise=TRUE,loglen=loglen,explab=explab,...)) -} - -# plots data as radial lines or a polygon starting at the right and going -# counterclockwise. -# angles should be given in 0-360 values, use radial.plot for radians -# example: polar.plot(rnorm(20)+3,seq(90,280,by=10)) - -polar.plot<-function(lengths,polar.pos=NULL,labels,label.pos=NULL, - start=0,clockwise=FALSE,rp.type="r",loglen=FALSE,explab=FALSE,...) { - - npoints<-length(lengths) - if(is.null(polar.pos)) { - halfinc<-pi/npoints # evenly spaced, offset from zero - radial.pos<-seq(halfinc,2*pi-halfinc,length.out=npoints) - } - else radial.pos<-pi*polar.pos/180 - if(start) start<-pi*start/180 - if(missing(labels)) { - labels<-label.pos<-seq(0,340,by=20) - } else if (length(labels) == 1 && labels == "") - label.pos <- NULL - if(!is.null(label.pos)) - label.pos <- pi*label.pos/180 - invisible(radial.plot(lengths,radial.pos,labels,label.pos,start=start, - clockwise=clockwise,rp.type=rp.type,loglen=loglen,explab=explab,...)) -} - -# plots radial lines of length 'lengths', symbols at 'lengths' from the -# center or a polygon with corresponding vertices at 'radial.pos' in radians. -# starts at the 'east' position and goes counterclockwise unless -# the "start" and "clockwise" arguments are changed -# label.prop is the proportion of max(lengths) that gives the -# radial position of the labels - -radial.plot<-function(lengths,radial.pos=NULL,labels=NA,label.pos=NULL, - radlab=FALSE,start=0,clockwise=FALSE,rp.type="r",label.prop=1.1,main="", - xlab="",ylab="",line.col=par("fg"),lty=par("lty"),lwd=par("lwd"), - mar=c(2,2,3,2),show.grid=TRUE,show.grid.labels=4,show.radial.grid=TRUE, - rad.col="gray",grid.col="gray",grid.bg="transparent",grid.left=FALSE, - grid.unit=NULL,point.symbols=1,point.col=par("fg"),show.centroid=FALSE, - radial.lim=NULL,radial.labels=NULL,boxed.radial=TRUE,poly.col=NA, - add=FALSE,loglen=FALSE,explab=FALSE,...) { - - # first convert lengths to log values if desired - if(loglen) lengths<-do.call(log10,list(lengths)) - if(is.null(radial.lim)) radial.lim<-c(floor(min(lengths,na.rm=TRUE)), - ceiling(max(lengths,na.rm=TRUE))) - length.dim<-dim(lengths) - if(is.null(length.dim)) { - npoints<-length(lengths) - nsets<-1 - lengths<-matrix(lengths,nrow=1) - } - else { - npoints<-length.dim[2] - nsets<-length.dim[1] - lengths<-as.matrix(lengths) - } - lengths<-lengths-radial.lim[1] - lengths[lengths<0]<-NA - if(is.null(radial.pos)) { - halfinc<-pi/npoints # evenly spaced, offset from zero - radial.pos<-seq(halfinc,2*pi-halfinc,length.out=npoints) - } - if(is.null(label.pos)) label.pos=radial.pos - radial.pos.dim<-dim(radial.pos) - if(is.null(radial.pos.dim)) - radial.pos<-matrix(rep(radial.pos,nsets),nrow=nsets,byrow=TRUE) - else radial.pos<-as.matrix(radial.pos) - if(rp.type == "l" && clockwise == TRUE) start<-pi/2 - if(clockwise) radial.pos<--radial.pos - if(start) radial.pos<-radial.pos+start - if(show.grid) { - if(loglen == 0) { - if(length(radial.lim) < 3) grid.pos<-pretty(radial.lim) - else grid.pos<-radial.lim - } else { - # log scaling is ON - rangerl<-ceiling(radial.lim) - grid.pos<-rangerl[1]:rangerl[2] - oddnum<-length(grid.pos) %% 2 - if(oddnum) dropit<-2 - while(length(grid.pos) > 6) { - if(oddnum) { - grid.pos<-grid.pos[-dropit] - dropit<-dropit+1 - } else { - grid.pos<-grid.pos[seq(1,length(grid.pos),by=2)] - } - } - if(is.null(radial.labels)) { - if(explab) radial.labels<-paste0(10,"^",grid.pos) - else radial.labels<-10^grid.pos - } - if(grid.pos[1] < radial.lim[1]) grid.pos[1]<-radial.lim[1] - angles<-seq(0,1.96*pi,by=0.04*pi) - } - maxlength<-max(grid.pos-radial.lim[1]) - } else { - grid.pos<-NA - maxlength<-diff(radial.lim) - } - oldpar<-par("xpd","mar","pty") - if(!add) { - par(mar=mar,pty="s") - plot(c(-maxlength,maxlength),c(-maxlength,maxlength),type="n",axes=FALSE, - main=main,xlab=xlab,ylab=ylab) - if(show.grid) { - radial.grid(labels=labels,label.pos=label.pos,radlab=radlab, - radial.lim=radial.lim,start=start,clockwise=clockwise, - label.prop=label.prop,grid.pos=grid.pos,rad.col=rad.col, - grid.col=grid.col,grid.bg=grid.bg, - show.radial.grid=show.radial.grid) - } - } - par(xpd=TRUE) - # stretch everything out to the correct length - if(length(line.col) < nsets) line.col<-1:nsets - if(length(rp.type) < nsets) rp.type<-rep(rp.type,length.out=nsets) - if(length(point.symbols) < nsets) - point.symbols<-rep(point.symbols,length.out=nsets) - if(length(point.col) < nsets) point.col<-rep(point.col,length.out=nsets) - if(length(poly.col) < nsets) poly.col<-rep(poly.col,length.out=nsets) - if(length(lty) < nsets) lty<-rep(lty,length.out=nsets) - if(length(lwd) < nsets) lwd<-rep(lwd,length.out=nsets) - for(i in 1:nsets) { - if(nsets > 1) { - linecol<-line.col[i] - polycol<-poly.col[i] - pointcol<-point.col[i] - pointsymbols<-point.symbols[i] - ltype<-lty[i] - lwidth<-lwd[i] - } - else { - linecol<-line.col - polycol<-poly.col - pointcol<-point.col - pointsymbols<-point.symbols - ltype<-lty - lwidth<-lwd - } - # split up rp.type if there is a combination of displays - rptype<-unlist(strsplit(rp.type[i],"")) - if(match("s",rptype,0)) { - if(is.null(pointsymbols)) pointsymbols<-i - if(is.null(pointcol)) pointcol<-i - } - # get the vector of x positions - xpos<-cos(radial.pos[i,])*lengths[i,] - # get the vector of y positions - ypos<-sin(radial.pos[i,])*lengths[i,] - # plot radial lines if rp.type == "r" - if(match("r",rptype,0)) - segments(0,0,xpos,ypos,col=linecol,lty=ltype,lwd=lwidth,...) - if(match("p",rptype,0)) - polygon(xpos,ypos,border=linecol,col=polycol,lty=ltype, - lwd=lwidth,...) - if(match("s",rptype,0)) - points(xpos,ypos,pch=point.symbols,col=pointcol,...) - if(match("t",rptype,0)) { - if(boxed.radial) - boxed.labels(xpos,ypos,point.symbols,col=pointcol) - else text(xpos,ypos,point.symbols,col=pointcol) - } - if(match("l",rptype,0)) - lines(xpos,ypos,lty=ltype,lwd=lwidth,col=linecol,...) - if(show.centroid) { - if(match("p",rptype,0)) { - nvertices<-length(xpos) - # first get the "last to first" area component - polygonarea<-xpos[nvertices]*ypos[1] - xpos[1]*ypos[nvertices] - for(vertex in 1:(nvertices-1)) - polygonarea<- - polygonarea+xpos[vertex]*ypos[vertex+1]-xpos[vertex+1]*ypos[vertex] - polygonarea<-polygonarea/2 - centroidx<- - (xpos[nvertices]+xpos[1])*(xpos[nvertices]*ypos[1]-xpos[1]*ypos[nvertices]) - centroidy<- - (ypos[nvertices]+ypos[1])*(xpos[nvertices]*ypos[1]-xpos[1]*ypos[nvertices]) - for(vertex in 1:(nvertices-1)) { - centroidx<-centroidx + (xpos[vertex]+xpos[vertex+1])* - (xpos[vertex]*ypos[vertex+1]-xpos[vertex+1]*ypos[vertex]) - centroidy<-centroidy + (ypos[vertex]+ypos[vertex+1])* - (xpos[vertex]*ypos[vertex+1]-xpos[vertex+1]*ypos[vertex]) - } - points(centroidx/(6*polygonarea),centroidy/(6*polygonarea), - col=point.col[i],pch=point.symbols[i],cex=2,...) - - } - else - points(mean(xpos),mean(ypos),col=pointcol,pch=pointsymbols, - cex=2,...) - } - } - if(show.grid.labels && !add) { - if(show.grid.labels%%2) { - ypos<-grid.pos-radial.lim[1] - xpos<-rep(0,length(grid.pos)) - if(show.grid.labels==1) ypos<--ypos - } - else { - xpos<-grid.pos-radial.lim[1] - ypos<-rep(0,length(grid.pos)) - if(show.grid.labels==2) xpos<--xpos - } - if(is.null(radial.labels)) radial.labels<-grid.pos - if(!is.null(grid.unit)) - radial.labels[length(grid.pos)]<- - paste0(radial.labels[length(grid.pos)],grid.unit) - if(boxed.radial) - boxed.labels(xpos,ypos,radial.labels,border=FALSE, - cex=par("cex.lab")) - else text(xpos,ypos,radial.labels,cex=par("cex.lab")) - } - invisible(oldpar) -} diff --git a/R/radial.plot.labels.R b/R/radial.plot.labels.R deleted file mode 100755 index dfb219e..0000000 --- a/R/radial.plot.labels.R +++ /dev/null @@ -1,36 +0,0 @@ -radial.plot.labels<-function(lengths,radial.pos=NULL,units="radians", - radial.lim = NULL,start=0,clockwise=FALSE,labels,adj=NULL,pos=NULL, - boxed.labels=FALSE,...) { - - npoints<-length(lengths) - if(is.null(radial.pos)) - radial.pos<-seq(0,pi*(2-2/npoints),length.out=npoints) - else { - # clock24 starts at "midnight" and always runs clockwise - if(units == "clock24") { - if(is.character(radial.pos)) { - splittime<-strsplit(radial.pos,":") - hm2dh<-function(x) return(as.numeric(x[1])+as.numeric(x[2])/60) - radial.pos<-sapply(splittime,hm2dh) - } - radial.pos<-pi*(450-radial.pos*15)/180 - start<-pi*(450-start*15)/180 - } - # polar starts at 3 o'clock and runs counterclockwise by default - if(units == "polar") { - radial.pos <- pi * radial.pos/180 - start <- pi * start/180 - } - } - if(clockwise && units != "clock24") radial.pos<--radial.pos - if (start && units != "clock24") radial.pos<-radial.pos+start - if (is.null(radial.lim)) radial.lim <- range(lengths) - lengths<-lengths-radial.lim[1] - # get the vector of x positions - xpos<-cos(radial.pos)*lengths - # get the vector of y positions - ypos<-sin(radial.pos)*lengths - if(boxed.labels) - boxed.labels(x=xpos,y=ypos,labels=labels,...) - else text(x=xpos,y=ypos,labels=labels,adj=adj,pos=pos,...) -} diff --git a/R/radialtext.R b/R/radialtext.R deleted file mode 100644 index 8cda16a..0000000 --- a/R/radialtext.R +++ /dev/null @@ -1,62 +0,0 @@ -radialtext <- function(x, center=c(0,0), start=NA, middle=1, end=NA, angle=0, deg=NA, - expand=0, stretch=1, nice=TRUE, cex=NA, ...) - { - oldcex <- par("cex") - if (is.na(cex)) - cex <- oldcex - par(cex=cex) - if (is.na(deg)) - deg <- angle*180/pi - deg <- deg %% 360 - chardeg <- deg - if (nice && (deg > 90 && deg < 270)) - { - chardeg <- (deg + 180) %% 360 - x <- paste(rev(unlist(strsplit(x, ""))),collapse="") - } - angle <- deg*pi/180 - xvec <- strsplit(x, "")[[1]] - lenx <- length(xvec) - xwidths <- stretch * strwidth(xvec) - xwrange <- range(xwidths) - xwidths[xwidths < xwrange[2]/2] <- xwrange[2]/2 # Make really narrow characters wider - # Compute expand factor for each character and adjust character widths accordingly. - chexp <- rep(1, lenx) - if (!is.na(start) && expand != 0) - { - # Note: width of each char changes in succession, affecting sizes AND positions. - expfactor <- expand/start - deltar <- 0 - for (xchar in 2:lenx) - { - deltar <- deltar + xwidths[xchar-1] - expansion <- 1+deltar*expfactor - if (expansion < 0.1) expansion <- 0.1 - chexp[xchar] <- expansion - xwidths[xchar] <- xwidths[xchar]*expansion - } - } - # Find start distance - if (is.na(start)) - { - if (is.na(end)) - start <- middle - sum(xwidths)/2 - else - start <- end - sum(xwidths) - } - cosang <- cos(angle) - sinang <- sin(angle) - charstart <- c(start, start + cumsum(xwidths)[-lenx]) - charpos <- charstart + xwidths/2 - xylim <- par("usr") - plotdim <- par("pin") - ymult <- (xylim[4] - xylim[3])/(xylim[2] - xylim[1]) * plotdim[1]/plotdim[2] - for (xchar in 1:lenx) - { - par(cex=cex*chexp[xchar]) - text(center[1] + charpos[xchar] * cosang, - center[2] + charpos[xchar] * ymult * sinang, xvec[xchar], - adj=c(0.5, 0.5), srt=chardeg, ...) - } - par(cex=oldcex) - } diff --git a/R/raw.means.plot.R b/R/raw.means.plot.R deleted file mode 100644 index 25dbc3c..0000000 --- a/R/raw.means.plot.R +++ /dev/null @@ -1,209 +0,0 @@ - -# more explanatory name for the function -raw.means.plot <-function(data, col.offset = 2, col.x = 3, col.value = 4, na.rm = FALSE, - avoid.overlap = c("y", "x", "both"), y.factor = 1, y.amount = NULL, x.amount = 0.05, - pch = 21:25, lty = 1:5, bg.b.col = "darkgrey", - bg.f.col = NULL, fg.b.col = "black", fg.f.col = "black", - type = "o", pt.cex = 1, lwd = 1, xlab = "", ylab = "", ylim, - max.offset = 0.2, xaxis = TRUE, x.labels, xaxt = "n", plot = TRUE, - legend = TRUE, mar = NULL, reset.mar = TRUE, l.pos, yjust = 0.5, - l.bty = "n", l.adj = c(0, 0.5), ...) -{ - # I somehow like more the idea of using random jitter. - - spread.out <- function(x, x.amount) { - dupl <- duplicated(x) - spreadx <- rep(0,length(x)) - spreadx[dupl] <- jitter(spreadx[dupl], amount = x.amount) - return(spreadx) - } - - addJitter <- function (x, y.factor, y.amount) { - dupl <- duplicated(x) - x[dupl] <- jitter(x[dupl], factor = y.factor, amount = y.amount) - return(x) - } - - - # I personally more like the spreading on the y-axis, but I totally agree that - # spacing on the x-axis is also totally reasonable. - create.dp <- function(lst, n.x, avoid.overlap, y.factor, y.amount, x.amount) { - ret <- vector("list", 2) - #browser() - if (avoid.overlap[1] %in% c("x", "both")) - ret[[1]] <- rep(1:n.x, vapply(lst, length, 0)) + - unlist(lapply(lst, spread.out, x.amount = x.amount)) - else ret[[1]] <- rep(1:n.x, vapply(lst, length, 0)) - if (avoid.overlap[1] %in% c("y", "both")) - ret[[2]] <- unlist(lapply(lst, addJitter, y.factor=y.factor, y.amount = y.amount)) - else ret[[2]] <- unlist(lst) - return(ret) - } - largs <- c("fill", "border", "angle", "density", "box.lwd", - "box.lty", "box.col", "pt.lwd", "xjust", "x.intersp", - "y.intersp", "text.width", "text.col", "merge", "trace", - "plot", "ncol", "horiz", "title", "inset", "title.col", - "title.adj") - dots <- list(...) - args.to.l <- dots[names(dots) %in% largs] - args.to.p <- dots[!(names(dots) %in% largs)] - if (!is.data.frame(data)) - stop("data must be a data.frame") - # I used "any" here as it seems more straightforward - # I notice that you used it in add.ps - if (any(is.na(data[, c(col.offset, col.x)]))) - warning("NAs in offset or x column (this produces other warnings).") - # as above - if (na.rm == FALSE) - if (any(is.na(data[, c(col.value)]))) - stop("NAs in data column. Try: na.rm = TRUE") - if (!is.factor(data[, col.offset])) { - warning(paste("Converting offset variable (column ", - col.offset, ") to factor.", sep = "")) - data[, col.offset] <- factor(data[, col.offset]) - } - if (!is.factor(data[, col.x])) { - warning(paste("Converting x-axis variable (column ", - col.offset, ") to factor.", sep = "")) - data[, col.x] <- factor(data[, col.x]) - } - if ((length(levels(data[, col.x])) != length(unique(data[, col.x])))) { - warning(paste("Refactoring x-axis variable (column ", - col.x, ") due to length mismatch.", sep = "")) - data[, col.x] <- factor(data[, col.x]) - } - if ((length(levels(data[, col.offset])) != length(unique(data[, - col.offset])))) { - warning(paste("Refactoring offset variable (column ", - col.offset, ") due to length mismatch.", sep = "")) - data[, col.offset] <- factor(data[, col.offset]) - } - if (missing(ylim)) { - # I think that range is equivalent to c(min,max) here - ylim <- range(data[, col.value], na.rm = na.rm) - warning(paste("ylim not specified, taken from data: ", - ylim[1], " - ", ylim[2], sep = "")) - } - n.offset <- length(levels(data[, col.offset])) - n.x <- length(levels(data[, col.x])) - if (!(missing(x.labels))) { - if (length(x.labels) < n.x) { - warning("x.labels too short, taking unique(data[,col.x]) as labels at x-axis ticks") - x.labels <- levels(data[, col.x]) - } - } - while (length(pch) < n.offset) { - warning("pch vector too short. recycling pch vector.") - # this makes sure that the pch vector will be long enough - pch <- rep(pch, length.out=n.offset) - } - while (length(lty) < n.offset) { - warning("lty vector too short. recycling lty vector.") - # ditto for the line type - lty <- rep(lty, length.out=n.offset) - } - if (!is.null(bg.b.col)) { - while (length(bg.b.col) < n.offset) { - bg.b.col <- rep(bg.b.col, length.out=n.offset) - } - } - if (!is.null(bg.f.col)) { - while (length(bg.f.col) < n.offset) { - bg.f.col <- rep(bg.f.col, length.out=n.offset) - } - } - if (!is.null(fg.b.col)) { - while (length(fg.b.col) < n.offset) { - fg.b.col <- rep(fg.b.col, length.out=n.offset) - } - } - if (!is.null(fg.f.col)) { - while (length(fg.f.col) < n.offset) { - fg.f.col <- rep(fg.f.col, length.out=n.offset) - } - } - if (missing(x.labels)) { - x.labels <- levels(data[, col.x]) - } - orig.mar <- par("mar") - if (legend == TRUE & is.null(mar)) { - mar <- orig.mar - max.l <- max(nchar(levels(data[, col.offset]))) - if (max.l < 3) - rb <- 4.2 - else if (max.l > 2 & max.l < 5) - rb <- 5 - else if (max.l > 4 & max.l < 7) - rb <- 6 - else if (max.l > 6 & max.l < 9) - rb <- 7 - else rb <- 8 - mar[4] <- rb + 0.1 - } - if (!plot) - mar <- c(0, 0, 0, 0) - if (!is.null(mar)) - res.mar <- par(mar = mar) - nd <- split(data, data[, col.offset]) - if (plot) { - do.call("plot", c(list(x = 1, y = 2, xlim = c((1 - max.offset - - 0.2), (n.x + max.offset + 0.2)), ylim = ylim, xaxt = xaxt, - type = "n", xlab = xlab, ylab = ylab), args.to.p)) - if (n.offset > 1) { - offset.start <- max.offset - ((1 - (n.offset%%2)) * - (max.offset/n.offset)) - offset.dist <- max.offset/((n.offset - (n.offset%%2))/2) - } - if (n.offset == 1) { - offset.start <- 0 - offset.dist <- 0 - } - for (c in 1:n.offset) { - d.c <- nd[[c]] - d.lst <- split(d.c[, col.value], d.c[, col.x]) - dp <- create.dp(lst = d.lst, n.x = n.x, avoid.overlap = avoid.overlap, y.factor = y.factor, y.amount = y.amount, x.amount = x.amount) - x <- dp[[1]] - ((offset.start) - ((c - 1) * offset.dist)) - y <- dp[[2]] - points(x, y, pch = pch[c], col = bg.b.col[c], bg = bg.f.col[c], - cex = pt.cex) - } - for (c in 1:n.offset) { - d.c <- nd[[c]] - d.lst <- split(d.c[, col.value], d.c[, col.x]) - x <- 1:n.x - ((offset.start) - ((c - 1) * offset.dist)) - y <- vapply(d.lst, mean, 0, na.rm = na.rm) - lines(x, y, pch = pch[c], type = type, lty = lty[c], - col = fg.b.col[c], bg = fg.f.col[c], cex = pt.cex, - lwd = lwd) - } - if (xaxis == TRUE) - axis(side = 1, at = 1:n.x, labels = x.labels) - } - if (!plot) { - plot(0, 0, type = "n", xlim = c(0, 10), ylim = c(0, 10), - axes = FALSE, ylab = "", xlab = "", mar = c(0, 0, - 0, 0)) - if (missing(l.pos)) - l.pos = c(5, 5) - } - if (legend == TRUE) { - if (n.x == 1) { - if (missing(l.pos)) { - l.pos <- (n.x + 0.45) - l.pos[2] <- (ylim[2] - ((ylim[2] - ylim[1])/2)) - } - lty <- NULL - } - else (if (missing(l.pos)) { - l.pos <- (n.x + max.offset + 0.4) - l.pos[2] <- (ylim[2] - ((ylim[2] - ylim[1])/2)) - }) - do.call("legend", c(list(x = l.pos[1], y = l.pos[2], - levels(data[, col.offset]), pch = pch, lty = lty, col = fg.b.col, - pt.bg = fg.f.col, yjust = yjust, bty = l.bty, adj = l.adj, - xpd = TRUE, pt.cex = pt.cex, lwd = lwd), args.to.l)) - } - if (legend == TRUE & reset.mar == TRUE) { - par(mar = res.mar) - } -} diff --git a/R/rectFill.R b/R/rectFill.R deleted file mode 100644 index d7c4edc..0000000 --- a/R/rectFill.R +++ /dev/null @@ -1,28 +0,0 @@ -rectFill<-function(x1,y1,x2,y2,fg=par("fg"),bg=par("bg"),xinc=NA,yinc=NA, - pch=1,pch.cex=1,pch.col=par("fg"),...) { - - if(is.na(xinc[1])) xinc<-strwidth(pch,cex=pch.cex) - if(is.na(yinc[1])) yinc<-strheight(pch,cex=pch.cex) - nrect<-length(x1) - if(length(fg) < nrect) fg<-rep(fg,nrect) - if(length(bg) < nrect) bg<-rep(bg,nrect) - if(length(xinc) < nrect) xinc<-rep(xinc,nrect) - if(length(yinc) < nrect) yinc<-rep(yinc,nrect) - if(length(pch) < nrect) pch<-rep(pch,nrect) - if(length(pch.cex) < nrect) pch.cex<-rep(pch.cex,nrect) - if(length(pch.col) < nrect) pch.col<-rep(pch.col,nrect) - for(frect in 1:nrect) { - rect(x1[frect],y1[frect],x2[frect],y2[frect],col=bg[frect],border=fg[frect]) - if(yinc[frect] > 0) { - xpos<-seq(x1[frect]+xinc[frect]/2,x2[frect]+xinc[frect]/2,by=xinc[frect]) - lenxpos<-length(xpos) - ypos<-seq(y1[frect]+yinc[frect]/2,y2[frect]+yinc[frect],by=yinc[frect]) - lenypos<-length(ypos) - xpos<-rep(xpos,each=lenypos) - ypos<-rep(ypos,lenxpos) - clip(x1[frect],x2[frect],y1[frect],y2[frect]) - points(xpos,ypos,pch=pch[frect],cex=pch.cex[frect],col=pch.col[frect],...) - } - } - do.call(clip,as.list(par("usr"))) -} diff --git a/R/rescale.R b/R/rescale.R deleted file mode 100644 index f5d7199..0000000 --- a/R/rescale.R +++ /dev/null @@ -1,24 +0,0 @@ -# linearly transforms a vector or matrix of numbers to a new range - -rescale<-function(x,newrange) { - if(missing(x) | missing(newrange)) { - usage.string<-paste("Usage: rescale(x,newrange)\n", - "\twhere x is a numeric object and newrange is the new min and max\n", - sep="",collapse="") - stop(usage.string) - } - if(is.numeric(x) && is.numeric(newrange)) { - xna<-is.na(x) - if(all(xna)) return(x) - if(any(xna)) xrange<-range(x[!xna]) - else xrange<-range(x) - # if x is constant, just return it - if(xrange[1] == xrange[2]) return(x) - mfac<-(newrange[2]-newrange[1])/(xrange[2]-xrange[1]) - return(newrange[1]+(x-xrange[1])*mfac) - } - else { - warning("Only numeric objects can be rescaled") - return(x) - } -} diff --git a/R/revaxis.R b/R/revaxis.R deleted file mode 100644 index 5e8d1ef..0000000 --- a/R/revaxis.R +++ /dev/null @@ -1,35 +0,0 @@ -# Function revaxis --- rev for ``reverse'' (to reverse the direction of -# axes). -# -# Written by T. Rolf Turner, University of New Brunswick (now -# with the Starpath Project, Universtiy of Auckland). -# -# Some bugs fixed 7/2/02, with the assistance of Herberto Ghezzo -# of McGill University. -# -revaxis<-function(x,y,xrev=FALSE,yrev=TRUE,xside=if(yrev) 3 else 1, - yside=if(xrev) 4 else 2,xlab=NULL,ylab=NULL,bty=NULL,...) { - - xname <- if(is.null(xlab)) deparse(substitute(x)) else xlab - yname <- if(is.null(ylab)) deparse(substitute(y)) else ylab - xlab <- if(yrev) "" else xname - ylab <- if(xrev) "" else yname - y1 <- if(yrev) -y else y - x1 <- if(xrev) -x else x - old.mar <- par()$mar - on.exit(par(mar = old.mar)) - par(mar = old.mar[c(xside, yside, 4 - xside, 6 - yside)]) - plot(x1, y1, axes = FALSE, xlab = xlab, ylab = ylab, ...) - if(xrev) { - axis(xside, at = pretty(-x), labels = rev(pretty(x))) - mtext(side = yside, line = 2, text = yname) - } - else axis(xside) - if(yrev) { - axis(yside,at=pretty(-y),labels=rev(pretty(y)),srt=90) - mtext(side=xside,line=3,text=xname) - } - else axis(yside) - if(!is.null(bty)) box(bty = bty) - invisible() -} diff --git a/R/rm.plot2.R b/R/rm.plot2.R deleted file mode 100644 index e91dcbd..0000000 --- a/R/rm.plot2.R +++ /dev/null @@ -1,14 +0,0 @@ - -raw.means.plot2 <- function(data, col.id, col.offset, col.x, col.value, fun.aggregate = "mean", ... ) { - - if(!is.data.frame(data)) stop("data must be a data.frame") - - columns <- c(col.id, col.offset, col.x, col.value) - - if (any(!(columns %in% colnames(data)))) stop("column not matching the data") - - formula.agg <- as.formula(paste(col.value, "~", col.id, "+", col.offset, "+", col.x)) - - d.new <- aggregate(formula.agg, data = data, FUN = fun.aggregate) - raw.means.plot(d.new, col.offset = col.offset, col.x = col.x, col.value = col.value, ...) -} diff --git a/R/ruginv.R b/R/ruginv.R deleted file mode 100644 index de41e85..0000000 --- a/R/ruginv.R +++ /dev/null @@ -1,37 +0,0 @@ -ruginv<-function(x,ticksize=0.03,side=1,lwd=0.5,col=par("fg"), - col.ticks="white",quiet=getOption("warn")<0,...) { - - x<-as.vector(x) - ok=is.finite(x) - x<-x[ok] - if(!quiet) { - u<-par("usr") - if(side%%2 == 1) { - if(par("xlog")) u<-10^u[1:2] - else u<-u[1:2] - } - else { - if(par("ylog")) u<-10^u[3:4] - else u<-u[3:4] - } - if(any(x < u[1] | x > u[2])) warning("Some values will be clipped") - } - u<-par("usr") - par("pin") - if(ticksize < 0.5) tic<-min(diff(u[3:4]),diff(u[1:2]))*ticksize - else tic<-ifelse(side%%2 == 1,diff(u[3:4]),diff(u[1:2]))*ticksize - if(ticksize < 0) opar<-par(xpd=TRUE) - switch(as.character(side), - "1"=polygon(u[c(1,2,2,1,1)],u[3]+c(0,0,tic,tic,0),col=col,border=NA,...), - "2"=polygon(u[1]+c(0,0,tic,tic,0),u[c(3,4,4,3,3)],col=col,border=NA,...), - "3"=polygon(u[c(1,2,2,1,1)],u[4]+c(0,0,-tic,-tic,0),col=col,border=NA,...), - "4"=polygon(u[2]+c(0,0,-tic,-tic,0),u[c(3,4,4,3,3)],col=col,border=NA,...)) - switch(as.character(side), - "1"=sapply(x,function(z) lines(c(z,z),u[3]+c(0,tic),col=col.ticks,lwd=lwd)), - "2"=sapply(x,function(z) lines(u[1]+c(0,tic),c(z,z),col=col.ticks,lwd=lwd)), - "3"=sapply(x,function(z) lines(c(z,z),u[4]+c(0,-tic),col=col.ticks,lwd=lwd)), - "4"=sapply(x,function(z) lines(u[2]+c(0,-tic),c(z,z),col=col.ticks,lwd=lwd))) - if(ticksize < 0) par(opar) - invisible(x) -} - diff --git a/R/size_n_color.R b/R/size_n_color.R deleted file mode 100644 index cff5401..0000000 --- a/R/size_n_color.R +++ /dev/null @@ -1,55 +0,0 @@ -size_n_color<-function(x=NULL,y,size,sizefun="sqrt",col,main="", - xlim=NA,xlab="",xat=NULL,xaxlab=NULL,xcex=1,xlas=0,xgrid=FALSE, - ylim=NA,ylab="",yat=NULL,yaxlab=NULL,ycex=1,ylas=1,ygrid=TRUE, - mar=c(5,4,4,2),boxit=TRUE,add=FALSE,...) { - - if(!is.na(sizefun)) size<-do.call(sizefun,list(size)) - if(is.matrix(size)) { - dimsize<-dim(size) - if(is.null(x)) { - x<-matrix(rep((1:dimsize[2])*max(size*2),each=dimsize[1]),ncol=dimsize[2]) - y<-matrix(rep((dimsize[1]:1)*max(size*2),dimsize[2]),ncol=dimsize[2]) - if(is.null(xat)) xat<-x[1,] - if(is.null(yat)) yat<-y[,1] - } - else { - if(is.null(xat)) xat<-1:dimsize[2] - if(is.null(yat)) yat<-1:dimsize[1] - } - } - else { - dimsize=c(length(size),1) - if(is.null(x)) x<-1:length(size) - } - xylim<-par("usr") - aspect_ratio<-(xylim[2]-xylim[1])/(xylim[4]-xylim[3]) - maxsize<-max(size) - if(is.na(xlim[1])) - xlim<-c(min(x)-maxsize*aspect_ratio,max(x)+maxsize*aspect_ratio) - if(is.na(ylim[1])) - ylim<-c(min(y)-maxsize/aspect_ratio,max(y)+maxsize/aspect_ratio) - if(!add) { - oldmar<-par(mar=mar) - plot(x,y,main=main,xlab=xlab,ylab=ylab,xlim=xlim,ylim=ylim, - axes=FALSE,type="n",...) - if(xgrid) segments(xat,xylim[3],xat,xylim[4],col="lightgray",lty=2) - if(ygrid) segments(xylim[1],yat,xylim[2],yat,col="lightgray",lty=2) - axis(1,at=xat,labels=xaxlab,las=xlas,cex.axis=xcex) - axis(2,at=yat,labels=yaxlab,las=ylas,cex.axis=ycex) - if(boxit) box() - } - if(is.matrix(size)) { - if(is.null(dim(col))) col=matrix(col,nrow=dimsize[1],ncol=dimsize[2]) - for(row in 1:dimsize[1]) { - for(column in 1:dimsize[2]) - draw.circle(x[row,column],y[row,column],size[row,column], - border=NA,col=col[row,column]) - } - } - else { - if(length(col) < length(size)) col=rep(col,size) - for(index in 1:length(size)) - draw.circle(x[index],y[index],size[index],border=NA,col=col[index]) - } - if(!add) par(mar=oldmar) -} diff --git a/R/sizeplot.R b/R/sizeplot.R deleted file mode 100644 index 03fa0ce..0000000 --- a/R/sizeplot.R +++ /dev/null @@ -1,19 +0,0 @@ -sizeplot<-function(x,y,scale=1,pow=0.5,powscale=TRUE,size=c(1,4),add=FALSE,...) { - - pair <- function(x, y) paste(x, y, sep = "/") - unpair <- function(x) t(sapply(strsplit(x, "/"), as.numeric)) - f<-factor(pair(x, y)) - n<-table(f) - if(min(n) == max(n)) { - warning("all points repeated equally (why use sizeplot?)") - if(powscale) psize <- rep(length(f), scale) - else psize <- rep(length(f), size[1]) - } - else { - if(powscale) psize<-scale*n^pow - else psize<-size[1]+(size[2]-size[1])*((n-min(n))/(max(n)-min(n))) - } - newpts<-unpair(levels(f)) - if(!add) plot(newpts[,1],newpts[,2],cex=psize,type="p",...) - else points(newpts[,1],newpts[,2],cex=psize,...) -} diff --git a/R/sizetree.R b/R/sizetree.R deleted file mode 100755 index 46fed20..0000000 --- a/R/sizetree.R +++ /dev/null @@ -1,86 +0,0 @@ -sizetree<-function (x, left = 0, top, right = 1, lastcenter = NA, - showval = TRUE, showcount = TRUE, stacklabels = TRUE, firstcall = TRUE, - col = NULL, border = NA, toplab = NULL, base.cex = 1, ...) -{ - dimx <- dim(x) - colname <- names(x)[1] - if (firstcall) { - x <- x[do.call(order, x), ] - oldmar <- par("mar") - par(mar = c(1, 2, 2, 1)) - top <- sum(!is.na(x[, 1])) - if (top < dimx[1]) - cat(dimx[1] - top, "NA values dropped from first stack.\n") - plot(0, xlim = c(0, dimx[2]), ylim = c(0, top), type = "n", - axes = FALSE, xlab = "", ylab = "", ...) - } - xfreq <- table(x[, 1]) - lenxf <- length(xfreq) - if (firstcall) { - if (is.null(col)) { - col <- list() - for (index in 1:dimx[2]) col[[index]] <- rainbow(length(table(x[, - index]))) - } - for (index in 1:dimx[2]) if (is.null(names(col[[index]]))) - names(col[[index]]) <- names(table(x[, index])) - } - if (lenxf) { - if (is.list(col)) { - barcol <- col[[1]] - barcol <- barcol[names(col[[1]]) %in% names(xfreq)] - } - else barcol <- col[names(col) %in% names(xfreq)] - labels <- names(xfreq) - squeeze <- (right - left)/10 - for (bar in 1:lenxf) { - if (length(xfreq[bar])) { - if (!is.na(xfreq[bar])) { - if (xfreq[bar] > 0) { - rect(left + squeeze, top - xfreq[bar], right - - squeeze, top, col = barcol[bar], border = border) - labelheight <- strheight(labels[bar]) - cex <- ifelse((1.5 * labelheight) > xfreq[bar], - base.cex * 0.75 * xfreq[bar]/labelheight, - base.cex) - if (showval) { - textcol <- ifelse(colSums(col2rgb(unlist(barcol[bar])) * - c(1.4, 1.4, 0.5)) < 350, "white", "black") - bartext <- ifelse(showcount, paste(labels[bar], - " (", xfreq[bar], ")", sep = ""), labels[bar]) - text((left + right)/2, top - xfreq[bar]/2, - bartext, cex = cex, col = textcol) - } - if (!is.na(lastcenter)) - segments(left + squeeze, top - xfreq[bar]/2, - left - squeeze, lastcenter) - xvalue <- ifelse(is.numeric(x[, 1]), as.numeric(labels[bar]), - labels[bar]) - if (dimx[2] > 1) { - newcol <- col - newcol[[1]] <- NULL - nextx <- subset(x, x[, 1] == xvalue, 2:dimx[2]) - sizetree(nextx, right, top, right + 1, - lastcenter = top - xfreq[bar]/2, showval = showval, - showcount = showcount, stacklabels = stacklabels, firstcall = FALSE, - col = newcol, border = border, base.cex = base.cex) - } - } - } - } - top <- top - xfreq[bar] - } - if (stacklabels) - mtext(colname, side = 1, at = (left + right)/2, line = -0.4) - } - if (firstcall) { - if (!is.null(toplab)) { - par(xpd = TRUE) - top <- sum(!is.na(x[, 1])) - text(0.5:(dimx[2] + 0.5), 1.01 * top, toplab, adj = c(0.5, - 0)) - par(xpd = FALSE) - } - par(mar = oldmar) - } -} diff --git a/R/smoothColors.R b/R/smoothColors.R deleted file mode 100644 index 1065df7..0000000 --- a/R/smoothColors.R +++ /dev/null @@ -1,53 +0,0 @@ -smoothColors<-function(...,alpha=NA){ - args <- list(...) - r <- g <- b <- NULL - while(length(args) > 0) { - if(!is.character(args[[1]])) - stop("Usage: smoothColors(\"color name\",[n|\"color name\"],...,\"color name\")") - arglen<-length(args) - if(arglen > 1){ - if(is.numeric(args[[2]])){ - lastarg<-2 - # args[[lastarg]] should be a color name - while(is.numeric(args[[lastarg]])) { - lastarg<-lastarg+1 - # make sure that there are enough arguments left - if(lastarg > arglen) stop("bad argument list") - } - ## do interpolate: - from <- col2rgb(args[[1]]) - too <- col2rgb(args[[lastarg]]) - ## generate args[[2]] colors between specified colors: - n <- args[[2]]+2 # add 2 for start and finish - ## chop off last one since it will be added on the next iteration: - r <- c(r,seq(from[1,],too[1,],length=n)) - i <- length(r) - r <- r[-i] - g <- c(g,seq(from[2,],too[2,],length=n)) - g <- g[-i] - b <- c(b,seq(from[3,],too[3,],length=n)) - b <- b[-i] - ## cut color and n from list and back we go - args <- args[-(1:(lastarg-1))] - } - else { - ## insert color, chop off 1 - cc <- col2rgb(args[[1]]) - r <- c(r,cc[1,]) - g <- c(g,cc[2,]) - b <- c(b,cc[3,]) - args <- args[-1] - } - } - else { - ## insert color, chop off 1 - cc <- col2rgb(args[[1]]) - r <- c(r,cc[1,]) - g <- c(g,cc[2,]) - b <- c(b,cc[3,]) - args <- args[-1] - } - } - if(is.na(alpha)) rgb(r,g,b,maxColorValue=255) - else rgb(r,g,b,alpha=alpha,maxColorValue=255) -} diff --git a/R/soil.texture.R b/R/soil.texture.R deleted file mode 100644 index 0e7de8c..0000000 --- a/R/soil.texture.R +++ /dev/null @@ -1,47 +0,0 @@ -get.soil.texture<-function(use.percentages=FALSE,cnames=c("sand","silt","clay")) { - return(get.triprop(use.percentages=use.percentages, cnames=cnames)) -} - -soil.texture<-function(soiltexture=NULL,main="",at=seq(0.1,0.9,by=0.1), - axis.labels=c("percent sand","percent silt","percent clay"), - tick.labels=list(l=seq(10,90,by=10),r=seq(10,90,by=10),b=seq(10,90,by=10)), - show.names=TRUE,show.lines=TRUE,col.names="gray",bg.names=par("bg"), - show.grid=FALSE,col.axis="black",col.lines="gray",col.grid="gray", - lty.grid=3,show.legend=FALSE,label.points=FALSE,point.labels=NULL, - col.symbols="black",pch=par("pch"), ...) { - - par(xpd=TRUE) - triax.plot(x=NULL,main=main,at=at,axis.labels=axis.labels,tick.labels=tick.labels, - col.axis=col.axis,show.grid=show.grid,col.grid=col.grid,lty.grid=lty.grid) - arrows(0.12,0.41,0.22,0.57,length=0.15) - arrows(0.78,0.57,0.88,0.41,length=0.15) - arrows(0.6,-0.1,0.38,-0.1,length=0.15) - if(show.lines) { - triax.segments<-function(h1,h3,t1,t3,col) { - segments(1-h1-h3/2,h3*sin(pi/3),1-t1-t3/2,t3*sin(pi/3),col=col) - } - # from bottom-left to up - h1 <- c(85, 70, 80, 52, 52, 50, 20, 8, 52, 45, 45, 65, 45, 20, 20)/100 - h3 <- c( 0, 0, 20, 20, 7, 0, 0, 12, 20, 27, 27, 35, 40, 27, 40)/100 - t1 <- c(90, 85, 52, 52, 43, 23, 8, 0, 45, 0, 45, 45, 0, 20, 0)/100 - t3 <- c(10, 15, 20, 7, 7, 27, 12, 12, 27, 27, 55, 35, 40, 40, 60)/100 - triax.segments(h1, h3, t1, t3, col.lines) - } - if(show.names) { - xpos <- c(0.5, 0.7, 0.7, 0.73, 0.73, 0.5, 0.275, 0.275, 0.27, - 0.27, 0.25, 0.135, 0.18, 0.055, 0.49, 0.72, 0.9) - ypos <- c(0.66, 0.49, 0.44, 0.36, 0.32, 0.35, 0.43, 0.39, 0.3, - 0.26, 0.13, 0.072, 0.032, 0.024, 0.18, 0.15, 0.06)*sin(pi/3) - snames <- c("clay", "silty", "clay", "silty clay", "loam", - "clay loam", "sandy", "clay", "sandy clay", "loam", "sandy loam", - "loamy", "sand", "sand", "loam", "silt loam", "silt") - boxed.labels(xpos, ypos, snames, border=FALSE, xpad=0.5) - } - par(xpd=FALSE) - # now call triax.points - if(is.null(soiltexture)) return(NULL) - soilpoints <- triax.points(soiltexture, show.legend=show.legend, - label.points=label.points, point.labels=point.labels, - col.symbols=col.symbols, pch=pch, ...) - invisible(soilpoints) -} diff --git a/R/soil.texture.uk.R b/R/soil.texture.uk.R deleted file mode 100644 index c01264e..0000000 --- a/R/soil.texture.uk.R +++ /dev/null @@ -1,47 +0,0 @@ -# UK soil texture plot -soil.texture.uk <- function (soiltexture = NULL, main = "", - at = seq(0.1, 0.9, by = 0.1), - axis.labels = c("percent sand", "percent silt", "percent clay"), - tick.labels = list(l = seq(10, 90, by = 10), r = seq(10, 90, by = 10), - b = seq(10, 90, by = 10)), show.names = TRUE, - show.lines = TRUE, col.names = "gray", bg.names = par("bg"), - show.grid = FALSE, col.axis = "black", col.lines = "gray", - col.grid = "gray", lty.grid = 3, show.legend = FALSE, label.points = FALSE, - point.labels = NULL, col.symbols = "black", pch = par("pch"), - h1 = NA, h3 = NA, t1 = NA, t3 = NA, lwduk = 2, xpos = NA, ypos = NA, - snames = NA, cexuk = 1.1, ...) { - - if(is.na(h1[1])) h1<-c(82, 85, 70, 50, 45, 20) / 100 - if(is.na(h3[1])) h3<-c(18, 15, 30, 30, 35, 0) / 100 - if(is.na(t1[1])) t1<-c(0, 70, 50, 45, 0, 20) / 100 - if(is.na(t3[1])) t3<-c(18, 0, 30, 35, 35, 35) / 100 - # Name positions (x and y, x starting form left point) - if(is.na(xpos[1])) xpos<-c(0.5,0.77,0.45,0.1,0.45,0.85) - if(is.na(ypos[1])) ypos<-c(0.65,0.265,0.265,0.07,0.1,0.1) - if(is.na(snames[1])) snames <- c("Clays","Medium silts","Medium loams", - "Sands","Light loams","Light silts") - par(xpd = TRUE) - triax.plot(x=NULL,main = main, at = at, axis.labels = axis.labels, - tick.labels = tick.labels, col.axis = col.axis, show.grid = show.grid, - col.grid = col.grid, lty.grid = lty.grid) - arrows(0.12, 0.41, 0.22, 0.57, length = 0.15) - arrows(0.78, 0.57, 0.88, 0.41, length = 0.15) - arrows(0.6, -0.1, 0.38, -0.1, length = 0.15) - if(show.lines) { - triax.segments <- function(h1, h3, t1, t3, col, lwd) { - segments(1 - h1 - h3/2, h3 * sin(pi/3), 1 - t1 - - t3/2, t3 * sin(pi/3), col = col, lwd = lwd) - } - triax.segments(h1 , h3, t1, t3, col.lines, lwduk) - } - if (show.names) { - boxed.labels(xpos, ypos* sin(pi/3), snames, border = FALSE, - xpad = 0.5, cex = cexuk) - } - par(xpd = FALSE) - if (is.null(soiltexture)) return(NULL) - soilpoints <- triax.points(soiltexture, show.legend = show.legend, - label.points = label.points, point.labels = point.labels, - col.symbols = col.symbols, pch = pch, ...) - invisible(soilpoints) -} diff --git a/R/spread.labels.R b/R/spread.labels.R deleted file mode 100644 index da1bf9a..0000000 --- a/R/spread.labels.R +++ /dev/null @@ -1,71 +0,0 @@ -spread.labels<-function (x,y,labels=NULL,ony=NA,offsets=NA,between=FALSE, - linecol=par("fg"),srt=0,...) { - - if(missing(x)) - stop("Usage: spread.labels(x,y,labels,...)") - nx<-length(x) - ny<-length(y) - if(is.na(ony)) { - xylim<-par("usr") - ony<-diff(range(x))/(xylim[2]-xylim[1]) 0) || all(offsets < 0)) - seggaps<-rep(seggap*(all(offsets)<0)*-1,length.out=nx) - else seggaps<-rep(c(seggap,-seggap),length.out=nx) - segments(newx,y+offsets-seggaps,x,y) - } - } -} diff --git a/R/spreadout.R b/R/spreadout.R deleted file mode 100644 index f343f53..0000000 --- a/R/spreadout.R +++ /dev/null @@ -1,54 +0,0 @@ -spreadout<-function(x,mindist) { - if(sum(!is.na(x)) < 2) return(x) - xorder<-order(x) - goodx<-x[xorder][!is.na(x[xorder])] - gxlen<-length(goodx) - start<-end<-gxlen%/%2 - # nicely spread groups of short intervals apart from their mean - while(start > 0) { - while(end < gxlen && goodx[end+1] - goodx[end] < mindist) end<-end+1 - while(start > 1 && goodx[start] - goodx[start-1] < mindist) start<-start-1 - if(start < end) { - nsqueezed<-1+end-start - newx<-sum(goodx[start:end])/nsqueezed - - mindist*(nsqueezed%/%2 - (nsqueezed/2 == nsqueezed%/%2) * 0.5) - for(stretch in start:end) { - goodx[stretch]<-newx - newx<-newx+mindist - } - } - start<-end<-start-1 - } - start<-end<-length(goodx)%/%2+1 - while(start < gxlen) { - while(start > 1 && goodx[start] - goodx[start-1] < mindist) start<-start-1 - while(end < gxlen && goodx[end+1] - goodx[end] < mindist) end<-end+1 - if(start < end) { - nsqueezed<-1+end-start - newx<-sum(goodx[start:end])/nsqueezed - - mindist*(nsqueezed%/%2 - (nsqueezed/2 == nsqueezed%/%2) * 0.5) - for(stretch in start:end) { - goodx[stretch]<-newx - newx<-newx+mindist - } - } - start<-end<-end+1 - } - # force any remaining short intervals apart - if(any(diff(goodx) < mindist)) { - start<-gxlen%/%2 - while(start > 1) { - if(goodx[start] - goodx[start-1] < mindist) - goodx[start-1]<-goodx[start]-mindist - start<-start-1 - } - end<-gxlen%/%2 - while(end < gxlen) { - if(goodx[end+1] - goodx[end] < mindist) - goodx[end+1]<-goodx[end]+mindist - end<-end+1 - } - } - x[xorder][!is.na(x[xorder])]<-goodx - return(x) -} diff --git a/R/stackpoly.R b/R/stackpoly.R deleted file mode 100644 index ea7c7b5..0000000 --- a/R/stackpoly.R +++ /dev/null @@ -1,54 +0,0 @@ -stackpoly<-function(x,y=NULL,main="",xlab="",ylab="",xat=NA,xaxlab=NA, - xlim=NA,ylim=NA,lty=1,lwd=1,border=NA,col=NULL,staxx=FALSE,stack=FALSE, - axis2=TRUE,axis4=TRUE,padj=0,...) { - - ydim<-dim(y) - if(is.null(y[1])) { - y<-x - ydim<-dim(y) - if(is.null(ydim)) x<-1:length(y) - else x<-matrix(rep(1:ydim[1],ydim[2]),ncol=ydim[2]) - } - # fix when x is a vector and y a matrix - Phil Novack-Gottshall - if(!identical(dim(x),ydim)) x<-matrix(rep(x,ydim[2]),ncol=ydim[2]) - if(stack) y<-t(unlist(apply(as.matrix(y),1,cumsum))) - if(is.na(xlim[1])) xlim<-range(x) - if(is.na(ylim[1])) ylim<-range(y) - plot(0,main=main,xlab=xlab,ylab=ylab,xlim=xlim,ylim=ylim,type="n", - xaxs="i",yaxs="i",axes=FALSE,...) - if(is.matrix(y) || is.list(y)) { - plotlim<-par("usr") - if(is.na(xat[1])) xat<-x[,1] - if(is.na(xaxlab[1])) xaxlab<-xat - if(staxx) staxlab(at=xat,labels=xaxlab) - else axis(1,at=xat,labels=xaxlab,padj=padj) - if(axis2) axis(2) - if(axis4) axis(4) - if(is.null(col[1])) col=rainbow(ydim[2]) - else if(length(col) 1) totals<-heights[,2] - heights<-as.vector(heights) - } - if(!is.numeric(heights)) - stop("heights must be a numeric vector or matrix/data frame with numeric first column") - nbars<-length(heights) - if(length(prefix) < nbars) prefix<-rep(prefix,length.out=nbars) - if(length(suffix) < nbars) suffix<-rep(suffix,length.out=nbars) - # if no marker for increments (FALSE | 0) and totals (TRUE | non-zero) - # consider the first and last values to be totals and all others increments - if(is.na(totals[1])) totals<-c(TRUE,rep(FALSE,nbars-2),TRUE) - # coerce totals to a logical vector if it isn't - if(!is.logical(totals)) totals<-totals != 0 - oldmar<-par("mar") - if(!is.na(bg.col)) { - oldbg<-par("bg") - par(bg=bg.col) - } - maxht<-max(heights) - # if there is a negative total height, make that the minimum, otherwise zero - minht<-min(c(min(heights[totals]),0)) - currht<-heights[1] - for(i in 2:nbars) { - if(!totals[i]) { - currht<-currht+heights[i] - if(currht > maxht) maxht<-currht - } - } - if(direction == "e" || direction == "w") { - if(is.na(mar[1])) mar<-c(10,2,3,2) - par(mar=mar,xaxs="i") - plot(0,xlim=c(0.5,nbars+0.5),ylim=c(minht,maxht),type="n",axes=FALSE, - xlab="",ylab="",...) - } - else { - if(is.na(mar[1])) mar<-c(2,10,3,2) - par(mar=mar,yaxs="i") - plot(0,xlim=c(minht,maxht),ylim=c(0.5,nbars+0.5),type="n",axes=FALSE, - xlab="",ylab="",...) - } - par(xpd=TRUE) - bar.col<-rep(NA,nbars) - if(length(stair.info$inc.col) < sum(!totals)) - stair.info$inc.col=rep(stair.info$inc.col,length.out=sum(!totals)) - bar.col[!totals]<-stair.info$inc.col - bar.col[totals]<-stair.info$total.col - label_offset<-ifelse(direction == "e" || direction == "w", - strheight("M"),strwidth("M")) - if(direction == "s" || direction == "w") { - start<-nbars - finish<-1 - dir<- -1 - } - else { - start<-1 - finish<-nbars - dir<-1 - } - barend<-0 - barpos<-start:finish - for(bar in 1:nbars) { - barstart<-ifelse(totals[bar],0,barend) - barend<-barstart+heights[bar] - if(direction == "e" || direction == "w") { - rect(barpos[bar]-halfwidth,barstart,barpos[bar]+halfwidth,barend, - col=bar.col[bar],border=stair.info$border) - if(display.height) - text(barpos[bar],ifelse(heights[bar]<0,barstart,barend)+label_offset, - paste(prefix[bar],heights[bar],suffix[bar],sep=""),cex=cex) - if(direction == "e" && bar != nbars) - segments(barpos[bar]+halfwidth*dir,barend,barpos[bar]+dir-halfwidth*dir, - barend,lty=3) - if(direction == "w" && bar != nbars) - segments(barpos[bar]-halfwidth*dir,barend,barpos[bar]+dir+halfwidth*dir, - barend,lty=3) - if(!is.null(labels)) { - labelline<-0.2 - if(stagger) labelline<-c(labelline,1.2) - mtext(labels,side=1,line=labelline,at=start:finish,adj=0.5,padj=1, - las=las,cex=cex) - } - } - else { - rect(barstart,barpos[bar]-halfwidth,barend,barpos[bar]+halfwidth, - col=bar.col[bar]) - if(display.height) - text(ifelse(heights[bar]<0,barstart,barend)+label_offset, - barpos[bar],paste(prefix[bar],heights[bar],suffix[bar],sep=""),adj=0,cex=cex) - if(bar != nbars) - segments(barend,barpos[bar]+halfwidth*dir,barend, - barpos[bar]+dir-halfwidth*dir,lty=3) - if(!is.null(labels)) { - labelline<-0.5 - if(stagger) labelline<-c(labelline,1.5) - mtext(labels,side=2,line=labelline,at=start:finish,adj=1,las=las,cex=cex) - } - } - } - if(nchar(main)) mtext(main,line=mar[3]/2,at=getFigCtr()[1],cex=1.5) - par(xpd=FALSE,mar=oldmar) - if(!is.na(bg.col)) par(bg=oldbg) -} diff --git a/R/starPie.R b/R/starPie.R deleted file mode 100644 index 97665c5..0000000 --- a/R/starPie.R +++ /dev/null @@ -1,43 +0,0 @@ -starPie<-function(x,y,radext,values,maxval=NA,border=par("fg"),col=NA, - prop.area=FALSE,label="",labelpos=1) { - - valdim<-dim(values) - if(is.null(valdim)) { - npies<-1 - values<-matrix(values,nrow=1) - valdim<-dim(values) - } - nfaces<-valdim[2] - if(is.na(x[1])) x<-rep(1:valdim[1],valdim[2]) - if(is.na(y[1])) y<-rep(1:valdim[2],each=valdim[1]) - if(length(labelpos) < valdim[1]) - labelpos<-rep(labelpos,length.out=valdim[1]*valdim[2]) - if(is.na(col[1])) col<-rainbow(nfaces) - if(length(col) axislim[2])) - warning("Some axis labels are off the plot") - if(is.null(srt)) { - linepos<-rep(top.line,nlines) - for(i in 2:nlines) linepos[i]<-linepos[i-1]+line.spacing - linepos<-rep(linepos,ceiling(nlabels/nlines))[1:nlabels] - axis(side=side,at=at,labels=rep("",nlabels)) - mtext(text=labels,side=side,line=linepos,at=at,...) - } - else { - xylim<-par("usr") - if(side == 1) { - xpos<-at - if(par("ylog")) ypos<-10^(xylim[3]-ticklen*(xylim[4]-xylim[3])) - else ypos<-xylim[3]-ticklen*(xylim[4]-xylim[3]) - } - if(side == 3) { - xpos<-at - if(par("ylog")) ypos<-10^(xylim[4]+ticklen*(xylim[4]-xylim[3])) - else ypos<-xylim[4]+ticklen*(xylim[4]-xylim[3]) - } - if(side == 2) { - ypos<-at - if(par("xlog")) xpos<-10^(xylim[1]-ticklen*(xylim[2]-xylim[1])) - else xpos<-xylim[1]-ticklen*(xylim[2]-xylim[1]) - } - if(side == 4) { - ypos<-at - if(par("xlog")) xpos<-10^(xylim[2]+ticklen*(xylim[2]-xylim[1])) - else xpos<-xylim[2]+ticklen*(xylim[2]-xylim[1]) - } - par(xpd=TRUE) - text(xpos,ypos,labels,srt=srt,adj=adj,...) - par(xpd=FALSE) - } -} diff --git a/R/std.error.R b/R/std.error.R deleted file mode 100644 index 88da00c..0000000 --- a/R/std.error.R +++ /dev/null @@ -1,19 +0,0 @@ -std.error<-function(x,na.rm) { - vn<-function(x) return(sum(!is.na(x))) - dimx<-dim(x) - if(is.null(dimx)) { - stderr<-sd(x,na.rm=TRUE) - vnx<-vn(x) - } - else { - if(is.data.frame(x)) { - vnx<-unlist(sapply(x,vn)) - stderr<-unlist(sapply(x,sd,na.rm=TRUE)) - } - else { - vnx<-unlist(apply(x,2,vn)) - stderr<-unlist(apply(x,2,sd,na.rm=TRUE)) - } - } - return(stderr/sqrt(vnx)) -} diff --git a/R/symbolbarplot.R b/R/symbolbarplot.R deleted file mode 100644 index 1dff803..0000000 --- a/R/symbolbarplot.R +++ /dev/null @@ -1,97 +0,0 @@ -symbolbarplot<-function(height,width=1,space=NULL,names.arg=NULL, - legend.text=NULL,beside=FALSE,horiz=FALSE,col=heat.colors(NR), - border=par("fg"),main=NULL,sub=NULL,xlab=NULL,ylab=NULL, - xlim=NULL,ylim=NULL,axes=TRUE,axisnames=TRUE,inside=TRUE, - plot=TRUE,rel.width=0.8,symbol="circles",symbbox=TRUE,debug=FALSE,...) { - - if(!missing(inside)) .NotYetUsed("inside", error = FALSE) - if(!missing(border)) .NotYetUsed("border", error = FALSE) - if(missing(space)) - space<-if(is.matrix(height) && beside) c(0, 1) else 0.2 - space<-space*mean(width) - if(plot && axisnames && missing(names.arg)) - names.arg<-if (is.matrix(height)) colnames(height) else names(height) - if(is.vector(height)) { - height <- cbind(height) - beside <- TRUE - } - else { - if(is.array(height) && (length(dim(height)) == 1)) { - height <- rbind(height) - beside <- TRUE - } - else if(!is.matrix(height)) stop("`height' must be a vector or a matrix") - } - NR <- nrow(height) - NC <- ncol(height) - if(beside) { - if(length(space) == 2) - space <- rep(c(space[2],rep(space[1],NR - 1)),NC) - width <- rep(width,length = NR * NC) - } - else { - width <- rep(width,length = NC) - height <- rbind(0,apply(height,2,cumsum)) - } - delta <- width/2 - w.r <- cumsum(space + width) - w.m <- w.r - delta - w.l <- w.m - delta - if(horiz) { - if(missing(xlim)) xlim <- range(-0.01 * height, height) - if(missing(ylim)) ylim <- c(min(w.l), max(w.r)) - } - else { - if(missing(xlim)) xlim <- c(min(w.l), max(w.r)) - if(missing(ylim)) ylim <- range(-0.01 * height, height) - } - if(beside) w.m <- matrix(w.m, ncol = NC) - if(plot) { - opar<- - if (horiz) par(xaxs = "i", xpd = TRUE) - else par(yaxs = "i", xpd = TRUE) - on.exit(par(opar)) - plot.new() - plot.window(xlim, ylim, log = "", ...) - xyrect<-function(x1,y1,x2,y2,horizontal = TRUE,n,col,...) { - if(horizontal) - multsymbolbox(x1, y1, x2, y2, tot = x2 - x1, - bg = col, fg = col, relw = rel.width, box = symbbox, - debug = debug, ...) - else - multsymbolbox(y1, x1, y2, x2, tot = x2 - x1, - bg = col, fg = col, relw = rel.width, box = symbbox, - debug = debug, ...) - } - if(beside) xyrect(0,w.l,c(height),w.r,horizontal=horiz,col=col,n=c(height)) - else { - for (i in 1:NC) { - xyrect(height[1:NR, i], w.l[i], height[-1, i], - w.r[i], horizontal = horiz, col = col, n = height[1:NR,i]) - } - } - if(axisnames && !is.null(names.arg)) { - at.l<- - if(length(names.arg) != length(w.m)) { - if(length(names.arg) == NC) apply(w.m, 2, mean) - else stop("incorrect number of names") - } - else w.m - axis(if(horiz) 2 else 1,at=at.l,labels=names.arg,lty = 0) - } - if(!is.null(legend.text)) { - legend.col <- rep(col, length = length(legend.text)) - if ((horiz & beside) || (!horiz & !beside)) { - legend.text <- rev(legend.text) - legend.col <- rev(legend.col) - } - xy<-par("usr") - legend(xy[2] - xinch(0.1), xy[4] - yinch(0.1), legend = legend.text, - fill = legend.col, xjust = 1, yjust = 1) - } - title(main = main,sub = sub,xlab = xlab,ylab = ylab,...) - if(axes) axis(if(horiz) 1 else 2) - invisible(w.m) - } - else w.m -} diff --git a/R/symbolbox.R b/R/symbolbox.R deleted file mode 100644 index 138981f..0000000 --- a/R/symbolbox.R +++ /dev/null @@ -1,39 +0,0 @@ -symbolbox<-function(x1,y1,x2,y2,tot,relw=0.5,fg=par("fg"),bg=par("bg"), - box=TRUE,debug=TRUE,...) { - - if(debug) cat("symbolbox:",x1,y1,x2,y2,tot,"\n") - x <- c(x1,x2) - y <- c(y1,y2) - if (x2 < x1) x<-rev(x) - if (y2 < y1) y<-rev(y) - pin<-par("pin") - usr<-par("usr") - usr.pin<-diff(par("usr"))[c(1,3)]/par("pin") - dx<-diff(x)/usr.pin[1] - dy<-diff(y)/usr.pin[2] - area<-dx*dy - m<-dx*sqrt(tot/area) - n<-dy*sqrt(tot/area) - rm<-max(round(m),1) - rn<-max(round(n),1) - while(rm*rn < tot) { - if((dx*sqrt(tot/area)-m) > (dy*sqrt(tot/area)-n)) { - rm <- rm + 1 - } - else { - rn <- rn + 1 - } - } - m<-rm - n<-rn - if(debug) cat("symbolbox:",dx,dy,m,n,rm,rn,tot,"\n") - r<-dx/m*relw/2 - dx<-dx/m*usr.pin[1] - dy<-dy/n*usr.pin[2] - mat<-matrix(1:(m*n),nrow=m,ncol=n) - xpos<-x[1]+(row(mat)[mat <= tot] - 0.5) * dx - ypos<-y[1]+(col(mat)[mat <= tot] - 0.5) * dy - symbols(xpos,ypos,rep(1,tot),bg=bg,fg=fg,add=TRUE,inches=r) - if(box) - polygon(x[c(1,1,2,2,1)],y[c(1,2,2,1,1)],border=fg,...) -} diff --git a/R/tab.title.R b/R/tab.title.R deleted file mode 100644 index 2065070..0000000 --- a/R/tab.title.R +++ /dev/null @@ -1,41 +0,0 @@ -tab.title<-function(label,text.col=par("fg"),tab.col=par("bg"), - border=par("fg"),lwd=par("lwd"),cex=1.5,pad.mult=1.6,radius=0) { - - plotin<-par("pin") - marin<-par("mai") - plim<-par("usr") - xmult<-(plim[2]-plim[1])/(plim[4]-plim[3])*plotin[2]/plotin[1] - plim[3]<-plim[4] - plim[4]<-plim[3]+((plim[2]-plim[1])/xmult)*marin[3]/plotin[2] - oldcex<-par("cex") - par(cex=cex) - tabtop<-plim[3]+strheight(label)*pad.mult - oldxlog<-par("xlog") - oldylog<-par("ylog") - par(xlog=FALSE,ylog=FALSE) - if(radius == 0) { - tabx<-c(plim[1],plim[1],plim[2],plim[2]) - taby<-c(plim[3],tabtop,tabtop,plim[3]) - } - else { - xradius<-radius*(tabtop-plim[3])*xmult - xcurve1<-xradius*cos(seq(0,pi/2,length.out=20)) - xcurve2<-xradius*cos(seq(pi/2,pi,length.out=20)) - tabx<-c(plim[2], - (plim[2]-xradius)+xcurve1, - (plim[1]+xradius)+xcurve2, - plim[1]) - yradius<-radius*(tabtop-plim[3]) - ycurve1<-yradius*sin(seq(0,pi/2,length.out=20)) - ycurve2<-yradius*sin(seq(pi/2,pi,length.out=20)) - taby<-c(plim[3], - tabtop-yradius+ycurve1, - tabtop-yradius+ycurve2, - plim[3]) - } - par(xpd=TRUE) - polygon(tabx,taby,border=border,col=tab.col,lwd=lwd) - text((plim[1]+plim[2])/2,(plim[3]+tabtop)/2,label, - col=text.col) - par(xpd=FALSE,xlog=oldxlog,ylog=oldylog,cex=oldcex) -} diff --git a/R/taylor.diagram.R b/R/taylor.diagram.R deleted file mode 100644 index 602a80b..0000000 --- a/R/taylor.diagram.R +++ /dev/null @@ -1,224 +0,0 @@ -# Display a Taylor diagram -# Taylor K.E. (2001) -# Summarizing multiple aspects of model performance in a single diagram -# Journal of Geophysical Research, 106: 7183-7192. - -# version 1.0 -# progr. Olivier.Eterradossi, 12/2007 -# 2007-01-12 - modifications and Anglicizing - Jim Lemon -# version 2.0 -# progr. initiale OLE, 8/01/2007 -# rev. OLE 3/09/2008 : remove samples with NA's from mean, sd and cor calculations -# 2008-09-04 - integration and more anglicizing - Jim Lemon -# 2008-12-09 - added correlation radii, sd arcs to the pos.cor=FALSE routine -# and stopped the pos.cor=FALSE routine from calculating arcs for zero radius -# Jim Lemon -# 2010-4-30 - added the gamma.col argument for pos.cor=TRUE plots - Jim Lemon -# 2010-6-24 - added mar argument to pos.cor=TRUE plots - Jim Lemon -# 2012-1-31 - added the cex.axis argument - Jim Lemon -# 2019-02-22 - added cex.axis to Olivier's text calls plus adj and srt - -taylor.diagram<-function(ref,model,add=FALSE,col="red",pch=19,pos.cor = TRUE, - xlab = "Standard deviation", ylab = "", main = "Taylor Diagram", - show.gamma = TRUE, ngamma = 3, gamma.col = 8, sd.arcs = 0, ref.sd = FALSE, - sd.method = "sample", grad.corr.lines = c(0.2, 0.4, 0.6, 0.8, 0.9), - pcex = 1, cex.axis = 1, normalize = FALSE, mar = c(4, 3, 4, 3), ...) { - - grad.corr.full <- c(0, 0.2, 0.4, 0.6, 0.8, 0.9, 0.95, 0.99, 1) - # convert any list elements or data frames to vectors - R <- cor(ref, model, use = "pairwise") - if (is.list(ref)) - ref <- unlist(ref) - if (is.list(model)) - ref <- unlist(model) - SD <- function(x, subn) { - meanx <- mean(x, na.rm = TRUE) - devx <- x - meanx - ssd <- sqrt(sum(devx * devx, na.rm = TRUE)/(length(x[!is.na(x)]) - - subn)) - return(ssd) - } - subn <- sd.method != "sample" - sd.r <- SD(ref, subn) - sd.f <- SD(model, subn) - if (normalize) { - sd.f <- sd.f/sd.r - sd.r <- 1 - } - maxsd <- 1.5 * max(sd.f, sd.r) - oldpar <- par("mar", "xpd", "xaxs", "yaxs") - if (!add) { - par(mar = mar) - # display the diagram - if (pos.cor) { - if (nchar(ylab) == 0) - ylab = "Standard deviation" - plot(0, xlim = c(0, maxsd*1.1), ylim = c(0, maxsd*1.1), xaxs = "i", - yaxs = "i", axes = FALSE, main = main, xlab = "", - ylab = ylab, type = "n", cex = cex.axis, ...) - mtext(xlab,side=1,line=2.3) - if (grad.corr.lines[1]) { - for (gcl in grad.corr.lines) lines(c(0, maxsd * - gcl), c(0, maxsd * sqrt(1 - gcl^2)), lty = 3) - } - # add the axes - segments(c(0, 0), c(0, 0), c(0, maxsd), c(maxsd, - 0)) - axis.ticks <- pretty(c(0, maxsd)) - axis.ticks <- axis.ticks[axis.ticks <= maxsd] - axis(1, at = axis.ticks,cex.axis=cex.axis) - axis(2, at = axis.ticks,cex.axis=cex.axis) - if (sd.arcs[1]) { - if (length(sd.arcs) == 1) - sd.arcs <- axis.ticks - for (sdarc in sd.arcs) { - xcurve <- cos(seq(0, pi/2, by = 0.03)) * sdarc - ycurve <- sin(seq(0, pi/2, by = 0.03)) * sdarc - lines(xcurve, ycurve, col = "blue", lty = 3) - } - } - if (show.gamma[1]) { - # if the user has passed a set of gamma values, use that - if (length(show.gamma) > 1) gamma <- show.gamma - # otherwise make up a set - else gamma <- pretty(c(0, maxsd), n = ngamma)[-1] - if (gamma[length(gamma)] > maxsd) - gamma <- gamma[-length(gamma)] - labelpos <- seq(45, 70, length.out = length(gamma)) - # do the gamma curves - for (gindex in 1:length(gamma)) { - xcurve <- cos(seq(0, pi, by = 0.03)) * gamma[gindex] + sd.r - # find where to clip the curves - endcurve <- which(xcurve < 0) - endcurve <- ifelse(length(endcurve), min(endcurve) - - 1, 105) - ycurve <- sin(seq(0, pi, by = 0.03)) * gamma[gindex] - maxcurve <- xcurve * xcurve + ycurve * ycurve - startcurve <- which(maxcurve > maxsd * maxsd) - startcurve <- ifelse(length(startcurve), max(startcurve) + - 1, 0) - lines(xcurve[startcurve:endcurve], ycurve[startcurve:endcurve], - col = gamma.col) - if (xcurve[labelpos[gindex]] > 0) - boxed.labels(xcurve[labelpos[gindex]], ycurve[labelpos[gindex]], - gamma[gindex], border = FALSE) - } - } - # the outer curve for correlation - xcurve <- cos(seq(0, pi/2, by = 0.01)) * maxsd - ycurve <- sin(seq(0, pi/2, by = 0.01)) * maxsd - lines(xcurve, ycurve) - bigtickangles <- acos(seq(0.1, 0.9, by = 0.1)) - medtickangles <- acos(seq(0.05, 0.95, by = 0.1)) - smltickangles <- acos(seq(0.91, 0.99, by = 0.01)) - segments(cos(bigtickangles) * maxsd, sin(bigtickangles) * - maxsd, cos(bigtickangles) * 0.97 * maxsd, sin(bigtickangles) * - 0.97 * maxsd) - par(xpd = TRUE) - # the inner curve for reference SD - if (ref.sd) { - xcurve <- cos(seq(0, pi/2, by = 0.01)) * sd.r - ycurve <- sin(seq(0, pi/2, by = 0.01)) * sd.r - lines(xcurve, ycurve) - } - points(sd.r, 0, cex = pcex) - text(cos(c(bigtickangles, acos(c(0.95, 0.99)))) * - 1.05 * maxsd, sin(c(bigtickangles, acos(c(0.95, - 0.99)))) * 1.05 * maxsd, c(seq(0.1, 0.9, by = 0.1), - 0.95, 0.99),cex=cex.axis) - text(maxsd * 0.8, maxsd * 0.8, "Correlation", srt = 315,cex=cex.axis) - segments(cos(medtickangles) * maxsd, sin(medtickangles) * - maxsd, cos(medtickangles) * 0.98 * maxsd, sin(medtickangles) * - 0.98 * maxsd) - segments(cos(smltickangles) * maxsd, sin(smltickangles) * - maxsd, cos(smltickangles) * 0.99 * maxsd, sin(smltickangles) * - 0.99 * maxsd) - } - else { - x <- ref - y <- model - R <- cor(x, y, use = "pairwise.complete.obs") - E <- mean(x, na.rm = TRUE) - mean(y, na.rm = TRUE) - xprime <- x - mean(x, na.rm = TRUE) - yprime <- y - mean(y, na.rm = TRUE) - sumofsquares <- (xprime - yprime)^2 - Eprime <- sqrt(sum(sumofsquares)/length(complete.cases(x))) - E2 <- E^2 + Eprime^2 - if (add == FALSE) { - # pourtour du diagramme (display the diagram) - maxray <- 1.5 * max(sd.f, sd.r) - plot(c(-maxray, maxray), c(0, maxray), type = "n", - asp = 1, bty = "n", xaxt = "n", yaxt = "n", - xlim=c(-1.1*maxray,1.1*maxray), - xlab = xlab, ylab = ylab, main = main, cex = cex.axis) - discrete <- seq(180, 0, by = -1) - listepoints <- NULL - for (i in discrete) { - listepoints <- cbind(listepoints, maxray * - cos(i * pi/180), maxray * sin(i * pi/180)) - } - listepoints <- matrix(listepoints, 2, length(listepoints)/2) - listepoints <- t(listepoints) - lines(listepoints[, 1], listepoints[, 2]) - # axes x,y - lines(c(-maxray, maxray), c(0, 0)) - lines(c(0, 0), c(0, maxray)) - # lignes radiales jusque R = +/- 0.8 - for (i in grad.corr.lines) { - lines(c(0, maxray * i), c(0, maxray * sqrt(1 - - i^2)), lty = 3) - lines(c(0, -maxray * i), c(0, maxray * sqrt(1 - - i^2)), lty = 3) - } - # texte radial - for (i in grad.corr.full) { - text(1.05 * maxray * i, 1.05 * maxray * sqrt(1 - - i^2), i, cex = cex.axis,adj=cos(i)/2) - text(-1.05 * maxray * i, 1.05 * maxray * sqrt(1 - - i^2), -i, cex = cex.axis,adj=1-cos(i)/2) - } - # sd concentriques autour de la reference - seq.sd <- seq.int(0, 2 * maxray, by = (maxray/10))[-1] - for (i in seq.sd) { - xcircle <- sd.r + (cos(discrete * pi/180) * - i) - ycircle <- sin(discrete * pi/180) * i - for (j in 1:length(xcircle)) { - if ((xcircle[j]^2 + ycircle[j]^2) < (maxray^2)) { - points(xcircle[j], ycircle[j], col = "darkgreen", - pch = ".") - if (j == 10) - text(xcircle[j], ycircle[j], signif(i, - 2), cex = cex.axis, col = "darkgreen",srt=90) - } - } - } - # sd concentriques autour de l'origine - seq.sd <- seq.int(0, maxray, length.out = 5) - for (i in seq.sd) { - xcircle <- cos(discrete * pi/180) * i - ycircle <- sin(discrete * pi/180) * i - if (i) - lines(xcircle, ycircle, lty = 3, col = "blue") - text(min(xcircle), -0.06 * maxray, signif(i, - 2), cex = cex.axis, col = "blue") - text(max(xcircle), -0.06 * maxray, signif(i, - 2), cex = cex.axis, col = "blue") - } - text(0, -0.14 * maxray, "Standard Deviation", - cex = cex.axis, col = "blue") - text(0, -0.22 * maxray, "Centered RMS Difference", - cex = cex.axis, col = "darkgreen") - points(sd.r, 0, pch = 22, bg = "darkgreen", cex = pcex) - text(0, 1.2 * maxray, "Correlation Coefficient", - cex = cex.axis) - } - S <- (2 * (1 + R))/(sd.f + (1/sd.f))^2 - # Taylor<-S - } - } - # display the points - points(sd.f * R, sd.f * sin(acos(R)), pch = pch, col = col, - cex = pcex) - invisible(oldpar) -} diff --git a/R/textbox.R b/R/textbox.R deleted file mode 100644 index 6e35ff8..0000000 --- a/R/textbox.R +++ /dev/null @@ -1,58 +0,0 @@ -textbox<-function(x,y,textlist,justify=c("l","c","r"),cex=1,leading=0.5, - box=TRUE,adj=c(0,0),font=NULL,vfont=NULL,col=NULL,border=NULL,fill=NA, - density=NULL,angle=45,lty=par("lty"),lwd=par("lwd"),margin=0) { - - if (length(margin) == 1) margin<-rep(margin, 4) - else if (length(margin) == 2) margin<-rep(margin, 2) - saveAdj<-par(adj = 0) - textstr<-paste(textlist, collapse=" ") - words<-strsplit(textstr," ")[[1]] - line.height<-strheight("hy",cex=cex,font=font,vfont=vfont) * (1+leading) - if(margin[2] > 0) x[1]<-x[1] + margin[2] - if(margin[3] > 0) y<-y-margin[3] - if(margin[4] > 0) x[2]<-x[2]-margin[4] - if(x[1] >= x[2]) x[2]<-x[1]+diff(par("usr")[1:2])*0.1 - x.len<-diff(x) - y.pos<-y - x.pos<-x[1] - adj2<-c(0,1) - if(justify[1] == "c") { - x.pos<-x.pos + x.len/2 - adj2[1]<-0.5 - } - else { - if(justify[1] == "r") { - x.pos<-x.pos + x.len - adj2[1]<-1 - } - } - curword<-1 - curline<-1 - txtline<-"" - while(curword <= length(words)) { - txtline[curline]<- "" - txtline[curline]<-paste(txtline[curline],words[curword]) - curword<-curword + 1 - while(strwidth(paste(txtline[curline],words[curword]),cex=cex, - font=font,vfont=vfont) < x.len && !is.na(words[curword])) { - txtline[curline]<-paste(txtline[curline],words[curword]) - curword<-curword+1 - } - curline<-curline+1 - y.pos[curline]<-y.pos[curline-1]-line.height - } - if(box) { - xbox<-x - ybox<-c(y.pos[curline],y) - ybox[1]<-ybox[1]-abs(margin[1]) - xbox[1]<-xbox[1]-abs(margin[2]) - ybox[2]<-ybox[2]+abs(margin[3]) - xbox[2]<-xbox[2]+abs(margin[4]) - rect(xbox[1],ybox[1],xbox[2],ybox[2],border=border, - col=fill,density=density,angle=angle,lty=lty,lwd=lwd) - } - text(x.pos,y.pos[1:curline-1],txtline,adj=adj+adj2,cex=cex, - col=col,font=font,vfont=vfont) - par(saveAdj) - return(y.pos) -} diff --git a/R/thigmophobe.R b/R/thigmophobe.R deleted file mode 100644 index 542ef9f..0000000 --- a/R/thigmophobe.R +++ /dev/null @@ -1,31 +0,0 @@ -# function contributed by Bill Venables as a replacement for thigmophobe -thigmophobe <- function (x, y = NULL, names = seq_along(z), - xlog = par("xlog"), ylog = par("ylog"), - usr = par("usr"), pin = par("pin"), - eps = .Machine$double.eps, pi = base::pi) { - # convert separete x and y coordinates to a two element list - xy <- grDevices::xy.coords(x, y, recycle = TRUE) - z <- with(xy, { - x <- ((if(xlog) log(x) else x) - usr[1])/diff(usr[1:2])*pin[1] - y <- ((if(ylog) log(y) else y) - usr[3])/diff(usr[3:4])*pin[2] - complex(real = x, imaginary = y) - }) - # calculate the matrix of distances - xydist <- outer(z, z, function(x, y) Mod(x - y)) - # remove "self" distances - diag(xydist) <- Inf - # get the indicies of the smallest distances - nearby <- apply(xydist, 2, which.min) - zdiff <- z - z[nearby] - # get the offset away from the nearest point for each label - pos <- findInterval((-pi/4 - Arg(zdiff)) %% (2*pi), - seq(0, 2*pi, by = pi/2), all.inside = TRUE) - # stagger the offsets for points with essentially zero differences - if(any(k <- Mod(zdiff) <= eps)) { - for(k in which(k)) { - pos[sort(c(k, nearby[k]))] <- c(1,3) - } - } - names(pos)<-names - return(pos) -} diff --git a/R/thigmophobe.labels.R b/R/thigmophobe.labels.R deleted file mode 100644 index bb58896..0000000 --- a/R/thigmophobe.labels.R +++ /dev/null @@ -1,20 +0,0 @@ -thigmophobe.labels<-function(x,y,labels=NULL,text.pos=NULL,...) { - if(missing(x)) stop("Usage: thigmophobe.labels(x,y,labels=1:length(x))") - lenx<-length(x) - if(missing(y)) { - if(is.list(x) && lenx >= 2) { - y<-x[[2]] - x<-x[[1]] - } - else stop("if y is missing, x must be a list with at least 2 elements") - } - validxy<-!(is.na(x) | is.na(y)) - if(is.null(labels)) labels<-1:lenx - if(is.null(text.pos)) { - if(lenx > 1) text.pos<-thigmophobe(x[validxy],y[validxy]) - else text.pos<-3 - } - par(xpd=TRUE) - text(x[validxy],y[validxy],labels[validxy],pos=text.pos,...) - par(xpd = FALSE) -} diff --git a/R/triax.R b/R/triax.R deleted file mode 100644 index 8203837..0000000 --- a/R/triax.R +++ /dev/null @@ -1,286 +0,0 @@ -get.triprop<-function(use.percentages=FALSE,cnames=c("1st","2nd","3rd")) { - cat("Enter the label and ") - cat(ifelse(use.percentages,"percentages ","proportions ")) - cat("of",cnames[1],cnames[2],"and",cnames[3],"for each observation.\n") - cat("Enter a blank observation label to end.\n") - nextlabel<-"dummy" - nextprop<-0 - proplabels<-NA - prop1<-NA - prop2<-NA - prop3<-NA - nprop<-0 - totprop<-ifelse(use.percentages,100,1) - tolerance<-ifelse(use.percentages,1,0.01) - while(nchar(nextlabel)) { - nextlabel<-readline("Observation label - ") - if(nchar(nextlabel)) { - if(is.na(proplabels[1])) proplabels<-nextlabel - else proplabels<-c(proplabels,nextlabel) - cat(cnames[1],"- ") - nextprop<-as.numeric(readline()) - if(is.na(prop1[1])) prop1<-nextprop - else prop1<-c(prop1,nextprop) - cat(cnames[2],"- ") - nextprop<-as.numeric(readline()) - if(is.na(prop2[1])) prop2<-nextprop - else prop2<-c(prop2,nextprop) - cat(cnames[3],"- ") - nextprop<-as.numeric(readline()) - if(is.na(prop3[1])) prop3<-nextprop - else prop3<-c(prop3,nextprop) - nprop<-nprop+1 - } - sumprop<-prop1[nprop]+prop2[nprop]+prop3[nprop] - if(abs(totprop-sumprop) > tolerance) - cat("Warning - sum not equal to",totprop,"\n") - } - triprop<-cbind(prop1,prop2,prop3) - rownames(triprop)<-proplabels - colnames(triprop)<-cnames - return(triprop) -} - -triax.abline<-function(b=NULL,r=NULL,l=NULL,col=par("col"),lty=par("lty"), - cc.axes=FALSE) { - - sin60<-sin(pi/3) - if(!is.null(b)) { - if(any(b>1)) b<-b/100 - if(cc.axes) { - bx2<-b+0.5*(1-b) - by2<-sin60*(1-b) - segments(b,0,bx2,by2,col=col,lty=lty) - } - else { - bx2<-0.5*(1-b) - by2<-sin60*(1-b) - segments(1-b,0,bx2,by2,col=col,lty=lty) - } - } - if(!is.null(r)) { - if(any(r>1)) r<-r/100 - if(cc.axes) { - rx1<-0.5*r - ry1<-sin60*r - rx2<-1-r*0.5 - segments(rx1,ry1,rx2,ry1,col=col,lty=lty) - } - else { - rx1<-0.5*(r+1) - ry1<-sin60*(1-r) - rx2<-1-r - segments(rx1,ry1,r,0,col=col,lty=lty) - } - } - if(!is.null(l)) { - if(any(l>1)) l<-l/100 - if(cc.axes) { - lx1<-0.5-l*0.5 - lx2<-1-l - ly<-sin60*(1-l) - segments(lx1,ly,lx2,0,col=col,lty=lty) - } - else { - lx1<-l*0.5 - ly<-l*sin60 - segments(lx1,ly,1-lx1,ly,col=col,lty=lty) - } - } -} - -triax.points<-function(x,show.legend=FALSE, - label.points=FALSE,point.labels=NULL,col.symbols=par("fg"), - pch=par("pch"),bg.symbols=par("bg"),cc.axes=FALSE,...) { - - if(dev.cur() == 1) - stop("Cannot add points unless the triax.frame has been drawn") - if(missing(x)) - stop("Usage: triax.points(x,...)\n\twhere x is a 3 column array of proportions or percentages") - if(!is.matrix(x) && !is.data.frame(x)) - stop("x must be a matrix or data frame with at least 3 columns and one row.") - if(any(x > 1) || any(x < 0)) { - if(any(x < 0)) - stop("All proportions must be between zero and one.") - if(any(x > 100)) - stop("All percentages must be between zero and 100.") - # convert percentages to proportions - x<-x/100 - } - if(any(abs(rowSums(x)-1) > 0.01)) - warning("At least one set of proportions does not equal one.") - sin60<-sin(pi/3) - if(cc.axes) { - ypos<-x[,3]*sin60 - xpos<-x[,1]+x[,3]*0.5 - } - else { - ypos<-x[,3]*sin60 - xpos<-1-(x[,1]+x[,3]*0.5) - } - nobs<-dim(x)[1] - points(x=xpos,y=ypos,pch=pch,col=col.symbols,bg=bg.symbols,type="p",...) - if(is.null(point.labels)) point.labels<-rownames(x) - if(label.points) thigmophobe.labels(xpos,ypos,point.labels) - if(show.legend) { - legend(0.2,0.7,legend=point.labels,pch=pch,col=col.symbols, - xjust=1,yjust=0) - } - invisible(list(x=xpos,y=ypos)) -} - -triax.frame<-function(at=seq(0.1,0.9,by=0.1),axis.labels=NULL, - tick.labels=NULL,col.axis="black",cex.axis=1,cex.ticks=1, - align.labels=TRUE,show.grid=FALSE,col.grid="gray",lty.grid=par("lty"), - cc.axes=FALSE) { - - sin60<-sin(pi/3) - # bottom ticks - bx1<-at - bx2<-bx1+0.01-0.02*cc.axes - by1<-rep(0,9) - if(cc.axes) by2<-rep(-0.02*sin(2*pi/3),9) - else by2<-rep(-0.02*sin60,9) - # left ticks - ly1<-at*sin60 - lx1<-bx1*0.5 - lx2<-lx1-0.02+0.013*cc.axes - if(cc.axes) ly2<-ly1+rep(0.014*sin60,9) - else ly2<-ly1 - # right ticks - rx1<-at*0.5+0.5 - rx2<-rx1+0.01 - ry1<-rev(ly1) - if(cc.axes) ry2<-ry1 - else ry2<-rev(ly2)+0.02*sin60 - if(show.grid) { - par(fg=col.grid) - segments(bx1,by1,lx1,ly1,lty=lty.grid) - segments(lx1,ly1,rev(rx1),rev(ry1),lty=lty.grid) - segments(rx1,ry1,bx1,by1,lty=lty.grid) - } - par(fg=col.axis,xpd=TRUE) - if(is.null(tick.labels)) { - if(cc.axes) tick.labels<-list(l=rev(at),r=rev(at),b=rev(at)) - else tick.labels<-list(l=at,r=at,b=at) - } - else { - if(cc.axes) { - tick.labels$l<-rev(tick.labels$l) - tick.labels$r<-rev(tick.labels$r) - tick.labels$b<-rev(tick.labels$b) - } - } - # left axis label - if(align.labels) par(srt=60) - text(0.13,0.5,axis.labels[3-cc.axes],adj=0.5,cex=cex.axis) - # left axis tick labels - if(cc.axes) { - par(srt=300) - xoffset<-0.02 - yoffset<-0.04 - } - else { - par(srt=0) - xoffset<-0.05 - yoffset<-0 - } - text(lx1-xoffset,ly1+yoffset,tick.labels$l,cex=cex.ticks) - # right axis label - if(align.labels) { - par(srt=300) - label.adj<-0.5 - } - else { - par(srt=0) - label.adj<-0 - } - text(0.86,0.52,axis.labels[2+cc.axes],adj=label.adj,cex=cex.axis) - # right axis tick labels - if(cc.axes) { - par(srt=0) - xoffset<-0.033 - yoffset<-0.005 - } - else { - par(srt=60) - xoffset<-0.015 - yoffset<-0.045 - } - text(rx2+xoffset,ry1+yoffset,tick.labels$r,cex=cex.ticks) - # bottom axis tick labels - if(cc.axes) { - par(srt=60) - xoffset<- -0.03 - } - else { - par(srt=300) - xoffset<-0.03 - } - text(bx1+xoffset,by1-0.05,rev(tick.labels$b),cex=cex.ticks) - # bottom axis label - par(srt=0) - text(0.5,-0.14,axis.labels[1],cex=cex.axis) - # draw the triangle and ticks - x1<-c(0,0,0.5) - x2<-c(1,0.5,1) - y1<-c(0,0,sin60) - y2<-c(0,sin60,0) - par(fg=col.axis) - segments(x1,y1,x2,y2) - # bottom ticks - segments(bx1,by1,bx2,by2) - # left ticks - segments(lx1,ly1,lx2,ly2) - # right ticks - segments(rx1,ry1,rx2,ry2) -} - -triax.fill<-function(col) { - nrows<-length(col) - sin60<-sin(pi/3) - rowlen<-1 - xinc<-0.5/nrows - yinc<-sin60/nrows - for(trirow in 1:nrows) { - startx<-0.5-xinc*(trirow-1) - starty<-sin60-trirow*yinc - dir<-1 - for(triangle in 1:rowlen) { - polygon(c(startx-xinc,startx,startx+xinc), - c(starty,starty+yinc*dir,starty),border=NA, - col=col[[trirow]][triangle]) - startx<-startx+xinc - starty<-starty+yinc*dir - dir<--dir - } - rowlen<-rowlen+2 - } -} - -triax.plot<-function (x=NULL,main="",at=seq(0.1,0.9,by=0.1), - axis.labels=NULL,tick.labels=NULL,col.axis="black", - cex.axis=1,cex.ticks=1,align.labels=TRUE, - show.grid=FALSE,col.grid="gray",lty.grid=par("lty"),cc.axes=FALSE, - show.legend=FALSE,label.points=FALSE,point.labels=NULL, - col.symbols="black",pch=par("pch"),mar=c(5,2,4,2),no.add=TRUE,...) { - - oldpar<-par("fg","pty","mar","srt","xpd") - par(xpd=TRUE) - if(is.null(axis.labels)) axis.labels<-colnames(x)[1:3] - par(pty="s",mar=mar) - plot(0.5,type="n",axes=FALSE,xlim=c(0,1),ylim=c(0,1),main=main, - xlab="",ylab="") - triax.frame(at=at,axis.labels=axis.labels, - tick.labels=tick.labels,col.axis=col.axis,cex.axis=cex.axis, - cex.ticks=cex.ticks,align.labels=align.labels,show.grid=show.grid, - col.grid=col.grid,lty.grid=lty.grid,cc.axes=cc.axes) - if(is.null(x)) xypos <- NULL - else - xypos<-triax.points(x,show.legend=show.legend, - label.points=label.points, - point.labels=point.labels, - col.symbols=col.symbols,pch=pch,cc.axes=cc.axes,...) - if(no.add) par(oldpar) - invisible(list(xypos=xypos,oldpar=oldpar)) -} diff --git a/R/tsxpos.R b/R/tsxpos.R deleted file mode 100644 index ebdcb35..0000000 --- a/R/tsxpos.R +++ /dev/null @@ -1,16 +0,0 @@ -tsxpos<-function(x,xlim,nint) { - # make sure that there is a graphics device open - if(dev.cur() == 1) stop("A graphics device must be open") - if(missing(xlim)) { - plotlim<-par("usr") - divlim<-ifelse(par("xaxs") == "r",0.04,0) - xrange<-(plotlim[2]-plotlim[1])/(1+2*divlim) - xstart<-plotlim[1]+xrange*divlim - } - else { - xstart<-xlim[1] - xrange<-diff(xlim) - } - if(missing(nint)) nint<-length(x)-1 - return(cumsum(c(xstart,rep(xrange/nint,nint)))) -} diff --git a/R/twoord.plot.R b/R/twoord.plot.R deleted file mode 100644 index 00780f0..0000000 --- a/R/twoord.plot.R +++ /dev/null @@ -1,142 +0,0 @@ -color.axis<-function(side=1,at=NULL,labels=TRUE,axlab=NA,axlab.at=NA, - col=par("fg"),cex.axis=par("cex.axis"),cex=par("cex")) { - - xylim<-par("usr") - if(side %% 2) { - at.ok<-at >= xylim[1] & at <= xylim[2] - if(sum(at.ok) < length(at)) { - at<-at[at.ok] - labels<-labels[at.ok] - } - } - else { - at.ok<-at >= xylim[3] & at <= xylim[4] - if(sum(at.ok) < length(at)) { - at<-at[at.ok] - labels<-labels[at.ok] - } - } - axis(side=side,at=at,labels=rep("",length(at)),col=col) - if(labels[1] == TRUE && length(labels) == 1) labels<-at - mtext(labels,side=side,at=at,line=0.7,col=col,cex=cex.axis) - if(!is.na(axlab)) { - if(is.na(axlab.at)) - axlab.at<-ifelse(side%%2,sum(xylim[1:2])/2,sum(xylim[3:4])/2) - mtext(axlab,side=side,at=axlab.at,line=2,col=col,cex=cex) - } - if(side == 1) abline(h=xylim[3],col=col) - if(side == 2) abline(v=xylim[1],col=col) - if(side == 3) abline(h=xylim[4],col=col) - if(side == 4) abline(v=xylim[2],col=col) -} - -twoord.plot<-function(lx,ly,rx,ry,data=NULL,main="",xlim=NULL,lylim=NULL, - rylim=NULL,mar=c(5,4,4,4),lcol=1,rcol=2,xlab="", - lytickpos=NA,ylab="",ylab.at=NA,rytickpos=NA,rylab="",rylab.at=NA, - lpch=1,rpch=2,type="b",xtickpos=NULL,xticklab=NULL,halfwidth=0.4, - axislab.cex=1,do.first=NULL,xaxt="s",...) { - - if(!is.null(data)) { - ly<-unlist(data[ly]) - ry<-unlist(data[ry]) - if(missing(lx)) lx<-1:length(ly) - else lx<-unlist(data[lx]) - if(missing(rx)) rx <- 1:length(ry) - else rx<-unlist(data[rx]) - } - if(missing(lx)) lx<-1:length(ly) - if(missing(ry)) { - if(missing(rx)) { - rx<-1:length(ry) - ry<-ly - ly<-lx - lx<-1:length(ly) - } - else { - ry<-rx - rx<-1:length(ry) - } - } - oldmar<-par("mar") - par(mar=mar) - if(is.null(xlim)) xlim<-range(c(lx,rx)) - if(missing(lx)) lx<-1:length(ly) - if(is.null(lylim)) { - lylim<-range(ly,na.rm=TRUE) - lyspan<-diff(lylim) - if(lyspan == 0) lyspan<-lylim[1] - lylim[2]<-lylim[2]+lyspan*0.04 - if(lylim[1] != 0) lylim[1]<-lylim[1]-lyspan*0.04 - } - if(length(type) < 2) type<-rep(type,2) - # first display the "left" plot - if(match(type[1],"bar",0)) { - oldcex<-par(cex=axislab.cex) - plot(lx,ly,xlim=xlim,ylim=lylim,xlab=xlab,ylab="",yaxs="i",type="n", - main="",axes=FALSE,...) - par(oldcex) - if(!is.null(do.first)) eval(parse(text=do.first)) - ybottom<-par("usr")[3] - if (lylim[1] < 0) abline(h=0,lty=2) - rect(lx-halfwidth,ifelse(ly<0,ly,ybottom),lx+halfwidth, - ifelse(ly>0,ly,0),col=lcol) - } - else { - oldcex<-par(cex=axislab.cex) - plot(lx,ly,xlim=xlim,ylim=lylim,xlab=xlab,ylab="",yaxs="i",type="n", - main="",axes=FALSE,...) - par(oldcex) - if(!is.null(do.first)) eval(parse(text=do.first)) - points(lx,ly,col=lcol,pch=lpch,type=type[1],...) - } - title(main=main) - xylim<-par("usr") - #mtext(ylab,2,2,col=lcol,cex=axislab.cex) - box() - if(xaxt != "n") { - # display the X axis - if(inherits(lx,"POSIXt")) axis.POSIXct(1) - else { - if(is.null(xticklab)) axis(1,cex.axis=axislab.cex) - else { - if(is.null(xtickpos)) xtickpos<-1:length(xticklab) - axis(1,at=xtickpos,labels=xticklab,cex.axis=axislab.cex) - } - } - } - # display the left axis - if(is.na(lytickpos[1])) lytickpos<-pretty(ly) - if(is.na(ylab.at)) ylab.at<-mean(lytickpos) - color.axis(2,at=lytickpos,axlab=ylab,axlab.at=ylab.at, - col=ifelse(is.na(lcol),1,lcol),cex.axis=axislab.cex,cex = axislab.cex) - # get the "right" y limits - if(is.null(rylim)) { - rylim<-range(ry,na.rm=TRUE) - ryspan<-diff(rylim) - if(ryspan == 0) ryspan<-rylim[1] - rylim[2]<-rylim[2]+ryspan*0.04 - if(rylim[1] != 0) rylim[1]<-rylim[1]-ryspan*0.04 - } - # multiplier for the "right" y values - ymult<-diff(lylim)/diff(rylim) -# offset for the "right" y values - yoff<-lylim[1]-rylim[1]*ymult - if(match(type[2],"bar",0)) { - if(rylim[1] < 0) abline(h=0,lty=2) - rect(rx-halfwidth,ifelse(ry<0,ry,rylim[1]*ymult+yoff),rx+halfwidth, - ifelse(ry>0,ry*ymult+yoff,0),col=rcol) - } - else points(rx,ry*ymult+yoff,col=rcol,pch=rpch,type=type[2],...) - if(is.na(rytickpos[1])) rylabels<-pretty(rylim) - else rylabels<-rytickpos - if(min(rylabels) < rylim[1]) rylabels<-rylabels[rylabels >= rylim[1]] - if(max(rylabels) > rylim[2]) rylabels<-rylabels[rylabels <= rylim[2]] - axat<-rylabels*ymult+yoff - if(is.na(rylab.at)) rylab.at<-mean(rytickpos) - if(!is.na(rylab.at)) rylab.at<-rylab.at*ymult+yoff - # display the right axis - color.axis(4,at=axat,labels=rylabels,axlab=rylab, - axlab.at=rylab.at,col=ifelse(is.na(rcol),1,rcol), - cex.axis=axislab.cex,cex=axislab.cex) - par(mar=oldmar,new=FALSE,col.axis="black") -} diff --git a/R/twoord.stackplot.R b/R/twoord.stackplot.R deleted file mode 100644 index 8520ae4..0000000 --- a/R/twoord.stackplot.R +++ /dev/null @@ -1,165 +0,0 @@ - -twoord.stackplot <- function(lx, rx, ldata, rdata, lcol, rcol, ltype, rtype, - border, rylab, lylab, xlab, ..., incrylim=NULL, - halfwidth=0.4, leftfront=FALSE, mar = c(5, 4, 4, 4)) -{ - ltype <- sapply(ltype, function(x) match.arg(x, c("p","l","b","c","o","bar"))) - rtype <- sapply(rtype, function(x) match.arg(x, c("p","l","b","c","o","bar"))) - - incrylim <- ifelse(is.null(incrylim), 0, as.numeric(incrylim)) - - #convert to matrix - if(is.vector(ldata)) - ldata <- as.matrix(ldata) - if(is.vector(rdata)) - rdata <- as.matrix(rdata) - - - #some default parameters - if(missing(border)) - border <- "grey80" - if(missing(xlab)) - xlab <- "x" - if(missing(rylab)) - rylab <- "right y values" - if(missing(lylab)) - lylab <- "left y values" - if(missing(lcol)) - lcol <- palette()[1:NCOL(ldata)] - if(missing(rcol)) - rcol <- palette()[1:NCOL(rdata)] - - - xlimits <- range(lx, rx) - - #assume line plot for the left data, and barplot for the right data - oldmar <- par("mar") - par(mar = mar) - - if(leftfront) - { - twoord.stackplot(rx, lx, rdata, ldata, rcol, lcol, rtype, ltype, - border, lylab, rylab, xlab, ..., incrylim=NULL, - halfwidth=0.4, leftfront=FALSE, mar = c(5, 4, 4, 4)) - return(invisible()) - } - - #------------------------------------------------------------------------ - #left y-axis plot - if(NCOL(ldata) > 1) - { - lcol <- rep(lcol, length=NCOL(ldata)) - ltype <- rep(ltype, length=NCOL(ldata)) - } - if(any(ltype == "bar")) - { - #------------------ - lylimits <- range(ifelse(ldata <0, ldata, 0), rowSums(ldata)) - lylimits[1] <- ifelse(lylimits[1] > 0, lylimits[1]*(1-incrylim), lylimits[1]*(1+incrylim)) - lylimits[2] <- ifelse(lylimits[2] > 0, lylimits[2]*(1+incrylim), lylimits[2]*(1-incrylim)) - - - plot(0, type = "n", axes = FALSE, xlim = xlimits, ylim = lylimits, - ylab="", xlab=xlab, ...) - - xbottom <- par("usr")[1] - xylim <- par("usr") - ly <- ldata[,1] - rect(lx-halfwidth, ifelse(ly < 0, ly, xbottom), lx+halfwidth, - ifelse(ly > 0, ly, 0), col=lcol[1], border=border, ...) - - if(NCOL(ldata) > 1) - for(i in 2:NCOL(ldata)) - { - ly <- ldata[,i] - rect(lx-halfwidth, ifelse(ly < 0, ly, xbottom)+ldata[,i-1], - lx+halfwidth, ifelse(ly > 0, ly, 0)+ldata[,i-1], col=lcol[i], - border=border, ...) - } - - }else - { - #------------------ - lylimits <- range(ldata) - lylimits[1] <- ifelse(lylimits[1] > 0, lylimits[1]*(1-incrylim), lylimits[1]*(1+incrylim)) - lylimits[2] <- ifelse(lylimits[2] > 0, lylimits[2]*(1+incrylim), lylimits[2]*(1-incrylim)) - - plot(lx, ldata[, 1], xlim=xlimits, ylim=lylimits, col=lcol[1], - type=ltype[1], axes=FALSE, ylab="", xlab=xlab, ...) - - if(NCOL(ldata) > 1) - for(i in 2:NCOL(ldata)) - lines(lx, ldata[, i], col=lcol[i], type=ltype[i], ...) - } - - xylim <- par("usr") - mtext(lylab, 2, 2, col = lcol[1]) - - axis(1) #x axis - axat <- axis(2, col=lcol[1], labels=FALSE) #left y axis - abline(v=xylim[1], col=lcol[1]) - mtext(axat, 2, 1, at = axat, col = lcol[1]) - - box() - - - #------------------------------------------------------------------------ - #right y-axis plot - par(new=TRUE) - - if(NCOL(rdata) > 1) - { - rcol <- rep(rcol, length=NCOL(rdata)) - rtype <- rep(rtype, length=NCOL(rdata)) - } - - if(any(rtype == "bar")) - { - #------------------ - rylimits <- range(ifelse(rdata <0, rdata, 0), rowSums(rdata)) - rylimits[1] <- ifelse(rylimits[1] > 0, rylimits[1]*(1-incrylim), rylimits[1]*(1+incrylim)) - rylimits[2] <- ifelse(rylimits[2] > 0, rylimits[2]*(1+incrylim), rylimits[2]*(1-incrylim)) - - ry <- rdata[,1] - plot(0, type = "n", axes = FALSE, xlim = xlimits, ylim = rylimits, - ylab="", xlab="", ...) - - xbottom <- par("usr")[1] - xylim <- par("usr") - rect(rx-halfwidth, ifelse(ry < 0, ry, xbottom), rx+halfwidth, - ifelse(ry > 0, ry, 0), col=rcol[1], border=border, ...) - - if(NCOL(rdata) > 1) - for(i in 2:NCOL(rdata)) - { - ry <- rdata[,i] - rect(rx-halfwidth, ifelse(ry < 0, ry, xbottom)+rdata[,i-1], - rx+halfwidth, ifelse(ry > 0, ry, 0)+rdata[,i-1], col=rcol[i], - border=border, ...) - - } - }else - { - #------------------ - rylimits <- range(rdata) - rylimits[1] <- ifelse(rylimits[1] > 0, rylimits[1]*(1-incrylim), rylimits[1]*(1+incrylim)) - rylimits[2] <- ifelse(rylimits[2] > 0, rylimits[2]*(1+incrylim), rylimits[2]*(1-incrylim)) - - plot(rx, rdata[, 1], xlim=xlimits, ylim=rylimits, col=rcol[1], - type=rtype[1], axes=FALSE, ylab="", xlab="", ...) - - if(NCOL(rdata) > 1) - for(i in 2:NCOL(rdata)) - lines(rx, rdata[, i], col=rcol[i], type=rtype[i], ...) - } - - - axat <- axis(4, col=rcol[1], labels=FALSE) #right y axis - abline(v=xylim[1], col=rcol[1]) - mtext(axat, 4, 1, at = axat, col = rcol[1]) - - mtext(rylab, 4, 2, col = rcol[1]) - - par(mar = oldmar) -} - diff --git a/R/vectorField.R b/R/vectorField.R deleted file mode 100644 index 028e061..0000000 --- a/R/vectorField.R +++ /dev/null @@ -1,37 +0,0 @@ -# Arguments: -# u,v - the x (longitude) and y (latitude) offsets -# OR orientation and magnitude -# xpos,ypos - the centers of the vectors -# scale - the longest arrow as a proportion of the cell size -# headspan - the extent of the arrowhead as a proportion of cell size -# this function doesn't assume a 1:1 aspect ratio - -vectorField<-function (u, v, xpos = NA, ypos = NA, scale = 1, headspan = 0.1, - vecspec = c("lonlat", "rad", "deg"), col = par("fg")) -{ - udim <- dim(u) - if (is.na(xpos[1])) - xpos <- col(u) - if (is.na(ypos[1])) - ypos <- udim[1] - row(u) + 1 - ymult <- getYmult() - if (match(vecspec[1], "lonlat", 0) == 0) { - if (match(vecspec[1], "deg", 0)) - u <- pi * u/180 - mag <- v - tempu <- v * cos(u) - v <- v * sin(u) * ymult - u <- tempu - } - else mag <- sqrt(u * u + v * v) - if (is.null(dim(xpos))) - maxmag <- 0.5 * max(diff(as.numeric(xpos)))/max(mag) - else maxmag <- 0.5 * max(diff(as.numeric(xpos[1, ])))/max(mag) - u2 <- u * scale * maxmag - v2 <- v * scale * maxmag - if (is.null(udim)) - length = headspan - else length <- headspan * par("pin")[1]/udim[2] - arrows(xpos - u2, ypos - v2, xpos + u2, ypos + v2, length = length, - col = col) -} diff --git a/R/violin_plot.R b/R/violin_plot.R deleted file mode 100644 index 5380743..0000000 --- a/R/violin_plot.R +++ /dev/null @@ -1,129 +0,0 @@ -violin_plot<-function (X = rnorm(50), - at, - add = FALSE, - na.rm = TRUE, - bw, - violin_width, - violin_end_width = 0.005, - equal_width = TRUE, - show_box = TRUE, - box_width = 0.01, - box_col = "black", - show_outliers = TRUE, - outlier_pch = NA, - range = 1.5, - xlim, - ylim, - axes = TRUE, - ann = TRUE, - xlab = "", - ylab = "", - x_axis_labels, - main = "Violin Plot", - col = "red", - median_col = "white", - show_mean = FALSE, - mean_pch = 19, - mean_pch_col = "yellow", - ...) -{ - if (missing(at)) at <- sequence(NCOL(X)) - if (missing(violin_width)) violin_width <- min(diff(c(0, at))) - if (missing(xlim)) xlim <- c(min(at) - violin_width/2, max(at) + violin_width/2) - if (missing(ylim)) ylim <- c(min(X, na.rm = TRUE), max(X, na.rm = TRUE)) - if (missing(x_axis_labels)) { - if (is.null(names(X))) x_axis_labels <- at - else x_axis_labels <- names(X) - } - if (length(col) != length(at)) { - col <- rep(col, length.out = length(at)) - } - if (!missing(bw)) bw <- rep(bw, length.out = length(at)) - if (add == FALSE) { - plot(x = 1, - y = 1, - type = "n", - xlim = xlim, - ylim = ylim, - xlab = xlab, - ylab = ylab, - xaxt = "n", - ann = ann, - axes = axes) - if (axes) - axis(side = 1, - at = at, - labels = x_axis_labels) - if(ann) title(main = main) - } - if (NCOL(X) == 1){ - if (missing(bw)) bw <- bw.nrd0(X) - max_dy <- max(density(X, bw = bw, na.rm = na.rm, n = 2048)$y) - } - if (NCOL(X) > 1){ - if (missing(bw)) bw <- sapply(1:NCOL(X), function(i) bw.nrd0(X[,i])) - for (i in 1:NCOL(X)) { - max_dy <- max(sapply(1:NCOL(X), function(i) max(density(X[,i], bw = bw[i], na.rm = na.rm, n = 2048)$y))) - } - } - for (i in 1:NCOL(X)) { - if (NCOL(X) == 1) x <- X - else x <- X[, i] - if (na.rm == TRUE) x <- x[!is.na(x)] - d <- density(x, bw = bw[i], n = 2048) - b <- boxplot.stats(x, coef = range) - if (equal_width == FALSE) width_2 <- violin_width * max(d$y)/max_dy - else width_2 <- violin_width - violin_y <- rescale(d$x, range(x)) - violin_x <- rescale(d$y, c(0, 0.48 * width_2)) - if (!show_outliers){ - ind1 <- findInterval(b$stats[1], violin_y) - ind2 <- findInterval(b$stats[5], violin_y) - violin_y <- violin_y[ind1:ind2] - violin_x <- violin_x[ind1:ind2] - } - polygon(x = c(at[i] + violin_end_width * width_2, - at[i] - violin_end_width * width_2, - at[i] - violin_x - violin_end_width * width_2, - at[i] - violin_end_width * width_2, - at[i] + violin_end_width * width_2, - rev(at[i] + violin_x + violin_end_width * width_2)), - y = c(min(violin_y), - min(violin_y), - violin_y, - max(violin_y), - max(violin_y), - rev(violin_y)), - col = col[i], ...) - if (show_box){ - lines(x = c(at[i], at[i]), - y = b$stats[1:2], - lwd = 1, - lend = "butt") - lines(x = c(at[i], at[i]), - y = b$stats[4:5], - lwd = 1, - lend = "butt") - polygon(x = c(at[i] - box_width * violin_width, - at[i] + box_width * violin_width, - at[i] + box_width * violin_width, - at[i] - box_width * violin_width), - y = c(b$stats[2], - b$stats[2], - b$stats[4], - b$stats[4]), - col = box_col) - lines(x = c(at[i] - box_width * violin_width, - at[i] + box_width * violin_width), - y = c(b$stats[3], - b$stats[3]), - lwd = 4, - lend = "butt", - col = median_col) - } - if (show_mean) - points(x = at[i], y = mean(x), pch = mean_pch, col = mean_pch_col) - if (show_outliers) - points(x = rep(at[i], length(b$out)), y = b$out, pch = outlier_pch) - } -} diff --git a/R/weighted.hist.R b/R/weighted.hist.R deleted file mode 100644 index 11abb4c..0000000 --- a/R/weighted.hist.R +++ /dev/null @@ -1,68 +0,0 @@ -get.breaks<-function (x, breaks) { - if (is.character(breaks)) - nbreaks <- do.call(paste("nclass", breaks, sep = ".", - collapse = ""), list(x)) - if (is.numeric(breaks)) { - if (length(breaks) == 1) { - nbreaks <- breaks - } - else return(breaks) - } - breakinc <- diff(range(x))/nbreaks - breaks <- c(min(x), rep(breakinc, nbreaks)) - breaks <- cumsum(breaks) - return(breaks) -} - -weighted.hist<-function (x, w, breaks = "Sturges", col = NULL, plot = TRUE, - freq = TRUE, ylim = NA, ylab = NULL, xaxis = TRUE, ...) { - - if (missing(x)) - stop("Usage: weighted.hist(x,...) vector of values x required") - if (missing(w)) - w <- rep(1, length(x)) - breaks <- get.breaks(x, breaks) - width <- diff(breaks) - diffx <- diff(range(x)) - equidist <- sum(width - width[1]) < diffx/1000 - nbreaks <- length(breaks) - 1 - lastbreak <- breaks[nbreaks + 1] - breaks[nbreaks + 1] <- breaks[nbreaks + 1] + diffx/1000 - if (diff(range(breaks)) < diffx) - warning("Not all values will be included in the histogram") - counts <- rep(0, nbreaks) - for (bin in 1:nbreaks) counts[bin] <- sum(w[x >= breaks[bin] & - x < breaks[bin + 1]]) - density <- counts/sum(counts) - if (freq) { - if (is.null(ylab)) - ylab <- "Frequency" - heights <- counts - if (!equidist) - warning("Areas will not relate to frequencies") - } - else { - if (!equidist) { - heights <- density * mean(width)/width - heights <- heights/sum(heights) - } - else heights <- density - if (is.null(ylab)) - ylab <- "Density" - } - if (plot) { - if (is.null(col)) - col <- par("bg") - if (is.na(ylim)) - ylim <- c(0, 1.1 * max(heights, na.rm = TRUE)) - mids <- barplot(heights, width = width, col = col, space = 0, - ylim = ylim, ylab = ylab, ...) - tickpos <- c(mids - width/2, mids[length(mids)] + width[length(width)]/2) - if (xaxis) - axis(1, at = tickpos, labels = signif(c(breaks[1:nbreaks], - lastbreak), 3)) - } - else mids <- breaks[-length(breaks)] + width/2 - invisible(list(breaks = breaks, counts = counts, density = density, - mids = mids, xname = deparse(substitute(x)), equidist = equidist)) -} diff --git a/R/windrose.R b/R/windrose.R deleted file mode 100644 index b3b66e6..0000000 --- a/R/windrose.R +++ /dev/null @@ -1,99 +0,0 @@ -bin.wind.records<-function(winddir,windspeed,ndir=8,radians=FALSE, - speed.breaks=c(0,10,20,30)) { - # the windagg matrix has wind speeds as rows and wind directions as columns - windagg<-matrix(0,ncol=ndir,nrow=5) - dir.breaks<-rep(0,ndir) - if(radians) { - angleinc<-2*pi/ndir - dir.breaks[1]<-pi/ndir - } - else { - angleinc<-360/ndir - dir.breaks[1]<-180/ndir - } - for(i in 2:ndir) dir.breaks[i]<-dir.breaks[i-1]+angleinc - nspeeds<-length(speed.breaks)+1 - for(i in 1:length(winddir)) { - dir<-1 - while(winddir[i] > dir.breaks[dir] && dir < ndir) dir<-dir+1 - if(winddir[i] > dir.breaks[ndir]) dir<-1 - speed<-1 - while(windspeed[i] > speed.breaks[speed] && speed < nspeeds) speed<-speed+1 - windagg[speed,dir]<-windagg[speed,dir]+1 - } - windagg<-100*windagg/sum(windagg) - return(windagg) -} - -oz.windrose.legend<-function(maxpct=20,scale.factor=30, - speed.col=c("#dab286","#fe9a66","#ce6733","#986434"), - speed.width=NA,legend.pos=NA) { - - wdnames<-c("E","NE","N","NW","W","SW","S","SE") - if(is.na(speed.width[1])) speed.width<-maxpct*1:4/100 - if(is.na(legend.pos[1])) legend.pos<-maxpct*1.25 - draw.circle(-maxpct/2,legend.pos,maxpct/20) - angles<-seq(0,7*pi/4,by=pi/4) - for(i in 1:8) { - x<-cos(angles[i])*c(maxpct/20,maxpct/16,maxpct/10)-maxpct/2 - y<-sin(angles[i])*c(maxpct/20,maxpct/16,maxpct/10)+legend.pos - segments(x[1],y[1],x[2],y[2]) - text(x[3],y[3],wdnames[i],cex=0.7) - } - wsnames<-c("1-10","10-20","20-30","30+") - draw.circle(-maxpct/30,legend.pos,maxpct/30) - for(i in 1:length(speed.col)) { - x<-c(i-1,i)*maxpct/4 - y<-c(legend.pos-speed.width[i],legend.pos+speed.width[i]) - polygon(c(x[1],x[1],x[2],x[2]),c(y[1],y[2],y[2],y[1]),col=speed.col[i]) - text((x[1]+x[2])/2,legend.pos-maxpct/15,wsnames[i],cex=0.7) - } - text(-maxpct/30,legend.pos+maxpct/10,"Calm") - text(maxpct/2,legend.pos+maxpct/10,"km/h") - text(maxpct/2,legend.pos-maxpct/8,paste("Scale factor = ",scale.factor,"%",sep="")) -} - -oz.windrose<-function(windagg,maxpct=20,wrmar=c(4,5,6,5), - scale.factor=30,speed.col=c("#dab286","#fe9a66","#ce6733","#986434"), - speed.width=NA,show.legend=TRUE,legend.pos=NA,...) { - - if(is.na(speed.width[1])) speed.width<-maxpct*1:4/100 - if(is.na(legend.pos[1])) legend.pos<-maxpct*1.25 - oldmar<-par("mar") - par(mar=wrmar,xpd=TRUE) - plot(0,xlim=c(-maxpct,maxpct),ylim=c(-maxpct,maxpct),type="n", - axes=FALSE,xlab="",ylab="",...) - winddim<-dim(windagg) - calm.radius<-sum(windagg[1,])/winddim[2] - rad<-10 - while(rad<=maxpct) { - draw.circle(0,0,rad+calm.radius,border="gray") - boxed.labels(rad+calm.radius,maxpct/10,paste(rad,"%",sep=""),ypad=0.7,border=FALSE) - rad<-rad+10 - } - draw.circle(0,0,calm.radius,border="gray") - angle.inc<--2*pi/winddim[2] - angles<-seq(5*pi/2,pi/2+angle.inc,by=angle.inc) - descpct<-order(colSums(windagg),decreasing=TRUE) - for(i in descpct) { - next.radius<-calm.radius - for(j in 2:winddim[1]) { - xinner<-cos(angles[i])*next.radius - xouter<-cos(angles[i])*(windagg[j,i]+next.radius) - yinner<-sin(angles[i])*next.radius - youter<-sin(angles[i])*(windagg[j,i]+next.radius) - next.radius<-sqrt(xouter*xouter+youter*youter) - # find the four points for each rectangle - xoffset<-cos(angles[i]-pi/2)*speed.width[j-1] - yoffset<-sin(angles[i]-pi/2)*speed.width[j-1] - polygon(c(xinner-xoffset,xinner+xoffset,xouter+xoffset,xouter-xoffset), - c(yinner-yoffset,yinner+yoffset,youter+yoffset,youter-yoffset), - col=speed.col[j-1]) - } - } - text(-maxpct,maxpct/4,paste("Calm ",round(sum(windagg[1,]),1),"%",sep=""),col="blue") - if(show.legend) - oz.windrose.legend(maxpct=maxpct,scale.factor=scale.factor,speed.col=speed.col, - speed.width=speed.width,legend.pos=legend.pos) - par(oldmar) -} diff --git a/R/zoomInPlot.R b/R/zoomInPlot.R deleted file mode 100644 index ed285d1..0000000 --- a/R/zoomInPlot.R +++ /dev/null @@ -1,55 +0,0 @@ -zoomInPlot<-function(x,y=NULL,xlim=NULL,ylim=NULL,rxlim=xlim,rylim=ylim, - xend=NA,zoomtitle=NULL,titlepos=NA,...) { - par(mfrow=c(1,2)) - if(is.null(y)) { - y<-x - x<-1:length(x) - } - if(is.null(xlim[1])) xlim<-range(x) - if(is.null(ylim[1])) ylim<-range(y) - plot(x,y,xlim=xlim,ylim=ylim,...) - xext<-yext<-rxext<-ryext<-0 - if(par("xaxs") == "r") { - xext<-diff(xlim)*0.04 - rxext<-diff(rxlim)*0.04 - } - if(par("yaxs") == "r") { - yext<-diff(ylim)*0.04 - ryext<-diff(rylim)*0.04 - } - if(is.na(rxlim[1])) { - newbox<-locator(2) - rxlim<-sort(newbox$x) - rylim<-sort(newbox$y) - } - rect(rxlim[1]-rxext,rylim[1]-ryext,rxlim[2]+rxext,rylim[2]+ryext) - xylim<-par("usr") - xypin<-par("pin") - rxi0<-xypin[1]*(xylim[2]-(rxlim[1]-rxext))/diff(xylim[1:2]) - rxi1<-xypin[1]*(xylim[2]-(rxlim[2]+rxext))/diff(xylim[1:2]) - y01i<-xypin[2]*(xylim[4]-(rylim[2]+ryext))/diff(xylim[3:4]) - y02i<-xypin[2]*((rylim[1]-ryext)-xylim[3])/diff(xylim[3:4]) - plot(x,y,xlim=rxlim,ylim=rylim,...) - xypin<-par("pin") - par(xpd=NA) - xylim<-par("usr") - xymai<-par("mai") - x0<-xylim[1]-diff(xylim[1:2])*(xymai[2]+xymai[4]+rxi0)/xypin[1] - x1<-xylim[1]-diff(xylim[1:2])*(xymai[2]+xymai[4]+rxi1)/xypin[1] - y01<-xylim[4]-diff(xylim[3:4])*y01i/xypin[2] - y02<-xylim[3]+diff(xylim[3:4])*y02i/xypin[2] - par(xpd=TRUE) - if(!is.null(zoomtitle)) { - if(is.na(titlepos)) titlepos<-getFigCtr()[1] - mtext(zoomtitle,at=titlepos,cex=1.5,line=1.5) - } - if(is.na(xend)) xend<-xylim[1]-diff(xylim[1:2])*xymai[2]/(2*xypin[1]) - xprop0<-(xylim[1]-xend)/(xylim[1]-x0) - xprop1<-(xylim[2]-xend)/(xylim[2]-x1) - par(xpd=NA) - segments(c(x0,x0,x1,x1),c(y01,y02,y01,y02), - c(xend,xend,xend,xend), - c(xylim[4]-(xylim[4]-y01)*xprop0,xylim[3]+(y02-xylim[3])*xprop0, - xylim[4]-(xylim[4]-y01)*xprop1,xylim[3]+(y02-xylim[3])*xprop1)) - par(xpd=FALSE,mfrow=c(1,1)) -} diff --git a/README.Rmd b/README.Rmd deleted file mode 100644 index c25e173..0000000 --- a/README.Rmd +++ /dev/null @@ -1,60 +0,0 @@ ---- -output: github_document ---- - - - -```{r, include = FALSE} -knitr::opts_chunk$set( - collapse = TRUE, - comment = "#>", - fig.path = "man/figures/README-", - out.width = "100%" -) -``` - -# plotrix - - -[![R-CMD-check](https://github.com/plotrix/plotrix/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/plotrix/plotrix/actions/workflows/R-CMD-check.yaml) - - -`plotrix` is an `R` package that provides many plotting, labeling, and axis & -color scaling functions. - - -## Installation - -You can install the current release of `plotrix` from CRAN with: - -``` r -install.packages("plotrix") -``` - -You can install the development version of plotrix from [GitHub](https://github.com/) with: - -``` r -# install.packages("devtools") -devtools::install_github("plotrix/plotrix") -``` - -## Authors - - -The original author and maintainer of `plotrix`, Jim Lemon, passed away in -September 2023. - -Currently it is being maintained by Duncan Murdoch. Please submit -bug reports to https://github.com/plotrix/plotrix/issues. - -```{r echo = FALSE} -authors <- eval(parse(text = packageDescription("plotrix")$Authors)) - -keep <- sapply(authors, function(a) !any((c("aut", "cre") %in% a$role))) -``` - -Other contributors include: - -`r paste(authors[keep], collapse=", \n")`. - - diff --git a/README.md b/README.md deleted file mode 100644 index 34becee..0000000 --- a/README.md +++ /dev/null @@ -1,69 +0,0 @@ - - - -# plotrix - - - -[![R-CMD-check](https://github.com/plotrix/plotrix/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/plotrix/plotrix/actions/workflows/R-CMD-check.yaml) - - -`plotrix` is an `R` package that provides many plotting, labeling, and -axis & color scaling functions. - -## Installation - -You can install the current release of `plotrix` from CRAN with: - -``` r -install.packages("plotrix") -``` - -You can install the development version of plotrix from -[GitHub](https://github.com/) with: - -``` r -# install.packages("devtools") -devtools::install_github("plotrix/plotrix") -``` - -## Authors - -The original author and maintainer of `plotrix`, Jim Lemon, passed away -in September 2023. - -Currently it is being maintained by Duncan Murdoch. Please submit bug -reports to . - -Other contributors include: - -Ben Bolker \[ctb\], -Sander Oom \[ctb\], -Eduardo Klein \[ctb\], -Barry Rowlingson \[ctb\], -Hadley Wickham \[ctb\], -Anupam Tyagi \[ctb\], -Olivier Eterradossi \[ctb\], -Gabor Grothendieck \[ctb\], -Michael Toews \[ctb\], -John Kane \[ctb\], -Rolf Turner \[ctb\], -Carl Witthoft \[ctb\], -Julian Stander \[ctb\], -Thomas Petzoldt \[ctb\], -Remko Duursma \[ctb\], -Elisa Biancotto \[ctb\], -Ofir Levy \[ctb\], -Christophe Dutang \[ctb\], -Peter Solymos \[ctb\], -Robby Engelmann \[ctb\], -Michael Hecker \[ctb\], -Felix Steinbeck \[ctb\], -Hans Borchers \[ctb\], -Henrik Singmann \[ctb\], -Ted Toal \[ctb\], -Derek Ogle \[ctb\], -Darshan Baral \[ctb\], -Ulrike Groemping \[ctb\], -Bill Venables \[ctb\], -The CRAN Team \[ctb\]. diff --git a/_pkgdown.yml b/_pkgdown.yml deleted file mode 100644 index 4491878..0000000 --- a/_pkgdown.yml +++ /dev/null @@ -1,7 +0,0 @@ -url: ~ -template: - bootstrap: 5 -authors: - footer: - roles: aut - diff --git a/authors.html b/authors.html new file mode 100644 index 0000000..ddb59ae --- /dev/null +++ b/authors.html @@ -0,0 +1,202 @@ + +Authors and Citation • plotrix + Skip to contents + + +
+
+
+ +
+

Authors

+ +
  • +

    Jim Lemon. Author. +

    +
  • +
  • +

    Ben Bolker. Contributor. +

    +
  • +
  • +

    Sander Oom. Contributor. +

    +
  • +
  • +

    Eduardo Klein. Contributor. +

    +
  • +
  • +

    Barry Rowlingson. Contributor. +

    +
  • +
  • +

    Hadley Wickham. Contributor. +

    +
  • +
  • +

    Anupam Tyagi. Contributor. +

    +
  • +
  • +

    Olivier Eterradossi. Contributor. +

    +
  • +
  • +

    Gabor Grothendieck. Contributor. +

    +
  • +
  • +

    Michael Toews. Contributor. +

    +
  • +
  • +

    John Kane. Contributor. +

    +
  • +
  • +

    Rolf Turner. Contributor. +

    +
  • +
  • +

    Carl Witthoft. Contributor. +

    +
  • +
  • +

    Julian Stander. Contributor. +

    +
  • +
  • +

    Thomas Petzoldt. Contributor. +

    +
  • +
  • +

    Remko Duursma. Contributor. +

    +
  • +
  • +

    Elisa Biancotto. Contributor. +

    +
  • +
  • +

    Ofir Levy. Contributor. +

    +
  • +
  • +

    Christophe Dutang. Contributor. +

    +
  • +
  • +

    Peter Solymos. Contributor. +

    +
  • +
  • +

    Robby Engelmann. Contributor. +

    +
  • +
  • +

    Michael Hecker. Contributor. +

    +
  • +
  • +

    Felix Steinbeck. Contributor. +

    +
  • +
  • +

    Hans Borchers. Contributor. +

    +
  • +
  • +

    Henrik Singmann. Contributor. +

    +
  • +
  • +

    Ted Toal. Contributor. +

    +
  • +
  • +

    Derek Ogle. Contributor. +

    +
  • +
  • +

    Darshan Baral. Contributor. +

    +
  • +
  • +

    Ulrike Groemping. Contributor. +

    +
  • +
  • +

    Bill Venables. Contributor. +

    +
  • +
  • +

    The CRAN Team. Contributor. +

    +
  • +
  • +

    Duncan Murdoch. Contributor, maintainer. +

    +
  • +
+ +
+

Citation

+

Source: inst/CITATION

+ +

Lemon, J. (2006) Plotrix: a package in the red light + district of R. R-News, 6(4): 8-12.

+
@Article{,
+  year = {2006},
+  title = {Plotrix: a package in the red light district of R},
+  journal = {R-News},
+  volume = {6},
+  number = {4},
+  pages = {8-12},
+  author = {Lemon J},
+}
+
+ +
+ + +
+ + + +
+ + + + + + + diff --git a/authors.md b/authors.md new file mode 100644 index 0000000..e23b9d7 --- /dev/null +++ b/authors.md @@ -0,0 +1,85 @@ +# Authors and Citation + +## Authors + +- **Jim Lemon**. Author. + +- **Ben Bolker**. Contributor. + +- **Sander Oom**. Contributor. + +- **Eduardo Klein**. Contributor. + +- **Barry Rowlingson**. Contributor. + +- **Hadley Wickham**. Contributor. + +- **Anupam Tyagi**. Contributor. + +- **Olivier Eterradossi**. Contributor. + +- **Gabor Grothendieck**. Contributor. + +- **Michael Toews**. Contributor. + +- **John Kane**. Contributor. + +- **Rolf Turner**. Contributor. + +- **Carl Witthoft**. Contributor. + +- **Julian Stander**. Contributor. + +- **Thomas Petzoldt**. Contributor. + +- **Remko Duursma**. Contributor. + +- **Elisa Biancotto**. Contributor. + +- **Ofir Levy**. Contributor. + +- **Christophe Dutang**. Contributor. + +- **Peter Solymos**. Contributor. + +- **Robby Engelmann**. Contributor. + +- **Michael Hecker**. Contributor. + +- **Felix Steinbeck**. Contributor. + +- **Hans Borchers**. Contributor. + +- **Henrik Singmann**. Contributor. + +- **Ted Toal**. Contributor. + +- **Derek Ogle**. Contributor. + +- **Darshan Baral**. Contributor. + +- **Ulrike Groemping**. Contributor. + +- **Bill Venables**. Contributor. + +- **The CRAN Team**. Contributor. + +- **Duncan Murdoch**. Contributor, maintainer. + +## Citation + +Source: +[`inst/CITATION`](https://github.com/plotrix/plotrix/blob/master/inst/CITATION) + +Lemon, J. (2006) Plotrix: a package in the red light district of R. +R-News, 6(4): 8-12. + + @Article{, + year = {2006}, + title = {Plotrix: a package in the red light district of R}, + journal = {R-News}, + volume = {6}, + number = {4}, + pages = {8-12}, + author = {Lemon J}, + } diff --git a/cran-comments.md b/cran-comments.md deleted file mode 100644 index 5278e98..0000000 --- a/cran-comments.md +++ /dev/null @@ -1,22 +0,0 @@ -## 3.8-13 - - - Fixes CRAN issues: URL moved, width of usage. - -## 3.8-12 - -This is a fairly minor bug fix release. It also adds a few -options to the `gap.plot()` function. Here's the news: - - - Fixed warnings in `gap.plot()` when there were 2 gaps. - - - Fixed `pie3D()` which skipped very small slices (issue #9). - - Fixed `polar.plot()` which put labels in the wrong place (PR #8). - - - Fixed `plotCI()` to allow `pch` to be a vector (PR #11). - - - Added arguments to `gap.plot()` to support non-standard - box types (PR #17). - - - Added pkgdown site at https://plotrix.github.io/plotrix/ - - - Changed `Authors` to more descriptive `Authors@R`. diff --git a/data/death_reg.rda b/data/death_reg.rda deleted file mode 100644 index 16f1185..0000000 Binary files a/data/death_reg.rda and /dev/null differ diff --git a/data/l2010.rda b/data/l2010.rda deleted file mode 100644 index 79a3e5b..0000000 Binary files a/data/l2010.rda and /dev/null differ diff --git a/data/soils.rda b/data/soils.rda deleted file mode 100755 index 26543cd..0000000 Binary files a/data/soils.rda and /dev/null differ diff --git a/demo/00Index b/demo/00Index deleted file mode 100755 index 24ab603..0000000 --- a/demo/00Index +++ /dev/null @@ -1 +0,0 @@ -plotrix Interactive demo of plotrix functions diff --git a/demo/plotrix.R b/demo/plotrix.R deleted file mode 100755 index 73af0d5..0000000 --- a/demo/plotrix.R +++ /dev/null @@ -1,1005 +0,0 @@ -# the interactive plotrix demo -par(ask=FALSE) -answer<-"Z" -whichplot<-"Z" -while(answer != "Q" && whichplot != "X") { -cat("1. Plots B-K\n2. Plots L-Z\n3. Enhancements A-L\n") -cat("4. Enhancements L-V\nQ. Quit\n") -answer<-toupper(readline("Choose a group - ")) -if(answer == "Q") break -if(answer=="1") { - cat("1. barNest - Plot nested breakdowns as superimposed bars\n") - cat("2. barp - A bar plotting routine similar to barplot\n") - cat("3. battleship.plot - Plot the values of a matrix as stacked rectangles\n") - cat("4. box.heresy - An unconventional box plot\n") - cat("5. brkdn.plot - Plot aggregate values from groups defines by factors\n") - cat("6. bumpchart - A league table by time plot\n") - cat("7. centipede.plot - A league table (ranking) plot\n") - cat("8. clock24.plot - Plot values on a 24 hour 'clockface'\n") - cat("9. clustered.dotplots - a sort of graphical crosstabulation\n") - cat("A. color2D.matplot - Display a numeric matrix as colors\n") - cat("B. color.scale.lines - Plot lines with colors dependent upon values\n") - cat("C. dendroPlot - Display distributions as dendrites\n") - cat("D. densityGrid - Overlay observation density and intensity on a map\n") - cat("E. diamondplot - Plot variables as polygons on a radial grid\n") - cat("F. dotplot.mtb - Minitab style dotplot\n") - cat("G. ehplot - Englemann-Hecker plot\n") - cat("H. election - Display party affiliations by color\n") - cat("I. fan.plot - Like a pie chart with overlaid sectors\n") - cat("J. feather.plot - Display vectors along a horizontal line\n") - cat("K. floating.pie - Display one or more pie charts\n") - cat("L. gantt.chart - Display a Gantt chart\n") - cat("M. gap.barplot - A bar plot with a specified gap\n") - cat("N. gap.boxplot - A box plot with a specified gap\n") - cat("O. gap.plot - A scatterplot with a specified gap\n") - cat("P. histStack - Display a stacked histogram\n") - cat("Q. intersectDiagram - Display set intersections as rectangles\n") - cat("R. joyPlot - Display a series of density or other curves\n") - cat("S. kiteChart - Display a matrix of values as polygon segments\n") - cat("X. Exit\n") - #par(ask=TRUE) - whichplot<-toupper(readline("Choose a plot - ")) - if(whichplot == "1") { - test.df<-data.frame(Age=rnorm(100,25,10), - Sex=sample(c("M","F"),100,TRUE), - Marital=sample(c("M","X","S","W"),100,TRUE), - Employ=sample(c("FT","PT","NO"),100,TRUE)) - test.col<-list(Overall="green",Employ=c("purple","orange","brown"), - Marital=c("#1affd8","#caeecc","#f7b3cc","#94ebff"),Sex=c(2,4)) - barNest(formula=Age~Employ+Marital+Sex,data=test.df,main="barNest", - col=test.col,showall=TRUE,ylab="Mean age") - } - if(whichplot == "2") { - happyday<-data.frame(Monday=c(2.3,3.4),Tuesday=c(2.8,3.3),Wednesday=c(3.2,3.1), - Thursday=c(3.6,2.8),Friday=c(4.2,2.6),Saturday=c(4.5,2.9),Sunday=c(4.1,2.8)) - happylabels<-c("Utterly dashed","Rather mopey","Indifferent","Somewhat elated", - "Euphoric") - barp(happyday,names.arg=names(happyday),legend.lab=c("Slaves","Unemployed"), - legend.pos=list(x=2,y=4.5),col=c("#ee7700","#3333ff"), - main="Test of barp, staxlab and color.legend", - xlab="Day of week",ylab="Happiness rating",ylim=c(1,5),staxx=TRUE,staxy=TRUE, - height.at=1:5,height.lab=happylabels,cex.axis=1,cylindrical=TRUE, - shadow=TRUE) - par(mar=c(5,4,4,2)) - h1<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2))) - h2<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2))) - h3<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2))) - hmat<-matrix(c(h1,h2,h3),nrow=3,byrow=TRUE) - barp(hmat,names.arg=names(h1),width=0.45,col=2:4, - main="Multiple histogram using barp",xlab="Bins",ylab="Frequency") - legend(3.8,50,c("h1","h2","h3"),fill=2:4) - } - if(whichplot == "3") { - x<-matrix(sample(10:50,100,TRUE),10) - xaxlab=c("One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten") - yaxlab=c("First","Second","Third","Fourth","Fifth","Sixth","Seventh", - "Eighth","Ninth","Tenth") - battleship.plot(x,xlab="The battle has just begun",main="Battleship1", - xaxlab=xaxlab,yaxlab=yaxlab) - } - if(whichplot == "4") { - y1<-runif(20,2,10) - y2<-rnorm(30,6,2) - y3<-sample(0:20,40,TRUE) - Ns<-c(20,30,40) - ymean<-c(mean(y1),mean(y2),mean(y3)) - y1inner<-quantile(y1,probs=c(.16,.84)) - y2inner<-c(ymean[2]+sd(y2),ymean[2]-sd(y2)) - y3inner<-quantile(y3,probs=c(.16,.84)) - uinner<-c(y1inner[1],y2inner[1],y3inner[1]) - linner<-c(y1inner[2],y2inner[2],y3inner[2]) - ulim<-c(max(y1),max(y2),max(y3)) - llim<-c(min(y1),min(y2),min(y3)) - box.heresy(ymean,uinner=uinner,linner=linner,ulim=ulim,llim=llim,boxwidth=Ns, - main="Boxplot of means, central spread and range",xlab="Distribution", - xaxlab=c("Uniform","Normal","Sample")) - } - if(whichplot == "5") { - test.df<-data.frame(a=rnorm(80)+4,b=rnorm(80)+4,c=rep(LETTERS[1:4],each=20), - d=rep(rep(letters[1:4],each=4),5)) - # first use the default values - brkdn.plot("a","c","d",test.df,pch=1:4,col=1:4) - } - if(whichplot == "6") { - educattn<-matrix(c(90.4,90.3,75.7,78.9,66,71.8,70.5,70.4,68.4,67.9, - 67.2,76.1,68.1,74.7,68.5,72.4,64.3,71.2,73.1,77.8),ncol=2,byrow=TRUE) - rownames(educattn)<-c("Anchorage AK","Boston MA","Chicago IL", - "Houston TX","Los Angeles CA","Louisville KY","New Orleans LA", - "New York NY","Philadelphia PA","Washington DC") - colnames(educattn)<-c(1990,2000) - bumpchart(educattn,rank=FALSE, - main="Percentage high school completion by over 25s",col=rainbow(10)) - par(mar=c(5,5,4,2)) - } - if(whichplot == "7") { - testcp<-list("",40) - for(i in 1:40) testcp[[i]]<-rnorm(sample(1:8,1)*50) - segs<-get.segs(testcp) - centipede.plot(segs,main="Centipede plot",vgrid=0) - xy.mat<-cbind(sample(1:10,200,TRUE),sample(1:10,200,TRUE)) - } - if(whichplot == "8") { - testlen<-rnorm(24)*2+5 - testpos<-0:23+rnorm(24)/4 - clock24.plot(testlen,testpos,main="Test Clock24 (lines)",show.grid=FALSE, - line.col="green",lwd=3) - } - if(whichplot == "9") { - data(mtcars) - cumcars<-by(mtcars$carb,list(mtcars$cyl,mtcars$gear),valid.n) - mtcars2<-data.frame(cyl=NA,gear=NA,carb=NA) - rownum<-1 - for(cyl in dimnames(cumcars)[[1]]) { - for(gear in dimnames(cumcars)[[2]]) { - if(!is.na(cumcars[cyl,gear])) { - mtcars2[rownum,]<-c(as.numeric(cyl),as.numeric(gear),cumcars[cyl,gear]) - rownum<-rownum+1 - } - } - } - clustered.dotplots(xgroup = mtcars2$cyl, ygroup = mtcars2$gear, - freq = mtcars2$carb,main="Cars by number of cylinders and gears", - xlab="Number of cylinders",ylab="Number of gears",type="points",pch=5) - } - if(whichplot == "A") { - x<-matrix(rnorm(1024),nrow=32) - # simulate a correlation matrix with values -0.5 to 0.5 - x<-rescale(x,c(-0.5,0.5)) - # add a column with the extreme values (-1,1) to calculate - # the colors, then drop the extra column in the result - cellcol<-color.scale(cbind(x,c(-1,rep(1,31))),c(0,1),0,c(1,0))[,1:32] - color2D.matplot(x,cellcolors=cellcol,main="Blue to red correlations") - # do the legend call separately to get the full range - color.legend(0,-4,10,-3,legend=c(-1,-0.5,0,0.5,1), - rect.col=color.scale(c(-1,-0.5,0,0.5,1),c(0,1),0,c(1,0)),align="rb") - } - if(whichplot == "B") { - x<-c(0,cumsum(rnorm(99))) - y<-c(0,cumsum(rnorm(99))) - xydist<-sqrt(x*x+y*y) - plot(x,y,main="Random walk plot (color.scale.lines)",xlab="X",ylab="Y",type="n") - color.scale.lines(x,y,c(1,1,0),0,c(0,1,1),colvar=xydist,lwd=2) - boxed.labels(x,y,labels=1:100,border=FALSE,cex=0.5) - } - if(whichplot == "C") { - x<-list(runif(90,1,2),factor(sample(LETTERS,100,TRUE)),rnorm(80,mean=5)) - dendroPlot(x,breaks=list(seq(1,2,by=0.1),0,0:10),nudge=c(0.03,0.3), - xlab="Groups",ylab="Counts",main="Test dendroPlot") - } - if(whichplot == "D") { - x<-sample(1:20,400,TRUE) - y<-sample(1:20,400,TRUE) - z<-runif(400,5,20) - xyz<-makeDensityMatrix(x,y,z,nx=20,ny=20,xlim=c(1,10),ylim=c(1,10), - geocoord=FALSE) - par(mar=c(7,3,2,3)) - plot(0,xlim=c(1,10),ylim=c(1,10),type="n",xlab="",axes=FALSE) - box() - densityGrid(xyz,range.cex=c(1,4),xlim=c(1,10),ylim=c(1,10), - red=c(0,0.5,0.8,1),green=c(1,0.8,0.5,0),blue=0,pch=15) - color.legend(3,-0.7,7,-0.2,c(5,10,15,20), - rect.col=color.scale(1:4,cs1=c(0,0.5,0.8,1),cs2=c(1,0.8,0.5,0),cs3=0,alpha=1)) - par(xpd=TRUE) - text(5,0.3,"Intensity") - points(c(3.5,4.5,5.5,6.5),rep(-1.7,4),pch=15,cex=1:4) - text(c(3.5,4.5,5.5,6.5),rep(-1.3,4),1:4) - text(5,-1,"Density") - par(xpd=FALSE) - } - if(whichplot == "E") { - data(mtcars) - mysubset<-mtcars[substr(dimnames(mtcars)[[1]],1,1)=="M",c("mpg","hp","wt","disp")] - diamondplot(mysubset,name="Diamondplot") - } - if(whichplot == "F") { - x <- rpois(100,10) - dotplot.mtb(x,yaxis=TRUE,main="Minitab dotplot with y-axis.") - } - if(whichplot == "G") { - data(iris) - ehplot(iris$Sepal.Length, iris$Species, intervals=20, cex=1.8, pch=20) - } - if(whichplot == "H") { - eu = structure(list(colour = c("#3399FF", "#F0001C", "#0054A5", - "#FFD700", "#990000", "#909090", "#32CD32", "#40E0D0"), - party = c("EPP", "S and D", "ECR", "ALDE", "GUE-NGL", - "Non-Inscrits", "Greens-EFA", "EFDD"), - members = c(220L, 191L, 70L, 68L, 52L, 52L, 50L, 48L)), - .Names = c("colour", "party", "members"), row.names = c(NA, - -8L), class = "data.frame") - strasbourg = seats(751, 16) - eugov = election(strasbourg, eu, party~members, colours=eu$colour) - oldmar<-par(mar=c(2,4,4,2)) - plot(eugov$x, eugov$y, col=eugov$colour, asp=1, pch=19, ylim=c(-2,2.5), - xlab="", ylab="", main="EU Parliament 2014", axes=FALSE) - legend(-0.7,-0.3,eu$party,fill=eu$colour) - par(oldmar) - } - if(whichplot == "I") { - iucn.df<-data.frame(area=c("Africa","Asia","Europe","N&C America", - "S America","Oceania"),threatened=c(5994,7737,1987,4716,5097,2093)) - fan.plot(iucn.df$threatened,max.span=pi, - labels=paste(iucn.df$area,iucn.df$threatened,sep="-"), - main="Threatened species by geographical area (fan.plot)",ticks=276) - } - if(whichplot == "J") { - feather.plot(0.6+rnorm(8)/5,seq(0,7*pi/4,by=pi/4),1:8, - main="Test of feather.plot",xlab="Time",ylab="Value") - } - if(whichplot == "K") { - plot(1:5,type="n",main="Floating Pie test",xlab="",ylab="",axes=FALSE) - box() - polygon(c(0,0,5.5,5.5),c(0,3,3,0),border="#44aaff",col="#44aaff") - floating.pie(1.7,3,c(2,4,4,2,8),radius=0.5, - col=c("#ff0000","#80ff00","#00ffff","#44bbff","#8000ff")) - floating.pie(3.1,3,c(1,4,5,2,8),radius=0.5, - col=c("#ff0000","#80ff00","#00ffff","#44bbff","#8000ff")) - floating.pie(4,1.5,c(3,4,6,7),radius=0.5, - col=c("#ff0066","#00cc88","#44bbff","#8000ff")) - draw.circle(3.9,2.1,radius=0.04,col="white") - draw.circle(3.9,2.1,radius=0.04,col="white") - draw.circle(3.9,2.1,radius=0.04,col="white") - draw.circle(4,2.3,radius=0.04,col="white") - draw.circle(4.07,2.55,radius=0.04,col="white") - draw.circle(4.03,2.85,radius=0.04,col="white") - text(c(1.7,3.1,4),c(3.7,3.7,3.7),c("Pass","Pass","Fail")) - } - if(whichplot == "L") { - Ymd.format<-"%Y/%m/%d" - gantt.info<-list(labels= - c("First task","Second task","Third task","Fourth task","Fifth task"), - starts=as.POSIXct(strptime( - c("2004/01/01","2004/02/02","2004/03/03","2004/05/05","2004/09/09"), - format=Ymd.format)), - ends=as.POSIXct(strptime( - c("2004/03/03","2004/05/05","2004/05/05","2004/08/08","2004/12/12"), - format=Ymd.format)), - priorities=c(1,2,3,4,5)) - vgridpos<-as.POSIXct(strptime(c("2004/01/01","2004/02/01","2004/03/01", - "2004/04/01","2004/05/01","2004/06/01","2004/07/01","2004/08/01", - "2004/09/01","2004/10/01","2004/11/01","2004/12/01"),format=Ymd.format)) - vgridlab<- - c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec") - gantt.chart(gantt.info,main="Calendar date Gantt chart (2004)", - priority.legend=TRUE,vgridpos=vgridpos,vgridlab=vgridlab,hgrid=TRUE) - } - if(whichplot == "M") { - twogrp<-c(rnorm(10)+4,rnorm(10)+20) - gap.barplot(twogrp,gap=c(8,16),xlab="Index",ytics=c(3,6,17,20), - ylab="Group values",main="gap.barplot") - } - if(whichplot == "N") { - twovec<-list(vec1=c(rnorm(30),-6),vec2=c(sample(1:10,40,TRUE),20)) - gap.boxplot(twovec,gap=list(top=c(12,18),bottom=c(-5,-3)), - main="Test gap.boxplot") - } - if(whichplot == "O") { - twogrp<-c(rnorm(5)+4,rnorm(5)+20,rnorm(5)+5,rnorm(5)+22) - gpcol<-c(2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5) - gap.plot(twogrp,gap=c(8,16),xlab="Index",ylab="Group values", - main="Test gap.plot",col=gpcol) - } - if(whichplot == "P") { - df<-data.frame(len=rnorm(100)+5, - grp=sample(c("A","B","C","D"),100,replace=TRUE)) - histStack(len~grp,data=df,main="Default (rainbow) colors", - xlab="Length category") - } - if(whichplot == "Q") { - druguse<-matrix(c(sample(c(0,1),200,TRUE,prob=c(0.15,0.85)), - sample(c(0,1),200,TRUE,prob=c(0.35,0.65)), - sample(c(0,1),200,TRUE,prob=c(0.5,0.5)), - sample(c(0,1),200,TRUE,prob=c(0.9,0.1))),ncol=4) - colnames(druguse)<-c("Alc","Tob","THC","Amp") - druglist<-makeIntersectList(druguse,sep="\n") - # first display it as counts - intersectDiagram(druglist,main="Patterns of drug use",sep="\n") - } - if(whichplot == "R") { - numbmat<-matrix(runif(500,0,1),nrow=10) - denslist<-apply(numbmat,1,density) - names(denslist)<-month.abb[1:10] - joyPlot(denslist,main="Test of joyPlot",fill="lightgray") - } - if(whichplot == "S") { - testmat<-matrix(c(runif(50),sample(1:50,50),rnorm(50)+5, - sin(1:50)),ncol=50,byrow=TRUE) - kiteChart(testmat,varlabels=c("Uniform","Sample","Normal","Sine"), - timepos=seq(1,50,by=5),timex=FALSE) - # not enough space for the last label, add it - mtext("Sine",at=65,side=1,line=2) - } - if(whichplot=="X") break -} -if(answer == "2") { - cat("1. labbePlot - Display a L'Abbe plot - successes as sizes of circles\n") - cat("2. ladderplot - Plot 1D scatterplots with connecting lines\n") - cat("3. multhist - Histogram for multiple series\n") - cat("4. oz.windrose - Australian Bureau of Meteorology wind rose\n") - cat("5. panes - Prepare a 'panel' type plot\n") - cat("6. perspx - Perspective plot\n") - cat("7. pie3D - 3D pie chart\n") - cat("8. plotH - Scatterplot with histogram-like bars\n") - cat("9. polar.plot - Plot values on a 360 degree chart\n") - cat("A. pyramid.plot - Pyramid plot\n") - cat("B. radial.pie - Plot sectors/annuli on a circular grid\n") - cat("C. radial.plot - Plot values on a 0 to 2*pi grid\n") - cat("D. raw.means.plot - Plot for experimental designs\n") - cat("E. sizeplot - Plot with repeated symbols by size\n") - cat("F. sizetree - Categorical breakdown as stacked rectangles\n") - cat("G. size_n_color - Display circles with specified size and color\n") - cat("H. stackpoly - Like a line plot with fill under the lines\n") - cat("I. staircase.plot - Display a staircase plot\n") - cat("J. taylor.diagram - Display a Taylor diagram\n") - cat("K. triax.plot - Triangle (three axis) plot\n") - cat("L. twoord.plot - Plot with two ordinates\n") - cat("M. vectorField - Diaplay magnitude/direction vectors\n") - cat("N. violin_plot - Display a violin plot\n") - cat("O. weighted.hist - Display a weighted histogram\n") - cat("P. zoomInPlot - Display a plot with a magnified section\n") - cat("X. Exit\n") - whichplot<-toupper(readline("Choose a plot - ")) - if(whichplot == "1") { - didf<-data.frame(subject=1:50,interv=rep(c("therapist","ex-drinker"),each=25), - outcome=sample(c("more","less"),50,TRUE)) - # make it into a table - didf.tab<-table(didf$interv,didf$outcome) - # now mix in some raw percentages just for the example - didf2<-c(74,46,200) - didf3<-c(33,87,500) - x<-list(didf.tab,didf2,didf3) - labbecol<-list("red","green","blue") - labbePlot(x,main="Ex-drinkers vs therapists", - xlab="Percent reduced drinking (ex-drinkers)", - ylab="Percent reduced drinking (therapists)", - labels=list("A","B52","X117"),col=labbecol) - labbePlot(list(c(20,40,20)),col=list("purple"),labels=list("Z"),add=TRUE) - } - if(whichplot == "2") { - x<-data.frame(A=c(1:10), B=c(2:11)+rnorm(10)) - y<-data.frame(x, C=c(1:10)+rnorm(10)) - ladderplot(x) - } - if(whichplot == "3") { - l<-list(runif(10)*10,1:10,c(1,1,1,1,4,8)) - multhist(l) - } - if(whichplot == "4") { - windagg<-matrix(c(8,0,0,0,0,0,0,0,4,6,2,1,6,3,0,4,2,8,5,3,5,2,1,1, - 5,5,2,4,1,4,1,2,1,2,4,0,3,1,3,1),nrow=5,byrow=TRUE) - oz.windrose(windagg) - } - if(whichplot == "5") { - y<-runif(8) - oldpar<-panes(matrix(1:4,nrow=2,byrow=TRUE)) - par(mar=c(0,2,1.6,0)) - boxplot(y,axes=FALSE) - axis(2) - box() - par(mar=c(0,0,1.6,2)) - tab.title("Boxplot of y",tab.col="#88dd88") - barplot(y,axes=FALSE,col=2:9) - axis(4) - box() - tab.title("Barplot of y",tab.col="#88dd88") - par(mar=c(2,2,1.6,0)) - pie(y,col=2:9) - tab.title("Pie chart of y",tab.col="#88dd88") - box() - par(mar=c(2,0,1.6,2)) - plot(y,xaxs="i",xlim=c(0,9),axes=FALSE,col=2:9) - axis(4) - box() - tab.title("Scatterplot of y",tab.col="#88dd88") - # center the title at the left edge of the last plot - mtext("Test of panes function",at=0,side=1,line=0.8,cex=1.5) - par(mfrow=c(1,1)) - } - if(whichplot == "6") { - x <- 1:10 - y <- 1:10 - z <- outer(x,y,function(x,y) { 3*sin(2*pi*x)/(2*pi*x)+exp(y/10)+(x*y)/1000 }) - par(mar=c(5,10,2,2)) - pp <- perspx(x,y,z,ticktype="detailed",phi=30,theta=80,nticks=3,r=10, - axes=FALSE) - par(mar=c(5,4,4,2)) - } - if(whichplot == "7") { - pieval<-c(2,4,6,8) - pielabels<-c("We hate\n pies","We oppose\n pies", - "We don't\n care","We just love pies") - # grab the radial positions of the labels - lp<-pie3D(pieval,radius=0.9,labels=pielabels,explode=0.1, - main="3D PIE OPINIONS") - par(mar=c(5,4,4,2)) - } - if(whichplot == "8") { - d<-data.frame(x=c(1,5,10:20),y=runif(13)+1, - g=factor(sample(c("A","B","C"),13,replace=TRUE))) - # new plotH function with formula notation - plotH(y~x,data=d) - } - if(whichplot == "9") { - testlen<-c(rnorm(36)*2+5) - testpos<-seq(0,350,by=10) - polar.plot(testlen,testpos,main="Test Polar Plot",lwd=3,line.col=4) - } - if(whichplot == "A") { - xy.pop<-c(3.2,3.5,3.6,3.6,3.5,3.5,3.9,3.7,3.9,3.5,3.2,2.8,2.2,1.8, - 1.5,1.3,0.7,0.4) - xx.pop<-c(3.2,3.4,3.5,3.5,3.5,3.7,4,3.8,3.9,3.6,3.2,2.5,2,1.7,1.5, - 1.3,1,0.8) - agelabels<-c("0-4","5-9","10-14","15-19","20-24","25-29","30-34", - "35-39","40-44","45-49","50-54","55-59","60-64","65-69","70-74", - "75-79","80-44","85+") - mcol<-color.gradient(c(0,0,0.5,1),c(0,0,0.5,1),c(1,1,0.5,1),18) - fcol<-color.gradient(c(1,1,0.5,1),c(0.5,0.5,0.5,1),c(0.5,0.5,0.5,1),18) - par(mar=pyramid.plot(xy.pop,xx.pop,labels=agelabels, - main="Australian population pyramid 2002",lxcol=mcol,rxcol=fcol, - gap=0.5,show.values=TRUE)) - } - if(whichplot == "B") { - pie1<-c(3,6,5,4,7,8,9,1,4) - pie2<-list(0:3,1:6,2:5,1:4,0:7,4:8,2:9,0:1,0:4) - pie3<-sample(10:60,36) - pie4<-list(sort(sample(1:60,8))) - for(sector in 2:36) pie4[[sector]]<-sort(sample(1:60,8)) - par(radial.pie(pie1,labels=LETTERS[1:9])) - } - if(whichplot == "C") { - testlen<-runif(10,0,10) - testpos<-seq(0,18*pi/10,length=10) - testlab<-letters[1:10] - par(radial.plot(testlen,testpos,main="Test Radial Lines",line.col="red", - lwd=3,rad.col="lightblue")) - } - if(whichplot == "D") { - x <- data.frame(id = 1:150, - offset = rep(c("Group A", "Group B", "Group C"), - each = 50), xaxis = sample(c("A", "B", "C", "D"),150, replace = TRUE), - data = c(rnorm(50, 10, 5), rnorm(50, 15,6), rnorm(50, 20, 5))) - raw.means.plot(x) - } - if(whichplot == "E") { - x <- c(0.1,0.1,0.1,0.1,0.1,0.2,0.2,0.2,0.2,0.3,0.3) - y <- c( 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5 ) - plot(x,y) - sizeplot(x,y) - } - if(whichplot == "F") { - cat1<-factor(sample(c("None","Low","Medium","High","Extreme"),40,TRUE), - levels=c("None","Low","Medium","High","Extreme")) - cat2<-factor(sample(c("None","Low","Medium","High"),40,TRUE), - levels=c("None","Low","Medium","High")) - cat3<-factor(sample(c("None","Low","High"),40,TRUE), - levels=c("None","Low","High")) - hcats<-data.frame(cat1,cat2,cat3) - # throw in a few NAs - hcats$cat1[10]<-NA - hcats$cat2[c(15,20)]<-NA - hcats$cat3[c(11,14,25)]<-NA - # first let sizetree work out the colors - sizetree(hcats,main="Sizetree with automatic colors") - par(mar=c(5,4,4,2)) - } - if(whichplot == "G") { - meantemp<-c(19,22,25,29,21,20,16,27,23,26) - totalrain<-c(174,152,196,120,177,183,92,153,161,85) - numpumpkin<-c(53,47,61,63,38,42,48,71,66,29) - meanwt<-c(1.5,2.3,2.8,1.9,2.4,1.8,2.6,2.2,1.7) - size_n_color(meantemp,totalrain,meanwt/5,NA,xlim=c(15,30), - color.scale(numpumpkin,c(0.8,0),c(0.8,1),0), - xlab="Temperature (degrees C)",ylab="Rainfall (mm)", - main="Number and weight of pumpkins by temperature and rainfall", - xat=seq(15,30,by=5),yat=seq(80,200,by=20)) - color.legend(15,55,18.5,60,seq(40,70,by=10), - rect.col=color.scale(seq(40,70,by=10),c(0.8,0),c(0.8,1),0)) - points(15:18,rep(126,4),cex=seq(1.5,3.0,by=0.5)) - text(15:19,rep(134,5),c("1.5","2.0","2.5","3.0","kg")) - par(xpd=TRUE) - text(13.5,60,"Number of\npumpkins") - par(xpd=FALSE) - } - if(whichplot == "H") { - testx<-matrix(abs(rnorm(100)),nrow=10) - stackpoly(matrix(cumsum(testx),nrow=10),main="Test Stackpoly I", - xaxlab=c("One","Two","Three","Four","Five", - "Six","Seven","Eight","Nine","Ten"),border="black",staxx=TRUE) - } - if(whichplot == "I") { - sample_size<-c(500,-72,428,-94,334,-45,289) - totals<-c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE) - labels<-c("Contact list","Uncontactable","","Declined","","Ineligible", - "Final sample") - staircase.plot(sample_size,totals,labels, - main="Acquisition of the sample (staircase.plot)", - total.col="gray",inc.col=2:4,bg.col="#eeeebb",direction="s") - } - if(whichplot == "J") { - ref<-rnorm(30,sd=2) - model1<-ref+rnorm(30)/2 - model2<-ref+rnorm(30) - oldpar<-taylor.diagram(ref,model1) - taylor.diagram(ref,model2,add=TRUE,col="blue") - lpos<-1.5*sd(ref) - legend(lpos,lpos,legend=c("Better","Worse"),pch=19,col=c("red","blue")) - par(oldpar) - } - if(whichplot == "K") { - data(soils) - triax.plot(soils[1:10,],main="DEFAULT") - } - if(whichplot == "L") { - going_up<-seq(3,7,by=0.5)+rnorm(9) - going_down<-rev(60:74)+rnorm(15) - twoord.plot(2:10,going_up,1:15,going_down,xlab="Sequence", - ylab="Ascending values",rylab="Descending values",lcol=4, - main="Plot with two ordinates - points and lines", - do.first="plot_bg();grid(col=\"white\",lty=1)") - } - if(whichplot == "M") { - plot(1:10,type="n",main="Random vectors") - mag<-runif(100)+1 - dir<-runif(100)*2*pi - xpos<-rep(1:10,10) - ypos<-rep(1:10,each=10) - vectorcol<-sample(colors(),100) - vectorField(dir,mag,xpos,ypos,scale=0.8,vecspec="rad",col=vectorcol) - } - if(whichplot == "N") { - normvar<-c(rnorm(49),-4) - unifvar<-runif(50,-2,2) - violin_plot(matrix(c(normvar,unifvar),ncol=2), - main="Default plot",x_axis_labels=c("Normal","Uniform")) - } - if(whichplot == "O") { - testx<-sample(1:10,300,TRUE) - testw<-seq(1,4,by=0.01) - weighted.hist(testx,testw,breaks=1:10,main="Test weighted histogram") - } - if(whichplot == "P") { - zoomInPlot(rnorm(100),rnorm(100),rxlim=c(-1,1),rylim=c(-1,1), - zoomtitle="Zoom In Plot",titlepos=-1.5) - } - if(whichplot=="X") break -} -if(answer=="3") { - cat("1. ablineclip - add a line to a plot clipped to a specified rectangle\n") - cat("2. addtable2plot - Add a table of values to a plot\n") - cat("3. arctext - Display text on a circular arc\n") - cat("4. axis.break - Add a 'break' mark to an axis\n") - cat("5. axis.mult - Display an axis with a multiplier value\n") - cat("6. barlabels - Add bar labels to a bar plot\n") - cat("7. boxed.labels - Add labels with optional boxes around them\n") - cat("8. clean.args - Remove inappropriate arguments from a list\n") - cat("9. color.id - identify closest match to a named color\n") - cat("A. color.legend - Legend matching categories or values to colors\n") - cat("B. color.scale - Turn values into colors\n") - cat("C. corner.label - Find the corners of the plot and display a label\n") - cat("D. cylindrect - Display an apparent cylinder\n") - cat("E. dispersion - Display error bars or confidence bands\n") - cat("F. draw.(arc|circle|line) - display a graphic element on a plot\n") - cat("G. emptyspace/MaxEmptyRect - Find the largest empty space on a plot\n") - cat("H. fullaxis - Display an axis that extends the full width/height\n") - cat("I. getFigCtr - Get the coordinates of the center of the current figure\n") - cat("J. getMarginWidth - Calculate the margin needed for text or a legend\n") - cat("K. getYmult - Calculate the ratio of y values to x values\n") - cat("L. gradient.rect - Display a rectangle with shaded colors\n") - cat("M. hexagon - Draw a hexagon on the current plot\n") - cat("N. jiggle - Move points apart, a bit like jitter\n") - cat("O. legendg - Display a grouped legend\n") - cat("P. length.key - Key for interpreting lengths in a plot\n") - cat("X. Exit\n") - whichplot<-toupper(readline("Choose an enhancement - ")) - if(whichplot == "1") { - x <- rnorm(100) - y <- x + rnorm(100) - lmfit <- lm(y~x) - plot(x, y, xlim=c(-3.5, 3.5)) - ablineclip(lmfit, x1 = -2, x2 = 2, lty = 2) - ablineclip(h = 0, x1 = -2,x2 = 2,lty = 3, col = "red") - ablineclip(v = 0, y1 = -2.5, y2 = 1.5, lty=4, col = "green") - } - if(whichplot == "2") { - testdf <- data.frame(Before = c(10, 7, 5, 9), During = c(8, 6, 2, 5), - After = c(5, 3, 4, 3)) - rownames(testdf) <- c("Red", "Green", "Blue", "Lightblue") - barp(testdf, main = "Test addtable2plot", ylab = "Value", - names.arg = colnames(testdf), col = 2:5) - } - if(whichplot == "3") { - plot(0, xlim = c(1, 5),ylim = c(1, 5),main = "Test of arctext", xlab = "", - ylab = "", type = "n") - arctext("bendy like spaghetti", center = c(3,3), col = "blue") - arctext("bendy like spaghetti", center = c(3,3), radius = 1.5, start = pi, - cex = 2) - arctext("bendy like spaghetti", center = c(3, 3),radius = 0.5, - start = pi/2, stretch = 1.2) - arctext("bendy like spaghetti", center = c(3, 3), radius = 1.7, - start = 4 * pi / 3, cex = 1.3, clockwise = FALSE) - } - if(whichplot == "4") { - plot(3:10, main = "Axis break test") - # put a break at the default axis and position - axis.break() - axis.break(2, 2.9, style = "zigzag") - } - if(whichplot == "5") { - plot(1:10 * 0.001, 1:10 * 100,axes = FALSE, xlab = "", ylab = "", - main = "Axis multipliers") - box() - axis.mult(1, mult = 0.001) - axis.mult(2, mult = 100) - } - if(whichplot == "6") { - heights<-c(14,20,9,31,17) - barpos<-barplot(heights,main="A redundant bar plot") - # show the usual value labels on the bars - barlabels(barpos,heights) - } - if(whichplot == "7") { - x<-rnorm(10) - y<-rnorm(10) - plot(x,y,type="p") - nums<-c("one","two","three","four","five","six", - "seven","eight","nine","ten") - boxed.labels(x,y-0.1,nums) - } - if(whichplot == "8") { - tststr <- list(n=2,mean=0,sd=1,foo=4,bar=6) - clean.args(tststr,rnorm) - try(do.call("rnorm",tststr)) - do.call("rnorm",clean.args(tststr,rnorm)) - remove.args(tststr,rnorm) - } - if(whichplot == "9") { - cat("Color ID -",color.id("#cc00cc"),"\n") - } - if(whichplot == "A") { - # get some extra room - par(mar=c(7,4,4,6)) - testcol<-color.gradient(c(0,1),0,c(1,0),nslices=5) - col.labels<-c("Cold","Warm","Hot") - # this will put the labels at the intersections - # col.labels<-c("","Cold","","Warm","","Warmer","","Hot","") - color2D.matplot(matrix(rnorm(100),nrow=10),c(1,0),0,c(0,1), - main="Test color legends") - color.legend(11,6,11.8,9,col.labels,testcol,gradient="y") - color.legend(10.2,2,11,5,col.labels,testcol,align="rb",gradient="y") - color.legend(0.5,-2,3.5,-1.2,col.labels,testcol) - color.legend(7,-1.8,10,-1,col.labels,testcol,align="rb",col=testcol[c(1,3,5)]) - par(mar=c(5,4,4,2)) - } - if(whichplot == "B") { - x<-rnorm(20) - y<-rnorm(20) - plot(x,y,col=color.scale(y,c(0,1,1),c(1,1,0),0),main="Color scale plot", - pch=16,cex=2) - plot(1:10,rep(1:3,length.out=10),axes=FALSE,type="n",xlim=c(0,11),ylim=c(0,4), - main="Test of RGB, HSV and HCL",xlab="",ylab="Color specification") - axis(2,at=1:3,labels=c("HCL","HSV","RGB")) - points(1:10,rep(1,10),pch=19,cex=8,col=color.scale(1:10,c(0,300),35,85, - color.spec="hcl")) - points(1:10,rep(2,10),pch=19,cex=8,col=color.scale(1:10,c(0,1), - 0.8,1,color.spec="hsv")) - points(1:10,rep(3,10),pch=19,cex=8,col=color.scale(1:10,c(1,0.5,0), - c(0,0.5,0),c(0,0,1),color.spec="rgb")) - } - if(whichplot == "C") { - plot(1:10,1:10) - corner.label("A") - corner.label(x=1,y=1) - corner.label("B",y=-1,x=1,figcorner=TRUE,col="red") - } - if(whichplot == "D") { - plot(0,xlim=c(0,5),ylim=c(0,5),main="Examples of pseudocylindrical rectangles", - xlab="",ylab="",axes=FALSE,type="n") - cylindrect(0,0,1,5,"red") - cylindrect(rep(1,3),c(0,2,4),rep(4,3),c(1,3,5),"green",gradient="y") - cylindrect(4,0,5,5,"#8844aa") - } - if(whichplot == "E") { - disptest<-matrix(rnorm(200),nrow=20) - disptest.means<-rowMeans(disptest) - row.order<-order(disptest.means) - se.disptest<-unlist(apply(disptest,1,std.error)) - plot(disptest.means[row.order],main="Dispersion as error bars", - ylim=c(min(disptest.means-se.disptest),max(disptest.means+se.disptest)), - xlab="Occasion",ylab="Value") - dispersion(1:20,disptest.means[row.order],se.disptest[row.order]) - } - if(whichplot == "F") { - plot(0,xlim=c(0,10),ylim=c(0,10),type="n") - draw.arc(5,5,4,deg1=0,deg2=180,col="blue",lwd=3) - draw.circle(5,5,3,lwd=3,col="red") - draw.ellipse(5,5,2.5,1.5,col="green",lwd=3) - draw.radial.line(3,4,center=c(5,5),deg=270,lwd=3,col="brown") - } - if(whichplot == "G") { - x<-runif(100) - y<-runif(100) - plot(x,y,main="Find the maximum empty rectangle",xlab="X",ylab="Y") - mer<-maxEmptyRect(c(0,1),c(0,1),x,y) - rect(mer$rect[1],mer$rect[2],mer$rect[3],mer$rect[4],border="red") - es<-emptyspace(x,y) - boxed.labels(es,labels="Here is the\nempty space",bg="transparent") - } - if(whichplot == "H") { - plot(runif(20,-1,1),runif(20,-1,1),xlim=c(-1,1.5),main="Demo of fullaxis", - xlab="X",ylab="Y",axes=FALSE) - fullaxis(1,col="red",col.axis="red") - fullaxis(2,col="blue",col.axis="blue") - fullaxis(4,at=c(-0.5,0,0.5),labels=c("Negative","Zero","Positive"),pos=1.2, - col="green",las=1) - xylim<-par("usr") - segments(xylim[1],xylim[4],xylim[2],xylim[4]) - } - if(whichplot == "I") { - plot(1:10) - getFigCtr() - } - if(whichplot == "J") { - plot(rnorm(10)) - newmarinfo<-getMarginWidth(labels=c("Long label","Even longer label")) - oldmar<-par("mar") - par(mar=c(oldmar[1:3],newmarinfo$newmar)) - plot(rnorm(10)) - par(xpd=TRUE) - text(rep(newmarinfo$marcenter,2),c(0.5,-0.5), - c("Long label","Even longer label")) - par(mar=oldmar,xpd=FALSE) - } - if(whichplot == "K") { - plot(1:3,c(10,20,30)) - getYmult() - } - if(whichplot == "L") { - plot(0:10,type="n",axes=FALSE) - gradient.rect(1,0,3,6,reds=c(1,0), - greens=c(seq(0,1,length=10),seq(1,0,length=10)), - blues=c(0,1),gradient="y") - gradient.rect(4,0,6,6,c(seq(0,1,length=10),rep(1,10)), - c(rep(1,10),seq(1,0,length=10)),c(0,0),gradient="y") - gradient.rect(7,0,9,6,col=smoothColors("red",38,"blue"),border=NA) - } - if(whichplot == "M") { - plot(1:3,type="n") - hexagon(1.5,1.5,col="green") - } - if(whichplot == "N") { - ahw.df<-data.frame(Age=rnorm(100,35,10), - Height=rnorm(100,160,15),Weight=rnorm(100,75,20)) - par(mfrow=c(1,3)) - boxplot(ahw.df$Age,main="Age") - points(jiggle(100,c(0.5,1.5)),ahw.df$Age,col="red") - boxplot(ahw.df$Height,main="Height") - points(jiggle(100,c(0.5,1.5)),ahw.df$Height,col="green") - boxplot(ahw.df$Weight,main="Weight") - points(jiggle(100,c(0.5,1.5)),ahw.df$Weight,col="blue") - par(mfrow=c(1,1)) - } - if(whichplot == "O") { - plot(0.5,0.5,xlim=c(0,1),ylim=c(0,1),type="n", - main="Test of grouped legend function") - legendg(0.5,0.8,c("one","two","three"),pch=list(1,2:3,4:6), - col=list(1,2:3,4:6),pt.space=1.5) - legendg(0.5,0.5,c("one","two","three"),fill=list(1,2:3,4:6)) - } - if(whichplot == "P") { - o<-matrix(rep(pi*seq(0.1,0.8,by=0.1),7),ncol=8,byrow=TRUE) - m<-matrix(rnorm(56)+4,ncol=8,byrow=TRUE) - plot(0,xlim=c(0.7,8.3),ylim=c(0.7,7.3),type="n") - vectorField(o,m,vecspec="rad") - lengthKey(0.3,-0.5,c(0,5,10),0.24) - } - if(whichplot=="X") break -} -if(answer == "4") { - cat("1. multsymbolbox - Draw boxes filled with symbols\n") - cat("2. oz.windrose.legend - Draw a legend for oz.windrose\n") - cat("3. p2p_arrows - Draw arrows between specified points\n") - cat("4. pie.labels - Display labels on a pie chart\n") - cat("5. placeLabels - manually place labels on a plot\n") - cat("6. plot_bg - Add a background color to a plot\n") - cat("7. polygon.shadow - Display a shadow effect\n") - cat("8. print.brklist - Print the list generated by brkdnNest\n") - cat("9. propbrk - Calculate the proportion of a specified value\n") - cat("A. rectFill - Display rectangle(s) filled with symbols\n") - cat("B. rescale - Rescale a vector of numbers into a new range\n") - cat("C. Plot with one or both x and y axes reversed\n") - cat("D. ruginv - Add an inverse rug axis to a plot\n") - cat("E. smoothColors - Build a vector of interpolated colors\n") - cat("F. spread.labels - Spread out labels for clustered values\n") - cat("G. spreadout - Spread out a vector of numbers to a minimum spacing\n") - cat("H. starPie - A polygonal graphic object almost unlike a pie chart\n") - cat("I. staxlab - Stagger or rotate axis labels\n") - cat("J. tab.title - Display a plot title in a colored tab\n") - cat("K. thigmophobe.labels - Place labels away from the nearest point\n") - cat("L. triax.abline - Display a line on a triangle plot\n") - cat("M. triax.fill - Color the triangles on a triangle plot\n") - cat("N. tsxpos - Calculated equispaced x positions of plotted values\n") - cat("O. valid.n - Find the number of valid (not NA) values\n") - cat("X. Exit\n") - whichplot<-toupper(readline("Choose an enhancement - ")) - if(whichplot == "1") { - plot(1:10,1:10,type="n") - multsymbolbox(c(2,4),5,c(4,5),8,tot=c(10,8)) - } - if(whichplot == "2") { - plot(0,xlim=c(-20,20),ylim=c(-20,20),type="n",axes=FALSE,xlab="",ylab="") - par(xpd=TRUE) - oz.windrose.legend() - par(xpd=FALSE) - } - if(whichplot == "3") { - plot(1:2) - points(2:1) - p2p_arrows(c(1,2),c(1,1),c(2,1),c(2,2),code=3) - } - if(whichplot == "4") { - pieval<-c(2,1,3,94) - plot(1:5,type="n",axes=FALSE,xlab="",ylab="") - box() - bisect.angles<-floating.pie(3,3,pieval) - pie.labels(3,3,bisect.angles,c("two","one","three","ninety\nfour")) - } - if(whichplot == "5") { - x<-rnorm(3) - y<-rnorm(3) - cat("Click where the labels are to be placed\n") - plot(x,y) - placeLabels(x,y,LETTERS[1:3],flagcol="purple") - } - if(whichplot == "6") { - barp(1:5,do.first="plot_bg()",col=1:5) - } - if(whichplot == "7") { - par(pty="s") - plot(1:5,type="n",main="Polygon Shadow test",xlab="",ylab="",axes=FALSE) - box() - polygon(c(1,2.2,2.2,1),c(5,5,3.8,3.8),col="#ffff00") - polygon.shadow(c(1.2,2,2,1.2),c(4.8,4.8,4,4),col=c("#ffff00","#cccc00")) - polygon(c(1.2,2,2,1.2),c(4.8,4.8,4,4),col=c("#ff0000")) - polygon(c(4,5,5,4),c(2,2,1,1),col="#aaaaff") - polygon.shadow(c(4.5,4.8,4.2),c(1.7,1.2,1.2),col=c("#aaaaff","#8888cc"), - offset=c(0.1,-0.1),inflate=c(0.2,0.2)) - polygon(c(4.5,4.8,4.2),c(1.7,1.2,1.2),col=c("#00ff00")) - polygon.shadow(cos(seq(0,2*pi,by=pi/20))+3,sin(seq(0,2*pi,by=pi/20))+3, - offset=c(0,0),inflate=c(0.1,0.1)) - text(3,3,"Polygon shadow\nas a circular\ntext background",cex=1.5) - } - if(whichplot == "8") { - printbrktest<-data.frame(A=c(sample(1:10,99,TRUE),NA), - B=sample(c("Yes","No"),100,TRUE), - C=sample(LETTERS[1:3],100,TRUE)) - pbt<-brkdnNest(A~B+C,printbrktest) - print(pbt) - } - if(whichplot == "9") { - cat("Proportion of M -",propbrk(sample(LETTERS,100,TRUE),trueval="M")) - } - if(whichplot == "A") { - plot(1:7,type="n",xlab="",ylab="",main="Test of rectFill") - rectFill(1:6,1:6,2:7,2:7,bg=2:7,pch=c("+","*","o",".","#","^"), - xinc=c(0.2,0.1,0.2,0.1,0.2,0.2),yinc=c(0.2,0.1,0.2,0.1,0.2,0.2), - pch.col=1:6) - } - if(whichplot == "B") { - normal.counts<-rnorm(100) - normal.tab<-tabulate(cut(normal.counts,breaks=seq(-3,3,by=1))) - normal.density<-rescale(dnorm(seq(-3,3,length=100)),range(normal.tab)) - plot(c(-2.5,-1.5,-0.5,0.5,1.5,2.5),normal.tab,xlab="X values", - type="h",col="green") - lines(seq(-3,3,length=100),normal.density,col="blue") - } - if(whichplot == "C") { - x <- runif(20) - y <- runif(20) - revaxis(x,y,yside=4) -} - if(whichplot == "D") { - require(stats) - plot(density(faithful$eruptions,bw=0.15)) - ruginv(faithful$eruptions,ticksize=-0.05) - ruginv(jitter(faithful$eruptions,amount=0.01),side=3,col="lightblue") - } - if(whichplot == "E") { - plot(1:10,main="Test opaque colors",type="n",axes=FALSE) - box() - rect(1:7,1:7,3:9,3:9,col=smoothColors("red",2,"green",2,"blue")) - } - if(whichplot == "F") { - x<-sort(rnorm(10)) - y<-rnorm(10)/10 - plot(x,y,ylim=c(-1,1),type="p") - nums<-c("one","two","three","four","five","six","seven","eight","nine","ten") - spread.labels(x,y,nums) - } - if(whichplot == "G") { - cat("Spread out values -",spreadout(c(5,2.5,2.5,NA,3.5,1,3.5,NA),0.2),"\n") - } - if(whichplot == "H") { - date_mat<-data.frame(sex=rep(c("M","F"),each=10), - names=c("Abe","Bob","Col","Dave","Eddie","Frank","Geoff","Harry","Igor","Jack", - "Alice","Betty","Clare","Dora","Eva","Fran","Grace","Hilda","Iris","Joan"), - eating=sample(0:100,20),dancing=sample(0:100,20),movies=sample(0:100,20), - reading=sample(0:100,20),travel=sample(0:100,20)) - plot(0,xlim=c(0.5,10.5),ylim=c(0,3),type="n",axes=FALSE,xlab="",ylab="Sex", - main="Date matching matrix") - par(xpd=TRUE) - legend(0.7,-0.3,c("Eat out","Dance","Movies","Read","Travel"),fill=rainbow(5), - ncol=5) - par(xpd=FALSE) - box() - axis(2,at=c(0.9,2.4),labels=c("Male","Female")) - starPie(x=rep(1:10,2),y=rep(c(0.9,2.4),each=10),radext=0.5, - values=as.matrix(date_mat[,3:7]),label=as.character(date_mat[["names"]])) - } - if(whichplot == "I") { - x<-rnorm(12) - plot(x,axes=FALSE) - box() - months<-c("January","February","March","April","May","June", - "July","August","September","October","November","December") - staxlab(1,1:12,months) - } - if(whichplot == "J") { - testx<-matrix(cumsum(rnorm(30)^2)+1,nrow=10) - stackpoly(testx,main="", - xaxlab=c("One","Two","Three","Four","Five", - "Six","Seven","Eight","Nine","Ten"),staxx=TRUE) - tab.title("Three Squiggly Lines",tab.col="yellow",radius=0.5) - } - if(whichplot == "K") { - x<-rnorm(20) - y<-rnorm(20) - xlim<-range(x) - xspace<-(xlim[2]-xlim[1])/20 - xlim<-c(xlim[1]-xspace,xlim[2]+xspace) - ylim<-range(y) - yspace<-(ylim[2]-ylim[1])/20 - ylim<-c(ylim[1]-yspace,ylim[2]+yspace) - plotlabels<- - c("one","two","three","four","five","six","seven","eight","nine","ten", - "eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen", - "eighteen","nineteen","twenty") - plot(x=x,y=y,xlim=xlim,ylim=ylim,main="Test thigmophobe.labels") - thigmophobe.labels(x,y,plotlabels,col=c(2:6,8:12),font=2) - } - if(whichplot == "L") { - oldpar<-par() - triax.plot(data.frame(bottom=0.4,right=0.3,left=0.3), - main="Triax ablines",no.add=FALSE) - triax.abline(l=0.3,col="red") - triax.abline(r=0.3,col="green") - triax.abline(b=0.4,col="blue") - par(oldpar) - } - if(whichplot == "M") { - oldpar<-par() - fillval<-list(0,c(0,0.1,0),c(0,0.1,0.2,0.1,0), - c(0,0.1,0.2,0.3,0.2,0.1,0),c(0,0.1,0.2,0.3,0.4,0.3,0.2,0.1,0), - c(0,0.1,0.2,0.3,0.4,0.5,0.4,0.3,0.2,0.1,0), - c(0,0,0.1,0.2,0.3,0.4,0.5,0.4,0.3,0.2,0.1,0,0), - c(0,0,0,0.1,0.1,0.2,0.3,0.4,0.3,0.2,0.1,0.1,0,0,0)) - fillcol<-sapply(fillval,function(x) {x*10+1} ) - triax.plot(main="Test of triax.fill function") - triax.fill(fillcol) - par(oldpar) - } - if(whichplot == "N") { - y<-rnorm(28) - par(mfrow=c(2,1)) - plot(y,main="Plot of the values") - yt<-ts(y,start=2011,frequency=12) - plot(yt,main="Plot of the time series",xaxt="n",xlab="Month") - labelpos<-tsxpos(yt) - staxlab(1,labelpos,rep(month.abb,length.out=28)) - par(mfrow=c(1,1)) - } - if(whichplot == "O") { - cat("Valid n =",valid.n(c(1,2,3,NA,5,6,7,NA,9,10)),"\n") - } - if(whichplot=="X") break -} -} diff --git a/deps/bootstrap-5.3.1/bootstrap.bundle.min.js b/deps/bootstrap-5.3.1/bootstrap.bundle.min.js new file mode 100644 index 0000000..e8f21f7 --- /dev/null +++ b/deps/bootstrap-5.3.1/bootstrap.bundle.min.js @@ -0,0 +1,7 @@ +/*! + * Bootstrap v5.3.1 (https://getbootstrap.com/) + * Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e()}(this,(function(){"use strict";const t=new Map,e={set(e,i,n){t.has(e)||t.set(e,new Map);const s=t.get(e);s.has(i)||0===s.size?s.set(i,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(e,i)=>t.has(e)&&t.get(e).get(i)||null,remove(e,i){if(!t.has(e))return;const n=t.get(e);n.delete(i),0===n.size&&t.delete(e)}},i="transitionend",n=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),s=t=>{t.dispatchEvent(new Event(i))},o=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),r=t=>o(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(n(t)):null,a=t=>{if(!o(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},l=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),c=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?c(t.parentNode):null},h=()=>{},d=t=>{t.offsetHeight},u=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,f=[],p=()=>"rtl"===document.documentElement.dir,m=t=>{var e;e=()=>{const e=u();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(f.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of f)t()})),f.push(e)):e()},g=(t,e=[],i=t)=>"function"==typeof t?t(...e):i,_=(t,e,n=!0)=>{if(!n)return void g(t);const o=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let r=!1;const a=({target:n})=>{n===e&&(r=!0,e.removeEventListener(i,a),g(t))};e.addEventListener(i,a),setTimeout((()=>{r||s(e)}),o)},b=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},v=/[^.]*(?=\..*)\.|.*/,y=/\..*/,w=/::\d+$/,A={};let E=1;const T={mouseenter:"mouseover",mouseleave:"mouseout"},C=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function O(t,e){return e&&`${e}::${E++}`||t.uidEvent||E++}function x(t){const e=O(t);return t.uidEvent=e,A[e]=A[e]||{},A[e]}function k(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function L(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=I(t);return C.has(o)||(o=t),[n,s,o]}function S(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=L(e,i,n);if(e in T){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=x(t),c=l[a]||(l[a]={}),h=k(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=O(r,e.replace(v,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return P(s,{delegateTarget:r}),n.oneOff&&N.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return P(n,{delegateTarget:t}),i.oneOff&&N.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function D(t,e,i,n,s){const o=k(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function $(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&D(t,e,i,r.callable,r.delegationSelector)}function I(t){return t=t.replace(y,""),T[t]||t}const N={on(t,e,i,n){S(t,e,i,n,!1)},one(t,e,i,n){S(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=L(e,i,n),a=r!==e,l=x(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))$(t,l,i,e.slice(1));for(const[i,n]of Object.entries(c)){const s=i.replace(w,"");a&&!e.includes(s)||D(t,l,r,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;D(t,l,r,o,s?i:null)}},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=u();let s=null,o=!0,r=!0,a=!1;e!==I(e)&&n&&(s=n.Event(e,i),n(t).trigger(s),o=!s.isPropagationStopped(),r=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());const l=P(new Event(e,{bubbles:o,cancelable:!0}),i);return a&&l.preventDefault(),r&&t.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function P(t,e={}){for(const[i,n]of Object.entries(e))try{t[i]=n}catch(e){Object.defineProperty(t,i,{configurable:!0,get:()=>n})}return t}function M(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function j(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const F={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${j(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${j(e)}`)},getDataAttributes(t){if(!t)return{};const e={},i=Object.keys(t.dataset).filter((t=>t.startsWith("bs")&&!t.startsWith("bsConfig")));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1,i.length),e[i]=M(t.dataset[n])}return e},getDataAttribute:(t,e)=>M(t.getAttribute(`data-bs-${j(e)}`))};class H{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const i=o(e)?F.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...o(e)?F.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[n,s]of Object.entries(e)){const e=t[n],r=o(e)?"element":null==(i=e)?`${i}`:Object.prototype.toString.call(i).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(s).test(r))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${r}" but expected type "${s}".`)}var i}}class W extends H{constructor(t,i){super(),(t=r(t))&&(this._element=t,this._config=this._getConfig(i),e.set(this._element,this.constructor.DATA_KEY,this))}dispose(){e.remove(this._element,this.constructor.DATA_KEY),N.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){_(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return e.get(r(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.1"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const B=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return n(e)},z={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const i=[];let n=t.parentNode.closest(e);for(;n;)i.push(n),n=n.parentNode.closest(e);return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(",");return this.find(e,t).filter((t=>!l(t)&&a(t)))},getSelectorFromElement(t){const e=B(t);return e&&z.findOne(e)?e:null},getElementFromSelector(t){const e=B(t);return e?z.findOne(e):null},getMultipleElementsFromSelector(t){const e=B(t);return e?z.find(e):[]}},R=(t,e="hide")=>{const i=`click.dismiss${t.EVENT_KEY}`,n=t.NAME;N.on(document,i,`[data-bs-dismiss="${n}"]`,(function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),l(this))return;const s=z.getElementFromSelector(this)||this.closest(`.${n}`);t.getOrCreateInstance(s)[e]()}))},q=".bs.alert",V=`close${q}`,K=`closed${q}`;class Q extends W{static get NAME(){return"alert"}close(){if(N.trigger(this._element,V).defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,t)}_destroyElement(){this._element.remove(),N.trigger(this._element,K),this.dispose()}static jQueryInterface(t){return this.each((function(){const e=Q.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}R(Q,"close"),m(Q);const X='[data-bs-toggle="button"]';class Y extends W{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each((function(){const e=Y.getOrCreateInstance(this);"toggle"===t&&e[t]()}))}}N.on(document,"click.bs.button.data-api",X,(t=>{t.preventDefault();const e=t.target.closest(X);Y.getOrCreateInstance(e).toggle()})),m(Y);const U=".bs.swipe",G=`touchstart${U}`,J=`touchmove${U}`,Z=`touchend${U}`,tt=`pointerdown${U}`,et=`pointerup${U}`,it={endCallback:null,leftCallback:null,rightCallback:null},nt={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class st extends H{constructor(t,e){super(),this._element=t,t&&st.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return it}static get DefaultType(){return nt}static get NAME(){return"swipe"}dispose(){N.off(this._element,U)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),g(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&g(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(N.on(this._element,tt,(t=>this._start(t))),N.on(this._element,et,(t=>this._end(t))),this._element.classList.add("pointer-event")):(N.on(this._element,G,(t=>this._start(t))),N.on(this._element,J,(t=>this._move(t))),N.on(this._element,Z,(t=>this._end(t))))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const ot=".bs.carousel",rt=".data-api",at="next",lt="prev",ct="left",ht="right",dt=`slide${ot}`,ut=`slid${ot}`,ft=`keydown${ot}`,pt=`mouseenter${ot}`,mt=`mouseleave${ot}`,gt=`dragstart${ot}`,_t=`load${ot}${rt}`,bt=`click${ot}${rt}`,vt="carousel",yt="active",wt=".active",At=".carousel-item",Et=wt+At,Tt={ArrowLeft:ht,ArrowRight:ct},Ct={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Ot={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class xt extends W{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=z.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===vt&&this.cycle()}static get Default(){return Ct}static get DefaultType(){return Ot}static get NAME(){return"carousel"}next(){this._slide(at)}nextWhenVisible(){!document.hidden&&a(this._element)&&this.next()}prev(){this._slide(lt)}pause(){this._isSliding&&s(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?N.one(this._element,ut,(()=>this.cycle())):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void N.one(this._element,ut,(()=>this.to(t)));const i=this._getItemIndex(this._getActive());if(i===t)return;const n=t>i?at:lt;this._slide(n,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&N.on(this._element,ft,(t=>this._keydown(t))),"hover"===this._config.pause&&(N.on(this._element,pt,(()=>this.pause())),N.on(this._element,mt,(()=>this._maybeEnableCycle()))),this._config.touch&&st.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of z.find(".carousel-item img",this._element))N.on(t,gt,(t=>t.preventDefault()));const t={leftCallback:()=>this._slide(this._directionToOrder(ct)),rightCallback:()=>this._slide(this._directionToOrder(ht)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval))}};this._swipeHelper=new st(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=Tt[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=z.findOne(wt,this._indicatorsElement);e.classList.remove(yt),e.removeAttribute("aria-current");const i=z.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);i&&(i.classList.add(yt),i.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const i=this._getActive(),n=t===at,s=e||b(this._getItems(),i,n,this._config.wrap);if(s===i)return;const o=this._getItemIndex(s),r=e=>N.trigger(this._element,e,{relatedTarget:s,direction:this._orderToDirection(t),from:this._getItemIndex(i),to:o});if(r(dt).defaultPrevented)return;if(!i||!s)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=s;const l=n?"carousel-item-start":"carousel-item-end",c=n?"carousel-item-next":"carousel-item-prev";s.classList.add(c),d(s),i.classList.add(l),s.classList.add(l),this._queueCallback((()=>{s.classList.remove(l,c),s.classList.add(yt),i.classList.remove(yt,c,l),this._isSliding=!1,r(ut)}),i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return z.findOne(Et,this._element)}_getItems(){return z.find(At,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return p()?t===ct?lt:at:t===ct?at:lt}_orderToDirection(t){return p()?t===lt?ct:ht:t===lt?ht:ct}static jQueryInterface(t){return this.each((function(){const e=xt.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)}))}}N.on(document,bt,"[data-bs-slide], [data-bs-slide-to]",(function(t){const e=z.getElementFromSelector(this);if(!e||!e.classList.contains(vt))return;t.preventDefault();const i=xt.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===F.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())})),N.on(window,_t,(()=>{const t=z.find('[data-bs-ride="carousel"]');for(const e of t)xt.getOrCreateInstance(e)})),m(xt);const kt=".bs.collapse",Lt=`show${kt}`,St=`shown${kt}`,Dt=`hide${kt}`,$t=`hidden${kt}`,It=`click${kt}.data-api`,Nt="show",Pt="collapse",Mt="collapsing",jt=`:scope .${Pt} .${Pt}`,Ft='[data-bs-toggle="collapse"]',Ht={parent:null,toggle:!0},Wt={parent:"(null|element)",toggle:"boolean"};class Bt extends W{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const i=z.find(Ft);for(const t of i){const e=z.getSelectorFromElement(t),i=z.find(e).filter((t=>t===this._element));null!==e&&i.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Ht}static get DefaultType(){return Wt}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((t=>t!==this._element)).map((t=>Bt.getOrCreateInstance(t,{toggle:!1})))),t.length&&t[0]._isTransitioning)return;if(N.trigger(this._element,Lt).defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(Pt),this._element.classList.add(Mt),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(Mt),this._element.classList.add(Pt,Nt),this._element.style[e]="",N.trigger(this._element,St)}),this._element,!0),this._element.style[e]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(N.trigger(this._element,Dt).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,d(this._element),this._element.classList.add(Mt),this._element.classList.remove(Pt,Nt);for(const t of this._triggerArray){const e=z.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0,this._element.style[t]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(Mt),this._element.classList.add(Pt),N.trigger(this._element,$t)}),this._element,!0)}_isShown(t=this._element){return t.classList.contains(Nt)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=r(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(Ft);for(const e of t){const t=z.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=z.find(jt,this._config.parent);return z.find(t,this._config.parent).filter((t=>!e.includes(t)))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const i of t)i.classList.toggle("collapsed",!e),i.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each((function(){const i=Bt.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}}))}}N.on(document,It,Ft,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of z.getMultipleElementsFromSelector(this))Bt.getOrCreateInstance(t,{toggle:!1}).toggle()})),m(Bt);var zt="top",Rt="bottom",qt="right",Vt="left",Kt="auto",Qt=[zt,Rt,qt,Vt],Xt="start",Yt="end",Ut="clippingParents",Gt="viewport",Jt="popper",Zt="reference",te=Qt.reduce((function(t,e){return t.concat([e+"-"+Xt,e+"-"+Yt])}),[]),ee=[].concat(Qt,[Kt]).reduce((function(t,e){return t.concat([e,e+"-"+Xt,e+"-"+Yt])}),[]),ie="beforeRead",ne="read",se="afterRead",oe="beforeMain",re="main",ae="afterMain",le="beforeWrite",ce="write",he="afterWrite",de=[ie,ne,se,oe,re,ae,le,ce,he];function ue(t){return t?(t.nodeName||"").toLowerCase():null}function fe(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function pe(t){return t instanceof fe(t).Element||t instanceof Element}function me(t){return t instanceof fe(t).HTMLElement||t instanceof HTMLElement}function ge(t){return"undefined"!=typeof ShadowRoot&&(t instanceof fe(t).ShadowRoot||t instanceof ShadowRoot)}const _e={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];me(s)&&ue(s)&&(Object.assign(s.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});me(n)&&ue(n)&&(Object.assign(n.style,o),Object.keys(s).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};function be(t){return t.split("-")[0]}var ve=Math.max,ye=Math.min,we=Math.round;function Ae(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function Ee(){return!/^((?!chrome|android).)*safari/i.test(Ae())}function Te(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),s=1,o=1;e&&me(t)&&(s=t.offsetWidth>0&&we(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&we(n.height)/t.offsetHeight||1);var r=(pe(t)?fe(t):window).visualViewport,a=!Ee()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function Ce(t){var e=Te(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Oe(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&ge(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function xe(t){return fe(t).getComputedStyle(t)}function ke(t){return["table","td","th"].indexOf(ue(t))>=0}function Le(t){return((pe(t)?t.ownerDocument:t.document)||window.document).documentElement}function Se(t){return"html"===ue(t)?t:t.assignedSlot||t.parentNode||(ge(t)?t.host:null)||Le(t)}function De(t){return me(t)&&"fixed"!==xe(t).position?t.offsetParent:null}function $e(t){for(var e=fe(t),i=De(t);i&&ke(i)&&"static"===xe(i).position;)i=De(i);return i&&("html"===ue(i)||"body"===ue(i)&&"static"===xe(i).position)?e:i||function(t){var e=/firefox/i.test(Ae());if(/Trident/i.test(Ae())&&me(t)&&"fixed"===xe(t).position)return null;var i=Se(t);for(ge(i)&&(i=i.host);me(i)&&["html","body"].indexOf(ue(i))<0;){var n=xe(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function Ie(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ne(t,e,i){return ve(t,ye(e,i))}function Pe(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Me(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}const je={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=be(i.placement),l=Ie(a),c=[Vt,qt].indexOf(a)>=0?"height":"width";if(o&&r){var h=function(t,e){return Pe("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Me(t,Qt))}(s.padding,i),d=Ce(o),u="y"===l?zt:Vt,f="y"===l?Rt:qt,p=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],m=r[l]-i.rects.reference[l],g=$e(o),_=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=p/2-m/2,v=h[u],y=_-d[c]-h[f],w=_/2-d[c]/2+b,A=Ne(v,w,y),E=l;i.modifiersData[n]=((e={})[E]=A,e.centerOffset=A-w,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Oe(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Fe(t){return t.split("-")[1]}var He={top:"auto",right:"auto",bottom:"auto",left:"auto"};function We(t){var e,i=t.popper,n=t.popperRect,s=t.placement,o=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,u=r.x,f=void 0===u?0:u,p=r.y,m=void 0===p?0:p,g="function"==typeof h?h({x:f,y:m}):{x:f,y:m};f=g.x,m=g.y;var _=r.hasOwnProperty("x"),b=r.hasOwnProperty("y"),v=Vt,y=zt,w=window;if(c){var A=$e(i),E="clientHeight",T="clientWidth";A===fe(i)&&"static"!==xe(A=Le(i)).position&&"absolute"===a&&(E="scrollHeight",T="scrollWidth"),(s===zt||(s===Vt||s===qt)&&o===Yt)&&(y=Rt,m-=(d&&A===w&&w.visualViewport?w.visualViewport.height:A[E])-n.height,m*=l?1:-1),s!==Vt&&(s!==zt&&s!==Rt||o!==Yt)||(v=qt,f-=(d&&A===w&&w.visualViewport?w.visualViewport.width:A[T])-n.width,f*=l?1:-1)}var C,O=Object.assign({position:a},c&&He),x=!0===h?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:we(i*s)/s||0,y:we(n*s)/s||0}}({x:f,y:m},fe(i)):{x:f,y:m};return f=x.x,m=x.y,l?Object.assign({},O,((C={})[y]=b?"0":"",C[v]=_?"0":"",C.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",C)):Object.assign({},O,((e={})[y]=b?m+"px":"",e[v]=_?f+"px":"",e.transform="",e))}const Be={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:be(e.placement),variation:Fe(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,We(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,We(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var ze={passive:!0};const Re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=fe(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",i.update,ze)})),a&&l.addEventListener("resize",i.update,ze),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",i.update,ze)})),a&&l.removeEventListener("resize",i.update,ze)}},data:{}};var qe={left:"right",right:"left",bottom:"top",top:"bottom"};function Ve(t){return t.replace(/left|right|bottom|top/g,(function(t){return qe[t]}))}var Ke={start:"end",end:"start"};function Qe(t){return t.replace(/start|end/g,(function(t){return Ke[t]}))}function Xe(t){var e=fe(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ye(t){return Te(Le(t)).left+Xe(t).scrollLeft}function Ue(t){var e=xe(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Ge(t){return["html","body","#document"].indexOf(ue(t))>=0?t.ownerDocument.body:me(t)&&Ue(t)?t:Ge(Se(t))}function Je(t,e){var i;void 0===e&&(e=[]);var n=Ge(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=fe(n),r=s?[o].concat(o.visualViewport||[],Ue(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(Je(Se(r)))}function Ze(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ti(t,e,i){return e===Gt?Ze(function(t,e){var i=fe(t),n=Le(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=Ee();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+Ye(t),y:l}}(t,i)):pe(e)?function(t,e){var i=Te(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):Ze(function(t){var e,i=Le(t),n=Xe(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=ve(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=ve(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Ye(t),l=-n.scrollTop;return"rtl"===xe(s||i).direction&&(a+=ve(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(Le(t)))}function ei(t){var e,i=t.reference,n=t.element,s=t.placement,o=s?be(s):null,r=s?Fe(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case zt:e={x:a,y:i.y-n.height};break;case Rt:e={x:a,y:i.y+i.height};break;case qt:e={x:i.x+i.width,y:l};break;case Vt:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?Ie(o):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case Xt:e[c]=e[c]-(i[h]/2-n[h]/2);break;case Yt:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}function ii(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=void 0===n?t.placement:n,o=i.strategy,r=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?Ut:a,c=i.rootBoundary,h=void 0===c?Gt:c,d=i.elementContext,u=void 0===d?Jt:d,f=i.altBoundary,p=void 0!==f&&f,m=i.padding,g=void 0===m?0:m,_=Pe("number"!=typeof g?g:Me(g,Qt)),b=u===Jt?Zt:Jt,v=t.rects.popper,y=t.elements[p?b:u],w=function(t,e,i,n){var s="clippingParents"===e?function(t){var e=Je(Se(t)),i=["absolute","fixed"].indexOf(xe(t).position)>=0&&me(t)?$e(t):t;return pe(i)?e.filter((function(t){return pe(t)&&Oe(t,i)&&"body"!==ue(t)})):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce((function(e,i){var s=ti(t,i,n);return e.top=ve(s.top,e.top),e.right=ye(s.right,e.right),e.bottom=ye(s.bottom,e.bottom),e.left=ve(s.left,e.left),e}),ti(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(pe(y)?y:y.contextElement||Le(t.elements.popper),l,h,r),A=Te(t.elements.reference),E=ei({reference:A,element:v,strategy:"absolute",placement:s}),T=Ze(Object.assign({},v,E)),C=u===Jt?T:A,O={top:w.top-C.top+_.top,bottom:C.bottom-w.bottom+_.bottom,left:w.left-C.left+_.left,right:C.right-w.right+_.right},x=t.modifiersData.offset;if(u===Jt&&x){var k=x[s];Object.keys(O).forEach((function(t){var e=[qt,Rt].indexOf(t)>=0?1:-1,i=[zt,Rt].indexOf(t)>=0?"y":"x";O[t]+=k[i]*e}))}return O}function ni(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?ee:l,h=Fe(n),d=h?a?te:te.filter((function(t){return Fe(t)===h})):Qt,u=d.filter((function(t){return c.indexOf(t)>=0}));0===u.length&&(u=d);var f=u.reduce((function(e,i){return e[i]=ii(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[be(i)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}const si={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,u=i.altBoundary,f=i.flipVariations,p=void 0===f||f,m=i.allowedAutoPlacements,g=e.options.placement,_=be(g),b=l||(_!==g&&p?function(t){if(be(t)===Kt)return[];var e=Ve(t);return[Qe(t),e,Qe(e)]}(g):[Ve(g)]),v=[g].concat(b).reduce((function(t,i){return t.concat(be(i)===Kt?ni(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):i)}),[]),y=e.rects.reference,w=e.rects.popper,A=new Map,E=!0,T=v[0],C=0;C=0,S=L?"width":"height",D=ii(e,{placement:O,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),$=L?k?qt:Vt:k?Rt:zt;y[S]>w[S]&&($=Ve($));var I=Ve($),N=[];if(o&&N.push(D[x]<=0),a&&N.push(D[$]<=0,D[I]<=0),N.every((function(t){return t}))){T=O,E=!1;break}A.set(O,N)}if(E)for(var P=function(t){var e=v.find((function(e){var i=A.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return T=e,"break"},M=p?3:1;M>0&&"break"!==P(M);M--);e.placement!==T&&(e.modifiersData[n]._skip=!0,e.placement=T,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function oi(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function ri(t){return[zt,qt,Rt,Vt].some((function(e){return t[e]>=0}))}const ai={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=ii(e,{elementContext:"reference"}),a=ii(e,{altBoundary:!0}),l=oi(r,n),c=oi(a,s,o),h=ri(l),d=ri(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}},li={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.offset,o=void 0===s?[0,0]:s,r=ee.reduce((function(t,i){return t[i]=function(t,e,i){var n=be(t),s=[Vt,zt].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[Vt,qt].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}(i,e.rects,o),t}),{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}},ci={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=ei({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},hi={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,u=i.tether,f=void 0===u||u,p=i.tetherOffset,m=void 0===p?0:p,g=ii(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),_=be(e.placement),b=Fe(e.placement),v=!b,y=Ie(_),w="x"===y?"y":"x",A=e.modifiersData.popperOffsets,E=e.rects.reference,T=e.rects.popper,C="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,O="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),x=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,k={x:0,y:0};if(A){if(o){var L,S="y"===y?zt:Vt,D="y"===y?Rt:qt,$="y"===y?"height":"width",I=A[y],N=I+g[S],P=I-g[D],M=f?-T[$]/2:0,j=b===Xt?E[$]:T[$],F=b===Xt?-T[$]:-E[$],H=e.elements.arrow,W=f&&H?Ce(H):{width:0,height:0},B=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},z=B[S],R=B[D],q=Ne(0,E[$],W[$]),V=v?E[$]/2-M-q-z-O.mainAxis:j-q-z-O.mainAxis,K=v?-E[$]/2+M+q+R+O.mainAxis:F+q+R+O.mainAxis,Q=e.elements.arrow&&$e(e.elements.arrow),X=Q?"y"===y?Q.clientTop||0:Q.clientLeft||0:0,Y=null!=(L=null==x?void 0:x[y])?L:0,U=I+K-Y,G=Ne(f?ye(N,I+V-Y-X):N,I,f?ve(P,U):P);A[y]=G,k[y]=G-I}if(a){var J,Z="x"===y?zt:Vt,tt="x"===y?Rt:qt,et=A[w],it="y"===w?"height":"width",nt=et+g[Z],st=et-g[tt],ot=-1!==[zt,Vt].indexOf(_),rt=null!=(J=null==x?void 0:x[w])?J:0,at=ot?nt:et-E[it]-T[it]-rt+O.altAxis,lt=ot?et+E[it]+T[it]-rt-O.altAxis:st,ct=f&&ot?function(t,e,i){var n=Ne(t,e,i);return n>i?i:n}(at,et,lt):Ne(f?at:nt,et,f?lt:st);A[w]=ct,k[w]=ct-et}e.modifiersData[n]=k}},requiresIfExists:["offset"]};function di(t,e,i){void 0===i&&(i=!1);var n,s,o=me(e),r=me(e)&&function(t){var e=t.getBoundingClientRect(),i=we(e.width)/t.offsetWidth||1,n=we(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=Le(e),l=Te(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==ue(e)||Ue(a))&&(c=(n=e)!==fe(n)&&me(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:Xe(n)),me(e)?((h=Te(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=Ye(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function ui(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||s(t)})),n}var fi={placement:"bottom",modifiers:[],strategy:"absolute"};function pi(){for(var t=arguments.length,e=new Array(t),i=0;iNumber.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(F.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...g(this._config.popperConfig,[t])}}_selectMenuItem({key:t,target:e}){const i=z.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((t=>a(t)));i.length&&b(i,e,t===Ti,!i.includes(e)).focus()}static jQueryInterface(t){return this.each((function(){const e=qi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=z.find(Ni);for(const i of e){const e=qi.getInstance(i);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),s=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!s||"outside"===e._config.autoClose&&s)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const o={relatedTarget:e._element};"click"===t.type&&(o.clickEvent=t),e._completeHide(o)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),i="Escape"===t.key,n=[Ei,Ti].includes(t.key);if(!n&&!i)return;if(e&&!i)return;t.preventDefault();const s=this.matches(Ii)?this:z.prev(this,Ii)[0]||z.next(this,Ii)[0]||z.findOne(Ii,t.delegateTarget.parentNode),o=qi.getOrCreateInstance(s);if(n)return t.stopPropagation(),o.show(),void o._selectMenuItem(t);o._isShown()&&(t.stopPropagation(),o.hide(),s.focus())}}N.on(document,Si,Ii,qi.dataApiKeydownHandler),N.on(document,Si,Pi,qi.dataApiKeydownHandler),N.on(document,Li,qi.clearMenus),N.on(document,Di,qi.clearMenus),N.on(document,Li,Ii,(function(t){t.preventDefault(),qi.getOrCreateInstance(this).toggle()})),m(qi);const Vi="backdrop",Ki="show",Qi=`mousedown.bs.${Vi}`,Xi={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Yi={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Ui extends H{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return Xi}static get DefaultType(){return Yi}static get NAME(){return Vi}show(t){if(!this._config.isVisible)return void g(t);this._append();const e=this._getElement();this._config.isAnimated&&d(e),e.classList.add(Ki),this._emulateAnimation((()=>{g(t)}))}hide(t){this._config.isVisible?(this._getElement().classList.remove(Ki),this._emulateAnimation((()=>{this.dispose(),g(t)}))):g(t)}dispose(){this._isAppended&&(N.off(this._element,Qi),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=r(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),N.on(t,Qi,(()=>{g(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(t){_(t,this._getElement(),this._config.isAnimated)}}const Gi=".bs.focustrap",Ji=`focusin${Gi}`,Zi=`keydown.tab${Gi}`,tn="backward",en={autofocus:!0,trapElement:null},nn={autofocus:"boolean",trapElement:"element"};class sn extends H{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return en}static get DefaultType(){return nn}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),N.off(document,Gi),N.on(document,Ji,(t=>this._handleFocusin(t))),N.on(document,Zi,(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,N.off(document,Gi))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const i=z.focusableChildren(e);0===i.length?e.focus():this._lastTabNavDirection===tn?i[i.length-1].focus():i[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?tn:"forward")}}const on=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",rn=".sticky-top",an="padding-right",ln="margin-right";class cn{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,an,(e=>e+t)),this._setElementAttributes(on,an,(e=>e+t)),this._setElementAttributes(rn,ln,(e=>e-t))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,an),this._resetElementAttributes(on,an),this._resetElementAttributes(rn,ln)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const n=this.getWidth();this._applyManipulationCallback(t,(t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const s=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${i(Number.parseFloat(s))}px`)}))}_saveInitialAttribute(t,e){const i=t.style.getPropertyValue(e);i&&F.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,(t=>{const i=F.getDataAttribute(t,e);null!==i?(F.removeDataAttribute(t,e),t.style.setProperty(e,i)):t.style.removeProperty(e)}))}_applyManipulationCallback(t,e){if(o(t))e(t);else for(const i of z.find(t,this._element))e(i)}}const hn=".bs.modal",dn=`hide${hn}`,un=`hidePrevented${hn}`,fn=`hidden${hn}`,pn=`show${hn}`,mn=`shown${hn}`,gn=`resize${hn}`,_n=`click.dismiss${hn}`,bn=`mousedown.dismiss${hn}`,vn=`keydown.dismiss${hn}`,yn=`click${hn}.data-api`,wn="modal-open",An="show",En="modal-static",Tn={backdrop:!0,focus:!0,keyboard:!0},Cn={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class On extends W{constructor(t,e){super(t,e),this._dialog=z.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new cn,this._addEventListeners()}static get Default(){return Tn}static get DefaultType(){return Cn}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||N.trigger(this._element,pn,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(wn),this._adjustDialog(),this._backdrop.show((()=>this._showElement(t))))}hide(){this._isShown&&!this._isTransitioning&&(N.trigger(this._element,dn).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(An),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated())))}dispose(){N.off(window,hn),N.off(this._dialog,hn),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Ui({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new sn({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=z.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),d(this._element),this._element.classList.add(An),this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,N.trigger(this._element,mn,{relatedTarget:t})}),this._dialog,this._isAnimated())}_addEventListeners(){N.on(this._element,vn,(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),N.on(window,gn,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),N.on(this._element,bn,(t=>{N.one(this._element,_n,(e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(wn),this._resetAdjustments(),this._scrollBar.reset(),N.trigger(this._element,fn)}))}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(N.trigger(this._element,un).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(En)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(En),this._queueCallback((()=>{this._element.classList.remove(En),this._queueCallback((()=>{this._element.style.overflowY=e}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;if(i&&!t){const t=p()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!i&&t){const t=p()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const i=On.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}}))}}N.on(document,yn,'[data-bs-toggle="modal"]',(function(t){const e=z.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),N.one(e,pn,(t=>{t.defaultPrevented||N.one(e,fn,(()=>{a(this)&&this.focus()}))}));const i=z.findOne(".modal.show");i&&On.getInstance(i).hide(),On.getOrCreateInstance(e).toggle(this)})),R(On),m(On);const xn=".bs.offcanvas",kn=".data-api",Ln=`load${xn}${kn}`,Sn="show",Dn="showing",$n="hiding",In=".offcanvas.show",Nn=`show${xn}`,Pn=`shown${xn}`,Mn=`hide${xn}`,jn=`hidePrevented${xn}`,Fn=`hidden${xn}`,Hn=`resize${xn}`,Wn=`click${xn}${kn}`,Bn=`keydown.dismiss${xn}`,zn={backdrop:!0,keyboard:!0,scroll:!1},Rn={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class qn extends W{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return zn}static get DefaultType(){return Rn}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||N.trigger(this._element,Nn,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new cn).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Dn),this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Sn),this._element.classList.remove(Dn),N.trigger(this._element,Pn,{relatedTarget:t})}),this._element,!0))}hide(){this._isShown&&(N.trigger(this._element,Mn).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add($n),this._backdrop.hide(),this._queueCallback((()=>{this._element.classList.remove(Sn,$n),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new cn).reset(),N.trigger(this._element,Fn)}),this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new Ui({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():N.trigger(this._element,jn)}:null})}_initializeFocusTrap(){return new sn({trapElement:this._element})}_addEventListeners(){N.on(this._element,Bn,(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():N.trigger(this._element,jn))}))}static jQueryInterface(t){return this.each((function(){const e=qn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}N.on(document,Wn,'[data-bs-toggle="offcanvas"]',(function(t){const e=z.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),l(this))return;N.one(e,Fn,(()=>{a(this)&&this.focus()}));const i=z.findOne(In);i&&i!==e&&qn.getInstance(i).hide(),qn.getOrCreateInstance(e).toggle(this)})),N.on(window,Ln,(()=>{for(const t of z.find(In))qn.getOrCreateInstance(t).show()})),N.on(window,Hn,(()=>{for(const t of z.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&qn.getOrCreateInstance(t).hide()})),R(qn),m(qn);const Vn={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Kn=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Qn=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Xn=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!Kn.has(i)||Boolean(Qn.test(t.nodeValue)):e.filter((t=>t instanceof RegExp)).some((t=>t.test(i)))},Yn={allowList:Vn,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},Un={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Gn={entry:"(string|element|function|null)",selector:"(string|element)"};class Jn extends H{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return Yn}static get DefaultType(){return Un}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,i]of Object.entries(this._config.content))this._setContent(t,i,e);const e=t.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&e.classList.add(...i.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,i]of Object.entries(t))super._typeCheckConfig({selector:e,entry:i},Gn)}_setContent(t,e,i){const n=z.findOne(i,t);n&&((e=this._resolvePossibleFunction(e))?o(e)?this._putElementInTemplate(r(e),n):this._config.html?n.innerHTML=this._maybeSanitize(e):n.textContent=e:n.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,i){if(!t.length)return t;if(i&&"function"==typeof i)return i(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),s=[].concat(...n.body.querySelectorAll("*"));for(const t of s){const i=t.nodeName.toLowerCase();if(!Object.keys(e).includes(i)){t.remove();continue}const n=[].concat(...t.attributes),s=[].concat(e["*"]||[],e[i]||[]);for(const e of n)Xn(e,s)||t.removeAttribute(e.nodeName)}return n.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return g(t,[this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const Zn=new Set(["sanitize","allowList","sanitizeFn"]),ts="fade",es="show",is=".modal",ns="hide.bs.modal",ss="hover",os="focus",rs={AUTO:"auto",TOP:"top",RIGHT:p()?"left":"right",BOTTOM:"bottom",LEFT:p()?"right":"left"},as={allowList:Vn,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},ls={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class cs extends W{constructor(t,e){if(void 0===vi)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return as}static get DefaultType(){return ls}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),N.off(this._element.closest(is),ns,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=N.trigger(this._element,this.constructor.eventName("show")),e=(c(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),N.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(es),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))N.on(t,"mouseover",h);this._queueCallback((()=>{N.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1}),this.tip,this._isAnimated())}hide(){if(this._isShown()&&!N.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(es),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))N.off(t,"mouseover",h);this._activeTrigger.click=!1,this._activeTrigger[os]=!1,this._activeTrigger[ss]=!1,this._isHovered=null,this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),N.trigger(this._element,this.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(ts,es),e.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",i),this._isAnimated()&&e.classList.add(ts),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new Jn({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(ts)}_isShown(){return this.tip&&this.tip.classList.contains(es)}_createPopper(t){const e=g(this._config.placement,[this,t,this._element]),i=rs[e.toUpperCase()];return bi(this._element,t,this._getPopperConfig(i))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return g(t,[this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...g(this._config.popperConfig,[e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)N.on(this._element,this.constructor.eventName("click"),this._config.selector,(t=>{this._initializeOnDelegatedTarget(t).toggle()}));else if("manual"!==e){const t=e===ss?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=e===ss?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");N.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?os:ss]=!0,e._enter()})),N.on(this._element,i,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?os:ss]=e._element.contains(t.relatedTarget),e._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},N.on(this._element.closest(is),ns,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=F.getDataAttributes(this._element);for(const t of Object.keys(e))Zn.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:r(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,i]of Object.entries(this._config))this.constructor.Default[e]!==i&&(t[e]=i);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each((function(){const e=cs.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}m(cs);const hs={...cs.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},ds={...cs.DefaultType,content:"(null|string|element|function)"};class us extends cs{static get Default(){return hs}static get DefaultType(){return ds}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each((function(){const e=us.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}m(us);const fs=".bs.scrollspy",ps=`activate${fs}`,ms=`click${fs}`,gs=`load${fs}.data-api`,_s="active",bs="[href]",vs=".nav-link",ys=`${vs}, .nav-item > ${vs}, .list-group-item`,ws={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},As={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Es extends W{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return ws}static get DefaultType(){return As}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=r(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map((t=>Number.parseFloat(t)))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(N.off(this._config.target,ms),N.on(this._config.target,ms,bs,(t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const i=this._rootElement||window,n=e.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}})))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((t=>this._observerCallback(t)),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),i=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,s=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const o of t){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(o));continue}const t=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&t){if(i(o),!n)return}else s||t||i(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=z.find(bs,this._config.target);for(const e of t){if(!e.hash||l(e))continue;const t=z.findOne(decodeURI(e.hash),this._element);a(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(_s),this._activateParents(t),N.trigger(this._element,ps,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))z.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(_s);else for(const e of z.parents(t,".nav, .list-group"))for(const t of z.prev(e,ys))t.classList.add(_s)}_clearActiveClass(t){t.classList.remove(_s);const e=z.find(`${bs}.${_s}`,t);for(const t of e)t.classList.remove(_s)}static jQueryInterface(t){return this.each((function(){const e=Es.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}N.on(window,gs,(()=>{for(const t of z.find('[data-bs-spy="scroll"]'))Es.getOrCreateInstance(t)})),m(Es);const Ts=".bs.tab",Cs=`hide${Ts}`,Os=`hidden${Ts}`,xs=`show${Ts}`,ks=`shown${Ts}`,Ls=`click${Ts}`,Ss=`keydown${Ts}`,Ds=`load${Ts}`,$s="ArrowLeft",Is="ArrowRight",Ns="ArrowUp",Ps="ArrowDown",Ms="Home",js="End",Fs="active",Hs="fade",Ws="show",Bs=":not(.dropdown-toggle)",zs='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Rs=`.nav-link${Bs}, .list-group-item${Bs}, [role="tab"]${Bs}, ${zs}`,qs=`.${Fs}[data-bs-toggle="tab"], .${Fs}[data-bs-toggle="pill"], .${Fs}[data-bs-toggle="list"]`;class Vs extends W{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),N.on(this._element,Ss,(t=>this._keydown(t))))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),i=e?N.trigger(e,Cs,{relatedTarget:t}):null;N.trigger(t,xs,{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){t&&(t.classList.add(Fs),this._activate(z.getElementFromSelector(t)),this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),N.trigger(t,ks,{relatedTarget:e})):t.classList.add(Ws)}),t,t.classList.contains(Hs)))}_deactivate(t,e){t&&(t.classList.remove(Fs),t.blur(),this._deactivate(z.getElementFromSelector(t)),this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),N.trigger(t,Os,{relatedTarget:e})):t.classList.remove(Ws)}),t,t.classList.contains(Hs)))}_keydown(t){if(![$s,Is,Ns,Ps,Ms,js].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter((t=>!l(t)));let i;if([Ms,js].includes(t.key))i=e[t.key===Ms?0:e.length-1];else{const n=[Is,Ps].includes(t.key);i=b(e,t.target,n,!0)}i&&(i.focus({preventScroll:!0}),Vs.getOrCreateInstance(i).show())}_getChildren(){return z.find(Rs,this._parent)}_getActiveElem(){return this._getChildren().find((t=>this._elemIsActive(t)))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=z.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const i=this._getOuterElement(t);if(!i.classList.contains("dropdown"))return;const n=(t,n)=>{const s=z.findOne(t,i);s&&s.classList.toggle(n,e)};n(".dropdown-toggle",Fs),n(".dropdown-menu",Ws),i.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(Fs)}_getInnerElement(t){return t.matches(Rs)?t:z.findOne(Rs,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(t){return this.each((function(){const e=Vs.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}N.on(document,Ls,zs,(function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),l(this)||Vs.getOrCreateInstance(this).show()})),N.on(window,Ds,(()=>{for(const t of z.find(qs))Vs.getOrCreateInstance(t)})),m(Vs);const Ks=".bs.toast",Qs=`mouseover${Ks}`,Xs=`mouseout${Ks}`,Ys=`focusin${Ks}`,Us=`focusout${Ks}`,Gs=`hide${Ks}`,Js=`hidden${Ks}`,Zs=`show${Ks}`,to=`shown${Ks}`,eo="hide",io="show",no="showing",so={animation:"boolean",autohide:"boolean",delay:"number"},oo={animation:!0,autohide:!0,delay:5e3};class ro extends W{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return oo}static get DefaultType(){return so}static get NAME(){return"toast"}show(){N.trigger(this._element,Zs).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(eo),d(this._element),this._element.classList.add(io,no),this._queueCallback((()=>{this._element.classList.remove(no),N.trigger(this._element,to),this._maybeScheduleHide()}),this._element,this._config.animation))}hide(){this.isShown()&&(N.trigger(this._element,Gs).defaultPrevented||(this._element.classList.add(no),this._queueCallback((()=>{this._element.classList.add(eo),this._element.classList.remove(no,io),N.trigger(this._element,Js)}),this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(io),super.dispose()}isShown(){return this._element.classList.contains(io)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const i=t.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){N.on(this._element,Qs,(t=>this._onInteraction(t,!0))),N.on(this._element,Xs,(t=>this._onInteraction(t,!1))),N.on(this._element,Ys,(t=>this._onInteraction(t,!0))),N.on(this._element,Us,(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=ro.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}return R(ro),m(ro),{Alert:Q,Button:Y,Carousel:xt,Collapse:Bt,Dropdown:qi,Modal:On,Offcanvas:qn,Popover:us,ScrollSpy:Es,Tab:Vs,Toast:ro,Tooltip:cs}})); +//# sourceMappingURL=bootstrap.bundle.min.js.map \ No newline at end of file diff --git a/deps/bootstrap-5.3.1/bootstrap.bundle.min.js.map b/deps/bootstrap-5.3.1/bootstrap.bundle.min.js.map new file mode 100644 index 0000000..3863da8 --- /dev/null +++ b/deps/bootstrap-5.3.1/bootstrap.bundle.min.js.map @@ -0,0 +1 @@ +{"version":3,"names":["elementMap","Map","Data","set","element","key","instance","has","instanceMap","get","size","console","error","Array","from","keys","remove","delete","TRANSITION_END","parseSelector","selector","window","CSS","escape","replace","match","id","triggerTransitionEnd","dispatchEvent","Event","isElement","object","jquery","nodeType","getElement","length","document","querySelector","isVisible","getClientRects","elementIsVisible","getComputedStyle","getPropertyValue","closedDetails","closest","summary","parentNode","isDisabled","Node","ELEMENT_NODE","classList","contains","disabled","hasAttribute","getAttribute","findShadowRoot","documentElement","attachShadow","getRootNode","root","ShadowRoot","noop","reflow","offsetHeight","getjQuery","jQuery","body","DOMContentLoadedCallbacks","isRTL","dir","defineJQueryPlugin","plugin","callback","$","name","NAME","JQUERY_NO_CONFLICT","fn","jQueryInterface","Constructor","noConflict","readyState","addEventListener","push","execute","possibleCallback","args","defaultValue","executeAfterTransition","transitionElement","waitForTransition","emulatedDuration","transitionDuration","transitionDelay","floatTransitionDuration","Number","parseFloat","floatTransitionDelay","split","getTransitionDurationFromElement","called","handler","target","removeEventListener","setTimeout","getNextActiveElement","list","activeElement","shouldGetNext","isCycleAllowed","listLength","index","indexOf","Math","max","min","namespaceRegex","stripNameRegex","stripUidRegex","eventRegistry","uidEvent","customEvents","mouseenter","mouseleave","nativeEvents","Set","makeEventUid","uid","getElementEvents","findHandler","events","callable","delegationSelector","Object","values","find","event","normalizeParameters","originalTypeEvent","delegationFunction","isDelegated","typeEvent","getTypeEvent","addHandler","oneOff","wrapFunction","relatedTarget","delegateTarget","call","this","handlers","previousFunction","domElements","querySelectorAll","domElement","hydrateObj","EventHandler","off","type","apply","bootstrapDelegationHandler","bootstrapHandler","removeHandler","Boolean","removeNamespacedHandlers","namespace","storeElementEvent","handlerKey","entries","includes","on","one","inNamespace","isNamespace","startsWith","elementEvent","slice","keyHandlers","trigger","jQueryEvent","bubbles","nativeDispatch","defaultPrevented","isPropagationStopped","isImmediatePropagationStopped","isDefaultPrevented","evt","cancelable","preventDefault","obj","meta","value","_unused","defineProperty","configurable","normalizeData","toString","JSON","parse","decodeURIComponent","normalizeDataKey","chr","toLowerCase","Manipulator","setDataAttribute","setAttribute","removeDataAttribute","removeAttribute","getDataAttributes","attributes","bsKeys","dataset","filter","pureKey","charAt","getDataAttribute","Config","Default","DefaultType","Error","_getConfig","config","_mergeConfigObj","_configAfterMerge","_typeCheckConfig","jsonConfig","constructor","configTypes","property","expectedTypes","valueType","prototype","RegExp","test","TypeError","toUpperCase","BaseComponent","super","_element","_config","DATA_KEY","dispose","EVENT_KEY","propertyName","getOwnPropertyNames","_queueCallback","isAnimated","getInstance","getOrCreateInstance","VERSION","eventName","getSelector","hrefAttribute","trim","SelectorEngine","concat","Element","findOne","children","child","matches","parents","ancestor","prev","previous","previousElementSibling","next","nextElementSibling","focusableChildren","focusables","map","join","el","getSelectorFromElement","getElementFromSelector","getMultipleElementsFromSelector","enableDismissTrigger","component","method","clickEvent","tagName","EVENT_CLOSE","EVENT_CLOSED","Alert","close","_destroyElement","each","data","undefined","SELECTOR_DATA_TOGGLE","Button","toggle","button","EVENT_TOUCHSTART","EVENT_TOUCHMOVE","EVENT_TOUCHEND","EVENT_POINTERDOWN","EVENT_POINTERUP","endCallback","leftCallback","rightCallback","Swipe","isSupported","_deltaX","_supportPointerEvents","PointerEvent","_initEvents","_start","_eventIsPointerPenTouch","clientX","touches","_end","_handleSwipe","_move","absDeltaX","abs","direction","add","pointerType","navigator","maxTouchPoints","DATA_API_KEY","ORDER_NEXT","ORDER_PREV","DIRECTION_LEFT","DIRECTION_RIGHT","EVENT_SLIDE","EVENT_SLID","EVENT_KEYDOWN","EVENT_MOUSEENTER","EVENT_MOUSELEAVE","EVENT_DRAG_START","EVENT_LOAD_DATA_API","EVENT_CLICK_DATA_API","CLASS_NAME_CAROUSEL","CLASS_NAME_ACTIVE","SELECTOR_ACTIVE","SELECTOR_ITEM","SELECTOR_ACTIVE_ITEM","KEY_TO_DIRECTION","ArrowLeft","ArrowRight","interval","keyboard","pause","ride","touch","wrap","Carousel","_interval","_activeElement","_isSliding","touchTimeout","_swipeHelper","_indicatorsElement","_addEventListeners","cycle","_slide","nextWhenVisible","hidden","_clearInterval","_updateInterval","setInterval","_maybeEnableCycle","to","items","_getItems","activeIndex","_getItemIndex","_getActive","order","defaultInterval","_keydown","_addTouchEventListeners","img","swipeConfig","_directionToOrder","endCallBack","clearTimeout","_setActiveIndicatorElement","activeIndicator","newActiveIndicator","elementInterval","parseInt","isNext","nextElement","nextElementIndex","triggerEvent","_orderToDirection","isCycling","directionalClassName","orderClassName","completeCallBack","_isAnimated","clearInterval","carousel","slideIndex","carousels","EVENT_SHOW","EVENT_SHOWN","EVENT_HIDE","EVENT_HIDDEN","CLASS_NAME_SHOW","CLASS_NAME_COLLAPSE","CLASS_NAME_COLLAPSING","CLASS_NAME_DEEPER_CHILDREN","parent","Collapse","_isTransitioning","_triggerArray","toggleList","elem","filterElement","foundElement","_initializeChildren","_addAriaAndCollapsedClass","_isShown","hide","show","activeChildren","_getFirstLevelChildren","activeInstance","dimension","_getDimension","style","scrollSize","complete","getBoundingClientRect","selected","triggerArray","isOpen","top","bottom","right","left","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","variationPlacements","reduce","acc","placement","placements","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases","getNodeName","nodeName","getWindow","node","ownerDocument","defaultView","isHTMLElement","HTMLElement","isShadowRoot","applyStyles$1","enabled","phase","_ref","state","elements","forEach","styles","assign","effect","_ref2","initialStyles","position","options","strategy","margin","arrow","hasOwnProperty","attribute","requires","getBasePlacement","round","getUAString","uaData","userAgentData","brands","isArray","item","brand","version","userAgent","isLayoutViewport","includeScale","isFixedStrategy","clientRect","scaleX","scaleY","offsetWidth","width","height","visualViewport","addVisualOffsets","x","offsetLeft","y","offsetTop","getLayoutRect","rootNode","isSameNode","host","isTableElement","getDocumentElement","getParentNode","assignedSlot","getTrueOffsetParent","offsetParent","getOffsetParent","isFirefox","currentNode","css","transform","perspective","contain","willChange","getContainingBlock","getMainAxisFromPlacement","within","mathMax","mathMin","mergePaddingObject","paddingObject","expandToHashMap","hashMap","arrow$1","_state$modifiersData$","arrowElement","popperOffsets","modifiersData","basePlacement","axis","len","padding","rects","toPaddingObject","arrowRect","minProp","maxProp","endDiff","startDiff","arrowOffsetParent","clientSize","clientHeight","clientWidth","centerToReference","center","offset","axisProp","centerOffset","_options$element","requiresIfExists","getVariation","unsetSides","mapToStyles","_Object$assign2","popperRect","variation","offsets","gpuAcceleration","adaptive","roundOffsets","isFixed","_offsets$x","_offsets$y","_ref3","hasX","hasY","sideX","sideY","win","heightProp","widthProp","_Object$assign","commonStyles","_ref4","dpr","devicePixelRatio","roundOffsetsByDPR","computeStyles$1","_ref5","_options$gpuAccelerat","_options$adaptive","_options$roundOffsets","passive","eventListeners","_options$scroll","scroll","_options$resize","resize","scrollParents","scrollParent","update","hash","getOppositePlacement","matched","getOppositeVariationPlacement","getWindowScroll","scrollLeft","pageXOffset","scrollTop","pageYOffset","getWindowScrollBarX","isScrollParent","_getComputedStyle","overflow","overflowX","overflowY","getScrollParent","listScrollParents","_element$ownerDocumen","isBody","updatedList","rectToClientRect","rect","getClientRectFromMixedType","clippingParent","html","layoutViewport","getViewportRect","clientTop","clientLeft","getInnerBoundingClientRect","winScroll","scrollWidth","scrollHeight","getDocumentRect","computeOffsets","commonX","commonY","mainAxis","detectOverflow","_options","_options$placement","_options$strategy","_options$boundary","boundary","_options$rootBoundary","rootBoundary","_options$elementConte","elementContext","_options$altBoundary","altBoundary","_options$padding","altContext","clippingClientRect","mainClippingParents","clipperElement","getClippingParents","firstClippingParent","clippingRect","accRect","getClippingRect","contextElement","referenceClientRect","popperClientRect","elementClientRect","overflowOffsets","offsetData","multiply","computeAutoPlacement","flipVariations","_options$allowedAutoP","allowedAutoPlacements","allPlacements","allowedPlacements","overflows","sort","a","b","flip$1","_skip","_options$mainAxis","checkMainAxis","_options$altAxis","altAxis","checkAltAxis","specifiedFallbackPlacements","fallbackPlacements","_options$flipVariatio","preferredPlacement","oppositePlacement","getExpandedFallbackPlacements","referenceRect","checksMap","makeFallbackChecks","firstFittingPlacement","i","_basePlacement","isStartVariation","isVertical","mainVariationSide","altVariationSide","checks","every","check","_loop","_i","fittingPlacement","reset","getSideOffsets","preventedOffsets","isAnySideFullyClipped","some","side","hide$1","preventOverflow","referenceOverflow","popperAltOverflow","referenceClippingOffsets","popperEscapeOffsets","isReferenceHidden","hasPopperEscaped","offset$1","_options$offset","invertDistance","skidding","distance","distanceAndSkiddingToXY","_data$state$placement","popperOffsets$1","preventOverflow$1","_options$tether","tether","_options$tetherOffset","tetherOffset","isBasePlacement","tetherOffsetValue","normalizedTetherOffsetValue","offsetModifierState","_offsetModifierState$","mainSide","altSide","additive","minLen","maxLen","arrowPaddingObject","arrowPaddingMin","arrowPaddingMax","arrowLen","minOffset","maxOffset","clientOffset","offsetModifierValue","tetherMax","preventedOffset","_offsetModifierState$2","_mainSide","_altSide","_offset","_len","_min","_max","isOriginSide","_offsetModifierValue","_tetherMin","_tetherMax","_preventedOffset","v","withinMaxClamp","getCompositeRect","elementOrVirtualElement","isOffsetParentAnElement","offsetParentIsScaled","isElementScaled","modifiers","visited","result","modifier","dep","depModifier","DEFAULT_OPTIONS","areValidElements","arguments","_key","popperGenerator","generatorOptions","_generatorOptions","_generatorOptions$def","defaultModifiers","_generatorOptions$def2","defaultOptions","pending","orderedModifiers","effectCleanupFns","isDestroyed","setOptions","setOptionsAction","cleanupModifierEffects","merged","orderModifiers","current","existing","m","_ref$options","cleanupFn","forceUpdate","_state$elements","_state$orderedModifie","_state$orderedModifie2","Promise","resolve","then","destroy","onFirstUpdate","createPopper","computeStyles","applyStyles","flip","ARROW_UP_KEY","ARROW_DOWN_KEY","EVENT_KEYDOWN_DATA_API","EVENT_KEYUP_DATA_API","SELECTOR_DATA_TOGGLE_SHOWN","SELECTOR_MENU","PLACEMENT_TOP","PLACEMENT_TOPEND","PLACEMENT_BOTTOM","PLACEMENT_BOTTOMEND","PLACEMENT_RIGHT","PLACEMENT_LEFT","autoClose","display","popperConfig","Dropdown","_popper","_parent","_menu","_inNavbar","_detectNavbar","_createPopper","focus","_completeHide","Popper","referenceElement","_getPopperConfig","_getPlacement","parentDropdown","isEnd","_getOffset","popperData","defaultBsPopperConfig","_selectMenuItem","clearMenus","openToggles","context","composedPath","isMenuTarget","dataApiKeydownHandler","isInput","isEscapeEvent","isUpOrDownEvent","getToggleButton","stopPropagation","EVENT_MOUSEDOWN","className","clickCallback","rootElement","Backdrop","_isAppended","_append","_getElement","_emulateAnimation","backdrop","createElement","append","EVENT_FOCUSIN","EVENT_KEYDOWN_TAB","TAB_NAV_BACKWARD","autofocus","trapElement","FocusTrap","_isActive","_lastTabNavDirection","activate","_handleFocusin","_handleKeydown","deactivate","shiftKey","SELECTOR_FIXED_CONTENT","SELECTOR_STICKY_CONTENT","PROPERTY_PADDING","PROPERTY_MARGIN","ScrollBarHelper","getWidth","documentWidth","innerWidth","_disableOverFlow","_setElementAttributes","calculatedValue","_resetElementAttributes","isOverflowing","_saveInitialAttribute","styleProperty","scrollbarWidth","_applyManipulationCallback","setProperty","actualValue","removeProperty","callBack","sel","EVENT_HIDE_PREVENTED","EVENT_RESIZE","EVENT_CLICK_DISMISS","EVENT_MOUSEDOWN_DISMISS","EVENT_KEYDOWN_DISMISS","CLASS_NAME_OPEN","CLASS_NAME_STATIC","Modal","_dialog","_backdrop","_initializeBackDrop","_focustrap","_initializeFocusTrap","_scrollBar","_adjustDialog","_showElement","_hideModal","handleUpdate","modalBody","transitionComplete","_triggerBackdropTransition","event2","_resetAdjustments","isModalOverflowing","initialOverflowY","isBodyOverflowing","paddingLeft","paddingRight","showEvent","alreadyOpen","CLASS_NAME_SHOWING","CLASS_NAME_HIDING","OPEN_SELECTOR","Offcanvas","blur","completeCallback","DefaultAllowlist","area","br","col","code","div","em","hr","h1","h2","h3","h4","h5","h6","li","ol","p","pre","s","small","span","sub","sup","strong","u","ul","uriAttributes","SAFE_URL_PATTERN","allowedAttribute","allowedAttributeList","attributeName","nodeValue","attributeRegex","regex","allowList","content","extraClass","sanitize","sanitizeFn","template","DefaultContentType","entry","TemplateFactory","getContent","_resolvePossibleFunction","hasContent","changeContent","_checkContent","toHtml","templateWrapper","innerHTML","_maybeSanitize","text","_setContent","arg","templateElement","_putElementInTemplate","textContent","unsafeHtml","sanitizeFunction","createdDocument","DOMParser","parseFromString","elementName","attributeList","allowedAttributes","sanitizeHtml","DISALLOWED_ATTRIBUTES","CLASS_NAME_FADE","SELECTOR_MODAL","EVENT_MODAL_HIDE","TRIGGER_HOVER","TRIGGER_FOCUS","AttachmentMap","AUTO","TOP","RIGHT","BOTTOM","LEFT","animation","container","customClass","delay","title","Tooltip","_isEnabled","_timeout","_isHovered","_activeTrigger","_templateFactory","_newContent","tip","_setListeners","_fixTitle","enable","disable","toggleEnabled","click","_leave","_enter","_hideModalHandler","_disposePopper","_isWithContent","isInTheDom","_getTipElement","_isWithActiveTrigger","_getTitle","_createTipElement","_getContentForTemplate","_getTemplateFactory","tipId","prefix","floor","random","getElementById","getUID","setContent","_initializeOnDelegatedTarget","_getDelegateConfig","attachment","triggers","eventIn","eventOut","_setTimeout","timeout","dataAttributes","dataAttribute","Popover","_getContent","EVENT_ACTIVATE","EVENT_CLICK","SELECTOR_TARGET_LINKS","SELECTOR_NAV_LINKS","SELECTOR_LINK_ITEMS","rootMargin","smoothScroll","threshold","ScrollSpy","_targetLinks","_observableSections","_rootElement","_activeTarget","_observer","_previousScrollData","visibleEntryTop","parentScrollTop","refresh","_initializeTargetsAndObservables","_maybeEnableSmoothScroll","disconnect","_getNewObserver","section","observe","observableSection","scrollTo","behavior","IntersectionObserver","_observerCallback","targetElement","_process","userScrollsDown","isIntersecting","_clearActiveClass","entryIsLowerThanPrevious","targetLinks","anchor","decodeURI","_activateParents","listGroup","activeNodes","spy","ARROW_LEFT_KEY","ARROW_RIGHT_KEY","HOME_KEY","END_KEY","NOT_SELECTOR_DROPDOWN_TOGGLE","SELECTOR_INNER_ELEM","SELECTOR_DATA_TOGGLE_ACTIVE","Tab","_setInitialAttributes","_getChildren","innerElem","_elemIsActive","active","_getActiveElem","hideEvent","_deactivate","_activate","relatedElem","_toggleDropDown","nextActiveElement","preventScroll","_setAttributeIfNotExists","_setInitialAttributesOnChild","_getInnerElement","isActive","outerElem","_getOuterElement","_setInitialAttributesOnTargetPanel","open","EVENT_MOUSEOVER","EVENT_MOUSEOUT","EVENT_FOCUSOUT","CLASS_NAME_HIDE","autohide","Toast","_hasMouseInteraction","_hasKeyboardInteraction","_clearTimeout","_maybeScheduleHide","isShown","_onInteraction","isInteracting"],"sources":["../../js/src/dom/data.js","../../js/src/util/index.js","../../js/src/dom/event-handler.js","../../js/src/dom/manipulator.js","../../js/src/util/config.js","../../js/src/base-component.js","../../js/src/dom/selector-engine.js","../../js/src/util/component-functions.js","../../js/src/alert.js","../../js/src/button.js","../../js/src/util/swipe.js","../../js/src/carousel.js","../../js/src/collapse.js","../../node_modules/@popperjs/core/lib/enums.js","../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js","../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js","../../node_modules/@popperjs/core/lib/utils/math.js","../../node_modules/@popperjs/core/lib/utils/userAgent.js","../../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","../../node_modules/@popperjs/core/lib/dom-utils/contains.js","../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","../../node_modules/@popperjs/core/lib/utils/within.js","../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js","../../node_modules/@popperjs/core/lib/modifiers/arrow.js","../../node_modules/@popperjs/core/lib/utils/getVariation.js","../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js","../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js","../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","../../node_modules/@popperjs/core/lib/utils/computeOffsets.js","../../node_modules/@popperjs/core/lib/utils/detectOverflow.js","../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","../../node_modules/@popperjs/core/lib/modifiers/flip.js","../../node_modules/@popperjs/core/lib/modifiers/hide.js","../../node_modules/@popperjs/core/lib/modifiers/offset.js","../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","../../node_modules/@popperjs/core/lib/utils/getAltAxis.js","../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","../../node_modules/@popperjs/core/lib/utils/orderModifiers.js","../../node_modules/@popperjs/core/lib/createPopper.js","../../node_modules/@popperjs/core/lib/utils/debounce.js","../../node_modules/@popperjs/core/lib/utils/mergeByName.js","../../node_modules/@popperjs/core/lib/popper-lite.js","../../node_modules/@popperjs/core/lib/popper.js","../../js/src/dropdown.js","../../js/src/util/backdrop.js","../../js/src/util/focustrap.js","../../js/src/util/scrollbar.js","../../js/src/modal.js","../../js/src/offcanvas.js","../../js/src/util/sanitizer.js","../../js/src/util/template-factory.js","../../js/src/tooltip.js","../../js/src/popover.js","../../js/src/scrollspy.js","../../js/src/tab.js","../../js/src/toast.js","../../js/index.umd.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * Constants\n */\n\nconst elementMap = new Map()\n\nexport default {\n set(element, key, instance) {\n if (!elementMap.has(element)) {\n elementMap.set(element, new Map())\n }\n\n const instanceMap = elementMap.get(element)\n\n // make it clear we only want one instance per element\n // can be removed later when multiple key/instances are fine to be used\n if (!instanceMap.has(key) && instanceMap.size !== 0) {\n // eslint-disable-next-line no-console\n console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`)\n return\n }\n\n instanceMap.set(key, instance)\n },\n\n get(element, key) {\n if (elementMap.has(element)) {\n return elementMap.get(element).get(key) || null\n }\n\n return null\n },\n\n remove(element, key) {\n if (!elementMap.has(element)) {\n return\n }\n\n const instanceMap = elementMap.get(element)\n\n instanceMap.delete(key)\n\n // free up element references if there are no instances left for an element\n if (instanceMap.size === 0) {\n elementMap.delete(element)\n }\n }\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1_000_000\nconst MILLISECONDS_MULTIPLIER = 1000\nconst TRANSITION_END = 'transitionend'\n\n/**\n * Properly escape IDs selectors to handle weird IDs\n * @param {string} selector\n * @returns {string}\n */\nconst parseSelector = selector => {\n if (selector && window.CSS && window.CSS.escape) {\n // document.querySelector needs escaping to handle IDs (html5+) containing for instance /\n selector = selector.replace(/#([^\\s\"#']+)/g, (match, id) => `#${CSS.escape(id)}`)\n }\n\n return selector\n}\n\n// Shout-out Angus Croll (https://goo.gl/pxwQGp)\nconst toType = object => {\n if (object === null || object === undefined) {\n return `${object}`\n }\n\n return Object.prototype.toString.call(object).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\n/**\n * Public Util API\n */\n\nconst getUID = prefix => {\n do {\n prefix += Math.floor(Math.random() * MAX_UID)\n } while (document.getElementById(prefix))\n\n return prefix\n}\n\nconst getTransitionDurationFromElement = element => {\n if (!element) {\n return 0\n }\n\n // Get transition-duration of the element\n let { transitionDuration, transitionDelay } = window.getComputedStyle(element)\n\n const floatTransitionDuration = Number.parseFloat(transitionDuration)\n const floatTransitionDelay = Number.parseFloat(transitionDelay)\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0]\n transitionDelay = transitionDelay.split(',')[0]\n\n return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n}\n\nconst triggerTransitionEnd = element => {\n element.dispatchEvent(new Event(TRANSITION_END))\n}\n\nconst isElement = object => {\n if (!object || typeof object !== 'object') {\n return false\n }\n\n if (typeof object.jquery !== 'undefined') {\n object = object[0]\n }\n\n return typeof object.nodeType !== 'undefined'\n}\n\nconst getElement = object => {\n // it's a jQuery object or a node element\n if (isElement(object)) {\n return object.jquery ? object[0] : object\n }\n\n if (typeof object === 'string' && object.length > 0) {\n return document.querySelector(parseSelector(object))\n }\n\n return null\n}\n\nconst isVisible = element => {\n if (!isElement(element) || element.getClientRects().length === 0) {\n return false\n }\n\n const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'\n // Handle `details` element as its content may falsie appear visible when it is closed\n const closedDetails = element.closest('details:not([open])')\n\n if (!closedDetails) {\n return elementIsVisible\n }\n\n if (closedDetails !== element) {\n const summary = element.closest('summary')\n if (summary && summary.parentNode !== closedDetails) {\n return false\n }\n\n if (summary === null) {\n return false\n }\n }\n\n return elementIsVisible\n}\n\nconst isDisabled = element => {\n if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n return true\n }\n\n if (element.classList.contains('disabled')) {\n return true\n }\n\n if (typeof element.disabled !== 'undefined') {\n return element.disabled\n }\n\n return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'\n}\n\nconst findShadowRoot = element => {\n if (!document.documentElement.attachShadow) {\n return null\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode()\n return root instanceof ShadowRoot ? root : null\n }\n\n if (element instanceof ShadowRoot) {\n return element\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null\n }\n\n return findShadowRoot(element.parentNode)\n}\n\nconst noop = () => {}\n\n/**\n * Trick to restart an element's animation\n *\n * @param {HTMLElement} element\n * @return void\n *\n * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation\n */\nconst reflow = element => {\n element.offsetHeight // eslint-disable-line no-unused-expressions\n}\n\nconst getjQuery = () => {\n if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {\n return window.jQuery\n }\n\n return null\n}\n\nconst DOMContentLoadedCallbacks = []\n\nconst onDOMContentLoaded = callback => {\n if (document.readyState === 'loading') {\n // add listener on the first call when the document is in loading state\n if (!DOMContentLoadedCallbacks.length) {\n document.addEventListener('DOMContentLoaded', () => {\n for (const callback of DOMContentLoadedCallbacks) {\n callback()\n }\n })\n }\n\n DOMContentLoadedCallbacks.push(callback)\n } else {\n callback()\n }\n}\n\nconst isRTL = () => document.documentElement.dir === 'rtl'\n\nconst defineJQueryPlugin = plugin => {\n onDOMContentLoaded(() => {\n const $ = getjQuery()\n /* istanbul ignore if */\n if ($) {\n const name = plugin.NAME\n const JQUERY_NO_CONFLICT = $.fn[name]\n $.fn[name] = plugin.jQueryInterface\n $.fn[name].Constructor = plugin\n $.fn[name].noConflict = () => {\n $.fn[name] = JQUERY_NO_CONFLICT\n return plugin.jQueryInterface\n }\n }\n })\n}\n\nconst execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {\n return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue\n}\n\nconst executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {\n if (!waitForTransition) {\n execute(callback)\n return\n }\n\n const durationPadding = 5\n const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding\n\n let called = false\n\n const handler = ({ target }) => {\n if (target !== transitionElement) {\n return\n }\n\n called = true\n transitionElement.removeEventListener(TRANSITION_END, handler)\n execute(callback)\n }\n\n transitionElement.addEventListener(TRANSITION_END, handler)\n setTimeout(() => {\n if (!called) {\n triggerTransitionEnd(transitionElement)\n }\n }, emulatedDuration)\n}\n\n/**\n * Return the previous/next element of a list.\n *\n * @param {array} list The list of elements\n * @param activeElement The active element\n * @param shouldGetNext Choose to get next or previous element\n * @param isCycleAllowed\n * @return {Element|elem} The proper element\n */\nconst getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {\n const listLength = list.length\n let index = list.indexOf(activeElement)\n\n // if the element does not exist in the list return an element\n // depending on the direction and if cycle is allowed\n if (index === -1) {\n return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0]\n }\n\n index += shouldGetNext ? 1 : -1\n\n if (isCycleAllowed) {\n index = (index + listLength) % listLength\n }\n\n return list[Math.max(0, Math.min(index, listLength - 1))]\n}\n\nexport {\n defineJQueryPlugin,\n execute,\n executeAfterTransition,\n findShadowRoot,\n getElement,\n getjQuery,\n getNextActiveElement,\n getTransitionDurationFromElement,\n getUID,\n isDisabled,\n isElement,\n isRTL,\n isVisible,\n noop,\n onDOMContentLoaded,\n parseSelector,\n reflow,\n triggerTransitionEnd,\n toType\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/event-handler.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { getjQuery } from '../util/index.js'\n\n/**\n * Constants\n */\n\nconst namespaceRegex = /[^.]*(?=\\..*)\\.|.*/\nconst stripNameRegex = /\\..*/\nconst stripUidRegex = /::\\d+$/\nconst eventRegistry = {} // Events storage\nlet uidEvent = 1\nconst customEvents = {\n mouseenter: 'mouseover',\n mouseleave: 'mouseout'\n}\n\nconst nativeEvents = new Set([\n 'click',\n 'dblclick',\n 'mouseup',\n 'mousedown',\n 'contextmenu',\n 'mousewheel',\n 'DOMMouseScroll',\n 'mouseover',\n 'mouseout',\n 'mousemove',\n 'selectstart',\n 'selectend',\n 'keydown',\n 'keypress',\n 'keyup',\n 'orientationchange',\n 'touchstart',\n 'touchmove',\n 'touchend',\n 'touchcancel',\n 'pointerdown',\n 'pointermove',\n 'pointerup',\n 'pointerleave',\n 'pointercancel',\n 'gesturestart',\n 'gesturechange',\n 'gestureend',\n 'focus',\n 'blur',\n 'change',\n 'reset',\n 'select',\n 'submit',\n 'focusin',\n 'focusout',\n 'load',\n 'unload',\n 'beforeunload',\n 'resize',\n 'move',\n 'DOMContentLoaded',\n 'readystatechange',\n 'error',\n 'abort',\n 'scroll'\n])\n\n/**\n * Private methods\n */\n\nfunction makeEventUid(element, uid) {\n return (uid && `${uid}::${uidEvent++}`) || element.uidEvent || uidEvent++\n}\n\nfunction getElementEvents(element) {\n const uid = makeEventUid(element)\n\n element.uidEvent = uid\n eventRegistry[uid] = eventRegistry[uid] || {}\n\n return eventRegistry[uid]\n}\n\nfunction bootstrapHandler(element, fn) {\n return function handler(event) {\n hydrateObj(event, { delegateTarget: element })\n\n if (handler.oneOff) {\n EventHandler.off(element, event.type, fn)\n }\n\n return fn.apply(element, [event])\n }\n}\n\nfunction bootstrapDelegationHandler(element, selector, fn) {\n return function handler(event) {\n const domElements = element.querySelectorAll(selector)\n\n for (let { target } = event; target && target !== this; target = target.parentNode) {\n for (const domElement of domElements) {\n if (domElement !== target) {\n continue\n }\n\n hydrateObj(event, { delegateTarget: target })\n\n if (handler.oneOff) {\n EventHandler.off(element, event.type, selector, fn)\n }\n\n return fn.apply(target, [event])\n }\n }\n }\n}\n\nfunction findHandler(events, callable, delegationSelector = null) {\n return Object.values(events)\n .find(event => event.callable === callable && event.delegationSelector === delegationSelector)\n}\n\nfunction normalizeParameters(originalTypeEvent, handler, delegationFunction) {\n const isDelegated = typeof handler === 'string'\n // TODO: tooltip passes `false` instead of selector, so we need to check\n const callable = isDelegated ? delegationFunction : (handler || delegationFunction)\n let typeEvent = getTypeEvent(originalTypeEvent)\n\n if (!nativeEvents.has(typeEvent)) {\n typeEvent = originalTypeEvent\n }\n\n return [isDelegated, callable, typeEvent]\n}\n\nfunction addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return\n }\n\n let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction)\n\n // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position\n // this prevents the handler from being dispatched the same way as mouseover or mouseout does\n if (originalTypeEvent in customEvents) {\n const wrapFunction = fn => {\n return function (event) {\n if (!event.relatedTarget || (event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget))) {\n return fn.call(this, event)\n }\n }\n }\n\n callable = wrapFunction(callable)\n }\n\n const events = getElementEvents(element)\n const handlers = events[typeEvent] || (events[typeEvent] = {})\n const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null)\n\n if (previousFunction) {\n previousFunction.oneOff = previousFunction.oneOff && oneOff\n\n return\n }\n\n const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''))\n const fn = isDelegated ?\n bootstrapDelegationHandler(element, handler, callable) :\n bootstrapHandler(element, callable)\n\n fn.delegationSelector = isDelegated ? handler : null\n fn.callable = callable\n fn.oneOff = oneOff\n fn.uidEvent = uid\n handlers[uid] = fn\n\n element.addEventListener(typeEvent, fn, isDelegated)\n}\n\nfunction removeHandler(element, events, typeEvent, handler, delegationSelector) {\n const fn = findHandler(events[typeEvent], handler, delegationSelector)\n\n if (!fn) {\n return\n }\n\n element.removeEventListener(typeEvent, fn, Boolean(delegationSelector))\n delete events[typeEvent][fn.uidEvent]\n}\n\nfunction removeNamespacedHandlers(element, events, typeEvent, namespace) {\n const storeElementEvent = events[typeEvent] || {}\n\n for (const [handlerKey, event] of Object.entries(storeElementEvent)) {\n if (handlerKey.includes(namespace)) {\n removeHandler(element, events, typeEvent, event.callable, event.delegationSelector)\n }\n }\n}\n\nfunction getTypeEvent(event) {\n // allow to get the native events from namespaced events ('click.bs.button' --> 'click')\n event = event.replace(stripNameRegex, '')\n return customEvents[event] || event\n}\n\nconst EventHandler = {\n on(element, event, handler, delegationFunction) {\n addHandler(element, event, handler, delegationFunction, false)\n },\n\n one(element, event, handler, delegationFunction) {\n addHandler(element, event, handler, delegationFunction, true)\n },\n\n off(element, originalTypeEvent, handler, delegationFunction) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return\n }\n\n const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction)\n const inNamespace = typeEvent !== originalTypeEvent\n const events = getElementEvents(element)\n const storeElementEvent = events[typeEvent] || {}\n const isNamespace = originalTypeEvent.startsWith('.')\n\n if (typeof callable !== 'undefined') {\n // Simplest case: handler is passed, remove that listener ONLY.\n if (!Object.keys(storeElementEvent).length) {\n return\n }\n\n removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null)\n return\n }\n\n if (isNamespace) {\n for (const elementEvent of Object.keys(events)) {\n removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1))\n }\n }\n\n for (const [keyHandlers, event] of Object.entries(storeElementEvent)) {\n const handlerKey = keyHandlers.replace(stripUidRegex, '')\n\n if (!inNamespace || originalTypeEvent.includes(handlerKey)) {\n removeHandler(element, events, typeEvent, event.callable, event.delegationSelector)\n }\n }\n },\n\n trigger(element, event, args) {\n if (typeof event !== 'string' || !element) {\n return null\n }\n\n const $ = getjQuery()\n const typeEvent = getTypeEvent(event)\n const inNamespace = event !== typeEvent\n\n let jQueryEvent = null\n let bubbles = true\n let nativeDispatch = true\n let defaultPrevented = false\n\n if (inNamespace && $) {\n jQueryEvent = $.Event(event, args)\n\n $(element).trigger(jQueryEvent)\n bubbles = !jQueryEvent.isPropagationStopped()\n nativeDispatch = !jQueryEvent.isImmediatePropagationStopped()\n defaultPrevented = jQueryEvent.isDefaultPrevented()\n }\n\n const evt = hydrateObj(new Event(event, { bubbles, cancelable: true }), args)\n\n if (defaultPrevented) {\n evt.preventDefault()\n }\n\n if (nativeDispatch) {\n element.dispatchEvent(evt)\n }\n\n if (evt.defaultPrevented && jQueryEvent) {\n jQueryEvent.preventDefault()\n }\n\n return evt\n }\n}\n\nfunction hydrateObj(obj, meta = {}) {\n for (const [key, value] of Object.entries(meta)) {\n try {\n obj[key] = value\n } catch {\n Object.defineProperty(obj, key, {\n configurable: true,\n get() {\n return value\n }\n })\n }\n }\n\n return obj\n}\n\nexport default EventHandler\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(value) {\n if (value === 'true') {\n return true\n }\n\n if (value === 'false') {\n return false\n }\n\n if (value === Number(value).toString()) {\n return Number(value)\n }\n\n if (value === '' || value === 'null') {\n return null\n }\n\n if (typeof value !== 'string') {\n return value\n }\n\n try {\n return JSON.parse(decodeURIComponent(value))\n } catch {\n return value\n }\n}\n\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)\n}\n\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)\n },\n\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)\n },\n\n getDataAttributes(element) {\n if (!element) {\n return {}\n }\n\n const attributes = {}\n const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'))\n\n for (const key of bsKeys) {\n let pureKey = key.replace(/^bs/, '')\n pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length)\n attributes[pureKey] = normalizeData(element.dataset[key])\n }\n\n return attributes\n },\n\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))\n }\n}\n\nexport default Manipulator\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap util/config.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Manipulator from '../dom/manipulator.js'\nimport { isElement, toType } from './index.js'\n\n/**\n * Class definition\n */\n\nclass Config {\n // Getters\n static get Default() {\n return {}\n }\n\n static get DefaultType() {\n return {}\n }\n\n static get NAME() {\n throw new Error('You have to implement the static method \"NAME\", for each component!')\n }\n\n _getConfig(config) {\n config = this._mergeConfigObj(config)\n config = this._configAfterMerge(config)\n this._typeCheckConfig(config)\n return config\n }\n\n _configAfterMerge(config) {\n return config\n }\n\n _mergeConfigObj(config, element) {\n const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {} // try to parse\n\n return {\n ...this.constructor.Default,\n ...(typeof jsonConfig === 'object' ? jsonConfig : {}),\n ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}),\n ...(typeof config === 'object' ? config : {})\n }\n }\n\n _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {\n for (const [property, expectedTypes] of Object.entries(configTypes)) {\n const value = config[property]\n const valueType = isElement(value) ? 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new TypeError(\n `${this.constructor.NAME.toUpperCase()}: Option \"${property}\" provided type \"${valueType}\" but expected type \"${expectedTypes}\".`\n )\n }\n }\n }\n}\n\nexport default Config\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap base-component.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Data from './dom/data.js'\nimport EventHandler from './dom/event-handler.js'\nimport Config from './util/config.js'\nimport { executeAfterTransition, getElement } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst VERSION = '5.3.1'\n\n/**\n * Class definition\n */\n\nclass BaseComponent extends Config {\n constructor(element, config) {\n super()\n\n element = getElement(element)\n if (!element) {\n return\n }\n\n this._element = element\n this._config = this._getConfig(config)\n\n Data.set(this._element, this.constructor.DATA_KEY, this)\n }\n\n // Public\n dispose() {\n Data.remove(this._element, this.constructor.DATA_KEY)\n EventHandler.off(this._element, this.constructor.EVENT_KEY)\n\n for (const propertyName of Object.getOwnPropertyNames(this)) {\n this[propertyName] = null\n }\n }\n\n _queueCallback(callback, element, isAnimated = true) {\n executeAfterTransition(callback, element, isAnimated)\n }\n\n _getConfig(config) {\n config = this._mergeConfigObj(config, this._element)\n config = this._configAfterMerge(config)\n this._typeCheckConfig(config)\n return config\n }\n\n // Static\n static getInstance(element) {\n return Data.get(getElement(element), this.DATA_KEY)\n }\n\n static getOrCreateInstance(element, config = {}) {\n return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null)\n }\n\n static get VERSION() {\n return VERSION\n }\n\n static get DATA_KEY() {\n return `bs.${this.NAME}`\n }\n\n static get EVENT_KEY() {\n return `.${this.DATA_KEY}`\n }\n\n static eventName(name) {\n return `${name}${this.EVENT_KEY}`\n }\n}\n\nexport default BaseComponent\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { isDisabled, isVisible, parseSelector } from '../util/index.js'\n\nconst getSelector = element => {\n let selector = element.getAttribute('data-bs-target')\n\n if (!selector || selector === '#') {\n let hrefAttribute = element.getAttribute('href')\n\n // The only valid content that could double as a selector are IDs or classes,\n // so everything starting with `#` or `.`. If a \"real\" URL is used as the selector,\n // `document.querySelector` will rightfully complain it is invalid.\n // See https://github.com/twbs/bootstrap/issues/32273\n if (!hrefAttribute || (!hrefAttribute.includes('#') && !hrefAttribute.startsWith('.'))) {\n return null\n }\n\n // Just in case some CMS puts out a full URL with the anchor appended\n if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {\n hrefAttribute = `#${hrefAttribute.split('#')[1]}`\n }\n\n selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null\n }\n\n return parseSelector(selector)\n}\n\nconst SelectorEngine = {\n find(selector, element = document.documentElement) {\n return [].concat(...Element.prototype.querySelectorAll.call(element, selector))\n },\n\n findOne(selector, element = document.documentElement) {\n return Element.prototype.querySelector.call(element, selector)\n },\n\n children(element, selector) {\n return [].concat(...element.children).filter(child => child.matches(selector))\n },\n\n parents(element, selector) {\n const parents = []\n let ancestor = element.parentNode.closest(selector)\n\n while (ancestor) {\n parents.push(ancestor)\n ancestor = ancestor.parentNode.closest(selector)\n }\n\n return parents\n },\n\n prev(element, selector) {\n let previous = element.previousElementSibling\n\n while (previous) {\n if (previous.matches(selector)) {\n return [previous]\n }\n\n previous = previous.previousElementSibling\n }\n\n return []\n },\n // TODO: this is now unused; remove later along with prev()\n next(element, selector) {\n let next = element.nextElementSibling\n\n while (next) {\n if (next.matches(selector)) {\n return [next]\n }\n\n next = next.nextElementSibling\n }\n\n return []\n },\n\n focusableChildren(element) {\n const focusables = [\n 'a',\n 'button',\n 'input',\n 'textarea',\n 'select',\n 'details',\n '[tabindex]',\n '[contenteditable=\"true\"]'\n ].map(selector => `${selector}:not([tabindex^=\"-\"])`).join(',')\n\n return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el))\n },\n\n getSelectorFromElement(element) {\n const selector = getSelector(element)\n\n if (selector) {\n return SelectorEngine.findOne(selector) ? selector : null\n }\n\n return null\n },\n\n getElementFromSelector(element) {\n const selector = getSelector(element)\n\n return selector ? SelectorEngine.findOne(selector) : null\n },\n\n getMultipleElementsFromSelector(element) {\n const selector = getSelector(element)\n\n return selector ? SelectorEngine.find(selector) : []\n }\n}\n\nexport default SelectorEngine\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap util/component-functions.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport { isDisabled } from './index.js'\n\nconst enableDismissTrigger = (component, method = 'hide') => {\n const clickEvent = `click.dismiss${component.EVENT_KEY}`\n const name = component.NAME\n\n EventHandler.on(document, clickEvent, `[data-bs-dismiss=\"${name}\"]`, function (event) {\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault()\n }\n\n if (isDisabled(this)) {\n return\n }\n\n const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`)\n const instance = component.getOrCreateInstance(target)\n\n // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method\n instance[method]()\n })\n}\n\nexport {\n enableDismissTrigger\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'alert'\nconst DATA_KEY = 'bs.alert'\nconst EVENT_KEY = `.${DATA_KEY}`\n\nconst EVENT_CLOSE = `close${EVENT_KEY}`\nconst EVENT_CLOSED = `closed${EVENT_KEY}`\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\n\n/**\n * Class definition\n */\n\nclass Alert extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME\n }\n\n // Public\n close() {\n const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE)\n\n if (closeEvent.defaultPrevented) {\n return\n }\n\n this._element.classList.remove(CLASS_NAME_SHOW)\n\n const isAnimated = this._element.classList.contains(CLASS_NAME_FADE)\n this._queueCallback(() => this._destroyElement(), this._element, isAnimated)\n }\n\n // Private\n _destroyElement() {\n this._element.remove()\n EventHandler.trigger(this._element, EVENT_CLOSED)\n this.dispose()\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Alert.getOrCreateInstance(this)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config](this)\n })\n }\n}\n\n/**\n * Data API implementation\n */\n\nenableDismissTrigger(Alert, 'close')\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Alert)\n\nexport default Alert\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'button'\nconst DATA_KEY = 'bs.button'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst CLASS_NAME_ACTIVE = 'active'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"button\"]'\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\n/**\n * Class definition\n */\n\nclass Button extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME\n }\n\n // Public\n toggle() {\n // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method\n this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE))\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Button.getOrCreateInstance(this)\n\n if (config === 'toggle') {\n data[config]()\n }\n })\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {\n event.preventDefault()\n\n const button = event.target.closest(SELECTOR_DATA_TOGGLE)\n const data = Button.getOrCreateInstance(button)\n\n data.toggle()\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Button)\n\nexport default Button\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap util/swipe.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport Config from './config.js'\nimport { execute } from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'swipe'\nconst EVENT_KEY = '.bs.swipe'\nconst EVENT_TOUCHSTART = `touchstart${EVENT_KEY}`\nconst EVENT_TOUCHMOVE = `touchmove${EVENT_KEY}`\nconst EVENT_TOUCHEND = `touchend${EVENT_KEY}`\nconst EVENT_POINTERDOWN = `pointerdown${EVENT_KEY}`\nconst EVENT_POINTERUP = `pointerup${EVENT_KEY}`\nconst POINTER_TYPE_TOUCH = 'touch'\nconst POINTER_TYPE_PEN = 'pen'\nconst CLASS_NAME_POINTER_EVENT = 'pointer-event'\nconst SWIPE_THRESHOLD = 40\n\nconst Default = {\n endCallback: null,\n leftCallback: null,\n rightCallback: null\n}\n\nconst DefaultType = {\n endCallback: '(function|null)',\n leftCallback: '(function|null)',\n rightCallback: '(function|null)'\n}\n\n/**\n * Class definition\n */\n\nclass Swipe extends Config {\n constructor(element, config) {\n super()\n this._element = element\n\n if (!element || !Swipe.isSupported()) {\n return\n }\n\n this._config = this._getConfig(config)\n this._deltaX = 0\n this._supportPointerEvents = Boolean(window.PointerEvent)\n this._initEvents()\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n dispose() {\n EventHandler.off(this._element, EVENT_KEY)\n }\n\n // Private\n _start(event) {\n if (!this._supportPointerEvents) {\n this._deltaX = event.touches[0].clientX\n\n return\n }\n\n if (this._eventIsPointerPenTouch(event)) {\n this._deltaX = event.clientX\n }\n }\n\n _end(event) {\n if (this._eventIsPointerPenTouch(event)) {\n this._deltaX = event.clientX - this._deltaX\n }\n\n this._handleSwipe()\n execute(this._config.endCallback)\n }\n\n _move(event) {\n this._deltaX = event.touches && event.touches.length > 1 ?\n 0 :\n event.touches[0].clientX - this._deltaX\n }\n\n _handleSwipe() {\n const absDeltaX = Math.abs(this._deltaX)\n\n if (absDeltaX <= SWIPE_THRESHOLD) {\n return\n }\n\n const direction = absDeltaX / this._deltaX\n\n this._deltaX = 0\n\n if (!direction) {\n return\n }\n\n execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback)\n }\n\n _initEvents() {\n if (this._supportPointerEvents) {\n EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event))\n EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event))\n\n this._element.classList.add(CLASS_NAME_POINTER_EVENT)\n } else {\n EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event))\n EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event))\n EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event))\n }\n }\n\n _eventIsPointerPenTouch(event) {\n return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)\n }\n\n // Static\n static isSupported() {\n return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0\n }\n}\n\nexport default Swipe\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n defineJQueryPlugin,\n getNextActiveElement,\n isRTL,\n isVisible,\n reflow,\n triggerTransitionEnd\n} from './util/index.js'\nimport Swipe from './util/swipe.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'carousel'\nconst DATA_KEY = 'bs.carousel'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst ARROW_LEFT_KEY = 'ArrowLeft'\nconst ARROW_RIGHT_KEY = 'ArrowRight'\nconst TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch\n\nconst ORDER_NEXT = 'next'\nconst ORDER_PREV = 'prev'\nconst DIRECTION_LEFT = 'left'\nconst DIRECTION_RIGHT = 'right'\n\nconst EVENT_SLIDE = `slide${EVENT_KEY}`\nconst EVENT_SLID = `slid${EVENT_KEY}`\nconst EVENT_KEYDOWN = `keydown${EVENT_KEY}`\nconst EVENT_MOUSEENTER = `mouseenter${EVENT_KEY}`\nconst EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY}`\nconst EVENT_DRAG_START = `dragstart${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_CAROUSEL = 'carousel'\nconst CLASS_NAME_ACTIVE = 'active'\nconst CLASS_NAME_SLIDE = 'slide'\nconst CLASS_NAME_END = 'carousel-item-end'\nconst CLASS_NAME_START = 'carousel-item-start'\nconst CLASS_NAME_NEXT = 'carousel-item-next'\nconst CLASS_NAME_PREV = 'carousel-item-prev'\n\nconst SELECTOR_ACTIVE = '.active'\nconst SELECTOR_ITEM = '.carousel-item'\nconst SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM\nconst SELECTOR_ITEM_IMG = '.carousel-item img'\nconst SELECTOR_INDICATORS = '.carousel-indicators'\nconst SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'\nconst SELECTOR_DATA_RIDE = '[data-bs-ride=\"carousel\"]'\n\nconst KEY_TO_DIRECTION = {\n [ARROW_LEFT_KEY]: DIRECTION_RIGHT,\n [ARROW_RIGHT_KEY]: DIRECTION_LEFT\n}\n\nconst Default = {\n interval: 5000,\n keyboard: true,\n pause: 'hover',\n ride: false,\n touch: true,\n wrap: true\n}\n\nconst DefaultType = {\n interval: '(number|boolean)', // TODO:v6 remove boolean support\n keyboard: 'boolean',\n pause: '(string|boolean)',\n ride: '(boolean|string)',\n touch: 'boolean',\n wrap: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Carousel extends BaseComponent {\n constructor(element, config) {\n super(element, config)\n\n this._interval = null\n this._activeElement = null\n this._isSliding = false\n this.touchTimeout = null\n this._swipeHelper = null\n\n this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element)\n this._addEventListeners()\n\n if (this._config.ride === CLASS_NAME_CAROUSEL) {\n this.cycle()\n }\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n next() {\n this._slide(ORDER_NEXT)\n }\n\n nextWhenVisible() {\n // FIXME TODO use `document.visibilityState`\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden && isVisible(this._element)) {\n this.next()\n }\n }\n\n prev() {\n this._slide(ORDER_PREV)\n }\n\n pause() {\n if (this._isSliding) {\n triggerTransitionEnd(this._element)\n }\n\n this._clearInterval()\n }\n\n cycle() {\n this._clearInterval()\n this._updateInterval()\n\n this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval)\n }\n\n _maybeEnableCycle() {\n if (!this._config.ride) {\n return\n }\n\n if (this._isSliding) {\n EventHandler.one(this._element, EVENT_SLID, () => this.cycle())\n return\n }\n\n this.cycle()\n }\n\n to(index) {\n const items = this._getItems()\n if (index > items.length - 1 || index < 0) {\n return\n }\n\n if (this._isSliding) {\n EventHandler.one(this._element, EVENT_SLID, () => this.to(index))\n return\n }\n\n const activeIndex = this._getItemIndex(this._getActive())\n if (activeIndex === index) {\n return\n }\n\n const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV\n\n this._slide(order, items[index])\n }\n\n dispose() {\n if (this._swipeHelper) {\n this._swipeHelper.dispose()\n }\n\n super.dispose()\n }\n\n // Private\n _configAfterMerge(config) {\n config.defaultInterval = config.interval\n return config\n }\n\n _addEventListeners() {\n if (this._config.keyboard) {\n EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event))\n }\n\n if (this._config.pause === 'hover') {\n EventHandler.on(this._element, EVENT_MOUSEENTER, () => this.pause())\n EventHandler.on(this._element, EVENT_MOUSELEAVE, () => this._maybeEnableCycle())\n }\n\n if (this._config.touch && Swipe.isSupported()) {\n this._addTouchEventListeners()\n }\n }\n\n _addTouchEventListeners() {\n for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) {\n EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault())\n }\n\n const endCallBack = () => {\n if (this._config.pause !== 'hover') {\n return\n }\n\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n\n this.pause()\n if (this.touchTimeout) {\n clearTimeout(this.touchTimeout)\n }\n\n this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval)\n }\n\n const swipeConfig = {\n leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)),\n rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)),\n endCallback: endCallBack\n }\n\n this._swipeHelper = new Swipe(this._element, swipeConfig)\n }\n\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n const direction = KEY_TO_DIRECTION[event.key]\n if (direction) {\n event.preventDefault()\n this._slide(this._directionToOrder(direction))\n }\n }\n\n _getItemIndex(element) {\n return this._getItems().indexOf(element)\n }\n\n _setActiveIndicatorElement(index) {\n if (!this._indicatorsElement) {\n return\n }\n\n const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement)\n\n activeIndicator.classList.remove(CLASS_NAME_ACTIVE)\n activeIndicator.removeAttribute('aria-current')\n\n const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to=\"${index}\"]`, this._indicatorsElement)\n\n if (newActiveIndicator) {\n newActiveIndicator.classList.add(CLASS_NAME_ACTIVE)\n newActiveIndicator.setAttribute('aria-current', 'true')\n }\n }\n\n _updateInterval() {\n const element = this._activeElement || this._getActive()\n\n if (!element) {\n return\n }\n\n const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10)\n\n this._config.interval = elementInterval || this._config.defaultInterval\n }\n\n _slide(order, element = null) {\n if (this._isSliding) {\n return\n }\n\n const activeElement = this._getActive()\n const isNext = order === ORDER_NEXT\n const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap)\n\n if (nextElement === activeElement) {\n return\n }\n\n const nextElementIndex = this._getItemIndex(nextElement)\n\n const triggerEvent = eventName => {\n return EventHandler.trigger(this._element, eventName, {\n relatedTarget: nextElement,\n direction: this._orderToDirection(order),\n from: this._getItemIndex(activeElement),\n to: nextElementIndex\n })\n }\n\n const slideEvent = triggerEvent(EVENT_SLIDE)\n\n if (slideEvent.defaultPrevented) {\n return\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n // TODO: change tests that use empty divs to avoid this check\n return\n }\n\n const isCycling = Boolean(this._interval)\n this.pause()\n\n this._isSliding = true\n\n this._setActiveIndicatorElement(nextElementIndex)\n this._activeElement = nextElement\n\n const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END\n const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV\n\n nextElement.classList.add(orderClassName)\n\n reflow(nextElement)\n\n activeElement.classList.add(directionalClassName)\n nextElement.classList.add(directionalClassName)\n\n const completeCallBack = () => {\n nextElement.classList.remove(directionalClassName, orderClassName)\n nextElement.classList.add(CLASS_NAME_ACTIVE)\n\n activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName)\n\n this._isSliding = false\n\n triggerEvent(EVENT_SLID)\n }\n\n this._queueCallback(completeCallBack, activeElement, this._isAnimated())\n\n if (isCycling) {\n this.cycle()\n }\n }\n\n _isAnimated() {\n return this._element.classList.contains(CLASS_NAME_SLIDE)\n }\n\n _getActive() {\n return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)\n }\n\n _getItems() {\n return SelectorEngine.find(SELECTOR_ITEM, this._element)\n }\n\n _clearInterval() {\n if (this._interval) {\n clearInterval(this._interval)\n this._interval = null\n }\n }\n\n _directionToOrder(direction) {\n if (isRTL()) {\n return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT\n }\n\n return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV\n }\n\n _orderToDirection(order) {\n if (isRTL()) {\n return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT\n }\n\n return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Carousel.getOrCreateInstance(this, config)\n\n if (typeof config === 'number') {\n data.to(config)\n return\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n }\n })\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, function (event) {\n const target = SelectorEngine.getElementFromSelector(this)\n\n if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {\n return\n }\n\n event.preventDefault()\n\n const carousel = Carousel.getOrCreateInstance(target)\n const slideIndex = this.getAttribute('data-bs-slide-to')\n\n if (slideIndex) {\n carousel.to(slideIndex)\n carousel._maybeEnableCycle()\n return\n }\n\n if (Manipulator.getDataAttribute(this, 'slide') === 'next') {\n carousel.next()\n carousel._maybeEnableCycle()\n return\n }\n\n carousel.prev()\n carousel._maybeEnableCycle()\n})\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE)\n\n for (const carousel of carousels) {\n Carousel.getOrCreateInstance(carousel)\n }\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Carousel)\n\nexport default Carousel\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n defineJQueryPlugin,\n getElement,\n reflow\n} from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'collapse'\nconst DATA_KEY = 'bs.collapse'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_COLLAPSE = 'collapse'\nconst CLASS_NAME_COLLAPSING = 'collapsing'\nconst CLASS_NAME_COLLAPSED = 'collapsed'\nconst CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`\nconst CLASS_NAME_HORIZONTAL = 'collapse-horizontal'\n\nconst WIDTH = 'width'\nconst HEIGHT = 'height'\n\nconst SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"collapse\"]'\n\nconst Default = {\n parent: null,\n toggle: true\n}\n\nconst DefaultType = {\n parent: '(null|element)',\n toggle: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Collapse extends BaseComponent {\n constructor(element, config) {\n super(element, config)\n\n this._isTransitioning = false\n this._triggerArray = []\n\n const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE)\n\n for (const elem of toggleList) {\n const selector = SelectorEngine.getSelectorFromElement(elem)\n const filterElement = SelectorEngine.find(selector)\n .filter(foundElement => foundElement === this._element)\n\n if (selector !== null && filterElement.length) {\n this._triggerArray.push(elem)\n }\n }\n\n this._initializeChildren()\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._triggerArray, this._isShown())\n }\n\n if (this._config.toggle) {\n this.toggle()\n }\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n toggle() {\n if (this._isShown()) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n show() {\n if (this._isTransitioning || this._isShown()) {\n return\n }\n\n let activeChildren = []\n\n // find active children\n if (this._config.parent) {\n activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES)\n .filter(element => element !== this._element)\n .map(element => Collapse.getOrCreateInstance(element, { toggle: false }))\n }\n\n if (activeChildren.length && activeChildren[0]._isTransitioning) {\n return\n }\n\n const startEvent = EventHandler.trigger(this._element, EVENT_SHOW)\n if (startEvent.defaultPrevented) {\n return\n }\n\n for (const activeInstance of activeChildren) {\n activeInstance.hide()\n }\n\n const dimension = this._getDimension()\n\n this._element.classList.remove(CLASS_NAME_COLLAPSE)\n this._element.classList.add(CLASS_NAME_COLLAPSING)\n\n this._element.style[dimension] = 0\n\n this._addAriaAndCollapsedClass(this._triggerArray, true)\n this._isTransitioning = true\n\n const complete = () => {\n this._isTransitioning = false\n\n this._element.classList.remove(CLASS_NAME_COLLAPSING)\n this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)\n\n this._element.style[dimension] = ''\n\n EventHandler.trigger(this._element, EVENT_SHOWN)\n }\n\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n const scrollSize = `scroll${capitalizedDimension}`\n\n this._queueCallback(complete, this._element, true)\n this._element.style[dimension] = `${this._element[scrollSize]}px`\n }\n\n hide() {\n if (this._isTransitioning || !this._isShown()) {\n return\n }\n\n const startEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n if (startEvent.defaultPrevented) {\n return\n }\n\n const dimension = this._getDimension()\n\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`\n\n reflow(this._element)\n\n this._element.classList.add(CLASS_NAME_COLLAPSING)\n this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)\n\n for (const trigger of this._triggerArray) {\n const element = SelectorEngine.getElementFromSelector(trigger)\n\n if (element && !this._isShown(element)) {\n this._addAriaAndCollapsedClass([trigger], false)\n }\n }\n\n this._isTransitioning = true\n\n const complete = () => {\n this._isTransitioning = false\n this._element.classList.remove(CLASS_NAME_COLLAPSING)\n this._element.classList.add(CLASS_NAME_COLLAPSE)\n EventHandler.trigger(this._element, EVENT_HIDDEN)\n }\n\n this._element.style[dimension] = ''\n\n this._queueCallback(complete, this._element, true)\n }\n\n _isShown(element = this._element) {\n return element.classList.contains(CLASS_NAME_SHOW)\n }\n\n // Private\n _configAfterMerge(config) {\n config.toggle = Boolean(config.toggle) // Coerce string values\n config.parent = getElement(config.parent)\n return config\n }\n\n _getDimension() {\n return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT\n }\n\n _initializeChildren() {\n if (!this._config.parent) {\n return\n }\n\n const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE)\n\n for (const element of children) {\n const selected = SelectorEngine.getElementFromSelector(element)\n\n if (selected) {\n this._addAriaAndCollapsedClass([element], this._isShown(selected))\n }\n }\n }\n\n _getFirstLevelChildren(selector) {\n const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent)\n // remove children if greater depth\n return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element))\n }\n\n _addAriaAndCollapsedClass(triggerArray, isOpen) {\n if (!triggerArray.length) {\n return\n }\n\n for (const element of triggerArray) {\n element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen)\n element.setAttribute('aria-expanded', isOpen)\n }\n }\n\n // Static\n static jQueryInterface(config) {\n const _config = {}\n if (typeof config === 'string' && /show|hide/.test(config)) {\n _config.toggle = false\n }\n\n return this.each(function () {\n const data = Collapse.getOrCreateInstance(this, _config)\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n }\n })\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n // preventDefault only for elements (which change the URL) not inside the collapsible element\n if (event.target.tagName === 'A' || (event.delegateTarget && event.delegateTarget.tagName === 'A')) {\n event.preventDefault()\n }\n\n for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) {\n Collapse.getOrCreateInstance(element, { toggle: false }).toggle()\n }\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Collapse)\n\nexport default Collapse\n","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}","import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}","import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n var x = _ref.x,\n y = _ref.y;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }, getWindow(popper)) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n });\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref) {\n var name = _ref.name,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n effect = _ref.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","/**\n * --------------------------------------------------------------------------\n * Bootstrap dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport * as Popper from '@popperjs/core'\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n defineJQueryPlugin,\n execute,\n getElement,\n getNextActiveElement,\n isDisabled,\n isElement,\n isRTL,\n isVisible,\n noop\n} from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'dropdown'\nconst DATA_KEY = 'bs.dropdown'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst ESCAPE_KEY = 'Escape'\nconst TAB_KEY = 'Tab'\nconst ARROW_UP_KEY = 'ArrowUp'\nconst ARROW_DOWN_KEY = 'ArrowDown'\nconst RIGHT_MOUSE_BUTTON = 2 // MouseEvent.button value for the secondary button, usually the right button\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_DROPUP = 'dropup'\nconst CLASS_NAME_DROPEND = 'dropend'\nconst CLASS_NAME_DROPSTART = 'dropstart'\nconst CLASS_NAME_DROPUP_CENTER = 'dropup-center'\nconst CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center'\n\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"dropdown\"]:not(.disabled):not(:disabled)'\nconst SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE}.${CLASS_NAME_SHOW}`\nconst SELECTOR_MENU = '.dropdown-menu'\nconst SELECTOR_NAVBAR = '.navbar'\nconst SELECTOR_NAVBAR_NAV = '.navbar-nav'\nconst SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n\nconst PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'\nconst PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'\nconst PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'\nconst PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'\nconst PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'\nconst PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'\nconst PLACEMENT_TOPCENTER = 'top'\nconst PLACEMENT_BOTTOMCENTER = 'bottom'\n\nconst Default = {\n autoClose: true,\n boundary: 'clippingParents',\n display: 'dynamic',\n offset: [0, 2],\n popperConfig: null,\n reference: 'toggle'\n}\n\nconst DefaultType = {\n autoClose: '(boolean|string)',\n boundary: '(string|element)',\n display: 'string',\n offset: '(array|string|function)',\n popperConfig: '(null|object|function)',\n reference: '(string|element|object)'\n}\n\n/**\n * Class definition\n */\n\nclass Dropdown extends BaseComponent {\n constructor(element, config) {\n super(element, config)\n\n this._popper = null\n this._parent = this._element.parentNode // dropdown wrapper\n // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] ||\n SelectorEngine.prev(this._element, SELECTOR_MENU)[0] ||\n SelectorEngine.findOne(SELECTOR_MENU, this._parent)\n this._inNavbar = this._detectNavbar()\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n toggle() {\n return this._isShown() ? this.hide() : this.show()\n }\n\n show() {\n if (isDisabled(this._element) || this._isShown()) {\n return\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n }\n\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, relatedTarget)\n\n if (showEvent.defaultPrevented) {\n return\n }\n\n this._createPopper()\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.on(element, 'mouseover', noop)\n }\n }\n\n this._element.focus()\n this._element.setAttribute('aria-expanded', true)\n\n this._menu.classList.add(CLASS_NAME_SHOW)\n this._element.classList.add(CLASS_NAME_SHOW)\n EventHandler.trigger(this._element, EVENT_SHOWN, relatedTarget)\n }\n\n hide() {\n if (isDisabled(this._element) || !this._isShown()) {\n return\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n }\n\n this._completeHide(relatedTarget)\n }\n\n dispose() {\n if (this._popper) {\n this._popper.destroy()\n }\n\n super.dispose()\n }\n\n update() {\n this._inNavbar = this._detectNavbar()\n if (this._popper) {\n this._popper.update()\n }\n }\n\n // Private\n _completeHide(relatedTarget) {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE, relatedTarget)\n if (hideEvent.defaultPrevented) {\n return\n }\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.off(element, 'mouseover', noop)\n }\n }\n\n if (this._popper) {\n this._popper.destroy()\n }\n\n this._menu.classList.remove(CLASS_NAME_SHOW)\n this._element.classList.remove(CLASS_NAME_SHOW)\n this._element.setAttribute('aria-expanded', 'false')\n Manipulator.removeDataAttribute(this._menu, 'popper')\n EventHandler.trigger(this._element, EVENT_HIDDEN, relatedTarget)\n }\n\n _getConfig(config) {\n config = super._getConfig(config)\n\n if (typeof config.reference === 'object' && !isElement(config.reference) &&\n typeof config.reference.getBoundingClientRect !== 'function'\n ) {\n // Popper virtual elements require a getBoundingClientRect method\n throw new TypeError(`${NAME.toUpperCase()}: Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.`)\n }\n\n return config\n }\n\n _createPopper() {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s dropdowns require Popper (https://popper.js.org)')\n }\n\n let referenceElement = this._element\n\n if (this._config.reference === 'parent') {\n referenceElement = this._parent\n } else if (isElement(this._config.reference)) {\n referenceElement = getElement(this._config.reference)\n } else if (typeof this._config.reference === 'object') {\n referenceElement = this._config.reference\n }\n\n const popperConfig = this._getPopperConfig()\n this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig)\n }\n\n _isShown() {\n return this._menu.classList.contains(CLASS_NAME_SHOW)\n }\n\n _getPlacement() {\n const parentDropdown = this._parent\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {\n return PLACEMENT_RIGHT\n }\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {\n return PLACEMENT_LEFT\n }\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) {\n return PLACEMENT_TOPCENTER\n }\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) {\n return PLACEMENT_BOTTOMCENTER\n }\n\n // We need to trim the value because custom properties can also include spaces\n const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {\n return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP\n }\n\n return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM\n }\n\n _detectNavbar() {\n return this._element.closest(SELECTOR_NAVBAR) !== null\n }\n\n _getOffset() {\n const { offset } = this._config\n\n if (typeof offset === 'string') {\n return offset.split(',').map(value => Number.parseInt(value, 10))\n }\n\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element)\n }\n\n return offset\n }\n\n _getPopperConfig() {\n const defaultBsPopperConfig = {\n placement: this._getPlacement(),\n modifiers: [{\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n },\n {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n }]\n }\n\n // Disable Popper if we have a static display or Dropdown is in Navbar\n if (this._inNavbar || this._config.display === 'static') {\n Manipulator.setDataAttribute(this._menu, 'popper', 'static') // TODO: v6 remove\n defaultBsPopperConfig.modifiers = [{\n name: 'applyStyles',\n enabled: false\n }]\n }\n\n return {\n ...defaultBsPopperConfig,\n ...execute(this._config.popperConfig, [defaultBsPopperConfig])\n }\n }\n\n _selectMenuItem({ key, target }) {\n const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element))\n\n if (!items.length) {\n return\n }\n\n // if target isn't included in items (e.g. when expanding the dropdown)\n // allow cycling to get the last item in case key equals ARROW_UP_KEY\n getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus()\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Dropdown.getOrCreateInstance(this, config)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n })\n }\n\n static clearMenus(event) {\n if (event.button === RIGHT_MOUSE_BUTTON || (event.type === 'keyup' && event.key !== TAB_KEY)) {\n return\n }\n\n const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN)\n\n for (const toggle of openToggles) {\n const context = Dropdown.getInstance(toggle)\n if (!context || context._config.autoClose === false) {\n continue\n }\n\n const composedPath = event.composedPath()\n const isMenuTarget = composedPath.includes(context._menu)\n if (\n composedPath.includes(context._element) ||\n (context._config.autoClose === 'inside' && !isMenuTarget) ||\n (context._config.autoClose === 'outside' && isMenuTarget)\n ) {\n continue\n }\n\n // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu\n if (context._menu.contains(event.target) && ((event.type === 'keyup' && event.key === TAB_KEY) || /input|select|option|textarea|form/i.test(event.target.tagName))) {\n continue\n }\n\n const relatedTarget = { relatedTarget: context._element }\n\n if (event.type === 'click') {\n relatedTarget.clickEvent = event\n }\n\n context._completeHide(relatedTarget)\n }\n }\n\n static dataApiKeydownHandler(event) {\n // If not an UP | DOWN | ESCAPE key => not a dropdown command\n // If input/textarea && if key is other than ESCAPE => not a dropdown command\n\n const isInput = /input|textarea/i.test(event.target.tagName)\n const isEscapeEvent = event.key === ESCAPE_KEY\n const isUpOrDownEvent = [ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key)\n\n if (!isUpOrDownEvent && !isEscapeEvent) {\n return\n }\n\n if (isInput && !isEscapeEvent) {\n return\n }\n\n event.preventDefault()\n\n // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ?\n this :\n (SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0] ||\n SelectorEngine.next(this, SELECTOR_DATA_TOGGLE)[0] ||\n SelectorEngine.findOne(SELECTOR_DATA_TOGGLE, event.delegateTarget.parentNode))\n\n const instance = Dropdown.getOrCreateInstance(getToggleButton)\n\n if (isUpOrDownEvent) {\n event.stopPropagation()\n instance.show()\n instance._selectMenuItem(event)\n return\n }\n\n if (instance._isShown()) { // else is escape and we check if it is shown\n event.stopPropagation()\n instance.hide()\n getToggleButton.focus()\n }\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown.dataApiKeydownHandler)\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler)\nEventHandler.on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus)\nEventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus)\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n event.preventDefault()\n Dropdown.getOrCreateInstance(this).toggle()\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Dropdown)\n\nexport default Dropdown\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap util/backdrop.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport Config from './config.js'\nimport { execute, executeAfterTransition, getElement, reflow } from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'backdrop'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\nconst EVENT_MOUSEDOWN = `mousedown.bs.${NAME}`\n\nconst Default = {\n className: 'modal-backdrop',\n clickCallback: null,\n isAnimated: false,\n isVisible: true, // if false, we use the backdrop helper without adding any element to the dom\n rootElement: 'body' // give the choice to place backdrop under different elements\n}\n\nconst DefaultType = {\n className: 'string',\n clickCallback: '(function|null)',\n isAnimated: 'boolean',\n isVisible: 'boolean',\n rootElement: '(element|string)'\n}\n\n/**\n * Class definition\n */\n\nclass Backdrop extends Config {\n constructor(config) {\n super()\n this._config = this._getConfig(config)\n this._isAppended = false\n this._element = null\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n show(callback) {\n if (!this._config.isVisible) {\n execute(callback)\n return\n }\n\n this._append()\n\n const element = this._getElement()\n if (this._config.isAnimated) {\n reflow(element)\n }\n\n element.classList.add(CLASS_NAME_SHOW)\n\n this._emulateAnimation(() => {\n execute(callback)\n })\n }\n\n hide(callback) {\n if (!this._config.isVisible) {\n execute(callback)\n return\n }\n\n this._getElement().classList.remove(CLASS_NAME_SHOW)\n\n this._emulateAnimation(() => {\n this.dispose()\n execute(callback)\n })\n }\n\n dispose() {\n if (!this._isAppended) {\n return\n }\n\n EventHandler.off(this._element, EVENT_MOUSEDOWN)\n\n this._element.remove()\n this._isAppended = false\n }\n\n // Private\n _getElement() {\n if (!this._element) {\n const backdrop = document.createElement('div')\n backdrop.className = this._config.className\n if (this._config.isAnimated) {\n backdrop.classList.add(CLASS_NAME_FADE)\n }\n\n this._element = backdrop\n }\n\n return this._element\n }\n\n _configAfterMerge(config) {\n // use getElement() with the default \"body\" to get a fresh Element on each instantiation\n config.rootElement = getElement(config.rootElement)\n return config\n }\n\n _append() {\n if (this._isAppended) {\n return\n }\n\n const element = this._getElement()\n this._config.rootElement.append(element)\n\n EventHandler.on(element, EVENT_MOUSEDOWN, () => {\n execute(this._config.clickCallback)\n })\n\n this._isAppended = true\n }\n\n _emulateAnimation(callback) {\n executeAfterTransition(callback, this._getElement(), this._config.isAnimated)\n }\n}\n\nexport default Backdrop\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap util/focustrap.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport Config from './config.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'focustrap'\nconst DATA_KEY = 'bs.focustrap'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst EVENT_FOCUSIN = `focusin${EVENT_KEY}`\nconst EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY}`\n\nconst TAB_KEY = 'Tab'\nconst TAB_NAV_FORWARD = 'forward'\nconst TAB_NAV_BACKWARD = 'backward'\n\nconst Default = {\n autofocus: true,\n trapElement: null // The element to trap focus inside of\n}\n\nconst DefaultType = {\n autofocus: 'boolean',\n trapElement: 'element'\n}\n\n/**\n * Class definition\n */\n\nclass FocusTrap extends Config {\n constructor(config) {\n super()\n this._config = this._getConfig(config)\n this._isActive = false\n this._lastTabNavDirection = null\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n activate() {\n if (this._isActive) {\n return\n }\n\n if (this._config.autofocus) {\n this._config.trapElement.focus()\n }\n\n EventHandler.off(document, EVENT_KEY) // guard against infinite focus loop\n EventHandler.on(document, EVENT_FOCUSIN, event => this._handleFocusin(event))\n EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event))\n\n this._isActive = true\n }\n\n deactivate() {\n if (!this._isActive) {\n return\n }\n\n this._isActive = false\n EventHandler.off(document, EVENT_KEY)\n }\n\n // Private\n _handleFocusin(event) {\n const { trapElement } = this._config\n\n if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) {\n return\n }\n\n const elements = SelectorEngine.focusableChildren(trapElement)\n\n if (elements.length === 0) {\n trapElement.focus()\n } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {\n elements[elements.length - 1].focus()\n } else {\n elements[0].focus()\n }\n }\n\n _handleKeydown(event) {\n if (event.key !== TAB_KEY) {\n return\n }\n\n this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD\n }\n}\n\nexport default FocusTrap\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap util/scrollBar.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Manipulator from '../dom/manipulator.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport { isElement } from './index.js'\n\n/**\n * Constants\n */\n\nconst SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'\nconst SELECTOR_STICKY_CONTENT = '.sticky-top'\nconst PROPERTY_PADDING = 'padding-right'\nconst PROPERTY_MARGIN = 'margin-right'\n\n/**\n * Class definition\n */\n\nclass ScrollBarHelper {\n constructor() {\n this._element = document.body\n }\n\n // Public\n getWidth() {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = document.documentElement.clientWidth\n return Math.abs(window.innerWidth - documentWidth)\n }\n\n hide() {\n const width = this.getWidth()\n this._disableOverFlow()\n // give padding to element to balance the hidden scrollbar width\n this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width)\n // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth\n this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width)\n this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width)\n }\n\n reset() {\n this._resetElementAttributes(this._element, 'overflow')\n this._resetElementAttributes(this._element, PROPERTY_PADDING)\n this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING)\n this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN)\n }\n\n isOverflowing() {\n return this.getWidth() > 0\n }\n\n // Private\n _disableOverFlow() {\n this._saveInitialAttribute(this._element, 'overflow')\n this._element.style.overflow = 'hidden'\n }\n\n _setElementAttributes(selector, styleProperty, callback) {\n const scrollbarWidth = this.getWidth()\n const manipulationCallBack = element => {\n if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {\n return\n }\n\n this._saveInitialAttribute(element, styleProperty)\n const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty)\n element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`)\n }\n\n this._applyManipulationCallback(selector, manipulationCallBack)\n }\n\n _saveInitialAttribute(element, styleProperty) {\n const actualValue = element.style.getPropertyValue(styleProperty)\n if (actualValue) {\n Manipulator.setDataAttribute(element, styleProperty, actualValue)\n }\n }\n\n _resetElementAttributes(selector, styleProperty) {\n const manipulationCallBack = element => {\n const value = Manipulator.getDataAttribute(element, styleProperty)\n // We only want to remove the property if the value is `null`; the value can also be zero\n if (value === null) {\n element.style.removeProperty(styleProperty)\n return\n }\n\n Manipulator.removeDataAttribute(element, styleProperty)\n element.style.setProperty(styleProperty, value)\n }\n\n this._applyManipulationCallback(selector, manipulationCallBack)\n }\n\n _applyManipulationCallback(selector, callBack) {\n if (isElement(selector)) {\n callBack(selector)\n return\n }\n\n for (const sel of SelectorEngine.find(selector, this._element)) {\n callBack(sel)\n }\n }\n}\n\nexport default ScrollBarHelper\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport Backdrop from './util/backdrop.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport FocusTrap from './util/focustrap.js'\nimport { defineJQueryPlugin, isRTL, isVisible, reflow } from './util/index.js'\nimport ScrollBarHelper from './util/scrollbar.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'modal'\nconst DATA_KEY = 'bs.modal'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst ESCAPE_KEY = 'Escape'\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_RESIZE = `resize${EVENT_KEY}`\nconst EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`\nconst EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_OPEN = 'modal-open'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_STATIC = 'modal-static'\n\nconst OPEN_SELECTOR = '.modal.show'\nconst SELECTOR_DIALOG = '.modal-dialog'\nconst SELECTOR_MODAL_BODY = '.modal-body'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"modal\"]'\n\nconst Default = {\n backdrop: true,\n focus: true,\n keyboard: true\n}\n\nconst DefaultType = {\n backdrop: '(boolean|string)',\n focus: 'boolean',\n keyboard: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Modal extends BaseComponent {\n constructor(element, config) {\n super(element, config)\n\n this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element)\n this._backdrop = this._initializeBackDrop()\n this._focustrap = this._initializeFocusTrap()\n this._isShown = false\n this._isTransitioning = false\n this._scrollBar = new ScrollBarHelper()\n\n this._addEventListeners()\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget)\n }\n\n show(relatedTarget) {\n if (this._isShown || this._isTransitioning) {\n return\n }\n\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {\n relatedTarget\n })\n\n if (showEvent.defaultPrevented) {\n return\n }\n\n this._isShown = true\n this._isTransitioning = true\n\n this._scrollBar.hide()\n\n document.body.classList.add(CLASS_NAME_OPEN)\n\n this._adjustDialog()\n\n this._backdrop.show(() => this._showElement(relatedTarget))\n }\n\n hide() {\n if (!this._isShown || this._isTransitioning) {\n return\n }\n\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n if (hideEvent.defaultPrevented) {\n return\n }\n\n this._isShown = false\n this._isTransitioning = true\n this._focustrap.deactivate()\n\n this._element.classList.remove(CLASS_NAME_SHOW)\n\n this._queueCallback(() => this._hideModal(), this._element, this._isAnimated())\n }\n\n dispose() {\n EventHandler.off(window, EVENT_KEY)\n EventHandler.off(this._dialog, EVENT_KEY)\n\n this._backdrop.dispose()\n this._focustrap.deactivate()\n\n super.dispose()\n }\n\n handleUpdate() {\n this._adjustDialog()\n }\n\n // Private\n _initializeBackDrop() {\n return new Backdrop({\n isVisible: Boolean(this._config.backdrop), // 'static' option will be translated to true, and booleans will keep their value,\n isAnimated: this._isAnimated()\n })\n }\n\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n })\n }\n\n _showElement(relatedTarget) {\n // try to append dynamic modal\n if (!document.body.contains(this._element)) {\n document.body.append(this._element)\n }\n\n this._element.style.display = 'block'\n this._element.removeAttribute('aria-hidden')\n this._element.setAttribute('aria-modal', true)\n this._element.setAttribute('role', 'dialog')\n this._element.scrollTop = 0\n\n const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog)\n if (modalBody) {\n modalBody.scrollTop = 0\n }\n\n reflow(this._element)\n\n this._element.classList.add(CLASS_NAME_SHOW)\n\n const transitionComplete = () => {\n if (this._config.focus) {\n this._focustrap.activate()\n }\n\n this._isTransitioning = false\n EventHandler.trigger(this._element, EVENT_SHOWN, {\n relatedTarget\n })\n }\n\n this._queueCallback(transitionComplete, this._dialog, this._isAnimated())\n }\n\n _addEventListeners() {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n if (event.key !== ESCAPE_KEY) {\n return\n }\n\n if (this._config.keyboard) {\n this.hide()\n return\n }\n\n this._triggerBackdropTransition()\n })\n\n EventHandler.on(window, EVENT_RESIZE, () => {\n if (this._isShown && !this._isTransitioning) {\n this._adjustDialog()\n }\n })\n\n EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {\n // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks\n EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => {\n if (this._element !== event.target || this._element !== event2.target) {\n return\n }\n\n if (this._config.backdrop === 'static') {\n this._triggerBackdropTransition()\n return\n }\n\n if (this._config.backdrop) {\n this.hide()\n }\n })\n })\n }\n\n _hideModal() {\n this._element.style.display = 'none'\n this._element.setAttribute('aria-hidden', true)\n this._element.removeAttribute('aria-modal')\n this._element.removeAttribute('role')\n this._isTransitioning = false\n\n this._backdrop.hide(() => {\n document.body.classList.remove(CLASS_NAME_OPEN)\n this._resetAdjustments()\n this._scrollBar.reset()\n EventHandler.trigger(this._element, EVENT_HIDDEN)\n })\n }\n\n _isAnimated() {\n return this._element.classList.contains(CLASS_NAME_FADE)\n }\n\n _triggerBackdropTransition() {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n if (hideEvent.defaultPrevented) {\n return\n }\n\n const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight\n const initialOverflowY = this._element.style.overflowY\n // return if the following background transition hasn't yet completed\n if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) {\n return\n }\n\n if (!isModalOverflowing) {\n this._element.style.overflowY = 'hidden'\n }\n\n this._element.classList.add(CLASS_NAME_STATIC)\n this._queueCallback(() => {\n this._element.classList.remove(CLASS_NAME_STATIC)\n this._queueCallback(() => {\n this._element.style.overflowY = initialOverflowY\n }, this._dialog)\n }, this._dialog)\n\n this._element.focus()\n }\n\n /**\n * The following methods are used to handle overflowing modals\n */\n\n _adjustDialog() {\n const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight\n const scrollbarWidth = this._scrollBar.getWidth()\n const isBodyOverflowing = scrollbarWidth > 0\n\n if (isBodyOverflowing && !isModalOverflowing) {\n const property = isRTL() ? 'paddingLeft' : 'paddingRight'\n this._element.style[property] = `${scrollbarWidth}px`\n }\n\n if (!isBodyOverflowing && isModalOverflowing) {\n const property = isRTL() ? 'paddingRight' : 'paddingLeft'\n this._element.style[property] = `${scrollbarWidth}px`\n }\n }\n\n _resetAdjustments() {\n this._element.style.paddingLeft = ''\n this._element.style.paddingRight = ''\n }\n\n // Static\n static jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n const data = Modal.getOrCreateInstance(this, config)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config](relatedTarget)\n })\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n const target = SelectorEngine.getElementFromSelector(this)\n\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault()\n }\n\n EventHandler.one(target, EVENT_SHOW, showEvent => {\n if (showEvent.defaultPrevented) {\n // only register focus restorer if modal will actually get shown\n return\n }\n\n EventHandler.one(target, EVENT_HIDDEN, () => {\n if (isVisible(this)) {\n this.focus()\n }\n })\n })\n\n // avoid conflict when clicking modal toggler while another one is open\n const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)\n if (alreadyOpen) {\n Modal.getInstance(alreadyOpen).hide()\n }\n\n const data = Modal.getOrCreateInstance(target)\n\n data.toggle(this)\n})\n\nenableDismissTrigger(Modal)\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Modal)\n\nexport default Modal\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap offcanvas.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport Backdrop from './util/backdrop.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport FocusTrap from './util/focustrap.js'\nimport {\n defineJQueryPlugin,\n isDisabled,\n isVisible\n} from './util/index.js'\nimport ScrollBarHelper from './util/scrollbar.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'offcanvas'\nconst DATA_KEY = 'bs.offcanvas'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\nconst ESCAPE_KEY = 'Escape'\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_SHOWING = 'showing'\nconst CLASS_NAME_HIDING = 'hiding'\nconst CLASS_NAME_BACKDROP = 'offcanvas-backdrop'\nconst OPEN_SELECTOR = '.offcanvas.show'\n\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_RESIZE = `resize${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`\n\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"offcanvas\"]'\n\nconst Default = {\n backdrop: true,\n keyboard: true,\n scroll: false\n}\n\nconst DefaultType = {\n backdrop: '(boolean|string)',\n keyboard: 'boolean',\n scroll: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Offcanvas extends BaseComponent {\n constructor(element, config) {\n super(element, config)\n\n this._isShown = false\n this._backdrop = this._initializeBackDrop()\n this._focustrap = this._initializeFocusTrap()\n this._addEventListeners()\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget)\n }\n\n show(relatedTarget) {\n if (this._isShown) {\n return\n }\n\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { relatedTarget })\n\n if (showEvent.defaultPrevented) {\n return\n }\n\n this._isShown = true\n this._backdrop.show()\n\n if (!this._config.scroll) {\n new ScrollBarHelper().hide()\n }\n\n this._element.setAttribute('aria-modal', true)\n this._element.setAttribute('role', 'dialog')\n this._element.classList.add(CLASS_NAME_SHOWING)\n\n const completeCallBack = () => {\n if (!this._config.scroll || this._config.backdrop) {\n this._focustrap.activate()\n }\n\n this._element.classList.add(CLASS_NAME_SHOW)\n this._element.classList.remove(CLASS_NAME_SHOWING)\n EventHandler.trigger(this._element, EVENT_SHOWN, { relatedTarget })\n }\n\n this._queueCallback(completeCallBack, this._element, true)\n }\n\n hide() {\n if (!this._isShown) {\n return\n }\n\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n if (hideEvent.defaultPrevented) {\n return\n }\n\n this._focustrap.deactivate()\n this._element.blur()\n this._isShown = false\n this._element.classList.add(CLASS_NAME_HIDING)\n this._backdrop.hide()\n\n const completeCallback = () => {\n this._element.classList.remove(CLASS_NAME_SHOW, CLASS_NAME_HIDING)\n this._element.removeAttribute('aria-modal')\n this._element.removeAttribute('role')\n\n if (!this._config.scroll) {\n new ScrollBarHelper().reset()\n }\n\n EventHandler.trigger(this._element, EVENT_HIDDEN)\n }\n\n this._queueCallback(completeCallback, this._element, true)\n }\n\n dispose() {\n this._backdrop.dispose()\n this._focustrap.deactivate()\n super.dispose()\n }\n\n // Private\n _initializeBackDrop() {\n const clickCallback = () => {\n if (this._config.backdrop === 'static') {\n EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n return\n }\n\n this.hide()\n }\n\n // 'static' option will be translated to true, and booleans will keep their value\n const isVisible = Boolean(this._config.backdrop)\n\n return new Backdrop({\n className: CLASS_NAME_BACKDROP,\n isVisible,\n isAnimated: true,\n rootElement: this._element.parentNode,\n clickCallback: isVisible ? clickCallback : null\n })\n }\n\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n })\n }\n\n _addEventListeners() {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n if (event.key !== ESCAPE_KEY) {\n return\n }\n\n if (this._config.keyboard) {\n this.hide()\n return\n }\n\n EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n })\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Offcanvas.getOrCreateInstance(this, config)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config](this)\n })\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n const target = SelectorEngine.getElementFromSelector(this)\n\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault()\n }\n\n if (isDisabled(this)) {\n return\n }\n\n EventHandler.one(target, EVENT_HIDDEN, () => {\n // focus on trigger when it is closed\n if (isVisible(this)) {\n this.focus()\n }\n })\n\n // avoid conflict when clicking a toggler of an offcanvas, while another is open\n const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)\n if (alreadyOpen && alreadyOpen !== target) {\n Offcanvas.getInstance(alreadyOpen).hide()\n }\n\n const data = Offcanvas.getOrCreateInstance(target)\n data.toggle(this)\n})\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n for (const selector of SelectorEngine.find(OPEN_SELECTOR)) {\n Offcanvas.getOrCreateInstance(selector).show()\n }\n})\n\nEventHandler.on(window, EVENT_RESIZE, () => {\n for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) {\n if (getComputedStyle(element).position !== 'fixed') {\n Offcanvas.getOrCreateInstance(element).hide()\n }\n }\n})\n\nenableDismissTrigger(Offcanvas)\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Offcanvas)\n\nexport default Offcanvas\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap util/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n// js-docs-start allow-list\nconst ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i\n\nexport const DefaultAllowlist = {\n // Global attributes allowed on any supplied element below.\n '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n a: ['target', 'href', 'title', 'rel'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n div: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n}\n// js-docs-end allow-list\n\nconst uriAttributes = new Set([\n 'background',\n 'cite',\n 'href',\n 'itemtype',\n 'longdesc',\n 'poster',\n 'src',\n 'xlink:href'\n])\n\n/**\n * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation\n * contexts.\n *\n * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38\n */\n// eslint-disable-next-line unicorn/better-regex\nconst SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i\n\nconst allowedAttribute = (attribute, allowedAttributeList) => {\n const attributeName = attribute.nodeName.toLowerCase()\n\n if (allowedAttributeList.includes(attributeName)) {\n if (uriAttributes.has(attributeName)) {\n return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue))\n }\n\n return true\n }\n\n // Check if a regular expression validates the attribute.\n return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp)\n .some(regex => regex.test(attributeName))\n}\n\nexport function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {\n if (!unsafeHtml.length) {\n return unsafeHtml\n }\n\n if (sanitizeFunction && typeof sanitizeFunction === 'function') {\n return sanitizeFunction(unsafeHtml)\n }\n\n const domParser = new window.DOMParser()\n const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html')\n const elements = [].concat(...createdDocument.body.querySelectorAll('*'))\n\n for (const element of elements) {\n const elementName = element.nodeName.toLowerCase()\n\n if (!Object.keys(allowList).includes(elementName)) {\n element.remove()\n continue\n }\n\n const attributeList = [].concat(...element.attributes)\n const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || [])\n\n for (const attribute of attributeList) {\n if (!allowedAttribute(attribute, allowedAttributes)) {\n element.removeAttribute(attribute.nodeName)\n }\n }\n }\n\n return createdDocument.body.innerHTML\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap util/template-factory.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport SelectorEngine from '../dom/selector-engine.js'\nimport Config from './config.js'\nimport { DefaultAllowlist, sanitizeHtml } from './sanitizer.js'\nimport { execute, getElement, isElement } from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'TemplateFactory'\n\nconst Default = {\n allowList: DefaultAllowlist,\n content: {}, // { selector : text , selector2 : text2 , }\n extraClass: '',\n html: false,\n sanitize: true,\n sanitizeFn: null,\n template: '
'\n}\n\nconst DefaultType = {\n allowList: 'object',\n content: 'object',\n extraClass: '(string|function)',\n html: 'boolean',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n template: 'string'\n}\n\nconst DefaultContentType = {\n entry: '(string|element|function|null)',\n selector: '(string|element)'\n}\n\n/**\n * Class definition\n */\n\nclass TemplateFactory extends Config {\n constructor(config) {\n super()\n this._config = this._getConfig(config)\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n getContent() {\n return Object.values(this._config.content)\n .map(config => this._resolvePossibleFunction(config))\n .filter(Boolean)\n }\n\n hasContent() {\n return this.getContent().length > 0\n }\n\n changeContent(content) {\n this._checkContent(content)\n this._config.content = { ...this._config.content, ...content }\n return this\n }\n\n toHtml() {\n const templateWrapper = document.createElement('div')\n templateWrapper.innerHTML = this._maybeSanitize(this._config.template)\n\n for (const [selector, text] of Object.entries(this._config.content)) {\n this._setContent(templateWrapper, text, selector)\n }\n\n const template = templateWrapper.children[0]\n const extraClass = this._resolvePossibleFunction(this._config.extraClass)\n\n if (extraClass) {\n template.classList.add(...extraClass.split(' '))\n }\n\n return template\n }\n\n // Private\n _typeCheckConfig(config) {\n super._typeCheckConfig(config)\n this._checkContent(config.content)\n }\n\n _checkContent(arg) {\n for (const [selector, content] of Object.entries(arg)) {\n super._typeCheckConfig({ selector, entry: content }, DefaultContentType)\n }\n }\n\n _setContent(template, content, selector) {\n const templateElement = SelectorEngine.findOne(selector, template)\n\n if (!templateElement) {\n return\n }\n\n content = this._resolvePossibleFunction(content)\n\n if (!content) {\n templateElement.remove()\n return\n }\n\n if (isElement(content)) {\n this._putElementInTemplate(getElement(content), templateElement)\n return\n }\n\n if (this._config.html) {\n templateElement.innerHTML = this._maybeSanitize(content)\n return\n }\n\n templateElement.textContent = content\n }\n\n _maybeSanitize(arg) {\n return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg\n }\n\n _resolvePossibleFunction(arg) {\n return execute(arg, [this])\n }\n\n _putElementInTemplate(element, templateElement) {\n if (this._config.html) {\n templateElement.innerHTML = ''\n templateElement.append(element)\n return\n }\n\n templateElement.textContent = element.textContent\n }\n}\n\nexport default TemplateFactory\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport * as Popper from '@popperjs/core'\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport { defineJQueryPlugin, execute, findShadowRoot, getElement, getUID, isRTL, noop } from './util/index.js'\nimport { DefaultAllowlist } from './util/sanitizer.js'\nimport TemplateFactory from './util/template-factory.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'tooltip'\nconst DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn'])\n\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_MODAL = 'modal'\nconst CLASS_NAME_SHOW = 'show'\n\nconst SELECTOR_TOOLTIP_INNER = '.tooltip-inner'\nconst SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`\n\nconst EVENT_MODAL_HIDE = 'hide.bs.modal'\n\nconst TRIGGER_HOVER = 'hover'\nconst TRIGGER_FOCUS = 'focus'\nconst TRIGGER_CLICK = 'click'\nconst TRIGGER_MANUAL = 'manual'\n\nconst EVENT_HIDE = 'hide'\nconst EVENT_HIDDEN = 'hidden'\nconst EVENT_SHOW = 'show'\nconst EVENT_SHOWN = 'shown'\nconst EVENT_INSERTED = 'inserted'\nconst EVENT_CLICK = 'click'\nconst EVENT_FOCUSIN = 'focusin'\nconst EVENT_FOCUSOUT = 'focusout'\nconst EVENT_MOUSEENTER = 'mouseenter'\nconst EVENT_MOUSELEAVE = 'mouseleave'\n\nconst AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: isRTL() ? 'left' : 'right',\n BOTTOM: 'bottom',\n LEFT: isRTL() ? 'right' : 'left'\n}\n\nconst Default = {\n allowList: DefaultAllowlist,\n animation: true,\n boundary: 'clippingParents',\n container: false,\n customClass: '',\n delay: 0,\n fallbackPlacements: ['top', 'right', 'bottom', 'left'],\n html: false,\n offset: [0, 6],\n placement: 'top',\n popperConfig: null,\n sanitize: true,\n sanitizeFn: null,\n selector: false,\n template: '
' +\n '
' +\n '
' +\n '
',\n title: '',\n trigger: 'hover focus'\n}\n\nconst DefaultType = {\n allowList: 'object',\n animation: 'boolean',\n boundary: '(string|element)',\n container: '(string|element|boolean)',\n customClass: '(string|function)',\n delay: '(number|object)',\n fallbackPlacements: 'array',\n html: 'boolean',\n offset: '(array|string|function)',\n placement: '(string|function)',\n popperConfig: '(null|object|function)',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n selector: '(string|boolean)',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string'\n}\n\n/**\n * Class definition\n */\n\nclass Tooltip extends BaseComponent {\n constructor(element, config) {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s tooltips require Popper (https://popper.js.org)')\n }\n\n super(element, config)\n\n // Private\n this._isEnabled = true\n this._timeout = 0\n this._isHovered = null\n this._activeTrigger = {}\n this._popper = null\n this._templateFactory = null\n this._newContent = null\n\n // Protected\n this.tip = null\n\n this._setListeners()\n\n if (!this._config.selector) {\n this._fixTitle()\n }\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n enable() {\n this._isEnabled = true\n }\n\n disable() {\n this._isEnabled = false\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled\n }\n\n toggle() {\n if (!this._isEnabled) {\n return\n }\n\n this._activeTrigger.click = !this._activeTrigger.click\n if (this._isShown()) {\n this._leave()\n return\n }\n\n this._enter()\n }\n\n dispose() {\n clearTimeout(this._timeout)\n\n EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)\n\n if (this._element.getAttribute('data-bs-original-title')) {\n this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'))\n }\n\n this._disposePopper()\n super.dispose()\n }\n\n show() {\n if (this._element.style.display === 'none') {\n throw new Error('Please use show on visible elements')\n }\n\n if (!(this._isWithContent() && this._isEnabled)) {\n return\n }\n\n const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW))\n const shadowRoot = findShadowRoot(this._element)\n const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element)\n\n if (showEvent.defaultPrevented || !isInTheDom) {\n return\n }\n\n // TODO: v6 remove this or make it optional\n this._disposePopper()\n\n const tip = this._getTipElement()\n\n this._element.setAttribute('aria-describedby', tip.getAttribute('id'))\n\n const { container } = this._config\n\n if (!this._element.ownerDocument.documentElement.contains(this.tip)) {\n container.append(tip)\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED))\n }\n\n this._popper = this._createPopper(tip)\n\n tip.classList.add(CLASS_NAME_SHOW)\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.on(element, 'mouseover', noop)\n }\n }\n\n const complete = () => {\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN))\n\n if (this._isHovered === false) {\n this._leave()\n }\n\n this._isHovered = false\n }\n\n this._queueCallback(complete, this.tip, this._isAnimated())\n }\n\n hide() {\n if (!this._isShown()) {\n return\n }\n\n const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE))\n if (hideEvent.defaultPrevented) {\n return\n }\n\n const tip = this._getTipElement()\n tip.classList.remove(CLASS_NAME_SHOW)\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.off(element, 'mouseover', noop)\n }\n }\n\n this._activeTrigger[TRIGGER_CLICK] = false\n this._activeTrigger[TRIGGER_FOCUS] = false\n this._activeTrigger[TRIGGER_HOVER] = false\n this._isHovered = null // it is a trick to support manual triggering\n\n const complete = () => {\n if (this._isWithActiveTrigger()) {\n return\n }\n\n if (!this._isHovered) {\n this._disposePopper()\n }\n\n this._element.removeAttribute('aria-describedby')\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN))\n }\n\n this._queueCallback(complete, this.tip, this._isAnimated())\n }\n\n update() {\n if (this._popper) {\n this._popper.update()\n }\n }\n\n // Protected\n _isWithContent() {\n return Boolean(this._getTitle())\n }\n\n _getTipElement() {\n if (!this.tip) {\n this.tip = this._createTipElement(this._newContent || this._getContentForTemplate())\n }\n\n return this.tip\n }\n\n _createTipElement(content) {\n const tip = this._getTemplateFactory(content).toHtml()\n\n // TODO: remove this check in v6\n if (!tip) {\n return null\n }\n\n tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)\n // TODO: v6 the following can be achieved with CSS only\n tip.classList.add(`bs-${this.constructor.NAME}-auto`)\n\n const tipId = getUID(this.constructor.NAME).toString()\n\n tip.setAttribute('id', tipId)\n\n if (this._isAnimated()) {\n tip.classList.add(CLASS_NAME_FADE)\n }\n\n return tip\n }\n\n setContent(content) {\n this._newContent = content\n if (this._isShown()) {\n this._disposePopper()\n this.show()\n }\n }\n\n _getTemplateFactory(content) {\n if (this._templateFactory) {\n this._templateFactory.changeContent(content)\n } else {\n this._templateFactory = new TemplateFactory({\n ...this._config,\n // the `content` var has to be after `this._config`\n // to override config.content in case of popover\n content,\n extraClass: this._resolvePossibleFunction(this._config.customClass)\n })\n }\n\n return this._templateFactory\n }\n\n _getContentForTemplate() {\n return {\n [SELECTOR_TOOLTIP_INNER]: this._getTitle()\n }\n }\n\n _getTitle() {\n return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title')\n }\n\n // Private\n _initializeOnDelegatedTarget(event) {\n return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig())\n }\n\n _isAnimated() {\n return this._config.animation || (this.tip && this.tip.classList.contains(CLASS_NAME_FADE))\n }\n\n _isShown() {\n return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW)\n }\n\n _createPopper(tip) {\n const placement = execute(this._config.placement, [this, tip, this._element])\n const attachment = AttachmentMap[placement.toUpperCase()]\n return Popper.createPopper(this._element, tip, this._getPopperConfig(attachment))\n }\n\n _getOffset() {\n const { offset } = this._config\n\n if (typeof offset === 'string') {\n return offset.split(',').map(value => Number.parseInt(value, 10))\n }\n\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element)\n }\n\n return offset\n }\n\n _resolvePossibleFunction(arg) {\n return execute(arg, [this._element])\n }\n\n _getPopperConfig(attachment) {\n const defaultBsPopperConfig = {\n placement: attachment,\n modifiers: [\n {\n name: 'flip',\n options: {\n fallbackPlacements: this._config.fallbackPlacements\n }\n },\n {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n },\n {\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n },\n {\n name: 'arrow',\n options: {\n element: `.${this.constructor.NAME}-arrow`\n }\n },\n {\n name: 'preSetPlacement',\n enabled: true,\n phase: 'beforeMain',\n fn: data => {\n // Pre-set Popper's placement attribute in order to read the arrow sizes properly.\n // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement\n this._getTipElement().setAttribute('data-popper-placement', data.state.placement)\n }\n }\n ]\n }\n\n return {\n ...defaultBsPopperConfig,\n ...execute(this._config.popperConfig, [defaultBsPopperConfig])\n }\n }\n\n _setListeners() {\n const triggers = this._config.trigger.split(' ')\n\n for (const trigger of triggers) {\n if (trigger === 'click') {\n EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK), this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event)\n context.toggle()\n })\n } else if (trigger !== TRIGGER_MANUAL) {\n const eventIn = trigger === TRIGGER_HOVER ?\n this.constructor.eventName(EVENT_MOUSEENTER) :\n this.constructor.eventName(EVENT_FOCUSIN)\n const eventOut = trigger === TRIGGER_HOVER ?\n this.constructor.eventName(EVENT_MOUSELEAVE) :\n this.constructor.eventName(EVENT_FOCUSOUT)\n\n EventHandler.on(this._element, eventIn, this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event)\n context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true\n context._enter()\n })\n EventHandler.on(this._element, eventOut, this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event)\n context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] =\n context._element.contains(event.relatedTarget)\n\n context._leave()\n })\n }\n }\n\n this._hideModalHandler = () => {\n if (this._element) {\n this.hide()\n }\n }\n\n EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)\n }\n\n _fixTitle() {\n const title = this._element.getAttribute('title')\n\n if (!title) {\n return\n }\n\n if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {\n this._element.setAttribute('aria-label', title)\n }\n\n this._element.setAttribute('data-bs-original-title', title) // DO NOT USE IT. Is only for backwards compatibility\n this._element.removeAttribute('title')\n }\n\n _enter() {\n if (this._isShown() || this._isHovered) {\n this._isHovered = true\n return\n }\n\n this._isHovered = true\n\n this._setTimeout(() => {\n if (this._isHovered) {\n this.show()\n }\n }, this._config.delay.show)\n }\n\n _leave() {\n if (this._isWithActiveTrigger()) {\n return\n }\n\n this._isHovered = false\n\n this._setTimeout(() => {\n if (!this._isHovered) {\n this.hide()\n }\n }, this._config.delay.hide)\n }\n\n _setTimeout(handler, timeout) {\n clearTimeout(this._timeout)\n this._timeout = setTimeout(handler, timeout)\n }\n\n _isWithActiveTrigger() {\n return Object.values(this._activeTrigger).includes(true)\n }\n\n _getConfig(config) {\n const dataAttributes = Manipulator.getDataAttributes(this._element)\n\n for (const dataAttribute of Object.keys(dataAttributes)) {\n if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {\n delete dataAttributes[dataAttribute]\n }\n }\n\n config = {\n ...dataAttributes,\n ...(typeof config === 'object' && config ? config : {})\n }\n config = this._mergeConfigObj(config)\n config = this._configAfterMerge(config)\n this._typeCheckConfig(config)\n return config\n }\n\n _configAfterMerge(config) {\n config.container = config.container === false ? document.body : getElement(config.container)\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n }\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString()\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString()\n }\n\n return config\n }\n\n _getDelegateConfig() {\n const config = {}\n\n for (const [key, value] of Object.entries(this._config)) {\n if (this.constructor.Default[key] !== value) {\n config[key] = value\n }\n }\n\n config.selector = false\n config.trigger = 'manual'\n\n // In the future can be replaced with:\n // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])\n // `Object.fromEntries(keysWithDifferentValues)`\n return config\n }\n\n _disposePopper() {\n if (this._popper) {\n this._popper.destroy()\n this._popper = null\n }\n\n if (this.tip) {\n this.tip.remove()\n this.tip = null\n }\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Tooltip.getOrCreateInstance(this, config)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n })\n }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tooltip)\n\nexport default Tooltip\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Tooltip from './tooltip.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'popover'\n\nconst SELECTOR_TITLE = '.popover-header'\nconst SELECTOR_CONTENT = '.popover-body'\n\nconst Default = {\n ...Tooltip.Default,\n content: '',\n offset: [0, 8],\n placement: 'right',\n template: '
' +\n '
' +\n '

' +\n '
' +\n '
',\n trigger: 'click'\n}\n\nconst DefaultType = {\n ...Tooltip.DefaultType,\n content: '(null|string|element|function)'\n}\n\n/**\n * Class definition\n */\n\nclass Popover extends Tooltip {\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Overrides\n _isWithContent() {\n return this._getTitle() || this._getContent()\n }\n\n // Private\n _getContentForTemplate() {\n return {\n [SELECTOR_TITLE]: this._getTitle(),\n [SELECTOR_CONTENT]: this._getContent()\n }\n }\n\n _getContent() {\n return this._resolvePossibleFunction(this._config.content)\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Popover.getOrCreateInstance(this, config)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n })\n }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Popover)\n\nexport default Popover\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport { defineJQueryPlugin, getElement, isDisabled, isVisible } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'scrollspy'\nconst DATA_KEY = 'bs.scrollspy'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst EVENT_ACTIVATE = `activate${EVENT_KEY}`\nconst EVENT_CLICK = `click${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'\nconst CLASS_NAME_ACTIVE = 'active'\n\nconst SELECTOR_DATA_SPY = '[data-bs-spy=\"scroll\"]'\nconst SELECTOR_TARGET_LINKS = '[href]'\nconst SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'\nconst SELECTOR_NAV_LINKS = '.nav-link'\nconst SELECTOR_NAV_ITEMS = '.nav-item'\nconst SELECTOR_LIST_ITEMS = '.list-group-item'\nconst SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`\nconst SELECTOR_DROPDOWN = '.dropdown'\nconst SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'\n\nconst Default = {\n offset: null, // TODO: v6 @deprecated, keep it for backwards compatibility reasons\n rootMargin: '0px 0px -25%',\n smoothScroll: false,\n target: null,\n threshold: [0.1, 0.5, 1]\n}\n\nconst DefaultType = {\n offset: '(number|null)', // TODO v6 @deprecated, keep it for backwards compatibility reasons\n rootMargin: 'string',\n smoothScroll: 'boolean',\n target: 'element',\n threshold: 'array'\n}\n\n/**\n * Class definition\n */\n\nclass ScrollSpy extends BaseComponent {\n constructor(element, config) {\n super(element, config)\n\n // this._element is the observablesContainer and config.target the menu links wrapper\n this._targetLinks = new Map()\n this._observableSections = new Map()\n this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element\n this._activeTarget = null\n this._observer = null\n this._previousScrollData = {\n visibleEntryTop: 0,\n parentScrollTop: 0\n }\n this.refresh() // initialize\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n refresh() {\n this._initializeTargetsAndObservables()\n this._maybeEnableSmoothScroll()\n\n if (this._observer) {\n this._observer.disconnect()\n } else {\n this._observer = this._getNewObserver()\n }\n\n for (const section of this._observableSections.values()) {\n this._observer.observe(section)\n }\n }\n\n dispose() {\n this._observer.disconnect()\n super.dispose()\n }\n\n // Private\n _configAfterMerge(config) {\n // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case\n config.target = getElement(config.target) || document.body\n\n // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only\n config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin\n\n if (typeof config.threshold === 'string') {\n config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value))\n }\n\n return config\n }\n\n _maybeEnableSmoothScroll() {\n if (!this._config.smoothScroll) {\n return\n }\n\n // unregister any previous listeners\n EventHandler.off(this._config.target, EVENT_CLICK)\n\n EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => {\n const observableSection = this._observableSections.get(event.target.hash)\n if (observableSection) {\n event.preventDefault()\n const root = this._rootElement || window\n const height = observableSection.offsetTop - this._element.offsetTop\n if (root.scrollTo) {\n root.scrollTo({ top: height, behavior: 'smooth' })\n return\n }\n\n // Chrome 60 doesn't support `scrollTo`\n root.scrollTop = height\n }\n })\n }\n\n _getNewObserver() {\n const options = {\n root: this._rootElement,\n threshold: this._config.threshold,\n rootMargin: this._config.rootMargin\n }\n\n return new IntersectionObserver(entries => this._observerCallback(entries), options)\n }\n\n // The logic of selection\n _observerCallback(entries) {\n const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`)\n const activate = entry => {\n this._previousScrollData.visibleEntryTop = entry.target.offsetTop\n this._process(targetElement(entry))\n }\n\n const parentScrollTop = (this._rootElement || document.documentElement).scrollTop\n const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop\n this._previousScrollData.parentScrollTop = parentScrollTop\n\n for (const entry of entries) {\n if (!entry.isIntersecting) {\n this._activeTarget = null\n this._clearActiveClass(targetElement(entry))\n\n continue\n }\n\n const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop\n // if we are scrolling down, pick the bigger offsetTop\n if (userScrollsDown && entryIsLowerThanPrevious) {\n activate(entry)\n // if parent isn't scrolled, let's keep the first visible item, breaking the iteration\n if (!parentScrollTop) {\n return\n }\n\n continue\n }\n\n // if we are scrolling up, pick the smallest offsetTop\n if (!userScrollsDown && !entryIsLowerThanPrevious) {\n activate(entry)\n }\n }\n }\n\n _initializeTargetsAndObservables() {\n this._targetLinks = new Map()\n this._observableSections = new Map()\n\n const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target)\n\n for (const anchor of targetLinks) {\n // ensure that the anchor has an id and is not disabled\n if (!anchor.hash || isDisabled(anchor)) {\n continue\n }\n\n const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element)\n\n // ensure that the observableSection exists & is visible\n if (isVisible(observableSection)) {\n this._targetLinks.set(decodeURI(anchor.hash), anchor)\n this._observableSections.set(anchor.hash, observableSection)\n }\n }\n }\n\n _process(target) {\n if (this._activeTarget === target) {\n return\n }\n\n this._clearActiveClass(this._config.target)\n this._activeTarget = target\n target.classList.add(CLASS_NAME_ACTIVE)\n this._activateParents(target)\n\n EventHandler.trigger(this._element, EVENT_ACTIVATE, { relatedTarget: target })\n }\n\n _activateParents(target) {\n // Activate dropdown parents\n if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {\n SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE, target.closest(SELECTOR_DROPDOWN))\n .classList.add(CLASS_NAME_ACTIVE)\n return\n }\n\n for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) {\n // Set triggered links parents as active\n // With both
    and
')},createChildNavList:function(e){var t=this.createNavList();return e.append(t),t},generateNavEl:function(e,t){var n=a('
');n.attr("href","#"+e),n.text(t);var r=a("
  • ");return r.append(n),r},generateNavItem:function(e){var t=this.generateAnchor(e),n=a(e),r=n.data("toc-text")||n.text();return this.generateNavEl(t,r)},getTopLevel:function(e){for(var t=1;t<=6;t++){if(1 + + + + + + + + + + + + diff --git a/deps/font-awesome-6.5.2/css/all.css b/deps/font-awesome-6.5.2/css/all.css new file mode 100644 index 0000000..151dd57 --- /dev/null +++ b/deps/font-awesome-6.5.2/css/all.css @@ -0,0 +1,8028 @@ +/*! + * Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2024 Fonticons, Inc. + */ +.fa { + font-family: var(--fa-style-family, "Font Awesome 6 Free"); + font-weight: var(--fa-style, 900); } + +.fa, +.fa-classic, +.fa-sharp, +.fas, +.fa-solid, +.far, +.fa-regular, +.fab, +.fa-brands { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + display: var(--fa-display, inline-block); + font-style: normal; + font-variant: normal; + line-height: 1; + text-rendering: auto; } + +.fas, +.fa-classic, +.fa-solid, +.far, +.fa-regular { + font-family: 'Font Awesome 6 Free'; } + +.fab, +.fa-brands { + font-family: 'Font Awesome 6 Brands'; } + +.fa-1x { + font-size: 1em; } + +.fa-2x { + font-size: 2em; } + +.fa-3x { + font-size: 3em; } + +.fa-4x { + font-size: 4em; } + +.fa-5x { + font-size: 5em; } + +.fa-6x { + font-size: 6em; } + +.fa-7x { + font-size: 7em; } + +.fa-8x { + font-size: 8em; } + +.fa-9x { + font-size: 9em; } + +.fa-10x { + font-size: 10em; } + +.fa-2xs { + font-size: 0.625em; + line-height: 0.1em; + vertical-align: 0.225em; } + +.fa-xs { + font-size: 0.75em; + line-height: 0.08333em; + vertical-align: 0.125em; } + +.fa-sm { + font-size: 0.875em; + line-height: 0.07143em; + vertical-align: 0.05357em; } + +.fa-lg { + font-size: 1.25em; + line-height: 0.05em; + vertical-align: -0.075em; } + +.fa-xl { + font-size: 1.5em; + line-height: 0.04167em; + vertical-align: -0.125em; } + +.fa-2xl { + font-size: 2em; + line-height: 0.03125em; + vertical-align: -0.1875em; } + +.fa-fw { + text-align: center; + width: 1.25em; } + +.fa-ul { + list-style-type: none; + margin-left: var(--fa-li-margin, 2.5em); + padding-left: 0; } + .fa-ul > li { + position: relative; } + +.fa-li { + left: calc(var(--fa-li-width, 2em) * -1); + position: absolute; + text-align: center; + width: var(--fa-li-width, 2em); + line-height: inherit; } + +.fa-border { + border-color: var(--fa-border-color, #eee); + border-radius: var(--fa-border-radius, 0.1em); + border-style: var(--fa-border-style, solid); + border-width: var(--fa-border-width, 0.08em); + padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); } + +.fa-pull-left { + float: left; + margin-right: var(--fa-pull-margin, 0.3em); } + +.fa-pull-right { + float: right; + margin-left: var(--fa-pull-margin, 0.3em); } + +.fa-beat { + -webkit-animation-name: fa-beat; + animation-name: fa-beat; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out); + animation-timing-function: var(--fa-animation-timing, ease-in-out); } + +.fa-bounce { + -webkit-animation-name: fa-bounce; + animation-name: fa-bounce; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); } + +.fa-fade { + -webkit-animation-name: fa-fade; + animation-name: fa-fade; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); } + +.fa-beat-fade { + -webkit-animation-name: fa-beat-fade; + animation-name: fa-beat-fade; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); } + +.fa-flip { + -webkit-animation-name: fa-flip; + animation-name: fa-flip; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out); + animation-timing-function: var(--fa-animation-timing, ease-in-out); } + +.fa-shake { + -webkit-animation-name: fa-shake; + animation-name: fa-shake; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, linear); + animation-timing-function: var(--fa-animation-timing, linear); } + +.fa-spin { + -webkit-animation-name: fa-spin; + animation-name: fa-spin; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 2s); + animation-duration: var(--fa-animation-duration, 2s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, linear); + animation-timing-function: var(--fa-animation-timing, linear); } + +.fa-spin-reverse { + --fa-animation-direction: reverse; } + +.fa-pulse, +.fa-spin-pulse { + -webkit-animation-name: fa-spin; + animation-name: fa-spin; + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, steps(8)); + animation-timing-function: var(--fa-animation-timing, steps(8)); } + +@media (prefers-reduced-motion: reduce) { + .fa-beat, + .fa-bounce, + .fa-fade, + .fa-beat-fade, + .fa-flip, + .fa-pulse, + .fa-shake, + .fa-spin, + .fa-spin-pulse { + -webkit-animation-delay: -1ms; + animation-delay: -1ms; + -webkit-animation-duration: 1ms; + animation-duration: 1ms; + -webkit-animation-iteration-count: 1; + animation-iteration-count: 1; + -webkit-transition-delay: 0s; + transition-delay: 0s; + -webkit-transition-duration: 0s; + transition-duration: 0s; } } + +@-webkit-keyframes fa-beat { + 0%, 90% { + -webkit-transform: scale(1); + transform: scale(1); } + 45% { + -webkit-transform: scale(var(--fa-beat-scale, 1.25)); + transform: scale(var(--fa-beat-scale, 1.25)); } } + +@keyframes fa-beat { + 0%, 90% { + -webkit-transform: scale(1); + transform: scale(1); } + 45% { + -webkit-transform: scale(var(--fa-beat-scale, 1.25)); + transform: scale(var(--fa-beat-scale, 1.25)); } } + +@-webkit-keyframes fa-bounce { + 0% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); } + 10% { + -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); } + 30% { + -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); } + 50% { + -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); } + 57% { + -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); } + 64% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); } + 100% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); } } + +@keyframes fa-bounce { + 0% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); } + 10% { + -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); } + 30% { + -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); } + 50% { + -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); } + 57% { + -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); } + 64% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); } + 100% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); } } + +@-webkit-keyframes fa-fade { + 50% { + opacity: var(--fa-fade-opacity, 0.4); } } + +@keyframes fa-fade { + 50% { + opacity: var(--fa-fade-opacity, 0.4); } } + +@-webkit-keyframes fa-beat-fade { + 0%, 100% { + opacity: var(--fa-beat-fade-opacity, 0.4); + -webkit-transform: scale(1); + transform: scale(1); } + 50% { + opacity: 1; + -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125)); + transform: scale(var(--fa-beat-fade-scale, 1.125)); } } + +@keyframes fa-beat-fade { + 0%, 100% { + opacity: var(--fa-beat-fade-opacity, 0.4); + -webkit-transform: scale(1); + transform: scale(1); } + 50% { + opacity: 1; + -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125)); + transform: scale(var(--fa-beat-fade-scale, 1.125)); } } + +@-webkit-keyframes fa-flip { + 50% { + -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); } } + +@keyframes fa-flip { + 50% { + -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); } } + +@-webkit-keyframes fa-shake { + 0% { + -webkit-transform: rotate(-15deg); + transform: rotate(-15deg); } + 4% { + -webkit-transform: rotate(15deg); + transform: rotate(15deg); } + 8%, 24% { + -webkit-transform: rotate(-18deg); + transform: rotate(-18deg); } + 12%, 28% { + -webkit-transform: rotate(18deg); + transform: rotate(18deg); } + 16% { + -webkit-transform: rotate(-22deg); + transform: rotate(-22deg); } + 20% { + -webkit-transform: rotate(22deg); + transform: rotate(22deg); } + 32% { + -webkit-transform: rotate(-12deg); + transform: rotate(-12deg); } + 36% { + -webkit-transform: rotate(12deg); + transform: rotate(12deg); } + 40%, 100% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); } } + +@keyframes fa-shake { + 0% { + -webkit-transform: rotate(-15deg); + transform: rotate(-15deg); } + 4% { + -webkit-transform: rotate(15deg); + transform: rotate(15deg); } + 8%, 24% { + -webkit-transform: rotate(-18deg); + transform: rotate(-18deg); } + 12%, 28% { + -webkit-transform: rotate(18deg); + transform: rotate(18deg); } + 16% { + -webkit-transform: rotate(-22deg); + transform: rotate(-22deg); } + 20% { + -webkit-transform: rotate(22deg); + transform: rotate(22deg); } + 32% { + -webkit-transform: rotate(-12deg); + transform: rotate(-12deg); } + 36% { + -webkit-transform: rotate(12deg); + transform: rotate(12deg); } + 40%, 100% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); } } + +@-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); } } + +@keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); } } + +.fa-rotate-90 { + -webkit-transform: rotate(90deg); + transform: rotate(90deg); } + +.fa-rotate-180 { + -webkit-transform: rotate(180deg); + transform: rotate(180deg); } + +.fa-rotate-270 { + -webkit-transform: rotate(270deg); + transform: rotate(270deg); } + +.fa-flip-horizontal { + -webkit-transform: scale(-1, 1); + transform: scale(-1, 1); } + +.fa-flip-vertical { + -webkit-transform: scale(1, -1); + transform: scale(1, -1); } + +.fa-flip-both, +.fa-flip-horizontal.fa-flip-vertical { + -webkit-transform: scale(-1, -1); + transform: scale(-1, -1); } + +.fa-rotate-by { + -webkit-transform: rotate(var(--fa-rotate-angle, 0)); + transform: rotate(var(--fa-rotate-angle, 0)); } + +.fa-stack { + display: inline-block; + height: 2em; + line-height: 2em; + position: relative; + vertical-align: middle; + width: 2.5em; } + +.fa-stack-1x, +.fa-stack-2x { + left: 0; + position: absolute; + text-align: center; + width: 100%; + z-index: var(--fa-stack-z-index, auto); } + +.fa-stack-1x { + line-height: inherit; } + +.fa-stack-2x { + font-size: 2em; } + +.fa-inverse { + color: var(--fa-inverse, #fff); } + +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen +readers do not read off random characters that represent icons */ + +.fa-0::before { + content: "\30"; } + +.fa-1::before { + content: "\31"; } + +.fa-2::before { + content: "\32"; } + +.fa-3::before { + content: "\33"; } + +.fa-4::before { + content: "\34"; } + +.fa-5::before { + content: "\35"; } + +.fa-6::before { + content: "\36"; } + +.fa-7::before { + content: "\37"; } + +.fa-8::before { + content: "\38"; } + +.fa-9::before { + content: "\39"; } + +.fa-fill-drip::before { + content: "\f576"; } + +.fa-arrows-to-circle::before { + content: "\e4bd"; } + +.fa-circle-chevron-right::before { + content: "\f138"; } + +.fa-chevron-circle-right::before { + content: "\f138"; } + +.fa-at::before { + content: "\40"; } + +.fa-trash-can::before { + content: "\f2ed"; } + +.fa-trash-alt::before { + content: "\f2ed"; } + +.fa-text-height::before { + content: "\f034"; } + +.fa-user-xmark::before { + content: "\f235"; } + +.fa-user-times::before { + content: "\f235"; } + +.fa-stethoscope::before { + content: "\f0f1"; } + +.fa-message::before { + content: "\f27a"; } + +.fa-comment-alt::before { + content: "\f27a"; } + +.fa-info::before { + content: "\f129"; } + +.fa-down-left-and-up-right-to-center::before { + content: "\f422"; } + +.fa-compress-alt::before { + content: "\f422"; } + +.fa-explosion::before { + content: "\e4e9"; } + +.fa-file-lines::before { + content: "\f15c"; } + +.fa-file-alt::before { + content: "\f15c"; } + +.fa-file-text::before { + content: "\f15c"; } + +.fa-wave-square::before { + content: "\f83e"; } + +.fa-ring::before { + content: "\f70b"; } + +.fa-building-un::before { + content: "\e4d9"; } + +.fa-dice-three::before { + content: "\f527"; } + +.fa-calendar-days::before { + content: "\f073"; } + +.fa-calendar-alt::before { + content: "\f073"; } + +.fa-anchor-circle-check::before { + content: "\e4aa"; } + +.fa-building-circle-arrow-right::before { + content: "\e4d1"; } + +.fa-volleyball::before { + content: "\f45f"; } + +.fa-volleyball-ball::before { + content: "\f45f"; } + +.fa-arrows-up-to-line::before { + content: "\e4c2"; } + +.fa-sort-down::before { + content: "\f0dd"; } + +.fa-sort-desc::before { + content: "\f0dd"; } + +.fa-circle-minus::before { + content: "\f056"; } + +.fa-minus-circle::before { + content: "\f056"; } + +.fa-door-open::before { + content: "\f52b"; } + +.fa-right-from-bracket::before { + content: "\f2f5"; } + +.fa-sign-out-alt::before { + content: "\f2f5"; } + +.fa-atom::before { + content: "\f5d2"; } + +.fa-soap::before { + content: "\e06e"; } + +.fa-icons::before { + content: "\f86d"; } + +.fa-heart-music-camera-bolt::before { + content: "\f86d"; } + +.fa-microphone-lines-slash::before { + content: "\f539"; } + +.fa-microphone-alt-slash::before { + content: "\f539"; } + +.fa-bridge-circle-check::before { + content: "\e4c9"; } + +.fa-pump-medical::before { + content: "\e06a"; } + +.fa-fingerprint::before { + content: "\f577"; } + +.fa-hand-point-right::before { + content: "\f0a4"; } + +.fa-magnifying-glass-location::before { + content: "\f689"; } + +.fa-search-location::before { + content: "\f689"; } + +.fa-forward-step::before { + content: "\f051"; } + +.fa-step-forward::before { + content: "\f051"; } + +.fa-face-smile-beam::before { + content: "\f5b8"; } + +.fa-smile-beam::before { + content: "\f5b8"; } + +.fa-flag-checkered::before { + content: "\f11e"; } + +.fa-football::before { + content: "\f44e"; } + +.fa-football-ball::before { + content: "\f44e"; } + +.fa-school-circle-exclamation::before { + content: "\e56c"; } + +.fa-crop::before { + content: "\f125"; } + +.fa-angles-down::before { + content: "\f103"; } + +.fa-angle-double-down::before { + content: "\f103"; } + +.fa-users-rectangle::before { + content: "\e594"; } + +.fa-people-roof::before { + content: "\e537"; } + +.fa-people-line::before { + content: "\e534"; } + +.fa-beer-mug-empty::before { + content: "\f0fc"; } + +.fa-beer::before { + content: "\f0fc"; } + +.fa-diagram-predecessor::before { + content: "\e477"; } + +.fa-arrow-up-long::before { + content: "\f176"; } + +.fa-long-arrow-up::before { + content: "\f176"; } + +.fa-fire-flame-simple::before { + content: "\f46a"; } + +.fa-burn::before { + content: "\f46a"; } + +.fa-person::before { + content: "\f183"; } + +.fa-male::before { + content: "\f183"; } + +.fa-laptop::before { + content: "\f109"; } + +.fa-file-csv::before { + content: "\f6dd"; } + +.fa-menorah::before { + content: "\f676"; } + +.fa-truck-plane::before { + content: "\e58f"; } + +.fa-record-vinyl::before { + content: "\f8d9"; } + +.fa-face-grin-stars::before { + content: "\f587"; } + +.fa-grin-stars::before { + content: "\f587"; } + +.fa-bong::before { + content: "\f55c"; } + +.fa-spaghetti-monster-flying::before { + content: "\f67b"; } + +.fa-pastafarianism::before { + content: "\f67b"; } + +.fa-arrow-down-up-across-line::before { + content: "\e4af"; } + +.fa-spoon::before { + content: "\f2e5"; } + +.fa-utensil-spoon::before { + content: "\f2e5"; } + +.fa-jar-wheat::before { + content: "\e517"; } + +.fa-envelopes-bulk::before { + content: "\f674"; } + +.fa-mail-bulk::before { + content: "\f674"; } + +.fa-file-circle-exclamation::before { + content: "\e4eb"; } + +.fa-circle-h::before { + content: "\f47e"; } + +.fa-hospital-symbol::before { + content: "\f47e"; } + +.fa-pager::before { + content: "\f815"; } + +.fa-address-book::before { + content: "\f2b9"; } + +.fa-contact-book::before { + content: "\f2b9"; } + +.fa-strikethrough::before { + content: "\f0cc"; } + +.fa-k::before { + content: "\4b"; } + +.fa-landmark-flag::before { + content: "\e51c"; } + +.fa-pencil::before { + content: "\f303"; } + +.fa-pencil-alt::before { + content: "\f303"; } + +.fa-backward::before { + content: "\f04a"; } + +.fa-caret-right::before { + content: "\f0da"; } + +.fa-comments::before { + content: "\f086"; } + +.fa-paste::before { + content: "\f0ea"; } + +.fa-file-clipboard::before { + content: "\f0ea"; } + +.fa-code-pull-request::before { + content: "\e13c"; } + +.fa-clipboard-list::before { + content: "\f46d"; } + +.fa-truck-ramp-box::before { + content: "\f4de"; } + +.fa-truck-loading::before { + content: "\f4de"; } + +.fa-user-check::before { + content: "\f4fc"; } + +.fa-vial-virus::before { + content: "\e597"; } + +.fa-sheet-plastic::before { + content: "\e571"; } + +.fa-blog::before { + content: "\f781"; } + +.fa-user-ninja::before { + content: "\f504"; } + +.fa-person-arrow-up-from-line::before { + content: "\e539"; } + +.fa-scroll-torah::before { + content: "\f6a0"; } + +.fa-torah::before { + content: "\f6a0"; } + +.fa-broom-ball::before { + content: "\f458"; } + +.fa-quidditch::before { + content: "\f458"; } + +.fa-quidditch-broom-ball::before { + content: "\f458"; } + +.fa-toggle-off::before { + content: "\f204"; } + +.fa-box-archive::before { + content: "\f187"; } + +.fa-archive::before { + content: "\f187"; } + +.fa-person-drowning::before { + content: "\e545"; } + +.fa-arrow-down-9-1::before { + content: "\f886"; } + +.fa-sort-numeric-desc::before { + content: "\f886"; } + +.fa-sort-numeric-down-alt::before { + content: "\f886"; } + +.fa-face-grin-tongue-squint::before { + content: "\f58a"; } + +.fa-grin-tongue-squint::before { + content: "\f58a"; } + +.fa-spray-can::before { + content: "\f5bd"; } + +.fa-truck-monster::before { + content: "\f63b"; } + +.fa-w::before { + content: "\57"; } + +.fa-earth-africa::before { + content: "\f57c"; } + +.fa-globe-africa::before { + content: "\f57c"; } + +.fa-rainbow::before { + content: "\f75b"; } + +.fa-circle-notch::before { + content: "\f1ce"; } + +.fa-tablet-screen-button::before { + content: "\f3fa"; } + +.fa-tablet-alt::before { + content: "\f3fa"; } + +.fa-paw::before { + content: "\f1b0"; } + +.fa-cloud::before { + content: "\f0c2"; } + +.fa-trowel-bricks::before { + content: "\e58a"; } + +.fa-face-flushed::before { + content: "\f579"; } + +.fa-flushed::before { + content: "\f579"; } + +.fa-hospital-user::before { + content: "\f80d"; } + +.fa-tent-arrow-left-right::before { + content: "\e57f"; } + +.fa-gavel::before { + content: "\f0e3"; } + +.fa-legal::before { + content: "\f0e3"; } + +.fa-binoculars::before { + content: "\f1e5"; } + +.fa-microphone-slash::before { + content: "\f131"; } + +.fa-box-tissue::before { + content: "\e05b"; } + +.fa-motorcycle::before { + content: "\f21c"; } + +.fa-bell-concierge::before { + content: "\f562"; } + +.fa-concierge-bell::before { + content: "\f562"; } + +.fa-pen-ruler::before { + content: "\f5ae"; } + +.fa-pencil-ruler::before { + content: "\f5ae"; } + +.fa-people-arrows::before { + content: "\e068"; } + +.fa-people-arrows-left-right::before { + content: "\e068"; } + +.fa-mars-and-venus-burst::before { + content: "\e523"; } + +.fa-square-caret-right::before { + content: "\f152"; } + +.fa-caret-square-right::before { + content: "\f152"; } + +.fa-scissors::before { + content: "\f0c4"; } + +.fa-cut::before { + content: "\f0c4"; } + +.fa-sun-plant-wilt::before { + content: "\e57a"; } + +.fa-toilets-portable::before { + content: "\e584"; } + +.fa-hockey-puck::before { + content: "\f453"; } + +.fa-table::before { + content: "\f0ce"; } + +.fa-magnifying-glass-arrow-right::before { + content: "\e521"; } + +.fa-tachograph-digital::before { + content: "\f566"; } + +.fa-digital-tachograph::before { + content: "\f566"; } + +.fa-users-slash::before { + content: "\e073"; } + +.fa-clover::before { + content: "\e139"; } + +.fa-reply::before { + content: "\f3e5"; } + +.fa-mail-reply::before { + content: "\f3e5"; } + +.fa-star-and-crescent::before { + content: "\f699"; } + +.fa-house-fire::before { + content: "\e50c"; } + +.fa-square-minus::before { + content: "\f146"; } + +.fa-minus-square::before { + content: "\f146"; } + +.fa-helicopter::before { + content: "\f533"; } + +.fa-compass::before { + content: "\f14e"; } + +.fa-square-caret-down::before { + content: "\f150"; } + +.fa-caret-square-down::before { + content: "\f150"; } + +.fa-file-circle-question::before { + content: "\e4ef"; } + +.fa-laptop-code::before { + content: "\f5fc"; } + +.fa-swatchbook::before { + content: "\f5c3"; } + +.fa-prescription-bottle::before { + content: "\f485"; } + +.fa-bars::before { + content: "\f0c9"; } + +.fa-navicon::before { + content: "\f0c9"; } + +.fa-people-group::before { + content: "\e533"; } + +.fa-hourglass-end::before { + content: "\f253"; } + +.fa-hourglass-3::before { + content: "\f253"; } + +.fa-heart-crack::before { + content: "\f7a9"; } + +.fa-heart-broken::before { + content: "\f7a9"; } + +.fa-square-up-right::before { + content: "\f360"; } + +.fa-external-link-square-alt::before { + content: "\f360"; } + +.fa-face-kiss-beam::before { + content: "\f597"; } + +.fa-kiss-beam::before { + content: "\f597"; } + +.fa-film::before { + content: "\f008"; } + +.fa-ruler-horizontal::before { + content: "\f547"; } + +.fa-people-robbery::before { + content: "\e536"; } + +.fa-lightbulb::before { + content: "\f0eb"; } + +.fa-caret-left::before { + content: "\f0d9"; } + +.fa-circle-exclamation::before { + content: "\f06a"; } + +.fa-exclamation-circle::before { + content: "\f06a"; } + +.fa-school-circle-xmark::before { + content: "\e56d"; } + +.fa-arrow-right-from-bracket::before { + content: "\f08b"; } + +.fa-sign-out::before { + content: "\f08b"; } + +.fa-circle-chevron-down::before { + content: "\f13a"; } + +.fa-chevron-circle-down::before { + content: "\f13a"; } + +.fa-unlock-keyhole::before { + content: "\f13e"; } + +.fa-unlock-alt::before { + content: "\f13e"; } + +.fa-cloud-showers-heavy::before { + content: "\f740"; } + +.fa-headphones-simple::before { + content: "\f58f"; } + +.fa-headphones-alt::before { + content: "\f58f"; } + +.fa-sitemap::before { + content: "\f0e8"; } + +.fa-circle-dollar-to-slot::before { + content: "\f4b9"; } + +.fa-donate::before { + content: "\f4b9"; } + +.fa-memory::before { + content: "\f538"; } + +.fa-road-spikes::before { + content: "\e568"; } + +.fa-fire-burner::before { + content: "\e4f1"; } + +.fa-flag::before { + content: "\f024"; } + +.fa-hanukiah::before { + content: "\f6e6"; } + +.fa-feather::before { + content: "\f52d"; } + +.fa-volume-low::before { + content: "\f027"; } + +.fa-volume-down::before { + content: "\f027"; } + +.fa-comment-slash::before { + content: "\f4b3"; } + +.fa-cloud-sun-rain::before { + content: "\f743"; } + +.fa-compress::before { + content: "\f066"; } + +.fa-wheat-awn::before { + content: "\e2cd"; } + +.fa-wheat-alt::before { + content: "\e2cd"; } + +.fa-ankh::before { + content: "\f644"; } + +.fa-hands-holding-child::before { + content: "\e4fa"; } + +.fa-asterisk::before { + content: "\2a"; } + +.fa-square-check::before { + content: "\f14a"; } + +.fa-check-square::before { + content: "\f14a"; } + +.fa-peseta-sign::before { + content: "\e221"; } + +.fa-heading::before { + content: "\f1dc"; } + +.fa-header::before { + content: "\f1dc"; } + +.fa-ghost::before { + content: "\f6e2"; } + +.fa-list::before { + content: "\f03a"; } + +.fa-list-squares::before { + content: "\f03a"; } + +.fa-square-phone-flip::before { + content: "\f87b"; } + +.fa-phone-square-alt::before { + content: "\f87b"; } + +.fa-cart-plus::before { + content: "\f217"; } + +.fa-gamepad::before { + content: "\f11b"; } + +.fa-circle-dot::before { + content: "\f192"; } + +.fa-dot-circle::before { + content: "\f192"; } + +.fa-face-dizzy::before { + content: "\f567"; } + +.fa-dizzy::before { + content: "\f567"; } + +.fa-egg::before { + content: "\f7fb"; } + +.fa-house-medical-circle-xmark::before { + content: "\e513"; } + +.fa-campground::before { + content: "\f6bb"; } + +.fa-folder-plus::before { + content: "\f65e"; } + +.fa-futbol::before { + content: "\f1e3"; } + +.fa-futbol-ball::before { + content: "\f1e3"; } + +.fa-soccer-ball::before { + content: "\f1e3"; } + +.fa-paintbrush::before { + content: "\f1fc"; } + +.fa-paint-brush::before { + content: "\f1fc"; } + +.fa-lock::before { + content: "\f023"; } + +.fa-gas-pump::before { + content: "\f52f"; } + +.fa-hot-tub-person::before { + content: "\f593"; } + +.fa-hot-tub::before { + content: "\f593"; } + +.fa-map-location::before { + content: "\f59f"; } + +.fa-map-marked::before { + content: "\f59f"; } + +.fa-house-flood-water::before { + content: "\e50e"; } + +.fa-tree::before { + content: "\f1bb"; } + +.fa-bridge-lock::before { + content: "\e4cc"; } + +.fa-sack-dollar::before { + content: "\f81d"; } + +.fa-pen-to-square::before { + content: "\f044"; } + +.fa-edit::before { + content: "\f044"; } + +.fa-car-side::before { + content: "\f5e4"; } + +.fa-share-nodes::before { + content: "\f1e0"; } + +.fa-share-alt::before { + content: "\f1e0"; } + +.fa-heart-circle-minus::before { + content: "\e4ff"; } + +.fa-hourglass-half::before { + content: "\f252"; } + +.fa-hourglass-2::before { + content: "\f252"; } + +.fa-microscope::before { + content: "\f610"; } + +.fa-sink::before { + content: "\e06d"; } + +.fa-bag-shopping::before { + content: "\f290"; } + +.fa-shopping-bag::before { + content: "\f290"; } + +.fa-arrow-down-z-a::before { + content: "\f881"; } + +.fa-sort-alpha-desc::before { + content: "\f881"; } + +.fa-sort-alpha-down-alt::before { + content: "\f881"; } + +.fa-mitten::before { + content: "\f7b5"; } + +.fa-person-rays::before { + content: "\e54d"; } + +.fa-users::before { + content: "\f0c0"; } + +.fa-eye-slash::before { + content: "\f070"; } + +.fa-flask-vial::before { + content: "\e4f3"; } + +.fa-hand::before { + content: "\f256"; } + +.fa-hand-paper::before { + content: "\f256"; } + +.fa-om::before { + content: "\f679"; } + +.fa-worm::before { + content: "\e599"; } + +.fa-house-circle-xmark::before { + content: "\e50b"; } + +.fa-plug::before { + content: "\f1e6"; } + +.fa-chevron-up::before { + content: "\f077"; } + +.fa-hand-spock::before { + content: "\f259"; } + +.fa-stopwatch::before { + content: "\f2f2"; } + +.fa-face-kiss::before { + content: "\f596"; } + +.fa-kiss::before { + content: "\f596"; } + +.fa-bridge-circle-xmark::before { + content: "\e4cb"; } + +.fa-face-grin-tongue::before { + content: "\f589"; } + +.fa-grin-tongue::before { + content: "\f589"; } + +.fa-chess-bishop::before { + content: "\f43a"; } + +.fa-face-grin-wink::before { + content: "\f58c"; } + +.fa-grin-wink::before { + content: "\f58c"; } + +.fa-ear-deaf::before { + content: "\f2a4"; } + +.fa-deaf::before { + content: "\f2a4"; } + +.fa-deafness::before { + content: "\f2a4"; } + +.fa-hard-of-hearing::before { + content: "\f2a4"; } + +.fa-road-circle-check::before { + content: "\e564"; } + +.fa-dice-five::before { + content: "\f523"; } + +.fa-square-rss::before { + content: "\f143"; } + +.fa-rss-square::before { + content: "\f143"; } + +.fa-land-mine-on::before { + content: "\e51b"; } + +.fa-i-cursor::before { + content: "\f246"; } + +.fa-stamp::before { + content: "\f5bf"; } + +.fa-stairs::before { + content: "\e289"; } + +.fa-i::before { + content: "\49"; } + +.fa-hryvnia-sign::before { + content: "\f6f2"; } + +.fa-hryvnia::before { + content: "\f6f2"; } + +.fa-pills::before { + content: "\f484"; } + +.fa-face-grin-wide::before { + content: "\f581"; } + +.fa-grin-alt::before { + content: "\f581"; } + +.fa-tooth::before { + content: "\f5c9"; } + +.fa-v::before { + content: "\56"; } + +.fa-bangladeshi-taka-sign::before { + content: "\e2e6"; } + +.fa-bicycle::before { + content: "\f206"; } + +.fa-staff-snake::before { + content: "\e579"; } + +.fa-rod-asclepius::before { + content: "\e579"; } + +.fa-rod-snake::before { + content: "\e579"; } + +.fa-staff-aesculapius::before { + content: "\e579"; } + +.fa-head-side-cough-slash::before { + content: "\e062"; } + +.fa-truck-medical::before { + content: "\f0f9"; } + +.fa-ambulance::before { + content: "\f0f9"; } + +.fa-wheat-awn-circle-exclamation::before { + content: "\e598"; } + +.fa-snowman::before { + content: "\f7d0"; } + +.fa-mortar-pestle::before { + content: "\f5a7"; } + +.fa-road-barrier::before { + content: "\e562"; } + +.fa-school::before { + content: "\f549"; } + +.fa-igloo::before { + content: "\f7ae"; } + +.fa-joint::before { + content: "\f595"; } + +.fa-angle-right::before { + content: "\f105"; } + +.fa-horse::before { + content: "\f6f0"; } + +.fa-q::before { + content: "\51"; } + +.fa-g::before { + content: "\47"; } + +.fa-notes-medical::before { + content: "\f481"; } + +.fa-temperature-half::before { + content: "\f2c9"; } + +.fa-temperature-2::before { + content: "\f2c9"; } + +.fa-thermometer-2::before { + content: "\f2c9"; } + +.fa-thermometer-half::before { + content: "\f2c9"; } + +.fa-dong-sign::before { + content: "\e169"; } + +.fa-capsules::before { + content: "\f46b"; } + +.fa-poo-storm::before { + content: "\f75a"; } + +.fa-poo-bolt::before { + content: "\f75a"; } + +.fa-face-frown-open::before { + content: "\f57a"; } + +.fa-frown-open::before { + content: "\f57a"; } + +.fa-hand-point-up::before { + content: "\f0a6"; } + +.fa-money-bill::before { + content: "\f0d6"; } + +.fa-bookmark::before { + content: "\f02e"; } + +.fa-align-justify::before { + content: "\f039"; } + +.fa-umbrella-beach::before { + content: "\f5ca"; } + +.fa-helmet-un::before { + content: "\e503"; } + +.fa-bullseye::before { + content: "\f140"; } + +.fa-bacon::before { + content: "\f7e5"; } + +.fa-hand-point-down::before { + content: "\f0a7"; } + +.fa-arrow-up-from-bracket::before { + content: "\e09a"; } + +.fa-folder::before { + content: "\f07b"; } + +.fa-folder-blank::before { + content: "\f07b"; } + +.fa-file-waveform::before { + content: "\f478"; } + +.fa-file-medical-alt::before { + content: "\f478"; } + +.fa-radiation::before { + content: "\f7b9"; } + +.fa-chart-simple::before { + content: "\e473"; } + +.fa-mars-stroke::before { + content: "\f229"; } + +.fa-vial::before { + content: "\f492"; } + +.fa-gauge::before { + content: "\f624"; } + +.fa-dashboard::before { + content: "\f624"; } + +.fa-gauge-med::before { + content: "\f624"; } + +.fa-tachometer-alt-average::before { + content: "\f624"; } + +.fa-wand-magic-sparkles::before { + content: "\e2ca"; } + +.fa-magic-wand-sparkles::before { + content: "\e2ca"; } + +.fa-e::before { + content: "\45"; } + +.fa-pen-clip::before { + content: "\f305"; } + +.fa-pen-alt::before { + content: "\f305"; } + +.fa-bridge-circle-exclamation::before { + content: "\e4ca"; } + +.fa-user::before { + content: "\f007"; } + +.fa-school-circle-check::before { + content: "\e56b"; } + +.fa-dumpster::before { + content: "\f793"; } + +.fa-van-shuttle::before { + content: "\f5b6"; } + +.fa-shuttle-van::before { + content: "\f5b6"; } + +.fa-building-user::before { + content: "\e4da"; } + +.fa-square-caret-left::before { + content: "\f191"; } + +.fa-caret-square-left::before { + content: "\f191"; } + +.fa-highlighter::before { + content: "\f591"; } + +.fa-key::before { + content: "\f084"; } + +.fa-bullhorn::before { + content: "\f0a1"; } + +.fa-globe::before { + content: "\f0ac"; } + +.fa-synagogue::before { + content: "\f69b"; } + +.fa-person-half-dress::before { + content: "\e548"; } + +.fa-road-bridge::before { + content: "\e563"; } + +.fa-location-arrow::before { + content: "\f124"; } + +.fa-c::before { + content: "\43"; } + +.fa-tablet-button::before { + content: "\f10a"; } + +.fa-building-lock::before { + content: "\e4d6"; } + +.fa-pizza-slice::before { + content: "\f818"; } + +.fa-money-bill-wave::before { + content: "\f53a"; } + +.fa-chart-area::before { + content: "\f1fe"; } + +.fa-area-chart::before { + content: "\f1fe"; } + +.fa-house-flag::before { + content: "\e50d"; } + +.fa-person-circle-minus::before { + content: "\e540"; } + +.fa-ban::before { + content: "\f05e"; } + +.fa-cancel::before { + content: "\f05e"; } + +.fa-camera-rotate::before { + content: "\e0d8"; } + +.fa-spray-can-sparkles::before { + content: "\f5d0"; } + +.fa-air-freshener::before { + content: "\f5d0"; } + +.fa-star::before { + content: "\f005"; } + +.fa-repeat::before { + content: "\f363"; } + +.fa-cross::before { + content: "\f654"; } + +.fa-box::before { + content: "\f466"; } + +.fa-venus-mars::before { + content: "\f228"; } + +.fa-arrow-pointer::before { + content: "\f245"; } + +.fa-mouse-pointer::before { + content: "\f245"; } + +.fa-maximize::before { + content: "\f31e"; } + +.fa-expand-arrows-alt::before { + content: "\f31e"; } + +.fa-charging-station::before { + content: "\f5e7"; } + +.fa-shapes::before { + content: "\f61f"; } + +.fa-triangle-circle-square::before { + content: "\f61f"; } + +.fa-shuffle::before { + content: "\f074"; } + +.fa-random::before { + content: "\f074"; } + +.fa-person-running::before { + content: "\f70c"; } + +.fa-running::before { + content: "\f70c"; } + +.fa-mobile-retro::before { + content: "\e527"; } + +.fa-grip-lines-vertical::before { + content: "\f7a5"; } + +.fa-spider::before { + content: "\f717"; } + +.fa-hands-bound::before { + content: "\e4f9"; } + +.fa-file-invoice-dollar::before { + content: "\f571"; } + +.fa-plane-circle-exclamation::before { + content: "\e556"; } + +.fa-x-ray::before { + content: "\f497"; } + +.fa-spell-check::before { + content: "\f891"; } + +.fa-slash::before { + content: "\f715"; } + +.fa-computer-mouse::before { + content: "\f8cc"; } + +.fa-mouse::before { + content: "\f8cc"; } + +.fa-arrow-right-to-bracket::before { + content: "\f090"; } + +.fa-sign-in::before { + content: "\f090"; } + +.fa-shop-slash::before { + content: "\e070"; } + +.fa-store-alt-slash::before { + content: "\e070"; } + +.fa-server::before { + content: "\f233"; } + +.fa-virus-covid-slash::before { + content: "\e4a9"; } + +.fa-shop-lock::before { + content: "\e4a5"; } + +.fa-hourglass-start::before { + content: "\f251"; } + +.fa-hourglass-1::before { + content: "\f251"; } + +.fa-blender-phone::before { + content: "\f6b6"; } + +.fa-building-wheat::before { + content: "\e4db"; } + +.fa-person-breastfeeding::before { + content: "\e53a"; } + +.fa-right-to-bracket::before { + content: "\f2f6"; } + +.fa-sign-in-alt::before { + content: "\f2f6"; } + +.fa-venus::before { + content: "\f221"; } + +.fa-passport::before { + content: "\f5ab"; } + +.fa-heart-pulse::before { + content: "\f21e"; } + +.fa-heartbeat::before { + content: "\f21e"; } + +.fa-people-carry-box::before { + content: "\f4ce"; } + +.fa-people-carry::before { + content: "\f4ce"; } + +.fa-temperature-high::before { + content: "\f769"; } + +.fa-microchip::before { + content: "\f2db"; } + +.fa-crown::before { + content: "\f521"; } + +.fa-weight-hanging::before { + content: "\f5cd"; } + +.fa-xmarks-lines::before { + content: "\e59a"; } + +.fa-file-prescription::before { + content: "\f572"; } + +.fa-weight-scale::before { + content: "\f496"; } + +.fa-weight::before { + content: "\f496"; } + +.fa-user-group::before { + content: "\f500"; } + +.fa-user-friends::before { + content: "\f500"; } + +.fa-arrow-up-a-z::before { + content: "\f15e"; } + +.fa-sort-alpha-up::before { + content: "\f15e"; } + +.fa-chess-knight::before { + content: "\f441"; } + +.fa-face-laugh-squint::before { + content: "\f59b"; } + +.fa-laugh-squint::before { + content: "\f59b"; } + +.fa-wheelchair::before { + content: "\f193"; } + +.fa-circle-arrow-up::before { + content: "\f0aa"; } + +.fa-arrow-circle-up::before { + content: "\f0aa"; } + +.fa-toggle-on::before { + content: "\f205"; } + +.fa-person-walking::before { + content: "\f554"; } + +.fa-walking::before { + content: "\f554"; } + +.fa-l::before { + content: "\4c"; } + +.fa-fire::before { + content: "\f06d"; } + +.fa-bed-pulse::before { + content: "\f487"; } + +.fa-procedures::before { + content: "\f487"; } + +.fa-shuttle-space::before { + content: "\f197"; } + +.fa-space-shuttle::before { + content: "\f197"; } + +.fa-face-laugh::before { + content: "\f599"; } + +.fa-laugh::before { + content: "\f599"; } + +.fa-folder-open::before { + content: "\f07c"; } + +.fa-heart-circle-plus::before { + content: "\e500"; } + +.fa-code-fork::before { + content: "\e13b"; } + +.fa-city::before { + content: "\f64f"; } + +.fa-microphone-lines::before { + content: "\f3c9"; } + +.fa-microphone-alt::before { + content: "\f3c9"; } + +.fa-pepper-hot::before { + content: "\f816"; } + +.fa-unlock::before { + content: "\f09c"; } + +.fa-colon-sign::before { + content: "\e140"; } + +.fa-headset::before { + content: "\f590"; } + +.fa-store-slash::before { + content: "\e071"; } + +.fa-road-circle-xmark::before { + content: "\e566"; } + +.fa-user-minus::before { + content: "\f503"; } + +.fa-mars-stroke-up::before { + content: "\f22a"; } + +.fa-mars-stroke-v::before { + content: "\f22a"; } + +.fa-champagne-glasses::before { + content: "\f79f"; } + +.fa-glass-cheers::before { + content: "\f79f"; } + +.fa-clipboard::before { + content: "\f328"; } + +.fa-house-circle-exclamation::before { + content: "\e50a"; } + +.fa-file-arrow-up::before { + content: "\f574"; } + +.fa-file-upload::before { + content: "\f574"; } + +.fa-wifi::before { + content: "\f1eb"; } + +.fa-wifi-3::before { + content: "\f1eb"; } + +.fa-wifi-strong::before { + content: "\f1eb"; } + +.fa-bath::before { + content: "\f2cd"; } + +.fa-bathtub::before { + content: "\f2cd"; } + +.fa-underline::before { + content: "\f0cd"; } + +.fa-user-pen::before { + content: "\f4ff"; } + +.fa-user-edit::before { + content: "\f4ff"; } + +.fa-signature::before { + content: "\f5b7"; } + +.fa-stroopwafel::before { + content: "\f551"; } + +.fa-bold::before { + content: "\f032"; } + +.fa-anchor-lock::before { + content: "\e4ad"; } + +.fa-building-ngo::before { + content: "\e4d7"; } + +.fa-manat-sign::before { + content: "\e1d5"; } + +.fa-not-equal::before { + content: "\f53e"; } + +.fa-border-top-left::before { + content: "\f853"; } + +.fa-border-style::before { + content: "\f853"; } + +.fa-map-location-dot::before { + content: "\f5a0"; } + +.fa-map-marked-alt::before { + content: "\f5a0"; } + +.fa-jedi::before { + content: "\f669"; } + +.fa-square-poll-vertical::before { + content: "\f681"; } + +.fa-poll::before { + content: "\f681"; } + +.fa-mug-hot::before { + content: "\f7b6"; } + +.fa-car-battery::before { + content: "\f5df"; } + +.fa-battery-car::before { + content: "\f5df"; } + +.fa-gift::before { + content: "\f06b"; } + +.fa-dice-two::before { + content: "\f528"; } + +.fa-chess-queen::before { + content: "\f445"; } + +.fa-glasses::before { + content: "\f530"; } + +.fa-chess-board::before { + content: "\f43c"; } + +.fa-building-circle-check::before { + content: "\e4d2"; } + +.fa-person-chalkboard::before { + content: "\e53d"; } + +.fa-mars-stroke-right::before { + content: "\f22b"; } + +.fa-mars-stroke-h::before { + content: "\f22b"; } + +.fa-hand-back-fist::before { + content: "\f255"; } + +.fa-hand-rock::before { + content: "\f255"; } + +.fa-square-caret-up::before { + content: "\f151"; } + +.fa-caret-square-up::before { + content: "\f151"; } + +.fa-cloud-showers-water::before { + content: "\e4e4"; } + +.fa-chart-bar::before { + content: "\f080"; } + +.fa-bar-chart::before { + content: "\f080"; } + +.fa-hands-bubbles::before { + content: "\e05e"; } + +.fa-hands-wash::before { + content: "\e05e"; } + +.fa-less-than-equal::before { + content: "\f537"; } + +.fa-train::before { + content: "\f238"; } + +.fa-eye-low-vision::before { + content: "\f2a8"; } + +.fa-low-vision::before { + content: "\f2a8"; } + +.fa-crow::before { + content: "\f520"; } + +.fa-sailboat::before { + content: "\e445"; } + +.fa-window-restore::before { + content: "\f2d2"; } + +.fa-square-plus::before { + content: "\f0fe"; } + +.fa-plus-square::before { + content: "\f0fe"; } + +.fa-torii-gate::before { + content: "\f6a1"; } + +.fa-frog::before { + content: "\f52e"; } + +.fa-bucket::before { + content: "\e4cf"; } + +.fa-image::before { + content: "\f03e"; } + +.fa-microphone::before { + content: "\f130"; } + +.fa-cow::before { + content: "\f6c8"; } + +.fa-caret-up::before { + content: "\f0d8"; } + +.fa-screwdriver::before { + content: "\f54a"; } + +.fa-folder-closed::before { + content: "\e185"; } + +.fa-house-tsunami::before { + content: "\e515"; } + +.fa-square-nfi::before { + content: "\e576"; } + +.fa-arrow-up-from-ground-water::before { + content: "\e4b5"; } + +.fa-martini-glass::before { + content: "\f57b"; } + +.fa-glass-martini-alt::before { + content: "\f57b"; } + +.fa-rotate-left::before { + content: "\f2ea"; } + +.fa-rotate-back::before { + content: "\f2ea"; } + +.fa-rotate-backward::before { + content: "\f2ea"; } + +.fa-undo-alt::before { + content: "\f2ea"; } + +.fa-table-columns::before { + content: "\f0db"; } + +.fa-columns::before { + content: "\f0db"; } + +.fa-lemon::before { + content: "\f094"; } + +.fa-head-side-mask::before { + content: "\e063"; } + +.fa-handshake::before { + content: "\f2b5"; } + +.fa-gem::before { + content: "\f3a5"; } + +.fa-dolly::before { + content: "\f472"; } + +.fa-dolly-box::before { + content: "\f472"; } + +.fa-smoking::before { + content: "\f48d"; } + +.fa-minimize::before { + content: "\f78c"; } + +.fa-compress-arrows-alt::before { + content: "\f78c"; } + +.fa-monument::before { + content: "\f5a6"; } + +.fa-snowplow::before { + content: "\f7d2"; } + +.fa-angles-right::before { + content: "\f101"; } + +.fa-angle-double-right::before { + content: "\f101"; } + +.fa-cannabis::before { + content: "\f55f"; } + +.fa-circle-play::before { + content: "\f144"; } + +.fa-play-circle::before { + content: "\f144"; } + +.fa-tablets::before { + content: "\f490"; } + +.fa-ethernet::before { + content: "\f796"; } + +.fa-euro-sign::before { + content: "\f153"; } + +.fa-eur::before { + content: "\f153"; } + +.fa-euro::before { + content: "\f153"; } + +.fa-chair::before { + content: "\f6c0"; } + +.fa-circle-check::before { + content: "\f058"; } + +.fa-check-circle::before { + content: "\f058"; } + +.fa-circle-stop::before { + content: "\f28d"; } + +.fa-stop-circle::before { + content: "\f28d"; } + +.fa-compass-drafting::before { + content: "\f568"; } + +.fa-drafting-compass::before { + content: "\f568"; } + +.fa-plate-wheat::before { + content: "\e55a"; } + +.fa-icicles::before { + content: "\f7ad"; } + +.fa-person-shelter::before { + content: "\e54f"; } + +.fa-neuter::before { + content: "\f22c"; } + +.fa-id-badge::before { + content: "\f2c1"; } + +.fa-marker::before { + content: "\f5a1"; } + +.fa-face-laugh-beam::before { + content: "\f59a"; } + +.fa-laugh-beam::before { + content: "\f59a"; } + +.fa-helicopter-symbol::before { + content: "\e502"; } + +.fa-universal-access::before { + content: "\f29a"; } + +.fa-circle-chevron-up::before { + content: "\f139"; } + +.fa-chevron-circle-up::before { + content: "\f139"; } + +.fa-lari-sign::before { + content: "\e1c8"; } + +.fa-volcano::before { + content: "\f770"; } + +.fa-person-walking-dashed-line-arrow-right::before { + content: "\e553"; } + +.fa-sterling-sign::before { + content: "\f154"; } + +.fa-gbp::before { + content: "\f154"; } + +.fa-pound-sign::before { + content: "\f154"; } + +.fa-viruses::before { + content: "\e076"; } + +.fa-square-person-confined::before { + content: "\e577"; } + +.fa-user-tie::before { + content: "\f508"; } + +.fa-arrow-down-long::before { + content: "\f175"; } + +.fa-long-arrow-down::before { + content: "\f175"; } + +.fa-tent-arrow-down-to-line::before { + content: "\e57e"; } + +.fa-certificate::before { + content: "\f0a3"; } + +.fa-reply-all::before { + content: "\f122"; } + +.fa-mail-reply-all::before { + content: "\f122"; } + +.fa-suitcase::before { + content: "\f0f2"; } + +.fa-person-skating::before { + content: "\f7c5"; } + +.fa-skating::before { + content: "\f7c5"; } + +.fa-filter-circle-dollar::before { + content: "\f662"; } + +.fa-funnel-dollar::before { + content: "\f662"; } + +.fa-camera-retro::before { + content: "\f083"; } + +.fa-circle-arrow-down::before { + content: "\f0ab"; } + +.fa-arrow-circle-down::before { + content: "\f0ab"; } + +.fa-file-import::before { + content: "\f56f"; } + +.fa-arrow-right-to-file::before { + content: "\f56f"; } + +.fa-square-arrow-up-right::before { + content: "\f14c"; } + +.fa-external-link-square::before { + content: "\f14c"; } + +.fa-box-open::before { + content: "\f49e"; } + +.fa-scroll::before { + content: "\f70e"; } + +.fa-spa::before { + content: "\f5bb"; } + +.fa-location-pin-lock::before { + content: "\e51f"; } + +.fa-pause::before { + content: "\f04c"; } + +.fa-hill-avalanche::before { + content: "\e507"; } + +.fa-temperature-empty::before { + content: "\f2cb"; } + +.fa-temperature-0::before { + content: "\f2cb"; } + +.fa-thermometer-0::before { + content: "\f2cb"; } + +.fa-thermometer-empty::before { + content: "\f2cb"; } + +.fa-bomb::before { + content: "\f1e2"; } + +.fa-registered::before { + content: "\f25d"; } + +.fa-address-card::before { + content: "\f2bb"; } + +.fa-contact-card::before { + content: "\f2bb"; } + +.fa-vcard::before { + content: "\f2bb"; } + +.fa-scale-unbalanced-flip::before { + content: "\f516"; } + +.fa-balance-scale-right::before { + content: "\f516"; } + +.fa-subscript::before { + content: "\f12c"; } + +.fa-diamond-turn-right::before { + content: "\f5eb"; } + +.fa-directions::before { + content: "\f5eb"; } + +.fa-burst::before { + content: "\e4dc"; } + +.fa-house-laptop::before { + content: "\e066"; } + +.fa-laptop-house::before { + content: "\e066"; } + +.fa-face-tired::before { + content: "\f5c8"; } + +.fa-tired::before { + content: "\f5c8"; } + +.fa-money-bills::before { + content: "\e1f3"; } + +.fa-smog::before { + content: "\f75f"; } + +.fa-crutch::before { + content: "\f7f7"; } + +.fa-cloud-arrow-up::before { + content: "\f0ee"; } + +.fa-cloud-upload::before { + content: "\f0ee"; } + +.fa-cloud-upload-alt::before { + content: "\f0ee"; } + +.fa-palette::before { + content: "\f53f"; } + +.fa-arrows-turn-right::before { + content: "\e4c0"; } + +.fa-vest::before { + content: "\e085"; } + +.fa-ferry::before { + content: "\e4ea"; } + +.fa-arrows-down-to-people::before { + content: "\e4b9"; } + +.fa-seedling::before { + content: "\f4d8"; } + +.fa-sprout::before { + content: "\f4d8"; } + +.fa-left-right::before { + content: "\f337"; } + +.fa-arrows-alt-h::before { + content: "\f337"; } + +.fa-boxes-packing::before { + content: "\e4c7"; } + +.fa-circle-arrow-left::before { + content: "\f0a8"; } + +.fa-arrow-circle-left::before { + content: "\f0a8"; } + +.fa-group-arrows-rotate::before { + content: "\e4f6"; } + +.fa-bowl-food::before { + content: "\e4c6"; } + +.fa-candy-cane::before { + content: "\f786"; } + +.fa-arrow-down-wide-short::before { + content: "\f160"; } + +.fa-sort-amount-asc::before { + content: "\f160"; } + +.fa-sort-amount-down::before { + content: "\f160"; } + +.fa-cloud-bolt::before { + content: "\f76c"; } + +.fa-thunderstorm::before { + content: "\f76c"; } + +.fa-text-slash::before { + content: "\f87d"; } + +.fa-remove-format::before { + content: "\f87d"; } + +.fa-face-smile-wink::before { + content: "\f4da"; } + +.fa-smile-wink::before { + content: "\f4da"; } + +.fa-file-word::before { + content: "\f1c2"; } + +.fa-file-powerpoint::before { + content: "\f1c4"; } + +.fa-arrows-left-right::before { + content: "\f07e"; } + +.fa-arrows-h::before { + content: "\f07e"; } + +.fa-house-lock::before { + content: "\e510"; } + +.fa-cloud-arrow-down::before { + content: "\f0ed"; } + +.fa-cloud-download::before { + content: "\f0ed"; } + +.fa-cloud-download-alt::before { + content: "\f0ed"; } + +.fa-children::before { + content: "\e4e1"; } + +.fa-chalkboard::before { + content: "\f51b"; } + +.fa-blackboard::before { + content: "\f51b"; } + +.fa-user-large-slash::before { + content: "\f4fa"; } + +.fa-user-alt-slash::before { + content: "\f4fa"; } + +.fa-envelope-open::before { + content: "\f2b6"; } + +.fa-handshake-simple-slash::before { + content: "\e05f"; } + +.fa-handshake-alt-slash::before { + content: "\e05f"; } + +.fa-mattress-pillow::before { + content: "\e525"; } + +.fa-guarani-sign::before { + content: "\e19a"; } + +.fa-arrows-rotate::before { + content: "\f021"; } + +.fa-refresh::before { + content: "\f021"; } + +.fa-sync::before { + content: "\f021"; } + +.fa-fire-extinguisher::before { + content: "\f134"; } + +.fa-cruzeiro-sign::before { + content: "\e152"; } + +.fa-greater-than-equal::before { + content: "\f532"; } + +.fa-shield-halved::before { + content: "\f3ed"; } + +.fa-shield-alt::before { + content: "\f3ed"; } + +.fa-book-atlas::before { + content: "\f558"; } + +.fa-atlas::before { + content: "\f558"; } + +.fa-virus::before { + content: "\e074"; } + +.fa-envelope-circle-check::before { + content: "\e4e8"; } + +.fa-layer-group::before { + content: "\f5fd"; } + +.fa-arrows-to-dot::before { + content: "\e4be"; } + +.fa-archway::before { + content: "\f557"; } + +.fa-heart-circle-check::before { + content: "\e4fd"; } + +.fa-house-chimney-crack::before { + content: "\f6f1"; } + +.fa-house-damage::before { + content: "\f6f1"; } + +.fa-file-zipper::before { + content: "\f1c6"; } + +.fa-file-archive::before { + content: "\f1c6"; } + +.fa-square::before { + content: "\f0c8"; } + +.fa-martini-glass-empty::before { + content: "\f000"; } + +.fa-glass-martini::before { + content: "\f000"; } + +.fa-couch::before { + content: "\f4b8"; } + +.fa-cedi-sign::before { + content: "\e0df"; } + +.fa-italic::before { + content: "\f033"; } + +.fa-table-cells-column-lock::before { + content: "\e678"; } + +.fa-church::before { + content: "\f51d"; } + +.fa-comments-dollar::before { + content: "\f653"; } + +.fa-democrat::before { + content: "\f747"; } + +.fa-z::before { + content: "\5a"; } + +.fa-person-skiing::before { + content: "\f7c9"; } + +.fa-skiing::before { + content: "\f7c9"; } + +.fa-road-lock::before { + content: "\e567"; } + +.fa-a::before { + content: "\41"; } + +.fa-temperature-arrow-down::before { + content: "\e03f"; } + +.fa-temperature-down::before { + content: "\e03f"; } + +.fa-feather-pointed::before { + content: "\f56b"; } + +.fa-feather-alt::before { + content: "\f56b"; } + +.fa-p::before { + content: "\50"; } + +.fa-snowflake::before { + content: "\f2dc"; } + +.fa-newspaper::before { + content: "\f1ea"; } + +.fa-rectangle-ad::before { + content: "\f641"; } + +.fa-ad::before { + content: "\f641"; } + +.fa-circle-arrow-right::before { + content: "\f0a9"; } + +.fa-arrow-circle-right::before { + content: "\f0a9"; } + +.fa-filter-circle-xmark::before { + content: "\e17b"; } + +.fa-locust::before { + content: "\e520"; } + +.fa-sort::before { + content: "\f0dc"; } + +.fa-unsorted::before { + content: "\f0dc"; } + +.fa-list-ol::before { + content: "\f0cb"; } + +.fa-list-1-2::before { + content: "\f0cb"; } + +.fa-list-numeric::before { + content: "\f0cb"; } + +.fa-person-dress-burst::before { + content: "\e544"; } + +.fa-money-check-dollar::before { + content: "\f53d"; } + +.fa-money-check-alt::before { + content: "\f53d"; } + +.fa-vector-square::before { + content: "\f5cb"; } + +.fa-bread-slice::before { + content: "\f7ec"; } + +.fa-language::before { + content: "\f1ab"; } + +.fa-face-kiss-wink-heart::before { + content: "\f598"; } + +.fa-kiss-wink-heart::before { + content: "\f598"; } + +.fa-filter::before { + content: "\f0b0"; } + +.fa-question::before { + content: "\3f"; } + +.fa-file-signature::before { + content: "\f573"; } + +.fa-up-down-left-right::before { + content: "\f0b2"; } + +.fa-arrows-alt::before { + content: "\f0b2"; } + +.fa-house-chimney-user::before { + content: "\e065"; } + +.fa-hand-holding-heart::before { + content: "\f4be"; } + +.fa-puzzle-piece::before { + content: "\f12e"; } + +.fa-money-check::before { + content: "\f53c"; } + +.fa-star-half-stroke::before { + content: "\f5c0"; } + +.fa-star-half-alt::before { + content: "\f5c0"; } + +.fa-code::before { + content: "\f121"; } + +.fa-whiskey-glass::before { + content: "\f7a0"; } + +.fa-glass-whiskey::before { + content: "\f7a0"; } + +.fa-building-circle-exclamation::before { + content: "\e4d3"; } + +.fa-magnifying-glass-chart::before { + content: "\e522"; } + +.fa-arrow-up-right-from-square::before { + content: "\f08e"; } + +.fa-external-link::before { + content: "\f08e"; } + +.fa-cubes-stacked::before { + content: "\e4e6"; } + +.fa-won-sign::before { + content: "\f159"; } + +.fa-krw::before { + content: "\f159"; } + +.fa-won::before { + content: "\f159"; } + +.fa-virus-covid::before { + content: "\e4a8"; } + +.fa-austral-sign::before { + content: "\e0a9"; } + +.fa-f::before { + content: "\46"; } + +.fa-leaf::before { + content: "\f06c"; } + +.fa-road::before { + content: "\f018"; } + +.fa-taxi::before { + content: "\f1ba"; } + +.fa-cab::before { + content: "\f1ba"; } + +.fa-person-circle-plus::before { + content: "\e541"; } + +.fa-chart-pie::before { + content: "\f200"; } + +.fa-pie-chart::before { + content: "\f200"; } + +.fa-bolt-lightning::before { + content: "\e0b7"; } + +.fa-sack-xmark::before { + content: "\e56a"; } + +.fa-file-excel::before { + content: "\f1c3"; } + +.fa-file-contract::before { + content: "\f56c"; } + +.fa-fish-fins::before { + content: "\e4f2"; } + +.fa-building-flag::before { + content: "\e4d5"; } + +.fa-face-grin-beam::before { + content: "\f582"; } + +.fa-grin-beam::before { + content: "\f582"; } + +.fa-object-ungroup::before { + content: "\f248"; } + +.fa-poop::before { + content: "\f619"; } + +.fa-location-pin::before { + content: "\f041"; } + +.fa-map-marker::before { + content: "\f041"; } + +.fa-kaaba::before { + content: "\f66b"; } + +.fa-toilet-paper::before { + content: "\f71e"; } + +.fa-helmet-safety::before { + content: "\f807"; } + +.fa-hard-hat::before { + content: "\f807"; } + +.fa-hat-hard::before { + content: "\f807"; } + +.fa-eject::before { + content: "\f052"; } + +.fa-circle-right::before { + content: "\f35a"; } + +.fa-arrow-alt-circle-right::before { + content: "\f35a"; } + +.fa-plane-circle-check::before { + content: "\e555"; } + +.fa-face-rolling-eyes::before { + content: "\f5a5"; } + +.fa-meh-rolling-eyes::before { + content: "\f5a5"; } + +.fa-object-group::before { + content: "\f247"; } + +.fa-chart-line::before { + content: "\f201"; } + +.fa-line-chart::before { + content: "\f201"; } + +.fa-mask-ventilator::before { + content: "\e524"; } + +.fa-arrow-right::before { + content: "\f061"; } + +.fa-signs-post::before { + content: "\f277"; } + +.fa-map-signs::before { + content: "\f277"; } + +.fa-cash-register::before { + content: "\f788"; } + +.fa-person-circle-question::before { + content: "\e542"; } + +.fa-h::before { + content: "\48"; } + +.fa-tarp::before { + content: "\e57b"; } + +.fa-screwdriver-wrench::before { + content: "\f7d9"; } + +.fa-tools::before { + content: "\f7d9"; } + +.fa-arrows-to-eye::before { + content: "\e4bf"; } + +.fa-plug-circle-bolt::before { + content: "\e55b"; } + +.fa-heart::before { + content: "\f004"; } + +.fa-mars-and-venus::before { + content: "\f224"; } + +.fa-house-user::before { + content: "\e1b0"; } + +.fa-home-user::before { + content: "\e1b0"; } + +.fa-dumpster-fire::before { + content: "\f794"; } + +.fa-house-crack::before { + content: "\e3b1"; } + +.fa-martini-glass-citrus::before { + content: "\f561"; } + +.fa-cocktail::before { + content: "\f561"; } + +.fa-face-surprise::before { + content: "\f5c2"; } + +.fa-surprise::before { + content: "\f5c2"; } + +.fa-bottle-water::before { + content: "\e4c5"; } + +.fa-circle-pause::before { + content: "\f28b"; } + +.fa-pause-circle::before { + content: "\f28b"; } + +.fa-toilet-paper-slash::before { + content: "\e072"; } + +.fa-apple-whole::before { + content: "\f5d1"; } + +.fa-apple-alt::before { + content: "\f5d1"; } + +.fa-kitchen-set::before { + content: "\e51a"; } + +.fa-r::before { + content: "\52"; } + +.fa-temperature-quarter::before { + content: "\f2ca"; } + +.fa-temperature-1::before { + content: "\f2ca"; } + +.fa-thermometer-1::before { + content: "\f2ca"; } + +.fa-thermometer-quarter::before { + content: "\f2ca"; } + +.fa-cube::before { + content: "\f1b2"; } + +.fa-bitcoin-sign::before { + content: "\e0b4"; } + +.fa-shield-dog::before { + content: "\e573"; } + +.fa-solar-panel::before { + content: "\f5ba"; } + +.fa-lock-open::before { + content: "\f3c1"; } + +.fa-elevator::before { + content: "\e16d"; } + +.fa-money-bill-transfer::before { + content: "\e528"; } + +.fa-money-bill-trend-up::before { + content: "\e529"; } + +.fa-house-flood-water-circle-arrow-right::before { + content: "\e50f"; } + +.fa-square-poll-horizontal::before { + content: "\f682"; } + +.fa-poll-h::before { + content: "\f682"; } + +.fa-circle::before { + content: "\f111"; } + +.fa-backward-fast::before { + content: "\f049"; } + +.fa-fast-backward::before { + content: "\f049"; } + +.fa-recycle::before { + content: "\f1b8"; } + +.fa-user-astronaut::before { + content: "\f4fb"; } + +.fa-plane-slash::before { + content: "\e069"; } + +.fa-trademark::before { + content: "\f25c"; } + +.fa-basketball::before { + content: "\f434"; } + +.fa-basketball-ball::before { + content: "\f434"; } + +.fa-satellite-dish::before { + content: "\f7c0"; } + +.fa-circle-up::before { + content: "\f35b"; } + +.fa-arrow-alt-circle-up::before { + content: "\f35b"; } + +.fa-mobile-screen-button::before { + content: "\f3cd"; } + +.fa-mobile-alt::before { + content: "\f3cd"; } + +.fa-volume-high::before { + content: "\f028"; } + +.fa-volume-up::before { + content: "\f028"; } + +.fa-users-rays::before { + content: "\e593"; } + +.fa-wallet::before { + content: "\f555"; } + +.fa-clipboard-check::before { + content: "\f46c"; } + +.fa-file-audio::before { + content: "\f1c7"; } + +.fa-burger::before { + content: "\f805"; } + +.fa-hamburger::before { + content: "\f805"; } + +.fa-wrench::before { + content: "\f0ad"; } + +.fa-bugs::before { + content: "\e4d0"; } + +.fa-rupee-sign::before { + content: "\f156"; } + +.fa-rupee::before { + content: "\f156"; } + +.fa-file-image::before { + content: "\f1c5"; } + +.fa-circle-question::before { + content: "\f059"; } + +.fa-question-circle::before { + content: "\f059"; } + +.fa-plane-departure::before { + content: "\f5b0"; } + +.fa-handshake-slash::before { + content: "\e060"; } + +.fa-book-bookmark::before { + content: "\e0bb"; } + +.fa-code-branch::before { + content: "\f126"; } + +.fa-hat-cowboy::before { + content: "\f8c0"; } + +.fa-bridge::before { + content: "\e4c8"; } + +.fa-phone-flip::before { + content: "\f879"; } + +.fa-phone-alt::before { + content: "\f879"; } + +.fa-truck-front::before { + content: "\e2b7"; } + +.fa-cat::before { + content: "\f6be"; } + +.fa-anchor-circle-exclamation::before { + content: "\e4ab"; } + +.fa-truck-field::before { + content: "\e58d"; } + +.fa-route::before { + content: "\f4d7"; } + +.fa-clipboard-question::before { + content: "\e4e3"; } + +.fa-panorama::before { + content: "\e209"; } + +.fa-comment-medical::before { + content: "\f7f5"; } + +.fa-teeth-open::before { + content: "\f62f"; } + +.fa-file-circle-minus::before { + content: "\e4ed"; } + +.fa-tags::before { + content: "\f02c"; } + +.fa-wine-glass::before { + content: "\f4e3"; } + +.fa-forward-fast::before { + content: "\f050"; } + +.fa-fast-forward::before { + content: "\f050"; } + +.fa-face-meh-blank::before { + content: "\f5a4"; } + +.fa-meh-blank::before { + content: "\f5a4"; } + +.fa-square-parking::before { + content: "\f540"; } + +.fa-parking::before { + content: "\f540"; } + +.fa-house-signal::before { + content: "\e012"; } + +.fa-bars-progress::before { + content: "\f828"; } + +.fa-tasks-alt::before { + content: "\f828"; } + +.fa-faucet-drip::before { + content: "\e006"; } + +.fa-cart-flatbed::before { + content: "\f474"; } + +.fa-dolly-flatbed::before { + content: "\f474"; } + +.fa-ban-smoking::before { + content: "\f54d"; } + +.fa-smoking-ban::before { + content: "\f54d"; } + +.fa-terminal::before { + content: "\f120"; } + +.fa-mobile-button::before { + content: "\f10b"; } + +.fa-house-medical-flag::before { + content: "\e514"; } + +.fa-basket-shopping::before { + content: "\f291"; } + +.fa-shopping-basket::before { + content: "\f291"; } + +.fa-tape::before { + content: "\f4db"; } + +.fa-bus-simple::before { + content: "\f55e"; } + +.fa-bus-alt::before { + content: "\f55e"; } + +.fa-eye::before { + content: "\f06e"; } + +.fa-face-sad-cry::before { + content: "\f5b3"; } + +.fa-sad-cry::before { + content: "\f5b3"; } + +.fa-audio-description::before { + content: "\f29e"; } + +.fa-person-military-to-person::before { + content: "\e54c"; } + +.fa-file-shield::before { + content: "\e4f0"; } + +.fa-user-slash::before { + content: "\f506"; } + +.fa-pen::before { + content: "\f304"; } + +.fa-tower-observation::before { + content: "\e586"; } + +.fa-file-code::before { + content: "\f1c9"; } + +.fa-signal::before { + content: "\f012"; } + +.fa-signal-5::before { + content: "\f012"; } + +.fa-signal-perfect::before { + content: "\f012"; } + +.fa-bus::before { + content: "\f207"; } + +.fa-heart-circle-xmark::before { + content: "\e501"; } + +.fa-house-chimney::before { + content: "\e3af"; } + +.fa-home-lg::before { + content: "\e3af"; } + +.fa-window-maximize::before { + content: "\f2d0"; } + +.fa-face-frown::before { + content: "\f119"; } + +.fa-frown::before { + content: "\f119"; } + +.fa-prescription::before { + content: "\f5b1"; } + +.fa-shop::before { + content: "\f54f"; } + +.fa-store-alt::before { + content: "\f54f"; } + +.fa-floppy-disk::before { + content: "\f0c7"; } + +.fa-save::before { + content: "\f0c7"; } + +.fa-vihara::before { + content: "\f6a7"; } + +.fa-scale-unbalanced::before { + content: "\f515"; } + +.fa-balance-scale-left::before { + content: "\f515"; } + +.fa-sort-up::before { + content: "\f0de"; } + +.fa-sort-asc::before { + content: "\f0de"; } + +.fa-comment-dots::before { + content: "\f4ad"; } + +.fa-commenting::before { + content: "\f4ad"; } + +.fa-plant-wilt::before { + content: "\e5aa"; } + +.fa-diamond::before { + content: "\f219"; } + +.fa-face-grin-squint::before { + content: "\f585"; } + +.fa-grin-squint::before { + content: "\f585"; } + +.fa-hand-holding-dollar::before { + content: "\f4c0"; } + +.fa-hand-holding-usd::before { + content: "\f4c0"; } + +.fa-bacterium::before { + content: "\e05a"; } + +.fa-hand-pointer::before { + content: "\f25a"; } + +.fa-drum-steelpan::before { + content: "\f56a"; } + +.fa-hand-scissors::before { + content: "\f257"; } + +.fa-hands-praying::before { + content: "\f684"; } + +.fa-praying-hands::before { + content: "\f684"; } + +.fa-arrow-rotate-right::before { + content: "\f01e"; } + +.fa-arrow-right-rotate::before { + content: "\f01e"; } + +.fa-arrow-rotate-forward::before { + content: "\f01e"; } + +.fa-redo::before { + content: "\f01e"; } + +.fa-biohazard::before { + content: "\f780"; } + +.fa-location-crosshairs::before { + content: "\f601"; } + +.fa-location::before { + content: "\f601"; } + +.fa-mars-double::before { + content: "\f227"; } + +.fa-child-dress::before { + content: "\e59c"; } + +.fa-users-between-lines::before { + content: "\e591"; } + +.fa-lungs-virus::before { + content: "\e067"; } + +.fa-face-grin-tears::before { + content: "\f588"; } + +.fa-grin-tears::before { + content: "\f588"; } + +.fa-phone::before { + content: "\f095"; } + +.fa-calendar-xmark::before { + content: "\f273"; } + +.fa-calendar-times::before { + content: "\f273"; } + +.fa-child-reaching::before { + content: "\e59d"; } + +.fa-head-side-virus::before { + content: "\e064"; } + +.fa-user-gear::before { + content: "\f4fe"; } + +.fa-user-cog::before { + content: "\f4fe"; } + +.fa-arrow-up-1-9::before { + content: "\f163"; } + +.fa-sort-numeric-up::before { + content: "\f163"; } + +.fa-door-closed::before { + content: "\f52a"; } + +.fa-shield-virus::before { + content: "\e06c"; } + +.fa-dice-six::before { + content: "\f526"; } + +.fa-mosquito-net::before { + content: "\e52c"; } + +.fa-bridge-water::before { + content: "\e4ce"; } + +.fa-person-booth::before { + content: "\f756"; } + +.fa-text-width::before { + content: "\f035"; } + +.fa-hat-wizard::before { + content: "\f6e8"; } + +.fa-pen-fancy::before { + content: "\f5ac"; } + +.fa-person-digging::before { + content: "\f85e"; } + +.fa-digging::before { + content: "\f85e"; } + +.fa-trash::before { + content: "\f1f8"; } + +.fa-gauge-simple::before { + content: "\f629"; } + +.fa-gauge-simple-med::before { + content: "\f629"; } + +.fa-tachometer-average::before { + content: "\f629"; } + +.fa-book-medical::before { + content: "\f7e6"; } + +.fa-poo::before { + content: "\f2fe"; } + +.fa-quote-right::before { + content: "\f10e"; } + +.fa-quote-right-alt::before { + content: "\f10e"; } + +.fa-shirt::before { + content: "\f553"; } + +.fa-t-shirt::before { + content: "\f553"; } + +.fa-tshirt::before { + content: "\f553"; } + +.fa-cubes::before { + content: "\f1b3"; } + +.fa-divide::before { + content: "\f529"; } + +.fa-tenge-sign::before { + content: "\f7d7"; } + +.fa-tenge::before { + content: "\f7d7"; } + +.fa-headphones::before { + content: "\f025"; } + +.fa-hands-holding::before { + content: "\f4c2"; } + +.fa-hands-clapping::before { + content: "\e1a8"; } + +.fa-republican::before { + content: "\f75e"; } + +.fa-arrow-left::before { + content: "\f060"; } + +.fa-person-circle-xmark::before { + content: "\e543"; } + +.fa-ruler::before { + content: "\f545"; } + +.fa-align-left::before { + content: "\f036"; } + +.fa-dice-d6::before { + content: "\f6d1"; } + +.fa-restroom::before { + content: "\f7bd"; } + +.fa-j::before { + content: "\4a"; } + +.fa-users-viewfinder::before { + content: "\e595"; } + +.fa-file-video::before { + content: "\f1c8"; } + +.fa-up-right-from-square::before { + content: "\f35d"; } + +.fa-external-link-alt::before { + content: "\f35d"; } + +.fa-table-cells::before { + content: "\f00a"; } + +.fa-th::before { + content: "\f00a"; } + +.fa-file-pdf::before { + content: "\f1c1"; } + +.fa-book-bible::before { + content: "\f647"; } + +.fa-bible::before { + content: "\f647"; } + +.fa-o::before { + content: "\4f"; } + +.fa-suitcase-medical::before { + content: "\f0fa"; } + +.fa-medkit::before { + content: "\f0fa"; } + +.fa-user-secret::before { + content: "\f21b"; } + +.fa-otter::before { + content: "\f700"; } + +.fa-person-dress::before { + content: "\f182"; } + +.fa-female::before { + content: "\f182"; } + +.fa-comment-dollar::before { + content: "\f651"; } + +.fa-business-time::before { + content: "\f64a"; } + +.fa-briefcase-clock::before { + content: "\f64a"; } + +.fa-table-cells-large::before { + content: "\f009"; } + +.fa-th-large::before { + content: "\f009"; } + +.fa-book-tanakh::before { + content: "\f827"; } + +.fa-tanakh::before { + content: "\f827"; } + +.fa-phone-volume::before { + content: "\f2a0"; } + +.fa-volume-control-phone::before { + content: "\f2a0"; } + +.fa-hat-cowboy-side::before { + content: "\f8c1"; } + +.fa-clipboard-user::before { + content: "\f7f3"; } + +.fa-child::before { + content: "\f1ae"; } + +.fa-lira-sign::before { + content: "\f195"; } + +.fa-satellite::before { + content: "\f7bf"; } + +.fa-plane-lock::before { + content: "\e558"; } + +.fa-tag::before { + content: "\f02b"; } + +.fa-comment::before { + content: "\f075"; } + +.fa-cake-candles::before { + content: "\f1fd"; } + +.fa-birthday-cake::before { + content: "\f1fd"; } + +.fa-cake::before { + content: "\f1fd"; } + +.fa-envelope::before { + content: "\f0e0"; } + +.fa-angles-up::before { + content: "\f102"; } + +.fa-angle-double-up::before { + content: "\f102"; } + +.fa-paperclip::before { + content: "\f0c6"; } + +.fa-arrow-right-to-city::before { + content: "\e4b3"; } + +.fa-ribbon::before { + content: "\f4d6"; } + +.fa-lungs::before { + content: "\f604"; } + +.fa-arrow-up-9-1::before { + content: "\f887"; } + +.fa-sort-numeric-up-alt::before { + content: "\f887"; } + +.fa-litecoin-sign::before { + content: "\e1d3"; } + +.fa-border-none::before { + content: "\f850"; } + +.fa-circle-nodes::before { + content: "\e4e2"; } + +.fa-parachute-box::before { + content: "\f4cd"; } + +.fa-indent::before { + content: "\f03c"; } + +.fa-truck-field-un::before { + content: "\e58e"; } + +.fa-hourglass::before { + content: "\f254"; } + +.fa-hourglass-empty::before { + content: "\f254"; } + +.fa-mountain::before { + content: "\f6fc"; } + +.fa-user-doctor::before { + content: "\f0f0"; } + +.fa-user-md::before { + content: "\f0f0"; } + +.fa-circle-info::before { + content: "\f05a"; } + +.fa-info-circle::before { + content: "\f05a"; } + +.fa-cloud-meatball::before { + content: "\f73b"; } + +.fa-camera::before { + content: "\f030"; } + +.fa-camera-alt::before { + content: "\f030"; } + +.fa-square-virus::before { + content: "\e578"; } + +.fa-meteor::before { + content: "\f753"; } + +.fa-car-on::before { + content: "\e4dd"; } + +.fa-sleigh::before { + content: "\f7cc"; } + +.fa-arrow-down-1-9::before { + content: "\f162"; } + +.fa-sort-numeric-asc::before { + content: "\f162"; } + +.fa-sort-numeric-down::before { + content: "\f162"; } + +.fa-hand-holding-droplet::before { + content: "\f4c1"; } + +.fa-hand-holding-water::before { + content: "\f4c1"; } + +.fa-water::before { + content: "\f773"; } + +.fa-calendar-check::before { + content: "\f274"; } + +.fa-braille::before { + content: "\f2a1"; } + +.fa-prescription-bottle-medical::before { + content: "\f486"; } + +.fa-prescription-bottle-alt::before { + content: "\f486"; } + +.fa-landmark::before { + content: "\f66f"; } + +.fa-truck::before { + content: "\f0d1"; } + +.fa-crosshairs::before { + content: "\f05b"; } + +.fa-person-cane::before { + content: "\e53c"; } + +.fa-tent::before { + content: "\e57d"; } + +.fa-vest-patches::before { + content: "\e086"; } + +.fa-check-double::before { + content: "\f560"; } + +.fa-arrow-down-a-z::before { + content: "\f15d"; } + +.fa-sort-alpha-asc::before { + content: "\f15d"; } + +.fa-sort-alpha-down::before { + content: "\f15d"; } + +.fa-money-bill-wheat::before { + content: "\e52a"; } + +.fa-cookie::before { + content: "\f563"; } + +.fa-arrow-rotate-left::before { + content: "\f0e2"; } + +.fa-arrow-left-rotate::before { + content: "\f0e2"; } + +.fa-arrow-rotate-back::before { + content: "\f0e2"; } + +.fa-arrow-rotate-backward::before { + content: "\f0e2"; } + +.fa-undo::before { + content: "\f0e2"; } + +.fa-hard-drive::before { + content: "\f0a0"; } + +.fa-hdd::before { + content: "\f0a0"; } + +.fa-face-grin-squint-tears::before { + content: "\f586"; } + +.fa-grin-squint-tears::before { + content: "\f586"; } + +.fa-dumbbell::before { + content: "\f44b"; } + +.fa-rectangle-list::before { + content: "\f022"; } + +.fa-list-alt::before { + content: "\f022"; } + +.fa-tarp-droplet::before { + content: "\e57c"; } + +.fa-house-medical-circle-check::before { + content: "\e511"; } + +.fa-person-skiing-nordic::before { + content: "\f7ca"; } + +.fa-skiing-nordic::before { + content: "\f7ca"; } + +.fa-calendar-plus::before { + content: "\f271"; } + +.fa-plane-arrival::before { + content: "\f5af"; } + +.fa-circle-left::before { + content: "\f359"; } + +.fa-arrow-alt-circle-left::before { + content: "\f359"; } + +.fa-train-subway::before { + content: "\f239"; } + +.fa-subway::before { + content: "\f239"; } + +.fa-chart-gantt::before { + content: "\e0e4"; } + +.fa-indian-rupee-sign::before { + content: "\e1bc"; } + +.fa-indian-rupee::before { + content: "\e1bc"; } + +.fa-inr::before { + content: "\e1bc"; } + +.fa-crop-simple::before { + content: "\f565"; } + +.fa-crop-alt::before { + content: "\f565"; } + +.fa-money-bill-1::before { + content: "\f3d1"; } + +.fa-money-bill-alt::before { + content: "\f3d1"; } + +.fa-left-long::before { + content: "\f30a"; } + +.fa-long-arrow-alt-left::before { + content: "\f30a"; } + +.fa-dna::before { + content: "\f471"; } + +.fa-virus-slash::before { + content: "\e075"; } + +.fa-minus::before { + content: "\f068"; } + +.fa-subtract::before { + content: "\f068"; } + +.fa-chess::before { + content: "\f439"; } + +.fa-arrow-left-long::before { + content: "\f177"; } + +.fa-long-arrow-left::before { + content: "\f177"; } + +.fa-plug-circle-check::before { + content: "\e55c"; } + +.fa-street-view::before { + content: "\f21d"; } + +.fa-franc-sign::before { + content: "\e18f"; } + +.fa-volume-off::before { + content: "\f026"; } + +.fa-hands-asl-interpreting::before { + content: "\f2a3"; } + +.fa-american-sign-language-interpreting::before { + content: "\f2a3"; } + +.fa-asl-interpreting::before { + content: "\f2a3"; } + +.fa-hands-american-sign-language-interpreting::before { + content: "\f2a3"; } + +.fa-gear::before { + content: "\f013"; } + +.fa-cog::before { + content: "\f013"; } + +.fa-droplet-slash::before { + content: "\f5c7"; } + +.fa-tint-slash::before { + content: "\f5c7"; } + +.fa-mosque::before { + content: "\f678"; } + +.fa-mosquito::before { + content: "\e52b"; } + +.fa-star-of-david::before { + content: "\f69a"; } + +.fa-person-military-rifle::before { + content: "\e54b"; } + +.fa-cart-shopping::before { + content: "\f07a"; } + +.fa-shopping-cart::before { + content: "\f07a"; } + +.fa-vials::before { + content: "\f493"; } + +.fa-plug-circle-plus::before { + content: "\e55f"; } + +.fa-place-of-worship::before { + content: "\f67f"; } + +.fa-grip-vertical::before { + content: "\f58e"; } + +.fa-arrow-turn-up::before { + content: "\f148"; } + +.fa-level-up::before { + content: "\f148"; } + +.fa-u::before { + content: "\55"; } + +.fa-square-root-variable::before { + content: "\f698"; } + +.fa-square-root-alt::before { + content: "\f698"; } + +.fa-clock::before { + content: "\f017"; } + +.fa-clock-four::before { + content: "\f017"; } + +.fa-backward-step::before { + content: "\f048"; } + +.fa-step-backward::before { + content: "\f048"; } + +.fa-pallet::before { + content: "\f482"; } + +.fa-faucet::before { + content: "\e005"; } + +.fa-baseball-bat-ball::before { + content: "\f432"; } + +.fa-s::before { + content: "\53"; } + +.fa-timeline::before { + content: "\e29c"; } + +.fa-keyboard::before { + content: "\f11c"; } + +.fa-caret-down::before { + content: "\f0d7"; } + +.fa-house-chimney-medical::before { + content: "\f7f2"; } + +.fa-clinic-medical::before { + content: "\f7f2"; } + +.fa-temperature-three-quarters::before { + content: "\f2c8"; } + +.fa-temperature-3::before { + content: "\f2c8"; } + +.fa-thermometer-3::before { + content: "\f2c8"; } + +.fa-thermometer-three-quarters::before { + content: "\f2c8"; } + +.fa-mobile-screen::before { + content: "\f3cf"; } + +.fa-mobile-android-alt::before { + content: "\f3cf"; } + +.fa-plane-up::before { + content: "\e22d"; } + +.fa-piggy-bank::before { + content: "\f4d3"; } + +.fa-battery-half::before { + content: "\f242"; } + +.fa-battery-3::before { + content: "\f242"; } + +.fa-mountain-city::before { + content: "\e52e"; } + +.fa-coins::before { + content: "\f51e"; } + +.fa-khanda::before { + content: "\f66d"; } + +.fa-sliders::before { + content: "\f1de"; } + +.fa-sliders-h::before { + content: "\f1de"; } + +.fa-folder-tree::before { + content: "\f802"; } + +.fa-network-wired::before { + content: "\f6ff"; } + +.fa-map-pin::before { + content: "\f276"; } + +.fa-hamsa::before { + content: "\f665"; } + +.fa-cent-sign::before { + content: "\e3f5"; } + +.fa-flask::before { + content: "\f0c3"; } + +.fa-person-pregnant::before { + content: "\e31e"; } + +.fa-wand-sparkles::before { + content: "\f72b"; } + +.fa-ellipsis-vertical::before { + content: "\f142"; } + +.fa-ellipsis-v::before { + content: "\f142"; } + +.fa-ticket::before { + content: "\f145"; } + +.fa-power-off::before { + content: "\f011"; } + +.fa-right-long::before { + content: "\f30b"; } + +.fa-long-arrow-alt-right::before { + content: "\f30b"; } + +.fa-flag-usa::before { + content: "\f74d"; } + +.fa-laptop-file::before { + content: "\e51d"; } + +.fa-tty::before { + content: "\f1e4"; } + +.fa-teletype::before { + content: "\f1e4"; } + +.fa-diagram-next::before { + content: "\e476"; } + +.fa-person-rifle::before { + content: "\e54e"; } + +.fa-house-medical-circle-exclamation::before { + content: "\e512"; } + +.fa-closed-captioning::before { + content: "\f20a"; } + +.fa-person-hiking::before { + content: "\f6ec"; } + +.fa-hiking::before { + content: "\f6ec"; } + +.fa-venus-double::before { + content: "\f226"; } + +.fa-images::before { + content: "\f302"; } + +.fa-calculator::before { + content: "\f1ec"; } + +.fa-people-pulling::before { + content: "\e535"; } + +.fa-n::before { + content: "\4e"; } + +.fa-cable-car::before { + content: "\f7da"; } + +.fa-tram::before { + content: "\f7da"; } + +.fa-cloud-rain::before { + content: "\f73d"; } + +.fa-building-circle-xmark::before { + content: "\e4d4"; } + +.fa-ship::before { + content: "\f21a"; } + +.fa-arrows-down-to-line::before { + content: "\e4b8"; } + +.fa-download::before { + content: "\f019"; } + +.fa-face-grin::before { + content: "\f580"; } + +.fa-grin::before { + content: "\f580"; } + +.fa-delete-left::before { + content: "\f55a"; } + +.fa-backspace::before { + content: "\f55a"; } + +.fa-eye-dropper::before { + content: "\f1fb"; } + +.fa-eye-dropper-empty::before { + content: "\f1fb"; } + +.fa-eyedropper::before { + content: "\f1fb"; } + +.fa-file-circle-check::before { + content: "\e5a0"; } + +.fa-forward::before { + content: "\f04e"; } + +.fa-mobile::before { + content: "\f3ce"; } + +.fa-mobile-android::before { + content: "\f3ce"; } + +.fa-mobile-phone::before { + content: "\f3ce"; } + +.fa-face-meh::before { + content: "\f11a"; } + +.fa-meh::before { + content: "\f11a"; } + +.fa-align-center::before { + content: "\f037"; } + +.fa-book-skull::before { + content: "\f6b7"; } + +.fa-book-dead::before { + content: "\f6b7"; } + +.fa-id-card::before { + content: "\f2c2"; } + +.fa-drivers-license::before { + content: "\f2c2"; } + +.fa-outdent::before { + content: "\f03b"; } + +.fa-dedent::before { + content: "\f03b"; } + +.fa-heart-circle-exclamation::before { + content: "\e4fe"; } + +.fa-house::before { + content: "\f015"; } + +.fa-home::before { + content: "\f015"; } + +.fa-home-alt::before { + content: "\f015"; } + +.fa-home-lg-alt::before { + content: "\f015"; } + +.fa-calendar-week::before { + content: "\f784"; } + +.fa-laptop-medical::before { + content: "\f812"; } + +.fa-b::before { + content: "\42"; } + +.fa-file-medical::before { + content: "\f477"; } + +.fa-dice-one::before { + content: "\f525"; } + +.fa-kiwi-bird::before { + content: "\f535"; } + +.fa-arrow-right-arrow-left::before { + content: "\f0ec"; } + +.fa-exchange::before { + content: "\f0ec"; } + +.fa-rotate-right::before { + content: "\f2f9"; } + +.fa-redo-alt::before { + content: "\f2f9"; } + +.fa-rotate-forward::before { + content: "\f2f9"; } + +.fa-utensils::before { + content: "\f2e7"; } + +.fa-cutlery::before { + content: "\f2e7"; } + +.fa-arrow-up-wide-short::before { + content: "\f161"; } + +.fa-sort-amount-up::before { + content: "\f161"; } + +.fa-mill-sign::before { + content: "\e1ed"; } + +.fa-bowl-rice::before { + content: "\e2eb"; } + +.fa-skull::before { + content: "\f54c"; } + +.fa-tower-broadcast::before { + content: "\f519"; } + +.fa-broadcast-tower::before { + content: "\f519"; } + +.fa-truck-pickup::before { + content: "\f63c"; } + +.fa-up-long::before { + content: "\f30c"; } + +.fa-long-arrow-alt-up::before { + content: "\f30c"; } + +.fa-stop::before { + content: "\f04d"; } + +.fa-code-merge::before { + content: "\f387"; } + +.fa-upload::before { + content: "\f093"; } + +.fa-hurricane::before { + content: "\f751"; } + +.fa-mound::before { + content: "\e52d"; } + +.fa-toilet-portable::before { + content: "\e583"; } + +.fa-compact-disc::before { + content: "\f51f"; } + +.fa-file-arrow-down::before { + content: "\f56d"; } + +.fa-file-download::before { + content: "\f56d"; } + +.fa-caravan::before { + content: "\f8ff"; } + +.fa-shield-cat::before { + content: "\e572"; } + +.fa-bolt::before { + content: "\f0e7"; } + +.fa-zap::before { + content: "\f0e7"; } + +.fa-glass-water::before { + content: "\e4f4"; } + +.fa-oil-well::before { + content: "\e532"; } + +.fa-vault::before { + content: "\e2c5"; } + +.fa-mars::before { + content: "\f222"; } + +.fa-toilet::before { + content: "\f7d8"; } + +.fa-plane-circle-xmark::before { + content: "\e557"; } + +.fa-yen-sign::before { + content: "\f157"; } + +.fa-cny::before { + content: "\f157"; } + +.fa-jpy::before { + content: "\f157"; } + +.fa-rmb::before { + content: "\f157"; } + +.fa-yen::before { + content: "\f157"; } + +.fa-ruble-sign::before { + content: "\f158"; } + +.fa-rouble::before { + content: "\f158"; } + +.fa-rub::before { + content: "\f158"; } + +.fa-ruble::before { + content: "\f158"; } + +.fa-sun::before { + content: "\f185"; } + +.fa-guitar::before { + content: "\f7a6"; } + +.fa-face-laugh-wink::before { + content: "\f59c"; } + +.fa-laugh-wink::before { + content: "\f59c"; } + +.fa-horse-head::before { + content: "\f7ab"; } + +.fa-bore-hole::before { + content: "\e4c3"; } + +.fa-industry::before { + content: "\f275"; } + +.fa-circle-down::before { + content: "\f358"; } + +.fa-arrow-alt-circle-down::before { + content: "\f358"; } + +.fa-arrows-turn-to-dots::before { + content: "\e4c1"; } + +.fa-florin-sign::before { + content: "\e184"; } + +.fa-arrow-down-short-wide::before { + content: "\f884"; } + +.fa-sort-amount-desc::before { + content: "\f884"; } + +.fa-sort-amount-down-alt::before { + content: "\f884"; } + +.fa-less-than::before { + content: "\3c"; } + +.fa-angle-down::before { + content: "\f107"; } + +.fa-car-tunnel::before { + content: "\e4de"; } + +.fa-head-side-cough::before { + content: "\e061"; } + +.fa-grip-lines::before { + content: "\f7a4"; } + +.fa-thumbs-down::before { + content: "\f165"; } + +.fa-user-lock::before { + content: "\f502"; } + +.fa-arrow-right-long::before { + content: "\f178"; } + +.fa-long-arrow-right::before { + content: "\f178"; } + +.fa-anchor-circle-xmark::before { + content: "\e4ac"; } + +.fa-ellipsis::before { + content: "\f141"; } + +.fa-ellipsis-h::before { + content: "\f141"; } + +.fa-chess-pawn::before { + content: "\f443"; } + +.fa-kit-medical::before { + content: "\f479"; } + +.fa-first-aid::before { + content: "\f479"; } + +.fa-person-through-window::before { + content: "\e5a9"; } + +.fa-toolbox::before { + content: "\f552"; } + +.fa-hands-holding-circle::before { + content: "\e4fb"; } + +.fa-bug::before { + content: "\f188"; } + +.fa-credit-card::before { + content: "\f09d"; } + +.fa-credit-card-alt::before { + content: "\f09d"; } + +.fa-car::before { + content: "\f1b9"; } + +.fa-automobile::before { + content: "\f1b9"; } + +.fa-hand-holding-hand::before { + content: "\e4f7"; } + +.fa-book-open-reader::before { + content: "\f5da"; } + +.fa-book-reader::before { + content: "\f5da"; } + +.fa-mountain-sun::before { + content: "\e52f"; } + +.fa-arrows-left-right-to-line::before { + content: "\e4ba"; } + +.fa-dice-d20::before { + content: "\f6cf"; } + +.fa-truck-droplet::before { + content: "\e58c"; } + +.fa-file-circle-xmark::before { + content: "\e5a1"; } + +.fa-temperature-arrow-up::before { + content: "\e040"; } + +.fa-temperature-up::before { + content: "\e040"; } + +.fa-medal::before { + content: "\f5a2"; } + +.fa-bed::before { + content: "\f236"; } + +.fa-square-h::before { + content: "\f0fd"; } + +.fa-h-square::before { + content: "\f0fd"; } + +.fa-podcast::before { + content: "\f2ce"; } + +.fa-temperature-full::before { + content: "\f2c7"; } + +.fa-temperature-4::before { + content: "\f2c7"; } + +.fa-thermometer-4::before { + content: "\f2c7"; } + +.fa-thermometer-full::before { + content: "\f2c7"; } + +.fa-bell::before { + content: "\f0f3"; } + +.fa-superscript::before { + content: "\f12b"; } + +.fa-plug-circle-xmark::before { + content: "\e560"; } + +.fa-star-of-life::before { + content: "\f621"; } + +.fa-phone-slash::before { + content: "\f3dd"; } + +.fa-paint-roller::before { + content: "\f5aa"; } + +.fa-handshake-angle::before { + content: "\f4c4"; } + +.fa-hands-helping::before { + content: "\f4c4"; } + +.fa-location-dot::before { + content: "\f3c5"; } + +.fa-map-marker-alt::before { + content: "\f3c5"; } + +.fa-file::before { + content: "\f15b"; } + +.fa-greater-than::before { + content: "\3e"; } + +.fa-person-swimming::before { + content: "\f5c4"; } + +.fa-swimmer::before { + content: "\f5c4"; } + +.fa-arrow-down::before { + content: "\f063"; } + +.fa-droplet::before { + content: "\f043"; } + +.fa-tint::before { + content: "\f043"; } + +.fa-eraser::before { + content: "\f12d"; } + +.fa-earth-americas::before { + content: "\f57d"; } + +.fa-earth::before { + content: "\f57d"; } + +.fa-earth-america::before { + content: "\f57d"; } + +.fa-globe-americas::before { + content: "\f57d"; } + +.fa-person-burst::before { + content: "\e53b"; } + +.fa-dove::before { + content: "\f4ba"; } + +.fa-battery-empty::before { + content: "\f244"; } + +.fa-battery-0::before { + content: "\f244"; } + +.fa-socks::before { + content: "\f696"; } + +.fa-inbox::before { + content: "\f01c"; } + +.fa-section::before { + content: "\e447"; } + +.fa-gauge-high::before { + content: "\f625"; } + +.fa-tachometer-alt::before { + content: "\f625"; } + +.fa-tachometer-alt-fast::before { + content: "\f625"; } + +.fa-envelope-open-text::before { + content: "\f658"; } + +.fa-hospital::before { + content: "\f0f8"; } + +.fa-hospital-alt::before { + content: "\f0f8"; } + +.fa-hospital-wide::before { + content: "\f0f8"; } + +.fa-wine-bottle::before { + content: "\f72f"; } + +.fa-chess-rook::before { + content: "\f447"; } + +.fa-bars-staggered::before { + content: "\f550"; } + +.fa-reorder::before { + content: "\f550"; } + +.fa-stream::before { + content: "\f550"; } + +.fa-dharmachakra::before { + content: "\f655"; } + +.fa-hotdog::before { + content: "\f80f"; } + +.fa-person-walking-with-cane::before { + content: "\f29d"; } + +.fa-blind::before { + content: "\f29d"; } + +.fa-drum::before { + content: "\f569"; } + +.fa-ice-cream::before { + content: "\f810"; } + +.fa-heart-circle-bolt::before { + content: "\e4fc"; } + +.fa-fax::before { + content: "\f1ac"; } + +.fa-paragraph::before { + content: "\f1dd"; } + +.fa-check-to-slot::before { + content: "\f772"; } + +.fa-vote-yea::before { + content: "\f772"; } + +.fa-star-half::before { + content: "\f089"; } + +.fa-boxes-stacked::before { + content: "\f468"; } + +.fa-boxes::before { + content: "\f468"; } + +.fa-boxes-alt::before { + content: "\f468"; } + +.fa-link::before { + content: "\f0c1"; } + +.fa-chain::before { + content: "\f0c1"; } + +.fa-ear-listen::before { + content: "\f2a2"; } + +.fa-assistive-listening-systems::before { + content: "\f2a2"; } + +.fa-tree-city::before { + content: "\e587"; } + +.fa-play::before { + content: "\f04b"; } + +.fa-font::before { + content: "\f031"; } + +.fa-table-cells-row-lock::before { + content: "\e67a"; } + +.fa-rupiah-sign::before { + content: "\e23d"; } + +.fa-magnifying-glass::before { + content: "\f002"; } + +.fa-search::before { + content: "\f002"; } + +.fa-table-tennis-paddle-ball::before { + content: "\f45d"; } + +.fa-ping-pong-paddle-ball::before { + content: "\f45d"; } + +.fa-table-tennis::before { + content: "\f45d"; } + +.fa-person-dots-from-line::before { + content: "\f470"; } + +.fa-diagnoses::before { + content: "\f470"; } + +.fa-trash-can-arrow-up::before { + content: "\f82a"; } + +.fa-trash-restore-alt::before { + content: "\f82a"; } + +.fa-naira-sign::before { + content: "\e1f6"; } + +.fa-cart-arrow-down::before { + content: "\f218"; } + +.fa-walkie-talkie::before { + content: "\f8ef"; } + +.fa-file-pen::before { + content: "\f31c"; } + +.fa-file-edit::before { + content: "\f31c"; } + +.fa-receipt::before { + content: "\f543"; } + +.fa-square-pen::before { + content: "\f14b"; } + +.fa-pen-square::before { + content: "\f14b"; } + +.fa-pencil-square::before { + content: "\f14b"; } + +.fa-suitcase-rolling::before { + content: "\f5c1"; } + +.fa-person-circle-exclamation::before { + content: "\e53f"; } + +.fa-chevron-down::before { + content: "\f078"; } + +.fa-battery-full::before { + content: "\f240"; } + +.fa-battery::before { + content: "\f240"; } + +.fa-battery-5::before { + content: "\f240"; } + +.fa-skull-crossbones::before { + content: "\f714"; } + +.fa-code-compare::before { + content: "\e13a"; } + +.fa-list-ul::before { + content: "\f0ca"; } + +.fa-list-dots::before { + content: "\f0ca"; } + +.fa-school-lock::before { + content: "\e56f"; } + +.fa-tower-cell::before { + content: "\e585"; } + +.fa-down-long::before { + content: "\f309"; } + +.fa-long-arrow-alt-down::before { + content: "\f309"; } + +.fa-ranking-star::before { + content: "\e561"; } + +.fa-chess-king::before { + content: "\f43f"; } + +.fa-person-harassing::before { + content: "\e549"; } + +.fa-brazilian-real-sign::before { + content: "\e46c"; } + +.fa-landmark-dome::before { + content: "\f752"; } + +.fa-landmark-alt::before { + content: "\f752"; } + +.fa-arrow-up::before { + content: "\f062"; } + +.fa-tv::before { + content: "\f26c"; } + +.fa-television::before { + content: "\f26c"; } + +.fa-tv-alt::before { + content: "\f26c"; } + +.fa-shrimp::before { + content: "\e448"; } + +.fa-list-check::before { + content: "\f0ae"; } + +.fa-tasks::before { + content: "\f0ae"; } + +.fa-jug-detergent::before { + content: "\e519"; } + +.fa-circle-user::before { + content: "\f2bd"; } + +.fa-user-circle::before { + content: "\f2bd"; } + +.fa-user-shield::before { + content: "\f505"; } + +.fa-wind::before { + content: "\f72e"; } + +.fa-car-burst::before { + content: "\f5e1"; } + +.fa-car-crash::before { + content: "\f5e1"; } + +.fa-y::before { + content: "\59"; } + +.fa-person-snowboarding::before { + content: "\f7ce"; } + +.fa-snowboarding::before { + content: "\f7ce"; } + +.fa-truck-fast::before { + content: "\f48b"; } + +.fa-shipping-fast::before { + content: "\f48b"; } + +.fa-fish::before { + content: "\f578"; } + +.fa-user-graduate::before { + content: "\f501"; } + +.fa-circle-half-stroke::before { + content: "\f042"; } + +.fa-adjust::before { + content: "\f042"; } + +.fa-clapperboard::before { + content: "\e131"; } + +.fa-circle-radiation::before { + content: "\f7ba"; } + +.fa-radiation-alt::before { + content: "\f7ba"; } + +.fa-baseball::before { + content: "\f433"; } + +.fa-baseball-ball::before { + content: "\f433"; } + +.fa-jet-fighter-up::before { + content: "\e518"; } + +.fa-diagram-project::before { + content: "\f542"; } + +.fa-project-diagram::before { + content: "\f542"; } + +.fa-copy::before { + content: "\f0c5"; } + +.fa-volume-xmark::before { + content: "\f6a9"; } + +.fa-volume-mute::before { + content: "\f6a9"; } + +.fa-volume-times::before { + content: "\f6a9"; } + +.fa-hand-sparkles::before { + content: "\e05d"; } + +.fa-grip::before { + content: "\f58d"; } + +.fa-grip-horizontal::before { + content: "\f58d"; } + +.fa-share-from-square::before { + content: "\f14d"; } + +.fa-share-square::before { + content: "\f14d"; } + +.fa-child-combatant::before { + content: "\e4e0"; } + +.fa-child-rifle::before { + content: "\e4e0"; } + +.fa-gun::before { + content: "\e19b"; } + +.fa-square-phone::before { + content: "\f098"; } + +.fa-phone-square::before { + content: "\f098"; } + +.fa-plus::before { + content: "\2b"; } + +.fa-add::before { + content: "\2b"; } + +.fa-expand::before { + content: "\f065"; } + +.fa-computer::before { + content: "\e4e5"; } + +.fa-xmark::before { + content: "\f00d"; } + +.fa-close::before { + content: "\f00d"; } + +.fa-multiply::before { + content: "\f00d"; } + +.fa-remove::before { + content: "\f00d"; } + +.fa-times::before { + content: "\f00d"; } + +.fa-arrows-up-down-left-right::before { + content: "\f047"; } + +.fa-arrows::before { + content: "\f047"; } + +.fa-chalkboard-user::before { + content: "\f51c"; } + +.fa-chalkboard-teacher::before { + content: "\f51c"; } + +.fa-peso-sign::before { + content: "\e222"; } + +.fa-building-shield::before { + content: "\e4d8"; } + +.fa-baby::before { + content: "\f77c"; } + +.fa-users-line::before { + content: "\e592"; } + +.fa-quote-left::before { + content: "\f10d"; } + +.fa-quote-left-alt::before { + content: "\f10d"; } + +.fa-tractor::before { + content: "\f722"; } + +.fa-trash-arrow-up::before { + content: "\f829"; } + +.fa-trash-restore::before { + content: "\f829"; } + +.fa-arrow-down-up-lock::before { + content: "\e4b0"; } + +.fa-lines-leaning::before { + content: "\e51e"; } + +.fa-ruler-combined::before { + content: "\f546"; } + +.fa-copyright::before { + content: "\f1f9"; } + +.fa-equals::before { + content: "\3d"; } + +.fa-blender::before { + content: "\f517"; } + +.fa-teeth::before { + content: "\f62e"; } + +.fa-shekel-sign::before { + content: "\f20b"; } + +.fa-ils::before { + content: "\f20b"; } + +.fa-shekel::before { + content: "\f20b"; } + +.fa-sheqel::before { + content: "\f20b"; } + +.fa-sheqel-sign::before { + content: "\f20b"; } + +.fa-map::before { + content: "\f279"; } + +.fa-rocket::before { + content: "\f135"; } + +.fa-photo-film::before { + content: "\f87c"; } + +.fa-photo-video::before { + content: "\f87c"; } + +.fa-folder-minus::before { + content: "\f65d"; } + +.fa-store::before { + content: "\f54e"; } + +.fa-arrow-trend-up::before { + content: "\e098"; } + +.fa-plug-circle-minus::before { + content: "\e55e"; } + +.fa-sign-hanging::before { + content: "\f4d9"; } + +.fa-sign::before { + content: "\f4d9"; } + +.fa-bezier-curve::before { + content: "\f55b"; } + +.fa-bell-slash::before { + content: "\f1f6"; } + +.fa-tablet::before { + content: "\f3fb"; } + +.fa-tablet-android::before { + content: "\f3fb"; } + +.fa-school-flag::before { + content: "\e56e"; } + +.fa-fill::before { + content: "\f575"; } + +.fa-angle-up::before { + content: "\f106"; } + +.fa-drumstick-bite::before { + content: "\f6d7"; } + +.fa-holly-berry::before { + content: "\f7aa"; } + +.fa-chevron-left::before { + content: "\f053"; } + +.fa-bacteria::before { + content: "\e059"; } + +.fa-hand-lizard::before { + content: "\f258"; } + +.fa-notdef::before { + content: "\e1fe"; } + +.fa-disease::before { + content: "\f7fa"; } + +.fa-briefcase-medical::before { + content: "\f469"; } + +.fa-genderless::before { + content: "\f22d"; } + +.fa-chevron-right::before { + content: "\f054"; } + +.fa-retweet::before { + content: "\f079"; } + +.fa-car-rear::before { + content: "\f5de"; } + +.fa-car-alt::before { + content: "\f5de"; } + +.fa-pump-soap::before { + content: "\e06b"; } + +.fa-video-slash::before { + content: "\f4e2"; } + +.fa-battery-quarter::before { + content: "\f243"; } + +.fa-battery-2::before { + content: "\f243"; } + +.fa-radio::before { + content: "\f8d7"; } + +.fa-baby-carriage::before { + content: "\f77d"; } + +.fa-carriage-baby::before { + content: "\f77d"; } + +.fa-traffic-light::before { + content: "\f637"; } + +.fa-thermometer::before { + content: "\f491"; } + +.fa-vr-cardboard::before { + content: "\f729"; } + +.fa-hand-middle-finger::before { + content: "\f806"; } + +.fa-percent::before { + content: "\25"; } + +.fa-percentage::before { + content: "\25"; } + +.fa-truck-moving::before { + content: "\f4df"; } + +.fa-glass-water-droplet::before { + content: "\e4f5"; } + +.fa-display::before { + content: "\e163"; } + +.fa-face-smile::before { + content: "\f118"; } + +.fa-smile::before { + content: "\f118"; } + +.fa-thumbtack::before { + content: "\f08d"; } + +.fa-thumb-tack::before { + content: "\f08d"; } + +.fa-trophy::before { + content: "\f091"; } + +.fa-person-praying::before { + content: "\f683"; } + +.fa-pray::before { + content: "\f683"; } + +.fa-hammer::before { + content: "\f6e3"; } + +.fa-hand-peace::before { + content: "\f25b"; } + +.fa-rotate::before { + content: "\f2f1"; } + +.fa-sync-alt::before { + content: "\f2f1"; } + +.fa-spinner::before { + content: "\f110"; } + +.fa-robot::before { + content: "\f544"; } + +.fa-peace::before { + content: "\f67c"; } + +.fa-gears::before { + content: "\f085"; } + +.fa-cogs::before { + content: "\f085"; } + +.fa-warehouse::before { + content: "\f494"; } + +.fa-arrow-up-right-dots::before { + content: "\e4b7"; } + +.fa-splotch::before { + content: "\f5bc"; } + +.fa-face-grin-hearts::before { + content: "\f584"; } + +.fa-grin-hearts::before { + content: "\f584"; } + +.fa-dice-four::before { + content: "\f524"; } + +.fa-sim-card::before { + content: "\f7c4"; } + +.fa-transgender::before { + content: "\f225"; } + +.fa-transgender-alt::before { + content: "\f225"; } + +.fa-mercury::before { + content: "\f223"; } + +.fa-arrow-turn-down::before { + content: "\f149"; } + +.fa-level-down::before { + content: "\f149"; } + +.fa-person-falling-burst::before { + content: "\e547"; } + +.fa-award::before { + content: "\f559"; } + +.fa-ticket-simple::before { + content: "\f3ff"; } + +.fa-ticket-alt::before { + content: "\f3ff"; } + +.fa-building::before { + content: "\f1ad"; } + +.fa-angles-left::before { + content: "\f100"; } + +.fa-angle-double-left::before { + content: "\f100"; } + +.fa-qrcode::before { + content: "\f029"; } + +.fa-clock-rotate-left::before { + content: "\f1da"; } + +.fa-history::before { + content: "\f1da"; } + +.fa-face-grin-beam-sweat::before { + content: "\f583"; } + +.fa-grin-beam-sweat::before { + content: "\f583"; } + +.fa-file-export::before { + content: "\f56e"; } + +.fa-arrow-right-from-file::before { + content: "\f56e"; } + +.fa-shield::before { + content: "\f132"; } + +.fa-shield-blank::before { + content: "\f132"; } + +.fa-arrow-up-short-wide::before { + content: "\f885"; } + +.fa-sort-amount-up-alt::before { + content: "\f885"; } + +.fa-house-medical::before { + content: "\e3b2"; } + +.fa-golf-ball-tee::before { + content: "\f450"; } + +.fa-golf-ball::before { + content: "\f450"; } + +.fa-circle-chevron-left::before { + content: "\f137"; } + +.fa-chevron-circle-left::before { + content: "\f137"; } + +.fa-house-chimney-window::before { + content: "\e00d"; } + +.fa-pen-nib::before { + content: "\f5ad"; } + +.fa-tent-arrow-turn-left::before { + content: "\e580"; } + +.fa-tents::before { + content: "\e582"; } + +.fa-wand-magic::before { + content: "\f0d0"; } + +.fa-magic::before { + content: "\f0d0"; } + +.fa-dog::before { + content: "\f6d3"; } + +.fa-carrot::before { + content: "\f787"; } + +.fa-moon::before { + content: "\f186"; } + +.fa-wine-glass-empty::before { + content: "\f5ce"; } + +.fa-wine-glass-alt::before { + content: "\f5ce"; } + +.fa-cheese::before { + content: "\f7ef"; } + +.fa-yin-yang::before { + content: "\f6ad"; } + +.fa-music::before { + content: "\f001"; } + +.fa-code-commit::before { + content: "\f386"; } + +.fa-temperature-low::before { + content: "\f76b"; } + +.fa-person-biking::before { + content: "\f84a"; } + +.fa-biking::before { + content: "\f84a"; } + +.fa-broom::before { + content: "\f51a"; } + +.fa-shield-heart::before { + content: "\e574"; } + +.fa-gopuram::before { + content: "\f664"; } + +.fa-earth-oceania::before { + content: "\e47b"; } + +.fa-globe-oceania::before { + content: "\e47b"; } + +.fa-square-xmark::before { + content: "\f2d3"; } + +.fa-times-square::before { + content: "\f2d3"; } + +.fa-xmark-square::before { + content: "\f2d3"; } + +.fa-hashtag::before { + content: "\23"; } + +.fa-up-right-and-down-left-from-center::before { + content: "\f424"; } + +.fa-expand-alt::before { + content: "\f424"; } + +.fa-oil-can::before { + content: "\f613"; } + +.fa-t::before { + content: "\54"; } + +.fa-hippo::before { + content: "\f6ed"; } + +.fa-chart-column::before { + content: "\e0e3"; } + +.fa-infinity::before { + content: "\f534"; } + +.fa-vial-circle-check::before { + content: "\e596"; } + +.fa-person-arrow-down-to-line::before { + content: "\e538"; } + +.fa-voicemail::before { + content: "\f897"; } + +.fa-fan::before { + content: "\f863"; } + +.fa-person-walking-luggage::before { + content: "\e554"; } + +.fa-up-down::before { + content: "\f338"; } + +.fa-arrows-alt-v::before { + content: "\f338"; } + +.fa-cloud-moon-rain::before { + content: "\f73c"; } + +.fa-calendar::before { + content: "\f133"; } + +.fa-trailer::before { + content: "\e041"; } + +.fa-bahai::before { + content: "\f666"; } + +.fa-haykal::before { + content: "\f666"; } + +.fa-sd-card::before { + content: "\f7c2"; } + +.fa-dragon::before { + content: "\f6d5"; } + +.fa-shoe-prints::before { + content: "\f54b"; } + +.fa-circle-plus::before { + content: "\f055"; } + +.fa-plus-circle::before { + content: "\f055"; } + +.fa-face-grin-tongue-wink::before { + content: "\f58b"; } + +.fa-grin-tongue-wink::before { + content: "\f58b"; } + +.fa-hand-holding::before { + content: "\f4bd"; } + +.fa-plug-circle-exclamation::before { + content: "\e55d"; } + +.fa-link-slash::before { + content: "\f127"; } + +.fa-chain-broken::before { + content: "\f127"; } + +.fa-chain-slash::before { + content: "\f127"; } + +.fa-unlink::before { + content: "\f127"; } + +.fa-clone::before { + content: "\f24d"; } + +.fa-person-walking-arrow-loop-left::before { + content: "\e551"; } + +.fa-arrow-up-z-a::before { + content: "\f882"; } + +.fa-sort-alpha-up-alt::before { + content: "\f882"; } + +.fa-fire-flame-curved::before { + content: "\f7e4"; } + +.fa-fire-alt::before { + content: "\f7e4"; } + +.fa-tornado::before { + content: "\f76f"; } + +.fa-file-circle-plus::before { + content: "\e494"; } + +.fa-book-quran::before { + content: "\f687"; } + +.fa-quran::before { + content: "\f687"; } + +.fa-anchor::before { + content: "\f13d"; } + +.fa-border-all::before { + content: "\f84c"; } + +.fa-face-angry::before { + content: "\f556"; } + +.fa-angry::before { + content: "\f556"; } + +.fa-cookie-bite::before { + content: "\f564"; } + +.fa-arrow-trend-down::before { + content: "\e097"; } + +.fa-rss::before { + content: "\f09e"; } + +.fa-feed::before { + content: "\f09e"; } + +.fa-draw-polygon::before { + content: "\f5ee"; } + +.fa-scale-balanced::before { + content: "\f24e"; } + +.fa-balance-scale::before { + content: "\f24e"; } + +.fa-gauge-simple-high::before { + content: "\f62a"; } + +.fa-tachometer::before { + content: "\f62a"; } + +.fa-tachometer-fast::before { + content: "\f62a"; } + +.fa-shower::before { + content: "\f2cc"; } + +.fa-desktop::before { + content: "\f390"; } + +.fa-desktop-alt::before { + content: "\f390"; } + +.fa-m::before { + content: "\4d"; } + +.fa-table-list::before { + content: "\f00b"; } + +.fa-th-list::before { + content: "\f00b"; } + +.fa-comment-sms::before { + content: "\f7cd"; } + +.fa-sms::before { + content: "\f7cd"; } + +.fa-book::before { + content: "\f02d"; } + +.fa-user-plus::before { + content: "\f234"; } + +.fa-check::before { + content: "\f00c"; } + +.fa-battery-three-quarters::before { + content: "\f241"; } + +.fa-battery-4::before { + content: "\f241"; } + +.fa-house-circle-check::before { + content: "\e509"; } + +.fa-angle-left::before { + content: "\f104"; } + +.fa-diagram-successor::before { + content: "\e47a"; } + +.fa-truck-arrow-right::before { + content: "\e58b"; } + +.fa-arrows-split-up-and-left::before { + content: "\e4bc"; } + +.fa-hand-fist::before { + content: "\f6de"; } + +.fa-fist-raised::before { + content: "\f6de"; } + +.fa-cloud-moon::before { + content: "\f6c3"; } + +.fa-briefcase::before { + content: "\f0b1"; } + +.fa-person-falling::before { + content: "\e546"; } + +.fa-image-portrait::before { + content: "\f3e0"; } + +.fa-portrait::before { + content: "\f3e0"; } + +.fa-user-tag::before { + content: "\f507"; } + +.fa-rug::before { + content: "\e569"; } + +.fa-earth-europe::before { + content: "\f7a2"; } + +.fa-globe-europe::before { + content: "\f7a2"; } + +.fa-cart-flatbed-suitcase::before { + content: "\f59d"; } + +.fa-luggage-cart::before { + content: "\f59d"; } + +.fa-rectangle-xmark::before { + content: "\f410"; } + +.fa-rectangle-times::before { + content: "\f410"; } + +.fa-times-rectangle::before { + content: "\f410"; } + +.fa-window-close::before { + content: "\f410"; } + +.fa-baht-sign::before { + content: "\e0ac"; } + +.fa-book-open::before { + content: "\f518"; } + +.fa-book-journal-whills::before { + content: "\f66a"; } + +.fa-journal-whills::before { + content: "\f66a"; } + +.fa-handcuffs::before { + content: "\e4f8"; } + +.fa-triangle-exclamation::before { + content: "\f071"; } + +.fa-exclamation-triangle::before { + content: "\f071"; } + +.fa-warning::before { + content: "\f071"; } + +.fa-database::before { + content: "\f1c0"; } + +.fa-share::before { + content: "\f064"; } + +.fa-mail-forward::before { + content: "\f064"; } + +.fa-bottle-droplet::before { + content: "\e4c4"; } + +.fa-mask-face::before { + content: "\e1d7"; } + +.fa-hill-rockslide::before { + content: "\e508"; } + +.fa-right-left::before { + content: "\f362"; } + +.fa-exchange-alt::before { + content: "\f362"; } + +.fa-paper-plane::before { + content: "\f1d8"; } + +.fa-road-circle-exclamation::before { + content: "\e565"; } + +.fa-dungeon::before { + content: "\f6d9"; } + +.fa-align-right::before { + content: "\f038"; } + +.fa-money-bill-1-wave::before { + content: "\f53b"; } + +.fa-money-bill-wave-alt::before { + content: "\f53b"; } + +.fa-life-ring::before { + content: "\f1cd"; } + +.fa-hands::before { + content: "\f2a7"; } + +.fa-sign-language::before { + content: "\f2a7"; } + +.fa-signing::before { + content: "\f2a7"; } + +.fa-calendar-day::before { + content: "\f783"; } + +.fa-water-ladder::before { + content: "\f5c5"; } + +.fa-ladder-water::before { + content: "\f5c5"; } + +.fa-swimming-pool::before { + content: "\f5c5"; } + +.fa-arrows-up-down::before { + content: "\f07d"; } + +.fa-arrows-v::before { + content: "\f07d"; } + +.fa-face-grimace::before { + content: "\f57f"; } + +.fa-grimace::before { + content: "\f57f"; } + +.fa-wheelchair-move::before { + content: "\e2ce"; } + +.fa-wheelchair-alt::before { + content: "\e2ce"; } + +.fa-turn-down::before { + content: "\f3be"; } + +.fa-level-down-alt::before { + content: "\f3be"; } + +.fa-person-walking-arrow-right::before { + content: "\e552"; } + +.fa-square-envelope::before { + content: "\f199"; } + +.fa-envelope-square::before { + content: "\f199"; } + +.fa-dice::before { + content: "\f522"; } + +.fa-bowling-ball::before { + content: "\f436"; } + +.fa-brain::before { + content: "\f5dc"; } + +.fa-bandage::before { + content: "\f462"; } + +.fa-band-aid::before { + content: "\f462"; } + +.fa-calendar-minus::before { + content: "\f272"; } + +.fa-circle-xmark::before { + content: "\f057"; } + +.fa-times-circle::before { + content: "\f057"; } + +.fa-xmark-circle::before { + content: "\f057"; } + +.fa-gifts::before { + content: "\f79c"; } + +.fa-hotel::before { + content: "\f594"; } + +.fa-earth-asia::before { + content: "\f57e"; } + +.fa-globe-asia::before { + content: "\f57e"; } + +.fa-id-card-clip::before { + content: "\f47f"; } + +.fa-id-card-alt::before { + content: "\f47f"; } + +.fa-magnifying-glass-plus::before { + content: "\f00e"; } + +.fa-search-plus::before { + content: "\f00e"; } + +.fa-thumbs-up::before { + content: "\f164"; } + +.fa-user-clock::before { + content: "\f4fd"; } + +.fa-hand-dots::before { + content: "\f461"; } + +.fa-allergies::before { + content: "\f461"; } + +.fa-file-invoice::before { + content: "\f570"; } + +.fa-window-minimize::before { + content: "\f2d1"; } + +.fa-mug-saucer::before { + content: "\f0f4"; } + +.fa-coffee::before { + content: "\f0f4"; } + +.fa-brush::before { + content: "\f55d"; } + +.fa-mask::before { + content: "\f6fa"; } + +.fa-magnifying-glass-minus::before { + content: "\f010"; } + +.fa-search-minus::before { + content: "\f010"; } + +.fa-ruler-vertical::before { + content: "\f548"; } + +.fa-user-large::before { + content: "\f406"; } + +.fa-user-alt::before { + content: "\f406"; } + +.fa-train-tram::before { + content: "\e5b4"; } + +.fa-user-nurse::before { + content: "\f82f"; } + +.fa-syringe::before { + content: "\f48e"; } + +.fa-cloud-sun::before { + content: "\f6c4"; } + +.fa-stopwatch-20::before { + content: "\e06f"; } + +.fa-square-full::before { + content: "\f45c"; } + +.fa-magnet::before { + content: "\f076"; } + +.fa-jar::before { + content: "\e516"; } + +.fa-note-sticky::before { + content: "\f249"; } + +.fa-sticky-note::before { + content: "\f249"; } + +.fa-bug-slash::before { + content: "\e490"; } + +.fa-arrow-up-from-water-pump::before { + content: "\e4b6"; } + +.fa-bone::before { + content: "\f5d7"; } + +.fa-user-injured::before { + content: "\f728"; } + +.fa-face-sad-tear::before { + content: "\f5b4"; } + +.fa-sad-tear::before { + content: "\f5b4"; } + +.fa-plane::before { + content: "\f072"; } + +.fa-tent-arrows-down::before { + content: "\e581"; } + +.fa-exclamation::before { + content: "\21"; } + +.fa-arrows-spin::before { + content: "\e4bb"; } + +.fa-print::before { + content: "\f02f"; } + +.fa-turkish-lira-sign::before { + content: "\e2bb"; } + +.fa-try::before { + content: "\e2bb"; } + +.fa-turkish-lira::before { + content: "\e2bb"; } + +.fa-dollar-sign::before { + content: "\24"; } + +.fa-dollar::before { + content: "\24"; } + +.fa-usd::before { + content: "\24"; } + +.fa-x::before { + content: "\58"; } + +.fa-magnifying-glass-dollar::before { + content: "\f688"; } + +.fa-search-dollar::before { + content: "\f688"; } + +.fa-users-gear::before { + content: "\f509"; } + +.fa-users-cog::before { + content: "\f509"; } + +.fa-person-military-pointing::before { + content: "\e54a"; } + +.fa-building-columns::before { + content: "\f19c"; } + +.fa-bank::before { + content: "\f19c"; } + +.fa-institution::before { + content: "\f19c"; } + +.fa-museum::before { + content: "\f19c"; } + +.fa-university::before { + content: "\f19c"; } + +.fa-umbrella::before { + content: "\f0e9"; } + +.fa-trowel::before { + content: "\e589"; } + +.fa-d::before { + content: "\44"; } + +.fa-stapler::before { + content: "\e5af"; } + +.fa-masks-theater::before { + content: "\f630"; } + +.fa-theater-masks::before { + content: "\f630"; } + +.fa-kip-sign::before { + content: "\e1c4"; } + +.fa-hand-point-left::before { + content: "\f0a5"; } + +.fa-handshake-simple::before { + content: "\f4c6"; } + +.fa-handshake-alt::before { + content: "\f4c6"; } + +.fa-jet-fighter::before { + content: "\f0fb"; } + +.fa-fighter-jet::before { + content: "\f0fb"; } + +.fa-square-share-nodes::before { + content: "\f1e1"; } + +.fa-share-alt-square::before { + content: "\f1e1"; } + +.fa-barcode::before { + content: "\f02a"; } + +.fa-plus-minus::before { + content: "\e43c"; } + +.fa-video::before { + content: "\f03d"; } + +.fa-video-camera::before { + content: "\f03d"; } + +.fa-graduation-cap::before { + content: "\f19d"; } + +.fa-mortar-board::before { + content: "\f19d"; } + +.fa-hand-holding-medical::before { + content: "\e05c"; } + +.fa-person-circle-check::before { + content: "\e53e"; } + +.fa-turn-up::before { + content: "\f3bf"; } + +.fa-level-up-alt::before { + content: "\f3bf"; } + +.sr-only, +.fa-sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; } + +.sr-only-focusable:not(:focus), +.fa-sr-only-focusable:not(:focus) { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; } +:root, :host { + --fa-style-family-brands: 'Font Awesome 6 Brands'; + --fa-font-brands: normal 400 1em/1 'Font Awesome 6 Brands'; } + +@font-face { + font-family: 'Font Awesome 6 Brands'; + font-style: normal; + font-weight: 400; + font-display: block; + src: url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.ttf") format("truetype"); } + +.fab, +.fa-brands { + font-weight: 400; } + +.fa-monero:before { + content: "\f3d0"; } + +.fa-hooli:before { + content: "\f427"; } + +.fa-yelp:before { + content: "\f1e9"; } + +.fa-cc-visa:before { + content: "\f1f0"; } + +.fa-lastfm:before { + content: "\f202"; } + +.fa-shopware:before { + content: "\f5b5"; } + +.fa-creative-commons-nc:before { + content: "\f4e8"; } + +.fa-aws:before { + content: "\f375"; } + +.fa-redhat:before { + content: "\f7bc"; } + +.fa-yoast:before { + content: "\f2b1"; } + +.fa-cloudflare:before { + content: "\e07d"; } + +.fa-ups:before { + content: "\f7e0"; } + +.fa-pixiv:before { + content: "\e640"; } + +.fa-wpexplorer:before { + content: "\f2de"; } + +.fa-dyalog:before { + content: "\f399"; } + +.fa-bity:before { + content: "\f37a"; } + +.fa-stackpath:before { + content: "\f842"; } + +.fa-buysellads:before { + content: "\f20d"; } + +.fa-first-order:before { + content: "\f2b0"; } + +.fa-modx:before { + content: "\f285"; } + +.fa-guilded:before { + content: "\e07e"; } + +.fa-vnv:before { + content: "\f40b"; } + +.fa-square-js:before { + content: "\f3b9"; } + +.fa-js-square:before { + content: "\f3b9"; } + +.fa-microsoft:before { + content: "\f3ca"; } + +.fa-qq:before { + content: "\f1d6"; } + +.fa-orcid:before { + content: "\f8d2"; } + +.fa-java:before { + content: "\f4e4"; } + +.fa-invision:before { + content: "\f7b0"; } + +.fa-creative-commons-pd-alt:before { + content: "\f4ed"; } + +.fa-centercode:before { + content: "\f380"; } + +.fa-glide-g:before { + content: "\f2a6"; } + +.fa-drupal:before { + content: "\f1a9"; } + +.fa-jxl:before { + content: "\e67b"; } + +.fa-hire-a-helper:before { + content: "\f3b0"; } + +.fa-creative-commons-by:before { + content: "\f4e7"; } + +.fa-unity:before { + content: "\e049"; } + +.fa-whmcs:before { + content: "\f40d"; } + +.fa-rocketchat:before { + content: "\f3e8"; } + +.fa-vk:before { + content: "\f189"; } + +.fa-untappd:before { + content: "\f405"; } + +.fa-mailchimp:before { + content: "\f59e"; } + +.fa-css3-alt:before { + content: "\f38b"; } + +.fa-square-reddit:before { + content: "\f1a2"; } + +.fa-reddit-square:before { + content: "\f1a2"; } + +.fa-vimeo-v:before { + content: "\f27d"; } + +.fa-contao:before { + content: "\f26d"; } + +.fa-square-font-awesome:before { + content: "\e5ad"; } + +.fa-deskpro:before { + content: "\f38f"; } + +.fa-brave:before { + content: "\e63c"; } + +.fa-sistrix:before { + content: "\f3ee"; } + +.fa-square-instagram:before { + content: "\e055"; } + +.fa-instagram-square:before { + content: "\e055"; } + +.fa-battle-net:before { + content: "\f835"; } + +.fa-the-red-yeti:before { + content: "\f69d"; } + +.fa-square-hacker-news:before { + content: "\f3af"; } + +.fa-hacker-news-square:before { + content: "\f3af"; } + +.fa-edge:before { + content: "\f282"; } + +.fa-threads:before { + content: "\e618"; } + +.fa-napster:before { + content: "\f3d2"; } + +.fa-square-snapchat:before { + content: "\f2ad"; } + +.fa-snapchat-square:before { + content: "\f2ad"; } + +.fa-google-plus-g:before { + content: "\f0d5"; } + +.fa-artstation:before { + content: "\f77a"; } + +.fa-markdown:before { + content: "\f60f"; } + +.fa-sourcetree:before { + content: "\f7d3"; } + +.fa-google-plus:before { + content: "\f2b3"; } + +.fa-diaspora:before { + content: "\f791"; } + +.fa-foursquare:before { + content: "\f180"; } + +.fa-stack-overflow:before { + content: "\f16c"; } + +.fa-github-alt:before { + content: "\f113"; } + +.fa-phoenix-squadron:before { + content: "\f511"; } + +.fa-pagelines:before { + content: "\f18c"; } + +.fa-algolia:before { + content: "\f36c"; } + +.fa-red-river:before { + content: "\f3e3"; } + +.fa-creative-commons-sa:before { + content: "\f4ef"; } + +.fa-safari:before { + content: "\f267"; } + +.fa-google:before { + content: "\f1a0"; } + +.fa-square-font-awesome-stroke:before { + content: "\f35c"; } + +.fa-font-awesome-alt:before { + content: "\f35c"; } + +.fa-atlassian:before { + content: "\f77b"; } + +.fa-linkedin-in:before { + content: "\f0e1"; } + +.fa-digital-ocean:before { + content: "\f391"; } + +.fa-nimblr:before { + content: "\f5a8"; } + +.fa-chromecast:before { + content: "\f838"; } + +.fa-evernote:before { + content: "\f839"; } + +.fa-hacker-news:before { + content: "\f1d4"; } + +.fa-creative-commons-sampling:before { + content: "\f4f0"; } + +.fa-adversal:before { + content: "\f36a"; } + +.fa-creative-commons:before { + content: "\f25e"; } + +.fa-watchman-monitoring:before { + content: "\e087"; } + +.fa-fonticons:before { + content: "\f280"; } + +.fa-weixin:before { + content: "\f1d7"; } + +.fa-shirtsinbulk:before { + content: "\f214"; } + +.fa-codepen:before { + content: "\f1cb"; } + +.fa-git-alt:before { + content: "\f841"; } + +.fa-lyft:before { + content: "\f3c3"; } + +.fa-rev:before { + content: "\f5b2"; } + +.fa-windows:before { + content: "\f17a"; } + +.fa-wizards-of-the-coast:before { + content: "\f730"; } + +.fa-square-viadeo:before { + content: "\f2aa"; } + +.fa-viadeo-square:before { + content: "\f2aa"; } + +.fa-meetup:before { + content: "\f2e0"; } + +.fa-centos:before { + content: "\f789"; } + +.fa-adn:before { + content: "\f170"; } + +.fa-cloudsmith:before { + content: "\f384"; } + +.fa-opensuse:before { + content: "\e62b"; } + +.fa-pied-piper-alt:before { + content: "\f1a8"; } + +.fa-square-dribbble:before { + content: "\f397"; } + +.fa-dribbble-square:before { + content: "\f397"; } + +.fa-codiepie:before { + content: "\f284"; } + +.fa-node:before { + content: "\f419"; } + +.fa-mix:before { + content: "\f3cb"; } + +.fa-steam:before { + content: "\f1b6"; } + +.fa-cc-apple-pay:before { + content: "\f416"; } + +.fa-scribd:before { + content: "\f28a"; } + +.fa-debian:before { + content: "\e60b"; } + +.fa-openid:before { + content: "\f19b"; } + +.fa-instalod:before { + content: "\e081"; } + +.fa-expeditedssl:before { + content: "\f23e"; } + +.fa-sellcast:before { + content: "\f2da"; } + +.fa-square-twitter:before { + content: "\f081"; } + +.fa-twitter-square:before { + content: "\f081"; } + +.fa-r-project:before { + content: "\f4f7"; } + +.fa-delicious:before { + content: "\f1a5"; } + +.fa-freebsd:before { + content: "\f3a4"; } + +.fa-vuejs:before { + content: "\f41f"; } + +.fa-accusoft:before { + content: "\f369"; } + +.fa-ioxhost:before { + content: "\f208"; } + +.fa-fonticons-fi:before { + content: "\f3a2"; } + +.fa-app-store:before { + content: "\f36f"; } + +.fa-cc-mastercard:before { + content: "\f1f1"; } + +.fa-itunes-note:before { + content: "\f3b5"; } + +.fa-golang:before { + content: "\e40f"; } + +.fa-kickstarter:before { + content: "\f3bb"; } + +.fa-square-kickstarter:before { + content: "\f3bb"; } + +.fa-grav:before { + content: "\f2d6"; } + +.fa-weibo:before { + content: "\f18a"; } + +.fa-uncharted:before { + content: "\e084"; } + +.fa-firstdraft:before { + content: "\f3a1"; } + +.fa-square-youtube:before { + content: "\f431"; } + +.fa-youtube-square:before { + content: "\f431"; } + +.fa-wikipedia-w:before { + content: "\f266"; } + +.fa-wpressr:before { + content: "\f3e4"; } + +.fa-rendact:before { + content: "\f3e4"; } + +.fa-angellist:before { + content: "\f209"; } + +.fa-galactic-republic:before { + content: "\f50c"; } + +.fa-nfc-directional:before { + content: "\e530"; } + +.fa-skype:before { + content: "\f17e"; } + +.fa-joget:before { + content: "\f3b7"; } + +.fa-fedora:before { + content: "\f798"; } + +.fa-stripe-s:before { + content: "\f42a"; } + +.fa-meta:before { + content: "\e49b"; } + +.fa-laravel:before { + content: "\f3bd"; } + +.fa-hotjar:before { + content: "\f3b1"; } + +.fa-bluetooth-b:before { + content: "\f294"; } + +.fa-square-letterboxd:before { + content: "\e62e"; } + +.fa-sticker-mule:before { + content: "\f3f7"; } + +.fa-creative-commons-zero:before { + content: "\f4f3"; } + +.fa-hips:before { + content: "\f452"; } + +.fa-behance:before { + content: "\f1b4"; } + +.fa-reddit:before { + content: "\f1a1"; } + +.fa-discord:before { + content: "\f392"; } + +.fa-chrome:before { + content: "\f268"; } + +.fa-app-store-ios:before { + content: "\f370"; } + +.fa-cc-discover:before { + content: "\f1f2"; } + +.fa-wpbeginner:before { + content: "\f297"; } + +.fa-confluence:before { + content: "\f78d"; } + +.fa-shoelace:before { + content: "\e60c"; } + +.fa-mdb:before { + content: "\f8ca"; } + +.fa-dochub:before { + content: "\f394"; } + +.fa-accessible-icon:before { + content: "\f368"; } + +.fa-ebay:before { + content: "\f4f4"; } + +.fa-amazon:before { + content: "\f270"; } + +.fa-unsplash:before { + content: "\e07c"; } + +.fa-yarn:before { + content: "\f7e3"; } + +.fa-square-steam:before { + content: "\f1b7"; } + +.fa-steam-square:before { + content: "\f1b7"; } + +.fa-500px:before { + content: "\f26e"; } + +.fa-square-vimeo:before { + content: "\f194"; } + +.fa-vimeo-square:before { + content: "\f194"; } + +.fa-asymmetrik:before { + content: "\f372"; } + +.fa-font-awesome:before { + content: "\f2b4"; } + +.fa-font-awesome-flag:before { + content: "\f2b4"; } + +.fa-font-awesome-logo-full:before { + content: "\f2b4"; } + +.fa-gratipay:before { + content: "\f184"; } + +.fa-apple:before { + content: "\f179"; } + +.fa-hive:before { + content: "\e07f"; } + +.fa-gitkraken:before { + content: "\f3a6"; } + +.fa-keybase:before { + content: "\f4f5"; } + +.fa-apple-pay:before { + content: "\f415"; } + +.fa-padlet:before { + content: "\e4a0"; } + +.fa-amazon-pay:before { + content: "\f42c"; } + +.fa-square-github:before { + content: "\f092"; } + +.fa-github-square:before { + content: "\f092"; } + +.fa-stumbleupon:before { + content: "\f1a4"; } + +.fa-fedex:before { + content: "\f797"; } + +.fa-phoenix-framework:before { + content: "\f3dc"; } + +.fa-shopify:before { + content: "\e057"; } + +.fa-neos:before { + content: "\f612"; } + +.fa-square-threads:before { + content: "\e619"; } + +.fa-hackerrank:before { + content: "\f5f7"; } + +.fa-researchgate:before { + content: "\f4f8"; } + +.fa-swift:before { + content: "\f8e1"; } + +.fa-angular:before { + content: "\f420"; } + +.fa-speakap:before { + content: "\f3f3"; } + +.fa-angrycreative:before { + content: "\f36e"; } + +.fa-y-combinator:before { + content: "\f23b"; } + +.fa-empire:before { + content: "\f1d1"; } + +.fa-envira:before { + content: "\f299"; } + +.fa-google-scholar:before { + content: "\e63b"; } + +.fa-square-gitlab:before { + content: "\e5ae"; } + +.fa-gitlab-square:before { + content: "\e5ae"; } + +.fa-studiovinari:before { + content: "\f3f8"; } + +.fa-pied-piper:before { + content: "\f2ae"; } + +.fa-wordpress:before { + content: "\f19a"; } + +.fa-product-hunt:before { + content: "\f288"; } + +.fa-firefox:before { + content: "\f269"; } + +.fa-linode:before { + content: "\f2b8"; } + +.fa-goodreads:before { + content: "\f3a8"; } + +.fa-square-odnoklassniki:before { + content: "\f264"; } + +.fa-odnoklassniki-square:before { + content: "\f264"; } + +.fa-jsfiddle:before { + content: "\f1cc"; } + +.fa-sith:before { + content: "\f512"; } + +.fa-themeisle:before { + content: "\f2b2"; } + +.fa-page4:before { + content: "\f3d7"; } + +.fa-hashnode:before { + content: "\e499"; } + +.fa-react:before { + content: "\f41b"; } + +.fa-cc-paypal:before { + content: "\f1f4"; } + +.fa-squarespace:before { + content: "\f5be"; } + +.fa-cc-stripe:before { + content: "\f1f5"; } + +.fa-creative-commons-share:before { + content: "\f4f2"; } + +.fa-bitcoin:before { + content: "\f379"; } + +.fa-keycdn:before { + content: "\f3ba"; } + +.fa-opera:before { + content: "\f26a"; } + +.fa-itch-io:before { + content: "\f83a"; } + +.fa-umbraco:before { + content: "\f8e8"; } + +.fa-galactic-senate:before { + content: "\f50d"; } + +.fa-ubuntu:before { + content: "\f7df"; } + +.fa-draft2digital:before { + content: "\f396"; } + +.fa-stripe:before { + content: "\f429"; } + +.fa-houzz:before { + content: "\f27c"; } + +.fa-gg:before { + content: "\f260"; } + +.fa-dhl:before { + content: "\f790"; } + +.fa-square-pinterest:before { + content: "\f0d3"; } + +.fa-pinterest-square:before { + content: "\f0d3"; } + +.fa-xing:before { + content: "\f168"; } + +.fa-blackberry:before { + content: "\f37b"; } + +.fa-creative-commons-pd:before { + content: "\f4ec"; } + +.fa-playstation:before { + content: "\f3df"; } + +.fa-quinscape:before { + content: "\f459"; } + +.fa-less:before { + content: "\f41d"; } + +.fa-blogger-b:before { + content: "\f37d"; } + +.fa-opencart:before { + content: "\f23d"; } + +.fa-vine:before { + content: "\f1ca"; } + +.fa-signal-messenger:before { + content: "\e663"; } + +.fa-paypal:before { + content: "\f1ed"; } + +.fa-gitlab:before { + content: "\f296"; } + +.fa-typo3:before { + content: "\f42b"; } + +.fa-reddit-alien:before { + content: "\f281"; } + +.fa-yahoo:before { + content: "\f19e"; } + +.fa-dailymotion:before { + content: "\e052"; } + +.fa-affiliatetheme:before { + content: "\f36b"; } + +.fa-pied-piper-pp:before { + content: "\f1a7"; } + +.fa-bootstrap:before { + content: "\f836"; } + +.fa-odnoklassniki:before { + content: "\f263"; } + +.fa-nfc-symbol:before { + content: "\e531"; } + +.fa-mintbit:before { + content: "\e62f"; } + +.fa-ethereum:before { + content: "\f42e"; } + +.fa-speaker-deck:before { + content: "\f83c"; } + +.fa-creative-commons-nc-eu:before { + content: "\f4e9"; } + +.fa-patreon:before { + content: "\f3d9"; } + +.fa-avianex:before { + content: "\f374"; } + +.fa-ello:before { + content: "\f5f1"; } + +.fa-gofore:before { + content: "\f3a7"; } + +.fa-bimobject:before { + content: "\f378"; } + +.fa-brave-reverse:before { + content: "\e63d"; } + +.fa-facebook-f:before { + content: "\f39e"; } + +.fa-square-google-plus:before { + content: "\f0d4"; } + +.fa-google-plus-square:before { + content: "\f0d4"; } + +.fa-web-awesome:before { + content: "\e682"; } + +.fa-mandalorian:before { + content: "\f50f"; } + +.fa-first-order-alt:before { + content: "\f50a"; } + +.fa-osi:before { + content: "\f41a"; } + +.fa-google-wallet:before { + content: "\f1ee"; } + +.fa-d-and-d-beyond:before { + content: "\f6ca"; } + +.fa-periscope:before { + content: "\f3da"; } + +.fa-fulcrum:before { + content: "\f50b"; } + +.fa-cloudscale:before { + content: "\f383"; } + +.fa-forumbee:before { + content: "\f211"; } + +.fa-mizuni:before { + content: "\f3cc"; } + +.fa-schlix:before { + content: "\f3ea"; } + +.fa-square-xing:before { + content: "\f169"; } + +.fa-xing-square:before { + content: "\f169"; } + +.fa-bandcamp:before { + content: "\f2d5"; } + +.fa-wpforms:before { + content: "\f298"; } + +.fa-cloudversify:before { + content: "\f385"; } + +.fa-usps:before { + content: "\f7e1"; } + +.fa-megaport:before { + content: "\f5a3"; } + +.fa-magento:before { + content: "\f3c4"; } + +.fa-spotify:before { + content: "\f1bc"; } + +.fa-optin-monster:before { + content: "\f23c"; } + +.fa-fly:before { + content: "\f417"; } + +.fa-aviato:before { + content: "\f421"; } + +.fa-itunes:before { + content: "\f3b4"; } + +.fa-cuttlefish:before { + content: "\f38c"; } + +.fa-blogger:before { + content: "\f37c"; } + +.fa-flickr:before { + content: "\f16e"; } + +.fa-viber:before { + content: "\f409"; } + +.fa-soundcloud:before { + content: "\f1be"; } + +.fa-digg:before { + content: "\f1a6"; } + +.fa-tencent-weibo:before { + content: "\f1d5"; } + +.fa-letterboxd:before { + content: "\e62d"; } + +.fa-symfony:before { + content: "\f83d"; } + +.fa-maxcdn:before { + content: "\f136"; } + +.fa-etsy:before { + content: "\f2d7"; } + +.fa-facebook-messenger:before { + content: "\f39f"; } + +.fa-audible:before { + content: "\f373"; } + +.fa-think-peaks:before { + content: "\f731"; } + +.fa-bilibili:before { + content: "\e3d9"; } + +.fa-erlang:before { + content: "\f39d"; } + +.fa-x-twitter:before { + content: "\e61b"; } + +.fa-cotton-bureau:before { + content: "\f89e"; } + +.fa-dashcube:before { + content: "\f210"; } + +.fa-42-group:before { + content: "\e080"; } + +.fa-innosoft:before { + content: "\e080"; } + +.fa-stack-exchange:before { + content: "\f18d"; } + +.fa-elementor:before { + content: "\f430"; } + +.fa-square-pied-piper:before { + content: "\e01e"; } + +.fa-pied-piper-square:before { + content: "\e01e"; } + +.fa-creative-commons-nd:before { + content: "\f4eb"; } + +.fa-palfed:before { + content: "\f3d8"; } + +.fa-superpowers:before { + content: "\f2dd"; } + +.fa-resolving:before { + content: "\f3e7"; } + +.fa-xbox:before { + content: "\f412"; } + +.fa-square-web-awesome-stroke:before { + content: "\e684"; } + +.fa-searchengin:before { + content: "\f3eb"; } + +.fa-tiktok:before { + content: "\e07b"; } + +.fa-square-facebook:before { + content: "\f082"; } + +.fa-facebook-square:before { + content: "\f082"; } + +.fa-renren:before { + content: "\f18b"; } + +.fa-linux:before { + content: "\f17c"; } + +.fa-glide:before { + content: "\f2a5"; } + +.fa-linkedin:before { + content: "\f08c"; } + +.fa-hubspot:before { + content: "\f3b2"; } + +.fa-deploydog:before { + content: "\f38e"; } + +.fa-twitch:before { + content: "\f1e8"; } + +.fa-ravelry:before { + content: "\f2d9"; } + +.fa-mixer:before { + content: "\e056"; } + +.fa-square-lastfm:before { + content: "\f203"; } + +.fa-lastfm-square:before { + content: "\f203"; } + +.fa-vimeo:before { + content: "\f40a"; } + +.fa-mendeley:before { + content: "\f7b3"; } + +.fa-uniregistry:before { + content: "\f404"; } + +.fa-figma:before { + content: "\f799"; } + +.fa-creative-commons-remix:before { + content: "\f4ee"; } + +.fa-cc-amazon-pay:before { + content: "\f42d"; } + +.fa-dropbox:before { + content: "\f16b"; } + +.fa-instagram:before { + content: "\f16d"; } + +.fa-cmplid:before { + content: "\e360"; } + +.fa-upwork:before { + content: "\e641"; } + +.fa-facebook:before { + content: "\f09a"; } + +.fa-gripfire:before { + content: "\f3ac"; } + +.fa-jedi-order:before { + content: "\f50e"; } + +.fa-uikit:before { + content: "\f403"; } + +.fa-fort-awesome-alt:before { + content: "\f3a3"; } + +.fa-phabricator:before { + content: "\f3db"; } + +.fa-ussunnah:before { + content: "\f407"; } + +.fa-earlybirds:before { + content: "\f39a"; } + +.fa-trade-federation:before { + content: "\f513"; } + +.fa-autoprefixer:before { + content: "\f41c"; } + +.fa-whatsapp:before { + content: "\f232"; } + +.fa-square-upwork:before { + content: "\e67c"; } + +.fa-slideshare:before { + content: "\f1e7"; } + +.fa-google-play:before { + content: "\f3ab"; } + +.fa-viadeo:before { + content: "\f2a9"; } + +.fa-line:before { + content: "\f3c0"; } + +.fa-google-drive:before { + content: "\f3aa"; } + +.fa-servicestack:before { + content: "\f3ec"; } + +.fa-simplybuilt:before { + content: "\f215"; } + +.fa-bitbucket:before { + content: "\f171"; } + +.fa-imdb:before { + content: "\f2d8"; } + +.fa-deezer:before { + content: "\e077"; } + +.fa-raspberry-pi:before { + content: "\f7bb"; } + +.fa-jira:before { + content: "\f7b1"; } + +.fa-docker:before { + content: "\f395"; } + +.fa-screenpal:before { + content: "\e570"; } + +.fa-bluetooth:before { + content: "\f293"; } + +.fa-gitter:before { + content: "\f426"; } + +.fa-d-and-d:before { + content: "\f38d"; } + +.fa-microblog:before { + content: "\e01a"; } + +.fa-cc-diners-club:before { + content: "\f24c"; } + +.fa-gg-circle:before { + content: "\f261"; } + +.fa-pied-piper-hat:before { + content: "\f4e5"; } + +.fa-kickstarter-k:before { + content: "\f3bc"; } + +.fa-yandex:before { + content: "\f413"; } + +.fa-readme:before { + content: "\f4d5"; } + +.fa-html5:before { + content: "\f13b"; } + +.fa-sellsy:before { + content: "\f213"; } + +.fa-square-web-awesome:before { + content: "\e683"; } + +.fa-sass:before { + content: "\f41e"; } + +.fa-wirsindhandwerk:before { + content: "\e2d0"; } + +.fa-wsh:before { + content: "\e2d0"; } + +.fa-buromobelexperte:before { + content: "\f37f"; } + +.fa-salesforce:before { + content: "\f83b"; } + +.fa-octopus-deploy:before { + content: "\e082"; } + +.fa-medapps:before { + content: "\f3c6"; } + +.fa-ns8:before { + content: "\f3d5"; } + +.fa-pinterest-p:before { + content: "\f231"; } + +.fa-apper:before { + content: "\f371"; } + +.fa-fort-awesome:before { + content: "\f286"; } + +.fa-waze:before { + content: "\f83f"; } + +.fa-bluesky:before { + content: "\e671"; } + +.fa-cc-jcb:before { + content: "\f24b"; } + +.fa-snapchat:before { + content: "\f2ab"; } + +.fa-snapchat-ghost:before { + content: "\f2ab"; } + +.fa-fantasy-flight-games:before { + content: "\f6dc"; } + +.fa-rust:before { + content: "\e07a"; } + +.fa-wix:before { + content: "\f5cf"; } + +.fa-square-behance:before { + content: "\f1b5"; } + +.fa-behance-square:before { + content: "\f1b5"; } + +.fa-supple:before { + content: "\f3f9"; } + +.fa-webflow:before { + content: "\e65c"; } + +.fa-rebel:before { + content: "\f1d0"; } + +.fa-css3:before { + content: "\f13c"; } + +.fa-staylinked:before { + content: "\f3f5"; } + +.fa-kaggle:before { + content: "\f5fa"; } + +.fa-space-awesome:before { + content: "\e5ac"; } + +.fa-deviantart:before { + content: "\f1bd"; } + +.fa-cpanel:before { + content: "\f388"; } + +.fa-goodreads-g:before { + content: "\f3a9"; } + +.fa-square-git:before { + content: "\f1d2"; } + +.fa-git-square:before { + content: "\f1d2"; } + +.fa-square-tumblr:before { + content: "\f174"; } + +.fa-tumblr-square:before { + content: "\f174"; } + +.fa-trello:before { + content: "\f181"; } + +.fa-creative-commons-nc-jp:before { + content: "\f4ea"; } + +.fa-get-pocket:before { + content: "\f265"; } + +.fa-perbyte:before { + content: "\e083"; } + +.fa-grunt:before { + content: "\f3ad"; } + +.fa-weebly:before { + content: "\f5cc"; } + +.fa-connectdevelop:before { + content: "\f20e"; } + +.fa-leanpub:before { + content: "\f212"; } + +.fa-black-tie:before { + content: "\f27e"; } + +.fa-themeco:before { + content: "\f5c6"; } + +.fa-python:before { + content: "\f3e2"; } + +.fa-android:before { + content: "\f17b"; } + +.fa-bots:before { + content: "\e340"; } + +.fa-free-code-camp:before { + content: "\f2c5"; } + +.fa-hornbill:before { + content: "\f592"; } + +.fa-js:before { + content: "\f3b8"; } + +.fa-ideal:before { + content: "\e013"; } + +.fa-git:before { + content: "\f1d3"; } + +.fa-dev:before { + content: "\f6cc"; } + +.fa-sketch:before { + content: "\f7c6"; } + +.fa-yandex-international:before { + content: "\f414"; } + +.fa-cc-amex:before { + content: "\f1f3"; } + +.fa-uber:before { + content: "\f402"; } + +.fa-github:before { + content: "\f09b"; } + +.fa-php:before { + content: "\f457"; } + +.fa-alipay:before { + content: "\f642"; } + +.fa-youtube:before { + content: "\f167"; } + +.fa-skyatlas:before { + content: "\f216"; } + +.fa-firefox-browser:before { + content: "\e007"; } + +.fa-replyd:before { + content: "\f3e6"; } + +.fa-suse:before { + content: "\f7d6"; } + +.fa-jenkins:before { + content: "\f3b6"; } + +.fa-twitter:before { + content: "\f099"; } + +.fa-rockrms:before { + content: "\f3e9"; } + +.fa-pinterest:before { + content: "\f0d2"; } + +.fa-buffer:before { + content: "\f837"; } + +.fa-npm:before { + content: "\f3d4"; } + +.fa-yammer:before { + content: "\f840"; } + +.fa-btc:before { + content: "\f15a"; } + +.fa-dribbble:before { + content: "\f17d"; } + +.fa-stumbleupon-circle:before { + content: "\f1a3"; } + +.fa-internet-explorer:before { + content: "\f26b"; } + +.fa-stubber:before { + content: "\e5c7"; } + +.fa-telegram:before { + content: "\f2c6"; } + +.fa-telegram-plane:before { + content: "\f2c6"; } + +.fa-old-republic:before { + content: "\f510"; } + +.fa-odysee:before { + content: "\e5c6"; } + +.fa-square-whatsapp:before { + content: "\f40c"; } + +.fa-whatsapp-square:before { + content: "\f40c"; } + +.fa-node-js:before { + content: "\f3d3"; } + +.fa-edge-legacy:before { + content: "\e078"; } + +.fa-slack:before { + content: "\f198"; } + +.fa-slack-hash:before { + content: "\f198"; } + +.fa-medrt:before { + content: "\f3c8"; } + +.fa-usb:before { + content: "\f287"; } + +.fa-tumblr:before { + content: "\f173"; } + +.fa-vaadin:before { + content: "\f408"; } + +.fa-quora:before { + content: "\f2c4"; } + +.fa-square-x-twitter:before { + content: "\e61a"; } + +.fa-reacteurope:before { + content: "\f75d"; } + +.fa-medium:before { + content: "\f23a"; } + +.fa-medium-m:before { + content: "\f23a"; } + +.fa-amilia:before { + content: "\f36d"; } + +.fa-mixcloud:before { + content: "\f289"; } + +.fa-flipboard:before { + content: "\f44d"; } + +.fa-viacoin:before { + content: "\f237"; } + +.fa-critical-role:before { + content: "\f6c9"; } + +.fa-sitrox:before { + content: "\e44a"; } + +.fa-discourse:before { + content: "\f393"; } + +.fa-joomla:before { + content: "\f1aa"; } + +.fa-mastodon:before { + content: "\f4f6"; } + +.fa-airbnb:before { + content: "\f834"; } + +.fa-wolf-pack-battalion:before { + content: "\f514"; } + +.fa-buy-n-large:before { + content: "\f8a6"; } + +.fa-gulp:before { + content: "\f3ae"; } + +.fa-creative-commons-sampling-plus:before { + content: "\f4f1"; } + +.fa-strava:before { + content: "\f428"; } + +.fa-ember:before { + content: "\f423"; } + +.fa-canadian-maple-leaf:before { + content: "\f785"; } + +.fa-teamspeak:before { + content: "\f4f9"; } + +.fa-pushed:before { + content: "\f3e1"; } + +.fa-wordpress-simple:before { + content: "\f411"; } + +.fa-nutritionix:before { + content: "\f3d6"; } + +.fa-wodu:before { + content: "\e088"; } + +.fa-google-pay:before { + content: "\e079"; } + +.fa-intercom:before { + content: "\f7af"; } + +.fa-zhihu:before { + content: "\f63f"; } + +.fa-korvue:before { + content: "\f42f"; } + +.fa-pix:before { + content: "\e43a"; } + +.fa-steam-symbol:before { + content: "\f3f6"; } +:root, :host { + --fa-style-family-classic: 'Font Awesome 6 Free'; + --fa-font-regular: normal 400 1em/1 'Font Awesome 6 Free'; } + +@font-face { + font-family: 'Font Awesome 6 Free'; + font-style: normal; + font-weight: 400; + font-display: block; + src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); } + +.far, +.fa-regular { + font-weight: 400; } +:root, :host { + --fa-style-family-classic: 'Font Awesome 6 Free'; + --fa-font-solid: normal 900 1em/1 'Font Awesome 6 Free'; } + +@font-face { + font-family: 'Font Awesome 6 Free'; + font-style: normal; + font-weight: 900; + font-display: block; + src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); } + +.fas, +.fa-solid { + font-weight: 900; } +@font-face { + font-family: 'Font Awesome 5 Brands'; + font-display: block; + font-weight: 400; + src: url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.ttf") format("truetype"); } + +@font-face { + font-family: 'Font Awesome 5 Free'; + font-display: block; + font-weight: 900; + src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); } + +@font-face { + font-family: 'Font Awesome 5 Free'; + font-display: block; + font-weight: 400; + src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); } +@font-face { + font-family: 'FontAwesome'; + font-display: block; + src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); } + +@font-face { + font-family: 'FontAwesome'; + font-display: block; + src: url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.ttf") format("truetype"); } + +@font-face { + font-family: 'FontAwesome'; + font-display: block; + src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); } + +@font-face { + font-family: 'FontAwesome'; + font-display: block; + src: url("../webfonts/fa-v4compatibility.woff2") format("woff2"), url("../webfonts/fa-v4compatibility.ttf") format("truetype"); } diff --git a/deps/font-awesome-6.5.2/css/all.min.css b/deps/font-awesome-6.5.2/css/all.min.css new file mode 100644 index 0000000..269bcee --- /dev/null +++ b/deps/font-awesome-6.5.2/css/all.min.css @@ -0,0 +1,9 @@ +/*! + * Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2024 Fonticons, Inc. + */ +.fa{font-family:var(--fa-style-family,"Font Awesome 6 Free");font-weight:var(--fa-style,900)}.fa,.fa-brands,.fa-classic,.fa-regular,.fa-sharp,.fa-solid,.fab,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:var(--fa-display,inline-block);font-style:normal;font-variant:normal;line-height:1;text-rendering:auto}.fa-classic,.fa-regular,.fa-solid,.far,.fas{font-family:"Font Awesome 6 Free"}.fa-brands,.fab{font-family:"Font Awesome 6 Brands"}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-2xs{font-size:.625em;line-height:.1em;vertical-align:.225em}.fa-xs{font-size:.75em;line-height:.08333em;vertical-align:.125em}.fa-sm{font-size:.875em;line-height:.07143em;vertical-align:.05357em}.fa-lg{font-size:1.25em;line-height:.05em;vertical-align:-.075em}.fa-xl{font-size:1.5em;line-height:.04167em;vertical-align:-.125em}.fa-2xl{font-size:2em;line-height:.03125em;vertical-align:-.1875em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:var(--fa-li-margin,2.5em);padding-left:0}.fa-ul>li{position:relative}.fa-li{left:calc(var(--fa-li-width, 2em)*-1);position:absolute;text-align:center;width:var(--fa-li-width,2em);line-height:inherit}.fa-border{border-radius:var(--fa-border-radius,.1em);border:var(--fa-border-width,.08em) var(--fa-border-style,solid) var(--fa-border-color,#eee);padding:var(--fa-border-padding,.2em .25em .15em)}.fa-pull-left{float:left;margin-right:var(--fa-pull-margin,.3em)}.fa-pull-right{float:right;margin-left:var(--fa-pull-margin,.3em)}.fa-beat{-webkit-animation-name:fa-beat;animation-name:fa-beat;-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,ease-in-out);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-bounce{-webkit-animation-name:fa-bounce;animation-name:fa-bounce;-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1))}.fa-fade{-webkit-animation-name:fa-fade;animation-name:fa-fade;-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-beat-fade,.fa-fade{-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s)}.fa-beat-fade{-webkit-animation-name:fa-beat-fade;animation-name:fa-beat-fade;-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-flip{-webkit-animation-name:fa-flip;animation-name:fa-flip;-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,ease-in-out);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-shake{-webkit-animation-name:fa-shake;animation-name:fa-shake;-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,linear);animation-timing-function:var(--fa-animation-timing,linear)}.fa-shake,.fa-spin{-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal)}.fa-spin{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-duration:var(--fa-animation-duration,2s);animation-duration:var(--fa-animation-duration,2s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,linear);animation-timing-function:var(--fa-animation-timing,linear)}.fa-spin-reverse{--fa-animation-direction:reverse}.fa-pulse,.fa-spin-pulse{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,steps(8));animation-timing-function:var(--fa-animation-timing,steps(8))}@media (prefers-reduced-motion:reduce){.fa-beat,.fa-beat-fade,.fa-bounce,.fa-fade,.fa-flip,.fa-pulse,.fa-shake,.fa-spin,.fa-spin-pulse{-webkit-animation-delay:-1ms;animation-delay:-1ms;-webkit-animation-duration:1ms;animation-duration:1ms;-webkit-animation-iteration-count:1;animation-iteration-count:1;-webkit-transition-delay:0s;transition-delay:0s;-webkit-transition-duration:0s;transition-duration:0s}}@-webkit-keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale,1.25));transform:scale(var(--fa-beat-scale,1.25))}}@keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale,1.25));transform:scale(var(--fa-beat-scale,1.25))}}@-webkit-keyframes fa-bounce{0%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em));transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{-webkit-transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em));transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em))}64%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}to{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}}@keyframes fa-bounce{0%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em));transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{-webkit-transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em));transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em))}64%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}to{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}}@-webkit-keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@-webkit-keyframes fa-beat-fade{0%,to{opacity:var(--fa-beat-fade-opacity,.4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale,1.125));transform:scale(var(--fa-beat-fade-scale,1.125))}}@keyframes fa-beat-fade{0%,to{opacity:var(--fa-beat-fade-opacity,.4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale,1.125));transform:scale(var(--fa-beat-fade-scale,1.125))}}@-webkit-keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg));transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg));transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@-webkit-keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}8%,24%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}40%,to{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}8%,24%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}40%,to{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}.fa-rotate-by{-webkit-transform:rotate(var(--fa-rotate-angle,0));transform:rotate(var(--fa-rotate-angle,0))}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%;z-index:var(--fa-stack-z-index,auto)}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:var(--fa-inverse,#fff)} + +.fa-0:before{content:"\30"}.fa-1:before{content:"\31"}.fa-2:before{content:"\32"}.fa-3:before{content:"\33"}.fa-4:before{content:"\34"}.fa-5:before{content:"\35"}.fa-6:before{content:"\36"}.fa-7:before{content:"\37"}.fa-8:before{content:"\38"}.fa-9:before{content:"\39"}.fa-fill-drip:before{content:"\f576"}.fa-arrows-to-circle:before{content:"\e4bd"}.fa-chevron-circle-right:before,.fa-circle-chevron-right:before{content:"\f138"}.fa-at:before{content:"\40"}.fa-trash-alt:before,.fa-trash-can:before{content:"\f2ed"}.fa-text-height:before{content:"\f034"}.fa-user-times:before,.fa-user-xmark:before{content:"\f235"}.fa-stethoscope:before{content:"\f0f1"}.fa-comment-alt:before,.fa-message:before{content:"\f27a"}.fa-info:before{content:"\f129"}.fa-compress-alt:before,.fa-down-left-and-up-right-to-center:before{content:"\f422"}.fa-explosion:before{content:"\e4e9"}.fa-file-alt:before,.fa-file-lines:before,.fa-file-text:before{content:"\f15c"}.fa-wave-square:before{content:"\f83e"}.fa-ring:before{content:"\f70b"}.fa-building-un:before{content:"\e4d9"}.fa-dice-three:before{content:"\f527"}.fa-calendar-alt:before,.fa-calendar-days:before{content:"\f073"}.fa-anchor-circle-check:before{content:"\e4aa"}.fa-building-circle-arrow-right:before{content:"\e4d1"}.fa-volleyball-ball:before,.fa-volleyball:before{content:"\f45f"}.fa-arrows-up-to-line:before{content:"\e4c2"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-circle-minus:before,.fa-minus-circle:before{content:"\f056"}.fa-door-open:before{content:"\f52b"}.fa-right-from-bracket:before,.fa-sign-out-alt:before{content:"\f2f5"}.fa-atom:before{content:"\f5d2"}.fa-soap:before{content:"\e06e"}.fa-heart-music-camera-bolt:before,.fa-icons:before{content:"\f86d"}.fa-microphone-alt-slash:before,.fa-microphone-lines-slash:before{content:"\f539"}.fa-bridge-circle-check:before{content:"\e4c9"}.fa-pump-medical:before{content:"\e06a"}.fa-fingerprint:before{content:"\f577"}.fa-hand-point-right:before{content:"\f0a4"}.fa-magnifying-glass-location:before,.fa-search-location:before{content:"\f689"}.fa-forward-step:before,.fa-step-forward:before{content:"\f051"}.fa-face-smile-beam:before,.fa-smile-beam:before{content:"\f5b8"}.fa-flag-checkered:before{content:"\f11e"}.fa-football-ball:before,.fa-football:before{content:"\f44e"}.fa-school-circle-exclamation:before{content:"\e56c"}.fa-crop:before{content:"\f125"}.fa-angle-double-down:before,.fa-angles-down:before{content:"\f103"}.fa-users-rectangle:before{content:"\e594"}.fa-people-roof:before{content:"\e537"}.fa-people-line:before{content:"\e534"}.fa-beer-mug-empty:before,.fa-beer:before{content:"\f0fc"}.fa-diagram-predecessor:before{content:"\e477"}.fa-arrow-up-long:before,.fa-long-arrow-up:before{content:"\f176"}.fa-burn:before,.fa-fire-flame-simple:before{content:"\f46a"}.fa-male:before,.fa-person:before{content:"\f183"}.fa-laptop:before{content:"\f109"}.fa-file-csv:before{content:"\f6dd"}.fa-menorah:before{content:"\f676"}.fa-truck-plane:before{content:"\e58f"}.fa-record-vinyl:before{content:"\f8d9"}.fa-face-grin-stars:before,.fa-grin-stars:before{content:"\f587"}.fa-bong:before{content:"\f55c"}.fa-pastafarianism:before,.fa-spaghetti-monster-flying:before{content:"\f67b"}.fa-arrow-down-up-across-line:before{content:"\e4af"}.fa-spoon:before,.fa-utensil-spoon:before{content:"\f2e5"}.fa-jar-wheat:before{content:"\e517"}.fa-envelopes-bulk:before,.fa-mail-bulk:before{content:"\f674"}.fa-file-circle-exclamation:before{content:"\e4eb"}.fa-circle-h:before,.fa-hospital-symbol:before{content:"\f47e"}.fa-pager:before{content:"\f815"}.fa-address-book:before,.fa-contact-book:before{content:"\f2b9"}.fa-strikethrough:before{content:"\f0cc"}.fa-k:before{content:"\4b"}.fa-landmark-flag:before{content:"\e51c"}.fa-pencil-alt:before,.fa-pencil:before{content:"\f303"}.fa-backward:before{content:"\f04a"}.fa-caret-right:before{content:"\f0da"}.fa-comments:before{content:"\f086"}.fa-file-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-code-pull-request:before{content:"\e13c"}.fa-clipboard-list:before{content:"\f46d"}.fa-truck-loading:before,.fa-truck-ramp-box:before{content:"\f4de"}.fa-user-check:before{content:"\f4fc"}.fa-vial-virus:before{content:"\e597"}.fa-sheet-plastic:before{content:"\e571"}.fa-blog:before{content:"\f781"}.fa-user-ninja:before{content:"\f504"}.fa-person-arrow-up-from-line:before{content:"\e539"}.fa-scroll-torah:before,.fa-torah:before{content:"\f6a0"}.fa-broom-ball:before,.fa-quidditch-broom-ball:before,.fa-quidditch:before{content:"\f458"}.fa-toggle-off:before{content:"\f204"}.fa-archive:before,.fa-box-archive:before{content:"\f187"}.fa-person-drowning:before{content:"\e545"}.fa-arrow-down-9-1:before,.fa-sort-numeric-desc:before,.fa-sort-numeric-down-alt:before{content:"\f886"}.fa-face-grin-tongue-squint:before,.fa-grin-tongue-squint:before{content:"\f58a"}.fa-spray-can:before{content:"\f5bd"}.fa-truck-monster:before{content:"\f63b"}.fa-w:before{content:"\57"}.fa-earth-africa:before,.fa-globe-africa:before{content:"\f57c"}.fa-rainbow:before{content:"\f75b"}.fa-circle-notch:before{content:"\f1ce"}.fa-tablet-alt:before,.fa-tablet-screen-button:before{content:"\f3fa"}.fa-paw:before{content:"\f1b0"}.fa-cloud:before{content:"\f0c2"}.fa-trowel-bricks:before{content:"\e58a"}.fa-face-flushed:before,.fa-flushed:before{content:"\f579"}.fa-hospital-user:before{content:"\f80d"}.fa-tent-arrow-left-right:before{content:"\e57f"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-binoculars:before{content:"\f1e5"}.fa-microphone-slash:before{content:"\f131"}.fa-box-tissue:before{content:"\e05b"}.fa-motorcycle:before{content:"\f21c"}.fa-bell-concierge:before,.fa-concierge-bell:before{content:"\f562"}.fa-pen-ruler:before,.fa-pencil-ruler:before{content:"\f5ae"}.fa-people-arrows-left-right:before,.fa-people-arrows:before{content:"\e068"}.fa-mars-and-venus-burst:before{content:"\e523"}.fa-caret-square-right:before,.fa-square-caret-right:before{content:"\f152"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-sun-plant-wilt:before{content:"\e57a"}.fa-toilets-portable:before{content:"\e584"}.fa-hockey-puck:before{content:"\f453"}.fa-table:before{content:"\f0ce"}.fa-magnifying-glass-arrow-right:before{content:"\e521"}.fa-digital-tachograph:before,.fa-tachograph-digital:before{content:"\f566"}.fa-users-slash:before{content:"\e073"}.fa-clover:before{content:"\e139"}.fa-mail-reply:before,.fa-reply:before{content:"\f3e5"}.fa-star-and-crescent:before{content:"\f699"}.fa-house-fire:before{content:"\e50c"}.fa-minus-square:before,.fa-square-minus:before{content:"\f146"}.fa-helicopter:before{content:"\f533"}.fa-compass:before{content:"\f14e"}.fa-caret-square-down:before,.fa-square-caret-down:before{content:"\f150"}.fa-file-circle-question:before{content:"\e4ef"}.fa-laptop-code:before{content:"\f5fc"}.fa-swatchbook:before{content:"\f5c3"}.fa-prescription-bottle:before{content:"\f485"}.fa-bars:before,.fa-navicon:before{content:"\f0c9"}.fa-people-group:before{content:"\e533"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-heart-broken:before,.fa-heart-crack:before{content:"\f7a9"}.fa-external-link-square-alt:before,.fa-square-up-right:before{content:"\f360"}.fa-face-kiss-beam:before,.fa-kiss-beam:before{content:"\f597"}.fa-film:before{content:"\f008"}.fa-ruler-horizontal:before{content:"\f547"}.fa-people-robbery:before{content:"\e536"}.fa-lightbulb:before{content:"\f0eb"}.fa-caret-left:before{content:"\f0d9"}.fa-circle-exclamation:before,.fa-exclamation-circle:before{content:"\f06a"}.fa-school-circle-xmark:before{content:"\e56d"}.fa-arrow-right-from-bracket:before,.fa-sign-out:before{content:"\f08b"}.fa-chevron-circle-down:before,.fa-circle-chevron-down:before{content:"\f13a"}.fa-unlock-alt:before,.fa-unlock-keyhole:before{content:"\f13e"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-headphones-alt:before,.fa-headphones-simple:before{content:"\f58f"}.fa-sitemap:before{content:"\f0e8"}.fa-circle-dollar-to-slot:before,.fa-donate:before{content:"\f4b9"}.fa-memory:before{content:"\f538"}.fa-road-spikes:before{content:"\e568"}.fa-fire-burner:before{content:"\e4f1"}.fa-flag:before{content:"\f024"}.fa-hanukiah:before{content:"\f6e6"}.fa-feather:before{content:"\f52d"}.fa-volume-down:before,.fa-volume-low:before{content:"\f027"}.fa-comment-slash:before{content:"\f4b3"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-compress:before{content:"\f066"}.fa-wheat-alt:before,.fa-wheat-awn:before{content:"\e2cd"}.fa-ankh:before{content:"\f644"}.fa-hands-holding-child:before{content:"\e4fa"}.fa-asterisk:before{content:"\2a"}.fa-check-square:before,.fa-square-check:before{content:"\f14a"}.fa-peseta-sign:before{content:"\e221"}.fa-header:before,.fa-heading:before{content:"\f1dc"}.fa-ghost:before{content:"\f6e2"}.fa-list-squares:before,.fa-list:before{content:"\f03a"}.fa-phone-square-alt:before,.fa-square-phone-flip:before{content:"\f87b"}.fa-cart-plus:before{content:"\f217"}.fa-gamepad:before{content:"\f11b"}.fa-circle-dot:before,.fa-dot-circle:before{content:"\f192"}.fa-dizzy:before,.fa-face-dizzy:before{content:"\f567"}.fa-egg:before{content:"\f7fb"}.fa-house-medical-circle-xmark:before{content:"\e513"}.fa-campground:before{content:"\f6bb"}.fa-folder-plus:before{content:"\f65e"}.fa-futbol-ball:before,.fa-futbol:before,.fa-soccer-ball:before{content:"\f1e3"}.fa-paint-brush:before,.fa-paintbrush:before{content:"\f1fc"}.fa-lock:before{content:"\f023"}.fa-gas-pump:before{content:"\f52f"}.fa-hot-tub-person:before,.fa-hot-tub:before{content:"\f593"}.fa-map-location:before,.fa-map-marked:before{content:"\f59f"}.fa-house-flood-water:before{content:"\e50e"}.fa-tree:before{content:"\f1bb"}.fa-bridge-lock:before{content:"\e4cc"}.fa-sack-dollar:before{content:"\f81d"}.fa-edit:before,.fa-pen-to-square:before{content:"\f044"}.fa-car-side:before{content:"\f5e4"}.fa-share-alt:before,.fa-share-nodes:before{content:"\f1e0"}.fa-heart-circle-minus:before{content:"\e4ff"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-microscope:before{content:"\f610"}.fa-sink:before{content:"\e06d"}.fa-bag-shopping:before,.fa-shopping-bag:before{content:"\f290"}.fa-arrow-down-z-a:before,.fa-sort-alpha-desc:before,.fa-sort-alpha-down-alt:before{content:"\f881"}.fa-mitten:before{content:"\f7b5"}.fa-person-rays:before{content:"\e54d"}.fa-users:before{content:"\f0c0"}.fa-eye-slash:before{content:"\f070"}.fa-flask-vial:before{content:"\e4f3"}.fa-hand-paper:before,.fa-hand:before{content:"\f256"}.fa-om:before{content:"\f679"}.fa-worm:before{content:"\e599"}.fa-house-circle-xmark:before{content:"\e50b"}.fa-plug:before{content:"\f1e6"}.fa-chevron-up:before{content:"\f077"}.fa-hand-spock:before{content:"\f259"}.fa-stopwatch:before{content:"\f2f2"}.fa-face-kiss:before,.fa-kiss:before{content:"\f596"}.fa-bridge-circle-xmark:before{content:"\e4cb"}.fa-face-grin-tongue:before,.fa-grin-tongue:before{content:"\f589"}.fa-chess-bishop:before{content:"\f43a"}.fa-face-grin-wink:before,.fa-grin-wink:before{content:"\f58c"}.fa-deaf:before,.fa-deafness:before,.fa-ear-deaf:before,.fa-hard-of-hearing:before{content:"\f2a4"}.fa-road-circle-check:before{content:"\e564"}.fa-dice-five:before{content:"\f523"}.fa-rss-square:before,.fa-square-rss:before{content:"\f143"}.fa-land-mine-on:before{content:"\e51b"}.fa-i-cursor:before{content:"\f246"}.fa-stamp:before{content:"\f5bf"}.fa-stairs:before{content:"\e289"}.fa-i:before{content:"\49"}.fa-hryvnia-sign:before,.fa-hryvnia:before{content:"\f6f2"}.fa-pills:before{content:"\f484"}.fa-face-grin-wide:before,.fa-grin-alt:before{content:"\f581"}.fa-tooth:before{content:"\f5c9"}.fa-v:before{content:"\56"}.fa-bangladeshi-taka-sign:before{content:"\e2e6"}.fa-bicycle:before{content:"\f206"}.fa-rod-asclepius:before,.fa-rod-snake:before,.fa-staff-aesculapius:before,.fa-staff-snake:before{content:"\e579"}.fa-head-side-cough-slash:before{content:"\e062"}.fa-ambulance:before,.fa-truck-medical:before{content:"\f0f9"}.fa-wheat-awn-circle-exclamation:before{content:"\e598"}.fa-snowman:before{content:"\f7d0"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-road-barrier:before{content:"\e562"}.fa-school:before{content:"\f549"}.fa-igloo:before{content:"\f7ae"}.fa-joint:before{content:"\f595"}.fa-angle-right:before{content:"\f105"}.fa-horse:before{content:"\f6f0"}.fa-q:before{content:"\51"}.fa-g:before{content:"\47"}.fa-notes-medical:before{content:"\f481"}.fa-temperature-2:before,.fa-temperature-half:before,.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-dong-sign:before{content:"\e169"}.fa-capsules:before{content:"\f46b"}.fa-poo-bolt:before,.fa-poo-storm:before{content:"\f75a"}.fa-face-frown-open:before,.fa-frown-open:before{content:"\f57a"}.fa-hand-point-up:before{content:"\f0a6"}.fa-money-bill:before{content:"\f0d6"}.fa-bookmark:before{content:"\f02e"}.fa-align-justify:before{content:"\f039"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-helmet-un:before{content:"\e503"}.fa-bullseye:before{content:"\f140"}.fa-bacon:before{content:"\f7e5"}.fa-hand-point-down:before{content:"\f0a7"}.fa-arrow-up-from-bracket:before{content:"\e09a"}.fa-folder-blank:before,.fa-folder:before{content:"\f07b"}.fa-file-medical-alt:before,.fa-file-waveform:before{content:"\f478"}.fa-radiation:before{content:"\f7b9"}.fa-chart-simple:before{content:"\e473"}.fa-mars-stroke:before{content:"\f229"}.fa-vial:before{content:"\f492"}.fa-dashboard:before,.fa-gauge-med:before,.fa-gauge:before,.fa-tachometer-alt-average:before{content:"\f624"}.fa-magic-wand-sparkles:before,.fa-wand-magic-sparkles:before{content:"\e2ca"}.fa-e:before{content:"\45"}.fa-pen-alt:before,.fa-pen-clip:before{content:"\f305"}.fa-bridge-circle-exclamation:before{content:"\e4ca"}.fa-user:before{content:"\f007"}.fa-school-circle-check:before{content:"\e56b"}.fa-dumpster:before{content:"\f793"}.fa-shuttle-van:before,.fa-van-shuttle:before{content:"\f5b6"}.fa-building-user:before{content:"\e4da"}.fa-caret-square-left:before,.fa-square-caret-left:before{content:"\f191"}.fa-highlighter:before{content:"\f591"}.fa-key:before{content:"\f084"}.fa-bullhorn:before{content:"\f0a1"}.fa-globe:before{content:"\f0ac"}.fa-synagogue:before{content:"\f69b"}.fa-person-half-dress:before{content:"\e548"}.fa-road-bridge:before{content:"\e563"}.fa-location-arrow:before{content:"\f124"}.fa-c:before{content:"\43"}.fa-tablet-button:before{content:"\f10a"}.fa-building-lock:before{content:"\e4d6"}.fa-pizza-slice:before{content:"\f818"}.fa-money-bill-wave:before{content:"\f53a"}.fa-area-chart:before,.fa-chart-area:before{content:"\f1fe"}.fa-house-flag:before{content:"\e50d"}.fa-person-circle-minus:before{content:"\e540"}.fa-ban:before,.fa-cancel:before{content:"\f05e"}.fa-camera-rotate:before{content:"\e0d8"}.fa-air-freshener:before,.fa-spray-can-sparkles:before{content:"\f5d0"}.fa-star:before{content:"\f005"}.fa-repeat:before{content:"\f363"}.fa-cross:before{content:"\f654"}.fa-box:before{content:"\f466"}.fa-venus-mars:before{content:"\f228"}.fa-arrow-pointer:before,.fa-mouse-pointer:before{content:"\f245"}.fa-expand-arrows-alt:before,.fa-maximize:before{content:"\f31e"}.fa-charging-station:before{content:"\f5e7"}.fa-shapes:before,.fa-triangle-circle-square:before{content:"\f61f"}.fa-random:before,.fa-shuffle:before{content:"\f074"}.fa-person-running:before,.fa-running:before{content:"\f70c"}.fa-mobile-retro:before{content:"\e527"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-spider:before{content:"\f717"}.fa-hands-bound:before{content:"\e4f9"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-plane-circle-exclamation:before{content:"\e556"}.fa-x-ray:before{content:"\f497"}.fa-spell-check:before{content:"\f891"}.fa-slash:before{content:"\f715"}.fa-computer-mouse:before,.fa-mouse:before{content:"\f8cc"}.fa-arrow-right-to-bracket:before,.fa-sign-in:before{content:"\f090"}.fa-shop-slash:before,.fa-store-alt-slash:before{content:"\e070"}.fa-server:before{content:"\f233"}.fa-virus-covid-slash:before{content:"\e4a9"}.fa-shop-lock:before{content:"\e4a5"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-blender-phone:before{content:"\f6b6"}.fa-building-wheat:before{content:"\e4db"}.fa-person-breastfeeding:before{content:"\e53a"}.fa-right-to-bracket:before,.fa-sign-in-alt:before{content:"\f2f6"}.fa-venus:before{content:"\f221"}.fa-passport:before{content:"\f5ab"}.fa-heart-pulse:before,.fa-heartbeat:before{content:"\f21e"}.fa-people-carry-box:before,.fa-people-carry:before{content:"\f4ce"}.fa-temperature-high:before{content:"\f769"}.fa-microchip:before{content:"\f2db"}.fa-crown:before{content:"\f521"}.fa-weight-hanging:before{content:"\f5cd"}.fa-xmarks-lines:before{content:"\e59a"}.fa-file-prescription:before{content:"\f572"}.fa-weight-scale:before,.fa-weight:before{content:"\f496"}.fa-user-friends:before,.fa-user-group:before{content:"\f500"}.fa-arrow-up-a-z:before,.fa-sort-alpha-up:before{content:"\f15e"}.fa-chess-knight:before{content:"\f441"}.fa-face-laugh-squint:before,.fa-laugh-squint:before{content:"\f59b"}.fa-wheelchair:before{content:"\f193"}.fa-arrow-circle-up:before,.fa-circle-arrow-up:before{content:"\f0aa"}.fa-toggle-on:before{content:"\f205"}.fa-person-walking:before,.fa-walking:before{content:"\f554"}.fa-l:before{content:"\4c"}.fa-fire:before{content:"\f06d"}.fa-bed-pulse:before,.fa-procedures:before{content:"\f487"}.fa-shuttle-space:before,.fa-space-shuttle:before{content:"\f197"}.fa-face-laugh:before,.fa-laugh:before{content:"\f599"}.fa-folder-open:before{content:"\f07c"}.fa-heart-circle-plus:before{content:"\e500"}.fa-code-fork:before{content:"\e13b"}.fa-city:before{content:"\f64f"}.fa-microphone-alt:before,.fa-microphone-lines:before{content:"\f3c9"}.fa-pepper-hot:before{content:"\f816"}.fa-unlock:before{content:"\f09c"}.fa-colon-sign:before{content:"\e140"}.fa-headset:before{content:"\f590"}.fa-store-slash:before{content:"\e071"}.fa-road-circle-xmark:before{content:"\e566"}.fa-user-minus:before{content:"\f503"}.fa-mars-stroke-up:before,.fa-mars-stroke-v:before{content:"\f22a"}.fa-champagne-glasses:before,.fa-glass-cheers:before{content:"\f79f"}.fa-clipboard:before{content:"\f328"}.fa-house-circle-exclamation:before{content:"\e50a"}.fa-file-arrow-up:before,.fa-file-upload:before{content:"\f574"}.fa-wifi-3:before,.fa-wifi-strong:before,.fa-wifi:before{content:"\f1eb"}.fa-bath:before,.fa-bathtub:before{content:"\f2cd"}.fa-underline:before{content:"\f0cd"}.fa-user-edit:before,.fa-user-pen:before{content:"\f4ff"}.fa-signature:before{content:"\f5b7"}.fa-stroopwafel:before{content:"\f551"}.fa-bold:before{content:"\f032"}.fa-anchor-lock:before{content:"\e4ad"}.fa-building-ngo:before{content:"\e4d7"}.fa-manat-sign:before{content:"\e1d5"}.fa-not-equal:before{content:"\f53e"}.fa-border-style:before,.fa-border-top-left:before{content:"\f853"}.fa-map-location-dot:before,.fa-map-marked-alt:before{content:"\f5a0"}.fa-jedi:before{content:"\f669"}.fa-poll:before,.fa-square-poll-vertical:before{content:"\f681"}.fa-mug-hot:before{content:"\f7b6"}.fa-battery-car:before,.fa-car-battery:before{content:"\f5df"}.fa-gift:before{content:"\f06b"}.fa-dice-two:before{content:"\f528"}.fa-chess-queen:before{content:"\f445"}.fa-glasses:before{content:"\f530"}.fa-chess-board:before{content:"\f43c"}.fa-building-circle-check:before{content:"\e4d2"}.fa-person-chalkboard:before{content:"\e53d"}.fa-mars-stroke-h:before,.fa-mars-stroke-right:before{content:"\f22b"}.fa-hand-back-fist:before,.fa-hand-rock:before{content:"\f255"}.fa-caret-square-up:before,.fa-square-caret-up:before{content:"\f151"}.fa-cloud-showers-water:before{content:"\e4e4"}.fa-bar-chart:before,.fa-chart-bar:before{content:"\f080"}.fa-hands-bubbles:before,.fa-hands-wash:before{content:"\e05e"}.fa-less-than-equal:before{content:"\f537"}.fa-train:before{content:"\f238"}.fa-eye-low-vision:before,.fa-low-vision:before{content:"\f2a8"}.fa-crow:before{content:"\f520"}.fa-sailboat:before{content:"\e445"}.fa-window-restore:before{content:"\f2d2"}.fa-plus-square:before,.fa-square-plus:before{content:"\f0fe"}.fa-torii-gate:before{content:"\f6a1"}.fa-frog:before{content:"\f52e"}.fa-bucket:before{content:"\e4cf"}.fa-image:before{content:"\f03e"}.fa-microphone:before{content:"\f130"}.fa-cow:before{content:"\f6c8"}.fa-caret-up:before{content:"\f0d8"}.fa-screwdriver:before{content:"\f54a"}.fa-folder-closed:before{content:"\e185"}.fa-house-tsunami:before{content:"\e515"}.fa-square-nfi:before{content:"\e576"}.fa-arrow-up-from-ground-water:before{content:"\e4b5"}.fa-glass-martini-alt:before,.fa-martini-glass:before{content:"\f57b"}.fa-rotate-back:before,.fa-rotate-backward:before,.fa-rotate-left:before,.fa-undo-alt:before{content:"\f2ea"}.fa-columns:before,.fa-table-columns:before{content:"\f0db"}.fa-lemon:before{content:"\f094"}.fa-head-side-mask:before{content:"\e063"}.fa-handshake:before{content:"\f2b5"}.fa-gem:before{content:"\f3a5"}.fa-dolly-box:before,.fa-dolly:before{content:"\f472"}.fa-smoking:before{content:"\f48d"}.fa-compress-arrows-alt:before,.fa-minimize:before{content:"\f78c"}.fa-monument:before{content:"\f5a6"}.fa-snowplow:before{content:"\f7d2"}.fa-angle-double-right:before,.fa-angles-right:before{content:"\f101"}.fa-cannabis:before{content:"\f55f"}.fa-circle-play:before,.fa-play-circle:before{content:"\f144"}.fa-tablets:before{content:"\f490"}.fa-ethernet:before{content:"\f796"}.fa-eur:before,.fa-euro-sign:before,.fa-euro:before{content:"\f153"}.fa-chair:before{content:"\f6c0"}.fa-check-circle:before,.fa-circle-check:before{content:"\f058"}.fa-circle-stop:before,.fa-stop-circle:before{content:"\f28d"}.fa-compass-drafting:before,.fa-drafting-compass:before{content:"\f568"}.fa-plate-wheat:before{content:"\e55a"}.fa-icicles:before{content:"\f7ad"}.fa-person-shelter:before{content:"\e54f"}.fa-neuter:before{content:"\f22c"}.fa-id-badge:before{content:"\f2c1"}.fa-marker:before{content:"\f5a1"}.fa-face-laugh-beam:before,.fa-laugh-beam:before{content:"\f59a"}.fa-helicopter-symbol:before{content:"\e502"}.fa-universal-access:before{content:"\f29a"}.fa-chevron-circle-up:before,.fa-circle-chevron-up:before{content:"\f139"}.fa-lari-sign:before{content:"\e1c8"}.fa-volcano:before{content:"\f770"}.fa-person-walking-dashed-line-arrow-right:before{content:"\e553"}.fa-gbp:before,.fa-pound-sign:before,.fa-sterling-sign:before{content:"\f154"}.fa-viruses:before{content:"\e076"}.fa-square-person-confined:before{content:"\e577"}.fa-user-tie:before{content:"\f508"}.fa-arrow-down-long:before,.fa-long-arrow-down:before{content:"\f175"}.fa-tent-arrow-down-to-line:before{content:"\e57e"}.fa-certificate:before{content:"\f0a3"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-suitcase:before{content:"\f0f2"}.fa-person-skating:before,.fa-skating:before{content:"\f7c5"}.fa-filter-circle-dollar:before,.fa-funnel-dollar:before{content:"\f662"}.fa-camera-retro:before{content:"\f083"}.fa-arrow-circle-down:before,.fa-circle-arrow-down:before{content:"\f0ab"}.fa-arrow-right-to-file:before,.fa-file-import:before{content:"\f56f"}.fa-external-link-square:before,.fa-square-arrow-up-right:before{content:"\f14c"}.fa-box-open:before{content:"\f49e"}.fa-scroll:before{content:"\f70e"}.fa-spa:before{content:"\f5bb"}.fa-location-pin-lock:before{content:"\e51f"}.fa-pause:before{content:"\f04c"}.fa-hill-avalanche:before{content:"\e507"}.fa-temperature-0:before,.fa-temperature-empty:before,.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-bomb:before{content:"\f1e2"}.fa-registered:before{content:"\f25d"}.fa-address-card:before,.fa-contact-card:before,.fa-vcard:before{content:"\f2bb"}.fa-balance-scale-right:before,.fa-scale-unbalanced-flip:before{content:"\f516"}.fa-subscript:before{content:"\f12c"}.fa-diamond-turn-right:before,.fa-directions:before{content:"\f5eb"}.fa-burst:before{content:"\e4dc"}.fa-house-laptop:before,.fa-laptop-house:before{content:"\e066"}.fa-face-tired:before,.fa-tired:before{content:"\f5c8"}.fa-money-bills:before{content:"\e1f3"}.fa-smog:before{content:"\f75f"}.fa-crutch:before{content:"\f7f7"}.fa-cloud-arrow-up:before,.fa-cloud-upload-alt:before,.fa-cloud-upload:before{content:"\f0ee"}.fa-palette:before{content:"\f53f"}.fa-arrows-turn-right:before{content:"\e4c0"}.fa-vest:before{content:"\e085"}.fa-ferry:before{content:"\e4ea"}.fa-arrows-down-to-people:before{content:"\e4b9"}.fa-seedling:before,.fa-sprout:before{content:"\f4d8"}.fa-arrows-alt-h:before,.fa-left-right:before{content:"\f337"}.fa-boxes-packing:before{content:"\e4c7"}.fa-arrow-circle-left:before,.fa-circle-arrow-left:before{content:"\f0a8"}.fa-group-arrows-rotate:before{content:"\e4f6"}.fa-bowl-food:before{content:"\e4c6"}.fa-candy-cane:before{content:"\f786"}.fa-arrow-down-wide-short:before,.fa-sort-amount-asc:before,.fa-sort-amount-down:before{content:"\f160"}.fa-cloud-bolt:before,.fa-thunderstorm:before{content:"\f76c"}.fa-remove-format:before,.fa-text-slash:before{content:"\f87d"}.fa-face-smile-wink:before,.fa-smile-wink:before{content:"\f4da"}.fa-file-word:before{content:"\f1c2"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-arrows-h:before,.fa-arrows-left-right:before{content:"\f07e"}.fa-house-lock:before{content:"\e510"}.fa-cloud-arrow-down:before,.fa-cloud-download-alt:before,.fa-cloud-download:before{content:"\f0ed"}.fa-children:before{content:"\e4e1"}.fa-blackboard:before,.fa-chalkboard:before{content:"\f51b"}.fa-user-alt-slash:before,.fa-user-large-slash:before{content:"\f4fa"}.fa-envelope-open:before{content:"\f2b6"}.fa-handshake-alt-slash:before,.fa-handshake-simple-slash:before{content:"\e05f"}.fa-mattress-pillow:before{content:"\e525"}.fa-guarani-sign:before{content:"\e19a"}.fa-arrows-rotate:before,.fa-refresh:before,.fa-sync:before{content:"\f021"}.fa-fire-extinguisher:before{content:"\f134"}.fa-cruzeiro-sign:before{content:"\e152"}.fa-greater-than-equal:before{content:"\f532"}.fa-shield-alt:before,.fa-shield-halved:before{content:"\f3ed"}.fa-atlas:before,.fa-book-atlas:before{content:"\f558"}.fa-virus:before{content:"\e074"}.fa-envelope-circle-check:before{content:"\e4e8"}.fa-layer-group:before{content:"\f5fd"}.fa-arrows-to-dot:before{content:"\e4be"}.fa-archway:before{content:"\f557"}.fa-heart-circle-check:before{content:"\e4fd"}.fa-house-chimney-crack:before,.fa-house-damage:before{content:"\f6f1"}.fa-file-archive:before,.fa-file-zipper:before{content:"\f1c6"}.fa-square:before{content:"\f0c8"}.fa-glass-martini:before,.fa-martini-glass-empty:before{content:"\f000"}.fa-couch:before{content:"\f4b8"}.fa-cedi-sign:before{content:"\e0df"}.fa-italic:before{content:"\f033"}.fa-table-cells-column-lock:before{content:"\e678"}.fa-church:before{content:"\f51d"}.fa-comments-dollar:before{content:"\f653"}.fa-democrat:before{content:"\f747"}.fa-z:before{content:"\5a"}.fa-person-skiing:before,.fa-skiing:before{content:"\f7c9"}.fa-road-lock:before{content:"\e567"}.fa-a:before{content:"\41"}.fa-temperature-arrow-down:before,.fa-temperature-down:before{content:"\e03f"}.fa-feather-alt:before,.fa-feather-pointed:before{content:"\f56b"}.fa-p:before{content:"\50"}.fa-snowflake:before{content:"\f2dc"}.fa-newspaper:before{content:"\f1ea"}.fa-ad:before,.fa-rectangle-ad:before{content:"\f641"}.fa-arrow-circle-right:before,.fa-circle-arrow-right:before{content:"\f0a9"}.fa-filter-circle-xmark:before{content:"\e17b"}.fa-locust:before{content:"\e520"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-list-1-2:before,.fa-list-numeric:before,.fa-list-ol:before{content:"\f0cb"}.fa-person-dress-burst:before{content:"\e544"}.fa-money-check-alt:before,.fa-money-check-dollar:before{content:"\f53d"}.fa-vector-square:before{content:"\f5cb"}.fa-bread-slice:before{content:"\f7ec"}.fa-language:before{content:"\f1ab"}.fa-face-kiss-wink-heart:before,.fa-kiss-wink-heart:before{content:"\f598"}.fa-filter:before{content:"\f0b0"}.fa-question:before{content:"\3f"}.fa-file-signature:before{content:"\f573"}.fa-arrows-alt:before,.fa-up-down-left-right:before{content:"\f0b2"}.fa-house-chimney-user:before{content:"\e065"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-puzzle-piece:before{content:"\f12e"}.fa-money-check:before{content:"\f53c"}.fa-star-half-alt:before,.fa-star-half-stroke:before{content:"\f5c0"}.fa-code:before{content:"\f121"}.fa-glass-whiskey:before,.fa-whiskey-glass:before{content:"\f7a0"}.fa-building-circle-exclamation:before{content:"\e4d3"}.fa-magnifying-glass-chart:before{content:"\e522"}.fa-arrow-up-right-from-square:before,.fa-external-link:before{content:"\f08e"}.fa-cubes-stacked:before{content:"\e4e6"}.fa-krw:before,.fa-won-sign:before,.fa-won:before{content:"\f159"}.fa-virus-covid:before{content:"\e4a8"}.fa-austral-sign:before{content:"\e0a9"}.fa-f:before{content:"\46"}.fa-leaf:before{content:"\f06c"}.fa-road:before{content:"\f018"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-person-circle-plus:before{content:"\e541"}.fa-chart-pie:before,.fa-pie-chart:before{content:"\f200"}.fa-bolt-lightning:before{content:"\e0b7"}.fa-sack-xmark:before{content:"\e56a"}.fa-file-excel:before{content:"\f1c3"}.fa-file-contract:before{content:"\f56c"}.fa-fish-fins:before{content:"\e4f2"}.fa-building-flag:before{content:"\e4d5"}.fa-face-grin-beam:before,.fa-grin-beam:before{content:"\f582"}.fa-object-ungroup:before{content:"\f248"}.fa-poop:before{content:"\f619"}.fa-location-pin:before,.fa-map-marker:before{content:"\f041"}.fa-kaaba:before{content:"\f66b"}.fa-toilet-paper:before{content:"\f71e"}.fa-hard-hat:before,.fa-hat-hard:before,.fa-helmet-safety:before{content:"\f807"}.fa-eject:before{content:"\f052"}.fa-arrow-alt-circle-right:before,.fa-circle-right:before{content:"\f35a"}.fa-plane-circle-check:before{content:"\e555"}.fa-face-rolling-eyes:before,.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-object-group:before{content:"\f247"}.fa-chart-line:before,.fa-line-chart:before{content:"\f201"}.fa-mask-ventilator:before{content:"\e524"}.fa-arrow-right:before{content:"\f061"}.fa-map-signs:before,.fa-signs-post:before{content:"\f277"}.fa-cash-register:before{content:"\f788"}.fa-person-circle-question:before{content:"\e542"}.fa-h:before{content:"\48"}.fa-tarp:before{content:"\e57b"}.fa-screwdriver-wrench:before,.fa-tools:before{content:"\f7d9"}.fa-arrows-to-eye:before{content:"\e4bf"}.fa-plug-circle-bolt:before{content:"\e55b"}.fa-heart:before{content:"\f004"}.fa-mars-and-venus:before{content:"\f224"}.fa-home-user:before,.fa-house-user:before{content:"\e1b0"}.fa-dumpster-fire:before{content:"\f794"}.fa-house-crack:before{content:"\e3b1"}.fa-cocktail:before,.fa-martini-glass-citrus:before{content:"\f561"}.fa-face-surprise:before,.fa-surprise:before{content:"\f5c2"}.fa-bottle-water:before{content:"\e4c5"}.fa-circle-pause:before,.fa-pause-circle:before{content:"\f28b"}.fa-toilet-paper-slash:before{content:"\e072"}.fa-apple-alt:before,.fa-apple-whole:before{content:"\f5d1"}.fa-kitchen-set:before{content:"\e51a"}.fa-r:before{content:"\52"}.fa-temperature-1:before,.fa-temperature-quarter:before,.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-cube:before{content:"\f1b2"}.fa-bitcoin-sign:before{content:"\e0b4"}.fa-shield-dog:before{content:"\e573"}.fa-solar-panel:before{content:"\f5ba"}.fa-lock-open:before{content:"\f3c1"}.fa-elevator:before{content:"\e16d"}.fa-money-bill-transfer:before{content:"\e528"}.fa-money-bill-trend-up:before{content:"\e529"}.fa-house-flood-water-circle-arrow-right:before{content:"\e50f"}.fa-poll-h:before,.fa-square-poll-horizontal:before{content:"\f682"}.fa-circle:before{content:"\f111"}.fa-backward-fast:before,.fa-fast-backward:before{content:"\f049"}.fa-recycle:before{content:"\f1b8"}.fa-user-astronaut:before{content:"\f4fb"}.fa-plane-slash:before{content:"\e069"}.fa-trademark:before{content:"\f25c"}.fa-basketball-ball:before,.fa-basketball:before{content:"\f434"}.fa-satellite-dish:before{content:"\f7c0"}.fa-arrow-alt-circle-up:before,.fa-circle-up:before{content:"\f35b"}.fa-mobile-alt:before,.fa-mobile-screen-button:before{content:"\f3cd"}.fa-volume-high:before,.fa-volume-up:before{content:"\f028"}.fa-users-rays:before{content:"\e593"}.fa-wallet:before{content:"\f555"}.fa-clipboard-check:before{content:"\f46c"}.fa-file-audio:before{content:"\f1c7"}.fa-burger:before,.fa-hamburger:before{content:"\f805"}.fa-wrench:before{content:"\f0ad"}.fa-bugs:before{content:"\e4d0"}.fa-rupee-sign:before,.fa-rupee:before{content:"\f156"}.fa-file-image:before{content:"\f1c5"}.fa-circle-question:before,.fa-question-circle:before{content:"\f059"}.fa-plane-departure:before{content:"\f5b0"}.fa-handshake-slash:before{content:"\e060"}.fa-book-bookmark:before{content:"\e0bb"}.fa-code-branch:before{content:"\f126"}.fa-hat-cowboy:before{content:"\f8c0"}.fa-bridge:before{content:"\e4c8"}.fa-phone-alt:before,.fa-phone-flip:before{content:"\f879"}.fa-truck-front:before{content:"\e2b7"}.fa-cat:before{content:"\f6be"}.fa-anchor-circle-exclamation:before{content:"\e4ab"}.fa-truck-field:before{content:"\e58d"}.fa-route:before{content:"\f4d7"}.fa-clipboard-question:before{content:"\e4e3"}.fa-panorama:before{content:"\e209"}.fa-comment-medical:before{content:"\f7f5"}.fa-teeth-open:before{content:"\f62f"}.fa-file-circle-minus:before{content:"\e4ed"}.fa-tags:before{content:"\f02c"}.fa-wine-glass:before{content:"\f4e3"}.fa-fast-forward:before,.fa-forward-fast:before{content:"\f050"}.fa-face-meh-blank:before,.fa-meh-blank:before{content:"\f5a4"}.fa-parking:before,.fa-square-parking:before{content:"\f540"}.fa-house-signal:before{content:"\e012"}.fa-bars-progress:before,.fa-tasks-alt:before{content:"\f828"}.fa-faucet-drip:before{content:"\e006"}.fa-cart-flatbed:before,.fa-dolly-flatbed:before{content:"\f474"}.fa-ban-smoking:before,.fa-smoking-ban:before{content:"\f54d"}.fa-terminal:before{content:"\f120"}.fa-mobile-button:before{content:"\f10b"}.fa-house-medical-flag:before{content:"\e514"}.fa-basket-shopping:before,.fa-shopping-basket:before{content:"\f291"}.fa-tape:before{content:"\f4db"}.fa-bus-alt:before,.fa-bus-simple:before{content:"\f55e"}.fa-eye:before{content:"\f06e"}.fa-face-sad-cry:before,.fa-sad-cry:before{content:"\f5b3"}.fa-audio-description:before{content:"\f29e"}.fa-person-military-to-person:before{content:"\e54c"}.fa-file-shield:before{content:"\e4f0"}.fa-user-slash:before{content:"\f506"}.fa-pen:before{content:"\f304"}.fa-tower-observation:before{content:"\e586"}.fa-file-code:before{content:"\f1c9"}.fa-signal-5:before,.fa-signal-perfect:before,.fa-signal:before{content:"\f012"}.fa-bus:before{content:"\f207"}.fa-heart-circle-xmark:before{content:"\e501"}.fa-home-lg:before,.fa-house-chimney:before{content:"\e3af"}.fa-window-maximize:before{content:"\f2d0"}.fa-face-frown:before,.fa-frown:before{content:"\f119"}.fa-prescription:before{content:"\f5b1"}.fa-shop:before,.fa-store-alt:before{content:"\f54f"}.fa-floppy-disk:before,.fa-save:before{content:"\f0c7"}.fa-vihara:before{content:"\f6a7"}.fa-balance-scale-left:before,.fa-scale-unbalanced:before{content:"\f515"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-comment-dots:before,.fa-commenting:before{content:"\f4ad"}.fa-plant-wilt:before{content:"\e5aa"}.fa-diamond:before{content:"\f219"}.fa-face-grin-squint:before,.fa-grin-squint:before{content:"\f585"}.fa-hand-holding-dollar:before,.fa-hand-holding-usd:before{content:"\f4c0"}.fa-bacterium:before{content:"\e05a"}.fa-hand-pointer:before{content:"\f25a"}.fa-drum-steelpan:before{content:"\f56a"}.fa-hand-scissors:before{content:"\f257"}.fa-hands-praying:before,.fa-praying-hands:before{content:"\f684"}.fa-arrow-right-rotate:before,.fa-arrow-rotate-forward:before,.fa-arrow-rotate-right:before,.fa-redo:before{content:"\f01e"}.fa-biohazard:before{content:"\f780"}.fa-location-crosshairs:before,.fa-location:before{content:"\f601"}.fa-mars-double:before{content:"\f227"}.fa-child-dress:before{content:"\e59c"}.fa-users-between-lines:before{content:"\e591"}.fa-lungs-virus:before{content:"\e067"}.fa-face-grin-tears:before,.fa-grin-tears:before{content:"\f588"}.fa-phone:before{content:"\f095"}.fa-calendar-times:before,.fa-calendar-xmark:before{content:"\f273"}.fa-child-reaching:before{content:"\e59d"}.fa-head-side-virus:before{content:"\e064"}.fa-user-cog:before,.fa-user-gear:before{content:"\f4fe"}.fa-arrow-up-1-9:before,.fa-sort-numeric-up:before{content:"\f163"}.fa-door-closed:before{content:"\f52a"}.fa-shield-virus:before{content:"\e06c"}.fa-dice-six:before{content:"\f526"}.fa-mosquito-net:before{content:"\e52c"}.fa-bridge-water:before{content:"\e4ce"}.fa-person-booth:before{content:"\f756"}.fa-text-width:before{content:"\f035"}.fa-hat-wizard:before{content:"\f6e8"}.fa-pen-fancy:before{content:"\f5ac"}.fa-digging:before,.fa-person-digging:before{content:"\f85e"}.fa-trash:before{content:"\f1f8"}.fa-gauge-simple-med:before,.fa-gauge-simple:before,.fa-tachometer-average:before{content:"\f629"}.fa-book-medical:before{content:"\f7e6"}.fa-poo:before{content:"\f2fe"}.fa-quote-right-alt:before,.fa-quote-right:before{content:"\f10e"}.fa-shirt:before,.fa-t-shirt:before,.fa-tshirt:before{content:"\f553"}.fa-cubes:before{content:"\f1b3"}.fa-divide:before{content:"\f529"}.fa-tenge-sign:before,.fa-tenge:before{content:"\f7d7"}.fa-headphones:before{content:"\f025"}.fa-hands-holding:before{content:"\f4c2"}.fa-hands-clapping:before{content:"\e1a8"}.fa-republican:before{content:"\f75e"}.fa-arrow-left:before{content:"\f060"}.fa-person-circle-xmark:before{content:"\e543"}.fa-ruler:before{content:"\f545"}.fa-align-left:before{content:"\f036"}.fa-dice-d6:before{content:"\f6d1"}.fa-restroom:before{content:"\f7bd"}.fa-j:before{content:"\4a"}.fa-users-viewfinder:before{content:"\e595"}.fa-file-video:before{content:"\f1c8"}.fa-external-link-alt:before,.fa-up-right-from-square:before{content:"\f35d"}.fa-table-cells:before,.fa-th:before{content:"\f00a"}.fa-file-pdf:before{content:"\f1c1"}.fa-bible:before,.fa-book-bible:before{content:"\f647"}.fa-o:before{content:"\4f"}.fa-medkit:before,.fa-suitcase-medical:before{content:"\f0fa"}.fa-user-secret:before{content:"\f21b"}.fa-otter:before{content:"\f700"}.fa-female:before,.fa-person-dress:before{content:"\f182"}.fa-comment-dollar:before{content:"\f651"}.fa-briefcase-clock:before,.fa-business-time:before{content:"\f64a"}.fa-table-cells-large:before,.fa-th-large:before{content:"\f009"}.fa-book-tanakh:before,.fa-tanakh:before{content:"\f827"}.fa-phone-volume:before,.fa-volume-control-phone:before{content:"\f2a0"}.fa-hat-cowboy-side:before{content:"\f8c1"}.fa-clipboard-user:before{content:"\f7f3"}.fa-child:before{content:"\f1ae"}.fa-lira-sign:before{content:"\f195"}.fa-satellite:before{content:"\f7bf"}.fa-plane-lock:before{content:"\e558"}.fa-tag:before{content:"\f02b"}.fa-comment:before{content:"\f075"}.fa-birthday-cake:before,.fa-cake-candles:before,.fa-cake:before{content:"\f1fd"}.fa-envelope:before{content:"\f0e0"}.fa-angle-double-up:before,.fa-angles-up:before{content:"\f102"}.fa-paperclip:before{content:"\f0c6"}.fa-arrow-right-to-city:before{content:"\e4b3"}.fa-ribbon:before{content:"\f4d6"}.fa-lungs:before{content:"\f604"}.fa-arrow-up-9-1:before,.fa-sort-numeric-up-alt:before{content:"\f887"}.fa-litecoin-sign:before{content:"\e1d3"}.fa-border-none:before{content:"\f850"}.fa-circle-nodes:before{content:"\e4e2"}.fa-parachute-box:before{content:"\f4cd"}.fa-indent:before{content:"\f03c"}.fa-truck-field-un:before{content:"\e58e"}.fa-hourglass-empty:before,.fa-hourglass:before{content:"\f254"}.fa-mountain:before{content:"\f6fc"}.fa-user-doctor:before,.fa-user-md:before{content:"\f0f0"}.fa-circle-info:before,.fa-info-circle:before{content:"\f05a"}.fa-cloud-meatball:before{content:"\f73b"}.fa-camera-alt:before,.fa-camera:before{content:"\f030"}.fa-square-virus:before{content:"\e578"}.fa-meteor:before{content:"\f753"}.fa-car-on:before{content:"\e4dd"}.fa-sleigh:before{content:"\f7cc"}.fa-arrow-down-1-9:before,.fa-sort-numeric-asc:before,.fa-sort-numeric-down:before{content:"\f162"}.fa-hand-holding-droplet:before,.fa-hand-holding-water:before{content:"\f4c1"}.fa-water:before{content:"\f773"}.fa-calendar-check:before{content:"\f274"}.fa-braille:before{content:"\f2a1"}.fa-prescription-bottle-alt:before,.fa-prescription-bottle-medical:before{content:"\f486"}.fa-landmark:before{content:"\f66f"}.fa-truck:before{content:"\f0d1"}.fa-crosshairs:before{content:"\f05b"}.fa-person-cane:before{content:"\e53c"}.fa-tent:before{content:"\e57d"}.fa-vest-patches:before{content:"\e086"}.fa-check-double:before{content:"\f560"}.fa-arrow-down-a-z:before,.fa-sort-alpha-asc:before,.fa-sort-alpha-down:before{content:"\f15d"}.fa-money-bill-wheat:before{content:"\e52a"}.fa-cookie:before{content:"\f563"}.fa-arrow-left-rotate:before,.fa-arrow-rotate-back:before,.fa-arrow-rotate-backward:before,.fa-arrow-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-hard-drive:before,.fa-hdd:before{content:"\f0a0"}.fa-face-grin-squint-tears:before,.fa-grin-squint-tears:before{content:"\f586"}.fa-dumbbell:before{content:"\f44b"}.fa-list-alt:before,.fa-rectangle-list:before{content:"\f022"}.fa-tarp-droplet:before{content:"\e57c"}.fa-house-medical-circle-check:before{content:"\e511"}.fa-person-skiing-nordic:before,.fa-skiing-nordic:before{content:"\f7ca"}.fa-calendar-plus:before{content:"\f271"}.fa-plane-arrival:before{content:"\f5af"}.fa-arrow-alt-circle-left:before,.fa-circle-left:before{content:"\f359"}.fa-subway:before,.fa-train-subway:before{content:"\f239"}.fa-chart-gantt:before{content:"\e0e4"}.fa-indian-rupee-sign:before,.fa-indian-rupee:before,.fa-inr:before{content:"\e1bc"}.fa-crop-alt:before,.fa-crop-simple:before{content:"\f565"}.fa-money-bill-1:before,.fa-money-bill-alt:before{content:"\f3d1"}.fa-left-long:before,.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-dna:before{content:"\f471"}.fa-virus-slash:before{content:"\e075"}.fa-minus:before,.fa-subtract:before{content:"\f068"}.fa-chess:before{content:"\f439"}.fa-arrow-left-long:before,.fa-long-arrow-left:before{content:"\f177"}.fa-plug-circle-check:before{content:"\e55c"}.fa-street-view:before{content:"\f21d"}.fa-franc-sign:before{content:"\e18f"}.fa-volume-off:before{content:"\f026"}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before,.fa-hands-american-sign-language-interpreting:before,.fa-hands-asl-interpreting:before{content:"\f2a3"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-droplet-slash:before,.fa-tint-slash:before{content:"\f5c7"}.fa-mosque:before{content:"\f678"}.fa-mosquito:before{content:"\e52b"}.fa-star-of-david:before{content:"\f69a"}.fa-person-military-rifle:before{content:"\e54b"}.fa-cart-shopping:before,.fa-shopping-cart:before{content:"\f07a"}.fa-vials:before{content:"\f493"}.fa-plug-circle-plus:before{content:"\e55f"}.fa-place-of-worship:before{content:"\f67f"}.fa-grip-vertical:before{content:"\f58e"}.fa-arrow-turn-up:before,.fa-level-up:before{content:"\f148"}.fa-u:before{content:"\55"}.fa-square-root-alt:before,.fa-square-root-variable:before{content:"\f698"}.fa-clock-four:before,.fa-clock:before{content:"\f017"}.fa-backward-step:before,.fa-step-backward:before{content:"\f048"}.fa-pallet:before{content:"\f482"}.fa-faucet:before{content:"\e005"}.fa-baseball-bat-ball:before{content:"\f432"}.fa-s:before{content:"\53"}.fa-timeline:before{content:"\e29c"}.fa-keyboard:before{content:"\f11c"}.fa-caret-down:before{content:"\f0d7"}.fa-clinic-medical:before,.fa-house-chimney-medical:before{content:"\f7f2"}.fa-temperature-3:before,.fa-temperature-three-quarters:before,.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-mobile-android-alt:before,.fa-mobile-screen:before{content:"\f3cf"}.fa-plane-up:before{content:"\e22d"}.fa-piggy-bank:before{content:"\f4d3"}.fa-battery-3:before,.fa-battery-half:before{content:"\f242"}.fa-mountain-city:before{content:"\e52e"}.fa-coins:before{content:"\f51e"}.fa-khanda:before{content:"\f66d"}.fa-sliders-h:before,.fa-sliders:before{content:"\f1de"}.fa-folder-tree:before{content:"\f802"}.fa-network-wired:before{content:"\f6ff"}.fa-map-pin:before{content:"\f276"}.fa-hamsa:before{content:"\f665"}.fa-cent-sign:before{content:"\e3f5"}.fa-flask:before{content:"\f0c3"}.fa-person-pregnant:before{content:"\e31e"}.fa-wand-sparkles:before{content:"\f72b"}.fa-ellipsis-v:before,.fa-ellipsis-vertical:before{content:"\f142"}.fa-ticket:before{content:"\f145"}.fa-power-off:before{content:"\f011"}.fa-long-arrow-alt-right:before,.fa-right-long:before{content:"\f30b"}.fa-flag-usa:before{content:"\f74d"}.fa-laptop-file:before{content:"\e51d"}.fa-teletype:before,.fa-tty:before{content:"\f1e4"}.fa-diagram-next:before{content:"\e476"}.fa-person-rifle:before{content:"\e54e"}.fa-house-medical-circle-exclamation:before{content:"\e512"}.fa-closed-captioning:before{content:"\f20a"}.fa-hiking:before,.fa-person-hiking:before{content:"\f6ec"}.fa-venus-double:before{content:"\f226"}.fa-images:before{content:"\f302"}.fa-calculator:before{content:"\f1ec"}.fa-people-pulling:before{content:"\e535"}.fa-n:before{content:"\4e"}.fa-cable-car:before,.fa-tram:before{content:"\f7da"}.fa-cloud-rain:before{content:"\f73d"}.fa-building-circle-xmark:before{content:"\e4d4"}.fa-ship:before{content:"\f21a"}.fa-arrows-down-to-line:before{content:"\e4b8"}.fa-download:before{content:"\f019"}.fa-face-grin:before,.fa-grin:before{content:"\f580"}.fa-backspace:before,.fa-delete-left:before{content:"\f55a"}.fa-eye-dropper-empty:before,.fa-eye-dropper:before,.fa-eyedropper:before{content:"\f1fb"}.fa-file-circle-check:before{content:"\e5a0"}.fa-forward:before{content:"\f04e"}.fa-mobile-android:before,.fa-mobile-phone:before,.fa-mobile:before{content:"\f3ce"}.fa-face-meh:before,.fa-meh:before{content:"\f11a"}.fa-align-center:before{content:"\f037"}.fa-book-dead:before,.fa-book-skull:before{content:"\f6b7"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-heart-circle-exclamation:before{content:"\e4fe"}.fa-home-alt:before,.fa-home-lg-alt:before,.fa-home:before,.fa-house:before{content:"\f015"}.fa-calendar-week:before{content:"\f784"}.fa-laptop-medical:before{content:"\f812"}.fa-b:before{content:"\42"}.fa-file-medical:before{content:"\f477"}.fa-dice-one:before{content:"\f525"}.fa-kiwi-bird:before{content:"\f535"}.fa-arrow-right-arrow-left:before,.fa-exchange:before{content:"\f0ec"}.fa-redo-alt:before,.fa-rotate-forward:before,.fa-rotate-right:before{content:"\f2f9"}.fa-cutlery:before,.fa-utensils:before{content:"\f2e7"}.fa-arrow-up-wide-short:before,.fa-sort-amount-up:before{content:"\f161"}.fa-mill-sign:before{content:"\e1ed"}.fa-bowl-rice:before{content:"\e2eb"}.fa-skull:before{content:"\f54c"}.fa-broadcast-tower:before,.fa-tower-broadcast:before{content:"\f519"}.fa-truck-pickup:before{content:"\f63c"}.fa-long-arrow-alt-up:before,.fa-up-long:before{content:"\f30c"}.fa-stop:before{content:"\f04d"}.fa-code-merge:before{content:"\f387"}.fa-upload:before{content:"\f093"}.fa-hurricane:before{content:"\f751"}.fa-mound:before{content:"\e52d"}.fa-toilet-portable:before{content:"\e583"}.fa-compact-disc:before{content:"\f51f"}.fa-file-arrow-down:before,.fa-file-download:before{content:"\f56d"}.fa-caravan:before{content:"\f8ff"}.fa-shield-cat:before{content:"\e572"}.fa-bolt:before,.fa-zap:before{content:"\f0e7"}.fa-glass-water:before{content:"\e4f4"}.fa-oil-well:before{content:"\e532"}.fa-vault:before{content:"\e2c5"}.fa-mars:before{content:"\f222"}.fa-toilet:before{content:"\f7d8"}.fa-plane-circle-xmark:before{content:"\e557"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen-sign:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble-sign:before,.fa-ruble:before{content:"\f158"}.fa-sun:before{content:"\f185"}.fa-guitar:before{content:"\f7a6"}.fa-face-laugh-wink:before,.fa-laugh-wink:before{content:"\f59c"}.fa-horse-head:before{content:"\f7ab"}.fa-bore-hole:before{content:"\e4c3"}.fa-industry:before{content:"\f275"}.fa-arrow-alt-circle-down:before,.fa-circle-down:before{content:"\f358"}.fa-arrows-turn-to-dots:before{content:"\e4c1"}.fa-florin-sign:before{content:"\e184"}.fa-arrow-down-short-wide:before,.fa-sort-amount-desc:before,.fa-sort-amount-down-alt:before{content:"\f884"}.fa-less-than:before{content:"\3c"}.fa-angle-down:before{content:"\f107"}.fa-car-tunnel:before{content:"\e4de"}.fa-head-side-cough:before{content:"\e061"}.fa-grip-lines:before{content:"\f7a4"}.fa-thumbs-down:before{content:"\f165"}.fa-user-lock:before{content:"\f502"}.fa-arrow-right-long:before,.fa-long-arrow-right:before{content:"\f178"}.fa-anchor-circle-xmark:before{content:"\e4ac"}.fa-ellipsis-h:before,.fa-ellipsis:before{content:"\f141"}.fa-chess-pawn:before{content:"\f443"}.fa-first-aid:before,.fa-kit-medical:before{content:"\f479"}.fa-person-through-window:before{content:"\e5a9"}.fa-toolbox:before{content:"\f552"}.fa-hands-holding-circle:before{content:"\e4fb"}.fa-bug:before{content:"\f188"}.fa-credit-card-alt:before,.fa-credit-card:before{content:"\f09d"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-hand-holding-hand:before{content:"\e4f7"}.fa-book-open-reader:before,.fa-book-reader:before{content:"\f5da"}.fa-mountain-sun:before{content:"\e52f"}.fa-arrows-left-right-to-line:before{content:"\e4ba"}.fa-dice-d20:before{content:"\f6cf"}.fa-truck-droplet:before{content:"\e58c"}.fa-file-circle-xmark:before{content:"\e5a1"}.fa-temperature-arrow-up:before,.fa-temperature-up:before{content:"\e040"}.fa-medal:before{content:"\f5a2"}.fa-bed:before{content:"\f236"}.fa-h-square:before,.fa-square-h:before{content:"\f0fd"}.fa-podcast:before{content:"\f2ce"}.fa-temperature-4:before,.fa-temperature-full:before,.fa-thermometer-4:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-bell:before{content:"\f0f3"}.fa-superscript:before{content:"\f12b"}.fa-plug-circle-xmark:before{content:"\e560"}.fa-star-of-life:before{content:"\f621"}.fa-phone-slash:before{content:"\f3dd"}.fa-paint-roller:before{content:"\f5aa"}.fa-hands-helping:before,.fa-handshake-angle:before{content:"\f4c4"}.fa-location-dot:before,.fa-map-marker-alt:before{content:"\f3c5"}.fa-file:before{content:"\f15b"}.fa-greater-than:before{content:"\3e"}.fa-person-swimming:before,.fa-swimmer:before{content:"\f5c4"}.fa-arrow-down:before{content:"\f063"}.fa-droplet:before,.fa-tint:before{content:"\f043"}.fa-eraser:before{content:"\f12d"}.fa-earth-america:before,.fa-earth-americas:before,.fa-earth:before,.fa-globe-americas:before{content:"\f57d"}.fa-person-burst:before{content:"\e53b"}.fa-dove:before{content:"\f4ba"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-socks:before{content:"\f696"}.fa-inbox:before{content:"\f01c"}.fa-section:before{content:"\e447"}.fa-gauge-high:before,.fa-tachometer-alt-fast:before,.fa-tachometer-alt:before{content:"\f625"}.fa-envelope-open-text:before{content:"\f658"}.fa-hospital-alt:before,.fa-hospital-wide:before,.fa-hospital:before{content:"\f0f8"}.fa-wine-bottle:before{content:"\f72f"}.fa-chess-rook:before{content:"\f447"}.fa-bars-staggered:before,.fa-reorder:before,.fa-stream:before{content:"\f550"}.fa-dharmachakra:before{content:"\f655"}.fa-hotdog:before{content:"\f80f"}.fa-blind:before,.fa-person-walking-with-cane:before{content:"\f29d"}.fa-drum:before{content:"\f569"}.fa-ice-cream:before{content:"\f810"}.fa-heart-circle-bolt:before{content:"\e4fc"}.fa-fax:before{content:"\f1ac"}.fa-paragraph:before{content:"\f1dd"}.fa-check-to-slot:before,.fa-vote-yea:before{content:"\f772"}.fa-star-half:before{content:"\f089"}.fa-boxes-alt:before,.fa-boxes-stacked:before,.fa-boxes:before{content:"\f468"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-assistive-listening-systems:before,.fa-ear-listen:before{content:"\f2a2"}.fa-tree-city:before{content:"\e587"}.fa-play:before{content:"\f04b"}.fa-font:before{content:"\f031"}.fa-table-cells-row-lock:before{content:"\e67a"}.fa-rupiah-sign:before{content:"\e23d"}.fa-magnifying-glass:before,.fa-search:before{content:"\f002"}.fa-ping-pong-paddle-ball:before,.fa-table-tennis-paddle-ball:before,.fa-table-tennis:before{content:"\f45d"}.fa-diagnoses:before,.fa-person-dots-from-line:before{content:"\f470"}.fa-trash-can-arrow-up:before,.fa-trash-restore-alt:before{content:"\f82a"}.fa-naira-sign:before{content:"\e1f6"}.fa-cart-arrow-down:before{content:"\f218"}.fa-walkie-talkie:before{content:"\f8ef"}.fa-file-edit:before,.fa-file-pen:before{content:"\f31c"}.fa-receipt:before{content:"\f543"}.fa-pen-square:before,.fa-pencil-square:before,.fa-square-pen:before{content:"\f14b"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-person-circle-exclamation:before{content:"\e53f"}.fa-chevron-down:before{content:"\f078"}.fa-battery-5:before,.fa-battery-full:before,.fa-battery:before{content:"\f240"}.fa-skull-crossbones:before{content:"\f714"}.fa-code-compare:before{content:"\e13a"}.fa-list-dots:before,.fa-list-ul:before{content:"\f0ca"}.fa-school-lock:before{content:"\e56f"}.fa-tower-cell:before{content:"\e585"}.fa-down-long:before,.fa-long-arrow-alt-down:before{content:"\f309"}.fa-ranking-star:before{content:"\e561"}.fa-chess-king:before{content:"\f43f"}.fa-person-harassing:before{content:"\e549"}.fa-brazilian-real-sign:before{content:"\e46c"}.fa-landmark-alt:before,.fa-landmark-dome:before{content:"\f752"}.fa-arrow-up:before{content:"\f062"}.fa-television:before,.fa-tv-alt:before,.fa-tv:before{content:"\f26c"}.fa-shrimp:before{content:"\e448"}.fa-list-check:before,.fa-tasks:before{content:"\f0ae"}.fa-jug-detergent:before{content:"\e519"}.fa-circle-user:before,.fa-user-circle:before{content:"\f2bd"}.fa-user-shield:before{content:"\f505"}.fa-wind:before{content:"\f72e"}.fa-car-burst:before,.fa-car-crash:before{content:"\f5e1"}.fa-y:before{content:"\59"}.fa-person-snowboarding:before,.fa-snowboarding:before{content:"\f7ce"}.fa-shipping-fast:before,.fa-truck-fast:before{content:"\f48b"}.fa-fish:before{content:"\f578"}.fa-user-graduate:before{content:"\f501"}.fa-adjust:before,.fa-circle-half-stroke:before{content:"\f042"}.fa-clapperboard:before{content:"\e131"}.fa-circle-radiation:before,.fa-radiation-alt:before{content:"\f7ba"}.fa-baseball-ball:before,.fa-baseball:before{content:"\f433"}.fa-jet-fighter-up:before{content:"\e518"}.fa-diagram-project:before,.fa-project-diagram:before{content:"\f542"}.fa-copy:before{content:"\f0c5"}.fa-volume-mute:before,.fa-volume-times:before,.fa-volume-xmark:before{content:"\f6a9"}.fa-hand-sparkles:before{content:"\e05d"}.fa-grip-horizontal:before,.fa-grip:before{content:"\f58d"}.fa-share-from-square:before,.fa-share-square:before{content:"\f14d"}.fa-child-combatant:before,.fa-child-rifle:before{content:"\e4e0"}.fa-gun:before{content:"\e19b"}.fa-phone-square:before,.fa-square-phone:before{content:"\f098"}.fa-add:before,.fa-plus:before{content:"\2b"}.fa-expand:before{content:"\f065"}.fa-computer:before{content:"\e4e5"}.fa-close:before,.fa-multiply:before,.fa-remove:before,.fa-times:before,.fa-xmark:before{content:"\f00d"}.fa-arrows-up-down-left-right:before,.fa-arrows:before{content:"\f047"}.fa-chalkboard-teacher:before,.fa-chalkboard-user:before{content:"\f51c"}.fa-peso-sign:before{content:"\e222"}.fa-building-shield:before{content:"\e4d8"}.fa-baby:before{content:"\f77c"}.fa-users-line:before{content:"\e592"}.fa-quote-left-alt:before,.fa-quote-left:before{content:"\f10d"}.fa-tractor:before{content:"\f722"}.fa-trash-arrow-up:before,.fa-trash-restore:before{content:"\f829"}.fa-arrow-down-up-lock:before{content:"\e4b0"}.fa-lines-leaning:before{content:"\e51e"}.fa-ruler-combined:before{content:"\f546"}.fa-copyright:before{content:"\f1f9"}.fa-equals:before{content:"\3d"}.fa-blender:before{content:"\f517"}.fa-teeth:before{content:"\f62e"}.fa-ils:before,.fa-shekel-sign:before,.fa-shekel:before,.fa-sheqel-sign:before,.fa-sheqel:before{content:"\f20b"}.fa-map:before{content:"\f279"}.fa-rocket:before{content:"\f135"}.fa-photo-film:before,.fa-photo-video:before{content:"\f87c"}.fa-folder-minus:before{content:"\f65d"}.fa-store:before{content:"\f54e"}.fa-arrow-trend-up:before{content:"\e098"}.fa-plug-circle-minus:before{content:"\e55e"}.fa-sign-hanging:before,.fa-sign:before{content:"\f4d9"}.fa-bezier-curve:before{content:"\f55b"}.fa-bell-slash:before{content:"\f1f6"}.fa-tablet-android:before,.fa-tablet:before{content:"\f3fb"}.fa-school-flag:before{content:"\e56e"}.fa-fill:before{content:"\f575"}.fa-angle-up:before{content:"\f106"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-holly-berry:before{content:"\f7aa"}.fa-chevron-left:before{content:"\f053"}.fa-bacteria:before{content:"\e059"}.fa-hand-lizard:before{content:"\f258"}.fa-notdef:before{content:"\e1fe"}.fa-disease:before{content:"\f7fa"}.fa-briefcase-medical:before{content:"\f469"}.fa-genderless:before{content:"\f22d"}.fa-chevron-right:before{content:"\f054"}.fa-retweet:before{content:"\f079"}.fa-car-alt:before,.fa-car-rear:before{content:"\f5de"}.fa-pump-soap:before{content:"\e06b"}.fa-video-slash:before{content:"\f4e2"}.fa-battery-2:before,.fa-battery-quarter:before{content:"\f243"}.fa-radio:before{content:"\f8d7"}.fa-baby-carriage:before,.fa-carriage-baby:before{content:"\f77d"}.fa-traffic-light:before{content:"\f637"}.fa-thermometer:before{content:"\f491"}.fa-vr-cardboard:before{content:"\f729"}.fa-hand-middle-finger:before{content:"\f806"}.fa-percent:before,.fa-percentage:before{content:"\25"}.fa-truck-moving:before{content:"\f4df"}.fa-glass-water-droplet:before{content:"\e4f5"}.fa-display:before{content:"\e163"}.fa-face-smile:before,.fa-smile:before{content:"\f118"}.fa-thumb-tack:before,.fa-thumbtack:before{content:"\f08d"}.fa-trophy:before{content:"\f091"}.fa-person-praying:before,.fa-pray:before{content:"\f683"}.fa-hammer:before{content:"\f6e3"}.fa-hand-peace:before{content:"\f25b"}.fa-rotate:before,.fa-sync-alt:before{content:"\f2f1"}.fa-spinner:before{content:"\f110"}.fa-robot:before{content:"\f544"}.fa-peace:before{content:"\f67c"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-warehouse:before{content:"\f494"}.fa-arrow-up-right-dots:before{content:"\e4b7"}.fa-splotch:before{content:"\f5bc"}.fa-face-grin-hearts:before,.fa-grin-hearts:before{content:"\f584"}.fa-dice-four:before{content:"\f524"}.fa-sim-card:before{content:"\f7c4"}.fa-transgender-alt:before,.fa-transgender:before{content:"\f225"}.fa-mercury:before{content:"\f223"}.fa-arrow-turn-down:before,.fa-level-down:before{content:"\f149"}.fa-person-falling-burst:before{content:"\e547"}.fa-award:before{content:"\f559"}.fa-ticket-alt:before,.fa-ticket-simple:before{content:"\f3ff"}.fa-building:before{content:"\f1ad"}.fa-angle-double-left:before,.fa-angles-left:before{content:"\f100"}.fa-qrcode:before{content:"\f029"}.fa-clock-rotate-left:before,.fa-history:before{content:"\f1da"}.fa-face-grin-beam-sweat:before,.fa-grin-beam-sweat:before{content:"\f583"}.fa-arrow-right-from-file:before,.fa-file-export:before{content:"\f56e"}.fa-shield-blank:before,.fa-shield:before{content:"\f132"}.fa-arrow-up-short-wide:before,.fa-sort-amount-up-alt:before{content:"\f885"}.fa-house-medical:before{content:"\e3b2"}.fa-golf-ball-tee:before,.fa-golf-ball:before{content:"\f450"}.fa-chevron-circle-left:before,.fa-circle-chevron-left:before{content:"\f137"}.fa-house-chimney-window:before{content:"\e00d"}.fa-pen-nib:before{content:"\f5ad"}.fa-tent-arrow-turn-left:before{content:"\e580"}.fa-tents:before{content:"\e582"}.fa-magic:before,.fa-wand-magic:before{content:"\f0d0"}.fa-dog:before{content:"\f6d3"}.fa-carrot:before{content:"\f787"}.fa-moon:before{content:"\f186"}.fa-wine-glass-alt:before,.fa-wine-glass-empty:before{content:"\f5ce"}.fa-cheese:before{content:"\f7ef"}.fa-yin-yang:before{content:"\f6ad"}.fa-music:before{content:"\f001"}.fa-code-commit:before{content:"\f386"}.fa-temperature-low:before{content:"\f76b"}.fa-biking:before,.fa-person-biking:before{content:"\f84a"}.fa-broom:before{content:"\f51a"}.fa-shield-heart:before{content:"\e574"}.fa-gopuram:before{content:"\f664"}.fa-earth-oceania:before,.fa-globe-oceania:before{content:"\e47b"}.fa-square-xmark:before,.fa-times-square:before,.fa-xmark-square:before{content:"\f2d3"}.fa-hashtag:before{content:"\23"}.fa-expand-alt:before,.fa-up-right-and-down-left-from-center:before{content:"\f424"}.fa-oil-can:before{content:"\f613"}.fa-t:before{content:"\54"}.fa-hippo:before{content:"\f6ed"}.fa-chart-column:before{content:"\e0e3"}.fa-infinity:before{content:"\f534"}.fa-vial-circle-check:before{content:"\e596"}.fa-person-arrow-down-to-line:before{content:"\e538"}.fa-voicemail:before{content:"\f897"}.fa-fan:before{content:"\f863"}.fa-person-walking-luggage:before{content:"\e554"}.fa-arrows-alt-v:before,.fa-up-down:before{content:"\f338"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-calendar:before{content:"\f133"}.fa-trailer:before{content:"\e041"}.fa-bahai:before,.fa-haykal:before{content:"\f666"}.fa-sd-card:before{content:"\f7c2"}.fa-dragon:before{content:"\f6d5"}.fa-shoe-prints:before{content:"\f54b"}.fa-circle-plus:before,.fa-plus-circle:before{content:"\f055"}.fa-face-grin-tongue-wink:before,.fa-grin-tongue-wink:before{content:"\f58b"}.fa-hand-holding:before{content:"\f4bd"}.fa-plug-circle-exclamation:before{content:"\e55d"}.fa-chain-broken:before,.fa-chain-slash:before,.fa-link-slash:before,.fa-unlink:before{content:"\f127"}.fa-clone:before{content:"\f24d"}.fa-person-walking-arrow-loop-left:before{content:"\e551"}.fa-arrow-up-z-a:before,.fa-sort-alpha-up-alt:before{content:"\f882"}.fa-fire-alt:before,.fa-fire-flame-curved:before{content:"\f7e4"}.fa-tornado:before{content:"\f76f"}.fa-file-circle-plus:before{content:"\e494"}.fa-book-quran:before,.fa-quran:before{content:"\f687"}.fa-anchor:before{content:"\f13d"}.fa-border-all:before{content:"\f84c"}.fa-angry:before,.fa-face-angry:before{content:"\f556"}.fa-cookie-bite:before{content:"\f564"}.fa-arrow-trend-down:before{content:"\e097"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-draw-polygon:before{content:"\f5ee"}.fa-balance-scale:before,.fa-scale-balanced:before{content:"\f24e"}.fa-gauge-simple-high:before,.fa-tachometer-fast:before,.fa-tachometer:before{content:"\f62a"}.fa-shower:before{content:"\f2cc"}.fa-desktop-alt:before,.fa-desktop:before{content:"\f390"}.fa-m:before{content:"\4d"}.fa-table-list:before,.fa-th-list:before{content:"\f00b"}.fa-comment-sms:before,.fa-sms:before{content:"\f7cd"}.fa-book:before{content:"\f02d"}.fa-user-plus:before{content:"\f234"}.fa-check:before{content:"\f00c"}.fa-battery-4:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-house-circle-check:before{content:"\e509"}.fa-angle-left:before{content:"\f104"}.fa-diagram-successor:before{content:"\e47a"}.fa-truck-arrow-right:before{content:"\e58b"}.fa-arrows-split-up-and-left:before{content:"\e4bc"}.fa-fist-raised:before,.fa-hand-fist:before{content:"\f6de"}.fa-cloud-moon:before{content:"\f6c3"}.fa-briefcase:before{content:"\f0b1"}.fa-person-falling:before{content:"\e546"}.fa-image-portrait:before,.fa-portrait:before{content:"\f3e0"}.fa-user-tag:before{content:"\f507"}.fa-rug:before{content:"\e569"}.fa-earth-europe:before,.fa-globe-europe:before{content:"\f7a2"}.fa-cart-flatbed-suitcase:before,.fa-luggage-cart:before{content:"\f59d"}.fa-rectangle-times:before,.fa-rectangle-xmark:before,.fa-times-rectangle:before,.fa-window-close:before{content:"\f410"}.fa-baht-sign:before{content:"\e0ac"}.fa-book-open:before{content:"\f518"}.fa-book-journal-whills:before,.fa-journal-whills:before{content:"\f66a"}.fa-handcuffs:before{content:"\e4f8"}.fa-exclamation-triangle:before,.fa-triangle-exclamation:before,.fa-warning:before{content:"\f071"}.fa-database:before{content:"\f1c0"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-bottle-droplet:before{content:"\e4c4"}.fa-mask-face:before{content:"\e1d7"}.fa-hill-rockslide:before{content:"\e508"}.fa-exchange-alt:before,.fa-right-left:before{content:"\f362"}.fa-paper-plane:before{content:"\f1d8"}.fa-road-circle-exclamation:before{content:"\e565"}.fa-dungeon:before{content:"\f6d9"}.fa-align-right:before{content:"\f038"}.fa-money-bill-1-wave:before,.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-life-ring:before{content:"\f1cd"}.fa-hands:before,.fa-sign-language:before,.fa-signing:before{content:"\f2a7"}.fa-calendar-day:before{content:"\f783"}.fa-ladder-water:before,.fa-swimming-pool:before,.fa-water-ladder:before{content:"\f5c5"}.fa-arrows-up-down:before,.fa-arrows-v:before{content:"\f07d"}.fa-face-grimace:before,.fa-grimace:before{content:"\f57f"}.fa-wheelchair-alt:before,.fa-wheelchair-move:before{content:"\e2ce"}.fa-level-down-alt:before,.fa-turn-down:before{content:"\f3be"}.fa-person-walking-arrow-right:before{content:"\e552"}.fa-envelope-square:before,.fa-square-envelope:before{content:"\f199"}.fa-dice:before{content:"\f522"}.fa-bowling-ball:before{content:"\f436"}.fa-brain:before{content:"\f5dc"}.fa-band-aid:before,.fa-bandage:before{content:"\f462"}.fa-calendar-minus:before{content:"\f272"}.fa-circle-xmark:before,.fa-times-circle:before,.fa-xmark-circle:before{content:"\f057"}.fa-gifts:before{content:"\f79c"}.fa-hotel:before{content:"\f594"}.fa-earth-asia:before,.fa-globe-asia:before{content:"\f57e"}.fa-id-card-alt:before,.fa-id-card-clip:before{content:"\f47f"}.fa-magnifying-glass-plus:before,.fa-search-plus:before{content:"\f00e"}.fa-thumbs-up:before{content:"\f164"}.fa-user-clock:before{content:"\f4fd"}.fa-allergies:before,.fa-hand-dots:before{content:"\f461"}.fa-file-invoice:before{content:"\f570"}.fa-window-minimize:before{content:"\f2d1"}.fa-coffee:before,.fa-mug-saucer:before{content:"\f0f4"}.fa-brush:before{content:"\f55d"}.fa-mask:before{content:"\f6fa"}.fa-magnifying-glass-minus:before,.fa-search-minus:before{content:"\f010"}.fa-ruler-vertical:before{content:"\f548"}.fa-user-alt:before,.fa-user-large:before{content:"\f406"}.fa-train-tram:before{content:"\e5b4"}.fa-user-nurse:before{content:"\f82f"}.fa-syringe:before{content:"\f48e"}.fa-cloud-sun:before{content:"\f6c4"}.fa-stopwatch-20:before{content:"\e06f"}.fa-square-full:before{content:"\f45c"}.fa-magnet:before{content:"\f076"}.fa-jar:before{content:"\e516"}.fa-note-sticky:before,.fa-sticky-note:before{content:"\f249"}.fa-bug-slash:before{content:"\e490"}.fa-arrow-up-from-water-pump:before{content:"\e4b6"}.fa-bone:before{content:"\f5d7"}.fa-user-injured:before{content:"\f728"}.fa-face-sad-tear:before,.fa-sad-tear:before{content:"\f5b4"}.fa-plane:before{content:"\f072"}.fa-tent-arrows-down:before{content:"\e581"}.fa-exclamation:before{content:"\21"}.fa-arrows-spin:before{content:"\e4bb"}.fa-print:before{content:"\f02f"}.fa-try:before,.fa-turkish-lira-sign:before,.fa-turkish-lira:before{content:"\e2bb"}.fa-dollar-sign:before,.fa-dollar:before,.fa-usd:before{content:"\24"}.fa-x:before{content:"\58"}.fa-magnifying-glass-dollar:before,.fa-search-dollar:before{content:"\f688"}.fa-users-cog:before,.fa-users-gear:before{content:"\f509"}.fa-person-military-pointing:before{content:"\e54a"}.fa-bank:before,.fa-building-columns:before,.fa-institution:before,.fa-museum:before,.fa-university:before{content:"\f19c"}.fa-umbrella:before{content:"\f0e9"}.fa-trowel:before{content:"\e589"}.fa-d:before{content:"\44"}.fa-stapler:before{content:"\e5af"}.fa-masks-theater:before,.fa-theater-masks:before{content:"\f630"}.fa-kip-sign:before{content:"\e1c4"}.fa-hand-point-left:before{content:"\f0a5"}.fa-handshake-alt:before,.fa-handshake-simple:before{content:"\f4c6"}.fa-fighter-jet:before,.fa-jet-fighter:before{content:"\f0fb"}.fa-share-alt-square:before,.fa-square-share-nodes:before{content:"\f1e1"}.fa-barcode:before{content:"\f02a"}.fa-plus-minus:before{content:"\e43c"}.fa-video-camera:before,.fa-video:before{content:"\f03d"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-hand-holding-medical:before{content:"\e05c"}.fa-person-circle-check:before{content:"\e53e"}.fa-level-up-alt:before,.fa-turn-up:before{content:"\f3bf"} +.fa-sr-only,.fa-sr-only-focusable:not(:focus),.sr-only,.sr-only-focusable:not(:focus){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}:host,:root{--fa-style-family-brands:"Font Awesome 6 Brands";--fa-font-brands:normal 400 1em/1 "Font Awesome 6 Brands"}@font-face{font-family:"Font Awesome 6 Brands";font-style:normal;font-weight:400;font-display:block;src: url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.ttf") format("truetype"); }.fa-brands,.fab{font-weight:400}.fa-monero:before{content:"\f3d0"}.fa-hooli:before{content:"\f427"}.fa-yelp:before{content:"\f1e9"}.fa-cc-visa:before{content:"\f1f0"}.fa-lastfm:before{content:"\f202"}.fa-shopware:before{content:"\f5b5"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-aws:before{content:"\f375"}.fa-redhat:before{content:"\f7bc"}.fa-yoast:before{content:"\f2b1"}.fa-cloudflare:before{content:"\e07d"}.fa-ups:before{content:"\f7e0"}.fa-pixiv:before{content:"\e640"}.fa-wpexplorer:before{content:"\f2de"}.fa-dyalog:before{content:"\f399"}.fa-bity:before{content:"\f37a"}.fa-stackpath:before{content:"\f842"}.fa-buysellads:before{content:"\f20d"}.fa-first-order:before{content:"\f2b0"}.fa-modx:before{content:"\f285"}.fa-guilded:before{content:"\e07e"}.fa-vnv:before{content:"\f40b"}.fa-js-square:before,.fa-square-js:before{content:"\f3b9"}.fa-microsoft:before{content:"\f3ca"}.fa-qq:before{content:"\f1d6"}.fa-orcid:before{content:"\f8d2"}.fa-java:before{content:"\f4e4"}.fa-invision:before{content:"\f7b0"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-centercode:before{content:"\f380"}.fa-glide-g:before{content:"\f2a6"}.fa-drupal:before{content:"\f1a9"}.fa-jxl:before{content:"\e67b"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-unity:before{content:"\e049"}.fa-whmcs:before{content:"\f40d"}.fa-rocketchat:before{content:"\f3e8"}.fa-vk:before{content:"\f189"}.fa-untappd:before{content:"\f405"}.fa-mailchimp:before{content:"\f59e"}.fa-css3-alt:before{content:"\f38b"}.fa-reddit-square:before,.fa-square-reddit:before{content:"\f1a2"}.fa-vimeo-v:before{content:"\f27d"}.fa-contao:before{content:"\f26d"}.fa-square-font-awesome:before{content:"\e5ad"}.fa-deskpro:before{content:"\f38f"}.fa-brave:before{content:"\e63c"}.fa-sistrix:before{content:"\f3ee"}.fa-instagram-square:before,.fa-square-instagram:before{content:"\e055"}.fa-battle-net:before{content:"\f835"}.fa-the-red-yeti:before{content:"\f69d"}.fa-hacker-news-square:before,.fa-square-hacker-news:before{content:"\f3af"}.fa-edge:before{content:"\f282"}.fa-threads:before{content:"\e618"}.fa-napster:before{content:"\f3d2"}.fa-snapchat-square:before,.fa-square-snapchat:before{content:"\f2ad"}.fa-google-plus-g:before{content:"\f0d5"}.fa-artstation:before{content:"\f77a"}.fa-markdown:before{content:"\f60f"}.fa-sourcetree:before{content:"\f7d3"}.fa-google-plus:before{content:"\f2b3"}.fa-diaspora:before{content:"\f791"}.fa-foursquare:before{content:"\f180"}.fa-stack-overflow:before{content:"\f16c"}.fa-github-alt:before{content:"\f113"}.fa-phoenix-squadron:before{content:"\f511"}.fa-pagelines:before{content:"\f18c"}.fa-algolia:before{content:"\f36c"}.fa-red-river:before{content:"\f3e3"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-safari:before{content:"\f267"}.fa-google:before{content:"\f1a0"}.fa-font-awesome-alt:before,.fa-square-font-awesome-stroke:before{content:"\f35c"}.fa-atlassian:before{content:"\f77b"}.fa-linkedin-in:before{content:"\f0e1"}.fa-digital-ocean:before{content:"\f391"}.fa-nimblr:before{content:"\f5a8"}.fa-chromecast:before{content:"\f838"}.fa-evernote:before{content:"\f839"}.fa-hacker-news:before{content:"\f1d4"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-adversal:before{content:"\f36a"}.fa-creative-commons:before{content:"\f25e"}.fa-watchman-monitoring:before{content:"\e087"}.fa-fonticons:before{content:"\f280"}.fa-weixin:before{content:"\f1d7"}.fa-shirtsinbulk:before{content:"\f214"}.fa-codepen:before{content:"\f1cb"}.fa-git-alt:before{content:"\f841"}.fa-lyft:before{content:"\f3c3"}.fa-rev:before{content:"\f5b2"}.fa-windows:before{content:"\f17a"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-square-viadeo:before,.fa-viadeo-square:before{content:"\f2aa"}.fa-meetup:before{content:"\f2e0"}.fa-centos:before{content:"\f789"}.fa-adn:before{content:"\f170"}.fa-cloudsmith:before{content:"\f384"}.fa-opensuse:before{content:"\e62b"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-dribbble-square:before,.fa-square-dribbble:before{content:"\f397"}.fa-codiepie:before{content:"\f284"}.fa-node:before{content:"\f419"}.fa-mix:before{content:"\f3cb"}.fa-steam:before{content:"\f1b6"}.fa-cc-apple-pay:before{content:"\f416"}.fa-scribd:before{content:"\f28a"}.fa-debian:before{content:"\e60b"}.fa-openid:before{content:"\f19b"}.fa-instalod:before{content:"\e081"}.fa-expeditedssl:before{content:"\f23e"}.fa-sellcast:before{content:"\f2da"}.fa-square-twitter:before,.fa-twitter-square:before{content:"\f081"}.fa-r-project:before{content:"\f4f7"}.fa-delicious:before{content:"\f1a5"}.fa-freebsd:before{content:"\f3a4"}.fa-vuejs:before{content:"\f41f"}.fa-accusoft:before{content:"\f369"}.fa-ioxhost:before{content:"\f208"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-app-store:before{content:"\f36f"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-itunes-note:before{content:"\f3b5"}.fa-golang:before{content:"\e40f"}.fa-kickstarter:before,.fa-square-kickstarter:before{content:"\f3bb"}.fa-grav:before{content:"\f2d6"}.fa-weibo:before{content:"\f18a"}.fa-uncharted:before{content:"\e084"}.fa-firstdraft:before{content:"\f3a1"}.fa-square-youtube:before,.fa-youtube-square:before{content:"\f431"}.fa-wikipedia-w:before{content:"\f266"}.fa-rendact:before,.fa-wpressr:before{content:"\f3e4"}.fa-angellist:before{content:"\f209"}.fa-galactic-republic:before{content:"\f50c"}.fa-nfc-directional:before{content:"\e530"}.fa-skype:before{content:"\f17e"}.fa-joget:before{content:"\f3b7"}.fa-fedora:before{content:"\f798"}.fa-stripe-s:before{content:"\f42a"}.fa-meta:before{content:"\e49b"}.fa-laravel:before{content:"\f3bd"}.fa-hotjar:before{content:"\f3b1"}.fa-bluetooth-b:before{content:"\f294"}.fa-square-letterboxd:before{content:"\e62e"}.fa-sticker-mule:before{content:"\f3f7"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-hips:before{content:"\f452"}.fa-behance:before{content:"\f1b4"}.fa-reddit:before{content:"\f1a1"}.fa-discord:before{content:"\f392"}.fa-chrome:before{content:"\f268"}.fa-app-store-ios:before{content:"\f370"}.fa-cc-discover:before{content:"\f1f2"}.fa-wpbeginner:before{content:"\f297"}.fa-confluence:before{content:"\f78d"}.fa-shoelace:before{content:"\e60c"}.fa-mdb:before{content:"\f8ca"}.fa-dochub:before{content:"\f394"}.fa-accessible-icon:before{content:"\f368"}.fa-ebay:before{content:"\f4f4"}.fa-amazon:before{content:"\f270"}.fa-unsplash:before{content:"\e07c"}.fa-yarn:before{content:"\f7e3"}.fa-square-steam:before,.fa-steam-square:before{content:"\f1b7"}.fa-500px:before{content:"\f26e"}.fa-square-vimeo:before,.fa-vimeo-square:before{content:"\f194"}.fa-asymmetrik:before{content:"\f372"}.fa-font-awesome-flag:before,.fa-font-awesome-logo-full:before,.fa-font-awesome:before{content:"\f2b4"}.fa-gratipay:before{content:"\f184"}.fa-apple:before{content:"\f179"}.fa-hive:before{content:"\e07f"}.fa-gitkraken:before{content:"\f3a6"}.fa-keybase:before{content:"\f4f5"}.fa-apple-pay:before{content:"\f415"}.fa-padlet:before{content:"\e4a0"}.fa-amazon-pay:before{content:"\f42c"}.fa-github-square:before,.fa-square-github:before{content:"\f092"}.fa-stumbleupon:before{content:"\f1a4"}.fa-fedex:before{content:"\f797"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-shopify:before{content:"\e057"}.fa-neos:before{content:"\f612"}.fa-square-threads:before{content:"\e619"}.fa-hackerrank:before{content:"\f5f7"}.fa-researchgate:before{content:"\f4f8"}.fa-swift:before{content:"\f8e1"}.fa-angular:before{content:"\f420"}.fa-speakap:before{content:"\f3f3"}.fa-angrycreative:before{content:"\f36e"}.fa-y-combinator:before{content:"\f23b"}.fa-empire:before{content:"\f1d1"}.fa-envira:before{content:"\f299"}.fa-google-scholar:before{content:"\e63b"}.fa-gitlab-square:before,.fa-square-gitlab:before{content:"\e5ae"}.fa-studiovinari:before{content:"\f3f8"}.fa-pied-piper:before{content:"\f2ae"}.fa-wordpress:before{content:"\f19a"}.fa-product-hunt:before{content:"\f288"}.fa-firefox:before{content:"\f269"}.fa-linode:before{content:"\f2b8"}.fa-goodreads:before{content:"\f3a8"}.fa-odnoklassniki-square:before,.fa-square-odnoklassniki:before{content:"\f264"}.fa-jsfiddle:before{content:"\f1cc"}.fa-sith:before{content:"\f512"}.fa-themeisle:before{content:"\f2b2"}.fa-page4:before{content:"\f3d7"}.fa-hashnode:before{content:"\e499"}.fa-react:before{content:"\f41b"}.fa-cc-paypal:before{content:"\f1f4"}.fa-squarespace:before{content:"\f5be"}.fa-cc-stripe:before{content:"\f1f5"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-bitcoin:before{content:"\f379"}.fa-keycdn:before{content:"\f3ba"}.fa-opera:before{content:"\f26a"}.fa-itch-io:before{content:"\f83a"}.fa-umbraco:before{content:"\f8e8"}.fa-galactic-senate:before{content:"\f50d"}.fa-ubuntu:before{content:"\f7df"}.fa-draft2digital:before{content:"\f396"}.fa-stripe:before{content:"\f429"}.fa-houzz:before{content:"\f27c"}.fa-gg:before{content:"\f260"}.fa-dhl:before{content:"\f790"}.fa-pinterest-square:before,.fa-square-pinterest:before{content:"\f0d3"}.fa-xing:before{content:"\f168"}.fa-blackberry:before{content:"\f37b"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-playstation:before{content:"\f3df"}.fa-quinscape:before{content:"\f459"}.fa-less:before{content:"\f41d"}.fa-blogger-b:before{content:"\f37d"}.fa-opencart:before{content:"\f23d"}.fa-vine:before{content:"\f1ca"}.fa-signal-messenger:before{content:"\e663"}.fa-paypal:before{content:"\f1ed"}.fa-gitlab:before{content:"\f296"}.fa-typo3:before{content:"\f42b"}.fa-reddit-alien:before{content:"\f281"}.fa-yahoo:before{content:"\f19e"}.fa-dailymotion:before{content:"\e052"}.fa-affiliatetheme:before{content:"\f36b"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-bootstrap:before{content:"\f836"}.fa-odnoklassniki:before{content:"\f263"}.fa-nfc-symbol:before{content:"\e531"}.fa-mintbit:before{content:"\e62f"}.fa-ethereum:before{content:"\f42e"}.fa-speaker-deck:before{content:"\f83c"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-patreon:before{content:"\f3d9"}.fa-avianex:before{content:"\f374"}.fa-ello:before{content:"\f5f1"}.fa-gofore:before{content:"\f3a7"}.fa-bimobject:before{content:"\f378"}.fa-brave-reverse:before{content:"\e63d"}.fa-facebook-f:before{content:"\f39e"}.fa-google-plus-square:before,.fa-square-google-plus:before{content:"\f0d4"}.fa-web-awesome:before{content:"\e682"}.fa-mandalorian:before{content:"\f50f"}.fa-first-order-alt:before{content:"\f50a"}.fa-osi:before{content:"\f41a"}.fa-google-wallet:before{content:"\f1ee"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-periscope:before{content:"\f3da"}.fa-fulcrum:before{content:"\f50b"}.fa-cloudscale:before{content:"\f383"}.fa-forumbee:before{content:"\f211"}.fa-mizuni:before{content:"\f3cc"}.fa-schlix:before{content:"\f3ea"}.fa-square-xing:before,.fa-xing-square:before{content:"\f169"}.fa-bandcamp:before{content:"\f2d5"}.fa-wpforms:before{content:"\f298"}.fa-cloudversify:before{content:"\f385"}.fa-usps:before{content:"\f7e1"}.fa-megaport:before{content:"\f5a3"}.fa-magento:before{content:"\f3c4"}.fa-spotify:before{content:"\f1bc"}.fa-optin-monster:before{content:"\f23c"}.fa-fly:before{content:"\f417"}.fa-aviato:before{content:"\f421"}.fa-itunes:before{content:"\f3b4"}.fa-cuttlefish:before{content:"\f38c"}.fa-blogger:before{content:"\f37c"}.fa-flickr:before{content:"\f16e"}.fa-viber:before{content:"\f409"}.fa-soundcloud:before{content:"\f1be"}.fa-digg:before{content:"\f1a6"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-letterboxd:before{content:"\e62d"}.fa-symfony:before{content:"\f83d"}.fa-maxcdn:before{content:"\f136"}.fa-etsy:before{content:"\f2d7"}.fa-facebook-messenger:before{content:"\f39f"}.fa-audible:before{content:"\f373"}.fa-think-peaks:before{content:"\f731"}.fa-bilibili:before{content:"\e3d9"}.fa-erlang:before{content:"\f39d"}.fa-x-twitter:before{content:"\e61b"}.fa-cotton-bureau:before{content:"\f89e"}.fa-dashcube:before{content:"\f210"}.fa-42-group:before,.fa-innosoft:before{content:"\e080"}.fa-stack-exchange:before{content:"\f18d"}.fa-elementor:before{content:"\f430"}.fa-pied-piper-square:before,.fa-square-pied-piper:before{content:"\e01e"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-palfed:before{content:"\f3d8"}.fa-superpowers:before{content:"\f2dd"}.fa-resolving:before{content:"\f3e7"}.fa-xbox:before{content:"\f412"}.fa-square-web-awesome-stroke:before{content:"\e684"}.fa-searchengin:before{content:"\f3eb"}.fa-tiktok:before{content:"\e07b"}.fa-facebook-square:before,.fa-square-facebook:before{content:"\f082"}.fa-renren:before{content:"\f18b"}.fa-linux:before{content:"\f17c"}.fa-glide:before{content:"\f2a5"}.fa-linkedin:before{content:"\f08c"}.fa-hubspot:before{content:"\f3b2"}.fa-deploydog:before{content:"\f38e"}.fa-twitch:before{content:"\f1e8"}.fa-ravelry:before{content:"\f2d9"}.fa-mixer:before{content:"\e056"}.fa-lastfm-square:before,.fa-square-lastfm:before{content:"\f203"}.fa-vimeo:before{content:"\f40a"}.fa-mendeley:before{content:"\f7b3"}.fa-uniregistry:before{content:"\f404"}.fa-figma:before{content:"\f799"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-dropbox:before{content:"\f16b"}.fa-instagram:before{content:"\f16d"}.fa-cmplid:before{content:"\e360"}.fa-upwork:before{content:"\e641"}.fa-facebook:before{content:"\f09a"}.fa-gripfire:before{content:"\f3ac"}.fa-jedi-order:before{content:"\f50e"}.fa-uikit:before{content:"\f403"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-phabricator:before{content:"\f3db"}.fa-ussunnah:before{content:"\f407"}.fa-earlybirds:before{content:"\f39a"}.fa-trade-federation:before{content:"\f513"}.fa-autoprefixer:before{content:"\f41c"}.fa-whatsapp:before{content:"\f232"}.fa-square-upwork:before{content:"\e67c"}.fa-slideshare:before{content:"\f1e7"}.fa-google-play:before{content:"\f3ab"}.fa-viadeo:before{content:"\f2a9"}.fa-line:before{content:"\f3c0"}.fa-google-drive:before{content:"\f3aa"}.fa-servicestack:before{content:"\f3ec"}.fa-simplybuilt:before{content:"\f215"}.fa-bitbucket:before{content:"\f171"}.fa-imdb:before{content:"\f2d8"}.fa-deezer:before{content:"\e077"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-jira:before{content:"\f7b1"}.fa-docker:before{content:"\f395"}.fa-screenpal:before{content:"\e570"}.fa-bluetooth:before{content:"\f293"}.fa-gitter:before{content:"\f426"}.fa-d-and-d:before{content:"\f38d"}.fa-microblog:before{content:"\e01a"}.fa-cc-diners-club:before{content:"\f24c"}.fa-gg-circle:before{content:"\f261"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-yandex:before{content:"\f413"}.fa-readme:before{content:"\f4d5"}.fa-html5:before{content:"\f13b"}.fa-sellsy:before{content:"\f213"}.fa-square-web-awesome:before{content:"\e683"}.fa-sass:before{content:"\f41e"}.fa-wirsindhandwerk:before,.fa-wsh:before{content:"\e2d0"}.fa-buromobelexperte:before{content:"\f37f"}.fa-salesforce:before{content:"\f83b"}.fa-octopus-deploy:before{content:"\e082"}.fa-medapps:before{content:"\f3c6"}.fa-ns8:before{content:"\f3d5"}.fa-pinterest-p:before{content:"\f231"}.fa-apper:before{content:"\f371"}.fa-fort-awesome:before{content:"\f286"}.fa-waze:before{content:"\f83f"}.fa-bluesky:before{content:"\e671"}.fa-cc-jcb:before{content:"\f24b"}.fa-snapchat-ghost:before,.fa-snapchat:before{content:"\f2ab"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-rust:before{content:"\e07a"}.fa-wix:before{content:"\f5cf"}.fa-behance-square:before,.fa-square-behance:before{content:"\f1b5"}.fa-supple:before{content:"\f3f9"}.fa-webflow:before{content:"\e65c"}.fa-rebel:before{content:"\f1d0"}.fa-css3:before{content:"\f13c"}.fa-staylinked:before{content:"\f3f5"}.fa-kaggle:before{content:"\f5fa"}.fa-space-awesome:before{content:"\e5ac"}.fa-deviantart:before{content:"\f1bd"}.fa-cpanel:before{content:"\f388"}.fa-goodreads-g:before{content:"\f3a9"}.fa-git-square:before,.fa-square-git:before{content:"\f1d2"}.fa-square-tumblr:before,.fa-tumblr-square:before{content:"\f174"}.fa-trello:before{content:"\f181"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-get-pocket:before{content:"\f265"}.fa-perbyte:before{content:"\e083"}.fa-grunt:before{content:"\f3ad"}.fa-weebly:before{content:"\f5cc"}.fa-connectdevelop:before{content:"\f20e"}.fa-leanpub:before{content:"\f212"}.fa-black-tie:before{content:"\f27e"}.fa-themeco:before{content:"\f5c6"}.fa-python:before{content:"\f3e2"}.fa-android:before{content:"\f17b"}.fa-bots:before{content:"\e340"}.fa-free-code-camp:before{content:"\f2c5"}.fa-hornbill:before{content:"\f592"}.fa-js:before{content:"\f3b8"}.fa-ideal:before{content:"\e013"}.fa-git:before{content:"\f1d3"}.fa-dev:before{content:"\f6cc"}.fa-sketch:before{content:"\f7c6"}.fa-yandex-international:before{content:"\f414"}.fa-cc-amex:before{content:"\f1f3"}.fa-uber:before{content:"\f402"}.fa-github:before{content:"\f09b"}.fa-php:before{content:"\f457"}.fa-alipay:before{content:"\f642"}.fa-youtube:before{content:"\f167"}.fa-skyatlas:before{content:"\f216"}.fa-firefox-browser:before{content:"\e007"}.fa-replyd:before{content:"\f3e6"}.fa-suse:before{content:"\f7d6"}.fa-jenkins:before{content:"\f3b6"}.fa-twitter:before{content:"\f099"}.fa-rockrms:before{content:"\f3e9"}.fa-pinterest:before{content:"\f0d2"}.fa-buffer:before{content:"\f837"}.fa-npm:before{content:"\f3d4"}.fa-yammer:before{content:"\f840"}.fa-btc:before{content:"\f15a"}.fa-dribbble:before{content:"\f17d"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-internet-explorer:before{content:"\f26b"}.fa-stubber:before{content:"\e5c7"}.fa-telegram-plane:before,.fa-telegram:before{content:"\f2c6"}.fa-old-republic:before{content:"\f510"}.fa-odysee:before{content:"\e5c6"}.fa-square-whatsapp:before,.fa-whatsapp-square:before{content:"\f40c"}.fa-node-js:before{content:"\f3d3"}.fa-edge-legacy:before{content:"\e078"}.fa-slack-hash:before,.fa-slack:before{content:"\f198"}.fa-medrt:before{content:"\f3c8"}.fa-usb:before{content:"\f287"}.fa-tumblr:before{content:"\f173"}.fa-vaadin:before{content:"\f408"}.fa-quora:before{content:"\f2c4"}.fa-square-x-twitter:before{content:"\e61a"}.fa-reacteurope:before{content:"\f75d"}.fa-medium-m:before,.fa-medium:before{content:"\f23a"}.fa-amilia:before{content:"\f36d"}.fa-mixcloud:before{content:"\f289"}.fa-flipboard:before{content:"\f44d"}.fa-viacoin:before{content:"\f237"}.fa-critical-role:before{content:"\f6c9"}.fa-sitrox:before{content:"\e44a"}.fa-discourse:before{content:"\f393"}.fa-joomla:before{content:"\f1aa"}.fa-mastodon:before{content:"\f4f6"}.fa-airbnb:before{content:"\f834"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-buy-n-large:before{content:"\f8a6"}.fa-gulp:before{content:"\f3ae"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-strava:before{content:"\f428"}.fa-ember:before{content:"\f423"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-teamspeak:before{content:"\f4f9"}.fa-pushed:before{content:"\f3e1"}.fa-wordpress-simple:before{content:"\f411"}.fa-nutritionix:before{content:"\f3d6"}.fa-wodu:before{content:"\e088"}.fa-google-pay:before{content:"\e079"}.fa-intercom:before{content:"\f7af"}.fa-zhihu:before{content:"\f63f"}.fa-korvue:before{content:"\f42f"}.fa-pix:before{content:"\e43a"}.fa-steam-symbol:before{content:"\f3f6"}:host,:root{--fa-font-regular:normal 400 1em/1 "Font Awesome 6 Free"}@font-face{font-family:"Font Awesome 6 Free";font-style:normal;font-weight:400;font-display:block;src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); }.fa-regular,.far{font-weight:400}:host,:root{--fa-style-family-classic:"Font Awesome 6 Free";--fa-font-solid:normal 900 1em/1 "Font Awesome 6 Free"}@font-face{font-family:"Font Awesome 6 Free";font-style:normal;font-weight:900;font-display:block;src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); }.fa-solid,.fas{font-weight:900}@font-face{font-family:"Font Awesome 5 Brands";font-display:block;font-weight:400;src: url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.ttf") format("truetype"); }@font-face{font-family:"Font Awesome 5 Free";font-display:block;font-weight:900;src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); }@font-face{font-family:"Font Awesome 5 Free";font-display:block;font-weight:400;src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); }@font-face{font-family:"FontAwesome";font-display:block;src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); }@font-face{font-family:"FontAwesome";font-display:block;src: url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.ttf") format("truetype"); }@font-face{font-family:"FontAwesome";font-display:block;src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); }@font-face{font-family:"FontAwesome";font-display:block;src: url("../webfonts/fa-v4compatibility.woff2") format("woff2"), url("../webfonts/fa-v4compatibility.ttf") format("truetype"); } \ No newline at end of file diff --git a/deps/font-awesome-6.5.2/css/v4-shims.css b/deps/font-awesome-6.5.2/css/v4-shims.css new file mode 100644 index 0000000..ea60ea4 --- /dev/null +++ b/deps/font-awesome-6.5.2/css/v4-shims.css @@ -0,0 +1,2194 @@ +/*! + * Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2024 Fonticons, Inc. + */ +.fa.fa-glass:before { + content: "\f000"; } + +.fa.fa-envelope-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-envelope-o:before { + content: "\f0e0"; } + +.fa.fa-star-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-star-o:before { + content: "\f005"; } + +.fa.fa-remove:before { + content: "\f00d"; } + +.fa.fa-close:before { + content: "\f00d"; } + +.fa.fa-gear:before { + content: "\f013"; } + +.fa.fa-trash-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-trash-o:before { + content: "\f2ed"; } + +.fa.fa-home:before { + content: "\f015"; } + +.fa.fa-file-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-o:before { + content: "\f15b"; } + +.fa.fa-clock-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-clock-o:before { + content: "\f017"; } + +.fa.fa-arrow-circle-o-down { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-arrow-circle-o-down:before { + content: "\f358"; } + +.fa.fa-arrow-circle-o-up { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-arrow-circle-o-up:before { + content: "\f35b"; } + +.fa.fa-play-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-play-circle-o:before { + content: "\f144"; } + +.fa.fa-repeat:before { + content: "\f01e"; } + +.fa.fa-rotate-right:before { + content: "\f01e"; } + +.fa.fa-refresh:before { + content: "\f021"; } + +.fa.fa-list-alt { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-list-alt:before { + content: "\f022"; } + +.fa.fa-dedent:before { + content: "\f03b"; } + +.fa.fa-video-camera:before { + content: "\f03d"; } + +.fa.fa-picture-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-picture-o:before { + content: "\f03e"; } + +.fa.fa-photo { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-photo:before { + content: "\f03e"; } + +.fa.fa-image { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-image:before { + content: "\f03e"; } + +.fa.fa-map-marker:before { + content: "\f3c5"; } + +.fa.fa-pencil-square-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-pencil-square-o:before { + content: "\f044"; } + +.fa.fa-edit { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-edit:before { + content: "\f044"; } + +.fa.fa-share-square-o:before { + content: "\f14d"; } + +.fa.fa-check-square-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-check-square-o:before { + content: "\f14a"; } + +.fa.fa-arrows:before { + content: "\f0b2"; } + +.fa.fa-times-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-times-circle-o:before { + content: "\f057"; } + +.fa.fa-check-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-check-circle-o:before { + content: "\f058"; } + +.fa.fa-mail-forward:before { + content: "\f064"; } + +.fa.fa-expand:before { + content: "\f424"; } + +.fa.fa-compress:before { + content: "\f422"; } + +.fa.fa-eye { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-eye-slash { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-warning:before { + content: "\f071"; } + +.fa.fa-calendar:before { + content: "\f073"; } + +.fa.fa-arrows-v:before { + content: "\f338"; } + +.fa.fa-arrows-h:before { + content: "\f337"; } + +.fa.fa-bar-chart:before { + content: "\e0e3"; } + +.fa.fa-bar-chart-o:before { + content: "\e0e3"; } + +.fa.fa-twitter-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-twitter-square:before { + content: "\f081"; } + +.fa.fa-facebook-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-facebook-square:before { + content: "\f082"; } + +.fa.fa-gears:before { + content: "\f085"; } + +.fa.fa-thumbs-o-up { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-thumbs-o-up:before { + content: "\f164"; } + +.fa.fa-thumbs-o-down { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-thumbs-o-down:before { + content: "\f165"; } + +.fa.fa-heart-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-heart-o:before { + content: "\f004"; } + +.fa.fa-sign-out:before { + content: "\f2f5"; } + +.fa.fa-linkedin-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-linkedin-square:before { + content: "\f08c"; } + +.fa.fa-thumb-tack:before { + content: "\f08d"; } + +.fa.fa-external-link:before { + content: "\f35d"; } + +.fa.fa-sign-in:before { + content: "\f2f6"; } + +.fa.fa-github-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-github-square:before { + content: "\f092"; } + +.fa.fa-lemon-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-lemon-o:before { + content: "\f094"; } + +.fa.fa-square-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-square-o:before { + content: "\f0c8"; } + +.fa.fa-bookmark-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-bookmark-o:before { + content: "\f02e"; } + +.fa.fa-twitter { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-facebook { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-facebook:before { + content: "\f39e"; } + +.fa.fa-facebook-f { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-facebook-f:before { + content: "\f39e"; } + +.fa.fa-github { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-credit-card { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-feed:before { + content: "\f09e"; } + +.fa.fa-hdd-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hdd-o:before { + content: "\f0a0"; } + +.fa.fa-hand-o-right { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-o-right:before { + content: "\f0a4"; } + +.fa.fa-hand-o-left { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-o-left:before { + content: "\f0a5"; } + +.fa.fa-hand-o-up { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-o-up:before { + content: "\f0a6"; } + +.fa.fa-hand-o-down { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-o-down:before { + content: "\f0a7"; } + +.fa.fa-globe:before { + content: "\f57d"; } + +.fa.fa-tasks:before { + content: "\f828"; } + +.fa.fa-arrows-alt:before { + content: "\f31e"; } + +.fa.fa-group:before { + content: "\f0c0"; } + +.fa.fa-chain:before { + content: "\f0c1"; } + +.fa.fa-cut:before { + content: "\f0c4"; } + +.fa.fa-files-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-files-o:before { + content: "\f0c5"; } + +.fa.fa-floppy-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-floppy-o:before { + content: "\f0c7"; } + +.fa.fa-save { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-save:before { + content: "\f0c7"; } + +.fa.fa-navicon:before { + content: "\f0c9"; } + +.fa.fa-reorder:before { + content: "\f0c9"; } + +.fa.fa-magic:before { + content: "\e2ca"; } + +.fa.fa-pinterest { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-pinterest-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-pinterest-square:before { + content: "\f0d3"; } + +.fa.fa-google-plus-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-google-plus-square:before { + content: "\f0d4"; } + +.fa.fa-google-plus { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-google-plus:before { + content: "\f0d5"; } + +.fa.fa-money:before { + content: "\f3d1"; } + +.fa.fa-unsorted:before { + content: "\f0dc"; } + +.fa.fa-sort-desc:before { + content: "\f0dd"; } + +.fa.fa-sort-asc:before { + content: "\f0de"; } + +.fa.fa-linkedin { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-linkedin:before { + content: "\f0e1"; } + +.fa.fa-rotate-left:before { + content: "\f0e2"; } + +.fa.fa-legal:before { + content: "\f0e3"; } + +.fa.fa-tachometer:before { + content: "\f625"; } + +.fa.fa-dashboard:before { + content: "\f625"; } + +.fa.fa-comment-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-comment-o:before { + content: "\f075"; } + +.fa.fa-comments-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-comments-o:before { + content: "\f086"; } + +.fa.fa-flash:before { + content: "\f0e7"; } + +.fa.fa-clipboard:before { + content: "\f0ea"; } + +.fa.fa-lightbulb-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-lightbulb-o:before { + content: "\f0eb"; } + +.fa.fa-exchange:before { + content: "\f362"; } + +.fa.fa-cloud-download:before { + content: "\f0ed"; } + +.fa.fa-cloud-upload:before { + content: "\f0ee"; } + +.fa.fa-bell-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-bell-o:before { + content: "\f0f3"; } + +.fa.fa-cutlery:before { + content: "\f2e7"; } + +.fa.fa-file-text-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-text-o:before { + content: "\f15c"; } + +.fa.fa-building-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-building-o:before { + content: "\f1ad"; } + +.fa.fa-hospital-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hospital-o:before { + content: "\f0f8"; } + +.fa.fa-tablet:before { + content: "\f3fa"; } + +.fa.fa-mobile:before { + content: "\f3cd"; } + +.fa.fa-mobile-phone:before { + content: "\f3cd"; } + +.fa.fa-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-circle-o:before { + content: "\f111"; } + +.fa.fa-mail-reply:before { + content: "\f3e5"; } + +.fa.fa-github-alt { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-folder-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-folder-o:before { + content: "\f07b"; } + +.fa.fa-folder-open-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-folder-open-o:before { + content: "\f07c"; } + +.fa.fa-smile-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-smile-o:before { + content: "\f118"; } + +.fa.fa-frown-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-frown-o:before { + content: "\f119"; } + +.fa.fa-meh-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-meh-o:before { + content: "\f11a"; } + +.fa.fa-keyboard-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-keyboard-o:before { + content: "\f11c"; } + +.fa.fa-flag-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-flag-o:before { + content: "\f024"; } + +.fa.fa-mail-reply-all:before { + content: "\f122"; } + +.fa.fa-star-half-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-star-half-o:before { + content: "\f5c0"; } + +.fa.fa-star-half-empty { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-star-half-empty:before { + content: "\f5c0"; } + +.fa.fa-star-half-full { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-star-half-full:before { + content: "\f5c0"; } + +.fa.fa-code-fork:before { + content: "\f126"; } + +.fa.fa-chain-broken:before { + content: "\f127"; } + +.fa.fa-unlink:before { + content: "\f127"; } + +.fa.fa-calendar-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-calendar-o:before { + content: "\f133"; } + +.fa.fa-maxcdn { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-html5 { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-css3 { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-unlock-alt:before { + content: "\f09c"; } + +.fa.fa-minus-square-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-minus-square-o:before { + content: "\f146"; } + +.fa.fa-level-up:before { + content: "\f3bf"; } + +.fa.fa-level-down:before { + content: "\f3be"; } + +.fa.fa-pencil-square:before { + content: "\f14b"; } + +.fa.fa-external-link-square:before { + content: "\f360"; } + +.fa.fa-compass { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-caret-square-o-down { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-caret-square-o-down:before { + content: "\f150"; } + +.fa.fa-toggle-down { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-toggle-down:before { + content: "\f150"; } + +.fa.fa-caret-square-o-up { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-caret-square-o-up:before { + content: "\f151"; } + +.fa.fa-toggle-up { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-toggle-up:before { + content: "\f151"; } + +.fa.fa-caret-square-o-right { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-caret-square-o-right:before { + content: "\f152"; } + +.fa.fa-toggle-right { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-toggle-right:before { + content: "\f152"; } + +.fa.fa-eur:before { + content: "\f153"; } + +.fa.fa-euro:before { + content: "\f153"; } + +.fa.fa-gbp:before { + content: "\f154"; } + +.fa.fa-usd:before { + content: "\24"; } + +.fa.fa-dollar:before { + content: "\24"; } + +.fa.fa-inr:before { + content: "\e1bc"; } + +.fa.fa-rupee:before { + content: "\e1bc"; } + +.fa.fa-jpy:before { + content: "\f157"; } + +.fa.fa-cny:before { + content: "\f157"; } + +.fa.fa-rmb:before { + content: "\f157"; } + +.fa.fa-yen:before { + content: "\f157"; } + +.fa.fa-rub:before { + content: "\f158"; } + +.fa.fa-ruble:before { + content: "\f158"; } + +.fa.fa-rouble:before { + content: "\f158"; } + +.fa.fa-krw:before { + content: "\f159"; } + +.fa.fa-won:before { + content: "\f159"; } + +.fa.fa-btc { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-bitcoin { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-bitcoin:before { + content: "\f15a"; } + +.fa.fa-file-text:before { + content: "\f15c"; } + +.fa.fa-sort-alpha-asc:before { + content: "\f15d"; } + +.fa.fa-sort-alpha-desc:before { + content: "\f881"; } + +.fa.fa-sort-amount-asc:before { + content: "\f884"; } + +.fa.fa-sort-amount-desc:before { + content: "\f160"; } + +.fa.fa-sort-numeric-asc:before { + content: "\f162"; } + +.fa.fa-sort-numeric-desc:before { + content: "\f886"; } + +.fa.fa-youtube-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-youtube-square:before { + content: "\f431"; } + +.fa.fa-youtube { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-xing { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-xing-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-xing-square:before { + content: "\f169"; } + +.fa.fa-youtube-play { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-youtube-play:before { + content: "\f167"; } + +.fa.fa-dropbox { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-stack-overflow { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-instagram { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-flickr { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-adn { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-bitbucket { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-bitbucket-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-bitbucket-square:before { + content: "\f171"; } + +.fa.fa-tumblr { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-tumblr-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-tumblr-square:before { + content: "\f174"; } + +.fa.fa-long-arrow-down:before { + content: "\f309"; } + +.fa.fa-long-arrow-up:before { + content: "\f30c"; } + +.fa.fa-long-arrow-left:before { + content: "\f30a"; } + +.fa.fa-long-arrow-right:before { + content: "\f30b"; } + +.fa.fa-apple { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-windows { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-android { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-linux { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-dribbble { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-skype { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-foursquare { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-trello { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-gratipay { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-gittip { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-gittip:before { + content: "\f184"; } + +.fa.fa-sun-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-sun-o:before { + content: "\f185"; } + +.fa.fa-moon-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-moon-o:before { + content: "\f186"; } + +.fa.fa-vk { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-weibo { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-renren { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-pagelines { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-stack-exchange { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-arrow-circle-o-right { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-arrow-circle-o-right:before { + content: "\f35a"; } + +.fa.fa-arrow-circle-o-left { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-arrow-circle-o-left:before { + content: "\f359"; } + +.fa.fa-caret-square-o-left { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-caret-square-o-left:before { + content: "\f191"; } + +.fa.fa-toggle-left { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-toggle-left:before { + content: "\f191"; } + +.fa.fa-dot-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-dot-circle-o:before { + content: "\f192"; } + +.fa.fa-vimeo-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-vimeo-square:before { + content: "\f194"; } + +.fa.fa-try:before { + content: "\e2bb"; } + +.fa.fa-turkish-lira:before { + content: "\e2bb"; } + +.fa.fa-plus-square-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-plus-square-o:before { + content: "\f0fe"; } + +.fa.fa-slack { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wordpress { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-openid { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-institution:before { + content: "\f19c"; } + +.fa.fa-bank:before { + content: "\f19c"; } + +.fa.fa-mortar-board:before { + content: "\f19d"; } + +.fa.fa-yahoo { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-google { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-reddit { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-reddit-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-reddit-square:before { + content: "\f1a2"; } + +.fa.fa-stumbleupon-circle { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-stumbleupon { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-delicious { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-digg { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-pied-piper-pp { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-pied-piper-alt { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-drupal { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-joomla { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-behance { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-behance-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-behance-square:before { + content: "\f1b5"; } + +.fa.fa-steam { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-steam-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-steam-square:before { + content: "\f1b7"; } + +.fa.fa-automobile:before { + content: "\f1b9"; } + +.fa.fa-cab:before { + content: "\f1ba"; } + +.fa.fa-spotify { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-deviantart { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-soundcloud { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-file-pdf-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-pdf-o:before { + content: "\f1c1"; } + +.fa.fa-file-word-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-word-o:before { + content: "\f1c2"; } + +.fa.fa-file-excel-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-excel-o:before { + content: "\f1c3"; } + +.fa.fa-file-powerpoint-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-powerpoint-o:before { + content: "\f1c4"; } + +.fa.fa-file-image-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-image-o:before { + content: "\f1c5"; } + +.fa.fa-file-photo-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-photo-o:before { + content: "\f1c5"; } + +.fa.fa-file-picture-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-picture-o:before { + content: "\f1c5"; } + +.fa.fa-file-archive-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-archive-o:before { + content: "\f1c6"; } + +.fa.fa-file-zip-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-zip-o:before { + content: "\f1c6"; } + +.fa.fa-file-audio-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-audio-o:before { + content: "\f1c7"; } + +.fa.fa-file-sound-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-sound-o:before { + content: "\f1c7"; } + +.fa.fa-file-video-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-video-o:before { + content: "\f1c8"; } + +.fa.fa-file-movie-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-movie-o:before { + content: "\f1c8"; } + +.fa.fa-file-code-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-code-o:before { + content: "\f1c9"; } + +.fa.fa-vine { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-codepen { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-jsfiddle { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-life-bouy:before { + content: "\f1cd"; } + +.fa.fa-life-buoy:before { + content: "\f1cd"; } + +.fa.fa-life-saver:before { + content: "\f1cd"; } + +.fa.fa-support:before { + content: "\f1cd"; } + +.fa.fa-circle-o-notch:before { + content: "\f1ce"; } + +.fa.fa-rebel { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-ra { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-ra:before { + content: "\f1d0"; } + +.fa.fa-resistance { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-resistance:before { + content: "\f1d0"; } + +.fa.fa-empire { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-ge { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-ge:before { + content: "\f1d1"; } + +.fa.fa-git-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-git-square:before { + content: "\f1d2"; } + +.fa.fa-git { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-hacker-news { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-y-combinator-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-y-combinator-square:before { + content: "\f1d4"; } + +.fa.fa-yc-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-yc-square:before { + content: "\f1d4"; } + +.fa.fa-tencent-weibo { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-qq { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-weixin { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wechat { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wechat:before { + content: "\f1d7"; } + +.fa.fa-send:before { + content: "\f1d8"; } + +.fa.fa-paper-plane-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-paper-plane-o:before { + content: "\f1d8"; } + +.fa.fa-send-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-send-o:before { + content: "\f1d8"; } + +.fa.fa-circle-thin { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-circle-thin:before { + content: "\f111"; } + +.fa.fa-header:before { + content: "\f1dc"; } + +.fa.fa-futbol-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-futbol-o:before { + content: "\f1e3"; } + +.fa.fa-soccer-ball-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-soccer-ball-o:before { + content: "\f1e3"; } + +.fa.fa-slideshare { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-twitch { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-yelp { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-newspaper-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-newspaper-o:before { + content: "\f1ea"; } + +.fa.fa-paypal { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-google-wallet { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc-visa { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc-mastercard { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc-discover { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc-amex { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc-paypal { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc-stripe { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-bell-slash-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-bell-slash-o:before { + content: "\f1f6"; } + +.fa.fa-trash:before { + content: "\f2ed"; } + +.fa.fa-copyright { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-eyedropper:before { + content: "\f1fb"; } + +.fa.fa-area-chart:before { + content: "\f1fe"; } + +.fa.fa-pie-chart:before { + content: "\f200"; } + +.fa.fa-line-chart:before { + content: "\f201"; } + +.fa.fa-lastfm { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-lastfm-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-lastfm-square:before { + content: "\f203"; } + +.fa.fa-ioxhost { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-angellist { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-cc:before { + content: "\f20a"; } + +.fa.fa-ils:before { + content: "\f20b"; } + +.fa.fa-shekel:before { + content: "\f20b"; } + +.fa.fa-sheqel:before { + content: "\f20b"; } + +.fa.fa-buysellads { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-connectdevelop { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-dashcube { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-forumbee { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-leanpub { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-sellsy { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-shirtsinbulk { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-simplybuilt { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-skyatlas { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-diamond { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-diamond:before { + content: "\f3a5"; } + +.fa.fa-transgender:before { + content: "\f224"; } + +.fa.fa-intersex:before { + content: "\f224"; } + +.fa.fa-transgender-alt:before { + content: "\f225"; } + +.fa.fa-facebook-official { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-facebook-official:before { + content: "\f09a"; } + +.fa.fa-pinterest-p { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-whatsapp { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-hotel:before { + content: "\f236"; } + +.fa.fa-viacoin { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-medium { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-y-combinator { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-yc { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-yc:before { + content: "\f23b"; } + +.fa.fa-optin-monster { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-opencart { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-expeditedssl { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-battery-4:before { + content: "\f240"; } + +.fa.fa-battery:before { + content: "\f240"; } + +.fa.fa-battery-3:before { + content: "\f241"; } + +.fa.fa-battery-2:before { + content: "\f242"; } + +.fa.fa-battery-1:before { + content: "\f243"; } + +.fa.fa-battery-0:before { + content: "\f244"; } + +.fa.fa-object-group { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-object-ungroup { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-sticky-note-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-sticky-note-o:before { + content: "\f249"; } + +.fa.fa-cc-jcb { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc-diners-club { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-clone { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hourglass-o:before { + content: "\f254"; } + +.fa.fa-hourglass-1:before { + content: "\f251"; } + +.fa.fa-hourglass-2:before { + content: "\f252"; } + +.fa.fa-hourglass-3:before { + content: "\f253"; } + +.fa.fa-hand-rock-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-rock-o:before { + content: "\f255"; } + +.fa.fa-hand-grab-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-grab-o:before { + content: "\f255"; } + +.fa.fa-hand-paper-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-paper-o:before { + content: "\f256"; } + +.fa.fa-hand-stop-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-stop-o:before { + content: "\f256"; } + +.fa.fa-hand-scissors-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-scissors-o:before { + content: "\f257"; } + +.fa.fa-hand-lizard-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-lizard-o:before { + content: "\f258"; } + +.fa.fa-hand-spock-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-spock-o:before { + content: "\f259"; } + +.fa.fa-hand-pointer-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-pointer-o:before { + content: "\f25a"; } + +.fa.fa-hand-peace-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-peace-o:before { + content: "\f25b"; } + +.fa.fa-registered { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-creative-commons { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-gg { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-gg-circle { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-odnoklassniki { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-odnoklassniki-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-odnoklassniki-square:before { + content: "\f264"; } + +.fa.fa-get-pocket { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wikipedia-w { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-safari { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-chrome { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-firefox { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-opera { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-internet-explorer { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-television:before { + content: "\f26c"; } + +.fa.fa-contao { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-500px { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-amazon { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-calendar-plus-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-calendar-plus-o:before { + content: "\f271"; } + +.fa.fa-calendar-minus-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-calendar-minus-o:before { + content: "\f272"; } + +.fa.fa-calendar-times-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-calendar-times-o:before { + content: "\f273"; } + +.fa.fa-calendar-check-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-calendar-check-o:before { + content: "\f274"; } + +.fa.fa-map-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-map-o:before { + content: "\f279"; } + +.fa.fa-commenting:before { + content: "\f4ad"; } + +.fa.fa-commenting-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-commenting-o:before { + content: "\f4ad"; } + +.fa.fa-houzz { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-vimeo { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-vimeo:before { + content: "\f27d"; } + +.fa.fa-black-tie { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-fonticons { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-reddit-alien { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-edge { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-credit-card-alt:before { + content: "\f09d"; } + +.fa.fa-codiepie { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-modx { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-fort-awesome { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-usb { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-product-hunt { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-mixcloud { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-scribd { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-pause-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-pause-circle-o:before { + content: "\f28b"; } + +.fa.fa-stop-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-stop-circle-o:before { + content: "\f28d"; } + +.fa.fa-bluetooth { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-bluetooth-b { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-gitlab { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wpbeginner { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wpforms { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-envira { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wheelchair-alt { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wheelchair-alt:before { + content: "\f368"; } + +.fa.fa-question-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-question-circle-o:before { + content: "\f059"; } + +.fa.fa-volume-control-phone:before { + content: "\f2a0"; } + +.fa.fa-asl-interpreting:before { + content: "\f2a3"; } + +.fa.fa-deafness:before { + content: "\f2a4"; } + +.fa.fa-hard-of-hearing:before { + content: "\f2a4"; } + +.fa.fa-glide { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-glide-g { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-signing:before { + content: "\f2a7"; } + +.fa.fa-viadeo { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-viadeo-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-viadeo-square:before { + content: "\f2aa"; } + +.fa.fa-snapchat { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-snapchat-ghost { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-snapchat-ghost:before { + content: "\f2ab"; } + +.fa.fa-snapchat-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-snapchat-square:before { + content: "\f2ad"; } + +.fa.fa-pied-piper { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-first-order { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-yoast { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-themeisle { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-google-plus-official { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-google-plus-official:before { + content: "\f2b3"; } + +.fa.fa-google-plus-circle { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-google-plus-circle:before { + content: "\f2b3"; } + +.fa.fa-font-awesome { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-fa { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-fa:before { + content: "\f2b4"; } + +.fa.fa-handshake-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-handshake-o:before { + content: "\f2b5"; } + +.fa.fa-envelope-open-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-envelope-open-o:before { + content: "\f2b6"; } + +.fa.fa-linode { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-address-book-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-address-book-o:before { + content: "\f2b9"; } + +.fa.fa-vcard:before { + content: "\f2bb"; } + +.fa.fa-address-card-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-address-card-o:before { + content: "\f2bb"; } + +.fa.fa-vcard-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-vcard-o:before { + content: "\f2bb"; } + +.fa.fa-user-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-user-circle-o:before { + content: "\f2bd"; } + +.fa.fa-user-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-user-o:before { + content: "\f007"; } + +.fa.fa-id-badge { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-drivers-license:before { + content: "\f2c2"; } + +.fa.fa-id-card-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-id-card-o:before { + content: "\f2c2"; } + +.fa.fa-drivers-license-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-drivers-license-o:before { + content: "\f2c2"; } + +.fa.fa-quora { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-free-code-camp { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-telegram { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-thermometer-4:before { + content: "\f2c7"; } + +.fa.fa-thermometer:before { + content: "\f2c7"; } + +.fa.fa-thermometer-3:before { + content: "\f2c8"; } + +.fa.fa-thermometer-2:before { + content: "\f2c9"; } + +.fa.fa-thermometer-1:before { + content: "\f2ca"; } + +.fa.fa-thermometer-0:before { + content: "\f2cb"; } + +.fa.fa-bathtub:before { + content: "\f2cd"; } + +.fa.fa-s15:before { + content: "\f2cd"; } + +.fa.fa-window-maximize { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-window-restore { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-times-rectangle:before { + content: "\f410"; } + +.fa.fa-window-close-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-window-close-o:before { + content: "\f410"; } + +.fa.fa-times-rectangle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-times-rectangle-o:before { + content: "\f410"; } + +.fa.fa-bandcamp { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-grav { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-etsy { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-imdb { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-ravelry { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-eercast { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-eercast:before { + content: "\f2da"; } + +.fa.fa-snowflake-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-snowflake-o:before { + content: "\f2dc"; } + +.fa.fa-superpowers { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wpexplorer { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-meetup { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } diff --git a/deps/font-awesome-6.5.2/css/v4-shims.min.css b/deps/font-awesome-6.5.2/css/v4-shims.min.css new file mode 100644 index 0000000..09baf5f --- /dev/null +++ b/deps/font-awesome-6.5.2/css/v4-shims.min.css @@ -0,0 +1,6 @@ +/*! + * Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2024 Fonticons, Inc. + */ +.fa.fa-glass:before{content:"\f000"}.fa.fa-envelope-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-envelope-o:before{content:"\f0e0"}.fa.fa-star-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-star-o:before{content:"\f005"}.fa.fa-close:before,.fa.fa-remove:before{content:"\f00d"}.fa.fa-gear:before{content:"\f013"}.fa.fa-trash-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-trash-o:before{content:"\f2ed"}.fa.fa-home:before{content:"\f015"}.fa.fa-file-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-o:before{content:"\f15b"}.fa.fa-clock-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-clock-o:before{content:"\f017"}.fa.fa-arrow-circle-o-down{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-arrow-circle-o-down:before{content:"\f358"}.fa.fa-arrow-circle-o-up{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-arrow-circle-o-up:before{content:"\f35b"}.fa.fa-play-circle-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-play-circle-o:before{content:"\f144"}.fa.fa-repeat:before,.fa.fa-rotate-right:before{content:"\f01e"}.fa.fa-refresh:before{content:"\f021"}.fa.fa-list-alt{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-list-alt:before{content:"\f022"}.fa.fa-dedent:before{content:"\f03b"}.fa.fa-video-camera:before{content:"\f03d"}.fa.fa-picture-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-picture-o:before{content:"\f03e"}.fa.fa-photo{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-photo:before{content:"\f03e"}.fa.fa-image{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-image:before{content:"\f03e"}.fa.fa-map-marker:before{content:"\f3c5"}.fa.fa-pencil-square-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-pencil-square-o:before{content:"\f044"}.fa.fa-edit{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-edit:before{content:"\f044"}.fa.fa-share-square-o:before{content:"\f14d"}.fa.fa-check-square-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-check-square-o:before{content:"\f14a"}.fa.fa-arrows:before{content:"\f0b2"}.fa.fa-times-circle-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-times-circle-o:before{content:"\f057"}.fa.fa-check-circle-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-check-circle-o:before{content:"\f058"}.fa.fa-mail-forward:before{content:"\f064"}.fa.fa-expand:before{content:"\f424"}.fa.fa-compress:before{content:"\f422"}.fa.fa-eye,.fa.fa-eye-slash{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-warning:before{content:"\f071"}.fa.fa-calendar:before{content:"\f073"}.fa.fa-arrows-v:before{content:"\f338"}.fa.fa-arrows-h:before{content:"\f337"}.fa.fa-bar-chart-o:before,.fa.fa-bar-chart:before{content:"\e0e3"}.fa.fa-twitter-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-twitter-square:before{content:"\f081"}.fa.fa-facebook-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-facebook-square:before{content:"\f082"}.fa.fa-gears:before{content:"\f085"}.fa.fa-thumbs-o-up{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-thumbs-o-up:before{content:"\f164"}.fa.fa-thumbs-o-down{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-thumbs-o-down:before{content:"\f165"}.fa.fa-heart-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-heart-o:before{content:"\f004"}.fa.fa-sign-out:before{content:"\f2f5"}.fa.fa-linkedin-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-linkedin-square:before{content:"\f08c"}.fa.fa-thumb-tack:before{content:"\f08d"}.fa.fa-external-link:before{content:"\f35d"}.fa.fa-sign-in:before{content:"\f2f6"}.fa.fa-github-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-github-square:before{content:"\f092"}.fa.fa-lemon-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-lemon-o:before{content:"\f094"}.fa.fa-square-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-square-o:before{content:"\f0c8"}.fa.fa-bookmark-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-bookmark-o:before{content:"\f02e"}.fa.fa-facebook,.fa.fa-twitter{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-facebook:before{content:"\f39e"}.fa.fa-facebook-f{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-facebook-f:before{content:"\f39e"}.fa.fa-github{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-credit-card{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-feed:before{content:"\f09e"}.fa.fa-hdd-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hdd-o:before{content:"\f0a0"}.fa.fa-hand-o-right{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hand-o-right:before{content:"\f0a4"}.fa.fa-hand-o-left{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hand-o-left:before{content:"\f0a5"}.fa.fa-hand-o-up{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hand-o-up:before{content:"\f0a6"}.fa.fa-hand-o-down{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hand-o-down:before{content:"\f0a7"}.fa.fa-globe:before{content:"\f57d"}.fa.fa-tasks:before{content:"\f828"}.fa.fa-arrows-alt:before{content:"\f31e"}.fa.fa-group:before{content:"\f0c0"}.fa.fa-chain:before{content:"\f0c1"}.fa.fa-cut:before{content:"\f0c4"}.fa.fa-files-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-files-o:before{content:"\f0c5"}.fa.fa-floppy-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-floppy-o:before{content:"\f0c7"}.fa.fa-save{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-save:before{content:"\f0c7"}.fa.fa-navicon:before,.fa.fa-reorder:before{content:"\f0c9"}.fa.fa-magic:before{content:"\e2ca"}.fa.fa-pinterest,.fa.fa-pinterest-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-pinterest-square:before{content:"\f0d3"}.fa.fa-google-plus-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-google-plus-square:before{content:"\f0d4"}.fa.fa-google-plus{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-google-plus:before{content:"\f0d5"}.fa.fa-money:before{content:"\f3d1"}.fa.fa-unsorted:before{content:"\f0dc"}.fa.fa-sort-desc:before{content:"\f0dd"}.fa.fa-sort-asc:before{content:"\f0de"}.fa.fa-linkedin{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-linkedin:before{content:"\f0e1"}.fa.fa-rotate-left:before{content:"\f0e2"}.fa.fa-legal:before{content:"\f0e3"}.fa.fa-dashboard:before,.fa.fa-tachometer:before{content:"\f625"}.fa.fa-comment-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-comment-o:before{content:"\f075"}.fa.fa-comments-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-comments-o:before{content:"\f086"}.fa.fa-flash:before{content:"\f0e7"}.fa.fa-clipboard:before{content:"\f0ea"}.fa.fa-lightbulb-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-lightbulb-o:before{content:"\f0eb"}.fa.fa-exchange:before{content:"\f362"}.fa.fa-cloud-download:before{content:"\f0ed"}.fa.fa-cloud-upload:before{content:"\f0ee"}.fa.fa-bell-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-bell-o:before{content:"\f0f3"}.fa.fa-cutlery:before{content:"\f2e7"}.fa.fa-file-text-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-text-o:before{content:"\f15c"}.fa.fa-building-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-building-o:before{content:"\f1ad"}.fa.fa-hospital-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hospital-o:before{content:"\f0f8"}.fa.fa-tablet:before{content:"\f3fa"}.fa.fa-mobile-phone:before,.fa.fa-mobile:before{content:"\f3cd"}.fa.fa-circle-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-circle-o:before{content:"\f111"}.fa.fa-mail-reply:before{content:"\f3e5"}.fa.fa-github-alt{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-folder-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-folder-o:before{content:"\f07b"}.fa.fa-folder-open-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-folder-open-o:before{content:"\f07c"}.fa.fa-smile-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-smile-o:before{content:"\f118"}.fa.fa-frown-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-frown-o:before{content:"\f119"}.fa.fa-meh-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-meh-o:before{content:"\f11a"}.fa.fa-keyboard-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-keyboard-o:before{content:"\f11c"}.fa.fa-flag-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-flag-o:before{content:"\f024"}.fa.fa-mail-reply-all:before{content:"\f122"}.fa.fa-star-half-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-star-half-o:before{content:"\f5c0"}.fa.fa-star-half-empty{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-star-half-empty:before{content:"\f5c0"}.fa.fa-star-half-full{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-star-half-full:before{content:"\f5c0"}.fa.fa-code-fork:before{content:"\f126"}.fa.fa-chain-broken:before,.fa.fa-unlink:before{content:"\f127"}.fa.fa-calendar-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-calendar-o:before{content:"\f133"}.fa.fa-css3,.fa.fa-html5,.fa.fa-maxcdn{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-unlock-alt:before{content:"\f09c"}.fa.fa-minus-square-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-minus-square-o:before{content:"\f146"}.fa.fa-level-up:before{content:"\f3bf"}.fa.fa-level-down:before{content:"\f3be"}.fa.fa-pencil-square:before{content:"\f14b"}.fa.fa-external-link-square:before{content:"\f360"}.fa.fa-compass{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-caret-square-o-down{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-caret-square-o-down:before{content:"\f150"}.fa.fa-toggle-down{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-toggle-down:before{content:"\f150"}.fa.fa-caret-square-o-up{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-caret-square-o-up:before{content:"\f151"}.fa.fa-toggle-up{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-toggle-up:before{content:"\f151"}.fa.fa-caret-square-o-right{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-caret-square-o-right:before{content:"\f152"}.fa.fa-toggle-right{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-toggle-right:before{content:"\f152"}.fa.fa-eur:before,.fa.fa-euro:before{content:"\f153"}.fa.fa-gbp:before{content:"\f154"}.fa.fa-dollar:before,.fa.fa-usd:before{content:"\24"}.fa.fa-inr:before,.fa.fa-rupee:before{content:"\e1bc"}.fa.fa-cny:before,.fa.fa-jpy:before,.fa.fa-rmb:before,.fa.fa-yen:before{content:"\f157"}.fa.fa-rouble:before,.fa.fa-rub:before,.fa.fa-ruble:before{content:"\f158"}.fa.fa-krw:before,.fa.fa-won:before{content:"\f159"}.fa.fa-bitcoin,.fa.fa-btc{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-bitcoin:before{content:"\f15a"}.fa.fa-file-text:before{content:"\f15c"}.fa.fa-sort-alpha-asc:before{content:"\f15d"}.fa.fa-sort-alpha-desc:before{content:"\f881"}.fa.fa-sort-amount-asc:before{content:"\f884"}.fa.fa-sort-amount-desc:before{content:"\f160"}.fa.fa-sort-numeric-asc:before{content:"\f162"}.fa.fa-sort-numeric-desc:before{content:"\f886"}.fa.fa-youtube-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-youtube-square:before{content:"\f431"}.fa.fa-xing,.fa.fa-xing-square,.fa.fa-youtube{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-xing-square:before{content:"\f169"}.fa.fa-youtube-play{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-youtube-play:before{content:"\f167"}.fa.fa-adn,.fa.fa-bitbucket,.fa.fa-bitbucket-square,.fa.fa-dropbox,.fa.fa-flickr,.fa.fa-instagram,.fa.fa-stack-overflow{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-bitbucket-square:before{content:"\f171"}.fa.fa-tumblr,.fa.fa-tumblr-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-tumblr-square:before{content:"\f174"}.fa.fa-long-arrow-down:before{content:"\f309"}.fa.fa-long-arrow-up:before{content:"\f30c"}.fa.fa-long-arrow-left:before{content:"\f30a"}.fa.fa-long-arrow-right:before{content:"\f30b"}.fa.fa-android,.fa.fa-apple,.fa.fa-dribbble,.fa.fa-foursquare,.fa.fa-gittip,.fa.fa-gratipay,.fa.fa-linux,.fa.fa-skype,.fa.fa-trello,.fa.fa-windows{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-gittip:before{content:"\f184"}.fa.fa-sun-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-sun-o:before{content:"\f185"}.fa.fa-moon-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-moon-o:before{content:"\f186"}.fa.fa-pagelines,.fa.fa-renren,.fa.fa-stack-exchange,.fa.fa-vk,.fa.fa-weibo{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-arrow-circle-o-right{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-arrow-circle-o-right:before{content:"\f35a"}.fa.fa-arrow-circle-o-left{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-arrow-circle-o-left:before{content:"\f359"}.fa.fa-caret-square-o-left{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-caret-square-o-left:before{content:"\f191"}.fa.fa-toggle-left{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-toggle-left:before{content:"\f191"}.fa.fa-dot-circle-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-dot-circle-o:before{content:"\f192"}.fa.fa-vimeo-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-vimeo-square:before{content:"\f194"}.fa.fa-try:before,.fa.fa-turkish-lira:before{content:"\e2bb"}.fa.fa-plus-square-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-plus-square-o:before{content:"\f0fe"}.fa.fa-openid,.fa.fa-slack,.fa.fa-wordpress{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-bank:before,.fa.fa-institution:before{content:"\f19c"}.fa.fa-mortar-board:before{content:"\f19d"}.fa.fa-google,.fa.fa-reddit,.fa.fa-reddit-square,.fa.fa-yahoo{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-reddit-square:before{content:"\f1a2"}.fa.fa-behance,.fa.fa-behance-square,.fa.fa-delicious,.fa.fa-digg,.fa.fa-drupal,.fa.fa-joomla,.fa.fa-pied-piper-alt,.fa.fa-pied-piper-pp,.fa.fa-stumbleupon,.fa.fa-stumbleupon-circle{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-behance-square:before{content:"\f1b5"}.fa.fa-steam,.fa.fa-steam-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-steam-square:before{content:"\f1b7"}.fa.fa-automobile:before{content:"\f1b9"}.fa.fa-cab:before{content:"\f1ba"}.fa.fa-deviantart,.fa.fa-soundcloud,.fa.fa-spotify{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-file-pdf-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-pdf-o:before{content:"\f1c1"}.fa.fa-file-word-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-word-o:before{content:"\f1c2"}.fa.fa-file-excel-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-excel-o:before{content:"\f1c3"}.fa.fa-file-powerpoint-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-powerpoint-o:before{content:"\f1c4"}.fa.fa-file-image-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-image-o:before{content:"\f1c5"}.fa.fa-file-photo-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-photo-o:before{content:"\f1c5"}.fa.fa-file-picture-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-picture-o:before{content:"\f1c5"}.fa.fa-file-archive-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-archive-o:before{content:"\f1c6"}.fa.fa-file-zip-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-zip-o:before{content:"\f1c6"}.fa.fa-file-audio-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-audio-o:before{content:"\f1c7"}.fa.fa-file-sound-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-sound-o:before{content:"\f1c7"}.fa.fa-file-video-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-video-o:before{content:"\f1c8"}.fa.fa-file-movie-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-movie-o:before{content:"\f1c8"}.fa.fa-file-code-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-file-code-o:before{content:"\f1c9"}.fa.fa-codepen,.fa.fa-jsfiddle,.fa.fa-vine{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-life-bouy:before,.fa.fa-life-buoy:before,.fa.fa-life-saver:before,.fa.fa-support:before{content:"\f1cd"}.fa.fa-circle-o-notch:before{content:"\f1ce"}.fa.fa-ra,.fa.fa-rebel{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-ra:before{content:"\f1d0"}.fa.fa-resistance{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-resistance:before{content:"\f1d0"}.fa.fa-empire,.fa.fa-ge{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-ge:before{content:"\f1d1"}.fa.fa-git-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-git-square:before{content:"\f1d2"}.fa.fa-git,.fa.fa-hacker-news,.fa.fa-y-combinator-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-y-combinator-square:before{content:"\f1d4"}.fa.fa-yc-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-yc-square:before{content:"\f1d4"}.fa.fa-qq,.fa.fa-tencent-weibo,.fa.fa-wechat,.fa.fa-weixin{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-wechat:before{content:"\f1d7"}.fa.fa-send:before{content:"\f1d8"}.fa.fa-paper-plane-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-paper-plane-o:before{content:"\f1d8"}.fa.fa-send-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-send-o:before{content:"\f1d8"}.fa.fa-circle-thin{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-circle-thin:before{content:"\f111"}.fa.fa-header:before{content:"\f1dc"}.fa.fa-futbol-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-futbol-o:before{content:"\f1e3"}.fa.fa-soccer-ball-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-soccer-ball-o:before{content:"\f1e3"}.fa.fa-slideshare,.fa.fa-twitch,.fa.fa-yelp{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-newspaper-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-newspaper-o:before{content:"\f1ea"}.fa.fa-cc-amex,.fa.fa-cc-discover,.fa.fa-cc-mastercard,.fa.fa-cc-paypal,.fa.fa-cc-stripe,.fa.fa-cc-visa,.fa.fa-google-wallet,.fa.fa-paypal{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-bell-slash-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-bell-slash-o:before{content:"\f1f6"}.fa.fa-trash:before{content:"\f2ed"}.fa.fa-copyright{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-eyedropper:before{content:"\f1fb"}.fa.fa-area-chart:before{content:"\f1fe"}.fa.fa-pie-chart:before{content:"\f200"}.fa.fa-line-chart:before{content:"\f201"}.fa.fa-lastfm,.fa.fa-lastfm-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-lastfm-square:before{content:"\f203"}.fa.fa-angellist,.fa.fa-ioxhost{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-cc{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-cc:before{content:"\f20a"}.fa.fa-ils:before,.fa.fa-shekel:before,.fa.fa-sheqel:before{content:"\f20b"}.fa.fa-buysellads,.fa.fa-connectdevelop,.fa.fa-dashcube,.fa.fa-forumbee,.fa.fa-leanpub,.fa.fa-sellsy,.fa.fa-shirtsinbulk,.fa.fa-simplybuilt,.fa.fa-skyatlas{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-diamond{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-diamond:before{content:"\f3a5"}.fa.fa-intersex:before,.fa.fa-transgender:before{content:"\f224"}.fa.fa-transgender-alt:before{content:"\f225"}.fa.fa-facebook-official{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-facebook-official:before{content:"\f09a"}.fa.fa-pinterest-p,.fa.fa-whatsapp{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-hotel:before{content:"\f236"}.fa.fa-medium,.fa.fa-viacoin,.fa.fa-y-combinator,.fa.fa-yc{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-yc:before{content:"\f23b"}.fa.fa-expeditedssl,.fa.fa-opencart,.fa.fa-optin-monster{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-battery-4:before,.fa.fa-battery:before{content:"\f240"}.fa.fa-battery-3:before{content:"\f241"}.fa.fa-battery-2:before{content:"\f242"}.fa.fa-battery-1:before{content:"\f243"}.fa.fa-battery-0:before{content:"\f244"}.fa.fa-object-group,.fa.fa-object-ungroup,.fa.fa-sticky-note-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-sticky-note-o:before{content:"\f249"}.fa.fa-cc-diners-club,.fa.fa-cc-jcb{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-clone{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hourglass-o:before{content:"\f254"}.fa.fa-hourglass-1:before{content:"\f251"}.fa.fa-hourglass-2:before{content:"\f252"}.fa.fa-hourglass-3:before{content:"\f253"}.fa.fa-hand-rock-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hand-rock-o:before{content:"\f255"}.fa.fa-hand-grab-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hand-grab-o:before{content:"\f255"}.fa.fa-hand-paper-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hand-paper-o:before{content:"\f256"}.fa.fa-hand-stop-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hand-stop-o:before{content:"\f256"}.fa.fa-hand-scissors-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hand-scissors-o:before{content:"\f257"}.fa.fa-hand-lizard-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hand-lizard-o:before{content:"\f258"}.fa.fa-hand-spock-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hand-spock-o:before{content:"\f259"}.fa.fa-hand-pointer-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hand-pointer-o:before{content:"\f25a"}.fa.fa-hand-peace-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-hand-peace-o:before{content:"\f25b"}.fa.fa-registered{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-creative-commons,.fa.fa-gg,.fa.fa-gg-circle,.fa.fa-odnoklassniki,.fa.fa-odnoklassniki-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-odnoklassniki-square:before{content:"\f264"}.fa.fa-chrome,.fa.fa-firefox,.fa.fa-get-pocket,.fa.fa-internet-explorer,.fa.fa-opera,.fa.fa-safari,.fa.fa-wikipedia-w{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-television:before{content:"\f26c"}.fa.fa-500px,.fa.fa-amazon,.fa.fa-contao{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-calendar-plus-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-calendar-plus-o:before{content:"\f271"}.fa.fa-calendar-minus-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-calendar-minus-o:before{content:"\f272"}.fa.fa-calendar-times-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-calendar-times-o:before{content:"\f273"}.fa.fa-calendar-check-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-calendar-check-o:before{content:"\f274"}.fa.fa-map-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-map-o:before{content:"\f279"}.fa.fa-commenting:before{content:"\f4ad"}.fa.fa-commenting-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-commenting-o:before{content:"\f4ad"}.fa.fa-houzz,.fa.fa-vimeo{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-vimeo:before{content:"\f27d"}.fa.fa-black-tie,.fa.fa-edge,.fa.fa-fonticons,.fa.fa-reddit-alien{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-credit-card-alt:before{content:"\f09d"}.fa.fa-codiepie,.fa.fa-fort-awesome,.fa.fa-mixcloud,.fa.fa-modx,.fa.fa-product-hunt,.fa.fa-scribd,.fa.fa-usb{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-pause-circle-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-pause-circle-o:before{content:"\f28b"}.fa.fa-stop-circle-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-stop-circle-o:before{content:"\f28d"}.fa.fa-bluetooth,.fa.fa-bluetooth-b,.fa.fa-envira,.fa.fa-gitlab,.fa.fa-wheelchair-alt,.fa.fa-wpbeginner,.fa.fa-wpforms{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-wheelchair-alt:before{content:"\f368"}.fa.fa-question-circle-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-question-circle-o:before{content:"\f059"}.fa.fa-volume-control-phone:before{content:"\f2a0"}.fa.fa-asl-interpreting:before{content:"\f2a3"}.fa.fa-deafness:before,.fa.fa-hard-of-hearing:before{content:"\f2a4"}.fa.fa-glide,.fa.fa-glide-g{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-signing:before{content:"\f2a7"}.fa.fa-viadeo,.fa.fa-viadeo-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-viadeo-square:before{content:"\f2aa"}.fa.fa-snapchat,.fa.fa-snapchat-ghost{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-snapchat-ghost:before{content:"\f2ab"}.fa.fa-snapchat-square{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-snapchat-square:before{content:"\f2ad"}.fa.fa-first-order,.fa.fa-google-plus-official,.fa.fa-pied-piper,.fa.fa-themeisle,.fa.fa-yoast{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-google-plus-official:before{content:"\f2b3"}.fa.fa-google-plus-circle{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-google-plus-circle:before{content:"\f2b3"}.fa.fa-fa,.fa.fa-font-awesome{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-fa:before{content:"\f2b4"}.fa.fa-handshake-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-handshake-o:before{content:"\f2b5"}.fa.fa-envelope-open-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-envelope-open-o:before{content:"\f2b6"}.fa.fa-linode{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-address-book-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-address-book-o:before{content:"\f2b9"}.fa.fa-vcard:before{content:"\f2bb"}.fa.fa-address-card-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-address-card-o:before{content:"\f2bb"}.fa.fa-vcard-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-vcard-o:before{content:"\f2bb"}.fa.fa-user-circle-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-user-circle-o:before{content:"\f2bd"}.fa.fa-user-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-user-o:before{content:"\f007"}.fa.fa-id-badge{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-drivers-license:before{content:"\f2c2"}.fa.fa-id-card-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-id-card-o:before{content:"\f2c2"}.fa.fa-drivers-license-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-drivers-license-o:before{content:"\f2c2"}.fa.fa-free-code-camp,.fa.fa-quora,.fa.fa-telegram{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-thermometer-4:before,.fa.fa-thermometer:before{content:"\f2c7"}.fa.fa-thermometer-3:before{content:"\f2c8"}.fa.fa-thermometer-2:before{content:"\f2c9"}.fa.fa-thermometer-1:before{content:"\f2ca"}.fa.fa-thermometer-0:before{content:"\f2cb"}.fa.fa-bathtub:before,.fa.fa-s15:before{content:"\f2cd"}.fa.fa-window-maximize,.fa.fa-window-restore{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-times-rectangle:before{content:"\f410"}.fa.fa-window-close-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-window-close-o:before{content:"\f410"}.fa.fa-times-rectangle-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-times-rectangle-o:before{content:"\f410"}.fa.fa-bandcamp,.fa.fa-eercast,.fa.fa-etsy,.fa.fa-grav,.fa.fa-imdb,.fa.fa-ravelry{font-family:"Font Awesome 6 Brands";font-weight:400}.fa.fa-eercast:before{content:"\f2da"}.fa.fa-snowflake-o{font-family:"Font Awesome 6 Free";font-weight:400}.fa.fa-snowflake-o:before{content:"\f2dc"}.fa.fa-meetup,.fa.fa-superpowers,.fa.fa-wpexplorer{font-family:"Font Awesome 6 Brands";font-weight:400} \ No newline at end of file diff --git a/deps/font-awesome-6.5.2/webfonts/fa-brands-400.ttf b/deps/font-awesome-6.5.2/webfonts/fa-brands-400.ttf new file mode 100644 index 0000000..1fbb1f7 Binary files /dev/null and b/deps/font-awesome-6.5.2/webfonts/fa-brands-400.ttf differ diff --git a/deps/font-awesome-6.5.2/webfonts/fa-brands-400.woff2 b/deps/font-awesome-6.5.2/webfonts/fa-brands-400.woff2 new file mode 100644 index 0000000..5d28021 Binary files /dev/null and b/deps/font-awesome-6.5.2/webfonts/fa-brands-400.woff2 differ diff --git a/deps/font-awesome-6.5.2/webfonts/fa-regular-400.ttf b/deps/font-awesome-6.5.2/webfonts/fa-regular-400.ttf new file mode 100644 index 0000000..549d68d Binary files /dev/null and b/deps/font-awesome-6.5.2/webfonts/fa-regular-400.ttf differ diff --git a/deps/font-awesome-6.5.2/webfonts/fa-regular-400.woff2 b/deps/font-awesome-6.5.2/webfonts/fa-regular-400.woff2 new file mode 100644 index 0000000..18400d7 Binary files /dev/null and b/deps/font-awesome-6.5.2/webfonts/fa-regular-400.woff2 differ diff --git a/deps/font-awesome-6.5.2/webfonts/fa-solid-900.ttf b/deps/font-awesome-6.5.2/webfonts/fa-solid-900.ttf new file mode 100644 index 0000000..bb2a869 Binary files /dev/null and b/deps/font-awesome-6.5.2/webfonts/fa-solid-900.ttf differ diff --git a/deps/font-awesome-6.5.2/webfonts/fa-solid-900.woff2 b/deps/font-awesome-6.5.2/webfonts/fa-solid-900.woff2 new file mode 100644 index 0000000..758dd4f Binary files /dev/null and b/deps/font-awesome-6.5.2/webfonts/fa-solid-900.woff2 differ diff --git a/deps/font-awesome-6.5.2/webfonts/fa-v4compatibility.ttf b/deps/font-awesome-6.5.2/webfonts/fa-v4compatibility.ttf new file mode 100644 index 0000000..8c5864c Binary files /dev/null and b/deps/font-awesome-6.5.2/webfonts/fa-v4compatibility.ttf differ diff --git a/deps/font-awesome-6.5.2/webfonts/fa-v4compatibility.woff2 b/deps/font-awesome-6.5.2/webfonts/fa-v4compatibility.woff2 new file mode 100644 index 0000000..f94bec2 Binary files /dev/null and b/deps/font-awesome-6.5.2/webfonts/fa-v4compatibility.woff2 differ diff --git a/deps/headroom-0.11.0/headroom.min.js b/deps/headroom-0.11.0/headroom.min.js new file mode 100644 index 0000000..433069f --- /dev/null +++ b/deps/headroom-0.11.0/headroom.min.js @@ -0,0 +1,7 @@ +/*! + * headroom.js v0.11.0 - Give your page some headroom. Hide your header until you need it + * Copyright (c) 2020 Nick Williams - http://wicky.nillia.ms/headroom.js + * License: MIT + */ + +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).Headroom=n()}(this,function(){"use strict";function t(){return"undefined"!=typeof window}function d(t){return function(t){return t&&t.document&&function(t){return 9===t.nodeType}(t.document)}(t)?function(t){var n=t.document,o=n.body,s=n.documentElement;return{scrollHeight:function(){return Math.max(o.scrollHeight,s.scrollHeight,o.offsetHeight,s.offsetHeight,o.clientHeight,s.clientHeight)},height:function(){return t.innerHeight||s.clientHeight||o.clientHeight},scrollY:function(){return void 0!==t.pageYOffset?t.pageYOffset:(s||o.parentNode||o).scrollTop}}}(t):function(t){return{scrollHeight:function(){return Math.max(t.scrollHeight,t.offsetHeight,t.clientHeight)},height:function(){return Math.max(t.offsetHeight,t.clientHeight)},scrollY:function(){return t.scrollTop}}}(t)}function n(t,s,e){var n,o=function(){var n=!1;try{var t={get passive(){n=!0}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){n=!1}return n}(),i=!1,r=d(t),l=r.scrollY(),a={};function c(){var t=Math.round(r.scrollY()),n=r.height(),o=r.scrollHeight();a.scrollY=t,a.lastScrollY=l,a.direction=ls.tolerance[a.direction],e(a),l=t,i=!1}function h(){i||(i=!0,n=requestAnimationFrame(c))}var u=!!o&&{passive:!0,capture:!1};return t.addEventListener("scroll",h,u),c(),{destroy:function(){cancelAnimationFrame(n),t.removeEventListener("scroll",h,u)}}}function o(t,n){n=n||{},Object.assign(this,o.options,n),this.classes=Object.assign({},o.options.classes,n.classes),this.elem=t,this.tolerance=function(t){return t===Object(t)?t:{down:t,up:t}}(this.tolerance),this.initialised=!1,this.frozen=!1}return o.prototype={constructor:o,init:function(){return o.cutsTheMustard&&!this.initialised&&(this.addClass("initial"),this.initialised=!0,setTimeout(function(t){t.scrollTracker=n(t.scroller,{offset:t.offset,tolerance:t.tolerance},t.update.bind(t))},100,this)),this},destroy:function(){this.initialised=!1,Object.keys(this.classes).forEach(this.removeClass,this),this.scrollTracker.destroy()},unpin:function(){!this.hasClass("pinned")&&this.hasClass("unpinned")||(this.addClass("unpinned"),this.removeClass("pinned"),this.onUnpin&&this.onUnpin.call(this))},pin:function(){this.hasClass("unpinned")&&(this.addClass("pinned"),this.removeClass("unpinned"),this.onPin&&this.onPin.call(this))},freeze:function(){this.frozen=!0,this.addClass("frozen")},unfreeze:function(){this.frozen=!1,this.removeClass("frozen")},top:function(){this.hasClass("top")||(this.addClass("top"),this.removeClass("notTop"),this.onTop&&this.onTop.call(this))},notTop:function(){this.hasClass("notTop")||(this.addClass("notTop"),this.removeClass("top"),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){this.hasClass("bottom")||(this.addClass("bottom"),this.removeClass("notBottom"),this.onBottom&&this.onBottom.call(this))},notBottom:function(){this.hasClass("notBottom")||(this.addClass("notBottom"),this.removeClass("bottom"),this.onNotBottom&&this.onNotBottom.call(this))},shouldUnpin:function(t){return"down"===t.direction&&!t.top&&t.toleranceExceeded},shouldPin:function(t){return"up"===t.direction&&t.toleranceExceeded||t.top},addClass:function(t){this.elem.classList.add.apply(this.elem.classList,this.classes[t].split(" "))},removeClass:function(t){this.elem.classList.remove.apply(this.elem.classList,this.classes[t].split(" "))},hasClass:function(t){return this.classes[t].split(" ").every(function(t){return this.classList.contains(t)},this.elem)},update:function(t){t.isOutOfBounds||!0!==this.frozen&&(t.top?this.top():this.notTop(),t.bottom?this.bottom():this.notBottom(),this.shouldUnpin(t)?this.unpin():this.shouldPin(t)&&this.pin())}},o.options={tolerance:{up:0,down:0},offset:0,scroller:t()?window:null,classes:{frozen:"headroom--frozen",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},o.cutsTheMustard=!!(t()&&function(){}.bind&&"classList"in document.documentElement&&Object.assign&&Object.keys&&requestAnimationFrame),o}); \ No newline at end of file diff --git a/deps/headroom-0.11.0/jQuery.headroom.min.js b/deps/headroom-0.11.0/jQuery.headroom.min.js new file mode 100644 index 0000000..17f70c9 --- /dev/null +++ b/deps/headroom-0.11.0/jQuery.headroom.min.js @@ -0,0 +1,7 @@ +/*! + * headroom.js v0.9.4 - Give your page some headroom. Hide your header until you need it + * Copyright (c) 2017 Nick Williams - http://wicky.nillia.ms/headroom.js + * License: MIT + */ + +!function(a){a&&(a.fn.headroom=function(b){return this.each(function(){var c=a(this),d=c.data("headroom"),e="object"==typeof b&&b;e=a.extend(!0,{},Headroom.options,e),d||(d=new Headroom(this,e),d.init(),c.data("headroom",d)),"string"==typeof b&&(d[b](),"destroy"===b&&c.removeData("headroom"))})},a("[data-headroom]").each(function(){var b=a(this);b.headroom(b.data())}))}(window.Zepto||window.jQuery); \ No newline at end of file diff --git a/deps/jquery-3.6.0/jquery-3.6.0.js b/deps/jquery-3.6.0/jquery-3.6.0.js new file mode 100644 index 0000000..fc6c299 --- /dev/null +++ b/deps/jquery-3.6.0/jquery-3.6.0.js @@ -0,0 +1,10881 @@ +/*! + * jQuery JavaScript Library v3.6.0 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2021-03-02T17:08Z + */ +( function( global, factory ) { + + "use strict"; + + if ( typeof module === "object" && typeof module.exports === "object" ) { + + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; + +var arr = []; + +var getProto = Object.getPrototypeOf; + +var slice = arr.slice; + +var flat = arr.flat ? function( array ) { + return arr.flat.call( array ); +} : function( array ) { + return arr.concat.apply( [], array ); +}; + + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + +var support = {}; + +var isFunction = function isFunction( obj ) { + + // Support: Chrome <=57, Firefox <=52 + // In some browsers, typeof returns "function" for HTML elements + // (i.e., `typeof document.createElement( "object" ) === "function"`). + // We don't want to classify *any* DOM node as a function. + // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 + // Plus for old WebKit, typeof returns "function" for HTML collections + // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) + return typeof obj === "function" && typeof obj.nodeType !== "number" && + typeof obj.item !== "function"; + }; + + +var isWindow = function isWindow( obj ) { + return obj != null && obj === obj.window; + }; + + +var document = window.document; + + + + var preservedScriptAttributes = { + type: true, + src: true, + nonce: true, + noModule: true + }; + + function DOMEval( code, node, doc ) { + doc = doc || document; + + var i, val, + script = doc.createElement( "script" ); + + script.text = code; + if ( node ) { + for ( i in preservedScriptAttributes ) { + + // Support: Firefox 64+, Edge 18+ + // Some browsers don't support the "nonce" property on scripts. + // On the other hand, just using `getAttribute` is not enough as + // the `nonce` attribute is reset to an empty string whenever it + // becomes browsing-context connected. + // See https://github.com/whatwg/html/issues/2369 + // See https://html.spec.whatwg.org/#nonce-attributes + // The `node.getAttribute` check was added for the sake of + // `jQuery.globalEval` so that it can fake a nonce-containing node + // via an object. + val = node[ i ] || node.getAttribute && node.getAttribute( i ); + if ( val ) { + script.setAttribute( i, val ); + } + } + } + doc.head.appendChild( script ).parentNode.removeChild( script ); + } + + +function toType( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; +} +/* global Symbol */ +// Defining this global in .eslintrc.json would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module + + + +var + version = "3.6.0", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + + // Return all the elements in a clean array + if ( num == null ) { + return slice.call( this ); + } + + // Return just the one element from the set + return num < 0 ? this[ num + this.length ] : this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + even: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return ( i + 1 ) % 2; + } ) ); + }, + + odd: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return i % 2; + } ) ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + copy = options[ name ]; + + // Prevent Object.prototype pollution + // Prevent never-ending loop + if ( name === "__proto__" || target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + src = target[ name ]; + + // Ensure proper type for the source value + if ( copyIsArray && !Array.isArray( src ) ) { + clone = []; + } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { + clone = {}; + } else { + clone = src; + } + copyIsArray = false; + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isPlainObject: function( obj ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { + return false; + } + + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; + } + + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; + }, + + isEmptyObject: function( obj ) { + var name; + + for ( name in obj ) { + return false; + } + return true; + }, + + // Evaluates a script in a provided context; falls back to the global one + // if not specified. + globalEval: function( code, options, doc ) { + DOMEval( code, { nonce: options && options.nonce }, doc ); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return flat( ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), + function( _i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); + } ); + +function isArrayLike( obj ) { + + // Support: real iOS 8.2 only (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = toType( obj ); + + if ( isFunction( obj ) || isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.3.6 + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://js.foundation/ + * + * Date: 2021-02-16 + */ +( function( window ) { +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + nonnativeSelectorCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // Instance methods + hasOwn = ( {} ).hasOwnProperty, + arr = [], + pop = arr.pop, + pushNative = arr.push, + push = arr.push, + slice = arr.slice, + + // Use a stripped-down indexOf as it's faster than native + // https://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[ i ] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + + "ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram + identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + + // "Attribute values must be CSS identifiers [capture 5] + // or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + + whitespace + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + + "*" ), + rdescend = new RegExp( whitespace + "|>" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rhtml = /HTML$/i, + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + + // CSS escapes + // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), + funescape = function( escape, nonHex ) { + var high = "0x" + escape.slice( 1 ) - 0x10000; + + return nonHex ? + + // Strip the backslash prefix from a non-hex escape sequence + nonHex : + + // Replace a hexadecimal escape sequence with the encoded Unicode code point + // Support: IE <=11+ + // For values outside the Basic Multilingual Plane (BMP), manually construct a + // surrogate pair + high < 0 ? + String.fromCharCode( high + 0x10000 ) : + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }, + + inDisabledFieldset = addCombinator( + function( elem ) { + return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; + }, + { dir: "parentNode", next: "legend" } + ); + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + ( arr = slice.call( preferredDoc.childNodes ) ), + preferredDoc.childNodes + ); + + // Support: Android<4.0 + // Detect silently failing push.apply + // eslint-disable-next-line no-unused-expressions + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + pushNative.apply( target, slice.call( els ) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + + // Can't trust NodeList.length + while ( ( target[ j++ ] = els[ i++ ] ) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + setDocument( context ); + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { + + // ID selector + if ( ( m = match[ 1 ] ) ) { + + // Document context + if ( nodeType === 9 ) { + if ( ( elem = context.getElementById( m ) ) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && ( elem = newContext.getElementById( m ) ) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[ 2 ] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !nonnativeSelectorCache[ selector + " " ] && + ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && + + // Support: IE 8 only + // Exclude object elements + ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { + + newSelector = selector; + newContext = context; + + // qSA considers elements outside a scoping root when evaluating child or + // descendant combinators, which is not what we want. + // In such cases, we work around the behavior by prefixing every selector in the + // list with an ID selector referencing the scope context. + // The technique has to be used as well when a leading combinator is used + // as such selectors are not recognized by querySelectorAll. + // Thanks to Andrew Dupont for this technique. + if ( nodeType === 1 && + ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + + // We can use :scope instead of the ID hack if the browser + // supports it & if we're not changing the context. + if ( newContext !== context || !support.scope ) { + + // Capture the context ID, setting it first if necessary + if ( ( nid = context.getAttribute( "id" ) ) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", ( nid = expando ) ); + } + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + + toSelector( groups[ i ] ); + } + newSelector = groups.join( "," ); + } + + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + nonnativeSelectorCache( selector, true ); + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return ( cache[ key + " " ] = value ); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created element and returns a boolean result + */ +function assert( fn ) { + var el = document.createElement( "fieldset" ); + + try { + return !!fn( el ); + } catch ( e ) { + return false; + } finally { + + // Remove from its parent by default + if ( el.parentNode ) { + el.parentNode.removeChild( el ); + } + + // release memory in IE + el = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split( "|" ), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[ i ] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + a.sourceIndex - b.sourceIndex; + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( ( cur = cur.nextSibling ) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return ( name === "input" || name === "button" ) && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + + // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Only certain elements can match :enabled or :disabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled + if ( "form" in elem ) { + + // Check for inherited disabledness on relevant non-disabled elements: + // * listed form-associated elements in a disabled fieldset + // https://html.spec.whatwg.org/multipage/forms.html#category-listed + // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled + // * option elements in a disabled optgroup + // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled + // All such elements have a "form" property. + if ( elem.parentNode && elem.disabled === false ) { + + // Option elements defer to a parent optgroup if present + if ( "label" in elem ) { + if ( "label" in elem.parentNode ) { + return elem.parentNode.disabled === disabled; + } else { + return elem.disabled === disabled; + } + } + + // Support: IE 6 - 11 + // Use the isDisabled shortcut property to check for disabled fieldset ancestors + return elem.isDisabled === disabled || + + // Where there is no isDisabled, check manually + /* jshint -W018 */ + elem.isDisabled !== !disabled && + inDisabledFieldset( elem ) === disabled; + } + + return elem.disabled === disabled; + + // Try to winnow out elements that can't be disabled before trusting the disabled property. + // Some victims get caught in our net (label, legend, menu, track), but it shouldn't + // even exist on them, let alone have a boolean value. + } else if ( "label" in elem ) { + return elem.disabled === disabled; + } + + // Remaining elements are neither :enabled nor :disabled + return false; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction( function( argument ) { + argument = +argument; + return markFunction( function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ ( j = matchIndexes[ i ] ) ] ) { + seed[ j ] = !( matches[ j ] = seed[ j ] ); + } + } + } ); + } ); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + var namespace = elem && elem.namespaceURI, + docElem = elem && ( elem.ownerDocument || elem ).documentElement; + + // Support: IE <=8 + // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes + // https://bugs.jquery.com/ticket/4833 + return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, subWindow, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9 - 11+, Edge 12 - 18+ + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( preferredDoc != document && + ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { + + // Support: IE 11, Edge + if ( subWindow.addEventListener ) { + subWindow.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( subWindow.attachEvent ) { + subWindow.attachEvent( "onunload", unloadHandler ); + } + } + + // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, + // Safari 4 - 5 only, Opera <=11.6 - 12.x only + // IE/Edge & older browsers don't support the :scope pseudo-class. + // Support: Safari 6.0 only + // Safari 6.0 supports :scope but it's an alias of :root there. + support.scope = assert( function( el ) { + docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); + return typeof el.querySelectorAll !== "undefined" && + !el.querySelectorAll( ":scope fieldset div" ).length; + } ); + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert( function( el ) { + el.className = "i"; + return !el.getAttribute( "className" ); + } ); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert( function( el ) { + el.appendChild( document.createComment( "" ) ); + return !el.getElementsByTagName( "*" ).length; + } ); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programmatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert( function( el ) { + docElem.appendChild( el ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + } ); + + // ID filter and find + if ( support.getById ) { + Expr.filter[ "ID" ] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute( "id" ) === attrId; + }; + }; + Expr.find[ "ID" ] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var elem = context.getElementById( id ); + return elem ? [ elem ] : []; + } + }; + } else { + Expr.filter[ "ID" ] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode( "id" ); + return node && node.value === attrId; + }; + }; + + // Support: IE 6 - 7 only + // getElementById is not reliable as a find shortcut + Expr.find[ "ID" ] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var node, i, elems, + elem = context.getElementById( id ); + + if ( elem ) { + + // Verify the id attribute + node = elem.getAttributeNode( "id" ); + if ( node && node.value === id ) { + return [ elem ]; + } + + // Fall back on getElementsByName + elems = context.getElementsByName( id ); + i = 0; + while ( ( elem = elems[ i++ ] ) ) { + node = elem.getAttributeNode( "id" ); + if ( node && node.value === id ) { + return [ elem ]; + } + } + } + + return []; + } + }; + } + + // Tag + Expr.find[ "TAG" ] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( ( elem = results[ i++ ] ) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See https://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { + + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert( function( el ) { + + var input; + + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // https://bugs.jquery.com/ticket/12359 + docElem.appendChild( el ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !el.querySelectorAll( "[selected]" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push( "~=" ); + } + + // Support: IE 11+, Edge 15 - 18+ + // IE 11/Edge don't find elements on a `[name='']` query in some cases. + // Adding a temporary attribute to the document before the selection works + // around the issue. + // Interestingly, IE 10 & older don't seem to have the issue. + input = document.createElement( "input" ); + input.setAttribute( "name", "" ); + el.appendChild( input ); + if ( !el.querySelectorAll( "[name='']" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + + whitespace + "*(?:''|\"\")" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !el.querySelectorAll( ":checked" ).length ) { + rbuggyQSA.push( ":checked" ); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibling-combinator selector` fails + if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push( ".#.+[+~]" ); + } + + // Support: Firefox <=3.6 - 5 only + // Old Firefox doesn't throw on a badly-escaped identifier. + el.querySelectorAll( "\\\f" ); + rbuggyQSA.push( "[\\r\\n\\f]" ); + } ); + + assert( function( el ) { + el.innerHTML = "" + + ""; + + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement( "input" ); + input.setAttribute( "type", "hidden" ); + el.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( el.querySelectorAll( "[name=d]" ).length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: IE9-11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + docElem.appendChild( el ).disabled = true; + if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: Opera 10 - 11 only + // Opera 10-11 does not throw on post-comma invalid pseudos + el.querySelectorAll( "*,:x" ); + rbuggyQSA.push( ",.*:" ); + } ); + } + + if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector ) ) ) ) { + + assert( function( el ) { + + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( el, "*" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( el, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + } ); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + ) ); + } : + function( a, b ) { + if ( b ) { + while ( ( b = b.parentNode ) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { + + // Choose the first element that is related to our preferred document + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( a == document || a.ownerDocument == preferredDoc && + contains( preferredDoc, a ) ) { + return -1; + } + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( b == document || b.ownerDocument == preferredDoc && + contains( preferredDoc, b ) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + /* eslint-disable eqeqeq */ + return a == document ? -1 : + b == document ? 1 : + /* eslint-enable eqeqeq */ + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( ( cur = cur.parentNode ) ) { + ap.unshift( cur ); + } + cur = b; + while ( ( cur = cur.parentNode ) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[ i ] === bp[ i ] ) { + i++; + } + + return i ? + + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[ i ], bp[ i ] ) : + + // Otherwise nodes in our document sort first + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + /* eslint-disable eqeqeq */ + ap[ i ] == preferredDoc ? -1 : + bp[ i ] == preferredDoc ? 1 : + /* eslint-enable eqeqeq */ + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + setDocument( elem ); + + if ( support.matchesSelector && documentIsHTML && + !nonnativeSelectorCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch ( e ) { + nonnativeSelectorCache( expr, true ); + } + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + + // Set document vars if needed + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( context.ownerDocument || context ) != document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + + // Set document vars if needed + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( elem.ownerDocument || elem ) != document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + ( val = elem.getAttributeNode( name ) ) && val.specified ? + val.value : + null; +}; + +Sizzle.escape = function( sel ) { + return ( sel + "" ).replace( rcssescape, fcssescape ); +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( ( elem = results[ i++ ] ) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + + // If no nodeType, this is expected to be an array + while ( ( node = elem[ i++ ] ) ) { + + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[ 1 ] = match[ 1 ].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[ 3 ] = ( match[ 3 ] || match[ 4 ] || + match[ 5 ] || "" ).replace( runescape, funescape ); + + if ( match[ 2 ] === "~=" ) { + match[ 3 ] = " " + match[ 3 ] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[ 1 ] = match[ 1 ].toLowerCase(); + + if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { + + // nth-* requires argument + if ( !match[ 3 ] ) { + Sizzle.error( match[ 0 ] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[ 4 ] = +( match[ 4 ] ? + match[ 5 ] + ( match[ 6 ] || 1 ) : + 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); + match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); + + // other types prohibit arguments + } else if ( match[ 3 ] ) { + Sizzle.error( match[ 0 ] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[ 6 ] && match[ 2 ]; + + if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[ 3 ] ) { + match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + + // Get excess from tokenize (recursively) + ( excess = tokenize( unquoted, true ) ) && + + // advance to the next closing parenthesis + ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { + + // excess is a negative index + match[ 0 ] = match[ 0 ].slice( 0, excess ); + match[ 2 ] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { + return true; + } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + ( pattern = new RegExp( "(^|" + whitespace + + ")" + className + "(" + whitespace + "|$)" ) ) && classCache( + className, function( elem ) { + return pattern.test( + typeof elem.className === "string" && elem.className || + typeof elem.getAttribute !== "undefined" && + elem.getAttribute( "class" ) || + "" + ); + } ); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + /* eslint-disable max-len */ + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + /* eslint-enable max-len */ + + }; + }, + + "CHILD": function( type, what, _argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, _context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( ( node = node[ dir ] ) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( ( node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + ( diff = nodeIndex = 0 ) || start.pop() ) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + + // Use previously-cached element index if available + if ( useCache ) { + + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + + // Use the same loop as above to seek `elem` from the start + while ( ( node = ++nodeIndex && node && node[ dir ] || + ( diff = nodeIndex = 0 ) || start.pop() ) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || + ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction( function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[ i ] ); + seed[ idx ] = !( matches[ idx ] = matched[ i ] ); + } + } ) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + + // Potentially complex pseudos + "not": markFunction( function( selector ) { + + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction( function( seed, matches, _context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( ( elem = unmatched[ i ] ) ) { + seed[ i ] = !( matches[ i ] = elem ); + } + } + } ) : + function( elem, _context, xml ) { + input[ 0 ] = elem; + matcher( input, null, xml, results ); + + // Don't keep the element (issue #299) + input[ 0 ] = null; + return !results.pop(); + }; + } ), + + "has": markFunction( function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + } ), + + "contains": markFunction( function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; + }; + } ), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + + // lang value must be a valid identifier + if ( !ridentifier.test( lang || "" ) ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( ( elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); + return false; + }; + } ), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && + ( !document.hasFocus || document.hasFocus() ) && + !!( elem.type || elem.href || ~elem.tabIndex ); + }, + + // Boolean properties + "enabled": createDisabledPseudo( false ), + "disabled": createDisabledPseudo( true ), + + "checked": function( elem ) { + + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return ( nodeName === "input" && !!elem.checked ) || + ( nodeName === "option" && !!elem.selected ); + }, + + "selected": function( elem ) { + + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + // eslint-disable-next-line no-unused-expressions + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos[ "empty" ]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( ( attr = elem.getAttribute( "type" ) ) == null || + attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo( function() { + return [ 0 ]; + } ), + + "last": createPositionalPseudo( function( _matchIndexes, length ) { + return [ length - 1 ]; + } ), + + "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + } ), + + "even": createPositionalPseudo( function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "odd": createPositionalPseudo( function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { + var i = argument < 0 ? + argument + length : + argument > length ? + length : + argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ) + } +}; + +Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || ( match = rcomma.exec( soFar ) ) ) { + if ( match ) { + + // Don't consume trailing commas as valid + soFar = soFar.slice( match[ 0 ].length ) || soFar; + } + groups.push( ( tokens = [] ) ); + } + + matched = false; + + // Combinators + if ( ( match = rcombinators.exec( soFar ) ) ) { + matched = match.shift(); + tokens.push( { + value: matched, + + // Cast descendant combinators to space + type: match[ 0 ].replace( rtrim, " " ) + } ); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || + ( match = preFilters[ type ]( match ) ) ) ) { + matched = match.shift(); + tokens.push( { + value: matched, + type: type, + matches: match + } ); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[ i ].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + skip = combinator.next, + key = skip || dir, + checkNonElements = base && key === "parentNode", + doneName = done++; + + return combinator.first ? + + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + return false; + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || ( elem[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || + ( outerCache[ elem.uniqueID ] = {} ); + + if ( skip && skip === elem.nodeName.toLowerCase() ) { + elem = elem[ dir ] || elem; + } else if ( ( oldCache = uniqueCache[ key ] ) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return ( newCache[ 2 ] = oldCache[ 2 ] ); + } else { + + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ key ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { + return true; + } + } + } + } + } + return false; + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[ i ]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[ 0 ]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[ i ], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( ( elem = unmatched[ i ] ) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction( function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( + selector || "*", + context.nodeType ? [ context ] : context, + [] + ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( ( elem = temp[ i ] ) ) { + matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( ( elem = matcherOut[ i ] ) ) { + + // Restore matcherIn since elem is not yet a final match + temp.push( ( matcherIn[ i ] = elem ) ); + } + } + postFinder( null, ( matcherOut = [] ), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( ( elem = matcherOut[ i ] ) && + ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { + + seed[ temp ] = !( results[ temp ] = elem ); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + } ); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[ 0 ].type ], + implicitRelative = leadingRelative || Expr.relative[ " " ], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + ( checkContext = context ).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { + matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; + } else { + matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[ j ].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens + .slice( 0, i - 1 ) + .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), + + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), + len = elems.length; + + if ( outermost ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + outermostContext = context == document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( !context && elem.ownerDocument != document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( ( matcher = elementMatchers[ j++ ] ) ) { + if ( matcher( elem, context || document, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + + // They will have gone through all possible matchers + if ( ( elem = !matcher && elem ) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( ( matcher = setMatchers[ j++ ] ) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !( unmatched[ i ] || setMatched[ i ] ) ) { + setMatched[ i ] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[ i ] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( + selector, + matcherFromGroupMatchers( elementMatchers, setMatchers ) + ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( ( selector = compiled.selector || selector ) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[ 0 ] = match[ 0 ].slice( 0 ); + if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { + + context = ( Expr.find[ "ID" ]( token.matches[ 0 ] + .replace( runescape, funescape ), context ) || [] )[ 0 ]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[ i ]; + + // Abort if we hit a combinator + if ( Expr.relative[ ( type = token.type ) ] ) { + break; + } + if ( ( find = Expr.find[ type ] ) ) { + + // Search, expanding context for leading sibling combinators + if ( ( seed = find( + token.matches[ 0 ].replace( runescape, funescape ), + rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || + context + ) ) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert( function( el ) { + + // Should return 1, but returns 4 (following) + return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; +} ); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert( function( el ) { + el.innerHTML = ""; + return el.firstChild.getAttribute( "href" ) === "#"; +} ) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + } ); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert( function( el ) { + el.innerHTML = ""; + el.firstChild.setAttribute( "value", "" ); + return el.firstChild.getAttribute( "value" ) === ""; +} ) ) { + addHandle( "value", function( elem, _name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + } ); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert( function( el ) { + return el.getAttribute( "disabled" ) == null; +} ) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + ( val = elem.getAttributeNode( name ) ) && val.specified ? + val.value : + null; + } + } ); +} + +return Sizzle; + +} )( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; + +// Deprecated +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; +jQuery.escapeSelector = Sizzle.escape; + + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + + + +function nodeName( elem, name ) { + + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + +} +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); + + + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) !== not; + } ); + } + + // Single element + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + } + + // Arraylike of elements (jQuery, arguments, Array) + if ( typeof qualifier !== "string" ) { + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); + } + + // Filtered directly for both simple and complex selectors + return jQuery.filter( qualifier, elements, not ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + if ( elems.length === 1 && elem.nodeType === 1 ) { + return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; + } + + return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, ret, + len = this.length, + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + ret = this.pushStack( [] ); + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + return len > 1 ? jQuery.uniqueSort( ret ) : ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + // Shortcut simple #id case for speed + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + if ( elem ) { + + // Inject the element directly into the jQuery object + this[ 0 ] = elem; + this.length = 1; + } + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter( function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + targets = typeof selectors !== "string" && jQuery( selectors ); + + // Positional selectors never match, since there's no _selection_ context + if ( !rneedsContext.test( selectors ) ) { + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( targets ? + targets.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, _i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, _i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, _i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + if ( elem.contentDocument != null && + + // Support: IE 11+ + // elements with no `data` attribute has an object + // `contentDocument` with a `null` prototype. + getProto( elem.contentDocument ) ) { + + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.uniqueSort( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +} ); +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = locked || options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && toType( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory && !firing ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +function Identity( v ) { + return v; +} +function Thrower( ex ) { + throw ex; +} + +function adoptValue( value, resolve, reject, noValue ) { + var method; + + try { + + // Check for promise aspect first to privilege synchronous behavior + if ( value && isFunction( ( method = value.promise ) ) ) { + method.call( value ).done( resolve ).fail( reject ); + + // Other thenables + } else if ( value && isFunction( ( method = value.then ) ) ) { + method.call( value, resolve, reject ); + + // Other non-thenables + } else { + + // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: + // * false: [ value ].slice( 0 ) => resolve( value ) + // * true: [ value ].slice( 1 ) => resolve() + resolve.apply( undefined, [ value ].slice( noValue ) ); + } + + // For Promises/A+, convert exceptions into rejections + // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in + // Deferred#then to conditionally suppress rejection. + } catch ( value ) { + + // Support: Android 4.0 only + // Strict mode functions invoked without .call/.apply get global-object context + reject.apply( undefined, [ value ] ); + } +} + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + "catch": function( fn ) { + return promise.then( null, fn ); + }, + + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( _i, tuple ) { + + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; + + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; + + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } + + returned = handler.apply( that, args ); + + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } + + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && + + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; + + // Handle a returned thenable + if ( isFunction( then ) ) { + + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); + + // Normal processors (resolve) also hook into progress + } else { + + // ...and disregard older resolution values + maxDepth++; + + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } + + // Handle all other returned values + } else { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } + + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, + + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { + + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.stackTrace ); + } + + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } + + deferred.rejectWith( that, args ); + } + } + }; + + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); + } else { + + // Call an optional hook to record the stack, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getStackHook ) { + process.stackTrace = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 5 ]; + + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( + function() { + + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // rejected_handlers.disable + // fulfilled_handlers.disable + tuples[ 3 - i ][ 3 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock, + + // progress_handlers.lock + tuples[ 0 ][ 3 ].lock + ); + } + + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); + return this; + }; + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, + + // subordinate fulfillment data + resolveContexts = Array( i ), + resolveValues = slice.call( arguments ), + + // the primary Deferred + primary = jQuery.Deferred(), + + // subordinate callback factory + updateFunc = function( i ) { + return function( value ) { + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + primary.resolveWith( resolveContexts, resolveValues ); + } + }; + }; + + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, + !remaining ); + + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( primary.state() === "pending" || + isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return primary.then(); + } + } + + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); + } + + return primary.promise(); + } +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + + + +// The deferred used on DOM ready +var readyList = jQuery.Deferred(); + +jQuery.fn.ready = function( fn ) { + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + } +} ); + +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + +} else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( toType( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, _key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + if ( chainable ) { + return elems; + } + + // Gets + if ( bulk ) { + return fn.call( elems ); + } + + return len ? fn( elems[ 0 ], key ) : emptyGet; +}; + + +// Matches dashed string for camelizing +var rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g; + +// Used by camelCase as callback to replace() +function fcamelCase( _all, letter ) { + return letter.toUpperCase(); +} + +// Convert dashed to camelCase; used by the css and data modules +// Support: IE <=9 - 11, Edge 12 - 15 +// Microsoft forgot to hump their vendor prefix (#9572) +function camelCase( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); +} +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + cache: function( owner ) { + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) + if ( typeof data === "string" ) { + cache[ camelCase( data ) ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ camelCase( prop ) ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; + }, + access: function( owner, key, value ) { + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + return this.get( owner, key ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { + + // Support array or space separated string of keys + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( camelCase ); + } else { + key = camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); + } + + i = key.length; + + while ( i-- ) { + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = getData( data ); + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE 11 only + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, key ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each( function() { + + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var documentElement = document.documentElement; + + + + var isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ); + }, + composed = { composed: true }; + + // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only + // Check attachment across shadow DOM boundaries when possible (gh-3504) + // Support: iOS 10.0-10.2 only + // Early iOS 10 versions support `attachShadow` but not `getRootNode`, + // leading to errors. We need to check for `getRootNode`. + if ( documentElement.getRootNode ) { + isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ) || + elem.getRootNode( composed ) === elem.ownerDocument; + }; + } +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + isAttached( elem ) && + + jQuery.css( elem, "display" ) === "none"; + }; + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, scale, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = elem.nodeType && + ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Support: Firefox <=54 + // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) + initial = initial / 2; + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + while ( maxIterations-- ) { + + // Evaluate and update our best guess (doubling guesses that zero out). + // Finish if the scale equals or crosses 1 (making the old*new product non-positive). + jQuery.style( elem, prop, initialInUnit + unit ); + if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { + maxIterations = 0; + } + initialInUnit = initialInUnit / scale; + + } + + initialInUnit = initialInUnit * 2; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +var defaultDisplayMap = {}; + +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; + + if ( display ) { + return display; + } + + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); + + temp.parentNode.removeChild( temp ); + + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; + + return display; +} + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; + } + } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); + +var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); + + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; + + // Support: IE <=9 only + // IE <=9 replaces "; + support.option = !!div.lastChild; +} )(); + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
    " ], + col: [ 2, "", "
    " ], + tr: [ 2, "", "
    " ], + td: [ 3, "", "
    " ], + + _default: [ 0, "", "" ] +}; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// Support: IE <=9 only +if ( !support.option ) { + wrapMap.optgroup = wrapMap.option = [ 1, "" ]; +} + + +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, attached, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( toType( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + attached = isAttached( elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( attached ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE <=9 - 11+ +// focus() and blur() are asynchronous, except when they are no-op. +// So expect focus to be synchronous when the element is already active, +// and blur to be synchronous when the element is not already active. +// (focus and blur are always synchronous in other supported browsers, +// this just defines when we can count on it). +function expectSync( elem, type ) { + return ( elem === safeActiveElement() ) === ( type === "focus" ); +} + +// Support: IE <=9 only +// Accessing document.activeElement can throw unexpectedly +// https://bugs.jquery.com/ticket/13393 +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Only attach events to objects that accept data + if ( !acceptData( elem ) ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = Object.create( null ); + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, + + dispatch: function( nativeEvent ) { + + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( nativeEvent ), + + handlers = ( + dataPriv.get( this, "events" ) || Object.create( null ) + )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // If the event is namespaced, then each handler is only invoked if it is + // specially universal or its namespaces are a superset of the event's. + if ( !event.rnamespace || handleObj.namespace === false || + event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, handleObj, sel, matchedHandlers, matchedSelectors, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); + } + } + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + cur = this; + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, + + get: isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, + + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); + } + } ); + }, + + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + click: { + + // Utilize native event to ensure correct state for checkable inputs + setup: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Claim the first handler + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + // dataPriv.set( el, "click", ... ) + leverageNative( el, "click", returnTrue ); + } + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Force setup before triggering a click + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + leverageNative( el, "click" ); + } + + // Return non-false to allow normal event-path propagation + return true; + }, + + // For cross-browser consistency, suppress native .click() on links + // Also prevent it if we're currently inside a leveraged native-event stack + _default: function( event ) { + var target = event.target; + return rcheckableType.test( target.type ) && + target.click && nodeName( target, "input" ) && + dataPriv.get( target, "click" ) || + nodeName( target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +// Ensure the presence of an event listener that handles manually-triggered +// synthetic events by interrupting progress until reinvoked in response to +// *native* events that it fires directly, ensuring that state changes have +// already occurred before other listeners are invoked. +function leverageNative( el, type, expectSync ) { + + // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add + if ( !expectSync ) { + if ( dataPriv.get( el, type ) === undefined ) { + jQuery.event.add( el, type, returnTrue ); + } + return; + } + + // Register the controller as a special universal handler for all event namespaces + dataPriv.set( el, type, false ); + jQuery.event.add( el, type, { + namespace: false, + handler: function( event ) { + var notAsync, result, + saved = dataPriv.get( this, type ); + + if ( ( event.isTrigger & 1 ) && this[ type ] ) { + + // Interrupt processing of the outer synthetic .trigger()ed event + // Saved data should be false in such cases, but might be a leftover capture object + // from an async native handler (gh-4350) + if ( !saved.length ) { + + // Store arguments for use when handling the inner native event + // There will always be at least one argument (an event object), so this array + // will not be confused with a leftover capture object. + saved = slice.call( arguments ); + dataPriv.set( this, type, saved ); + + // Trigger the native event and capture its result + // Support: IE <=9 - 11+ + // focus() and blur() are asynchronous + notAsync = expectSync( this, type ); + this[ type ](); + result = dataPriv.get( this, type ); + if ( saved !== result || notAsync ) { + dataPriv.set( this, type, false ); + } else { + result = {}; + } + if ( saved !== result ) { + + // Cancel the outer synthetic event + event.stopImmediatePropagation(); + event.preventDefault(); + + // Support: Chrome 86+ + // In Chrome, if an element having a focusout handler is blurred by + // clicking outside of it, it invokes the handler synchronously. If + // that handler calls `.remove()` on the element, the data is cleared, + // leaving `result` undefined. We need to guard against this. + return result && result.value; + } + + // If this is an inner synthetic event for an event with a bubbling surrogate + // (focus or blur), assume that the surrogate already propagated from triggering the + // native event and prevent that from happening again here. + // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the + // bubbling surrogate propagates *after* the non-bubbling base), but that seems + // less bad than duplication. + } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { + event.stopPropagation(); + } + + // If this is a native event triggered above, everything is now in order + // Fire an inner synthetic event with the original arguments + } else if ( saved.length ) { + + // ...and capture the result + dataPriv.set( this, type, { + value: jQuery.event.trigger( + + // Support: IE <=9 - 11+ + // Extend with the prototype to reset the above stopImmediatePropagation() + jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), + saved.slice( 1 ), + this + ) + } ); + + // Abort handling of the native event + event.stopImmediatePropagation(); + } + } + } ); +} + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android <=2.3 only + src.returnValue === false ? + returnTrue : + returnFalse; + + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (#504, #13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || Date.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + isSimulated: false, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && !this.isSimulated ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + code: true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + which: true +}, jQuery.event.addProp ); + +jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { + jQuery.event.special[ type ] = { + + // Utilize native event if possible so blur/focus sequence is correct + setup: function() { + + // Claim the first handler + // dataPriv.set( this, "focus", ... ) + // dataPriv.set( this, "blur", ... ) + leverageNative( this, type, expectSync ); + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function() { + + // Force setup before trigger + leverageNative( this, type ); + + // Return non-false to allow normal event-path propagation + return true; + }, + + // Suppress native focus or blur as it's already being fired + // in leverageNative. + _default: function() { + return true; + }, + + delegateType: delegateType + }; +} ); + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + + // Support: IE <=10 - 11, Edge 12 - 13 only + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g; + +// Prefer a tbody over its parent table for containing new rows +function manipulationTarget( elem, content ) { + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return jQuery( elem ).children( "tbody" )[ 0 ] || elem; + } + + return elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { + elem.type = elem.type.slice( 5 ); + } else { + elem.removeAttribute( "type" ); + } + + return elem; +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.get( src ); + events = pdataOld.events; + + if ( events ) { + dataPriv.remove( dest, "handle events" ); + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + dataUser.set( dest, udataCur ); + } +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = flat( args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + valueIsFunction = isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( valueIsFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( valueIsFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl && !node.noModule ) { + jQuery._evalUrl( node.src, { + nonce: node.nonce || node.getAttribute( "nonce" ) + }, doc ); + } + } else { + DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && isAttached( node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html; + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = isAttached( elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, + i = 0; + + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; + } + } + } + } +} ); + +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + +var getStyles = function( elem ) { + + // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + var view = elem.ownerDocument.defaultView; + + if ( !view || !view.opener ) { + view = window; + } + + return view.getComputedStyle( elem ); + }; + +var swap = function( elem, options, callback ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.call( elem ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + +var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); + + + +( function() { + + // Executing both pixelPosition & boxSizingReliable tests require only one layout + // so they're executed at the same time to save the second computation. + function computeStyleTests() { + + // This is a singleton, we need to execute it only once + if ( !div ) { + return; + } + + container.style.cssText = "position:absolute;left:-11111px;width:60px;" + + "margin-top:1px;padding:0;border:0"; + div.style.cssText = + "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + + "margin:auto;border:1px;padding:1px;" + + "width:60%;top:1%"; + documentElement.appendChild( container ).appendChild( div ); + + var divStyle = window.getComputedStyle( div ); + pixelPositionVal = divStyle.top !== "1%"; + + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 + reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; + + // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 + // Some styles come back with percentage values, even though they shouldn't + div.style.right = "60%"; + pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; + + // Support: IE 9 - 11 only + // Detect misreporting of content dimensions for box-sizing:border-box elements + boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; + + // Support: IE 9 only + // Detect overflow:scroll screwiness (gh-3699) + // Support: Chrome <=64 + // Don't get tricked when zoom affects offsetWidth (gh-4029) + div.style.position = "absolute"; + scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; + + documentElement.removeChild( container ); + + // Nullify the div so it wouldn't be stored in the memory and + // it will also be a sign that checks already performed + div = null; + } + + function roundPixelMeasures( measure ) { + return Math.round( parseFloat( measure ) ); + } + + var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, + reliableTrDimensionsVal, reliableMarginLeftVal, + container = document.createElement( "div" ), + div = document.createElement( "div" ); + + // Finish early in limited (non-browser) environments + if ( !div.style ) { + return; + } + + // Support: IE <=9 - 11 only + // Style of cloned element affects source element cloned (#8908) + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + jQuery.extend( support, { + boxSizingReliable: function() { + computeStyleTests(); + return boxSizingReliableVal; + }, + pixelBoxStyles: function() { + computeStyleTests(); + return pixelBoxStylesVal; + }, + pixelPosition: function() { + computeStyleTests(); + return pixelPositionVal; + }, + reliableMarginLeft: function() { + computeStyleTests(); + return reliableMarginLeftVal; + }, + scrollboxSize: function() { + computeStyleTests(); + return scrollboxSizeVal; + }, + + // Support: IE 9 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Behavior in IE 9 is more subtle than in newer versions & it passes + // some versions of this test; make sure not to make it pass there! + // + // Support: Firefox 70+ + // Only Firefox includes border widths + // in computed dimensions. (gh-4529) + reliableTrDimensions: function() { + var table, tr, trChild, trStyle; + if ( reliableTrDimensionsVal == null ) { + table = document.createElement( "table" ); + tr = document.createElement( "tr" ); + trChild = document.createElement( "div" ); + + table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; + tr.style.cssText = "border:1px solid"; + + // Support: Chrome 86+ + // Height set through cssText does not get applied. + // Computed height then comes back as 0. + tr.style.height = "1px"; + trChild.style.height = "9px"; + + // Support: Android 8 Chrome 86+ + // In our bodyBackground.html iframe, + // display for all div elements is set to "inline", + // which causes a problem only in Android 8 Chrome 86. + // Ensuring the div is display: block + // gets around this issue. + trChild.style.display = "block"; + + documentElement + .appendChild( table ) + .appendChild( tr ) + .appendChild( trChild ); + + trStyle = window.getComputedStyle( tr ); + reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + + parseInt( trStyle.borderTopWidth, 10 ) + + parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; + + documentElement.removeChild( table ); + } + return reliableTrDimensionsVal; + } + } ); +} )(); + + +function curCSS( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + + // Support: Firefox 51+ + // Retrieving style before computed somehow + // fixes an issue with getting wrong values + // on detached elements + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is needed for: + // .css('filter') (IE 9 only, #12537) + // .css('--customProperty) (#3144) + if ( computed ) { + ret = computed.getPropertyValue( name ) || computed[ name ]; + + if ( ret === "" && !isAttached( elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // https://drafts.csswg.org/cssom/#resolved-values + if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret !== undefined ? + + // Support: IE <=9 - 11 only + // IE returns zIndex value as an integer. + ret + "" : + ret; +} + + +function addGetHookIf( conditionFn, hookFn ) { + + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + if ( conditionFn() ) { + + // Hook not needed (or it's not possible to use it due + // to missing dependency), remove it. + delete this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + return ( this.get = hookFn ).apply( this, arguments ); + } + }; +} + + +var cssPrefixes = [ "Webkit", "Moz", "ms" ], + emptyStyle = document.createElement( "div" ).style, + vendorProps = {}; + +// Return a vendor-prefixed property or undefined +function vendorPropName( name ) { + + // Check for vendor prefixed names + var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in emptyStyle ) { + return name; + } + } +} + +// Return a potentially-mapped jQuery.cssProps or vendor prefixed property +function finalPropName( name ) { + var final = jQuery.cssProps[ name ] || vendorProps[ name ]; + + if ( final ) { + return final; + } + if ( name in emptyStyle ) { + return name; + } + return vendorProps[ name ] = vendorPropName( name ) || name; +} + + +var + + // Swappable if display is none or starts with table + // except "table", "table-cell", or "table-caption" + // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rcustomProp = /^--/, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: "0", + fontWeight: "400" + }; + +function setPositiveNumber( _elem, value, subtract ) { + + // Any relative (+/-) values have already been + // normalized at this point + var matches = rcssNum.exec( value ); + return matches ? + + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : + value; +} + +function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { + var i = dimension === "width" ? 1 : 0, + extra = 0, + delta = 0; + + // Adjustment may not be necessary + if ( box === ( isBorderBox ? "border" : "content" ) ) { + return 0; + } + + for ( ; i < 4; i += 2 ) { + + // Both box models exclude margin + if ( box === "margin" ) { + delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); + } + + // If we get here with a content-box, we're seeking "padding" or "border" or "margin" + if ( !isBorderBox ) { + + // Add padding + delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // For "border" or "margin", add border + if ( box !== "padding" ) { + delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + + // But still keep track of it otherwise + } else { + extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + + // If we get here with a border-box (content + padding + border), we're seeking "content" or + // "padding" or "margin" + } else { + + // For "content", subtract padding + if ( box === "content" ) { + delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // For "content" or "padding", subtract border + if ( box !== "margin" ) { + delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + // Account for positive content-box scroll gutter when requested by providing computedVal + if ( !isBorderBox && computedVal >= 0 ) { + + // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border + // Assuming integer scroll gutter, subtract the rest and round down + delta += Math.max( 0, Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + computedVal - + delta - + extra - + 0.5 + + // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter + // Use an explicit zero to avoid NaN (gh-3964) + ) ) || 0; + } + + return delta; +} + +function getWidthOrHeight( elem, dimension, extra ) { + + // Start with computed style + var styles = getStyles( elem ), + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). + // Fake content-box until we know it's needed to know the true value. + boxSizingNeeded = !support.boxSizingReliable() || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + valueIsBorderBox = isBorderBox, + + val = curCSS( elem, dimension, styles ), + offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); + + // Support: Firefox <=54 + // Return a confounding non-pixel value or feign ignorance, as appropriate. + if ( rnumnonpx.test( val ) ) { + if ( !extra ) { + return val; + } + val = "auto"; + } + + + // Support: IE 9 - 11 only + // Use offsetWidth/offsetHeight for when box sizing is unreliable. + // In those cases, the computed value can be trusted to be border-box. + if ( ( !support.boxSizingReliable() && isBorderBox || + + // Support: IE 10 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Interestingly, in some cases IE 9 doesn't suffer from this issue. + !support.reliableTrDimensions() && nodeName( elem, "tr" ) || + + // Fall back to offsetWidth/offsetHeight when value is "auto" + // This happens for inline elements with no explicit setting (gh-3571) + val === "auto" || + + // Support: Android <=4.1 - 4.3 only + // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) + !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && + + // Make sure the element is visible & connected + elem.getClientRects().length ) { + + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // Where available, offsetWidth/offsetHeight approximate border box dimensions. + // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the + // retrieved value as a content box dimension. + valueIsBorderBox = offsetProp in elem; + if ( valueIsBorderBox ) { + val = elem[ offsetProp ]; + } + } + + // Normalize "" and auto + val = parseFloat( val ) || 0; + + // Adjust for the element's box model + return ( val + + boxModelAdjustment( + elem, + dimension, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles, + + // Provide the current computed size to request scroll gutter calculation (gh-3589) + val + ) + ) + "px"; +} + +jQuery.extend( { + + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "animationIterationCount": true, + "columnCount": true, + "fillOpacity": true, + "flexGrow": true, + "flexShrink": true, + "fontWeight": true, + "gridArea": true, + "gridColumn": true, + "gridColumnEnd": true, + "gridColumnStart": true, + "gridRow": true, + "gridRowEnd": true, + "gridRowStart": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: {}, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ), + style = elem.style; + + // Make sure that we're working with the right name. We don't + // want to query the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Gets hook for the prefixed version, then unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // Convert "+=" or "-=" to relative numbers (#7345) + if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { + value = adjustCSS( elem, name, ret ); + + // Fixes bug #9237 + type = "number"; + } + + // Make sure that null and NaN values aren't set (#7116) + if ( value == null || value !== value ) { + return; + } + + // If a number was passed in, add the unit (except for certain CSS properties) + // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append + // "px" to a few hardcoded values. + if ( type === "number" && !isCustomProp ) { + value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); + } + + // background-* props affect original clone's values + if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !( "set" in hooks ) || + ( value = hooks.set( elem, value, extra ) ) !== undefined ) { + + if ( isCustomProp ) { + style.setProperty( name, value ); + } else { + style[ name ] = value; + } + } + + } else { + + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && + ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { + + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var val, num, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ); + + // Make sure that we're working with the right name. We don't + // want to modify the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Try prefixed name followed by the unprefixed name + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + // Convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Make numeric if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || isFinite( num ) ? num || 0 : val; + } + + return val; + } +} ); + +jQuery.each( [ "height", "width" ], function( _i, dimension ) { + jQuery.cssHooks[ dimension ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + + // Certain elements can have dimension info if we invisibly show them + // but it must have a current display style that would benefit + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && + + // Support: Safari 8+ + // Table columns in Safari have non-zero offsetWidth & zero + // getBoundingClientRect().width unless display is changed. + // Support: IE <=11 only + // Running getBoundingClientRect on a disconnected node + // in IE throws an error. + ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? + swap( elem, cssShow, function() { + return getWidthOrHeight( elem, dimension, extra ); + } ) : + getWidthOrHeight( elem, dimension, extra ); + } + }, + + set: function( elem, value, extra ) { + var matches, + styles = getStyles( elem ), + + // Only read styles.position if the test has a chance to fail + // to avoid forcing a reflow. + scrollboxSizeBuggy = !support.scrollboxSize() && + styles.position === "absolute", + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) + boxSizingNeeded = scrollboxSizeBuggy || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + subtract = extra ? + boxModelAdjustment( + elem, + dimension, + extra, + isBorderBox, + styles + ) : + 0; + + // Account for unreliable border-box dimensions by comparing offset* to computed and + // faking a content-box to get border and padding (gh-3699) + if ( isBorderBox && scrollboxSizeBuggy ) { + subtract -= Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + parseFloat( styles[ dimension ] ) - + boxModelAdjustment( elem, dimension, "border", false, styles ) - + 0.5 + ); + } + + // Convert to pixels if value adjustment is needed + if ( subtract && ( matches = rcssNum.exec( value ) ) && + ( matches[ 3 ] || "px" ) !== "px" ) { + + elem.style[ dimension ] = value; + value = jQuery.css( elem, dimension ); + } + + return setPositiveNumber( elem, value, subtract ); + } + }; +} ); + +jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, + function( elem, computed ) { + if ( computed ) { + return ( parseFloat( curCSS( elem, "marginLeft" ) ) || + elem.getBoundingClientRect().left - + swap( elem, { marginLeft: 0 }, function() { + return elem.getBoundingClientRect().left; + } ) + ) + "px"; + } + } +); + +// These hooks are used by animate to expand properties +jQuery.each( { + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, + + // Assumes a single number if not a string + parts = typeof value === "string" ? value.split( " " ) : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( prefix !== "margin" ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +} ); + +jQuery.fn.extend( { + css: function( name, value ) { + return access( this, function( elem, name, value ) { + var styles, len, + map = {}, + i = 0; + + if ( Array.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + } +} ); + + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || jQuery.easing._default; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + // Use a property on the element directly when it is not a DOM element, + // or when there is no matching style property that exists. + if ( tween.elem.nodeType !== 1 || + tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { + return tween.elem[ tween.prop ]; + } + + // Passing an empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails. + // Simple values such as "10px" are parsed to Float; + // complex values such as "rotate(1rad)" are returned as-is. + result = jQuery.css( tween.elem, tween.prop, "" ); + + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + + // Use step hook for back compat. + // Use cssHook if its there. + // Use .style if available and use plain properties where available. + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.nodeType === 1 && ( + jQuery.cssHooks[ tween.prop ] || + tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Support: IE <=9 only +// Panic based approach to setting things on disconnected nodes +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p * Math.PI ) / 2; + }, + _default: "swing" +}; + +jQuery.fx = Tween.prototype.init; + +// Back compat <1.8 extension point +jQuery.fx.step = {}; + + + + +var + fxNow, inProgress, + rfxtypes = /^(?:toggle|show|hide)$/, + rrun = /queueHooks$/; + +function schedule() { + if ( inProgress ) { + if ( document.hidden === false && window.requestAnimationFrame ) { + window.requestAnimationFrame( schedule ); + } else { + window.setTimeout( schedule, jQuery.fx.interval ); + } + + jQuery.fx.tick(); + } +} + +// Animations created synchronously will run synchronously +function createFxNow() { + window.setTimeout( function() { + fxNow = undefined; + } ); + return ( fxNow = Date.now() ); +} + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + i = 0, + attrs = { height: type }; + + // If we include width, step value is 1 to do all cssExpand values, + // otherwise step value is 2 to skip over Left and Right + includeWidth = includeWidth ? 1 : 0; + for ( ; i < 4; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +function createTween( value, prop, animation ) { + var tween, + collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { + + // We're done with this property + return tween; + } + } +} + +function defaultPrefilter( elem, props, opts ) { + var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, + isBox = "width" in props || "height" in props, + anim = this, + orig = {}, + style = elem.style, + hidden = elem.nodeType && isHiddenWithinTree( elem ), + dataShow = dataPriv.get( elem, "fxshow" ); + + // Queue-skipping animations hijack the fx hooks + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always( function() { + + // Ensure the complete handler is called before this completes + anim.always( function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + } ); + } ); + } + + // Detect show/hide animations + for ( prop in props ) { + value = props[ prop ]; + if ( rfxtypes.test( value ) ) { + delete props[ prop ]; + toggle = toggle || value === "toggle"; + if ( value === ( hidden ? "hide" : "show" ) ) { + + // Pretend to be hidden if this is a "show" and + // there is still data from a stopped show/hide + if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { + hidden = true; + + // Ignore all other no-op show/hide data + } else { + continue; + } + } + orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); + } + } + + // Bail out if this is a no-op like .hide().hide() + propTween = !jQuery.isEmptyObject( props ); + if ( !propTween && jQuery.isEmptyObject( orig ) ) { + return; + } + + // Restrict "overflow" and "display" styles during box animations + if ( isBox && elem.nodeType === 1 ) { + + // Support: IE <=9 - 11, Edge 12 - 15 + // Record all 3 overflow attributes because IE does not infer the shorthand + // from identically-valued overflowX and overflowY and Edge just mirrors + // the overflowX value there. + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Identify a display type, preferring old show/hide data over the CSS cascade + restoreDisplay = dataShow && dataShow.display; + if ( restoreDisplay == null ) { + restoreDisplay = dataPriv.get( elem, "display" ); + } + display = jQuery.css( elem, "display" ); + if ( display === "none" ) { + if ( restoreDisplay ) { + display = restoreDisplay; + } else { + + // Get nonempty value(s) by temporarily forcing visibility + showHide( [ elem ], true ); + restoreDisplay = elem.style.display || restoreDisplay; + display = jQuery.css( elem, "display" ); + showHide( [ elem ] ); + } + } + + // Animate inline elements as inline-block + if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { + if ( jQuery.css( elem, "float" ) === "none" ) { + + // Restore the original display value at the end of pure show/hide animations + if ( !propTween ) { + anim.done( function() { + style.display = restoreDisplay; + } ); + if ( restoreDisplay == null ) { + display = style.display; + restoreDisplay = display === "none" ? "" : display; + } + } + style.display = "inline-block"; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + anim.always( function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + } ); + } + + // Implement show/hide animations + propTween = false; + for ( prop in orig ) { + + // General show/hide setup for this element animation + if ( !propTween ) { + if ( dataShow ) { + if ( "hidden" in dataShow ) { + hidden = dataShow.hidden; + } + } else { + dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); + } + + // Store hidden/visible for toggle so `.stop().toggle()` "reverses" + if ( toggle ) { + dataShow.hidden = !hidden; + } + + // Show elements before animating them + if ( hidden ) { + showHide( [ elem ], true ); + } + + /* eslint-disable no-loop-func */ + + anim.done( function() { + + /* eslint-enable no-loop-func */ + + // The final step of a "hide" animation is actually hiding the element + if ( !hidden ) { + showHide( [ elem ] ); + } + dataPriv.remove( elem, "fxshow" ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + } ); + } + + // Per-property setup + propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = propTween.start; + if ( hidden ) { + propTween.end = propTween.start; + propTween.start = 0; + } + } + } +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( Array.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // Not quite $.extend, this won't overwrite existing keys. + // Reusing 'index' because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +function Animation( elem, properties, options ) { + var result, + stopped, + index = 0, + length = Animation.prefilters.length, + deferred = jQuery.Deferred().always( function() { + + // Don't match elem in the :animated selector + delete tick.elem; + } ), + tick = function() { + if ( stopped ) { + return false; + } + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + + // Support: Android 2.3 only + // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) + temp = remaining / animation.duration || 0, + percent = 1 - temp, + index = 0, + length = animation.tweens.length; + + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ] ); + + // If there's more to do, yield + if ( percent < 1 && length ) { + return remaining; + } + + // If this was an empty animation, synthesize a final progress notification + if ( !length ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + } + + // Resolve the animation and report its conclusion + deferred.resolveWith( elem, [ animation ] ); + return false; + }, + animation = deferred.promise( { + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { + specialEasing: {}, + easing: jQuery.easing._default + }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + + // If we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + if ( stopped ) { + return this; + } + stopped = true; + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // Resolve when we played the last frame; otherwise, reject + if ( gotoEnd ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + } ), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length; index++ ) { + result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + if ( isFunction( result.stop ) ) { + jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = + result.stop.bind( result ); + } + return result; + } + } + + jQuery.map( props, createTween, animation ); + + if ( isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + // Attach callbacks from options + animation + .progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); + + jQuery.fx.timer( + jQuery.extend( tick, { + elem: elem, + anim: animation, + queue: animation.opts.queue + } ) + ); + + return animation; +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweeners: { + "*": [ function( prop, value ) { + var tween = this.createTween( prop, value ); + adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); + return tween; + } ] + }, + + tweener: function( props, callback ) { + if ( isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.match( rnothtmlwhite ); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length; index++ ) { + prop = props[ index ]; + Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; + Animation.tweeners[ prop ].unshift( callback ); + } + }, + + prefilters: [ defaultPrefilter ], + + prefilter: function( callback, prepend ) { + if ( prepend ) { + Animation.prefilters.unshift( callback ); + } else { + Animation.prefilters.push( callback ); + } + } +} ); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !isFunction( easing ) && easing + }; + + // Go to the end state if fx are off + if ( jQuery.fx.off ) { + opt.duration = 0; + + } else { + if ( typeof opt.duration !== "number" ) { + if ( opt.duration in jQuery.fx.speeds ) { + opt.duration = jQuery.fx.speeds[ opt.duration ]; + + } else { + opt.duration = jQuery.fx.speeds._default; + } + } + } + + // Normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.fn.extend( { + fadeTo: function( speed, to, easing, callback ) { + + // Show any hidden elements after setting opacity to 0 + return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() + + // Animate to the value specified + .end().animate( { opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations, or finishing resolves immediately + if ( empty || dataPriv.get( this, "finish" ) ) { + anim.stop( true ); + } + }; + + doAnimation.finish = doAnimation; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue ) { + this.queue( type || "fx", [] ); + } + + return this.each( function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = dataPriv.get( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && + ( type == null || timers[ index ].queue === type ) ) { + + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // Start the next in the queue if the last step wasn't forced. + // Timers currently will call their complete callbacks, which + // will dequeue but only if they were gotoEnd. + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + } ); + }, + finish: function( type ) { + if ( type !== false ) { + type = type || "fx"; + } + return this.each( function() { + var index, + data = dataPriv.get( this ), + queue = data[ type + "queue" ], + hooks = data[ type + "queueHooks" ], + timers = jQuery.timers, + length = queue ? queue.length : 0; + + // Enable finishing flag on private data + data.finish = true; + + // Empty the queue first + jQuery.queue( this, type, [] ); + + if ( hooks && hooks.stop ) { + hooks.stop.call( this, true ); + } + + // Look for any active animations, and finish them + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && timers[ index ].queue === type ) { + timers[ index ].anim.stop( true ); + timers.splice( index, 1 ); + } + } + + // Look for any animations in the old queue and finish them + for ( index = 0; index < length; index++ ) { + if ( queue[ index ] && queue[ index ].finish ) { + queue[ index ].finish.call( this ); + } + } + + // Turn off finishing flag + delete data.finish; + } ); + } +} ); + +jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +} ); + +// Generate shortcuts for custom animations +jQuery.each( { + slideDown: genFx( "show" ), + slideUp: genFx( "hide" ), + slideToggle: genFx( "toggle" ), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +} ); + +jQuery.timers = []; +jQuery.fx.tick = function() { + var timer, + i = 0, + timers = jQuery.timers; + + fxNow = Date.now(); + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + + // Run the timer and safely remove it when done (allowing for external removal) + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + fxNow = undefined; +}; + +jQuery.fx.timer = function( timer ) { + jQuery.timers.push( timer ); + jQuery.fx.start(); +}; + +jQuery.fx.interval = 13; +jQuery.fx.start = function() { + if ( inProgress ) { + return; + } + + inProgress = true; + schedule(); +}; + +jQuery.fx.stop = function() { + inProgress = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + + // Default speed + _default: 400 +}; + + +// Based off of the plugin by Clint Helfers, with permission. +// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ +jQuery.fn.delay = function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = window.setTimeout( next, time ); + hooks.stop = function() { + window.clearTimeout( timeout ); + }; + } ); +}; + + +( function() { + var input = document.createElement( "input" ), + select = document.createElement( "select" ), + opt = select.appendChild( document.createElement( "option" ) ); + + input.type = "checkbox"; + + // Support: Android <=4.3 only + // Default value for a checkbox should be "on" + support.checkOn = input.value !== ""; + + // Support: IE <=11 only + // Must access selectedIndex to make default options select + support.optSelected = opt.selected; + + // Support: IE <=11 only + // An input loses its value after becoming a radio + input = document.createElement( "input" ); + input.value = "t"; + input.type = "radio"; + support.radioValue = input.value === "t"; +} )(); + + +var boolHook, + attrHandle = jQuery.expr.attrHandle; + +jQuery.fn.extend( { + attr: function( name, value ) { + return access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each( function() { + jQuery.removeAttr( this, name ); + } ); + } +} ); + +jQuery.extend( { + attr: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set attributes on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + // Attribute hooks are determined by the lowercase version + // Grab necessary hook if one is defined + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + hooks = jQuery.attrHooks[ name.toLowerCase() ] || + ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); + } + + if ( value !== undefined ) { + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + } + + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + elem.setAttribute( name, value + "" ); + return value; + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? undefined : ret; + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !support.radioValue && value === "radio" && + nodeName( elem, "input" ) ) { + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + removeAttr: function( elem, value ) { + var name, + i = 0, + + // Attribute names can contain non-HTML whitespace characters + // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 + attrNames = value && value.match( rnothtmlwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( ( name = attrNames[ i++ ] ) ) { + elem.removeAttribute( name ); + } + } + } +} ); + +// Hooks for boolean attributes +boolHook = { + set: function( elem, value, name ) { + if ( value === false ) { + + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + elem.setAttribute( name, name ); + } + return name; + } +}; + +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { + var getter = attrHandle[ name ] || jQuery.find.attr; + + attrHandle[ name ] = function( elem, name, isXML ) { + var ret, handle, + lowercaseName = name.toLowerCase(); + + if ( !isXML ) { + + // Avoid an infinite loop by temporarily removing this function from the getter + handle = attrHandle[ lowercaseName ]; + attrHandle[ lowercaseName ] = ret; + ret = getter( elem, name, isXML ) != null ? + lowercaseName : + null; + attrHandle[ lowercaseName ] = handle; + } + return ret; + }; +} ); + + + + +var rfocusable = /^(?:input|select|textarea|button)$/i, + rclickable = /^(?:a|area)$/i; + +jQuery.fn.extend( { + prop: function( name, value ) { + return access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + return this.each( function() { + delete this[ jQuery.propFix[ name ] || name ]; + } ); + } +} ); + +jQuery.extend( { + prop: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set properties on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + return ( elem[ name ] = value ); + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + return elem[ name ]; + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + + // Support: IE <=9 - 11 only + // elem.tabIndex doesn't always return the + // correct value when it hasn't been explicitly set + // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // Use proper attribute retrieval(#12072) + var tabindex = jQuery.find.attr( elem, "tabindex" ); + + if ( tabindex ) { + return parseInt( tabindex, 10 ); + } + + if ( + rfocusable.test( elem.nodeName ) || + rclickable.test( elem.nodeName ) && + elem.href + ) { + return 0; + } + + return -1; + } + } + }, + + propFix: { + "for": "htmlFor", + "class": "className" + } +} ); + +// Support: IE <=11 only +// Accessing the selectedIndex property +// forces the browser to respect setting selected +// on the option +// The getter ensures a default option is selected +// when in an optgroup +// eslint rule "no-unused-expressions" is disabled for this code +// since it considers such accessions noop +if ( !support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent && parent.parentNode ) { + parent.parentNode.selectedIndex; + } + return null; + }, + set: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + }; +} + +jQuery.each( [ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +} ); + + + + + // Strip and collapse whitespace according to HTML spec + // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace + function stripAndCollapse( value ) { + var tokens = value.match( rnothtmlwhite ) || []; + return tokens.join( " " ); + } + + +function getClass( elem ) { + return elem.getAttribute && elem.getAttribute( "class" ) || ""; +} + +function classesToArray( value ) { + if ( Array.isArray( value ) ) { + return value; + } + if ( typeof value === "string" ) { + return value.match( rnothtmlwhite ) || []; + } + return []; +} + +jQuery.fn.extend( { + addClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( !arguments.length ) { + return this.attr( "class", "" ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) > -1 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isValidValue = type === "string" || Array.isArray( value ); + + if ( typeof stateVal === "boolean" && isValidValue ) { + return stateVal ? this.addClass( value ) : this.removeClass( value ); + } + + if ( isFunction( value ) ) { + return this.each( function( i ) { + jQuery( this ).toggleClass( + value.call( this, i, getClass( this ), stateVal ), + stateVal + ); + } ); + } + + return this.each( function() { + var className, i, self, classNames; + + if ( isValidValue ) { + + // Toggle individual class names + i = 0; + self = jQuery( this ); + classNames = classesToArray( value ); + + while ( ( className = classNames[ i++ ] ) ) { + + // Check each className given, space separated list + if ( self.hasClass( className ) ) { + self.removeClass( className ); + } else { + self.addClass( className ); + } + } + + // Toggle whole class name + } else if ( value === undefined || type === "boolean" ) { + className = getClass( this ); + if ( className ) { + + // Store className if set + dataPriv.set( this, "__className__", className ); + } + + // If the element has a class name or if we're passed `false`, + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + if ( this.setAttribute ) { + this.setAttribute( "class", + className || value === false ? + "" : + dataPriv.get( this, "__className__" ) || "" + ); + } + } + } ); + }, + + hasClass: function( selector ) { + var className, elem, + i = 0; + + className = " " + selector + " "; + while ( ( elem = this[ i++ ] ) ) { + if ( elem.nodeType === 1 && + ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { + return true; + } + } + + return false; + } +} ); + + + + +var rreturn = /\r/g; + +jQuery.fn.extend( { + val: function( value ) { + var hooks, ret, valueIsFunction, + elem = this[ 0 ]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || + jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && + "get" in hooks && + ( ret = hooks.get( elem, "value" ) ) !== undefined + ) { + return ret; + } + + ret = elem.value; + + // Handle most common string cases + if ( typeof ret === "string" ) { + return ret.replace( rreturn, "" ); + } + + // Handle cases where value is null/undef or number + return ret == null ? "" : ret; + } + + return; + } + + valueIsFunction = isFunction( value ); + + return this.each( function( i ) { + var val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( valueIsFunction ) { + val = value.call( this, i, jQuery( this ).val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + + } else if ( typeof val === "number" ) { + val += ""; + + } else if ( Array.isArray( val ) ) { + val = jQuery.map( val, function( value ) { + return value == null ? "" : value + ""; + } ); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + } ); + } +} ); + +jQuery.extend( { + valHooks: { + option: { + get: function( elem ) { + + var val = jQuery.find.attr( elem, "value" ); + return val != null ? + val : + + // Support: IE <=10 - 11 only + // option.text throws exceptions (#14686, #14858) + // Strip and collapse whitespace + // https://html.spec.whatwg.org/#strip-and-collapse-whitespace + stripAndCollapse( jQuery.text( elem ) ); + } + }, + select: { + get: function( elem ) { + var value, option, i, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one", + values = one ? null : [], + max = one ? index + 1 : options.length; + + if ( index < 0 ) { + i = max; + + } else { + i = one ? index : 0; + } + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Support: IE <=9 only + // IE8-9 doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + + // Don't return options that are disabled or in a disabled optgroup + !option.disabled && + ( !option.parentNode.disabled || + !nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var optionSet, option, + options = elem.options, + values = jQuery.makeArray( value ), + i = options.length; + + while ( i-- ) { + option = options[ i ]; + + /* eslint-disable no-cond-assign */ + + if ( option.selected = + jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 + ) { + optionSet = true; + } + + /* eslint-enable no-cond-assign */ + } + + // Force browsers to behave consistently when non-matching value is set + if ( !optionSet ) { + elem.selectedIndex = -1; + } + return values; + } + } + } +} ); + +// Radios and checkboxes getter/setter +jQuery.each( [ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + set: function( elem, value ) { + if ( Array.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); + } + } + }; + if ( !support.checkOn ) { + jQuery.valHooks[ this ].get = function( elem ) { + return elem.getAttribute( "value" ) === null ? "on" : elem.value; + }; + } +} ); + + + + +// Return jQuery for attributes-only inclusion + + +support.focusin = "onfocusin" in window; + + +var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + stopPropagationCallback = function( e ) { + e.stopPropagation(); + }; + +jQuery.extend( jQuery.event, { + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = lastElement = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + lastElement = cur; + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && + dataPriv.get( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( ( !special._default || + special._default.apply( eventPath.pop(), data ) === false ) && + acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name as the event. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + + if ( event.isPropagationStopped() ) { + lastElement.addEventListener( type, stopPropagationCallback ); + } + + elem[ type ](); + + if ( event.isPropagationStopped() ) { + lastElement.removeEventListener( type, stopPropagationCallback ); + } + + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + // Piggyback on a donor event to simulate a different one + // Used only for `focus(in | out)` events + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + } + ); + + jQuery.event.trigger( e, null, elem ); + } + +} ); + +jQuery.fn.extend( { + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +// Support: Firefox <=44 +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + + // Handle: regular nodes (via `this.ownerDocument`), window + // (via `this.document`) & document (via `this`). + var doc = this.ownerDocument || this.document || this, + attaches = dataPriv.access( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this.document || this, + attaches = dataPriv.access( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + dataPriv.remove( doc, fix ); + + } else { + dataPriv.access( doc, fix, attaches ); + } + } + }; + } ); +} +var location = window.location; + +var nonce = { guid: Date.now() }; + +var rquery = ( /\?/ ); + + + +// Cross-browser xml parsing +jQuery.parseXML = function( data ) { + var xml, parserErrorElem; + if ( !data || typeof data !== "string" ) { + return null; + } + + // Support: IE 9 - 11 only + // IE throws on parseFromString with invalid input. + try { + xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); + } catch ( e ) {} + + parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; + if ( !xml || parserErrorElem ) { + jQuery.error( "Invalid XML: " + ( + parserErrorElem ? + jQuery.map( parserErrorElem.childNodes, function( el ) { + return el.textContent; + } ).join( "\n" ) : + data + ) ); + } + return xml; +}; + + +var + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, + rsubmittable = /^(?:input|select|textarea|keygen)/i; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( Array.isArray( obj ) ) { + + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + + // Item is non-scalar (array or object), encode its numeric index. + buildParams( + prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", + v, + traditional, + add + ); + } + } ); + + } else if ( !traditional && toType( obj ) === "object" ) { + + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + + // Serialize scalar item. + add( prefix, obj ); + } +} + +// Serialize an array of form elements or a set of +// key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, valueOrFunction ) { + + // If value is a function, invoke it and use its return value + var value = isFunction( valueOrFunction ) ? + valueOrFunction() : + valueOrFunction; + + s[ s.length ] = encodeURIComponent( key ) + "=" + + encodeURIComponent( value == null ? "" : value ); + }; + + if ( a == null ) { + return ""; + } + + // If an array was passed in, assume that it is an array of form elements. + if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + } ); + + } else { + + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ); +}; + +jQuery.fn.extend( { + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map( function() { + + // Can add propHook for "elements" to filter or add form elements + var elements = jQuery.prop( this, "elements" ); + return elements ? jQuery.makeArray( elements ) : this; + } ).filter( function() { + var type = this.type; + + // Use .is( ":disabled" ) so that fieldset[disabled] works + return this.name && !jQuery( this ).is( ":disabled" ) && + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && + ( this.checked || !rcheckableType.test( type ) ); + } ).map( function( _i, elem ) { + var val = jQuery( this ).val(); + + if ( val == null ) { + return null; + } + + if ( Array.isArray( val ) ) { + return jQuery.map( val, function( val ) { + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ); + } + + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ).get(); + } +} ); + + +var + r20 = /%20/g, + rhash = /#.*$/, + rantiCache = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, + + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat( "*" ), + + // Anchor tag for parsing the document origin + originAnchor = document.createElement( "a" ); + +originAnchor.href = location.href; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; + + if ( isFunction( func ) ) { + + // For each dataType in the dataTypeExpression + while ( ( dataType = dataTypes[ i++ ] ) ) { + + // Prepend if requested + if ( dataType[ 0 ] === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); + + // Otherwise append + } else { + ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if ( typeof dataTypeOrTransport === "string" && + !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + } ); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +/* Handles responses to an ajax request: + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes; + + // Remove auto dataType and get content-type in the process + while ( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +/* Chain conversions given the request and the original response + * Also sets the responseXXX fields on the jqXHR instance + */ +function ajaxConvert( s, response, jqXHR, isSuccess ) { + var conv2, current, conv, tmp, prev, + converters = {}, + + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(); + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + current = dataTypes.shift(); + + // Convert to each sequential dataType + while ( current ) { + + if ( s.responseFields[ current ] ) { + jqXHR[ s.responseFields[ current ] ] = response; + } + + // Apply the dataFilter if provided + if ( !prev && isSuccess && s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + prev = current; + current = dataTypes.shift(); + + if ( current ) { + + // There's only work to do if current dataType is non-auto + if ( current === "*" ) { + + current = prev; + + // Convert response if prev dataType is non-auto and differs from current + } else if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split( " " ); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.unshift( tmp[ 1 ] ); + } + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s.throws ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { + state: "parsererror", + error: conv ? e : "No conversion from " + prev + " to " + current + }; + } + } + } + } + } + } + + return { state: "success", data: response }; +} + +jQuery.extend( { + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: location.href, + type: "GET", + isLocal: rlocalProtocol.test( location.protocol ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /\bxml\b/, + html: /\bhtml/, + json: /\bjson\b/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": JSON.parse, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var transport, + + // URL without anti-cache param + cacheURL, + + // Response headers + responseHeadersString, + responseHeaders, + + // timeout handle + timeoutTimer, + + // Url cleanup var + urlAnchor, + + // Request state (becomes false upon send and true upon completion) + completed, + + // To know if global events are to be dispatched + fireGlobals, + + // Loop variable + i, + + // uncached part of the url + uncached, + + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + + // Callbacks context + callbackContext = s.context || s, + + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && + ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks( "once memory" ), + + // Status-dependent callbacks + statusCode = s.statusCode || {}, + + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + + // Default abort message + strAbort = "canceled", + + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( completed ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( ( match = rheaders.exec( responseHeadersString ) ) ) { + responseHeaders[ match[ 1 ].toLowerCase() + " " ] = + ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) + .concat( match[ 2 ] ); + } + } + match = responseHeaders[ key.toLowerCase() + " " ]; + } + return match == null ? null : match.join( ", " ); + }, + + // Raw string + getAllResponseHeaders: function() { + return completed ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + if ( completed == null ) { + name = requestHeadersNames[ name.toLowerCase() ] = + requestHeadersNames[ name.toLowerCase() ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( completed == null ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( completed ) { + + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } else { + + // Lazy-add the new callbacks in a way that preserves old ones + for ( code in map ) { + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ); + + // Add protocol if not provided (prefilters might expect it) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || location.href ) + "" ) + .replace( rprotocol, location.protocol + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; + + // A cross-domain request is in order when the origin doesn't match the current origin. + if ( s.crossDomain == null ) { + urlAnchor = document.createElement( "a" ); + + // Support: IE <=8 - 11, Edge 12 - 15 + // IE throws exception on accessing the href property if url is malformed, + // e.g. http://example.com:80x/ + try { + urlAnchor.href = s.url; + + // Support: IE <=8 - 11 only + // Anchor's host property isn't correctly set when s.url is relative + urlAnchor.href = urlAnchor.href; + s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== + urlAnchor.protocol + "//" + urlAnchor.host; + } catch ( e ) { + + // If there is an error parsing the URL, assume it is crossDomain, + // it can be rejected by the transport if it is invalid + s.crossDomain = true; + } + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( completed ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) + fireGlobals = jQuery.event && s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + // Remove hash to simplify url manipulation + cacheURL = s.url.replace( rhash, "" ); + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // Remember the hash so we can put it back + uncached = s.url.slice( cacheURL.length ); + + // If data is available and should be processed, append data to url + if ( s.data && ( s.processData || typeof s.data === "string" ) ) { + cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; + + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add or update anti-cache param if needed + if ( s.cache === false ) { + cacheURL = cacheURL.replace( rantiCache, "$1" ); + uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + + uncached; + } + + // Put hash and anti-cache on the URL that will be requested (gh-1732) + s.url = cacheURL + uncached; + + // Change '%20' to '+' if this is encoded form body content (gh-2658) + } else if ( s.data && s.processData && + ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { + s.data = s.data.replace( r20, "+" ); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? + s.accepts[ s.dataTypes[ 0 ] ] + + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && + ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { + + // Abort if not done already and return + return jqXHR.abort(); + } + + // Aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + completeDeferred.add( s.complete ); + jqXHR.done( s.success ); + jqXHR.fail( s.error ); + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + + // If request was aborted inside ajaxSend, stop there + if ( completed ) { + return jqXHR; + } + + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = window.setTimeout( function() { + jqXHR.abort( "timeout" ); + }, s.timeout ); + } + + try { + completed = false; + transport.send( requestHeaders, done ); + } catch ( e ) { + + // Rethrow post-completion exceptions + if ( completed ) { + throw e; + } + + // Propagate others as results + done( -1, e ); + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Ignore repeat invocations + if ( completed ) { + return; + } + + completed = true; + + // Clear timeout if it exists + if ( timeoutTimer ) { + window.clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Determine if successful + isSuccess = status >= 200 && status < 300 || status === 304; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // Use a noop converter for missing script but not if jsonp + if ( !isSuccess && + jQuery.inArray( "script", s.dataTypes ) > -1 && + jQuery.inArray( "json", s.dataTypes ) < 0 ) { + s.converters[ "text script" ] = function() {}; + } + + // Convert no matter what (that way responseXXX fields are always set) + response = ajaxConvert( s, response, jqXHR, isSuccess ); + + // If successful, handle type chaining + if ( isSuccess ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader( "Last-Modified" ); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader( "etag" ); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // if no content + if ( status === 204 || s.type === "HEAD" ) { + statusText = "nocontent"; + + // if not modified + } else if ( status === 304 ) { + statusText = "notmodified"; + + // If we have data, let's convert it + } else { + statusText = response.state; + success = response.data; + error = response.error; + isSuccess = !error; + } + } else { + + // Extract error from statusText and normalize for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger( "ajaxStop" ); + } + } + } + + return jqXHR; + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + } +} ); + +jQuery.each( [ "get", "post" ], function( _i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + + // Shift arguments if data argument was omitted + if ( isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + // The url can be an options object (which then must have .url) + return jQuery.ajax( jQuery.extend( { + url: url, + type: method, + dataType: type, + data: data, + success: callback + }, jQuery.isPlainObject( url ) && url ) ); + }; +} ); + +jQuery.ajaxPrefilter( function( s ) { + var i; + for ( i in s.headers ) { + if ( i.toLowerCase() === "content-type" ) { + s.contentType = s.headers[ i ] || ""; + } + } +} ); + + +jQuery._evalUrl = function( url, options, doc ) { + return jQuery.ajax( { + url: url, + + // Make this explicit, since user can override this through ajaxSetup (#11264) + type: "GET", + dataType: "script", + cache: true, + async: false, + global: false, + + // Only evaluate the response if it is successful (gh-4126) + // dataFilter is not invoked for failure responses, so using it instead + // of the default converter is kludgy but it works. + converters: { + "text script": function() {} + }, + dataFilter: function( response ) { + jQuery.globalEval( response, options, doc ); + } + } ); +}; + + +jQuery.fn.extend( { + wrapAll: function( html ) { + var wrap; + + if ( this[ 0 ] ) { + if ( isFunction( html ) ) { + html = html.call( this[ 0 ] ); + } + + // The elements to wrap the target around + wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); + + if ( this[ 0 ].parentNode ) { + wrap.insertBefore( this[ 0 ] ); + } + + wrap.map( function() { + var elem = this; + + while ( elem.firstElementChild ) { + elem = elem.firstElementChild; + } + + return elem; + } ).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( isFunction( html ) ) { + return this.each( function( i ) { + jQuery( this ).wrapInner( html.call( this, i ) ); + } ); + } + + return this.each( function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + } ); + }, + + wrap: function( html ) { + var htmlIsFunction = isFunction( html ); + + return this.each( function( i ) { + jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); + } ); + }, + + unwrap: function( selector ) { + this.parent( selector ).not( "body" ).each( function() { + jQuery( this ).replaceWith( this.childNodes ); + } ); + return this; + } +} ); + + +jQuery.expr.pseudos.hidden = function( elem ) { + return !jQuery.expr.pseudos.visible( elem ); +}; +jQuery.expr.pseudos.visible = function( elem ) { + return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); +}; + + + + +jQuery.ajaxSettings.xhr = function() { + try { + return new window.XMLHttpRequest(); + } catch ( e ) {} +}; + +var xhrSuccessStatus = { + + // File protocol always yields status code 0, assume 200 + 0: 200, + + // Support: IE <=9 only + // #1450: sometimes IE returns 1223 when it should be 204 + 1223: 204 + }, + xhrSupported = jQuery.ajaxSettings.xhr(); + +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); +support.ajax = xhrSupported = !!xhrSupported; + +jQuery.ajaxTransport( function( options ) { + var callback, errorCallback; + + // Cross domain only allowed if supported through XMLHttpRequest + if ( support.cors || xhrSupported && !options.crossDomain ) { + return { + send: function( headers, complete ) { + var i, + xhr = options.xhr(); + + xhr.open( + options.type, + options.url, + options.async, + options.username, + options.password + ); + + // Apply custom fields if provided + if ( options.xhrFields ) { + for ( i in options.xhrFields ) { + xhr[ i ] = options.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( options.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( options.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { + headers[ "X-Requested-With" ] = "XMLHttpRequest"; + } + + // Set headers + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + + // Callback + callback = function( type ) { + return function() { + if ( callback ) { + callback = errorCallback = xhr.onload = + xhr.onerror = xhr.onabort = xhr.ontimeout = + xhr.onreadystatechange = null; + + if ( type === "abort" ) { + xhr.abort(); + } else if ( type === "error" ) { + + // Support: IE <=9 only + // On a manual native abort, IE9 throws + // errors on any property access that is not readyState + if ( typeof xhr.status !== "number" ) { + complete( 0, "error" ); + } else { + complete( + + // File: protocol always yields status 0; see #8605, #14207 + xhr.status, + xhr.statusText + ); + } + } else { + complete( + xhrSuccessStatus[ xhr.status ] || xhr.status, + xhr.statusText, + + // Support: IE <=9 only + // IE9 has no XHR2 but throws on binary (trac-11426) + // For XHR2 non-text, let the caller handle it (gh-2498) + ( xhr.responseType || "text" ) !== "text" || + typeof xhr.responseText !== "string" ? + { binary: xhr.response } : + { text: xhr.responseText }, + xhr.getAllResponseHeaders() + ); + } + } + }; + }; + + // Listen to events + xhr.onload = callback(); + errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); + + // Support: IE 9 only + // Use onreadystatechange to replace onabort + // to handle uncaught aborts + if ( xhr.onabort !== undefined ) { + xhr.onabort = errorCallback; + } else { + xhr.onreadystatechange = function() { + + // Check readyState before timeout as it changes + if ( xhr.readyState === 4 ) { + + // Allow onerror to be called first, + // but that will not handle a native abort + // Also, save errorCallback to a variable + // as xhr.onerror cannot be accessed + window.setTimeout( function() { + if ( callback ) { + errorCallback(); + } + } ); + } + }; + } + + // Create the abort callback + callback = callback( "abort" ); + + try { + + // Do send the request (this may raise an exception) + xhr.send( options.hasContent && options.data || null ); + } catch ( e ) { + + // #14683: Only rethrow if this hasn't been notified as an error yet + if ( callback ) { + throw e; + } + } + }, + + abort: function() { + if ( callback ) { + callback(); + } + } + }; + } +} ); + + + + +// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) +jQuery.ajaxPrefilter( function( s ) { + if ( s.crossDomain ) { + s.contents.script = false; + } +} ); + +// Install script dataType +jQuery.ajaxSetup( { + accepts: { + script: "text/javascript, application/javascript, " + + "application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /\b(?:java|ecma)script\b/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +} ); + +// Handle cache's special case and crossDomain +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + } +} ); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function( s ) { + + // This transport only deals with cross domain or forced-by-attrs requests + if ( s.crossDomain || s.scriptAttrs ) { + var script, callback; + return { + send: function( _, complete ) { + script = jQuery( " + + + + + + + + + Skip to contents + + +
    +
    +
    + + + +

    plotrix is an R package that provides many plotting, labeling, and axis & color scaling functions.

    +
    +

    Installation +

    +

    You can install the current release of plotrix from CRAN with:

    +
    +install.packages("plotrix")
    +

    You can install the development version of plotrix from GitHub with:

    +
    +# install.packages("devtools")
    +devtools::install_github("plotrix/plotrix")
    +
    +
    +

    Authors +

    +

    The original author and maintainer of plotrix, Jim Lemon, passed away in September 2023.

    +

    Currently it is being maintained by Duncan Murdoch. Please submit bug reports to https://github.com/plotrix/plotrix/issues.

    +

    Other contributors include:

    +

    Ben Bolker [ctb],
    +Sander Oom [ctb],
    +Eduardo Klein [ctb],
    +Barry Rowlingson [ctb],
    +Hadley Wickham [ctb],
    +Anupam Tyagi [ctb],
    +Olivier Eterradossi [ctb],
    +Gabor Grothendieck [ctb],
    +Michael Toews [ctb],
    +John Kane [ctb],
    +Rolf Turner [ctb],
    +Carl Witthoft [ctb],
    +Julian Stander [ctb],
    +Thomas Petzoldt [ctb],
    +Remko Duursma [ctb],
    +Elisa Biancotto [ctb],
    +Ofir Levy [ctb],
    +Christophe Dutang [ctb],
    +Peter Solymos [ctb],
    +Robby Engelmann [ctb],
    +Michael Hecker [ctb],
    +Felix Steinbeck [ctb],
    +Hans Borchers [ctb],
    +Henrik Singmann [ctb],
    +Ted Toal [ctb],
    +Derek Ogle [ctb],
    +Darshan Baral [ctb],
    +Ulrike Groemping [ctb],
    +Bill Venables [ctb],
    +The CRAN Team [ctb].

    +
    +
    +
    +
    + + +
    + + + +
    +
    + + + + + + + diff --git a/index.md b/index.md new file mode 100644 index 0000000..122e95e --- /dev/null +++ b/index.md @@ -0,0 +1,61 @@ +# plotrix + +`plotrix` is an `R` package that provides many plotting, labeling, and +axis & color scaling functions. + +## Installation + +You can install the current release of `plotrix` from CRAN with: + +``` r +install.packages("plotrix") +``` + +You can install the development version of plotrix from +[GitHub](https://github.com/) with: + +``` r +# install.packages("devtools") +devtools::install_github("plotrix/plotrix") +``` + +## Authors + +The original author and maintainer of `plotrix`, Jim Lemon, passed away +in September 2023. + +Currently it is being maintained by Duncan Murdoch. Please submit bug +reports to . + +Other contributors include: + +Ben Bolker \[ctb\], +Sander Oom \[ctb\], +Eduardo Klein \[ctb\], +Barry Rowlingson \[ctb\], +Hadley Wickham \[ctb\], +Anupam Tyagi \[ctb\], +Olivier Eterradossi \[ctb\], +Gabor Grothendieck \[ctb\], +Michael Toews \[ctb\], +John Kane \[ctb\], +Rolf Turner \[ctb\], +Carl Witthoft \[ctb\], +Julian Stander \[ctb\], +Thomas Petzoldt \[ctb\], +Remko Duursma \[ctb\], +Elisa Biancotto \[ctb\], +Ofir Levy \[ctb\], +Christophe Dutang \[ctb\], +Peter Solymos \[ctb\], +Robby Engelmann \[ctb\], +Michael Hecker \[ctb\], +Felix Steinbeck \[ctb\], +Hans Borchers \[ctb\], +Henrik Singmann \[ctb\], +Ted Toal \[ctb\], +Derek Ogle \[ctb\], +Darshan Baral \[ctb\], +Ulrike Groemping \[ctb\], +Bill Venables \[ctb\], +The CRAN Team \[ctb\]. diff --git a/inst/CITATION b/inst/CITATION deleted file mode 100644 index e68ed42..0000000 --- a/inst/CITATION +++ /dev/null @@ -1,12 +0,0 @@ -citHeader("To cite package 'plotrix' in publications use:") -bibentry(bibtype = "Article", - year = 2006, - title = "Plotrix: a package in the red light district of R", - journal = "R-News", - volume = "6", - number = "4", - pages = "8-12", - author = as.person("Lemon J"), - textVersion = "Lemon, J. (2006) Plotrix: a package in the red light - district of R. R-News, 6(4): 8-12." -) diff --git a/katex-auto.js b/katex-auto.js new file mode 100644 index 0000000..2adab3a --- /dev/null +++ b/katex-auto.js @@ -0,0 +1,16 @@ +// https://github.com/jgm/pandoc/blob/29fa97ab96b8e2d62d48326e1b949a71dc41f47a/src/Text/Pandoc/Writers/HTML.hs#L332-L345 +document.addEventListener("DOMContentLoaded", function () { + var mathElements = document.getElementsByClassName("math"); + var macros = []; + for (var i = 0; i < mathElements.length; i++) { + var texText = mathElements[i].firstChild; + if (mathElements[i].tagName == "SPAN") { + katex.render(texText.data, mathElements[i], { + displayMode: mathElements[i].classList.contains("display"), + throwOnError: false, + macros: macros, + fleqn: false + }); + } + } +}); diff --git a/lightswitch.js b/lightswitch.js new file mode 100644 index 0000000..3808ca1 --- /dev/null +++ b/lightswitch.js @@ -0,0 +1,85 @@ + +/*! + * Color mode toggler for Bootstrap's docs (https://getbootstrap.com/) + * Copyright 2011-2023 The Bootstrap Authors + * Licensed under the Creative Commons Attribution 3.0 Unported License. + * Updates for {pkgdown} by the {bslib} authors, also licensed under CC-BY-3.0. + */ + +const getStoredTheme = () => localStorage.getItem('theme') +const setStoredTheme = theme => localStorage.setItem('theme', theme) + +const getPreferredTheme = () => { + const storedTheme = getStoredTheme() + if (storedTheme) { + return storedTheme + } + + return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' +} + +const setTheme = theme => { + if (theme === 'auto') { + document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) + } else { + document.documentElement.setAttribute('data-bs-theme', theme) + } +} + +function bsSetupThemeToggle() { + 'use strict' + + const showActiveTheme = (theme, focus = false) => { + var activeLabel, activeIcon; + + document.querySelectorAll('[data-bs-theme-value]').forEach(element => { + const buttonTheme = element.getAttribute('data-bs-theme-value') + const isActive = buttonTheme == theme + + element.classList.toggle('active', isActive) + element.setAttribute('aria-pressed', isActive) + + if (isActive) { + activeLabel = element.textContent; + activeIcon = element.querySelector('span').classList.value; + } + }) + + const themeSwitcher = document.querySelector('#dropdown-lightswitch') + if (!themeSwitcher) { + return + } + + themeSwitcher.setAttribute('aria-label', activeLabel) + themeSwitcher.querySelector('span').classList.value = activeIcon; + + if (focus) { + themeSwitcher.focus() + } + } + + window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => { + const storedTheme = getStoredTheme() + if (storedTheme !== 'light' && storedTheme !== 'dark') { + setTheme(getPreferredTheme()) + } + }) + + window.addEventListener('DOMContentLoaded', () => { + showActiveTheme(getPreferredTheme()) + + document + .querySelectorAll('[data-bs-theme-value]') + .forEach(toggle => { + toggle.addEventListener('click', () => { + const theme = toggle.getAttribute('data-bs-theme-value') + setTheme(theme) + setStoredTheme(theme) + showActiveTheme(theme, true) + }) + }) + }) +} + +setTheme(getPreferredTheme()); +bsSetupThemeToggle(); diff --git a/link.svg b/link.svg new file mode 100644 index 0000000..88ad827 --- /dev/null +++ b/link.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/llms.txt b/llms.txt new file mode 100644 index 0000000..e70ce06 --- /dev/null +++ b/llms.txt @@ -0,0 +1,300 @@ +# plotrix + +`plotrix` is an `R` package that provides many plotting, labeling, and +axis & color scaling functions. + +## Installation + +You can install the current release of `plotrix` from CRAN with: + +``` r +install.packages("plotrix") +``` + +You can install the development version of plotrix from +[GitHub](https://github.com/) with: + +``` r +# install.packages("devtools") +devtools::install_github("plotrix/plotrix") +``` + +## Authors + +The original author and maintainer of `plotrix`, Jim Lemon, passed away +in September 2023. + +Currently it is being maintained by Duncan Murdoch. Please submit bug +reports to . + +Other contributors include: + +Ben Bolker \[ctb\], +Sander Oom \[ctb\], +Eduardo Klein \[ctb\], +Barry Rowlingson \[ctb\], +Hadley Wickham \[ctb\], +Anupam Tyagi \[ctb\], +Olivier Eterradossi \[ctb\], +Gabor Grothendieck \[ctb\], +Michael Toews \[ctb\], +John Kane \[ctb\], +Rolf Turner \[ctb\], +Carl Witthoft \[ctb\], +Julian Stander \[ctb\], +Thomas Petzoldt \[ctb\], +Remko Duursma \[ctb\], +Elisa Biancotto \[ctb\], +Ofir Levy \[ctb\], +Christophe Dutang \[ctb\], +Peter Solymos \[ctb\], +Robby Engelmann \[ctb\], +Michael Hecker \[ctb\], +Felix Steinbeck \[ctb\], +Hans Borchers \[ctb\], +Henrik Singmann \[ctb\], +Ted Toal \[ctb\], +Derek Ogle \[ctb\], +Darshan Baral \[ctb\], +Ulrike Groemping \[ctb\], +Bill Venables \[ctb\], +The CRAN Team \[ctb\]. + +# Package index + +## All functions + +- [`ablineclip()`](ablineclip.md) : Add a straight line to a plot +- [`add.ps()`](add.ps.md) : add p-values from t-tests +- [`addtable2plot()`](addtable2plot.md) : Add a table of values to a + plot +- [`arctext()`](arctext.md) : Display text on a circular arc +- [`axis.break()`](axis.break.md) : Place a "break" mark on an axis +- [`axis.mult()`](axis.mult.md) : Display an axis with values having a + multiplier +- [`barNest()`](barNest.md) : Display a nested breakdown of numeric + values +- [`barlabels()`](barlabels.md) : Label the bars on a barplot +- [`barp()`](barp.md) : A bar plotting routine +- [`battleship.plot()`](battleship.plot.md) : Display a matrix of values + as the widths of stacked rectangles +- [`bin.wind.records()`](bin.wind.records.md) : Classify wind direction + and speed records +- [`binciW()`](binciW.md) : Binomial confidence limits +- [`binciWl()`](binciWl.md) : Lower binomial confidence limit +- [`binciWu()`](binciWu.md) : Upper binomial confidence limit +- [`box.heresy()`](box.heresy.md) : Display a sort of box plot +- [`boxed.labels()`](boxed.labels.md) : Place labels in boxes +- [`brkdn.plot()`](brkdn.plot.md) : A point/line plotting routine +- [`brkdnNest()`](brkdnNest.md) : Perform a nested breakdown of numeric + values +- [`bumpchart()`](bumpchart.md) : Display a "bumps" (sequential ranking) + chart +- [`categoryReshape()`](categoryReshape.md) : Convert object + label/attribute label coding. +- [`centipede.plot()`](centipede.plot.md) : Display a centipede plot +- [`clean.args()`](clean.args.md) [`remove.args()`](clean.args.md) : + Remove inappropriate arguments from an argument list +- [`clock24.plot()`](clock24.plot.md) : Plot values on a 24 hour + "clockface" +- [`clplot()`](clplot.md) : Plot lines with colors determined by values. +- [`cluster.overplot()`](cluster.overplot.md) : Shift overlying points + into clusters +- [`clustered.dotplots()`](clustered.dotplots.md) : Display the + frequencies of two categories +- [`color.axis()`](color.axis.md) : Display an axis in a specified color +- [`color.gradient()`](color.gradient.md) : Calculate an arbitrary + sequence of colors +- [`color.id()`](color.id.md) : Identify closest match to a color +- [`color.legend()`](color.legend.md) : Legend matching categories or + values to colors +- [`color.scale()`](color.scale.md) : Turn values into colors. +- [`color.scale.lines()`](color.scale.lines.md) : Line segments with + scaled colors +- [`color2D.matplot()`](color2D.matplot.md) : Display a numeric matrix + as color matrix +- [`corner.label()`](corner.label.md) : Find corner locations and + optionally display a label +- [`count.overplot()`](count.overplot.md) : Show overlying points as + counts +- [`cylindrect()`](cylindrect.md) : Display an apparent cylinder +- [`death_reg`](death_reg.md) : Death registrations from 1996 to 2010 +- [`dendroPlot()`](dendroPlot.md) : Display distributions as dendrites +- [`densityGrid()`](densityGrid.md) : Display a matrix of cell values as + symbols. +- [`diamondplot()`](diamondplot.md) : Plot multiple variables as + polygons on a radial grid +- [`dispersion()`](dispersion.md) : Display a measure of dispersion. +- [`do.first`](do.first.md) : Execute a graphic function on a plot +- [`dotplot.mtb()`](dotplot.mtb.md) : Minitab style dotplots. +- [`draw.arc()`](draw.arc.md) : Draw arc +- [`draw.circle()`](draw.circle.md) : Draw a circle +- [`draw.ellipse()`](draw.ellipse.md) : Draw ellipse +- [`draw.radial.line()`](draw.radial.line.md) : Draw a radial line +- [`draw.tilted.sector()`](draw.tilted.sector.md) : Display a 3D pie + sector +- [`drawNestedBars()`](drawNestedBars.md) : Display nested bars +- [`drawSectorAnnulus()`](drawSectorAnnulus.md) : Display a radial pie + sector +- [`ehplot()`](ehplot.md) : Engelmann-Hecker-Plot - EH-Plot +- [`election()`](election.md) : Assign party members to seats +- [`emptyspace()`](emptyspace.md) : Find an empty space on a plot +- [`fan.plot()`](fan.plot.md) : Display a fan plot +- [`feather.plot()`](feather.plot.md) : Display vectors along a + horizontal reference line +- [`fill.corner()`](fill.corner.md) : Fill a "corner" of a matrix with + values +- [`find_max_cell()`](find_max_cell.md) : Maximum (or minimum) value + cell in a matrix. +- [`floating.pie()`](floating.pie.md) : Display a floating pie chart +- [`fullaxis()`](fullaxis.md) : Add an axis with a line to the edge of + the plot +- [`gantt.chart()`](gantt.chart.md) : Display a Gantt chart +- [`gap.barplot()`](gap.barplot.md) : Display a barplot with a gap + (missing range) on one axis +- [`gap.boxplot()`](gap.boxplot.md) : Display a boxplot with a gap + (missing range) +- [`gap.plot()`](gap.plot.md) : Display a plot with one or two gaps + (missing ranges) on one axis +- [`gap_barp()`](gap_barp.md) : Display a barplot with a gap (missing + range) on one axis +- [`get.breaks()`](get.breaks.md) : Get the breakpoints for a weighted + histogram +- [`get.gantt.info()`](get.gantt.info.md) : Gather the information to + create a Gantt chart +- [`get.segs()`](get.segs.md) : Calculate the midpoints and limits for a + centipede plot +- [`get.soil.texture()`](get.soil.texture.md) : Enter soil texture data +- [`get.tablepos()`](get.tablepos.md) : Get the position for a legend or + table +- [`get.triprop()`](get.triprop.md) : Enter three proportion data - + usually soil textures +- [`getFigCtr()`](getFigCtr.md) : Get coordinates in the figure region + in user units. +- [`getIntersectList()`](getIntersectList.md) : Enter a set intersection + list +- [`getMarginWidth()`](getMarginWidth.md) : Find the margin width + necessary to fit text or a legend next to a plot +- [`getYmult()`](getYmult.md) : Correct for aspect and coordinate ratio +- [`get_axispos3d()`](get_axispos3d.md) : Get axis positions on a 3D + plot +- [`gradient.rect()`](gradient.rect.md) : Display a rectangle filled + with an arbitrary color gradient +- [`hexagon()`](hexagon.md) : Draw a hexagon +- [`histStack()`](histStack.md) : Histogram "stacked" by categories +- [`intersectDiagram()`](intersectDiagram.md) : Display set + intersections +- [`jiggle()`](jiggle.md) : Calculate equally spaced values within a + range. +- [`joyPlot()`](joyPlot.md) : Display a series of density curves. +- [`kiteChart()`](kiteChart.md) : Magnitude by position chart. +- [`l2010`](l2010.md) : World lightning strike data from 2010 +- [`labbePlot()`](labbePlot.md) : Display a L'Abbe plot +- [`ladderplot()`](ladderplot.md) : Ladder Plot +- [`legendg()`](legendg.md) : Legend with grouped bars, lines or symbols +- [`lengthKey()`](lengthKey.md) : Key for interpreting lengths in a plot +- [`makeDensityMatrix()`](makeDensityMatrix.md) : Compute a matrix of + counts from a list of x,y positions +- [`makeIntersectList()`](makeIntersectList.md) : Count set + intersections +- [`maxEmptyRect()`](maxEmptyRect.md) : Find an empty space on a plot +- [`mtext3d()`](mtext3d.md) : Display text in the margins of a 3D plot +- [`multhist()`](multhist.md) : Plot a multiple histogram, as a barplot +- [`multivari()`](multivari.md) : Function to draw a multivari chart +- [`multsymbolbox()`](multsymbolbox.md) : Draw boxes filled with symbols +- [`oz.windrose()`](oz.windrose.md) : Display an Australian wind rose +- [`oz.windrose.legend()`](oz.windrose.legend.md) : Display an + Australian wind rose legend +- [`p2p_arrows()`](p2p_arrows.md) : Draw arrows between points +- [`panes()`](panes.md) : Prepare a "panel" type layout +- [`pasteCols()`](pasteCols.md) : Paste the columns of a matrix together +- [`paxis3d()`](paxis3d.md) : Display text in the margins of a 3D plot +- [`perspx()`](perspx.md) : Display perspective plot +- [`pie.labels()`](pie.labels.md) : Place labels on a pie chart +- [`pie3D()`](pie3D.md) : Display a 3D pie chart +- [`pie3D.labels()`](pie3D.labels.md) : Display labels on a 3D pie chart +- [`placeLabels()`](placeLabels.md) : Place labels in boxes +- [`plotCI()`](plotCI.md) : Plot confidence intervals/error bars +- [`plotH()`](plotH.md) : Scatterplot with histogram-like bars. +- [`plot_bg()`](plot_bg.md) : Add a background color to a plot +- [`plotrix-package`](plotrix-package.md) + [`plotrix`](plotrix-package.md) : Specialized plots and plotting + accessories +- [`polar.plot()`](polar.plot.md) : Plot values on a circular grid of 0 + to 360 degrees +- [`polygon.shadow()`](polygon.shadow.md) : Display a shadow effect for + an arbitrary polygon +- [`print(`*``*`)`](print.brklist.md) : Display the output of + brkdnNest +- [`propbrk()`](propbrk.md) : Calculate the proportion of specified + values in a vector +- [`psegments3d()`](psegments3d.md) : Draw segments on a 3D plot +- [`ptext3d()`](ptext3d.md) : Display text on a 3D plot +- [`pyramid.plot()`](pyramid.plot.md) : Pyramid plot +- [`radial.grid()`](radial.grid.md) : Display a radial grid +- [`radial.pie()`](radial.pie.md) : Plot sectors/annuli on a circular + grid of 0 to 2\*pi radians +- [`radial.plot()`](radial.plot.md) : Plot values on a circular grid of + 0 to 2\*pi radians +- [`radial.plot.labels()`](radial.plot.labels.md) : Display labels on a + circular grid +- [`radialtext()`](radialtext.md) : Display text in a radial line +- [`raw.means.plot()`](raw.means.plot.md) + [`raw.means.plot2()`](raw.means.plot.md) : raw.means.plot: Raw-Means + Plots for Experimental Designs +- [`rectFill()`](rectFill.md) : Draw a rectangle filled with symbols +- [`rescale()`](rescale.md) : Scale numbers into a new range +- [`revaxis()`](revaxis.md) : Plot with axis direction(s) reversed +- [`ruginv()`](ruginv.md) : Add an Inverse Rug to a Plot +- [`seats()`](seats.md) : Arrange N seats in M semicircular rows +- [`size_n_color()`](size_n_color.md) : Display circles with specified + size and color +- [`sizeplot()`](sizeplot.md) : Plot with repeated symbols by size +- [`sizetree()`](sizetree.md) : Display a hierarchical breakdown of + disjunct categories +- [`sliceArray()`](sliceArray.md) : Slice an array +- [`smoothColors()`](smoothColors.md) : Build a vector of color values +- [`soil.texture()`](soil.texture.md) : Soil texture triangle plot +- [`soil.texture.uk()`](soil.texture.uk.md) : Soil texture triangle plot + using UK conventions +- [`soils`](soils.md) : Soil texture data from 125 soils +- [`spread.labels()`](spread.labels.md) : Spread labels for irregularly + spaced values +- [`spreadout()`](spreadout.md) : Spread out a vector of numbers to a + minimum interval +- [`stackpoly()`](stackpoly.md) : Display the columns of a matrix or + data frame as stacked polygons +- [`staircase.plot()`](staircase.plot.md) : Display a staircase plot +- [`staircasePlot()`](staircasePlot.md) : Display a staircase plot +- [`starPie()`](starPie.md) : A pie-like graphic object +- [`staxlab()`](staxlab.md) : Place staggered or angled labels on an + axis +- [`std.error()`](std.error.md) : Calculate standard error of the mean +- [`sumbrk()`](sumbrk.md) : Count specified values in a vector +- [`symbolbarplot()`](symbolbarplot.md) : barplot filled with symbols +- [`symbolbox()`](symbolbox.md) : Draw a box filled with symbols +- [`tab.title()`](tab.title.md) : Display the title of a plot as a + colored tab +- [`taylor.diagram()`](taylor.diagram.md) : Taylor diagram +- [`textbox()`](textbox.md) : Add text box +- [`thigmophobe()`](thigmophobe.md) : Find the direction away from the + closest point +- [`thigmophobe.labels()`](thigmophobe.labels.md) : Place labels away + from the nearest point +- [`triax.abline()`](triax.abline.md) : Lines for triangle plot +- [`triax.fill()`](triax.fill.md) : Triangle plot fill +- [`triax.frame()`](triax.frame.md) : Triangle plot frame +- [`triax.plot()`](triax.plot.md) : Triangle plot +- [`triax.points()`](triax.points.md) : Triangle plot points +- [`tsxpos()`](tsxpos.md) : Calculate equispaced x positions. +- [`twoord.plot()`](twoord.plot.md) : Plot with two ordinates +- [`twoord.stackplot()`](twoord.stackplot.md) : Multiple (stack) plot + with two ordinates +- [`valid.n()`](valid.n.md) : Find the number of valid (not NA) values +- [`vectorField()`](vectorField.md) : Display magnitude/direction + vectors +- [`violin_plot()`](violin_plot.md) : Display a "violin" plot +- [`weighted.hist()`](weighted.hist.md) : Display a weighted histogram +- [`zoomInPlot()`](zoomInPlot.md) : Display a plot with a rectangular + section expanded in an adjacent plot + diff --git a/man/ablineclip.Rd b/man/ablineclip.Rd deleted file mode 100644 index 844402d..0000000 --- a/man/ablineclip.Rd +++ /dev/null @@ -1,44 +0,0 @@ -\name{ablineclip} -\alias{ablineclip} -\title{Add a straight line to a plot} -\description{ - As \samp{abline}, but has arguments \samp{x1,x2,y1,y2} as in \samp{clip}. -} -\usage{ - ablineclip(a=NULL,b=NULL,h=NULL,v=NULL,reg=NULL,coef=NULL,untf=FALSE, - x1=NULL,x2=NULL,y1=NULL,y2=NULL,...) -} -\arguments{ - \item{a}{Intercept.} - \item{b}{Slope.} - \item{h}{the y-value(s) for horizontal line(s).} - \item{v}{the x-value(s) for vertical line(s).} - \item{reg}{Fitted lm object. } - \item{coef}{Coefficients, typically intercept and slope.} - \item{untf}{How to plot on log coordinates, see \samp{abline}.} - \item{x1,x2,y1,y2}{Clipping limits, see \samp{clip}.} - \item{...}{Further arguments passed to \samp{abline}.} -} -\details{ - \samp{ablineclip} sets a new clipping region and then calls \samp{abline}. - If any of the four clipping limits is NULL, the values from \samp{par("usr")} - are substituted. After the call to \samp{abline}, the old clipping region - is restored. In order to make \samp{clip} work, there is a call to \samp{abline} that draws a line off the plot. - - Multiple lines of the same type can be drawn in a single call, but the clipping region must be the same for each group of lines. Thanks to Berry Boessenkool for pointing this out. -} -\value{ - None. Adds to the current plot. -} -\author{ Remko Duursma } -\seealso{\link{abline}, \link{clip}} -\examples{ - x <- rnorm(100) - y <- x + rnorm(100) - lmfit <- lm(y~x) - plot(x, y, xlim=c(-3.5, 3.5)) - ablineclip(lmfit, x1 = -2, x2 = 2, lty = 2) - ablineclip(h = 0, x1 = -2,x2 = 2,lty = 3, col = "red") - ablineclip(v = 0, y1 = -2.5, y2 = 1.5, lty=4, col = "green") -} -\keyword{ aplot } diff --git a/man/add.ps.Rd b/man/add.ps.Rd deleted file mode 100644 index 2996cdc..0000000 --- a/man/add.ps.Rd +++ /dev/null @@ -1,116 +0,0 @@ -\name{add.ps} -\alias{add.ps} -\title{ -add p-values from t-tests -} -\description{ - Adds p-values comparing the different cells at each x-axis position with a - reference cell. Uses a syntax similar to \samp{raw.means.plot2}. -} -\usage{ - add.ps(data, col.id, col.offset, col.x, col.value, fun.aggregate = "mean", - ref.offset = 1, prefixes,alternative = c("two.sided", "less", "greater"), - mu = 0, paired = FALSE, var.equal = FALSE, lty = 0, ...) -} -\arguments{ - \item{data}{ -A \samp{data.frame} -} - \item{col.id}{ -\samp{character} vector specifying the id column. -} - \item{col.offset}{ -\samp{character} vector specifying the offset column. -} - \item{col.x}{ -\samp{character} vector specifying the x-axis column. -} - \item{col.value}{ -\samp{character} vector specifying the data column. -} - \item{fun.aggregate}{ -Function or function name used for aggregating the results. Default is - \samp{"mean"}. -} - \item{ref.offset}{ - Scalar \samp{numeric} indicating the reference level to be tested against. - The default is 1 corresponding to \samp{levels(factor(d[,col.offset]))[1]}. -} - \item{prefixes}{ -\samp{character} vector of the indices for the p-values. If missing - corresponds to \samp{levels(factor(d.new[,col.offset]))[-ref.offset]}. -} - \item{alternative}{ -same as in \link{t.test} -} - \item{mu}{ -same as in \link{t.test} -} - \item{paired}{ -same as in \link{t.test} -} - \item{var.equal}{ -same as in \link{t.test} -} - \item{lty}{ -line type of axis, Default is 0 (i.e., no line). -} - \item{\dots}{ -further arguments passed to axis. -} -} -\details{ -This function computes t-tests comparing the values at each x-axis position - for each condition against the reference condition at and adds the p-values - to the axis. - -This functions uses the same syntax as \link{raw.means.plot2} and - should be used in addition to it. Note that values are ordered according to - the \samp{col.id} so \samp{paired = TRUE} should be fine. -} -\value{ -axis is plotted. -} -\author{ -Henrik Singmann -} - - -\seealso{ - \link{raw.means.plot} as the accompanying main functions. -} -\examples{ -\dontrun{ -#The examples uses the OBrienKaiser dataset from car and needs reshape. -# This extends the examples from raw.means.plot -require(reshape) -require(car) -data(OBrienKaiser) -OBKnew <- cbind(factor(1:nrow(OBrienKaiser)), OBrienKaiser) -colnames(OBKnew)[1] <- "id" -OBK.long <- melt(OBKnew) -OBK.long[, c("measurement", "time")] <- - t(vapply(strsplit(as.character(OBK.long$variable), "\\\."), "[", c("", ""))) - -# For this example the position at each x-axis are within-subject comparisons! -raw.means.plot2(OBK.long, "id", "measurement", "gender", "value") - add.ps(OBK.long, "id", "measurement", "gender", "value", paired = TRUE) - #reference is "fup" - -raw.means.plot2(OBK.long, "id", "measurement", "gender", "value") -add.ps(OBK.long, "id", "measurement", "gender", "value", ref.offset = 2, - paired = TRUE) #reference is "post" - -# Use R's standard (i.e., Welch test) -raw.means.plot2(OBK.long, "id", "treatment", "gender", "value") -add.ps(OBK.long, "id", "treatment", "gender", "value", - prefixes = c("p(control vs. A)", "p(control vs. B)")) - -# Use standard t-test -raw.means.plot2(OBK.long, "id", "treatment", "gender", "value") -add.ps(OBK.long, "id", "treatment", "gender", "value", var.equal = TRUE, - prefixes = c("p(control vs. A)", "p(control vs. B)")) - -} -} - diff --git a/man/addtable2plot.Rd b/man/addtable2plot.Rd deleted file mode 100644 index 29014ad..0000000 --- a/man/addtable2plot.Rd +++ /dev/null @@ -1,59 +0,0 @@ -\name{addtable2plot} -\alias{addtable2plot} -\title{Add a table of values to a plot} -\description{ - Displays a table of values at a user-specified position on an existing plot} -\usage{ - addtable2plot(x,y=NULL,table,lwd=par("lwd"),bty="n",bg=par("bg"), - cex=1,xjust=0,yjust=1,xpad=0.1,ypad=0.5,box.col=par("fg"),text.col=par("fg"), - display.colnames=TRUE,display.rownames=FALSE,hlines=FALSE,vlines=FALSE, - title=NULL) -} -\arguments{ - \item{x,y}{Either x and y coordinates to locate the table or an - \samp{xy.coords} object.} - \item{table}{A data frame, matrix or similar object that will be displayed.} - \item{lwd}{The line width for the box and horizontal dividers.} - \item{bty}{Whether to draw a box around the table ("o") or not ("n").} - \item{bg}{The background color for the table.} - \item{cex}{Character expansion for the table.} - \item{xjust,yjust}{Positioning for the table relative to \samp{x,y}.} - \item{xpad,ypad}{The amount of padding around text in the cells as a - proportion of the maximum width and height of the strings in each column.} - \item{box.col}{The color for the box and lines.} - \item{text.col}{The color for the text.} - \item{display.colnames}{Whether to display the column names in the table.} - \item{display.rownames}{Whether to display the row names in the table.} - \item{hlines}{Whether to draw horizontal lines between each row of the table.} - \item{vlines}{Whether to draw vertical lines between each column of the table.} - \item{title}{Optional title placed over the table.} -} -\value{nil} -\details{ - \samp{addtable2plot} displays the values in \samp{table} at a position in user - coordinates specified by \samp{x,y}. The two justification arguments, - \samp{xjust} and \samp{yjust} are the same as in the \samp{legend} function, - and \samp{addtable2plot} has been programmed to be as similar to \samp{legend} - as possible. The function now accepts the positional arguments such as - "topright" if passed as \samp{x}. The defaults are those that were most - popular in scientific journals at the time of programming. - - If \samp{bg} is a matrix of colors of the same dimensions as \samp{x}, those - colors will be the backgrounds of the cells. The default is no background color. -} -\author{Original by John Kane, mods by Jim Lemon and Brian Diggs. Thanks to - Andrija Djurovic for asking for the individual cell colors and Gabor Grothendieck - for alerting me to the problem of widely varying column widths.} -\seealso{\link{legend}} -\examples{ - testdf <- data.frame(Before = c(10, 7, 5, 9), During = c(8, 6, 2, 5), - After = c(5, 3, 4, 3)) - rownames(testdf) <- c("Red", "Green", "Blue", "Lightblue") - barp(testdf, main = "Test addtable2plot", ylab = "Value", - names.arg = colnames(testdf), col = 2:5) - # show most of the options including the christmas tree colors - abg <- matrix(c(2, 3, 5, 6, 7, 8), nrow=4, ncol=3) - addtable2plot(2, 8, testdf, bty = "o", display.rownames = TRUE, hlines = TRUE, - vlines = TRUE, title = "The table", bg = abg) -} -\keyword{misc} diff --git a/man/arctext.Rd b/man/arctext.Rd deleted file mode 100644 index ed291cc..0000000 --- a/man/arctext.Rd +++ /dev/null @@ -1,55 +0,0 @@ -\name{arctext} -\title{Display text on a circular arc} -\description{Displays a character string on the circumference of an imaginary - circle on an existing plot.} -\usage{ - arctext(x,center=c(0,0),radius=1,start=NULL,middle=pi/2,end=NULL,stretch=1, - clockwise=TRUE,cex=NULL,...) -} -\alias{arctext} -\arguments{ - \item{x}{A character string.} - \item{center}{The center of the circular arc in x/y user units.} - \item{radius}{The radius of the arc in user units.} - \item{start}{The starting position of the string in radians.} - \item{middle}{The middle position of the string in radians.} - \item{end}{The end position of the string in radians.} - \item{stretch}{How much to stretch the string for appearance.} - \item{clockwise}{Whether to print the string in the clockwise direction.} - \item{cex}{The character expansion factor.} - \item{...}{additional arguments passed to \samp{text}.} -} -\details{ - \samp{arctext} displays a string along a circular arc, rotating each - letter. This may not work on all devices, as not all graphic devices - can rotate text to arbitrary angles. The output looks best on a - Postscript or similar device that can rotate text without distortion. - Rotated text often looks very ragged on small bitmaps. - - If the user passes a value for - \samp{start}, this will override any value passed to \samp{middle}. - If the plot area is not square, see \samp{par(pty="s")}, the arc will - be somewhat elliptical. - - If the \samp{clockwise} argument is TRUE, the string will be displayed - in a clockwise direction and the orientation of the characters will be - rotated \samp{pi} radians (180 degrees). This is useful when the string - is to be displayed on the bottom of the circumference. -} -\value{nil} -\author{Jim Lemon - Thanks to Suhas Parandekar for the idea, Ted Toal - for greatly improving the placement of the text and Andy South for - providing the initial code for the clockwise argument.} -\seealso{\link{text}} -\examples{ - plot(0, xlim = c(1, 5),ylim = c(1, 5),main = "Test of arctext", xlab = "", - ylab = "", type = "n") - arctext("bendy like spaghetti", center = c(3,3), col = "blue") - arctext("bendy like spaghetti", center = c(3,3), radius = 1.5, start = pi, - cex = 2) - arctext("bendy like spaghetti", center = c(3, 3),radius = 0.5, - start = pi/2, stretch = 1.2) - arctext("bendy like spaghetti", center = c(3, 3), radius = 1.7, - start = 4 * pi / 3, cex = 1.3, clockwise = FALSE) -} -\keyword{misc} diff --git a/man/axis.break.Rd b/man/axis.break.Rd deleted file mode 100644 index 8976e28..0000000 --- a/man/axis.break.Rd +++ /dev/null @@ -1,47 +0,0 @@ -\name{axis.break} -\alias{axis.break} -\title{ Place a "break" mark on an axis } -\description{ - Places a "break" mark on an axis on an existing plot. -} -\usage{ - axis.break(axis=1,breakpos=NULL,pos=NULL,bgcol="white",breakcol="black", - style="slash",brw=0.02) -} -\arguments{ - \item{axis}{which axis to break} - \item{breakpos}{where to place the break in user units} - \item{pos}{position of the axis (see \link{axis}).} - \item{bgcol}{the color of the plot background} - \item{breakcol}{the color of the "break" marker} - \item{style}{Either \samp{gap}, \samp{slash} or \samp{zigzag}} - \item{brw}{break width relative to plot width} -} -\value{nil} -\details{ - The \samp{pos} argument is not needed unless the user has specified a - different position from the default for the axis to be broken. -} -\note{ - There is some controversy about the propriety of using discontinuous - coordinates for plotting, and thus axis breaks. Discontinuous coordinates - allow widely separated groups of values or outliers to appear without - devoting too much of the plot to empty space. The major objection seems - to be that the reader will be misled by assuming continuous coordinates. - The \samp{gap} style that clearly separates the two sections of the plot - is probably best for avoiding this. -} -\author{Jim Lemon and Ben Bolker} -\seealso{\link{gap.plot}} -\examples{ - plot(3:10, main = "Axis break test") - # put a break at the default axis and position - axis.break() - axis.break(2, 2.9, style = "zigzag") - twogrp <- c(rnorm(10) + 4, rnorm(10) + 20) - gap.plot(twogrp,gap = c(8,16), xlab = "Index", ylab = "Group values", - main = "Two separated groups with gap axis break", - col = c(rep(2, 10), rep(3, 10)), ytics = c(3, 5, 18, 20)) - legend(12, 6, c("Low group", "High group"), pch = 1, col = 2:3) -} -\keyword{misc} diff --git a/man/axis.mult.Rd b/man/axis.mult.Rd deleted file mode 100644 index a85b2aa..0000000 --- a/man/axis.mult.Rd +++ /dev/null @@ -1,47 +0,0 @@ -\name{axis.mult} -\alias{axis.mult} -\title{ Display an axis with values having a multiplier } -\description{ - An axis is displayed on an existing plot where the tick values are divided - by a multiplier and the multiplier is displayed next to the axis. -} -\usage{ - axis.mult(side=1,at=NULL,labels,mult=1,mult.label,mult.line, - mult.labelpos=NULL,...) -} -\arguments{ - \item{side}{which side to display} - \item{at}{where to place the tick marks - defaults to \samp{axTicks()}} - \item{labels}{tick labels - defaults to at/mult} - \item{mult}{the multiplier factor} - \item{mult.label}{the label to show the multiplier - defaults to "x mult"} - \item{mult.line}{the margin line upon which to show the multiplier} - \item{mult.labelpos}{where to place \samp{mult.label} - defaults to centered - and outside the axis tick labels} - \item{...}{additional arguments passed to \samp{axis}.} -} -\value{nil} -\details{ - \samp{axis.mult} automates the process of displaying an axis with a - multiplier applied to the tick values. By default it will divide the - default axis tick labels by \samp{mult} and place \samp{mult.label} - where \samp{xlab} or \samp{ylab} would normally appear. Thus the plot - call should set the relevant label to an empty string in such cases. - It is simplest to call \samp{plot} with \samp{axes=FALSE} and then - display the box and any standard axes before calling \samp{axis.mult}. -} -\note{ - While \samp{axis.mult} will try to display an axis on any side, the top - and right margins will require adjustment using \samp{par} for - \samp{axis.mult} to display properly. -} -\author{Jim Lemon} -\seealso{\link{axis}, \link{mtext}} -\examples{ - plot(1:10 * 0.001, 1:10 * 100,axes = FALSE, xlab = "", ylab = "", - main = "Axis multipliers") - box() - axis.mult(1, mult = 0.001) - axis.mult(2, mult = 100) -} -\keyword{misc} diff --git a/man/barNest.Rd b/man/barNest.Rd deleted file mode 100644 index 5a5a9e4..0000000 --- a/man/barNest.Rd +++ /dev/null @@ -1,159 +0,0 @@ -\name{barNest} -\alias{barNest} -\title{Display a nested breakdown of numeric values} -\description{Breaks down the elements of a data frame by one or more - categorical elements and displays the breakdown as a bar plot.} -\usage{ - barNest(formula=NULL,data=NULL,FUN=c("mean","sd","sd","valid.n"),ylim=NULL, - main="",xlab="",ylab="",shrink=0.1,errbars=FALSE,col=NA, - labelcex=1,lineht=NULL,showall=TRUE,Nwidths=FALSE,barlabels=NULL, - showlabels=TRUE,mar=NULL,arrow.cap=NULL,trueval=TRUE) -} -\arguments{ - \item{formula}{A formula with a numeric element of a data frame on the left and - one or more categorical elements on the right.} - \item{data}{A data frame containing the elements in \samp{formula}.} - \item{FUN}{The functions to apply to x.} - \item{ylim}{Optional y limits for the plot, usually necessary for counts.} - \item{main}{Title for the plot.} - \item{xlab,ylab}{Axis labels for the plot. The x axis label is typically blank} - \item{shrink}{The proportion to shrink the width of the bars at each level.} - \item{errbars}{Whether to display error bars on the lowest level of breakdown.} - \item{col}{The colors to use to fill the bars. See Details.} - \item{labelcex}{Character size for the group labels.} - \item{lineht}{The height of a line of text in the lower margin of the plot in user - units. This will be calculated by the function if a value is not passed.} - \item{showall}{Whether to display bars for the entire breakdown.} - \item{Nwidths}{Whether to scale the widths of the bars to the number of - observations.} - \item{barlabels}{Optional group labels that may be useful if the factors used to - break down the numeric variable are fairly long strings.} - \item{showlabels}{Whether to display the labels below the bars.} - \item{mar}{If not NULL, a four element vector to set the plot margins. If new - margins are set, the user must reset the margins after the function exits.} - \item{arrow.cap}{The width of the "cap" on error bars in user units, - calculated on the basis of the number of bars in the final breakdown if NA.} - \item{trueval}{If this is not NA, the call to \samp{brkdnNest} will return the - proportions of the response variable that are equal to \samp{trueval}. - See Details.} -} -\value{The summary list produced by brkdnNest.} -\details{ - \samp{barNest} displays a bar plot illustrating the hierarchic breakdown of - the elements of a data frame. The breakdown is performed by \samp{brkdnNest} - and the actual display is performed by \samp{drawNestedBars}. The heights of - the bars will be proportional to the values returned by the first function in - \samp{FUN}. If \samp{showall} is TRUE, the entire nested breakdown will be - displayed. This can be useful in visualizing the relationship between groups - and subgroups in a compact format. - - \samp{barNest} assumes that there will be four breakdowns in the list - returned by \samp{brkdnNest} in the order summary measure, upper dispersion - value, lower dispersion value and number of valid observations. If - \samp{Nwidths=FALSE}, it may work with only three and if \samp{errbars=FALSE} - as well, it may work with only one. - - If \samp{Nwidths=TRUE}, the bar widths will be scaled to the relative number - of observations per group. When the numbers of observations are very different, - the labels for those bars with small numbers of observations will probably - overlap. - - A number of functions can be passed in the \samp{FUN} argument. Three - functions, \samp{propbrk}, \samp{sumbrk} and \samp{valid.n} will work as - summary measures, giving proportions or sums of particular values of a - discrete variable and counts in each group and subgroup respectively. - Binomial confidence limits can be added to the proportions returned by - \samp{propbrk} with \samp{binciWl} and \samp{binciWu} as in the second last - example. If \samp{valid.n} is the first element of \samp{FUN}, the "overall" - bar and label will be suppressed, as they are not informative. It is up to - the user to decide whether any "error bars" displayed are meaningful. - - The colors of the bars are determined by \samp{col}. If \samp{showall} is - FALSE, the user only need pass a vector of colors, usually the same length - as the number of categories in the final (last on the right side) element in - the formula. If \samp{showall} is TRUE and the user wants to color all of the - bars, a list with as many elements as there are levels in the breakdown - should be passed. Each element should be a vector of colors, again usually - the same length as the number of categories. As the categorical variables are - likely to be factors, it is important to remember that the colors must be in - the correct order for the levels of the factors. When the levels are not in - the default alphanumeric order, it is quite easy to get this wrong. As a - \samp{barNest} plot with more than a few factors and levels in each factor is - quite dense, easily distinguished colors for each level of the breakdown may - be preferable. As with some other plots, trying to cram too much information - into a single illustration may not work well. -} -\author{Jim Lemon and Ofir Levy} -\references{ - Lemon, J. & Levy, O. (2011) barNest: Illustrating nested summary measures. - Statistical Computing and Graphics Newsletter of the American Statistical - Association, 21(2): 5-10. -} -\seealso{\link{brkdnNest}, \link{drawNestedBars}, superbarplot(UsingR)} -\examples{ - # recreate the Titanic data frame and show the three way breakdown - titanic<-data.frame( - class=c(rep("1st",325),rep("2nd",285),rep("3rd",706),rep("Crew",885)), - age=c(rep("Adult",319),rep("Child",6),rep("Adult",261),rep("Child",24), - rep("Adult",627),rep("Child",79),rep("Adult",885)), - sex=c(rep("M",175),rep("F",144),rep("M",5),rep("F",1), - rep("M",168),rep("F",93),rep("M",11),rep("F",13), - rep("M",462),rep("F",165),rep("M",48),rep("F",31), - rep("M",862),rep("F",23)), - survived=c(rep("Yes",57),rep("No",118),rep("Yes",140),rep("No",4),rep("Yes",6), - rep("Yes",14),rep("No",154),rep("Yes",80),rep("No",13),rep("Yes",24), - rep("Yes",75),rep("No",387),rep("Yes",76),rep("No",89), - rep("Yes",13),rep("No",35),rep("Yes",14),rep("No",17), - rep("Yes",192),rep("No",670),rep("Yes",20),rep("No",3))) - require(plotrix) - titanic.colors<-list("gray90",c("#0000ff","#7700ee","#aa00cc","#dd00aa"), - c("#ddcc00","#ee9900"),c("pink","lightblue")) - barNest(survived~class+age+sex,titanic,col=titanic.colors,showall=TRUE, - main="Titanic survival by class, age and sex",ylab="Proportion surviving", - FUN=c("propbrk","binciWu","binciWl","valid.n"),shrink=0.15,trueval="Yes") - barNest(survived~class+age+sex,titanic,col=titanic.colors,showall=TRUE, - main="Titanic survival by class, age and sex (scaled bar widths)", - ylab="Proportion surviving",FUN=c("propbrk","binciWu","binciWl","valid.n"), - shrink=0.15,trueval="Yes",Nwidths=TRUE) - # now show the actual numbers of passengers - barNest(survived~class+age+sex,titanic,col=titanic.colors,showall=TRUE, - main="Titanic passengers and crew by class, age and sex", - ylab="Number",FUN="valid.n",shrink=0.15) - # to see this properly displayed, start a wide plot window - # x11(width=10) - test.df<-data.frame(Age=rnorm(100,35,10), - Sex=sample(c("Male","Female"),100,TRUE), - Marital=sample(c("Div","Mar","Sing","Wid"),100,TRUE), - Employ=sample(c("FT","PT","Un"),100,TRUE)) - test.col<-list(Overall="gray",Sex=c("pink","lightblue"), - Marital=c("mediumpurple","orange","tan","lightgreen"), - Employ=c("#1affd8","#caeecc","#ff90d0")) - barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Mean age (years)", - main="Mean age by subgroups",errbars=TRUE,col=test.col) - barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Mean age (years)", - main="Mean age by subgroups (widths scaled to Ns)",errbars=TRUE,col=test.col, - Nwidths=TRUE) - # set up functions for 20th and 80th percentiles - q20<-function(x,na.rm=TRUE) return(quantile(x,probs=0.2,na.rm=TRUE)) - q80<-function(x,na.rm=TRUE) return(quantile(x,probs=0.8,na.rm=TRUE)) - # show the asymmetric dispersion measures - barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Mean age (years)", - main="Use median and quantiles for dispersion", - FUN=c("median","q80","q20","valid.n"), - errbars=TRUE,col=test.col) - barNest(formula=Employ~Sex+Marital,data=test.df,ylab="Proportion unemployed", - main="Proportion unemployed by sex and marital status", - FUN=c("propbrk","binciWu","binciWl","valid.n"), - errbars=TRUE,col=test.col,trueval="Un") - barNest(formula=Employ~Sex+Marital,data=test.df,ylab="Proportion unemployed", - main="Proportion unemployed by sex and marital status (scaled bar widths)", - FUN=c("propbrk","binciWu","binciWl","valid.n"), - errbars=TRUE,col=test.col,trueval="Un",Nwidths=TRUE) - barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Counts", - main="Show the counts in subgroups (final level only)",FUN="valid.n", - col=test.col,showall=FALSE,ylim=c(0,10)) - barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Counts", - main="Show all the counts in subgroups",FUN="valid.n",mar=c(5,5,4,2), - col=test.col) - } -\keyword{misc} diff --git a/man/barlabels.Rd b/man/barlabels.Rd deleted file mode 100644 index 8db8a94..0000000 --- a/man/barlabels.Rd +++ /dev/null @@ -1,50 +0,0 @@ -\name{barlabels} -\alias{barlabels} -\title{Label the bars on a barplot} -\description{Displays labels on a plot, usually a bar plot.} -\usage{ - barlabels(xpos,ypos,labels=NULL,cex=1,prop=0.5,miny=0,offset=0,nobox=FALSE,...) -} -\arguments{ - \item{xpos}{A vector, matrix or data frame of x positions for the labels.} - \item{ypos}{A vector, matrix or data frame of y values for the labels.} - \item{labels}{The labels to display. Defaults to the values of ypos.} - \item{cex}{Relative size of the labels. See \samp{text}.} - \item{prop}{The proportion of \samp{ypos} at which to place the labels. - Defaults to 0.5 (the middle).} - \item{miny}{The minimum value at which to display labels.} - \item{offset}{Amount to horizontally offset successive labels in case - of vertical overlaps.} - \item{nobox}{Whether to call \samp{boxed.labels} or \samp{text}.} - \item{...}{Extra arguments passed to \samp{boxed.labels} or \samp{text}.} -} -\details{ - \samp{barlabels} places labels on a plot at horizontal positions \samp{xpos} - and vertical positions \samp{ypos} * \samp{prop}. The typical use of this - function is to place labels on bars, by default in the middle of the bars. - - To put labels just over the tops of the bars, set \samp{prop} to 1 and add a - constant amount to \samp{ypos}. -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{boxed.labels}} -\examples{ - heights<-c(14,20,9,31,17) - barpos<-barplot(heights,main="A redundant bar plot") - # show the usual value labels on the bars - barlabels(barpos,heights) - # now with stacked bars and offsets - heights<-matrix(sample(c(1,2,10,15),20,TRUE),ncol=4) - barpos<-barplot(heights,main="A redundant stacked bar plot") - barlabels(barpos,heights,offset=0.1) - # do it again without stacking - barpos<-barplot(heights,main="An unstacked redundant bar plot", - beside=TRUE) - barlabels(barpos,heights) - # finally use barp for the plot - barpos<-barp(heights,main="A fourth and final bar plot",col=2:6, - names.arg=paste("Day",1:4)) - barlabels(barpos$x,barpos$y,matrix(LETTERS[1:5],nrow=5,ncol=4)) -} -\keyword{misc} diff --git a/man/barp.Rd b/man/barp.Rd deleted file mode 100644 index c15e50f..0000000 --- a/man/barp.Rd +++ /dev/null @@ -1,156 +0,0 @@ -\name{barp} -\alias{barp} -\title{A bar plotting routine} -\description{Display a bar plot} -\usage{ - barp(height,width=0.4,names.arg=NULL,legend.lab=NULL,legend.pos=NULL, - col=NULL,border=par("fg"),main=NULL,xlab="",ylab="",xlim=NULL,ylim=NULL, - x=NULL,staxx=FALSE,staxy=FALSE, height.at=NULL,height.lab=NULL, - cex.axis=par("cex.axis"),pch=NULL,cylindrical=FALSE,shadow=FALSE, - do.first=NULL,ylog=FALSE,srt=NULL,...) -} -\arguments{ - \item{height}{A numeric vector, matrix or data frame that will be represented - as the heights of bars.} - \item{width}{Half the width of a single bar or group of bars in X axis units.} - \item{names.arg}{The labels for the bars or groups of bars.} - \item{legend.lab}{Labels for an optional legend. If NULL, no legend is - displayed.} - \item{legend.pos}{Optional position for the legend as a list with \samp{x} - and \samp{y} components. If this is NULL, \samp{locator} will be called.} - \item{col}{The fill colors for the bars. The default is no fill.} - \item{border}{The border for the bars.} - \item{main}{The title at the top of the plot.} - \item{xlab,ylab}{The labels for the X and Y axes respectively.} - \item{xlim,ylim}{Optional horizontal and vertical limits for the plot.} - \item{x}{Optional horizontal positions for the bars. Defaults to 1:length(height).} -\item{staxx,staxy}{Whether to use \link{staxlab} to stagger the - X or Y axis tick labels. Can also omit the X or Y axes.} - \item{height.at}{Optional positions of the tick marks on the Y axis.} - \item{height.lab}{Optional tick labels for the Y axis.} - \item{cex.axis}{Character expansion for the axis labels.} - \item{pch}{Symbol(s) to fill the bars. See Details.} - \item{cylindrical}{Whether to give the bars a cylindrical appearance - by shading them.} - \item{shadow}{Whether to place a shadow behind the bars.} - \item{do.first}{An optional string that will be evaluated before anything - else is displayed on the plot. Useful for background colors or lines.} - \item{ylog}{Logical for whether a log scale is to be used. see details.} - \item{srt}{Rotation of axis labels if staxx or staxy is TRUE (see - \samp{staxlab}).} - \item{...}{arguments passed to \samp{plot}}. -} -\value{ - A list containing two components of the same form as \samp{height}: - \item{x}{The centers of the bars displayed.} - \item{y}{The heights of the bars.} -} -\details{ - \samp{barp} displays a bar plot similar to \samp{barplot} but with axes and - horizontal bar positions more like \samp{plot}. Bars or groups of bars are - centered on integral X values by default, and so both the width and spacing of - the bars are controlled by a single number. If the user passes explicit \samp{x} - values, those values will determine the spacing. If \samp{height} is a vector, - single bars representing each value will be displayed centered at - \samp{1:length(height)} unless the user has specified \samp{x} values. - If \samp{height} is a matrix, 2D array, or data frame, a group of bars will be - drawn for each column, with the values of the group taken from the rows of that - column. Explicit x values cannot be used with a matrix, however, by adjusting the - values of x, grouped bars can be displayed. - - The values from \samp{freq} or \samp{brkdn} in the prettyR package can - be used as the \samp{height} argument. The value from \samp{table} can also be - passed as \samp{height}, as can a 2D array returned from the \samp{by} function. - - Bars are empty by default but fill colors can be defined in several ways. - If a single color is passed, all bars will be the same color. If \samp{height} - is a vector, colors will be recycled or some will be ignored if the length of - \samp{col} is - not equal to that of \samp{height}. If \samp{height} is a matrix or data frame, - the user may pass a vector of colors equal to the number of rows in \samp{height} - or a matrix of colors of the same dimensions as \samp{height}. Other sequences - of color will probably not result in an easy to interpret plot. - - \samp{barp} is intended to simplify illustrating categorical data for which both - the variable designations and the categories are names, as on many multiple - choice questions. \samp{height.at} and \samp{height.lab} allow the user to place - labels on the vertical axis, usually representing the options. If \samp{staxx} - or \samp{staxy} are TRUE, the labels on the horizontal or vertical axes - respectively will be staggered, allowing the user to use many or lengthy variable - or value labels. If \samp{srt} is not NULL, these labels will be rotated - counterclockwise by that value as angles in degrees instead of staggered. - - If \samp{staxx} or \samp{staxy} are set to NA, the respective axis will not - be displayed. - - \samp{barp} allows two enhancements that may be useful in those areas where fancy - plots are appreciated. One is to give the bars a cylindrical look by shading the - color. The other is to place an apparent shadow behind each bar. Both of these - effects appear as though the light is coming from the upper left, and this is - hard coded. You can add error bars by calling \samp{dispersion}, but many advise - against this. - - If \samp{legend.lab} is not NULL, a legend will be displayed. If - \samp{legend.pos} is NULL, \samp{locator} is called to place the legend. On - Windows, the alert may not appear on the console, and the function will - appear to hang unless the user clicks on the console window or the plot. - - The \samp{ylog} argument produces a log scale on the y axis. Currently, - neither \samp{pretty} nor \samp{axTicks} seems to produce a nice set of axis - ticks, so it is best to pass the positions of these in \samp{height.at}. - - If the \samp{pch} argument is not NULL, barp will display white bars filled - with the symbols specified in \samp{pch}. With grouped bars, this must be a - matrix with the same form as the \samp{col} argument. This option allows a - black and white bar plot to be produced. -} -\author{Jim Lemon} -\seealso{\link{staxlab}, \link{barplot}, \link{cylindrect}, - \link{gradient.rect}} -\examples{ - # get some extra room on the left - par(mar=c(5,5,4,2)) - # make up some happiness data, as so many seem to do - happyday<-data.frame(Monday=c(2.3,3.4),Tuesday=c(2.8,3.3),Wednesday=c(3.2,3.1), - Thursday=c(3.6,2.8),Friday=c(4.2,2.6),Saturday=c(4.5,2.9),Sunday=c(4.1,2.8)) - happylabels<-c("Utterly dashed","Rather mopey","Indifferent","Somewhat elated", - "Euphoric") - barp(happyday,names.arg=names(happyday),legend.lab=c("Slaves","Unemployed"), - legend.pos=list(x=2,y=4.5),col=c("#ee7700","#3333ff"),main="9AM happiness by weekday", - xlab="Day of week",ylab="Happiness rating",ylim=c(1,5),staxx=TRUE,staxy=TRUE, - height.at=1:5,height.lab=happylabels,cex.axis=0.9,cylindrical=TRUE, - shadow=TRUE) - # now do a plot with colors scaled to the sex ratio (real data!) - sexratio<-c(0.24,0.35,0.09,0.59,0.63,0.34,0.7,0.6) - # the fun ratings are once again a pack of lies - funrating<-c(3.2,3.5,1.5,5.4,4.5,2.7,6.8,4.9) - funstudy<-c("Astronomy","Chemistry","Economics","Anthropology","Linguistics", - "Math/Stats","Psychology","Sociology") - funlabels<-c("Torture","Agony","Boredom","Neutral","Entertaining","Exhilarating", - "Maniacal") - # xrange is used to get the colors to match the 0-100% scale - barp(funrating,names.arg=funstudy,main="Fun ratings for various areas of study", - col=color.scale(sexratio,c(0.2,1),c(0.2,0.4),c(1,0.4),xrange=c(0,1)), - xlab="Study",ylab="Rating",height.at=1:7,height.lab=funlabels,ylim=c(1,7), - staxx=TRUE,staxy=TRUE,cex.axis=0.9) - # here we want the full scale from zero to one - color.legend(2,6,4,6.4,legend=c("100\% guys","100\% girls"), - rect.col=color.scale(seq(0,1,by=0.25),c(0.2,1),c(0.2,0.4),c(1,0.4))) - par(mar=c(5,4,4,2)) - # use barp to display a multiple histogram with a shaded background - # notice how the expression uses local variables inside the barp function - gradbg<-"gradient.rect(xlim[1],ylim[1],xlim[2],ylim[2], - c(1,0.5,1),c(1,0.5,1),c(1,0.5,1),gradient=\"y\",nslices=100)" - h1<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2))) - h2<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2))) - h3<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2))) - hmat<-matrix(c(h1,h2,h3),nrow=3,byrow=TRUE) - barp(hmat,names.arg=names(h1),width=0.45,col=2:4,do.first=gradbg, - main="Multiple histogram using barp",xlab="Bins",ylab="Frequency") - legend(3.8,50,c("h1","h2","h3"),fill=2:4) - # now display a positive/negative plot - barp(c(2,-3,4,-5,6,-7,8),main="Positive/negative plot", - xlab="Alternating colors",ylab="For alternating values", - col=2+(c(2,-3,4,-5,6,-7,8)>0)) -} -\keyword{misc} diff --git a/man/battleship.plot.Rd b/man/battleship.plot.Rd deleted file mode 100644 index 349bfa3..0000000 --- a/man/battleship.plot.Rd +++ /dev/null @@ -1,48 +0,0 @@ -\name{battleship.plot} -\alias{battleship.plot} -\title{Display a matrix of values as the widths of stacked rectangles} -\usage{ - battleship.plot(x,mar=c(2,5,5,1),col="white",border="black", - main="",xlab="",ylab="",xaxlab=NULL,yaxlab=NULL,cex.labels=1, - maxxspan=0.45,maxyspan=0.45) -} -\arguments{ - \item{x}{A matrix or data frame containing numeric values. See the example.} - \item{mar}{Margins for the plot.} - \item{col}{The fill colors for the rectangles.} - \item{border}{The border colors for the rectangles.} - \item{main}{The title for the plot (i.e. \samp{main}).} - \item{xlab,ylab}{The x and y axis labels.} - \item{xaxlab,yaxlab}{Optional labels for the rows and columns.} - \item{cex.labels}{Character expansion for the row and column labels.} - \item{maxxspan,maxyspan}{Scaling factor for the widths and heights of the - rectangles so that they don't overlap.} -} -\description{ - \samp{battleship.plot} displays a matrix of rectangles, with widths - proportional to the values in \samp{x}. The values are scaled so that half the - width of the largest rectangle is equal to \samp{maxxspan} in user units. This - prevents the rectangles from overlapping. The user can adjust the spacing of the - stacks of rectangles by changing \samp{maxxspan}. Similarly, maxyspan controls - the spacing between rectangles in the vertical direction. - - The labels for each stack of plots (the columns of x) are displayed at the top - of the plot, angled at 45 degrees. The labels for each row of rectangles in the - stacks (the rows of x) are displayed at the left. Long labels for either may - require adjusting the \samp{mar} argument. - - The function will try to extract the labels \samp{xaxlab} and \samp{yaxlab} from - the matrix column and row names respectively if none are passed. -} -\value{nil} -\author{Jim Lemon - thanks to Adam Maltese for the suggestion} -\keyword{misc} -\seealso{\link{plot}, \link{staxlab}} -\examples{ - x<-matrix(sample(10:50,100,TRUE),10) - xaxlab=c("One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten") - yaxlab=c("First","Second","Third","Fourth","Fifth","Sixth","Seventh", - "Eighth","Ninth","Tenth") - battleship.plot(x,xlab="The battle has just begun",main="Battleship1", - xaxlab=xaxlab,yaxlab=yaxlab) -} diff --git a/man/bin.wind.records.Rd b/man/bin.wind.records.Rd deleted file mode 100644 index a410651..0000000 --- a/man/bin.wind.records.Rd +++ /dev/null @@ -1,35 +0,0 @@ -\name{bin.wind.records} -\alias{bin.wind.records} -\title{Classify wind direction and speed records} -\description{Classifies wind direction and speed records into a matrix of - percentages of observations in speed and direction bins.} -\usage{ - bin.wind.records(winddir,windspeed,ndir=8,radians=FALSE, - speed.breaks=c(0,10,20,30)) -} -\arguments{ - \item{winddir}{A vector of wind directions.} - \item{windspeed}{A vector of wind speeds corresponding to the above - directions.} - \item{ndir}{Number of direction bins in a compass circle.} - \item{radians}{Whether wind directions are in radians.} - \item{speed.breaks}{Minimum wind speed for each speed bin.} -} -\details{ - \samp{bin.wind.records} bins a number of wind direction and speed - records into a matrix of percentages of observations that can be used to - display a cumulative wind rose with \samp{oz.windrose} The defaults are those - used by the Australian Bureau of Meteorology. -} -\value{ - A matrix of percentages in which the rows represent wind speed categories and - the columns represent wind direction categories. -} -\author{Jim Lemon} -\seealso{\link{oz.windrose}} -\examples{ - winddir<-sample(0:360,100,TRUE) - windspeed<-sample(0:40,100,TRUE) - bin.wind.records(winddir,windspeed) -} -\keyword{misc} diff --git a/man/binciW.Rd b/man/binciW.Rd deleted file mode 100644 index e644848..0000000 --- a/man/binciW.Rd +++ /dev/null @@ -1,28 +0,0 @@ -\name{binciW} -\alias{binciW} -\title{Binomial confidence limits} -\description{ - Calculates binomial confidence limits using the Wilson approximation. -} -\usage{ - binciW(x,n,alpha=0.05,cc=FALSE) -} -\arguments{ - \item{x}{The number of successes or failures for which the CI is to be calculated.} - \item{n}{The number of trials as above.} - \item{alpha}{The desired coverage - 0.05 produces 95 percent coverage} - \item{cc}{Whether to apply a continuity correction} -} -\details{ - \samp{binciW} calculates binomial confidence limits for the - given number of successes and trials. It is mainly to allow binomial - confidence limits to be calculated in the \samp{brkdnNest} function, - which is why the upper and lower CIs are called separately. -} -\value{The lower and upper binomial confidence limits} -\author{Jim Lemon} -\seealso{\link{binciWl}, \link{binciWu}} -\examples{ - binciW(5,42) -} -\keyword{misc} diff --git a/man/binciWl.Rd b/man/binciWl.Rd deleted file mode 100644 index ace3235..0000000 --- a/man/binciWl.Rd +++ /dev/null @@ -1,26 +0,0 @@ -\name{binciWl} -\alias{binciWl} -\title{Lower binomial confidence limit} -\description{ - Returns the lower binomial confidence limit using the Wilson approximation. -} -\usage{ - binciWl(x,n,alpha=0.05,trueval=TRUE,na.rm=TRUE) -} -\arguments{ - \item{x}{The number of successes or failures for which the CI is to be calculated.} - \item{n}{The number of trials as above.} - \item{alpha}{The desired coverage - 0.05 produces 95 percent coverage} - \item{trueval}{The value representing the outcome of interest for the CI.} - \item{na.rm}{Argument needed to make this work} -} -\details{ - \samp{binciWl} now calls \samp{binciW} and returns the lower limit. -} -\value{The lower binomial confidence limit} -\author{Jim Lemon} -\seealso{\link{binciWu}} -\examples{ - binciWl(c(rep(5,TRUE),rep(37,FALSE))) -} -\keyword{misc} diff --git a/man/binciWu.Rd b/man/binciWu.Rd deleted file mode 100644 index 2b20e80..0000000 --- a/man/binciWu.Rd +++ /dev/null @@ -1,26 +0,0 @@ -\name{binciWu} -\alias{binciWu} -\title{Upper binomial confidence limit} -\description{ - Returns the upper binomial confidence limit using the Wilson approximation. -} -\usage{ - binciWu(x,n,alpha=0.05,trueval=TRUE,na.rm=TRUE) -} -\arguments{ - \item{x}{The number of successes or failures for which the CI is to be calculated.} - \item{n}{The number of trials as above.} - \item{alpha}{The desired coverage - 0.05 produces 95 percent coverage} - \item{trueval}{The value representing the outcome of interest for the CI.} - \item{na.rm}{Argument needed to make this work} -} -\details{ - \samp{binciWu} now calls \samp{binciW} and returns the upper limit. -} -\value{The upper binomial confidence interval} -\author{Jim Lemon} -\seealso{\link{binciWl}} -\examples{ - binciWl(c(rep(5,TRUE),rep(37,FALSE))) -} -\keyword{misc} diff --git a/man/box.heresy.Rd b/man/box.heresy.Rd deleted file mode 100644 index cdff26d..0000000 --- a/man/box.heresy.Rd +++ /dev/null @@ -1,80 +0,0 @@ -\name{box.heresy} -\alias{box.heresy} -\title{Display a sort of box plot} -\usage{ - box.heresy(x,y,uinner,linner,ulim,llim,boxwidth=NULL, - intervals=FALSE,arrow.cap=NULL,pch=22,main="",xlab="",ylab="", - xaxlab=NULL,col="white",do.first=NULL,...) -} -\arguments{ - \item{x,y}{Vectors of numeric values representing measures of central tendency.} - \item{uinner,linner}{Vectors of numeric values representing "inner" measures of - dispersion.} - \item{ulim,llim}{Vectors of numeric values representing "outer" measures of - dispersion.} - \item{boxwidth}{Optional widths for the boxes.} - \item{intervals}{Whether the values for dispersion are intervals (TRUE) or - absolute limits (FALSE).} - \item{arrow.cap}{The width of the cap on the "whiskers" relative to the width - of the plot. Defaults to the same width as the outer box.} - \item{pch}{The symbol to be used to represent the measure(s) of central tendency - in the box.} - \item{main}{The title for the plot (i.e. \samp{main}).} - \item{xlab,ylab}{The x and y axis labels.} - \item{xaxlab}{Optional labels for the boxes.} - \item{col}{The fill colors for the "inner" rectangles.} - \item{do.first}{An expression that will be evaluated before anything is displayed.} - \item{...}{additional arguments passed to the \samp{dispersion} function.} -} -\description{ - \samp{box.heresy} displays a box plot in which a symbol represents a measure of - central tendency, a surrounding box that represents an "inner" measure of dispersion - (e.g. standard error) and whiskers represent an "outer" measure of dispersion - (e.g. standard deviation). The function is pretty basic at this time and will - probably change a bit. - - The argument "intervals" is particularly important, and can wreak - havoc on the resulting plot. The default of FALSE means that the - values passed to the inner and outer measures of dispersion are - absolute, not intervals away from the measure of central tendency. - Mixing absolute and relative values will always lead to errors and - typically a very strange looking plot. It is probably easiest to - calculate the absolute values before calling box.heresy. The first and - second examples show how intervals=FALSE and intervals=TRUE can be used. - - One of the first changes is to allow varying box widths. The user can specify - the box widths as a vector of numeric values at least as long as the number - of boxes to be displayed. The usual reason for doing this is to display widths - that are proportional to the number of observations. A useful start is to pass - \samp{boxwidth} as the number of observations and let the function work it out. -} -\value{nil} -\author{Jim Lemon - thanks to Gianni Lavaredo for the suggestion} -\keyword{misc} -\seealso{\link{plot}, \link{boxplot}} -\examples{ - y1<-runif(20,2,10) - y2<-rnorm(30,6,2) - y3<-sample(0:20,40,TRUE) - Ns<-c(20,30,40) - ymean<-c(mean(y1),mean(y2),mean(y3)) - y1inner<-quantile(y1,probs=c(.16,.84)) - y2inner<-c(ymean[2]+sd(y2),ymean[2]-sd(y2)) - y3inner<-quantile(y3,probs=c(.16,.84)) - uinner<-c(y1inner[1],y2inner[1],y3inner[1]) - linner<-c(y1inner[2],y2inner[2],y3inner[2]) - ulim<-c(max(y1),max(y2),max(y3)) - llim<-c(min(y1),min(y2),min(y3)) - box.heresy(ymean,uinner=uinner,linner=linner,ulim=ulim,llim=llim,boxwidth=Ns, - main="Boxplot of means, central spread and range",xlab="Distribution", - xaxlab=c("Uniform","Normal","Sample")) - y1outer<- - y<-runif(5) - ulim<-runif(5) - llim<-runif(5) - uinner<-ulim/2 - linner<-llim/2 - box.heresy(y,uinner=uinner,linner=linner,ulim=ulim,llim=llim, - intervals=TRUE,main="The heretical boxplot", - xlab="Number of observations",ylab="Value") -} diff --git a/man/boxed.labels.Rd b/man/boxed.labels.Rd deleted file mode 100644 index 025dd3d..0000000 --- a/man/boxed.labels.Rd +++ /dev/null @@ -1,73 +0,0 @@ -\name{boxed.labels} -\alias{boxed.labels} -\title{ Place labels in boxes } -\description{ - Places labels in boxes on an existing plot -} -\usage{ - boxed.labels(x,y=NULL,labels, - bg=ifelse(match(par("bg"),"transparent",0),"white",par("bg")), - border=TRUE,xpad=1.2,ypad=1.2,srt=0,cex=1,adj=0.5,xlog=FALSE,ylog=FALSE,...) -} -\arguments{ - \item{x,y}{x and y position of the centers of the labels. \samp{x} can be an - \link{xy.coords} list.} - \item{bg}{The fill color of the rectangles on which the labels are displayed - (see Details).} - \item{labels}{Text strings} - \item{border}{Whether to draw borders around the rectangles.} - \item{xpad,ypad}{The proportion of the rectangles to the - extent of the text within.} - \item{srt}{Rotation of the labels. If 90 or 270 degrees, the box will be - rotated 90 degrees.} - \item{cex}{Character expansion. See \samp{text}.} - \item{adj}{left/right adjustment. If this is set outside the function, - the box will not be aligned properly.} - \item{xlog}{Whether the X axis is a log axis} - \item{ylog}{Whether the Y axis is a log axis} - \item{...}{additional arguments passed to \samp{text}.} -} -\details{ - The label(s) are displayed on a rectangular background. This may be useful - for visibility and is the reason that "transparent" background is not available. - With the default \samp{textcol=NA}, the function tries to work out whether white - or black text will be more easily read based on the background color and displays - the text accordingly. If the user specifies text colors in the additional - arguments, these colors will override the automatic white/black above - see the - last example. - - Only right angle rotations are allowed in \samp{boxed.labels}. \emph{Important - change}: \samp{xpad} and \samp{ypad} are now the full proportion of - the box to text, not half. The user can now call \samp{cylindrect} or - \samp{gradient.rect} for the background rectangle. -} -\note{ - This function is best for regularly spaced labels where overlapping is - not a problem. See \link{thigmophobe.labels} for placing labels - where overlap is likely. -} -\value{nil} -\author{Jim Lemon - thanks to Thorn Thaler for the code allowing - user-specified text colors and Flemming Skjoth for the log axis correction} -\seealso{\link{spread.labels}, \link{thigmophobe.labels}} -\examples{ - x<-rnorm(10) - y<-rnorm(10) - plot(x,y,type="p") - nums<-c("one","two","three","four","five","six","seven","eight","nine","ten") - boxed.labels(x,y-0.1,nums) - # now label a barplot - xpos<-barp(c(1,3,2,4)) - boxed.labels(xpos$x,0.5,nums[1:4]) - # and add labels below the x axis ticks - boxed.labels(xpos$x,-0.4,c("First","Second","Third","Fourth")) - # perform a PCA on the "swiss" dataset and plot the first two components - data(swiss) - swiss.pca<-prcomp(swiss) - plot(swiss.pca$rotation[,1:2],xlim=c(-1,0.2),main="PCA of swiss dataset", - type="n") - boxed.labels(swiss.pca$rotation[1:6],swiss.pca$rotation[7:12],ypad=1.5, - colnames(swiss),bg=c("red","purple","blue","blue","darkgreen","red"), - col="yellow") -} -\keyword{misc} diff --git a/man/brkdn.plot.Rd b/man/brkdn.plot.Rd deleted file mode 100644 index 9ab3de6..0000000 --- a/man/brkdn.plot.Rd +++ /dev/null @@ -1,90 +0,0 @@ -\name{brkdn.plot} -\alias{brkdn.plot} -\title{A point/line plotting routine} -\description{Display a point/line plot of breakdowns of one or more variables.} -\usage{ - brkdn.plot(vars,groups=NULL,obs=NULL,data,mct="mean",md="std.error", - stagger=NULL,dispbar=TRUE,main="Breakdown plot",xlab=NULL,ylab=NULL,xaxlab=NA, - ylim=NA,type="b",pch=1,lty=1,col=par("fg"),staxx=FALSE,yat=NULL,...) -} -\arguments{ - \item{vars}{The names or indices of one or more columns in a data frame. - The columns must contain numeric data. If only one variable is to be - broken down, vars can be a formula.} - \item{groups}{The name or index of a column in a data frame that classifies - the values in \samp{vars} into different, usually fixed effect, levels.} - \item{obs}{The name or index of a column in a data frame that classifies - the values in \samp{vars} into different, usually random effect, levels.} - \item{data}{The data frame.} - \item{mct}{The measure of central tendency to calculate for each group.} - \item{md}{The measure of dispersion to calculate, NA for none.} - \item{stagger}{The amount to offset the successive values at each horizontal - position as a proportion of the width of the plot. The calculated default - is usually adequate. Pass zero for none.} - \item{dispbar}{Whether to display the measures of dispersion as bars.} - \item{main}{The title at the top of the plot.} - \item{xlab,ylab}{The labels for the X and Y axes respectively. There are - defaults, but they are basic.} - \item{xaxlab}{Optional labels for the horizontal axis ticks.} - \item{ylim}{Optional vertical limits for the plot.} - \item{type}{Whether to plot symbols, lines or both (as in \samp{plot}).} - \item{pch}{Symbol(s) to plot.} - \item{lty}{Line type(s) to plot.} - \item{col}{Color(s) for the symbols and lines.} - \item{staxx}{Whether to call \link{staxlab} to display the X axis - labels.} - \item{yat}{Optional y axis tick positions.} - \item{...}{additional arguments passed to \samp{plot}.} -} -\value{ - A list of two matrices of dimension \samp{length(levels(groups))} by - \samp{length(levels(obs))}. The first contains the measures of central - tendency calculated and its name is the name of the function passed as - \samp{mct}. The second contains the measures of dispersion and its name - is the name of the function passed as \samp{md}. - - If both \samp{groups} and \samp{obs} are not NULL, the rows of each matrix - will be the \samp{groups} and the columns the \samp{obs}. If \samp{obs} - is NULL, the rows will be the \samp{groups} and the columns the \samp{vars}. - If \samp{groups} is NULL, the rows will be the \samp{vars} and the columns - the \samp{obs}. That is, if \samp{vars} has more than one element, if - \samp{obs} is NULL, the elements of \samp{vars} will be considered to - represent observations, while if \samp{groups} is NULL, they will be - considered to represent groups. At least one of \samp{groups} and \samp{obs} - must be not NULL or there is no point in using \samp{brkdn.plot}. -} -\details{ - \samp{brkdn.plot} displays a plot useful for visualizing the breakdown of a - response measure by two factors, or more than one response measure by either - a factor representing something like levels of treatment (\samp{groups}) or - something like repeated observations (\samp{obs}). For example, if - observations are made at different times on data objects that receive - different treatments, the \samp{groups} factor will display the measures - of central tendency as points/lines with the same color, symbol and line type, - while the \samp{obs} factor will be represented as horizontal positions on the - plot. If \samp{obs} is numeric, its unique values will be used as the - positions, if not, 1 to the number of unique values. This is a common way of - representing changes over time intervals for experimental groups. - - If only one numeric variable is to be broken down, \samp{vars} may be a - formula like \samp{var~groups+obs}. The position of the two factors to break - down the variable is fixed - the second term will be interpreted as "groups" - and the third, if present, will be interpreted as "obs". -} -\author{Jim Lemon} -\seealso{\link{dispersion}} -\examples{ - test.df<-data.frame(a=rnorm(80)+4,b=rnorm(80)+4,c=rep(LETTERS[1:4],each=20), - d=rep(rep(letters[1:4],each=4),5)) - # first use the default values - brkdn.plot("a","c","d",test.df,pch=1:4,col=1:4) - # now jazz it up a bit using medians and median absolute deviations - # and some enhancements - bp<-brkdn.plot(a~c+d,data=test.df,main="Test of the breakdown plot", - mct="median",md="mad",xlab="Temperature range", ylab="Cognition", - xaxlab=c("10-15","16-20","21-25","25-30"),pch=1:4,lty=1:4,col=1:4) - es<-emptyspace(bp) - legend(es,legend=c("Sydney","Gosford","Karuah","Brisbane"),pch=1:4, - col=1:4,lty=1:4,xjust=0.5,yjust=0.5) -} -\keyword{misc} diff --git a/man/brkdnNest.Rd b/man/brkdnNest.Rd deleted file mode 100644 index e7bd048..0000000 --- a/man/brkdnNest.Rd +++ /dev/null @@ -1,67 +0,0 @@ -\name{brkdnNest} -\alias{brkdnNest} -\title{Perform a nested breakdown of numeric values} -\description{Breaks down a numeric or categorical element of a data frame - by one or more categorical elements.} -\usage{ - brkdnNest(formula,data,FUN=c("mean","sd","sd","valid.n"),label1="Overall", - trueval=TRUE) -} -\arguments{ - \item{formula}{A formula with a numeric element of a data frame on the left and - one or more categorical elements on the right.} - \item{data}{A data frame containing the elements in \samp{formula}.} - \item{FUN}{The functions to be applied to successive breakdowns.} - \item{label1}{The label to use for the overall value of the first function.} - \item{trueval}{The value to use in calculating proportions or sums of a - categorical response variable. See Details.} -} -\value{ - A list with as many elements as there are functions in \samp{FUN}. It is - probably best to always specify four functions (summary measure, upper - dispersion measure, lower dispersion measure and number of valid observations) - even if this is redundant as in the default. - - This function is similar to \samp{brkdn} in the \pkg{prettyR} package, but - is structured to be used with the \samp{barNest} function. It produces one - or more measures for the overall data, then the subsets of the data defined by - the first variable to the right of the tilde, then the subsets defined by - the first and second variable, and so on. -} -\details{ - \samp{brkdnNest} performs a nested breakdown of an element of a data frame - by one or more categorical elements. For each category and optional - subcategories, the variable on the left of the formula is summarized as - specified by the functions named in \samp{FUN}. - - If \samp{trueval} is not NA, brkdnNest will calculate the proportion of - \samp{trueval} values in the response variable out of the total valid - responses. If the function \samp{valid.n} is the first function in - \samp{FUN}, the counts of the groups and subgroups will be returned. - - Two specialized summary functions are defined within \samp{brkdnNest}. - \samp{sumbrk} returns the count of values in a factor equal to \samp{trueval}, - and \samp{propbrk} returns the proportion of values equal to - \samp{trueval}. Be aware that if a categorical variable is specified on - the left of the formula, functions which expect numeric data such as - \samp{mean} should not be included in \samp{FUN}. - - The user should take care when specifying different summary functions. - \samp{barNest} expects a summary measure as the first component of the list - and measures of dispersion as the second and third. If two different measures - of dispersion are passed, the first must calculate the upper and the second - the lower measure. -} -\author{Jim Lemon} -\seealso{\link{by}} -\examples{ - brkdntest<-data.frame(Age=rnorm(100,25,10), - Sex=factor(sample(c("M","F"),100,TRUE)), - Marital=sample(c("M","X","S","W"),100,TRUE), - Employ=sample(c("FT","PT","NO"),100,TRUE)) - brkdnNest(formula=Age~Sex+Marital+Employ,data=brkdntest) - # show the proportion of unemployed with binomial confidence intervals - brkdnNest(formula=Employ~Sex+Marital,data=brkdntest, - FUN=c("propbrk","binciWu","binciWl"),trueval="NO") -} -\keyword{misc} diff --git a/man/bumpchart.Rd b/man/bumpchart.Rd deleted file mode 100644 index 8fed091..0000000 --- a/man/bumpchart.Rd +++ /dev/null @@ -1,75 +0,0 @@ -\name{bumpchart} -\alias{bumpchart} -\title{Display a "bumps" (sequential ranking) chart} -\description{ - Display a chart with two of more columns of points in order of ascending values - with lines connecting the points in a row. -} -\usage{ - bumpchart(y,top.labels=colnames(y),labels=rep(rownames(y),2),rank=TRUE, - mar=c(2,8,5,8),pch=19,col=par("fg"),lty=1,lwd=1,arrows=FALSE,...) -} -\arguments{ - \item{y}{A numeric matrix or data frame which may contain NAs.} - \item{top.labels}{The strings that will appear at the top of each column of - points on the plot.} - \item{labels}{The strings that will appear next to the outer columns of - points.} - \item{rank}{Whether to rank the values in \samp{y} before plotting.} - \item{mar}{The margins to use for the bumps chart. Alter to your taste.} - \item{pch}{The symbols to use when plotting the points.} - \item{col}{The colors to use.} - \item{lty}{The line types to use.} - \item{lwd}{The line widths to use.} - \item{arrows}{Whether to join the points with lines (FALSE) or arrows (TRUE).} - \item{...}{Additional arguments passed to \samp{matplot} or \samp{arrows}.} -} -\details{ - \samp{bumpchart} calls \samp{matplot} to plot the values in the transposed - \samp{y} matrix or data frame, joining the points with lines. At the left and - right edges of the plot, the labels identifying each row of points are - displayed. These labels may now be different for each side of the plot, - for example if the values of \samp{y} are to be included. Remember that - due to the transposition of the values for plotting, the labels on the - right have to precede those on the left - see the second example. - - This type of plot is often used to show the changing positions of - entities over time, like the ranking in surveys in different years. For a - similar, but more flexible plot, see \link{ladderplot}. - - Because of the way \samp{matplot} plots the values, the order of everything is - reversed. As the typical display of ranks is with rank 1 at the top, the - actual rank positions are used to plot the values. - This places the lowest scores at the bottom of the plot and the highest at - the top. - - Any arguments that are included in \samp{...} will be passed to \samp{matplot} - if the \samp{arrows} argument is FALSE, and to the \samp{arrows} function if - the \samp{arrows} argument is TRUE as in the first example. -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{matplot}} -\examples{ - # percentage of those over 25 years having completed high school - # in 10 cities in the USA in 1990 and 2000 - educattn<-matrix(c(90.4,90.3,75.7,78.9,66,71.8,70.5,70.4,68.4,67.9, - 67.2,76.1,68.1,74.7,68.5,72.4,64.3,71.2,73.1,77.8),ncol=2,byrow=TRUE) - rownames(educattn)<-c("Anchorage AK","Boston MA","Chicago IL", - "Houston TX","Los Angeles CA","Louisville KY","New Orleans LA", - "New York NY","Philadelphia PA","Washington DC") - colnames(educattn)<-c(1990,2000) - bumpchart(educattn,main="Rank for high school completion by over 25s", - arrows=TRUE,length=0.2) - vallab<-c(paste(educattn[,2],rownames(educattn),sep="-"), - paste(rownames(educattn),educattn[,1],sep="-")) - # now show the raw percentages and add central ticks - bumpchart(educattn,rank=FALSE,labels=vallab, - main="Percentage high school completion by over 25s", - lty=1:10,lwd=1,col=rainbow(10)) - # margins have been reset, so use - par(xpd=TRUE) - boxed.labels(1.5,seq(65,90,by=5),seq(65,90,by=5)) - par(xpd=FALSE) -} -\keyword{misc} diff --git a/man/categoryReshape.Rd b/man/categoryReshape.Rd deleted file mode 100644 index c6f8205..0000000 --- a/man/categoryReshape.Rd +++ /dev/null @@ -1,31 +0,0 @@ -\name{categoryReshape} -\alias{categoryReshape} -\title{Convert object label/attribute label coding.} -\description{Convert object label/attribute label coding to an object by - attribute data frame.} -\usage{ - categoryReshape(x) -} -\arguments{ - \item{x}{A matrix or data frame with at least two columns.} -} -\details{ - \samp{categoryReshape} attempts to convert the first two columns of its input - into a data frame in which rows represent objects and columns attributes. For - each object, a value of 1 indicates that the object has that attribute, and a - value of 0 that it does not. In set membership terms, a 1 indicates that the - object is a member of that set and a 0 that it is not. -} -\value{A data frame (see Details).} -\keyword{misc} -\author{Jim Lemon} -\seealso{\link{makeIntersectList}} -\examples{ - ns<-sample(1:8,20,TRUE) - objects<-0 - for(i in 1:length(ns)) objects<-c(objects,rep(i,ns[i])) - attributes<-"Z" - for(i in 1:length(ns)) attributes<-c(attributes,sample(LETTERS[1:8],ns[i])) - setdf<-data.frame(objects[-1],attributes[-1]) - categoryReshape(setdf) -} diff --git a/man/centipede.plot.Rd b/man/centipede.plot.Rd deleted file mode 100644 index 602f345..0000000 --- a/man/centipede.plot.Rd +++ /dev/null @@ -1,85 +0,0 @@ -\name{centipede.plot} -\alias{centipede.plot} -\title{Display a centipede plot} -\description{ - Displays a centipede plot on the current graphics device. -} -\usage{ - centipede.plot(segs,mct="mean",lower.limit="std.error", - upper.limit=lower.limit,left.labels=NULL,right.labels=NULL,sort.segs=TRUE, - main="",xlab=NA,pch=21,vgrid=NA,hgrid=NA,gridcol="lightgray",mar=NA,col=par("fg"), - bg="green",...) -} -\arguments{ - \item{segs}{a matrix of midpoints and limits calculated by - \link{get.segs} OR a \samp{dstat} object returned by - \samp{brkdn}.} - \item{mct}{The function to use in calculating the midpoint of each - segment.} - \item{lower.limit}{The functions to use in calculating the - lower limits for each subset of the data.} - \item{upper.limit}{The functions to use in calculating the - upper limits.} - \item{left.labels}{The variable or subset labels to place at the left margin of - the plot. Default values are provided.} - \item{right.labels}{The variable or subset labels to place at the right margin - of the plot.} - \item{sort.segs}{Whether to sort the segments in ascending order.} - \item{main}{Optional title for the plot.} - \item{xlab}{Optional x axis label for the plot. The default NA - displays a text label showing the midpoint and limit functions.} - \item{pch}{The symbols to use when plotting midpoints.} - \item{vgrid}{Optional vertical line(s) to display on the plot. Defaults to - NA (none).} - \item{hgrid}{Optional horizontal grid lines to display on the plot. Defaults - to NA (none).} - \item{gridcol}{The color for the vgrid and hgrid lines.} - \item{mar}{Margin widths for the plot. Defaults to c(4,5,1,4) or - c(4,5,3,4) if there is a title.} - \item{col}{The color(s) of the limit lines and borders of the midpoint - markers.} - \item{bg}{The color(s) to fill the midpoint markers.} - \item{...}{additional arguments passed to \samp{plot}.} -} -\details{ - \samp{centipede.plot} displays one or more midpoints and limits as - filled circles with horizontal error bars. It places labels on the left and - right sides of the plot. If these labels are long, it may be necessary to - pass explicit values to the \samp{mar} argument to leave enough room. - - The \samp{vgrid} argument is usually used to display an average value for - all of the midpoints. If one or more values are passed in this argument, - they will be displayed as vertical lines spanning the plot. The \samp{hgrid} - argument acts like the \samp{grid} function, drawing dashed horizontal lines - across the plot. If \samp{hgrid=NULL}, these lines will be drawn under the - values displayed, which will be 1 to the number of values on the vertical axis. - The user can pass explicit values if desired. With horizontal and optionally - vertical grid lines, the centipede plot is practically equivalent to a dotplot - with error bars. - - Similarly, centipede plots typically have a large number of subsets, and - it may be necessary to start the graphics device with an aspect ratio that - will prevent crowding of the labels when over 30 segments are displayed. - - The matrix \samp{segs} may be entered manually or read from a file. - The first row specifies midpoints, the second and third rows the lower - and upper limits respectively and the fourth row the number of valid - observations. If there are no values for number of valid observations, - just pass vector of blank strings with the \samp{right.labels} argument. - If a \samp{dstat} object is passed as \samp{segs}, the function will calculate - the lower and upper values according to the relevant arguments. This type of - plot is also known as a caterpillar plot or a league table. -} -\value{nil.} -\author{Jim Lemon} -\seealso{\link{get.segs}} -\examples{ - testcp<-list("",40) - for(i in 1:40) testcp[[i]]<-rnorm(sample(1:8,1)*50) - segs<-get.segs(testcp) - centipede.plot(segs,main="Test centipede plot",vgrid=0) - # now leave out the number of valid observations, pass x labels and no right labels - centipede.plot(segs[1:3,],main="Test centipede plot",vgrid=0,mar=c(4,5,3,2), - left.labels=paste("X",1:40,sep=""),right.labels=rep("",40)) -} -\keyword{misc} diff --git a/man/clean.args.Rd b/man/clean.args.Rd deleted file mode 100644 index fefbafe..0000000 --- a/man/clean.args.Rd +++ /dev/null @@ -1,35 +0,0 @@ -\name{clean.args} -\alias{clean.args} -\alias{remove.args} -\title{Remove inappropriate arguments from an argument list} -\description{ - Takes a list of arguments and eliminates those that are not - appropriate for passing to a particular function (and hence - would produce an error if passed). -} -\usage{ - clean.args(argstr,fn,exclude.repeats=FALSE,exclude.other=NULL,dots.ok=TRUE) - remove.args(argstr,fn) -} -\arguments{ - \item{argstr}{a named list of arguments, e.g. from \samp{\dots}} - \item{fn}{a function} - \item{exclude.repeats}{(logical) remove repeated arguments?} - \item{exclude.other}{a character vector of names of additional arguments to remove} - \item{dots.ok}{should "..." be allowed in the argument list?} -} -\value{ - \samp{clean.args} returns a list which is a copy of \samp{argstr} with - arguments inappropriate for \samp{fn} removed; \samp{remove.args} - removes the arguments for \samp{fn} from the list. -} -\author{Ben Bolker} -\examples{ - tststr <- list(n=2,mean=0,sd=1,foo=4,bar=6) - clean.args(tststr,rnorm) - try(do.call("rnorm",tststr)) - do.call("rnorm",clean.args(tststr,rnorm)) - remove.args(tststr,rnorm) - ## add example of combining arg. lists? -} -\keyword{programming} diff --git a/man/clock24.plot.Rd b/man/clock24.plot.Rd deleted file mode 100644 index 0bfa760..0000000 --- a/man/clock24.plot.Rd +++ /dev/null @@ -1,52 +0,0 @@ -\name{clock24.plot} -\title{Plot values on a 24 hour "clockface"} -\usage{ - clock24.plot(lengths,clock.pos,labels=0:23,minutes=FALSE, - hm2dec=FALSE,label.pos=NULL,rp.type="r",loglen=FALSE,explab=FALSE,...) -} -\alias{clock24.plot} -\arguments{ - \item{lengths}{numeric data vector. Magnitudes will be represented as - line lengths, or symbol or polygon vertex positions.} - \item{clock.pos}{numeric vector of positions on the 'clockface'. - These must be in decimal hours and will be rescaled to radians.} - \item{labels}{Labels to place at the circumference.} - \item{minutes}{Whether to add minutes (".00") to the labels.} - \item{hm2dec}{Whether to convert HH:MM clock positions to decimal hours.} - \item{label.pos}{Radial positions of the labels.} - \item{rp.type}{Whether to plot radial lines, symbols or a polygon.} - \item{loglen}{Whether to log transform the \samp{length} values. Only base - 10 logs are available.} - \item{explab}{Whether to use the default fixed (FALSE) or exponential (TRUE) - notation for the radial labels.} - \item{...}{additional arguments are passed to \samp{radial.plot} and - then to \samp{plot}.} -} -\description{ - \samp{clock24.plot} displays a plot of radial lines, symbols or a polygon - centered at the midpoint of the plot frame on a 24 hour 'clockface'. - In contrast to the default behavior of \samp{radial.plot}, the positions - are interpreted as beginning at vertical (000) and moving clockwise. - - If \samp{add=TRUE} is passed as one of the additional arguments, the values - will be added to the current plot. If a \samp{radial.lim} argument was - passed on the initial plot, it must be passed again to add values or the - values will be displayed incorrectly. -} -\value{A list of the parameters altered by \link{radial.plot}.} -\keyword{misc} -\author{Jim Lemon} -\seealso{\link{polar.plot},\link{radial.plot}} -\examples{ - testlen<-rnorm(24)*2+5 - testpos<-0:23+rnorm(24)/4 - clock24.plot(testlen,testpos,main="Test Clock24 (lines)",show.grid=FALSE, - line.col="green",lwd=3) - if(dev.interactive()) par(ask=TRUE) - # now do a 'daylight' plot - oldpar<-clock24.plot(testlen[7:19],testpos[7:19], - main="Test Clock24 daytime (symbols)", - point.col="blue",rp.type="s",lwd=3) - # reset everything - par(oldpar) -} diff --git a/man/clplot.Rd b/man/clplot.Rd deleted file mode 100644 index 49d756f..0000000 --- a/man/clplot.Rd +++ /dev/null @@ -1,34 +0,0 @@ -\name{clplot} -\title{Plot lines with colors determined by values.} -\usage{ - clplot(x,y,ylab=deparse(substitute(y)),xlab=deparse(substitute(x)), - levels=seq(min(y)+(max(y)-min(y))/5,max(y)-(max(y)-min(y))/5,length.out=4), - cols=c("black","blue","green","orange","red"),lty=1,showcuts=FALSE,...) -} -\alias{clplot} -\arguments{ - \item{x,y}{numeric data vectors.} - \item{ylab,xlab}{Labels for the X and Y axes.} - \item{levels}{Cut points to assign colors to the values of \samp{x} and - \samp{y}.} - \item{cols}{The colors to be assigned.} - \item{lty}{The line type.} - \item{showcuts}{Whether to show the positions of the cut points.} - \item{...}{additional arguments passed to \samp{plot} or \samp{lines}.} -} -\description{ - \samp{clplot} displays a plot of lines for which the colors are dependent - upon the x and y values. \samp{clplot} is similar to \samp{color.scale.lines} - except that while the latter calculates a color for each unique value, - \samp{clplot} assigns colors to groups of values within the cutpoints defined - by \samp{levels}. -} -\value{nil} -\author{Carl Witthoft} -\seealso{\link{plot}} -\examples{ - x<-seq(1,100) - y<-sin(x/5)+x/20 - clplot(x,y,main="Test of clplot") -} -\keyword{misc} diff --git a/man/cluster.overplot.Rd b/man/cluster.overplot.Rd deleted file mode 100644 index a757512..0000000 --- a/man/cluster.overplot.Rd +++ /dev/null @@ -1,44 +0,0 @@ -\name{cluster.overplot} -\alias{cluster.overplot} -\title{Shift overlying points into clusters} -\usage{ - cluster.overplot(x,y,away=NULL,tol=NULL,...) -} -\arguments{ - \item{x,y}{Numeric data vectors or the first two columns of a matrix - or data frame. Typically the x/y coordinates of points to be plotted.} - \item{away}{How far to move overlying points in user units. Defaults to - the width of a lower case "o" in the x direction and 5/8 of the - height of a lower case "o" in the y direction. Must have both values.} - \item{tol}{The largest distance between points that will be considered - to be overlying. Defaults to 1/2 of the width of a lower case "o" in - the x direction and 1/2 of the height of a lower case "o" in the y - direction.} - \item{...}{additional arguments returned as they are passed.} -} -\description{ - \samp{cluster.overplot} checks for overlying points in the x and y - coordinates passed. Those points that are overlying are moved to form - a small cluster of up to nine points. For large numbers of overlying - points, see \link{count.overplot} or \link{sizeplot}. - If you are unsure of the number of overplots in your data, run - \samp{count.overplot} first to see if there are any potential clusters - larger than nine. -} -\value{ - A list with two components. For unique x-y pairs the elements will be - the same as in the original. For overlying points up to eight additional - points will be generated that will create a cluster of points instead of one. -} -\keyword{misc} -\author{Jim Lemon - thanks to Markus Elze for the test for a current graphics - device} -\seealso{\link{count.overplot},\link{sizeplot}} -\examples{ - xy.mat<-cbind(sample(1:10,200,TRUE),sample(1:10,200,TRUE)) - clusteredpoints<- - cluster.overplot(xy.mat,col=rep(c("red","green"),each=100), - away=rep(0.2,2)) - plot(clusteredpoints,col=clusteredpoints$col, - main="Cluster overplot test") -} diff --git a/man/clustered.dotplots.Rd b/man/clustered.dotplots.Rd deleted file mode 100644 index 3348e22..0000000 --- a/man/clustered.dotplots.Rd +++ /dev/null @@ -1,63 +0,0 @@ -\name{clustered.dotplots} -\alias{clustered.dotplots} -\title{Display the frequencies of two categories} -\usage{ - clustered.dotplots(xgroup, ygroup, freq, type = "circles", - main="",xlab="",ylab="",x_las=1,y_las=1,axes=TRUE,size=1,...) -} -\arguments{ - \item{xgroup,ygroup}{Vectors that specify the two groupings to be - displayed (see Details).} - \item{freq}{The frequencies in the two groupings.} - \item{type}{The type of symbols to use as "dots".} - \item{main,xlab,ylab}{As in plot.} - \item{x_las,y_las}{Orientation of the axis tick labels.} - \item{axes}{Whether to display axes.} - \item{size}{Spacing for the clusters.} - \item{...}{additional arguments passed to "points".} -} -\description{ - \samp{clustered.dotplots} displays a contingency table as clusters of - symbols on a plot. It expects \samp{xgroup} and \samp{ygroup} to contain - all or some of the combinations of their unique values. It also expects - \samp{freq} to contain the number of instances of each combination. -} -\value{nil} -\author{Darshan Baral} -\seealso{\link{cluster.overplot}} -\examples{ - df <- structure(list(set = c("09t0101 TJ", "09t0102 MW", "09t0201 EH", - "09t0202 NH", "09t0101 TJ", "09t0102 MW", "09t0201 EH", "09t0202 NH", - "09t0101 TJ", "09t0102 MW", "09t0201 EH", "09t0202 NH", "09t0101 TJ", - "09t0102 MW", "09t0201 EH", "09t0202 NH", "09t0202 NH"), grade = c("1", - "1", "1", "1", "2", "2", "2", "2", "3", "3", "3", "3", "4", "4", - "4", "4", "5"), freq = c(7, 8, 2, 3, 11, 4, 11, 3, 3, 8, 3, 8, - 3, 9, 3, 2, 5)), .Names = c("set", "grade", "freq"), row.names = c(NA, - 17L), class = "data.frame") - clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq) - clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq, - col = "gray") - clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq, - type = "points") - clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq, - type = "points", pch = 19, col = "red") - # this will cause an error - # clustered.dotplots(xgroup = mtcars$cyl, ygroup = mtcars$gear, - # freq = mtcars$carb) - # how to fix it - cumcars<-by(mtcars$carb,list(mtcars$cyl,mtcars$gear),valid.n) - mtcars2<-data.frame(cyl=NA,gear=NA,carb=NA) - rownum<-1 - for(cyl in dimnames(cumcars)[[1]]) { - for(gear in dimnames(cumcars)[[2]]) { - if(!is.na(cumcars[cyl,gear])) { - mtcars2[rownum,]<-c(as.numeric(cyl),as.numeric(gear),cumcars[cyl,gear]) - rownum<-rownum+1 - } - } - } - clustered.dotplots(xgroup = mtcars2$cyl, ygroup = mtcars2$gear, - freq = mtcars2$carb,main="Cars by number of cylinders and gears", - xlab="Number of cylinders",ylab="Number of gears",type="points",pch=5) -} -\keyword{misc} diff --git a/man/color.axis.Rd b/man/color.axis.Rd deleted file mode 100644 index 5c5218b..0000000 --- a/man/color.axis.Rd +++ /dev/null @@ -1,23 +0,0 @@ -\name{color.axis} -\alias{color.axis} -\title{Display an axis in a specified color} -\usage{ - color.axis(side=1,at=NULL,labels=TRUE,axlab=NA,axlab.at=NA, - col=par("fg"),cex.axis=par("cex.axis"),cex=par("cex")) -} -\arguments{ - \item{side}{Which axis - see axis.} - \item{at}{Positions for the tick labels.} - \item{labels}{Tick labels.} - \item{axlab}{Optional axis label.} - \item{axlab.at}{Where to position the axis label - defaults to centered.} - \item{col}{Color for the axis.} - \item{cex.axis}{Character expansion for the tick labels.} - \item{cex}{Character expansion for the axis label.} -} -\description{ - \samp{color.axis} displays an axis in the specified color. -} -\value{nil} -\author{Jim Lemon} -\keyword{misc} diff --git a/man/color.gradient.Rd b/man/color.gradient.Rd deleted file mode 100644 index c0355da..0000000 --- a/man/color.gradient.Rd +++ /dev/null @@ -1,31 +0,0 @@ -\name{color.gradient} -\title{Calculate an arbitrary sequence of colors} -\usage{ - color.gradient(reds,greens,blues,nslices=50) -} -\alias{color.gradient} -\arguments{ - \item{reds,greens,blues}{vectors of the values of the color components - as 0 to 1.} - \item{nslices}{The number of color "slices".} -} -\description{ - \samp{color.gradient} is now just a call to \samp{color.scale} with a - vector of equally spaced integers (1:nslices). The function is kept for - backward compatibility. -} -\note{ - The function is mainly useful for defining a set of colors to represent - a known number of gradations. Such a set can be used to assign a grade - to a small number of values (e.g. points on a scatterplot - but see - \samp{color.scale} for large numbers) and display a color bar using - \samp{gradient.rect} as a legend. -} -\value{A vector of hexadecimal color values as used by \samp{col}.} -\author{Jim Lemon} -\seealso{\link{rescale},\link{approx},\link{color.scale}} -\examples{ - # try it with red and blue endpoints and green midpoints. - color.gradient(c(0,1),c(1,0.6,0.4,0.3,0),c(0.1,0.6)) -} -\keyword{misc} diff --git a/man/color.id.Rd b/man/color.id.Rd deleted file mode 100644 index f3df361..0000000 --- a/man/color.id.Rd +++ /dev/null @@ -1,25 +0,0 @@ -\name{color.id} -\alias{color.id} -\title{Identify closest match to a color} -\description{ - Given a color specified as a hex string, find the closest match in the - table of known (named) colors -} -\usage{ - color.id(col) -} -\arguments{ - \item{col}{a color specified as a hex string} -} -\details{ - finds the color with the minimum squared distance in RGB space -} -\value{ - the name of the closest match -} -\author{Ben Bolker} -\seealso{\link{col2rgb},\link{colors}} -\examples{ - color.id("#cc00cc") -} -\keyword{color} diff --git a/man/color.legend.Rd b/man/color.legend.Rd deleted file mode 100644 index b564e94..0000000 --- a/man/color.legend.Rd +++ /dev/null @@ -1,62 +0,0 @@ -\name{color.legend} -\alias{color.legend} -\title{Legend matching categories or values to colors} -\description{Display a color legend on a plot} -\usage{ - color.legend(xl,yb,xr,yt,legend,rect.col,cex=1,align="lt",gradient="x",...) -} -\arguments{ - \item{xl,yb,xr,yt}{The lower left and upper right coordinates of the - rectange of colors in user coordinates.} - \item{legend}{The labels that will appear next to some or all of the colors.} - \item{rect.col}{The colors that will fill the rectangle.} - \item{cex}{Character expansion factor for the labels.} - \item{align}{How to align the labels relative to the color rectangle.} - \item{gradient}{Whether to have a horizontal (x) or vertical (y) color - gradient.} - \item{...}{Additional arguments passed to \samp{text}.} -} -\value{nil} -\details{ - \samp{color.legend} displays a rectangle defined by the first four arguments - filled with smaller rectangles of color defined by the \samp{rect.col} argument. - Labels, defined by the \samp{legend} argument, are placed next to the color - rectangle. The position of the labels is determined by whether the color - rectangle is horizontal or vertical and the \samp{align} argument. The default - value of \samp{lt} places the labels at the left of a vertical rectangle or the - top of a horizontal one. \samp{rb} puts them on the other side. To have the - labels in the same color as the rectangles, include a \samp{col} argument that - will be passed to \samp{text} as in the example. - - There can be fewer labels than colors. The labels will be evenly spaced along - the rectangle in this case. It is possible to use empty labels to get uneven - spacing. The user can pass more labels than colors, but the labels will almost - certainly be crowded and I have only found one use for this. If the user wants - the labels at the intersection of the boxes rather than in the center, see the - alternative specification for the labels in the example (thanks Claudia Tebaldi). - To have complete control over the labels, see \link{gradient.rect} and - \link{text} or \link{mtext}. - - \samp{colorlegend} in the \pkg{shape} package offers a different approach, - creating a large number of colors from a color generating function (a bit - like \samp{color.gradient}) and then allowing the user to specify tick - marks at arbitrary points along the color bar. -} -\author{Jim Lemon} -\seealso{\link{color.gradient}, \link{gradient.rect}} -\examples{ - # get some extra room - par(mar=c(7,4,4,6)) - testcol<-color.gradient(c(0,1),0,c(1,0),nslices=5) - col.labels<-c("Cold","Warm","Hot") - # this will put the labels at the intersections - # col.labels<-c("","Cold","","Warm","","Warmer","","Hot","") - color2D.matplot(matrix(rnorm(100),nrow=10),c(1,0),0,c(0,1), - main="Test color legends") - color.legend(11,6,11.8,9,col.labels,testcol,gradient="y") - color.legend(10.2,2,11,5,col.labels,testcol,align="rb",gradient="y") - color.legend(0.5,-2,3.5,-1.2,col.labels,testcol) - color.legend(7,-1.8,10,-1,col.labels,testcol,align="rb",col=testcol[c(1,3,5)]) - par(mar=c(5,4,4,2)) -} -\keyword{misc} diff --git a/man/color.scale.Rd b/man/color.scale.Rd deleted file mode 100644 index 1092bf5..0000000 --- a/man/color.scale.Rd +++ /dev/null @@ -1,126 +0,0 @@ -\name{color.scale} -\alias{color.scale} -\title{Turn values into colors.} -\description{Transform numeric values into colors using RGB, HSV or HCL} -\usage{ - color.scale(x,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1),alpha=1, - extremes=NA,na.color=NA,xrange=NULL,color.spec="rgb") -} -\arguments{ - \item{x}{a numeric vector, matrix or data frame} - \item{cs1,cs2,cs3}{color parameters for scaling \samp{x}} - \item{alpha}{Value for transparency in colors. If more than one value is - passed, the alpha values will be transformed like the colors.} - \item{extremes}{The colors for the extreme values of \samp{x} (RGB only).} - \item{na.color}{The color to use for NA values of \samp{x}.} - \item{xrange}{An explicit range to use in the transformation.} - \item{color.spec}{The color specification to use in the transformation. - Anything other than "rgb", "hsv" or "hcl" will almost certainly fail.} -} -\details{ - \samp{color.scale} calculates a sequence of colors by a linear - transformation of the numeric values supplied into the ranges - for the three color parameters. If only one number is supplied for a - color range, that color remains constant for all values of \samp{x}. - If more than two values are supplied, the \samp{x} values will be - split into equal ranges (one less than the number of colors) and - the transformation carried out on each range. Values for a color - range must be between 0 and 1 for the RGB or HSV specifications, and - between 0 and 360 (cs1) and 0 to 100 (cs2 and cs3) for the HCL - specifications. - - IMPORTANT: If \samp{x} has fewer values than the number of values - in the color parameters, it will usually return incorrect - colors. This is usually only a problem when using \samp{color.legend} - with a small number of rectangles in the legend as \samp{color.legend} - calls \samp{color.scale} to calculate the color rectangles. - - If \samp{extremes} is not NA, the ranges will be calculated from - its values using \samp{col2rgb}, even if ranges are also supplied. - \samp{extremes} allows the user to just pass the extreme color values - in any format that \samp{col2rgb} will accept. Note that this forces - the color specification to RGB. - - If the user wants to specify a range of values with \samp{xrange}, - it must at least include the range of x values. This can be useful - when there is a notional range like 0-100\% that the values do not - cover, or when several series of values with different ranges are - to be assigned the same color scale. - - The user may not want the color scheme to be continuous across some - critical point, often zero. In this case, \samp{color.scale} can be called - separately for the values below and above zero. I may get around to - adding an argument to do this in one shot. Until then, see the second - example for \samp{color2D.matplot} and also the \samp{diverge.hcl} and - \samp{diverge.hsv} functions in the \pkg{colorspace} package. - - When passing more than one alpha value, it will be transformed like the - colors. This allows matrices with concentrations of high values to be - overplotted to illustrate group locations and separations. See the iris - example in \samp{color2D.matplot}. -} -\note{ - The function is useful for highlighting a numeric dimension or adding - an extra "dimension" to a plot. - - There are quite a few R functions that transform numeric values into - colors or produce colors that can be used to represent values. Two - packages that might be of interest are \pkg{RColorBrewer} and - \pkg{colourschemes}. See the last example for approximating other color - scales with \samp{color.scale}. -} -\value{A vector or matrix of hexadecimal color values.} -\author{Jim Lemon} -\seealso{\link{rescale}, \link{col2rgb}, \link{smoothColors}} -\examples{ - # go from green through yellow to red with no blue - x<-rnorm(20) - y<-rnorm(20) - # use y for the color scale - plot(x,y,col=color.scale(y,c(0,1,1),c(1,1,0),0),main="Color scale plot", - pch=16,cex=2) - plot(1:10,rep(1:3,length.out=10),axes=FALSE,type="n",xlim=c(0,11),ylim=c(0,4), - main="Test of RGB, HSV and HCL",xlab="",ylab="Color specification") - axis(2,at=1:3,labels=c("HCL","HSV","RGB")) - points(1:10,rep(1,10),pch=19,cex=8,col=color.scale(1:10,c(0,300),35,85, - color.spec="hcl")) - points(1:10,rep(2,10),pch=19,cex=8,col=color.scale(1:10,c(0,1), - 0.8,1,color.spec="hsv")) - points(1:10,rep(3,10),pch=19,cex=8,col=color.scale(1:10,c(1,0.5,0), - c(0,0.5,0),c(0,0,1),color.spec="rgb")) - \dontrun{ - # requires viridisLite - library(viridisLite) - plot(0,xlim=c(-1,1),ylim=c(-1,1),type="n",axes=FALSE, - main="Approximating other color scales",xlab="",ylab="") - gradient.rect(-1,0.8,1,0.95,nslices=50, - col=color.scale(1:50,1, - c(0,0.3,0.6,0.8,1,1), - c(0,0,0,0,0,0,1))) - text(0,1,"color.scale") - gradient.rect(-1,0.65,1,0.8,col=heat.colors(50)) - text(0,0.6,"heat.colors") - gradient.rect(-1,0.3,1,0.45,nslices=50, - col=color.scale(1:50,c(0,0.2,0.9,0.95,0.95), - c(0.7,0.8,0.9,0.7,0.95), - c(0.1,0,0,0.35,0.95))) - text(0,0.5,"color.scale") - gradient.rect(-1,0.15,1,0.3,col=terrain.colors(50)) - text(0,0.1,"terrain.colors") - gradient.rect(-1,-0.2,1,-0.05,nslices=50, - col=color.scale(1:50,c(0.3,0,0.3,0.1,1,0.95,1), - c(0,0.3,0.9,1,1,0.85,0.85), - c(1,1,0.9,0.1,0,0.5,0.5))) - text(0,0,"color.scale") - gradient.rect(-1,-0.35,1,-0.2,col=topo.colors(50)) - text(0,-0.4,"topo.colors") - gradient.rect(-1,-0.7,1,-0.55,nslices=50, - col=color.scale(1:50,c(0.3,0.2,0,0.4,0.95), - c(0.1,0.3,0.6,0.75,0.95), - c(0.3,0.6,0.5,0.4,0))) - text(0,-0.5,"color.scale") - gradient.rect(-1,-0.85,1,-0.7,col=viridis(50)) - text(0,-0.9,"viridis") - } -} -\keyword{misc} diff --git a/man/color.scale.lines.Rd b/man/color.scale.lines.Rd deleted file mode 100644 index 69720c5..0000000 --- a/man/color.scale.lines.Rd +++ /dev/null @@ -1,54 +0,0 @@ -\name{color.scale.lines} -\alias{color.scale.lines} -\title{Line segments with scaled colors} -\description{Display line segments with colors scaled to numeric values.} -\usage{ - color.scale.lines(x,y,reds,greens,blues,col=NA,colvar=NA,...) -} -\arguments{ - \item{x,y}{Numeric vectors or a list with at least two components, - the first two of which must be named x and y.} - \item{reds,greens,blues}{Color ranges into which to scale the - numeric values.} - \item{col}{One or more colors to use for the resultant lines. Will - be recycled if necessary.} - \item{colvar}{A numeric vector from which to scale the colors.} - \item{...}{Additional arguments passed to \samp{segments}.} -} -\details{ - \samp{color.scale.lines} displays line segments that can be individually - colored according to a variety of methods. In order of precedence, if - \samp{col} is not NA, the color values passed will be used. If - \samp{colvar} is not NA, the function will call \samp{color.scale} with - the three color range arguments to determine the line colors. If - \samp{colvar} is the same length as \samp{length(x)-1}, exactly enough - colors for the number of lines displayed will be calculated. If shorter, - some colors will be recycled and if longer, some colors will not be used. - Finally, the values in \samp{y} will be color-scaled if both of the above - arguments are NA. Thus the user can pass predetermined colors, use colors - scaled from an arbitrary vector of numerical values or use the \samp{y} - values. See \samp{color.scale} for an explanation of specifying color - ranges. -} -\note{ - The function is useful for highlighting a numeric dimension or adding - an extra "dimension" to a plot. -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{color.scale}} -\examples{ - # color a random walk "hot" (red) to "cold" (blue) on its distance - # from the starting point - x<-c(0,cumsum(rnorm(99))) - y<-c(0,cumsum(rnorm(99))) - xydist<-sqrt(x*x+y*y) - plot(x,y,main="Random walk plot",xlab="X",ylab="Y",type="n") - color.scale.lines(x,y,c(1,1,0),0,c(0,1,1),colvar=xydist,lwd=2) - boxed.labels(x,y,labels=1:100,border=FALSE,cex=0.5) - # now color the lines to show whether each step went away from - # or toward the starting position - color.scale.lines(x,y,col=2+(diff(xydist)>0)) - boxed.labels(x,y,labels=1:100,border=FALSE,cex=0.5) -} -\keyword{misc} diff --git a/man/color2D.matplot.Rd b/man/color2D.matplot.Rd deleted file mode 100755 index 8c54769..0000000 --- a/man/color2D.matplot.Rd +++ /dev/null @@ -1,165 +0,0 @@ -\name{color2D.matplot} -\alias{color2D.matplot} -\title{Display a numeric matrix as color matrix} -\description{ - Display the values of a numeric 2D matrix or data frame as colored - rectangles or hexagons. -} -\usage{ - color2D.matplot(x,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1), - extremes=NA,cellcolors=NA,show.legend=FALSE,nslices=10,xlab="Column", - ylab="Row",do.hex=FALSE,axes=TRUE,show.values=FALSE,vcol=NA,vcex=1, - border="black",na.color=NA,xrange=NULL,color.spec="rgb",yrev=TRUE, - xat=NULL,yat=NULL,Hinton=FALSE,add=FALSE,...) -} -\arguments{ - \item{x}{data values} - \item{cs1,cs2,cs3}{the color parameters that will be scaled to represent - the range of numeric values. (see \samp{color.scale})} - \item{extremes}{The colors for the extreme values of \samp{x}. Takes - precedence over the color ranges.} - \item{cellcolors}{A precalculated matrix of cell colors. This must have - the same number of rows and columns as the matrix or it will be - uninformative. It can be a vector, but be careTakes precedence over both \samp{extremes} - and color ranges.} - \item{show.legend}{whether to display a color legend with the - extreme numeric values in the lower left corner of the plot. This will - force the color specification to "rgb", so if this is different from - the color specification requested, call \samp{color.legend} separately.} - \item{nslices}{The number of color "slices" in the legend.} - \item{xlab,ylab}{axis labels for the plot.} - \item{do.hex}{plot packed hexagons instead of rectangles.} - \item{axes}{Whether to suppress the default axis labelling.} - \item{show.values}{Whether to display the numeric values of \samp{x}. - This also controls the number of decimal places displayed.} - \item{vcol}{The color for the value display. If NA, the values are displayed - in black or white depending upon the darkness of the cell color.} - \item{vcex}{The character expansion for the value display.} - \item{border}{The color(s) for the borders of the cells. Pass NA - if no border is wanted.} - \item{na.color}{The color to use for NA values of \samp{x}.} - \item{xrange}{An explicit range for the transformation of colors. - see \samp{color.scale}} - \item{color.spec}{The color specification system to use.} - \item{yrev}{Whether to reverse the order of the y-axis to display the - cells in "reading" order (left to right and top to bottom) if TRUE, - or in the order of a typical plot (left to right and bottom to top) if - FALSE.} - \item{xat,yat}{Values at which to place tick marks to override \samp{pretty}.} - \item{Hinton}{Whether to display a Hinton diagram in which the magnitude of - cell values is proportional to the size of the squares and the sign is - indicated by the color of the squares.} - \item{add}{If TRUE, no plot is created and the rectangles are displayed over - whatever is on the current device (see the "iris" example).} - \item{...}{arguments passed to \samp{plot}.} -} -\value{nil} -\details{ - Displays a plot with the same number of rectangular or hexagonal cells as - there are numeric values in the matrix or data frame. Each rectangle is - colored to represent its corresponding value. The rectangles are arranged - in the conventional display of a 2D matrix with rows beginning at the top - and columns at the left. To get the rows beginning at the bottom, use - \samp{yrev=FALSE}. The color scale defaults to black for the minimum - value and white for the maximum. - - The user will have to adjust the plot device dimensions to get regular - squares or hexagons, especially when the matrix is not square. As the - margins are not equivalent for all display devices, this is currently - a matter of trial and error. Drawing hexagons is quite slow. - - \samp{show.values} and \samp{show.legend} are also used to control the - number of decimal places displayed if the values or legend are shown. - \samp{TRUE} will give one decimal place, \samp{2} two, and so on. - - if \samp{Hinton} is TRUE, a Hinton diagram in which the sizes of the - squares are proportional to the absolute value of \samp{x} and the colors - of the squares indicate the sign of the \samp{x} values will be displayed. - This only works with squares. - - If \samp{add} is true, the color matrix is added to the current plot. This - is probably only useful when displaying plots that are mostly transparent. -} -\note{ - The function \link{image} performs almost the same when passed a - matrix of values without grid positions, except that it assigns values to - a specified list of colors rather than calculating a color for each distinct - value. -} -\author{Jim Lemon (thanks to Ashoka Polpitiya for \samp{axes})} -\seealso{\link{color.scale}, \link{fill.corner}, \link{image}} -\examples{ - x<-matrix(rnorm(1024),nrow=32) - # simulate a correlation matrix with values -0.5 to 0.5 - x<-rescale(x,c(-0.5,0.5)) - # add a column with the extreme values (-1,1) to calculate - # the colors, then drop the extra column in the result - cellcol<-color.scale(cbind(x,c(-1,rep(1,31))),c(0,1),0,c(1,0))[,1:32] - color2D.matplot(x,cellcolors=cellcol,main="Blue to red correlations") - # do the legend call separately to get the full range - color.legend(0,-4,10,-3,legend=c(-1,-0.5,0,0.5,1), - rect.col=color.scale(c(-1,-0.5,0,0.5,1),c(0,1),0,c(1,0)),align="rb") - x<-matrix(rnorm(100),nrow=10) - # generate colors that show negative values in red to brown - # and positive in blue-green to green - cellcol<-matrix(rep("#000000",100),nrow=10) - cellcol[x<0]<-color.scale(x[x<0],c(1,0.8),c(0,0.8),0) - cellcol[x>0]<-color.scale(x[x>0],0,c(0.8,1),c(0.8,0)) - # now do hexagons without borders - color2D.matplot(x,cellcolors=cellcol,xlab="Columns",ylab="Rows", - do.hex=TRUE,main="2D matrix plot (hexagons)",border=NA) - # for this one, we have to do the color legend separately - # because of the two part color scaling - legval<-seq(min(x),max(x),length.out=6) - legcol<-rep("#000000",6) - legcol[legval<0]<-color.scale(legval[legval<0],c(1,0.8),c(0,0.8),0) - legcol[legval>0]<-color.scale(legval[legval>0],0,c(0.8,1),c(0.8,0)) - color.legend(0,-1.8,3,-1.4,round(c(min(x),0,max(x)),1),rect.col=legcol) - # do a color only association plot - xt<-table(sample(1:10,100,TRUE),sample(1:10,100,TRUE)) - observed<-xt[,rev(1:dim(xt)[2])] - expected<-outer(rowSums(observed),colSums(observed),"*")/sum(xt) - deviates<-(observed-expected)/sqrt(expected) - cellcol<-matrix(rep("#000000",100),nrow=10) - cellcol[deviates<0]<- - color.scale(deviates[deviates<0],c(1,0.8),c(0,0.5),0) - cellcol[deviates>0]<- - color.scale(deviates[deviates>0],0,c(0.7,0.8),c(0.5,0)) - color2D.matplot(x=round(deviates,2),cellcolors=cellcol, - show.values=TRUE,main="Association plot") - # Hinton diagram - border.col<-color.scale(x,extremes=2:3) - color2D.matplot(x,extremes=c(2,3),main="Hinton diagram (green +, red -)", - Hinton=TRUE,border=border.col) - # waffle plot of percentages with two contributing elements - waffle.col<-fill.corner(c(rep("red",18),rep("blue",45)),10,10) - color2D.matplot(matrix(1:100,nrow=10),cellcolors=waffle.col,yrev=FALSE, - border="lightgray",xlab="",ylab="",main="Waffle plot",axes=FALSE) - # coarse density plot of the iris petal data - spnames<-unique(iris$Species) - spcols<-c("red","green","blue") - matmax<-list() - cindx<-1 - for(isp in spnames) { - petal_mat<-makeDensityMatrix(iris[iris$Species == isp,"Petal.Length"], - iris[iris$Species == isp,"Petal.Width"], - nx=20,ny=20,xlim=c(1,7),ylim=c(0,2.5),geocoord=FALSE) - # center the maximum markers in the cells - matmax[[cindx]]<-lapply(find_max_cell(petal_mat),"-",0.5) - if(isp == "setosa") - color2D.matplot(petal_mat,main="Iris petal length by petal width", - xlab="Petal length (cm)",ylab="Petal width (cm)",axes=FALSE, - cellcolors=color.scale(petal_mat,extremes=spcols[cindx],alpha=c(0,1)), - border=NA,yrev=FALSE) - else - color2D.matplot(petal_mat,border=NA,yrev=FALSE,add=TRUE, - cellcolors=color.scale(petal_mat,extremes=spcols[cindx],alpha=c(0,1))) - cindx<-cindx+1 - } - axis(1,at=seq(0,20,by=3.33),labels=1:7) - axis(2,at=seq(0,20,length.out=4),labels=seq(1,2.5,by=0.5)) - legend(1,6,paste0(spnames,"(",1:3,")"),fill=c("red","green","blue")) - for(cindx in 1:3) - text(matmax[[cindx]],as.character(cindx),col="white",cex=1.5) -} -\keyword{misc} diff --git a/man/corner.label.Rd b/man/corner.label.Rd deleted file mode 100644 index 86576ac..0000000 --- a/man/corner.label.Rd +++ /dev/null @@ -1,38 +0,0 @@ -\name{corner.label} -\alias{corner.label} -\title{Find corner locations and optionally display a label} -\description{ - Finds the coordinates in user parameters of a specified corner of the - figure region and optionally displays a label there -} -\usage{ - corner.label(label=NULL,x=-1,y=1,xoff=NA,yoff=NA,figcorner=FALSE,...) -} -\arguments{ - \item{label}{Text to display. The default is to display nothing.} - \item{x}{an integer value: -1 for the left side of the plot, 1 for the - right side} - \item{y}{an integer value: -1 for the bottom side of the plot, 1 for - the top side} - \item{xoff,yoff}{Horizontal and vertical text offsets. Defaults to one - half of the width and height of "m" respectively. } - \item{figcorner}{Whether to find/display at the corner of the plot or figure.} - \item{...}{further arguments to the \samp{text} command for the label} -} -\details{ - \samp{corner.label} finds the specified corner of the plot or figure and if - \samp{label} is not NULL, displays it there. The text justification is specified - so that the label will be justified away from the corner. To get the label - squeezed right into a corner, set \samp{xoff} and \samp{yoff} to zero. -} -\value{ - A list of the x and y positions of the corner adjusted for the offsets. -} -\author{Ben Bolker} -\examples{ - plot(1:10,1:10) - corner.label("A") - corner.label(x=1,y=1) - corner.label("B",y=-1,x=1,figcorner=TRUE,col="red") -} -\keyword{aplot} diff --git a/man/count.overplot.Rd b/man/count.overplot.Rd deleted file mode 100644 index 35d8d9e..0000000 --- a/man/count.overplot.Rd +++ /dev/null @@ -1,31 +0,0 @@ -\name{count.overplot} -\alias{count.overplot} -\title{Show overlying points as counts} -\usage{ - count.overplot(x,y,tol=NULL,col=par("fg"),pch="1",...) -} -\arguments{ - \item{x,y}{Two numeric data vectors or the first two columns of a matrix - or data frame. Typically the x/y coordinates of points to be plotted.} - \item{tol}{The largest distance between points that will be considered - to be overlying.} - \item{col}{Color(s) for the points (not the numbers).} - \item{pch}{Symbol(s) to display.} - \item{...}{additional arguments passed to \samp{plot}.} -} -\description{ - \samp{count.overplot} checks for overlying points defined as points - separated by a maximum of \samp{tol}, a two element numeric vector of - the x and y tolerance. Defaults to 1/2 of the width of a lower case - "o" in the x direction and 1/2 of the height of a lower case "o" in - the y direction. -} -\value{nil} -\keyword{misc} -\author{Jim Lemon} -\seealso{\link{cluster.overplot},\link{sizeplot}} -\examples{ - xy.mat<-cbind(sample(1:10,200,TRUE),sample(1:10,200,TRUE)) - count.overplot(xy.mat,main="count.overplot", - xlab="X values",ylab="Y values") -} diff --git a/man/cylindrect.Rd b/man/cylindrect.Rd deleted file mode 100644 index 82c2d91..0000000 --- a/man/cylindrect.Rd +++ /dev/null @@ -1,39 +0,0 @@ -\name{cylindrect} -\alias{cylindrect} -\title{Display an apparent cylinder} -\description{Display rectangles shaded to appear like cylinders.} -\usage{ - cylindrect(xleft,ybottom,xright,ytop,col,border=NA,gradient="x",nslices=50) -} -\arguments{ - \item{xleft}{The position of the left side of the rectangle(s).} - \item{ybottom}{The position of the bottom of the rectangle(s).} - \item{xright}{The position of the right side of the rectangle(s).} - \item{ytop}{The position of the top side of the rectangle(s).} - \item{col}{The base color(s) of the rectangles.} - \item{border}{Whether to draw a border and what color.} - \item{gradient}{Whether to vary the shading horizontally ("x" - the default) - or vertically (anything but "x").} - \item{nslices}{The number of "slices" of color for shading.} -} -\value{The base color(s) of the rectangle(s).} -\details{ - \samp{cylindrect} displays a rectangle filled with "slices" of color that - simulate the appearance of a cylinder. The slices are calculated so that the - base color appears at the right or bottom edge of the rectangle, becomes - progressively lighter to a "highlight" at two thirds of the width or height - and then darkens toward the base color again. - - The appearance is of a cylinder lit from above and to the left of the viewer. - The position of the apparent light source is hard coded into the function. -} -\author{Jim Lemon} -\seealso{\link{gradient.rect}} -\examples{ - plot(0,xlim=c(0,5),ylim=c(0,5),main="Examples of pseudocylindrical rectangles", - xlab="",ylab="",axes=FALSE,type="n") - cylindrect(0,0,1,5,"red") - cylindrect(rep(1,3),c(0,2,4),rep(4,3),c(1,3,5),"green",gradient="y") - cylindrect(4,0,5,5,"#8844aa") -} -\keyword{misc} diff --git a/man/death_reg.Rd b/man/death_reg.Rd deleted file mode 100644 index 09e6a6f..0000000 --- a/man/death_reg.Rd +++ /dev/null @@ -1,11 +0,0 @@ -\name{death_reg} -\alias{death_reg} -\title{Death registrations from 1996 to 2010} -\description{ - Death registrations for underlying cause of death as ICD-10 chapters for 1996 - to 2010. -} -\usage{ - data(death_reg) -} -\keyword{misc} diff --git a/man/dendroPlot.Rd b/man/dendroPlot.Rd deleted file mode 100644 index 99ef3e9..0000000 --- a/man/dendroPlot.Rd +++ /dev/null @@ -1,66 +0,0 @@ -\name{dendroPlot} -\alias{dendroPlot} -\title{ Display distributions as dendrites } -\description{ - Display the distributions of one or more sets of points as branching - (dendritic) clusters. -} -\usage{ - dendroPlot(x,breaks=list(10,10,10),pch=1,col=par("fg"),cex=1,nudge=NA, - setlabels=NA,...) -} -\arguments{ - \item{x}{A list or data frame of numeric or factor or character - columns.} - \item{breaks}{A list of cutpoints to transform numeric values into factors - (see \link{cut}). Must be at least one number >= 2.} - \item{pch}{Symbol(s) to use in plotting the values.} - \item{col}{Color(s) for the symbols.} - \item{cex}{Size of the symbol(s) to use in plotting.} - \item{nudge}{The amount to set each consecutive value in a category away from - the center of the dendrite.} - \item{setlabels}{Labels to place along the abcissa to identify the sets.} - \item{...}{Other arguments passed to plot.} -} -\details{ - \samp{dendroPlot} displays the distributions of categorical values as stacks - of "branches". The lengths of the branches show the number of values in each - category, rather like the opposed bars in a pyramid plot, except that there - is no separation of groups. The distribution of numeric values can also be - displayed by passing a set of breakpoints to categorize the values. The - breakpoints will usually be equidistant, but unevenly spaced breakpoints can - be passed. If an element of \samp{x} is numeric, the values of the - corresponding \samp{x} element will be used to place the points, but the - branches will be defined as the categories formed by applying the breaks to - those numeric values. - - Note that in the first example, the breakpoints for the first and third elements - are used to define the ten branches for each. The second element of \samp{x} - is already categorical, so the breakpoints are ignored. When comparing - distributions with very different ranges it may be necessary to adjust the - breakpoints to get a satisfactory result. - - Each successive point in a category is \samp{nudge}d away from the center - of the dendrite. If \samp{nudge} has more than one value, the points will be - nudged up and down for categorical variables to enable closer packing. The - second value of \samp{nudge} is ignored for numeric variables. The aspect - ratio of the plot, the character expansion and the nudging will have to be - adjusted to give the best point spacing for most dendroPlots. -} -\note{The \samp{ehplot} function is a much more versatile instantiation of this - type of plot. \samp{dendroPlot} has been retained as there are currently a few - differences that some users may find valuable. However, it is not impossible - that \samp{dendroPlot} will disappear in the future. Another very useful version - of this type of plot is \samp{beeswarm} in the \pkg{beeswarm} package. -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{ehplot}} -\examples{ - x<-list(runif(90,1,3),factor(sample(LETTERS[1:10],100,TRUE)),rnorm(80,mean=5)) - dendroPlot(x,xlab="Groups",ylab="Value of x",main="Test dendroPlot I") - # now apply a nudge factor and different breaks - dendroPlot(x,breaks=list(8,10,10),nudge=c(0.05,0.1), - xlab="Groups",ylab="Value of x",main="Test dendroPlot II") -} -\keyword{misc} diff --git a/man/densityGrid.Rd b/man/densityGrid.Rd deleted file mode 100644 index 2f3c32d..0000000 --- a/man/densityGrid.Rd +++ /dev/null @@ -1,101 +0,0 @@ -\name{densityGrid} -\alias{densityGrid} -\title{Display a matrix of cell values as symbols.} -\description{ - Displays a matrix of values as symbols on an existing image. -} -\usage{ - densityGrid(x,z=NULL,xrange=NA,zrange=NA,range.cex=c(1,10), - xlim=c(-180,180),ylim=c(-90,90),red=c(0,1),green=c(0,1),blue=c(0,1),alpha=1, - pch=".",geocoord=TRUE) -} -\arguments{ - \item{x}{Matrix of values representing counts in cells (usually locations).} - \item{z}{Optional matrix of values attached to the cells in x.} - \item{xrange,zrange}{Explicit ranges for the counts in x and z. Used to - define a "pretty" set of values to label legends.} - \item{range.cex}{The range of expansion for the symbols when this is used to - indicate the number of counts in the cells.} - \item{xlim}{The extreme coordinates in the horizontal direction (see Details).} - \item{ylim}{The extreme coordinates in the vertical direction (see Details).} - \item{red,green,blue}{Values in an RGB colorspace to use in transforming the - cell values into colors.} - \item{alpha}{Transparency of the colors.} - \item{pch}{The symbol to use in displaying the observation density. Either - "." or 15 seem to work well depending upon the resolution of the grid.} - \item{geocoord}{Whether the size of the symbols that indicate density when - there are intensity values should be corrected for a Mercator projection.} -} -\details{ - \samp{densityGrid} expects one matrix or a list of two matrices containing - values that will be transformed into colors or sizes of the symbols displayed. - The two matrices may be passed as a list. If only one matrix is present, the - color of the symbols is determined by the values (counts) in the matrix. If - a second matrix is passed, The values in that matrix will be used to determine - the colors, and the size of the symbols will be proportional to the values in - the first matrix. In the case of only one matrix, the user should set the - first value of \samp{range.cex} to the desired expansion of the symbols. - - Currently \samp{densityGrid} does not display anything in grid cells that have - zero count values. - - \samp{densityGrid} was developed to allow very large numbers of coordinate - locations to be accumulated in a matrix for display on a geographic map. Thus - the default limits refer to coordinates as latitude/longitude for the earth. - Because some geographic data are so numerous that memory limits are exceeded, - the underlying \samp{makeDensityMatrix} function can be run on small sections - of the entire data set and the resulting matrices added as long as the initial - coordinate limits are used throughout. Note that if the values for counts - (with one matrix) or for intensity (with two matrices) cover a very large - range, it may be necessary to trim extreme values (noting this on any legends) - and transform the data (usually log10) to get good color separation. -} -\value{ - nil. Displays a grid of symbols on an existing plot device. -} -\examples{ - \dontrun{ - data(l2010) - # log10 transform both density and intensity - l2010[[1]]<-log10(l2010[[1]]) - l2010[[2]]<-log10(l2010[[2]]) - library(maps) - x11(width=10) - par(mar=c(7,3,2,3)) - plot(0,xlim=c(-180,180),ylim=c(-90,90),type="n",axes=FALSE,xlab="",ylab="") - densityGrid(l2010,pch=".",xrange=c(0,6),zrange=c(2,8),range.cex=c(2,8), - red=c(0,0.5,1),green=c(0,1,0),blue=c(1,0,0),alpha=1) - color.legend(-60,-107,60,-97,c("2","3","4","5","6","7","8"), - rect.col=color.scale(1:7,cs1=c(0,0.5,1),cs2=c(0,1,0),cs3=c(1,0,0),alpha=1), - cex=0.5) - par(xpd=TRUE) - text(0,95,"Lightning strikes 2010") - text(0,-114,"Mean intensity kVA (10^n)",cex=0.5) - points(x=seq(-60,60,20),y=rep(-125,7),pch=".",cex=1:7) - text(x=seq(-60,60,20),y=rep(-132,7),c("<=1","2","3","4","5","6",">6"),cex=0.5) - text(0,-142,"Cell frequency (10^n)",cex=0.5) - par(xpd=FALSE) - map("world",mar=c(7,3,2,3),add=TRUE) - dev.off() - # now only Australia - par(mar=c(7,3,2,3)) - plot(0,xlim=c(112,154),ylim=c(-43.8,-11.1),type="n",axes=FALSE,xlab="",ylab="") - densityGrid(l2010,pch=".",xrange=c(0,6),zrange=c(2,8),range.cex=c(2,8), - xlim=c(112,154),ylim=c(-43.8,-11.1),red=c(0,0.5,1),green=c(0,1,0), - blue=c(1,0,0),alpha=1) - color.legend(120,-47,146,-45,c("2","3","4","5","6","7","8"), - rect.col=color.scale(1:7,cs1=c(0,0.5,1),cs2=c(0,1,0),cs3=c(1,0,0),alpha=1), - cex=0.5) - par(xpd=TRUE) - text(133,-9,"Lightning strikes 2010 (Australia)") - text(133,-48.2,"Mean intensity kVA (10^n)",cex=0.5) - points(x=seq(121,145,4),y=rep(-50,7),pch=".",cex=1:7) - text(x=seq(121,145,4),y=rep(-51,7),c("<=1","2","3","4","5","6",">6"),cex=0.5) - text(133,-52,"Cell frequency (10^n)",cex=0.5) - par(xpd=FALSE) - map("world",mar=c(7,3,2,3),xlim=c(112,154),ylim=c(-43.8,-11.1),add=TRUE) - } -} -\author{Jim Lemon} -\seealso{\link{makeDensityMatrix},\link{color.scale}} -\keyword{misc} diff --git a/man/diamondplot.Rd b/man/diamondplot.Rd deleted file mode 100644 index 3a263c9..0000000 --- a/man/diamondplot.Rd +++ /dev/null @@ -1,28 +0,0 @@ -\name{diamondplot} -\alias{diamondplot} -\title{Plot multiple variables as polygons on a radial grid} -\usage{ - diamondplot(x, bg=gray(0.6), col=rainbow,name="", ...) -} -\arguments{ - \item{x}{A data frame containing numeric values that represent attributes - (possibly repeated observations) of data objects. See the example.} - \item{bg}{The background color for the plot.} - \item{col}{The colors for the polygons.} - \item{name}{The title for the plot (i.e. \samp{main}).} - \item{...}{additional arguments passed to \samp{plot}.} -} -\description{ - \samp{diamondplot} displays a plot of polygons on a radial grid representing - the relationships between one or more attributes of data objects. For a slightly - different style of plot, see the "spiderweb plot" example in \samp{radial.plot}. -} -\value{nil} -\author{Elisa Biancotto} -\keyword{misc} -\seealso{\link{plot}, \link{radial.plot}} -\examples{ - data(mtcars) - mysubset<-mtcars[substr(dimnames(mtcars)[[1]],1,1)=="M",c("mpg","hp","wt","disp")] - diamondplot(mysubset) -} diff --git a/man/dispersion.Rd b/man/dispersion.Rd deleted file mode 100644 index 6232a63..0000000 --- a/man/dispersion.Rd +++ /dev/null @@ -1,84 +0,0 @@ -\name{dispersion} -\alias{dispersion} -\alias{dispbars} -\title{ Display a measure of dispersion. } -\description{ - Display lines or capped bars at specified points on a plot representing - measures of dispersion. -} -\usage{ - dispersion(x,y,ulim,llim=ulim,intervals=TRUE,arrow.cap=0.01,arrow.gap=NA, - type="a",fill=NA,lty=NA,pch=NA,border=NA,col=par("fg"),display.na=TRUE, - ...) -} -\arguments{ - \item{x,y}{x and y position of the centers of the bars} - \item{ulim,llim}{The extent of the dispersion measures.} - \item{arrow.cap}{The width of the cap at the outer end of each bar - as a proportion of the width of the plot.} - \item{arrow.gap}{The gap to leave at the inner end of each bar. - Defaults to two thirds of the height of a capital "O".} - \item{intervals}{Whether the limits are intervals (TRUE) or absolute values - (FALSE).} - \item{type}{What type of display to use.} - \item{fill}{Color to fill between the lines if \samp{type} is not NULL and - \samp{fill} is not NA.} - \item{lty}{Line type for redrawing the lines if necessary.} - \item{pch}{Symbol for redrawing the points if necessary.} - \item{border}{Line type for drawing a border on the confidence band.} - \item{col}{Color for the lines or capped bars.} - \item{display.na}{Whether to display NA values as lines going off the plot.} - \item{...}{additional arguments passed to \samp{arrows} or \samp{lines} - depending upon \samp{type}.} -} -\details{ - \samp{dispersion} displays a measure of dispersion on an existing plot. - Currently it will display either vertical lines with caps (error bars) or lines - that form a "confidence band" around a line of central tendency. If \samp{fill} - is not NA and \samp{type} is \samp{"l"}, a polygon will be drawn between the - confidence lines. Remember that any points or lines within the confidence band - will be obscured, so pass point and/or line types as in the second example. - - The default behavior is to display an undefined dispersion (e.g. a variance with - only one observation) as a line going off the plot. If \samp{display.na} is FALSE, - NA values will not be displayed, allowing the user to show only upper or lower - dispersion limits. - - The \samp{intervals} argument allows the user to pass the limits as either - intervals (the default) or absolute values. - - If \samp{arrow.gap} is greater than or equal to the upper or lower - limit for a bar, \samp{segments} is used to draw the upper and - lower caps with no bars to avoid zero length arrows. -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{arrows}, \link{segments},\link{lines}} -\examples{ - disptest<-matrix(rnorm(200),nrow=20) - disptest.means<-rowMeans(disptest) - row.order<-order(disptest.means) - se.disptest<-unlist(apply(disptest,1,std.error)) - plot(disptest.means[row.order],main="Dispersion as error bars", - ylim=c(min(disptest.means-se.disptest),max(disptest.means+se.disptest)), - xlab="Occasion",ylab="Value") - dispersion(1:20,disptest.means[row.order],se.disptest[row.order]) - plot(disptest.means[row.order],main="Dispersion as confidence band", - ylim=c(min(disptest.means-se.disptest),max(disptest.means+se.disptest)), - xlab="Occasion",ylab="Value") - dispersion(1:20,disptest.means[row.order],se.disptest[row.order],type="l", - fill="#eeccee",lty=2,pch=1) - disptest2<-matrix(sample(c(TRUE,FALSE),200,TRUE),nrow=10) - disptest.prop<-rowMeans(disptest2) - disptest.ulim<-disptest.llim<-rep(NA,10) - for(i in 1:10) { - disptest.ulim[i]<-binciWu(disptest2[i,],20) - disptest.llim[i]<-binciWl(disptest2[i,],20) - } - plot(disptest.prop,main="Dispersion as binomial confidence intervals", - ylim=c(min(disptest.llim),max(disptest.ulim)), - xlab="Sample",ylab="Proportion") - dispersion(1:10,disptest.prop,disptest.ulim,disptest.llim, - interval=FALSE,lty=2,pch=1) -} -\keyword{misc} diff --git a/man/do.first.Rd b/man/do.first.Rd deleted file mode 100644 index 814e270..0000000 --- a/man/do.first.Rd +++ /dev/null @@ -1,16 +0,0 @@ -\name{do.first} -\alias{do.first} -\title{ Execute a graphic function on a plot } -\description{ do.first allows the user to execute one or more commands before - displaying values on a plot. } -\details{ - \samp{do.first} is an argument in some plotrix functions that allows the user - to do things like add a background color or a grid to the plot before - displaying the other plot elements. - - The value of \samp{do.first} should be a character string that can be parsed - to one or more valid R commands. Remember to enclose the string in quotes, - separate commands with semicolons and escape quotes within the string with - backslashes if necessary. -} -\keyword{misc} diff --git a/man/dotplot.mtb.Rd b/man/dotplot.mtb.Rd deleted file mode 100644 index 09c02bf..0000000 --- a/man/dotplot.mtb.Rd +++ /dev/null @@ -1,61 +0,0 @@ -\name{dotplot.mtb} -\alias{dotplot.mtb} -\title{ Minitab style dotplots. } -\description{ - Create a dotplot of a data vector in the sense of "dotplot" as - used in the Minitab\eqn{\mbox{\copyright}} package. -} -\usage{ -dotplot.mtb(x, xlim = NULL, main = NULL, xlab = NULL, ylab = NULL, - pch = 19, hist = FALSE, yaxis = FALSE, mtbstyle=TRUE) -} -\arguments{ - \item{x}{ A numeric vector. } - \item{xlim}{ The x limits of the plot. } - \item{main}{ A title for the plot; defaults to blank.} - \item{xlab}{ A label for the x axis; defaults to blank.} - \item{ylab}{ A label for the y axis; defaults to blank.} - \item{pch}{ The plotting symbol for the dots in the plot; - defaults to a solid disc. } - \item{hist}{ Logical scalar; should the plot be done "histogram" - style, i.e. using vertical lines rather than stacks - of dots?} - \item{yaxis}{ Logical scalar; should a y-axis be produced? } - \item{mtbstyle}{ Logical scalar; should the dotplot be done in - the "Minitab" style? I.e. should the zero level - be at the vertical midway point? } -} -\details{ - The result of \code{hist=TRUE} looks less ugly than stacks of - dots for very large data sets. -} -\value{ - Nothing. A plot is produced as a side effect. -} -\author{ Barry Rowlingson - \email{B.Rowlingson@lancaster.ac.uk} - and Rolf Turner - \email{r.turner@auckland.ac.nz} - \url{http://www.stat.auckland.ac.nz/~rolf} -} -\section{Warnings}{ -This function does something toadally different from the \code{dotplot()} -(now \code{\link{dotchart}()}) function in the graphics package. - -The labelling of the \code{y}-axis is device dependent. -} - -\examples{ -\dontrun{ -set.seed(42) -x <- rpois(100,10) -dotplot.mtb(x,main="No y-axis.") -dotplot.mtb(x,yaxis=TRUE,main="With y-axis displayed.") -dotplot.mtb(x,hist=TRUE,main="An \"h\" style plot.") -dotplot.mtb(x,xlim=c(4,16),main="With the x-axis limited.") -dotplot.mtb(x,yaxis=TRUE,mtbstyle=FALSE,main="Non-Minitab style.") -dotplot.mtb(x,yaxis=TRUE,xlab="x",ylab="count", - main="With x and y axis labels.") -} -} -\keyword{ hplot } diff --git a/man/draw.arc.Rd b/man/draw.arc.Rd deleted file mode 100644 index 4a9e516..0000000 --- a/man/draw.arc.Rd +++ /dev/null @@ -1,55 +0,0 @@ -\name{draw.arc} -\alias{draw.arc} -\title{ Draw arc } -\description{ - Draw one or more arcs using classic graphics. -} -\usage{ - draw.arc(x=1,y=NULL,radius=1,angle1=deg1*pi/180,angle2=deg2*pi/180, - deg1=0,deg2=45,n=0.05,col=NA,lwd=NA,...) -} -\arguments{ - \item{x}{ x coordinate of center. Scalar or vector. } - \item{y}{ y coordinate of center. Scalar or vector. } - \item{radius}{ radius. Scalar or vector. } - \item{angle1}{ Starting angle in radians. Scalar or vector. } - \item{angle2}{ Ending angle in radians. Scalar or vector. } - \item{deg1}{ Starting angle in degrees. Scalar or vector. } - \item{deg2}{ Ending angle in degrees. Scalar or vector. } - \item{n}{ Number of polygons to use to approximate the arc. } - \item{col}{ Arc colors. } - \item{lwd}{Line width for the arc.} - \item{...}{ Other arguments passed to segments. Vectorization - is not supported for these. } -} -\details{ - Draws one or more arcs from \code{angle1} to \code{angle2}. - If \code{angle1} is numerically greater than \code{angle2}, - then the angles are swapped. - - Be sure to use an aspect ratio of 1 as shown in - the example to avoid distortion. For argument 'n' (which may be - either a scalar or a vector, although most likely you will leave - it at the default value), an integer value means to use that number - of segments to approximate the arc, while a non-integer value means - to use enough segments so that the angle that successive segments - make with one another is no more than n radians. -} -\value{ - Returns a matrix of expanded arguments invisibly. -} -\author{Gabor Grothendieck. Improvements by Ted Toal.} -\examples{ - - plot(1:10, asp = 1,main="Test draw.arc") - draw.arc(5, 5, 1:10/10, deg2 = 1:10*10, col = "blue") - draw.arc(8, 8, 1:10/10, deg2 = 1:10*10, col = 1:10) - draw.arc(5, 5, 3, deg1=100, deg2=170, col="gold", lwd=50, lend=1) - # example taken from post by Hans Borcher: - # https://stat.ethz.ch/pipermail/r-help/2009-July/205728.html - # Note setting of aspect ratio to 1 first. - curve(sin(x), 0, pi, col="blue", asp=1) - draw.arc(pi/2, 0, 1, deg1=45, deg2=135, col="red") - -} -\keyword{misc} diff --git a/man/draw.circle.Rd b/man/draw.circle.Rd deleted file mode 100644 index c9a565c..0000000 --- a/man/draw.circle.Rd +++ /dev/null @@ -1,39 +0,0 @@ -\name{draw.circle} -\alias{draw.circle} -\title{Draw a circle} -\description{Draws a circle on an existing plot.} -\usage{ - draw.circle(x,y,radius,nv=100,border=NULL,col=NA,lty=1,density=NULL, - angle=45,lwd=1) -} -\arguments{ - \item{x,y}{Coordinates of the center of the circle.} - \item{radius}{Radius (or radii) of the circle(s) in user units.} - \item{nv}{Number of vertices to draw the circle.} - \item{border}{Color to use for drawing the circumference.} - \item{col}{Color to use for filling the circle.} - \item{lty}{Line type for the circumference.} - \item{density}{Density for patterned fill. See \samp{polygon}.} - \item{angle}{Angle of patterned fill. See \samp{polygon}.} - \item{lwd}{Line width for the circumference.} -} -\value{ - A list with the x and y coordinates of the points on the circumference - of the last circle displayed. -} -\details{ - \samp{draw.circle} uses the dimensions of the plot and the \samp{x} and - \samp{y} coordinates to draw a circle rather than an ellipse. -} -\author{Jim Lemon, thanks to David Winsemius for the density and angle args} -\seealso{\link{polygon}} -\examples{ - plot(1:5,seq(1,10,length=5),type="n",xlab="",ylab="",main="Test draw.circle") - draw.circle(2,4,c(1,0.66,0.33),border="purple", - col=c("#ff00ff","#ff77ff","#ffccff"),lty=1,lwd=1) - draw.circle(2.5,8,0.6,border="red",lty=3,lwd=3) - draw.circle(4,3,0.7,border="green",col="yellow",lty=1, - density=5,angle=30,lwd=10) - draw.circle(3.5,8,0.8,border="blue",lty=2,lwd=2) -} -\keyword{misc} diff --git a/man/draw.ellipse.Rd b/man/draw.ellipse.Rd deleted file mode 100644 index 7ac14d6..0000000 --- a/man/draw.ellipse.Rd +++ /dev/null @@ -1,69 +0,0 @@ -\name{draw.ellipse} -\alias{draw.ellipse} -\title{Draw ellipse} -\description{Draws ellipses on an existing plot.} -\usage{ -draw.ellipse(x, y, a = 1, b = 1, angle = 0, segment = NULL, -arc.only = TRUE, deg = TRUE, nv = 100, border = NULL, -col = NA, lty = 1, lwd = 1, ...) -} -\arguments{ - \item{x}{ -A vector or a matrix (if \code{y} is missing).} - \item{y}{ -A vector, can be missing. -} - \item{a,b}{ -Vectors, radii of the ellypses along the two axes in user units. -} - \item{angle}{ -Angle of rotation in degrees (if \code{deg=TRUE}) or in radians - (if \code{deg=FALSE}). -} - \item{segment}{ -Start and endpoints of arc in degrees (if \code{deg=TRUE}) or in radians - (if \code{deg=FALSE}). -} - \item{arc.only}{ -Logical, if \code{segmen} the full ellipse is not drawn, radii from the -ends of the arc are drawn to form a sector (see Examples). -} - \item{deg}{ -Logical, if angles are given in degrees (\code{TRUE}) or radians. -} - \item{nv}{ -Number of vertices to draw the ellipses. -} - \item{border}{ -Color to use for drawing the circumference. -} - \item{col}{ -Color to use for filling the circle. -} - \item{lty}{ -Line type for the circumference. -} - \item{lwd}{ -Line width for the circumference. -} - \item{\dots}{ -Additional arguments passed to \code{\link{polygon}}. -} -} -\value{Draw ellipses as a side effect.} -\author{Peter Solymos } -\seealso{\link{polygon}} -\examples{ -plot(c(0,10), c(0,10), type="n", main="test draw.ellipse") -draw.ellipse(c(3,7), c(8,8), c(0.5,1), c(1,0.5), col=c(2,4), - angle=c(45,0), segment=rbind(c(0,45),c(45,360))) -draw.ellipse(c(3,7), c(6,6), c(0.5,1), c(1,0.5), col=c(2,4), - angle=c(45,0), segment=rbind(c(0,45),c(45,360)), arc.only=FALSE) -draw.ellipse(c(3,7), c(4,4), c(0.5,1), c(1,0.5), border=c(2,4), - angle=c(45,0), segment=rbind(c(0,45),c(45,360)), arc.only=FALSE) -draw.ellipse(c(3,7), c(2,2), c(0.5,1), c(1,0.5), border=1, - angle=c(45,0), lty=3) -draw.ellipse(c(3,7), c(2,2), c(0.5,1), c(1,0.5), border=c(5,3), - angle=c(45,0), nv=c(3,4), lty=2, lwd=2) -} -\keyword{misc} diff --git a/man/draw.radial.line.Rd b/man/draw.radial.line.Rd deleted file mode 100644 index 3e5c21b..0000000 --- a/man/draw.radial.line.Rd +++ /dev/null @@ -1,56 +0,0 @@ -\name{draw.radial.line} -\alias{draw.radial.line} -\title{Draw a radial line} -\description{Draws a line radiating from a specified center, optionally - expanding the line width as a function of distance from center.} -\usage{ - draw.radial.line(start, end, center=c(0, 0), angle=0, deg=NA, - expand=FALSE, col=NA, lwd=NA, ...) -} -\arguments{ - \item{start}{Distance from center of circular area to start of line in - x/y user units.} - \item{end}{Distance from center of circular area to end of line in x/y - user units.} - \item{center}{The center of the circular area in x/y user units.} - \item{angle}{The angular position of the line in radians.} - \item{deg}{The angular position of the line in degrees - (takes precedence if not NA).} - \item{expand}{TRUE to expand line width in proportion to distance from - center.} - \item{col}{The color of the line, NA for par("col").} - \item{lwd}{The width of the line in device-specific units, - NA for par("lwd").} - \item{...}{Arguments passed to 'lines' (expand=FALSE) or 'polygon' - (expand=TRUE).} -} -\value{nil} -\details{ - If the user passes a value for 'deg', this overrides any value passed - to 'angle'. - - If 'expand' is FALSE, the line width is constant (as specified by par("lwd"). - - If 'expand' is TRUE, the line width is equal to the lwd value at distance - 'end' and contracts as it moves towards 'start'. When expand is 'TRUE', - lty is ignored. -} -\author{Ted Toal} -\seealso{\ - \code{\link{lines}}, - \code{\link{draw.arc}}. -} -\examples{ - plot(0, xlim=c(1,5), ylim=c(1,5), main="Test of radial lines", xlab="", ylab="", type="n") - points(3, 3, pch=20) - draw.radial.line(1, 2, center=c(3,3)) - draw.radial.line(1, 2, center=c(3,3), angle=pi/4) - draw.radial.line(1, 2, center=c(3,3), angle=pi/4+0.1, col="blue", lwd=4, lty=3) - draw.radial.line(0.2, 1.2, center=c(3,3), deg=120, col="red", lwd=10) - draw.radial.line(0.2, 1.2, center=c(3,3), deg=145, col="purple", lwd=10, lend=1) - draw.radial.line(0.5, 2, center=c(3,3), deg=225, expand=TRUE, col="gold") - draw.radial.line(0.7, 1.4, center=c(3,3), deg=180, expand=TRUE, col="orange", lwd=30) - draw.radial.line(0.5, 1.5, center=c(3,3), deg=235, expand=TRUE, lwd=5, col="brown") - draw.radial.line(0.1, 1.5, center=c(3,3), deg=325, expand=TRUE, lwd=5, col="green") -} -\keyword{misc} diff --git a/man/draw.tilted.sector.Rd b/man/draw.tilted.sector.Rd deleted file mode 100644 index 8b4c8de..0000000 --- a/man/draw.tilted.sector.Rd +++ /dev/null @@ -1,40 +0,0 @@ -\name{draw.tilted.sector} -\alias{draw.tilted.sector} -\title{Display a 3D pie sector} -\description{ - Displays a 3D pie sector. -} -\usage{ - draw.tilted.sector(x=0,y=0,edges=NA,radius=1,height=0.1,theta=pi/6, - start=0,end=pi*2,border=par("fg"),col=par("bg"),explode=0,shade=0.8) -} -\arguments{ - \item{x,y}{Position of the center of the pie sector in user units} - \item{edges}{Number of edges to draw a complete ellipse} - \item{radius}{the radius of the pie in user units} - \item{height}{the height of the pie in user units} - \item{theta}{The angle of viewing in radians} - \item{start}{Starting angle of the sector} - \item{end}{Ending angle of the sector} - \item{border}{The color of the sector border lines} - \item{col}{Color of the sector} - \item{explode}{How far to "explode" the sectors in user units} - \item{shade}{If > 0 and < 1, the proportion to reduce the - brightness of the sector color to get a better 3D effect.} -} -\value{ - The bisector of the pie sector in radians. -} -\details{ - \samp{draw.tilted.sector} displays a single 3D pie sector. It is probably - only useful when called from \link{pie3D}. The \samp{shade} - argument proportionately reduces the brightness of the RGB color of - the sector to produce a top lighted effect. - - If \samp{explode} is zero, only the top and outer side of each - sector will be displayed. This will sometimes fix the problem of a pie with - one huge sector greater than 3*pi/2 that cannot otherwise be drawn. -} -\author{Jim Lemon} -\seealso{\link{pie3D}} -\keyword{misc} diff --git a/man/drawNestedBars.Rd b/man/drawNestedBars.Rd deleted file mode 100644 index acc6384..0000000 --- a/man/drawNestedBars.Rd +++ /dev/null @@ -1,43 +0,0 @@ -\name{drawNestedBars} -\alias{drawNestedBars} -\title{Display nested bars} -\description{Displays the nested bars for barNest.} -\usage{ - drawNestedBars(x,start,end,shrink=0.1,errbars=FALSE,intervals=TRUE,col=NA, - labelcex=1,lineht=NULL,showall=TRUE,Nwidths=FALSE,barlabels=NULL, - showlabels=TRUE,arrow.cap=NA) -} -\arguments{ - \item{x}{One level of the breakdown produced by \samp{brkdnNest}.} - \item{start,end}{The left and right x coordinates for the bar or group of bars - to be displayed.} - \item{shrink}{The proportion to shrink the width of the bars at each level.} - \item{errbars}{Whether to display error bars on the bars.} - \item{intervals}{Whether to use offsets or absolute values when displaying - measures of dispersion.} - \item{col}{The colors to use to fill the bars. See Details.} - \item{labelcex}{Character size for the group labels.} - \item{lineht}{The height of a margin line in user units.} - \item{showall}{Whether to display the bars at any levels above the last.} - \item{Nwidths}{Whether to scale the widths of the bars to the number of - observations.} - \item{barlabels}{Optional labels to display below the bars.} - \item{showlabels}{Whether to display the labels below the bars.} - \item{arrow.cap}{The width of the "cap" on error bars in user units, - defaulting to 0.01 of the width of the plot.} -} -\value{nil} -\details{ - \samp{drawNestedBars} displays the bars for the nested breakdown performed - by \samp{brkdnNest}. It starts at the top of the list and calls itself for - each level of the breakdown. It is unlikely to be useful for anything else. - - The combination of \samp{showlabels=TRUE} and \samp{showall=FALSE} allows - the display of all of the labels below the plot with only the last set of - bars being displayed. To have a set of labels not displayed, pass explicit - \samp{barlabels} and have zero length labels for the level that is not to - have labels. -} -\author{Jim Lemon and Ofir Levy} -\seealso{\link{brkdnNest}, \link{drawNestedBars}} -\keyword{misc} diff --git a/man/drawSectorAnnulus.Rd b/man/drawSectorAnnulus.Rd deleted file mode 100644 index 4d970ec..0000000 --- a/man/drawSectorAnnulus.Rd +++ /dev/null @@ -1,23 +0,0 @@ -\name{drawSectorAnnulus} -\alias{drawSectorAnnulus} -\title{Display a radial pie sector} -\description{ - Displays a radial pie sector with optional annuli. -} -\usage{ - drawSectorAnnulus(angle1,angle2,radius1,radius2,col,angleinc=0.03) -} -\arguments{ - \item{angle1,angle2}{Start and end angle for the sector.} - \item{radius1,radius2}{Start and end of the radial extent of the annulus.} - \item{col}{Color of the sector.} - \item{angleinc}{The angular increment to use in drawing the arcs.} -} -\value{nil} -\details{ - \samp{drawSectorAnnulus} displays a single radial pie sector. It is probably - only useful when called from \link{radial.pie}. -} -\author{Jim Lemon} -\seealso{\link{radial.pie}} -\keyword{misc} diff --git a/man/ehplot.Rd b/man/ehplot.Rd deleted file mode 100644 index f251e36..0000000 --- a/man/ehplot.Rd +++ /dev/null @@ -1,86 +0,0 @@ -\name{ehplot} -\alias{ehplot} -%- Also NEED an '\alias' for EACH other topic documented here. -\title{ - Engelmann-Hecker-Plot - EH-Plot -} -\description{ - This R function provides a convenient way to visualize the distribution of - grouped numerical data. -} -\usage{ - ehplot(data, groups, intervals=50, offset=0.1, log=FALSE, - median=TRUE, box=FALSE, boxborder="grey50", - xlab="groups", ylab="values", col="black", - add=FALSE, sort=TRUE, ...) -} -\arguments{ - \item{data}{ - Vector of numerical data. -} - \item{groups}{ - Vector of group names which should have the same length as data. -} - \item{intervals}{ - The data is splitted into a certain number of intervals. If data - points are in the same interval they are drawn side-by-side. -} - \item{offset}{ - x-distance between two data points at the same interval. -} - \item{log}{ - Logarithmic display -} - \item{median}{ - To show the median of each group. NAs in data are not considered - for calculating the medians. -} - \item{box}{ - To underlay a boxplot. -} - \item{boxborder}{ - The color of the boxplot if a boxplot is drawn. -} - \item{xlab}{ - x-axis label -} - \item{ylab}{ - y-axis label -} - \item{col}{ - vector of colors for the datapoints. (recycled as necessary). -} - \item{add}{ - add this plot to an existing one (i.e. do not call plot.new). -} - \item{sort}{ - normally, the groups are sorted by name. To keep the order as provided in - the groups-vector, set this to FALSE -} - \item{\dots}{ - additional plot-parameters will be passed to the plot-function -} - -} -\author{ - Robby Engelmann and - Michael Hecker -} - -\examples{ -data(iris) -ehplot(iris$Sepal.Length, iris$Species, intervals=20, cex=1.8, pch=20) -ehplot(iris$Sepal.Width, iris$Species, intervals=20, box=TRUE, median=FALSE) -ehplot(iris$Petal.Length, iris$Species, pch=17, col="red", log=TRUE) -ehplot(iris$Petal.Length, iris$Species, offset=0.06, pch=as.numeric(iris$Species)) - -# Groups don't have to be presorted: -rnd <- sample(150) -plen <- iris$Petal.Length[rnd] -pwid <- abs(rnorm(150, 1.2)) -spec <- iris$Species[rnd] -ehplot(plen, spec, pch=19, cex=pwid, col=rainbow(3, alpha=0.6)[as.numeric(spec)]) -} -% Add one or more standard keywords, see file 'KEYWORDS' in the -% R documentation directory. -\keyword{ misc } diff --git a/man/election.Rd b/man/election.Rd deleted file mode 100644 index ebb03ce..0000000 --- a/man/election.Rd +++ /dev/null @@ -1,62 +0,0 @@ -\name{election} -\alias{election} -\title{Assign party members to seats} -\description{Create a layout for an election result in an assembly} -\usage{ - election(seats,result,formula,colours = sample(rainbow(length(counts)))) -} -\arguments{ - \item{seats}{A data frame of x and y positions, row numbers and angles - (usually the output from the seats function).} - \item{result}{A data frame with party names and seat counts.} - \item{formula}{A formula with the party name column on the left and the - count column on the right. Think of the twiddle symbol as "got".} - \item{colours}{A vector of colours. If missing a random rainbow is used. - This may cause Green parties to show as red.} -} -\value{ - A data frame including: - \item{x}{The x positions of the seats to be plotted on semi-circular - arcs.} - \item{y}{The y positions of the seats to be plotted on semi-circular - arcs.} - \item{r}{The row numbers for each seat.} - \item{theta}{The angle of each seat, going from pi to zero radians.} - \item{party}{The labels for the party holding each seat.} - \item{colour}{The colour that has been assigned to the party.} -} -\author{Barry Rowlingson} -\seealso{\link{seats}} -\examples{ - # The EU parliament has 751 seats, and Wikipedia currently shows this - eu = structure(list(colour = c("#3399FF", "#F0001C", "#0054A5", "#FFD700", - "#990000", "#909090", "#32CD32", "#40E0D0"), party = c("EPP", - "S and D", "ECR", "ALDE", "GUE-NGL", "Non-Inscrits", "Greens-EFA", - "EFDD"), members = c(220L, 191L, 70L, 68L, 52L, 52L, 50L, 48L - )), .Names = c("colour", "party", "members"), row.names = c(NA, - -8L), class = "data.frame") - strasbourg = seats(751, 16) - eugov = election(strasbourg, eu, party~members, colours=eu$colour) - oldmar<-par(mar=c(2,4,4,2)) - plot(eugov$x, eugov$y, col=eugov$colour, asp=1, pch=19, ylim=c(-2,2.5), - xlab="", ylab="", main="EU Parliament 2014", axes=FALSE) - legend(-0.7,-0.3,eu$party,fill=eu$colour) - par(oldmar) - # or using ggplot2 - \dontrun{ - require(ggplot2) - blank = theme(axis.line=element_blank(), - axis.text.x=element_blank(), - axis.text.y=element_blank(), - axis.ticks=element_blank(), - axis.title.x=element_blank(), - axis.title.y=element_blank(), - panel.background=element_blank(), - panel.border=element_blank(), - panel.grid.major=element_blank(), - panel.grid.minor=element_blank(), - plot.background=element_blank()) - ggplot(eugov, aes(x=x,y=y,col=party)) + geom_point() + coord_fixed() + blank - } -} -\keyword{misc} diff --git a/man/emptyspace.Rd b/man/emptyspace.Rd deleted file mode 100644 index 74c4f3a..0000000 --- a/man/emptyspace.Rd +++ /dev/null @@ -1,38 +0,0 @@ -\name{emptyspace} -\alias{emptyspace} -\title{ Find an empty space on a plot } -\description{ - Try to find the largest empty rectangle on a plot. -} -\usage{ - emptyspace(x,y=NULL) -} -\arguments{ - \item{x,y}{x and y positions of the points on the plot.} -} -\details{ - \samp{emptyspace} searches the pairs of points on the plot to find - the largest rectangular space within which none of the points lie. - It does not guarantee that the space will be large enough to fit a - legend or text. - - Two alternatives are the \samp{largest.empty} function in the - \pkg{Hmisc} package and the \samp{maxEmptyRect} function. While - \samp{maxEmptyRect} will generally outperform \samp{emptyspace}, - \samp{emptyspace} will sometimes find a slightly smaller, but - "squarer" rectangle. -} -\value{ - The \samp{x} and \samp{y} coordinates of the center of the rectangle - found. -} -\author{Ray Brownrigg} -\examples{ - x<-rnorm(100) - y<-rnorm(100) - plot(x,y,main="Find the empty space",xlab="X",ylab="Y") - es<-emptyspace(x,y) - # use a transparent background so that any overplotted points are shown - boxed.labels(es,labels="Here is the\nempty space",bg="transparent") -} -\keyword{misc} diff --git a/man/fan.plot.Rd b/man/fan.plot.Rd deleted file mode 100644 index 8d4d080..0000000 --- a/man/fan.plot.Rd +++ /dev/null @@ -1,58 +0,0 @@ -\name{fan.plot} -\alias{fan.plot} -\title{ Display a fan plot } -\description{ - Displays numerical values as the arcs of overlapping sectors. -} -\usage{ - fan.plot(x,edges=200,radius=1,col=NULL,align.at=NULL,max.span=NULL, - labels=NULL,labelpos=NULL,label.radius=1.2,align="left",shrink=0.02, - main="",ticks=NULL,include.sumx=FALSE,...) -} -\arguments{ - \item{x}{Vector of numbers.} - \item{edges}{The number of edges with which to draw a circle.} - \item{radius}{The radius of the sectors.} - \item{col}{The colors with which to fill the sectors.} - \item{align.at}{Where to align the sectors (see Details).} - \item{max.span}{The angle of the maximal sector in radians. The default - is to scale \samp{x} so that it sums to 2*pi.} - \item{labels}{Labels placed around the sector arcs.} - \item{labelpos}{Optional circumferential positions for the labels.} - \item{label.radius}{How far away from the sectors the labels will - be placed. May be a vector with a radius for each label.} - \item{align}{Position of the alignment of sectors (see Details).} - \item{shrink}{How much to shrink each successive sector in user units.} - \item{main}{Optional title for the plot.} - \item{ticks}{The number of ticks that would appear if the sectors were on - a pie chart. Default is no ticks, TRUE gives the number of ticks equal to - the integer sum of \samp{x}, which is fairly sensible if - \samp{x} is a vector of integers.} - \item{include.sumx}{Whether to include the sum of all \samp{x} values - as the largest sector.} - \item{...}{Additional arguments passed to \samp{polygon}.} -} -\details{ - \samp{fan.plot} displays sectors much like a pie chart except that the - sectors are overlapped. this allows the angular extents of the sectors to - be visually compared much more accurately by the viewer. Sectors are plotted - from the largest to the smallest, shrinking the radius of each successive - sector. - - When sending output to the postscript device, the resulting image can be - trimmed by changing the values in BoundingBox in the header with a text - editor. -} -\value{ - The circumferential positions of the labels in radians. These are - returned in order of decreasing size of the values plotted. -} -\author{Jim Lemon, Anupam Tyagi} -\examples{ - iucn.df<-data.frame(area=c("Africa","Asia","Europe","N&C America", - "S America","Oceania"),threatened=c(5994,7737,1987,4716,5097,2093)) - fan.plot(iucn.df$threatened,max.span=pi, - labels=paste(iucn.df$area,iucn.df$threatened,sep="-"), - main="Threatened species by geographical area (fan.plot)",ticks=276) -} -\keyword{misc} diff --git a/man/feather.plot.Rd b/man/feather.plot.Rd deleted file mode 100644 index 451580c..0000000 --- a/man/feather.plot.Rd +++ /dev/null @@ -1,54 +0,0 @@ -\name{feather.plot} -\alias{feather.plot} -\title{ Display vectors along a horizontal reference line } -\description{ - Displays vectors along a line usually representing time or position. -} -\usage{ - feather.plot(r,theta,xpos,yref=0,use.arrows=TRUE, - col.refline="lightgray",fp.type="s",main="",xlab="",ylab="", - xlabels=NULL,...) -} -\arguments{ - \item{r}{radii of vectors} - \item{theta}{direction of vectors in radians} - \item{xpos}{where to start each vector along the reference line} - \item{yref}{vertical position to place the reference line} - \item{use.arrows}{whether to put arrow heads on the ends of the vectors} - \item{col.refline}{the color of the reference line} - \item{fp.type}{whether to use "standard" coordinates (begin at the - right and move counterclockwise) or "meteorological" coordinates - (begin at the top and move clockwise) when interpreting the values - of \samp{theta}} - \item{main}{the title of the plot} - \item{xlab}{the label for the reference line} - \item{ylab}{the label for the vertical axis} - \item{xlabels}{optional labels for the reference line} - \item{...}{additional arguments passed to \samp{arrows} or \samp{segments}} -} -\details{ - This function places vectors of length \samp{r} and angle \samp{theta} - along a reference line that may represent time or position or some other - value. The user is responsible for spacing the vectors so that they do - not overlap if this is desired. - - Feather plots are typically wider than high. The user will probably want - to specify a graphics device that doesn't leave lots of blank space above - and below the plot. -} -\value{nil} -\author{Jim Lemon, Eduardo Klein} -\seealso{\link{spread.labels}} -\examples{ - dev.new(width=8,height=3) - r<-0.6+rnorm(24)/5 - theta<-c(seq(15*pi/16,pi/16,length.out=12), - seq(17*pi/16,31*pi/16,length.out=12)) - feather.plot(r,theta,xlabels=1:24, - main="Standard Coordinates",xlab="Time",ylab="Value") - # rearrange theta for meteorological coordinates - feather.plot(r,c(theta[19:24],rev(theta[7:18]),theta[1:6]),xlabels=1:24,fp.type="m", - main="Meteorological Coordinates",xlab="Time",ylab="Value") - dev.off() -} -\keyword{misc} diff --git a/man/fill.corner.Rd b/man/fill.corner.Rd deleted file mode 100644 index b854437..0000000 --- a/man/fill.corner.Rd +++ /dev/null @@ -1,26 +0,0 @@ -\name{fill.corner} -\alias{fill.corner} -\title{ - Fill a "corner" of a matrix with values -} -\description{ - Fills one corner of a matrix with the supplied values, leaving the rest - filled with a default value. -} -\usage{ - fill.corner(x,nrow,ncol,na.value=NA) -} -\arguments{ - \item{x}{A vector of values.} - \item{nrow,ncol}{The number of rows and columns in the matrix to be returned.} - \item{na.value}{The default value for unfilled cells.} -} -\details{ - \samp{fill.corner} creates an nrow by ncol matrix and fills the lower left - corner with the values supplied in \samp{x}. If there are more values in - \samp{x} than cells in the matrix, only the first nrow*ncol values will be - inserted. -} -\value{An nrow by ncol matrix containing the values in \samp{x}.} -\author{Jim Lemon} -\keyword{misc} diff --git a/man/find_max_cell.Rd b/man/find_max_cell.Rd deleted file mode 100755 index b765f65..0000000 --- a/man/find_max_cell.Rd +++ /dev/null @@ -1,22 +0,0 @@ -\name{find_max_cell} -\alias{find_max_cell} -\title{Maximum (or minimum) value cell in a matrix.} -\description{ - Find the indices of the maximum value in a matrix. -} -\usage{ find_max_cell(x,max=TRUE) } -\arguments{ - \item{x}{a numeric matrix} - \item{max}{The default is to return the indices of the maximum value(s). - \samp{max=FALSE} returns those of the minimum.} -} -\value{ -A list containing the column (x) and row (y) indices. -} -\note{ -Intended to enable the user to mark cells in \samp{color2D.matplot}. -Remember to subtract 0.5 from both values to center the mark in the cell. -} -\author{Jim Lemon} -\keyword{misc} - diff --git a/man/floating.pie.Rd b/man/floating.pie.Rd deleted file mode 100644 index badfa15..0000000 --- a/man/floating.pie.Rd +++ /dev/null @@ -1,70 +0,0 @@ -\name{floating.pie} -\alias{floating.pie} -\title{Display a floating pie chart} -\description{ - Displays a pie chart at an arbitrary position on an existing plot -} -\usage{ - floating.pie(xpos=0,ypos=0,x,edges=200,radius=1,col=NULL,startpos=0, - shadow=FALSE,shadow.col=c("#ffffff","#cccccc"),explode=0,...) -} -\arguments{ - \item{xpos,ypos}{x and y position of the center of the pie chart} - \item{x}{a numeric vector for which each value will be a sector} - \item{edges}{the number of lines forming a circle} - \item{radius}{the radius of the pie in user units} - \item{col}{the colors of the sectors - defaults to \samp{rainbow}} - \item{startpos}{The starting position for drawing sectors in radians.} - \item{shadow}{Logical - whether to draw a shadow} - \item{shadow.col}{Colors to use for a shadow.} - \item{explode}{How much to "explode" one or more of the sectors.} - \item{...}{graphical parameters passed to \samp{polygon}} -} -\details{ - \samp{floating.pie} displays a pie chart with an optional shadow on an - existing plot (see \samp{polygon.shadow}). \samp{floating.pie} now accepts - NAs or zeros in \samp{x}, but simply ignores them. - - \samp{floating.pie} can be useful when multiple pie charts are placed on a - plot overlaying something else, like a map. -} -\value{ - The bisecting angle of the sectors in radians. Useful for placing - text labels for each sector. If any values in \samp{x} were zero or NA, - no angle is returned for that value. This means that the user must adjust - the labels accordingly if \samp{pie.labels} is called. - - If \samp{floating.pie} is called with no graphics device, it will try to - open one with the appropriate dimensions. - - If \samp{pie.labels} is called, ensure that the center of the pie chart - and any \samp{explode} values are the same. -} -\note{ - As with most pie charts, simplicity is essential. Trying to display a - complicated breakdown of data rarely succeeds. -} -\author{Jim Lemon} -\seealso{\link{pie.labels}, \link{boxed.labels}, \link{polygon.shadow}} -\examples{ - plot(1:5,type="n",main="Floating Pie test",xlab="",ylab="",axes=FALSE) - box() - polygon(c(0,0,5.5,5.5),c(0,3,3,0),border="#44aaff",col="#44aaff") - floating.pie(1.7,3,c(2,4,4,2,8),radius=0.5, - col=c("#ff0000","#80ff00","#00ffff","#44bbff","#8000ff")) - floating.pie(3.1,3,c(1,4,5,2,8),radius=0.5, - col=c("#ff0000","#80ff00","#00ffff","#44bbff","#8000ff")) - floating.pie(4,1.5,c(3,4,6,7),radius=0.5, - col=c("#ff0066","#00cc88","#44bbff","#8000ff")) - draw.circle(3.9,2.1,radius=0.04,col="white") - draw.circle(3.9,2.1,radius=0.04,col="white") - draw.circle(3.9,2.1,radius=0.04,col="white") - draw.circle(4,2.3,radius=0.04,col="white") - draw.circle(4.07,2.55,radius=0.04,col="white") - draw.circle(4.03,2.85,radius=0.04,col="white") - text(c(1.7,3.1,4),c(3.7,3.7,3.7),c("Pass","Pass","Fail")) - plot(0,xlim=c(-1.5,1.5),ylim=c(-1.5,1.5),type="n",axes=FALSE, - main="Floating pie with minor explosions",xlab="",ylab="") - floating.pie(x=1:5,explode=c(0,0.1,0,0.2,0)) -} -\keyword{misc} diff --git a/man/fullaxis.Rd b/man/fullaxis.Rd deleted file mode 100644 index cc8a6af..0000000 --- a/man/fullaxis.Rd +++ /dev/null @@ -1,51 +0,0 @@ -\name{fullaxis} -\alias{fullaxis} -\title{Add an axis with a line to the edge of the plot} -\description{ - As \samp{axis}, but draws a "box" line in the same color as the axis. -} -\usage{ - fullaxis(side=1,at=NULL,labels=TRUE,line=NA,pos=NA,outer=FALSE, - font=NA,lty="solid",lwd=1,lwd.ticks=lwd,col=NULL,col.ticks=NULL, - hadj=NA,padj=NA,...) -} -\arguments{ - \item{side}{The side of the plot to draw the axis} - \item{at}{Optional positions in user units for the tick marks.} - \item{labels}{Optional labels for the tick marks.} - \item{line}{Optional line into the margin.} - \item{pos}{Optional position in user units for the axis. Defaults to the edge.} - \item{outer}{Whether to use the outer margin as for \samp{axis}.} - \item{font}{Font for the labels.} - \item{lty}{Line type.} - \item{lwd}{Line width for the axis.} - \item{lwd.ticks}{Line width for the ticks.} - \item{col}{color for the axis and tick marks. See Details for label color.} - \item{col.ticks}{Color for the tick marks if different from the axis.} - \item{hadj,padj}{Justification for the labels. See \samp{axis}.} - \item{...}{Further arguments passed to \samp{axis}.} -} -\details{ - \samp{fullaxis} draws a line to the edges of the plot and then calls - \samp{axis} to draw an axis. \samp{fullaxis} is mainly useful for drawing a - colored axis on a boxed plot. In order to get the tick labels the same color as - the axis and ticks, pass the \samp{col.axis} argument (as part of ...) as well - as \samp{col}. See the example for some useful tips. -} -\value{ - The positions of the tick marks in user units. -} -\author{ Jim Lemon } -\seealso{ \link{axis}} -\examples{ - plot(runif(20,-1,1),runif(20,-1,1),xlim=c(-1,1.5),main="Demo of fullaxis", - xlab="X",ylab="Y",axes=FALSE) - fullaxis(1,col="red",col.axis="red") - fullaxis(2,col="blue",col.axis="blue") - fullaxis(4,at=c(-0.5,0,0.5),labels=c("Negative","Zero","Positive"),pos=1.2, - col="green",las=1) - # add a top line to complete the "box" - xylim<-par("usr") - segments(xylim[1],xylim[4],xylim[2],xylim[4]) -} -\keyword{misc} diff --git a/man/gantt.chart.Rd b/man/gantt.chart.Rd deleted file mode 100644 index 6a27675..0000000 --- a/man/gantt.chart.Rd +++ /dev/null @@ -1,112 +0,0 @@ -\encoding{latin1} -\name{gantt.chart} -\alias{gantt.chart} -\title{Display a Gantt chart} -\description{ - Displays a Gantt chart with priority coloring -} -\usage{ - gantt.chart(x=NULL,format="\%Y/\%m/\%d",xlim=NULL,taskcolors=NULL, - priority.legend=FALSE,vgridpos=NULL,vgridlab=NULL, - vgrid.format="\%Y/\%m/\%d", - half.height=0.25,hgrid=FALSE,main="",xlab="",cylindrical=FALSE, - label.cex=1,border.col=NA,priority.label="Priorities", - priority.extremes=c("High","Low"),time.axis=3) -} -\arguments{ - \item{x}{a list of task labels, start/end times and task priorities - as returned by \samp{get.gantt.info}. If this is not present, - \link{get.gantt.info} will be called.} - \item{format}{the format to be used in entering dates/times - (see \link{strptime}).} - \item{xlim}{the horizontal limits of the plot (see Details).} - \item{taskcolors}{a vector of colors used to illustrate task priority.} - \item{priority.legend}{Whether to display a priority color legend.} - \item{vgridpos}{optional positions of the vertical grid lines.} - \item{vgridlab}{optional labels for the vertical grid lines.} - \item{vgrid.format}{format for the vertical grid labels.} - \item{half.height}{the proportion of the spacing between task bars that - will be filled by the bar on each side - 0.5 will leave no space.} - \item{hgrid}{logical - whether to display grid lines between the bars.} - \item{main}{the title of the plot - note that this is actually displayed - using \samp{mtext}.} - \item{xlab}{horizontal axis label - usually suppressed.} - \item{cylindrical}{Whether to give the bars a cylindrical appearance.} - \item{label.cex}{Relative size for the task labels at the left side.} - \item{border.col}{The color for an optional border for the bars (NA=none).} - \item{priority.label}{Label for the priority color legend.} - \item{priority.extremes}{Labels for each end of the priority color legend.} - \item{time.axis}{Where to place the time axis labels.} -} -\value{ - The list used to create the chart - see \link{get.gantt.info} for - details. This can be saved and reused rather than manually entering the - information each time the chart is displayed. -} -\details{ - Because the "time" axis is calculated using POSIXct values, the - values passed as \samp{xlim} must also be POSIXct. See the second plot - in the examples. - - If task priority colors are not wanted, set \samp{taskcolors} to a single - value to suppress the coloring. If this is not done, \samp{rainbow} will - be called to generate a different color for each task. If colors other than - \samp{rainbow} are wanted, remember to pass enough colors for one to the - lowest (highest numerically) priority. - - There can now be more than one time interval for each task. If there is, - more than one bar will be displayed for each interval, which may not be a - task at all, but rather intervals related to the labels. Colors can be - specified for labels or intervals and if there are not as many colors as - intervals, the first "number of unique labels" colors will be assigned to - each unique label. This should make every bar for each label the - same color, but be aware that the colors will be distributed in alphabetical - order of the entity labels. If there are at least as many taskcolors as intervals, - they will be assigned to intervals in the order of the \samp{taskcolors} vector. - The examples should make this clearer. - - Since \samp{gantt.chart} can be used to display things other than prioritized - tasks, the labels for the priority legend can now be specified. -} -\author{Jim Lemon (original by Scott Waichler - features by Ulrike Gromping - - added label colors by Nicolas Immelman)} -\seealso{\link{get.gantt.info}} -\examples{ - Ymd.format<-"\%Y/\%m/\%d" - gantt.info<-list(labels= - c("First task","Second task","Third task","Fourth task","Fifth task"), - starts= - as.POSIXct(strptime( - c("2004/01/01","2004/02/02","2004/03/03","2004/05/05","2004/09/09"), - format=Ymd.format)), - ends= - as.POSIXct(strptime( - c("2004/03/03","2004/05/05","2004/05/05","2004/08/08","2004/12/12"), - format=Ymd.format)), - priorities=c(1,2,3,4,5)) - vgridpos<-as.POSIXct(strptime(c("2004/01/01","2004/02/01","2004/03/01", - "2004/04/01","2004/05/01","2004/06/01","2004/07/01","2004/08/01", - "2004/09/01","2004/10/01","2004/11/01","2004/12/01"),format=Ymd.format)) - vgridlab<- - c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec") - gantt.chart(gantt.info,main="Calendar date Gantt chart (2004)", - priority.legend=TRUE,vgridpos=vgridpos,vgridlab=vgridlab,hgrid=TRUE) - # add a little extra space on the right side - gantt.chart(gantt.info,main="Calendar date Gantt chart (2004)", - priority.legend=TRUE,vgridpos=vgridpos,vgridlab=vgridlab,hgrid=TRUE, - xlim=as.POSIXct(strptime(c("2004/01/01","2004/12/20"), - format=Ymd.format))) - # if both vgidpos and vgridlab are specified, - # starts and ends don't have to be dates - info2<-list(labels=c("Jim","Joe","Jim","John","John","Jake","Joe","Jed","Jake"), - starts=c(8.1,8.7,13.0,9.1,11.6,9.0,13.6,9.3,14.2), - ends=c(12.5,12.7,16.5,10.3,15.6,11.7,18.1,18.2,19.0)) - gantt.chart(info2,vgridlab=8:19,vgridpos=8:19, - main="All bars the same color",taskcolors="lightgray") - gantt.chart(info2,vgridlab=8:19,vgridpos=8:19, - main="A color for each label",taskcolors=c(2,3,7,4,8)) - gantt.chart(info2,vgridlab=8:19,vgridpos=8:19, - main="A color for each interval - with borders", - taskcolors=c(2,3,7,4,8,5,3,6,"purple"),border.col="black") -} -\keyword{misc} diff --git a/man/gap.barplot.Rd b/man/gap.barplot.Rd deleted file mode 100644 index 3902147..0000000 --- a/man/gap.barplot.Rd +++ /dev/null @@ -1,50 +0,0 @@ -\name{gap.barplot} -\alias{gap.barplot} -\title{ - Display a barplot with a gap (missing range) on one axis -} -\description{ - Displays a barplot with a missing range. -} -\usage{ - gap.barplot(y,gap,xaxlab,xtics,yaxlab,ytics,xlim=NA,ylim=NA,xlab=NULL, - ylab=NULL,horiz=FALSE,col,...) -} -\arguments{ - \item{y}{a vector of data values} - \item{gap}{the range of values to be left out} - \item{xaxlab}{labels for the x axis ticks} - \item{xtics}{position of the x axis ticks} - \item{yaxlab}{labels for the y axis ticks} - \item{ytics}{position of the y axis ticks} - \item{xlim}{Optional x limits for the plot} - \item{ylim}{optional y limits for the plot} - \item{xlab}{label for the x axis} - \item{ylab}{label for the y axis} - \item{horiz}{whether to have vertical or horizontal bars} - \item{col}{color(s) in which to plot the values} - \item{...}{arguments passed to \samp{barplot}.} -} -\value{ - The center positions of the bars. -} -\details{ - Displays a barplot omitting a range of values on the X or Y axis. Typically - used when there is a relatively large gap in the range of values - represented as bar heights. See \link{axis.break} for a brief - discussion of plotting on discontinuous coordinates. - - If the user does not ask for specific y limits, the function will calculate - limits based on the range of the data values. If passing specific limits, - remember to subtract the gap from the upper limit. -} -\author{Jim Lemon} -\seealso{\link{gap.barplot}} -\examples{ - twogrp<-c(rnorm(10)+4,rnorm(10)+20) - gap.barplot(twogrp,gap=c(8,16),xlab="Index",ytics=c(3,6,17,20), - ylab="Group values",main="Barplot with gap") - gap.barplot(twogrp,gap=c(8,16),xlab="Index",ytics=c(3,6,17,20), - ylab="Group values",horiz=TRUE,main="Horizontal barplot with gap") -} -\keyword{misc} diff --git a/man/gap.boxplot.Rd b/man/gap.boxplot.Rd deleted file mode 100755 index 50dbb4a..0000000 --- a/man/gap.boxplot.Rd +++ /dev/null @@ -1,79 +0,0 @@ -\name{gap.boxplot} -\alias{gap.boxplot} -\title{Display a boxplot with a gap (missing range)} -\description{ - Displays a boxplot with a missing range. -} -\usage{ - gap.boxplot(x,...,gap=list(top=c(NA,NA),bottom=c(NA,NA)), - range=1.5,width=NULL,varwidth=FALSE,notch=FALSE,outline=TRUE, - names,xlim=NA,ylim=NA,plot=TRUE,border=par("fg"),col=NULL,log="", - axis.labels=NULL,axes=TRUE,pars=list(boxwex=0.8,staplewex=0.5,outwex=0.5), - horizontal=FALSE,add=FALSE,at=NULL,main=NULL,xlab="",ylab="") -} -\arguments{ - \item{x}{numeric vector or a list of vectors} - \item{...}{arguments passed to \link{boxplot}.} - \item{gap}{the range(s) to be omitted - a list with two components, - \samp{top} and \samp{bottom} each specifying a range to omit. The - default range of \samp{c(NA,NA)} means no omitted range} - \item{range}{how far to extend the whiskers, (see \link{boxplot})} - \item{width}{the relative widths of the boxes} - \item{varwidth}{if TRUE, box widths are proportional to the square roots - of the number of observations} - \item{notch}{whether to display the confidence intervals for the - median as notches} - \item{outline}{whether to display outliers} - \item{names}{optional names to display beneath each boxplot} - \item{xlim,ylim}{Optional x and y axis limits for the plot.} - \item{boxwex}{scale factor for box widths} - \item{staplewex}{staple width proportional to box width} - \item{outwex}{outlier line width} - \item{plot}{dummy argument for consistency with \samp{boxplot} - always - plots} - \item{border}{optional color(s) for the box lines} - \item{col}{optional color(s) to fill the boxes} - \item{log}{whether to use a log scale - currently does nothing} - \item{axis.labels}{Optional axis labels.} - \item{axes}{Whether to display axes.} - \item{pars}{optional parameters for consistency with \samp{boxplot}} - \item{horizontal}{whether to plot horizontal boxplots - currently - does nothing} - \item{add}{whether to add the boxplot(s) to an existing plot - currently - does nothing.} - \item{at}{optional horizontal locations for the boxplots.} - \item{main}{a title for the plot.} - \item{xlab,ylab}{X and Y axis labels.} -} -\value{ - A list with the same structure as returned by \samp{boxplot}, except that - the values of elements beyond the gap(s) have their true positions on the - plot rather than the original values. For example, in the second example, - the value returned for the upper staple of the right boxplot is 14 rather - than 20, due to the 6 unit gap. -} -\details{ - Displays boxplot(s) omitting range(s) of values on the top and/or bottom - of the plot. Typically used when there are outliers far from the boxes. - See \link{boxplot} for more detailed descriptions of the - arguments. If the gaps specified include any of the values in the \samp{stats} - matrix returned from \samp{boxplot}, the function will exit with an - error message. This prevents generation of NAs in indexing operations, - which would fail anyway. A gap can include part of a box, but it is unlikely - that this would be intended by the user. - - See \link{axis.break} for a brief discussion - of plotting on discontinuous coordinates. -} -\author{Jim Lemon} -\seealso{\link{gap.barplot},\link{gap.plot}} -\examples{ - twovec<-list(vec1=c(rnorm(30),-6),vec2=c(sample(1:10,40,TRUE),20)) - gap.boxplot(twovec,gap=list(top=c(12,18),bottom=c(-5,-3)), - main="Show outliers separately") - if(dev.interactive()) par(ask=TRUE) - gap.boxplot(twovec,gap=list(top=c(12,18),bottom=c(-5,-3)),range=0, - main="Include outliers in whiskers") - par(ask=FALSE) -} -\keyword{misc} diff --git a/man/gap.plot.Rd b/man/gap.plot.Rd deleted file mode 100644 index 8c9539c..0000000 --- a/man/gap.plot.Rd +++ /dev/null @@ -1,96 +0,0 @@ -\name{gap.plot} -\alias{gap.plot} -\title{Display a plot with one or two gaps (missing ranges) on one axis} -\description{ - Displays a plot with one or two missing ranges on one of the axes. -} -\usage{ -gap.plot(x,y,gap,gap.axis="y", - bgcol="white",breakcol="black",brw=0.02, - xlim=range(x),ylim=range(y),xticlab,xtics=NA,yticlab,ytics=NA, - lty=rep(1,length(x)),col=rep(par("col"),length(x)),pch=rep(1,length(x)), - add=FALSE,stax=FALSE, - style="gap",bty=par("bty"),xaxt=par("xaxt"),yaxt=par("yaxt"),...) -} -\arguments{ - \item{x,y}{data values} - \item{gap}{the range(s) of values to be left out} - \item{gap.axis}{whether the gaps are to be on the x or y axis} - \item{bgcol}{the color of the plot background} - \item{breakcol}{the color of the "break" marker} - \item{brw}{break width relative to plot width} - \item{xlim,ylim}{the plot limits.} - \item{xticlab}{labels for the x axis ticks} - \item{xtics}{position of the x axis ticks} - \item{yticlab}{labels for the y axis ticks} - \item{ytics}{position of the y axis ticks} - \item{lty}{line type(s) to use if there are lines} - \item{col}{color(s) in which to plot the values} - \item{pch}{symbols to use in plotting.} - \item{add}{whether to add values to an existing plot.} - \item{stax}{whether to call staxlab for staggered axis labels.} - \item{style}{the style to use for the break; see \code{\link{axis.break}}} - \item{bty,xaxt,yaxt}{type of box and axes (see \code{\link{par}} for details.)} - \item{...}{arguments passed to \samp{plot} and \samp{points}.} -} -\value{nil} -\details{ - Displays a plot omitting one or two ranges of values on one axis. - Typically used when there is a relatively large gap or two in the overall - range of one set of values, often because of outliers. The function warns - the user if any values may have been omitted by being in the "gap". See - \link{axis.break} for a brief discussion of plotting on - discontinuous coordinates. - - To add more data series to a gap plot, call \samp{gap.plot} with - \samp{add = TRUE}. The same \samp{gap} and \samp{gap.axis} arguments as - in the initial call must be passed or the data will not be displayed - correctly. Remember to pass an explicit \samp{xlim} or \samp{ylim} to - the initial call if the added data exceed the range of the data - initially displayed. Also remember to subtract the width(s) of the gap(s) - if you are passing an explicit \samp{xlim} or \samp{ylim}. - - Because the gaps take up some space, it is possible to have a data value - that is just below a gap plotted in the gap. The answer is to make the lower - gap limit a little higher if this is a problem. - - If at least four values are passed in \samp{gap}, the first four will be - used to calculate two "gaps" in the plot instead of one. The function does - not check whether these values are sensible, so it is quite easy to - ask for a very silly plot. - - The default ticks are usually not ideal, and most users will want to pass - their own tick positions and perhaps labels. Note that \samp{lines} appears - to use only the first \samp{col} and \samp{lty} argument value, so if you - must have lines with different colors and types, use \samp{add=TRUE} and add - them separately (see the third example for the problem and the solution). -} -\author{Jim Lemon and Ben Bolker (thanks to Zheng Lu for the "add" idea, - and Art Roberts for helping to get the gaps right.)} -\seealso{\link{gap.barplot}, \link{axis.break}, \link{do.first}} -\examples{ - twogrp<-c(rnorm(5)+4,rnorm(5)+20,rnorm(5)+5,rnorm(5)+22) - gpcol<-c(2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5) - gap.plot(twogrp,gap=c(8,16),xlab="Index",ylab="Group values", - main="Gap on Y axis",col=gpcol) - gap.plot(twogrp,rnorm(20),gap=c(8,16),gap.axis="x",xlab="X values", - xtics=c(4,7,17,20),ylab="Y values",main="Gap on X axis with added lines") - gap.plot(c(seq(3.5,7.5,by=0.5),seq(16.5,22.5,by=0.5)), - rnorm(22),gap=c(8,16),gap.axis="x",type="l",add=TRUE,col=2,) - gap.plot(twogrp,gap=c(8,16,25,35), - xlab="X values",ylab="Y values",xlim=c(1,30),ylim=c(0,42), - main="Test two gap plot with the lot",xtics=seq(0,30,by=5), - ytics=c(4,6,18,20,22,38,40,42), - lty=c(rep(1,10),rep(2,10)), - pch=c(rep(2,10),rep(3,10)), - col=c(rep(2,10),rep(3,10)), - type="b") - gap.plot(21:30,rnorm(10)+40,gap=c(8,16,25,35),add=TRUE, - lty=rep(3,10),col=rep(4,10),type="l") - - # Use non-standard box type and break - gap.plot(twogrp,gap=c(7,17),xlab="Index",ylab="Group values", - main="Gap on Y axis",col=gpcol,bty="L",style="slash", - ytics=pretty(twogrp, 8)) -} -\keyword{misc} diff --git a/man/gap_barp.Rd b/man/gap_barp.Rd deleted file mode 100755 index 3067b85..0000000 --- a/man/gap_barp.Rd +++ /dev/null @@ -1,54 +0,0 @@ -\name{gap_barp} -\alias{gap_barp} -\title{ - Display a barplot with a gap (missing range) on one axis -} -\description{ - Displays a barplot with a missing range. -} -\usage{ - gap_barp(height,gap,width=0.4,names.arg=names(height), - col=NULL,main="",xlab="",ylab="",xlim=NULL,ylim=NULL,x=NULL, - height.at=pretty(height),height.lab=NULL,...) -} -\arguments{ - \item{height}{a vector of data values} - \item{gap}{the range of values to be left out} - \item{width}{the proportion of bar width to bar spacing divided by 2. - width=1 means no spaces between the bars.} - \item{names.arg}{labels for the bars.} - \item{col}{color(s) in which to plot the values} - \item{main}{title for the plot.} - \item{xlab}{label for the x axis} - \item{ylab}{label for the y axis} - \item{xlim}{Optional x limits for the plot} - \item{ylim}{optional y limits for the plot} - \item{x}{optional x positions for the bars.} - \item{height.at}{explicit positions for the y axis ticks} - \item{height.lab}{explicit labels for the y axis ticks.} - \item{...}{arguments passed to \samp{barp}.} -} -\value{ - The center positions of the bars. -} -\details{ - Displays a barplot omitting a range of values on the X or Y axis. Typically - used when there is a relatively large gap in the range of values - represented as bar heights. See \link{axis.break} for a brief - discussion of plotting on discontinuous coordinates. - - If the user does not ask for specific y limits, the function will calculate - limits based on the range of the data values. If passing specific limits, - remember to subtract the gap from the upper or lower limit. -} -\author{Jim Lemon} -\seealso{\link{barp}} -\examples{ - oneout<-c(rnorm(5,sd=5),20,rnorm(5,sd=5)) - gap_barp(oneout,gap=c(8,16),xlab="Index",height.at=c(-5,0,5,20), - ylab="Group values",main="Barplot with gap above zero") - oneout[6]<--20 - gap_barp(oneout,gap=c(-8,-16),xlab="Index",height.at=c(-20,-5,0,5), - ylab="Group values",main="Barplot with gap below zero") -} -\keyword{misc} diff --git a/man/get.breaks.Rd b/man/get.breaks.Rd deleted file mode 100644 index b436def..0000000 --- a/man/get.breaks.Rd +++ /dev/null @@ -1,23 +0,0 @@ -\name{get.breaks} -\alias{get.breaks} -\title{Get the breakpoints for a weighted histogram} -\description{ - Gets the breakpoints for a weighted histogram. -} -\usage{ - get.breaks(x,breaks) -} -\arguments{ - \item{x}{A numeric vector.} - \item{breaks}{Either the name of the function to calculate breakpoints, the - number of categories or a vector of breakpoints.} -} -\details{ - \samp{get.breaks} either calls the same functions as \samp{hist} to get - breakpoints or calculates a given number or just returns \samp{breaks} - if they are already specified. -} -\value{A vector of breakpoints.} -\author{Jim Lemon} -\seealso{\link{hist}} -\keyword{misc} diff --git a/man/get.gantt.info.Rd b/man/get.gantt.info.Rd deleted file mode 100644 index c1efe0a..0000000 --- a/man/get.gantt.info.Rd +++ /dev/null @@ -1,29 +0,0 @@ -\name{get.gantt.info} -\alias{get.gantt.info} -\title{Gather the information to create a Gantt chart} -\description{ - Allows the user to enter the information for a Gantt chart. -} -\usage{ - get.gantt.info(format="\%Y/\%m/\%d") -} -\arguments{ - \item{format}{the format to be used in entering dates/times. Defaults to - YYYY/mm/dd. See \link{strptime} for various date/time formats.} -} -\value{ - The list used to create the chart. Elements are: - \item{labels}{The task labels to be displayed at the left of the chart.} - \item{starts,ends}{The task starts/ends as POSIXct dates/times.} - \item{priorities}{Task priorities as integers in the range 1 to 10. - There can be less than 10 levels of priority, but if priorities do - not start at 1 (assumed to be the highest), the default priority colors - will be calculated from 1.} -} -\author{Jim Lemon} -\seealso{\link{gantt.chart}} -\examples{ - cat("Enter task times using HH:MM (hour:minute) format\n") - get.gantt.info("\%H:\%M") -} -\keyword{misc} diff --git a/man/get.segs.Rd b/man/get.segs.Rd deleted file mode 100644 index 771f246..0000000 --- a/man/get.segs.Rd +++ /dev/null @@ -1,29 +0,0 @@ -\name{get.segs} -\alias{get.segs} -\title{Calculate the midpoints and limits for a centipede plot} -\description{ - Calculates midpoints and limits for a list or data frame for use with - centipede.plot. -} -\usage{ - get.segs(x,mct="mean",lower.limit="std.error",upper.limit=lower.limit) -} -\arguments{ - \item{x}{a list or data frame.} - \item{mct}{The name of the function to calculate midpoints.} - \item{lower.limit,upper.limit}{The names of the function(s) to calculate - lower and upper limits.} -} -\details{ - \samp{get.segs} calls the functions whose names are passed to calculate - midpoints and limits for each list element or data frame column. The - user can define special functions for the central and dispersion measures - if desired. -} -\value{A matrix with four rows and as many columns as were in the object - \samp{x}. The first row contains the midpoint values, the second and third - the lower and upper limit values respectively and the fourth row the number - of valid observations in the columns.} -\author{Jim Lemon} -\seealso{\link{centipede.plot}} -\keyword{misc} diff --git a/man/get.soil.texture.Rd b/man/get.soil.texture.Rd deleted file mode 100644 index 7589a64..0000000 --- a/man/get.soil.texture.Rd +++ /dev/null @@ -1,29 +0,0 @@ -\name{get.soil.texture} -\alias{get.soil.texture} -\title{Enter soil texture data} -\usage{ - get.soil.texture(use.percentages=FALSE,cnames=c("sand","silt","clay")) -} -\arguments{ - \item{use.percentages}{Logical - whether to treat the entries as - percentages and scale to proportions.} - \item{cnames}{column names for the resulting three column matrix.} -} -\description{ - \samp{get.soil.texture} calls \samp{get.triprop} to allow the user to - enter soil textures as the proportions or percentages of three - components, sand, silt and clay. -} -\value{A matrix of the components of one or more soil samples.} -\author{Sander Oom and Jim Lemon} -\seealso{\link{soil.texture},\link{get.triprop}} -\examples{ - if(dev.interactive()) { - newsp<-get.soil.texture() - # show the soil triangle - soil.texture() - # now plot the observations - show.soil.texture(newsp) - } -} -\keyword{misc} diff --git a/man/get.tablepos.Rd b/man/get.tablepos.Rd deleted file mode 100644 index acada57..0000000 --- a/man/get.tablepos.Rd +++ /dev/null @@ -1,31 +0,0 @@ -\name{get.tablepos} -\alias{get.tablepos} -\title{Get the position for a legend or table} -\description{ - Gets the x and y positions and justification for a legend or table in - user units from the string descriptors like "top". -} -\usage{ - get.tablepos(x) -} -\arguments{ - \item{x}{A valid position descriptor like "top".} -} -\details{ - \samp{get.tablepos} checks for one of the nine valid position descriptors: - - topleft, top, topright, left, center, right, bottomleft, bottom and bottomright. - - If none of these descriptors are found, it will return the center position - and justification. -} -\value{ - A list containing: - \item{x}{x position} - \item{y}{y position} - \item{xjust}{x (horizontal) justification} - \item{yjust}{y (vertical) justification} -} -\author{Jim Lemon} -\seealso{\link{addtable2plot}, \link{legendg}} -\keyword{misc} diff --git a/man/get.triprop.Rd b/man/get.triprop.Rd deleted file mode 100644 index a15b03d..0000000 --- a/man/get.triprop.Rd +++ /dev/null @@ -1,32 +0,0 @@ -\name{get.triprop} -\alias{get.triprop} -\title{Enter three proportion data - usually soil textures} -\usage{ - get.triprop(use.percentages=FALSE,cnames=c("1st","2nd","3rd")) -} -\arguments{ - \item{use.percentages}{Logical - whether to treat the entries as - percentages and scale to proportions.} - \item{cnames}{column names for the resulting three column matrix.} -} -\description{ - \samp{get.triprop} allows the user to enter triplets of proportions - or percentages of three components such as sand, silt and clay in soils. -} -\details{ - The three proportions of each row must sum to 100 or 1 within 1\% or - the function will warn the operator.} -\value{A matrix of the components of one or more observations.} -\author{Jim Lemon} -\seealso{\link{triax.plot}, \link{soil.texture}} -\examples{ - if(dev.interactive()) { - # get some proportions - newsp<-get.triprop() - # show the triangle - triax.frame(main="Test triax.plot") - # now plot the observations - triax.points(newsp) - } -} -\keyword{misc} diff --git a/man/getFigCtr.Rd b/man/getFigCtr.Rd deleted file mode 100644 index b86d90e..0000000 --- a/man/getFigCtr.Rd +++ /dev/null @@ -1,26 +0,0 @@ -\name{getFigCtr} -\title{Get coordinates in the figure region in user units.} -\description{ - Calculates the coordinates of a proportional point of the figure - region in user units.} -\usage{ - getFigCtr(pos=c(0.5,0.5)) -} -\arguments{ - \item{pos}{The proportion of the figure region to find (see Details).} -} -\alias{getFigCtr} -\details{ - \samp{getFigCtr} reads parameters about the current plot and calculates the - vertical and horizontal centers of the figure region by default. This is - typically useful for placing a centered title on plots where the left and - right margins are very different. - - By changing \samp{pos}, any proportional points of the figure region can be - returned. For example, \samp{pos=c(0,0)} will return the left and bottom - coordinates of the figure region. -} -\value{A two element vector containing the coordinates of the center of the - figure region in user units.} -\author{Jim Lemon (thanks to Karl Brand for the adjustable coordinates)} -\keyword{misc} diff --git a/man/getIntersectList.Rd b/man/getIntersectList.Rd deleted file mode 100644 index b4f6bb9..0000000 --- a/man/getIntersectList.Rd +++ /dev/null @@ -1,51 +0,0 @@ -\name{getIntersectList} -\alias{getIntersectList} -\title{Enter a set intersection list} -\description{Enter the information for a set intersection display.} -\usage{ - getIntersectList(nelem,xnames=NULL,sep="+") -} -\arguments{ - \item{nelem}{The number of sets for which the intersections will be displayed.} - \item{xnames}{The labels for the set intersections. The function creates names - from combinations of the first \samp{nelem} capital letters if none are - given.} - \item{sep}{The separator to use when calling \samp{paste}.} -} -\details{ - \samp{getIntersectList} allows the user to manually enter the counts of - set intersections rather than build this information from a matrix of data. - It is probably most useful for producing an intersection diagram when the - counts of the intersections are already known, or when the values are - proportions rather than counts as in the example. - - It is very helpful when there are large numbers of elements, as the - \samp{makeIntersectList} function runs very slowly. -} -\value{A list of the counts of elements in the set intersections.} -\author{Jim Lemon} -\seealso{\link{makeIntersectList}, \link{intersectDiagram}} -\examples{ - # this example is from a haplotype mapping problem submitted by Mao Jianfeng - \dontrun{ - hapIntList<- - getIntersectList(3,xnames=c("hap.Pd","hap.Pt","hap.Py")) - # enter the data as follows: - # Number of elements in hap.Pd - 1: 27.586 - # Number of elements in hap.Pt - 1: 20.689 - # Number of elements in hap.Py - 1: 31.035 - # Number of elements in hap.Pd-hap.Pt - 1: 10.345 - # Number of elements in hap.Pd-hap.Py - 1: 10.345 - # Number of elements in hap.Pt-hap.Py - 1: 0 - # Number of elements in hap.Pd-hap.Pt-hap.Py - 1: 0 - # Total number of elements - 1: 100 - } - hapIntList<-structure(list(structure(c(27.586, 20.689, 31.035), - .Names = c("hap.Pd","hap.Pt","hap.Py")), - structure(c(10.345, 10.345, 0), - .Names = c("hap.Pd-hap.Pt","hap.Pd-hap.Py","hap.Pt-hap.Py")), - structure(0, .Names = "hap.Pd-hap.Pt-hap.Py"),100), - class = "intersectList") - intersectDiagram(hapIntList) -} -\keyword{misc} diff --git a/man/getMarginWidth.Rd b/man/getMarginWidth.Rd deleted file mode 100644 index b830357..0000000 --- a/man/getMarginWidth.Rd +++ /dev/null @@ -1,36 +0,0 @@ -\name{getMarginWidth} -\alias{getMarginWidth} -\title{Find the margin width necessary to fit text or a legend next to a plot} -\description{ - Calculates the margin width necessary to fit text or a legend next to a plot. -} -\usage{ - getMarginWidth(side=4,labels,is.legend=FALSE) -} -\arguments{ - \item{side}{Which side of the plot (as in axis).} - \item{labels}{The text to place next to the plot.} - \item{is.legend}{Whether the text is in a legend or not.} -} -\details{ - \samp{getMarginWidth} reads parameters about the current plot and calculates the - left or right (default) margin necessary to fit the strings passed as - \samp{labels} or a legend containing those strings. -} -\value{ - A two element list containing the number of margin lines necessary to - fit the text or legend and the horizontal center of the margin in user units. -} -\author{Jim Lemon} -\examples{ - plot(rnorm(10)) - newmarinfo<-getMarginWidth(labels=c("Long label","Even longer label")) - oldmar<-par("mar") - par(mar=c(oldmar[1:3],newmarinfo$newmar)) - plot(rnorm(10)) - par(xpd=TRUE) - text(rep(newmarinfo$marcenter,2),c(0.5,-0.5), - c("Long label","Even longer label")) - par(mar=oldmar,xpd=FALSE) -} -\keyword{misc} diff --git a/man/getYmult.Rd b/man/getYmult.Rd deleted file mode 100644 index dcb12da..0000000 --- a/man/getYmult.Rd +++ /dev/null @@ -1,17 +0,0 @@ -\name{getYmult} -\alias{getYmult} -\title{Correct for aspect and coordinate ratio} -\description{Calculate a multiplication factor for the Y dimension to correct - for unequal plot aspect and coordinate ratios on the current graphics device.} -\usage{ - getYmult() -} -\details{ - \samp{getYmult} retrieves the plot aspect ratio and the coordinate ratio for - the current graphics device, calculates a multiplicative factor to equalize - the X and Y dimensions of a plotted graphic object. -} -\value{The correction factor for the Y dimension.} -\author{Jim Lemon} -\seealso{\link{draw.circle}} -\keyword{misc} diff --git a/man/get_axispos3d.Rd b/man/get_axispos3d.Rd deleted file mode 100644 index c9e378a..0000000 --- a/man/get_axispos3d.Rd +++ /dev/null @@ -1,19 +0,0 @@ -\name{get_axispos3d} -\alias{get_axispos3d} -\title{ Get axis positions on a 3D plot } -\description{ - Calculate the axis positions on a 3D plot. -} -\usage{ - get_axispos3d(edge,pmat,at,pos=NULL, dist=0) -} -\arguments{ - \item{edge}{ which axis to calculate.} - \item{pmat}{ matrix to transform coordinates. } - \item{at}{ position on the axis. } - \item{pos}{ position of the axis relative to the other axes. } - \item{dist}{ Offset of the axis. } -} -\value{A position in 2D coordinates} -\author{Ben Bolker} -\keyword{misc} diff --git a/man/gradient.rect.Rd b/man/gradient.rect.Rd deleted file mode 100644 index b44253c..0000000 --- a/man/gradient.rect.Rd +++ /dev/null @@ -1,41 +0,0 @@ -\name{gradient.rect} -\title{Display a rectangle filled with an arbitrary color gradient} -\usage{ - gradient.rect(xleft,ybottom,xright,ytop,reds,greens,blues,col=NULL, - nslices=50,gradient="x",border=par("fg")) -} -\alias{gradient.rect} -\arguments{ - \item{xleft,ybottom,xright,ytop}{Positions of the relevant corners - of the desired rectangle, as in \samp{rect}.} - \item{reds,greens,blues}{vectors of the values of the color components - either as 0 to 1 or ,if any value is greater than 1, 0 to 255.} - \item{col}{Vector of colors. If supplied, this takes precedence over - \samp{reds, greens, blues} and \samp{nslices} will be set to its length.} - \item{nslices}{The number of sub-rectangles that will be drawn.} - \item{gradient}{whether the gradient should be horizontal (x) or vertical.} - \item{border}{The color of the border around the rectangle (NA for none).} -} -\description{ - \samp{gradient.rect} draws a rectangle consisting of \samp{nslices} - subrectangles of the colors in \samp{col} or those returned by - \samp{color.gradient} if \samp{col} is NULL. The rectangle is - 'sliced' in the direction specified by \samp{gradient}. -} -\value{the vector of hexadecimal color values from \samp{color.gradient} or - \samp{col}.} -\author{Jim Lemon} -\examples{ - # get an empty box - plot(0:10,type="n",axes=FALSE) - # run across the three primaries - gradient.rect(1,0,3,6,reds=c(1,0), - greens=c(seq(0,1,length=10),seq(1,0,length=10)), - blues=c(0,1),gradient="y") - # now a "danger gradient" - gradient.rect(4,0,6,6,c(seq(0,1,length=10),rep(1,10)), - c(rep(1,10),seq(1,0,length=10)),c(0,0),gradient="y") - # now just a smooth gradient across the bar - gradient.rect(7,0,9,6,col=smoothColors("red",38,"blue"),border=NA) -} -\keyword{misc} diff --git a/man/hexagon.Rd b/man/hexagon.Rd deleted file mode 100644 index 0f1ac38..0000000 --- a/man/hexagon.Rd +++ /dev/null @@ -1,27 +0,0 @@ -\name{hexagon} -\alias{hexagon} -\title{Draw a hexagon} -\description{ - Draws a hexagon on the current graphic device -} -\usage{ - hexagon(x,y,unitcell=1,col=NA,border="black") -} -\arguments{ - \item{x,y}{x and y position of the bottom left corner of the square that - would pack into the same space as the hexagon.} - \item{unitcell}{The dimension of the side of the abovementioned square.} - \item{col}{The color to fill the hexagon - default is no fill.} - \item{border}{The color of the perimeter of the hexagon.} -} -\note{ - Draws a hexagon with the same center as a square that would pack into the - same dimensions as the hexagon. That is, given a grid of squares with - alternate rows shifted one half the length of the sides, the hexagons - drawn would be close packed. Its use in the plotrix package is to provide - an alternative unit cell for the \samp{color2D.matplot} function. -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{color2D.matplot}} -\keyword{misc} diff --git a/man/histStack.Rd b/man/histStack.Rd deleted file mode 100644 index 4ddf284..0000000 --- a/man/histStack.Rd +++ /dev/null @@ -1,70 +0,0 @@ -\name{histStack} -\alias{histStack} -\alias{histStack.formula} -\alias{histStack.default} -\title{Histogram "stacked" by categories} -\description{ - Histogram of a quantitative variable with bars that are "stacked" by the - values of a factor variable. -} -\usage{ - histStack(x,...) - - \method{histStack}{formula}(x,data,breaks="Sturges",col="rainbow", - right=TRUE,main="",xlab=NULL,legend.pos=NULL,cex.legend=0.75,...) - - \method{histStack}{default}(x,z,breaks="Sturges",col="rainbow", - right=TRUE,main="",xlab=NULL,legend.pos=NULL,cex.legend=0.75,...) -} -\arguments{ - \item{x}{A vector of quantitative data or a formula of the form x~z - (see z below).} - \item{z}{A vector of categorical data (a factor) that will define the - \dQuote{stacks}.} - \item{data}{A data frame that contains both x and z.} - \item{breaks}{Breaks to use in categorizing values of x.} - \item{col}{Either a vector of colors in any legitimate form or a - character string that specifies a function that requires only the length - of the vector as an argument and will return a vector of colors with that - length. (see Details)} - \item{right}{A logical that indicates whether the bins are right-open - (left-closed; =TRUE) or right-closed (left-open; =FALSE; default).} - \item{main}{A character string that forms the main title for the plot.} - \item{xlab}{A character string for labeling the x-axis.} - \item{legend.pos}{A character string or two numeric values indicating the - position for the stacking legend.} - \item{cex.legend}{A numeric character expansion value for the legend. - Values less than 1 will make the legend smaller.} - \item{...}{Additional arguments sent to the hist function.} -} -\details{ - \samp{histStack} displays a \dQuote{stacked histogram} while using many of - the same arguments as hist(). The argument \samp{z} will be converted to a - factor with a warning if it is not already a factor. - - The color functions in \pkg{grDevices} (e.g. "gray.colors") should always - be valid when passed as the \samp{col} argument. Any function that will - return a vector of \samp{n} colors when called with a single argument - \samp{n} and that exists in the current environment should work. An error - will occur if length(col)==1 and the value is not a function as described - for \samp{col} (e.g., \samp{col="blue"} will result in an error).If fewer - colors than levels of \samp{z} are passed, they will be recycled. -} -\value{nil. A plot is displayed.} -\note{ - This function is currently experimental. -} -\author{Derek Ogle with modifications by Jim Lemon} -\seealso{\link{hist}, \link{legend}} -\examples{ - set.seed(409) - df<-data.frame(len=rnorm(100)+5, - grp=sample(c("A","B","C","D"),100,replace=TRUE)) - histStack(len~grp,data=df,main="Default (rainbow) colors", - xlab="Length category") - histStack(len~grp,data=df,col="heat.colors",main="Heat colors", - xlab="Length category",legend.pos="topright") - histStack(len~grp,data=df,col=2:5,main="Colors by number", - xlab="Length category",legend.pos=c(2.8,18)) -} -\keyword{misc} diff --git a/man/intersectDiagram.Rd b/man/intersectDiagram.Rd deleted file mode 100644 index 69877f7..0000000 --- a/man/intersectDiagram.Rd +++ /dev/null @@ -1,144 +0,0 @@ -\name{intersectDiagram} -\alias{intersectDiagram} -\title{Display set intersections} -\description{Display set intersections as rows of rectangles.} -\usage{ - intersectDiagram(x,pct=FALSE,show.nulls=FALSE,xnames=NULL,sep="+", - mar=c(0,0,3,0),main="Intersection Diagram",cex=1,col=NULL, - minspacing=NA,all.intersections=FALSE,include=NULL,null.label="Non-set") -} -\arguments{ - \item{x}{A list containing as many numeric vectors as there are sets. The - first vector contains the counts or percentages of the elements that are - only in one set, the next vector contains the counts or percentages of - elements that are in two sets and so on. A matrix of set membership - indicators or a two column matrix of object identifiers and attribute - identifiers can be passed - see Details.} - \item{pct}{Whether to display counts (FALSE) or percentages (TRUE) of the - number of entities.} - \item{show.nulls}{Whether to display the number of original objects that - are not members of any set. Any value that is not NA will become the - label for this category.} - \item{xnames}{Optional user supplied names for the set categories (see - Details).} - \item{sep}{The separator to use between category names (see Details).} - \item{mar}{The margins for the diagram. The margins that were in effect when - the function is called are restored.} - \item{main}{The title for the diagram.} - \item{col}{Colors for the sets (see Details).} - \item{cex}{Character expansion for the intersection labels.} - \item{minspacing}{The minimum spacing between the rectangles (see Details).} - \item{all.intersections}{Whether to display all intersections, even if empty - (Dangerous - see Detail).} - \item{include}{Which set identifiers to include in the diagram (see Details).} - \item{null.label}{The label for the non-set entities if displayed.} -} -\details{ - \samp{intersectDiagram} displays rows of optionally colored rectangles that - represent the intersections of set memberships (attributes) of a set of objects. - The topmost row represents the intersections of the fewest sets, and - succeeding rows represent the intersections of more sets. If there were objects - in the original data set that were not members of any set, any percentages - calculated will reflect this. By setting \samp{show.nulls} to TRUE, the counts - or percentages of such objects will be displayed below the intersections over - an empty rectangle scaled to the count or percentage. - - Important - If the \samp{all.intersections} argument is TRUE, all intersections - will be displayed, whether empty or not (see the example). This is mostly for - demonstration purposes, and if the number of sets is large, is likely to produce - a very messy diagram. Similarly, sets with large numbers of - intersections that are populated will require very large displays to be readable, - even if there are small numbers in the intersections. If you would like to see - this in action, pass the data frame \samp{setdf} in the \link{categoryReshape} - example to \samp{intersectDiagram} with \samp{all.intersections} TRUE. - - \samp{intersectDiagram} does not attempt to display the set intersections as - a pattern of overlapping geometric figures, but rather the relative numbers of - objects sharing each intersection. More than three intersecting sets generally - produce a complex and difficult to interpret Venn diagram, and this provides an - alternative way to display the size of intersections between larger numbers - of sets. - - \samp{intersectDiagram} now allows the user to display only part of the - set intersections, which is useful for analyzing very complex intersections. - This is controlled by the \samp{include} argument. This defaults to all sets or - attributes when \samp{include=NULL}. If one or more of the labels of the sets or - attributes is passed, only the intersections containing those labels will be - displayed. See examples 2 and 3 below. - - Each set (attribute) is assigned a color if \samp{col} is not NA. \samp{rainbow} - is called if \samp{col} is NULL, otherwise the colors passed are used. For each - intersection, the colors representing the sets intersecting are included in - the rectangle. - - The strings displayed on each rectangle are taken from the argument - \samp{xnames} unless that is NULL, then the \samp{names} of the intersectList - object passed as \samp{x} or returned from the call to \samp{makeIntersectList}. - - If a matrix or data frame of set membership indicators is passed as \samp{x}, - it will be passed to \link{makeIntersectList} for conversion. Each column must - represent a set, and the values in the columns must be 0 or 1, or FALSE or TRUE. - Similarly, if a matrix or data frame in which the first column is object - identifiers and the second column is attributes, this will be passed to - \samp{makeIntersectList}. - - The spacing between the largest rectangles is controlled by \samp{minspacing}. - \samp{minspacing} is in units of object counts and defaults to 0.1 times the - largest number of objects in an intersection. When the number of objects in - different intersections at a given level varies widely, the labels of - intersections with few objects may overlap if they are wide relative to the - rectangle representing the number of objects. This can be corrected by - passing a \samp{minspacing} argument that will increase the space between - rectangles and/or decreasing the character size of the labels. If the labels - for each set are relatively long, setting \samp{namesep="\n"} may help. Note - that if a different separator is passed, that separator must be explicitly - passed in any subsequent calls using the same \samp{intersectList} object - see - examples 1 to 3 below. -} -\value{ - Returns the intersectionList object invisibly. -} -\keyword{misc} -\author{Jim Lemon} -\seealso{\link{makeIntersectList}, \link{getIntersectList}, \link{categoryReshape}} -\examples{ - # create a matrix where each row represents an element and - # a 1 (or TRUE) in each column indicates that the element is a member - # of that set. - druguse<-matrix(c(sample(c(0,1),200,TRUE,prob=c(0.15,0.85)), - sample(c(0,1),200,TRUE,prob=c(0.35,0.65)), - sample(c(0,1),200,TRUE,prob=c(0.5,0.5)), - sample(c(0,1),200,TRUE,prob=c(0.9,0.1))),ncol=4) - colnames(druguse)<-c("Alc","Tob","THC","Amp") - druglist<-makeIntersectList(druguse,sep="\n") - # first display it as counts - intersectDiagram(druglist,main="Patterns of drug use",sep="\n") - # then display only the intersections containing "Alc" - intersectDiagram(druglist,main="Patterns of drug use (Alcohol users only)", - sep="\n",include="alc") - # now display only the intersections containing "Amp" - intersectDiagram(druglist,main="Patterns of drug use (Speed users only)", - sep="\n",include="amp") - # then as percent with non.members, passing the initial matrix - intersectDiagram(druguse,pct=TRUE,show.nulls=TRUE) - # alter the data to have more multiple intersections - druguse[which(as.logical(druguse[,1]))[1:40],2]<-1 - druguse[which(as.logical(druguse[,1]))[31:70],3]<-1 - druguse[,4]<-sample(c(0,1),200,TRUE,prob=c(0.9,0.1)) - intersectDiagram(druguse,main="Smaller font in labels", - col=c("gray20","gray40","gray60","gray80"),cex=0.8) - # transform the spacing - usually makes it too close, first try minspacing - intersectDiagram(druguse,col="gray",main="Minimum spacing = 30 cases", - minspacing=30) - # then try cex - may need both for large differences - intersectDiagram(druguse,main="Very boring single color",col="gray",cex=0.8) - # create a matrix with empty intersections - druguse<-matrix(c(sample(c(0,1),20,TRUE), - sample(c(0,1),20,TRUE), - sample(c(0,1),20,TRUE), - sample(c(0,1),20,TRUE)),ncol=4) - # show only the populated intersections - intersectDiagram(druguse,main="Display only populated intersections") - # show all intersections - intersectDiagram(druguse,main="Display empty intersections",all.intersections=TRUE) -} diff --git a/man/jiggle.Rd b/man/jiggle.Rd deleted file mode 100644 index e31efe7..0000000 --- a/man/jiggle.Rd +++ /dev/null @@ -1,33 +0,0 @@ -\name{jiggle} -\alias{jiggle} -\title{ Calculate equally spaced values within a range. } -\description{ - Calculates a specified number of equally spaced values in a range -} -\usage{ - jiggle(n,range=c(-1,1)) -} -\arguments{ - \item{n}{The number of values to calculate.} - \item{range}{The range within which to fit the values.} -} -\details{ - \samp{jiggle} is an alternative to the \samp{jitter} function. Instead - of using \samp{runif} to provide the values, it calls \samp{sample} - and then scales the resulting values to the range specified. This - guarantees that the values will be evenly spaced. -} -\value{ A vector of n values within the range specified. } -\author{Jim Lemon} -\examples{ - ahw.df<-data.frame(Age=rnorm(100,35,10), - Height=rnorm(100,160,15),Weight=rnorm(100,75,20)) - par(mfrow=c(1,3)) - boxplot(ahw.df$Age,main="Age") - points(jiggle(100,c(0.5,1.5)),ahw.df$Age,col="red") - boxplot(ahw.df$Height,main="Height") - points(jiggle(100,c(0.5,1.5)),ahw.df$Height,col="green") - boxplot(ahw.df$Weight,main="Weight") - points(jiggle(100,c(0.5,1.5)),ahw.df$Weight,col="blue") -} -\keyword{misc} diff --git a/man/joyPlot.Rd b/man/joyPlot.Rd deleted file mode 100644 index 9d7f7bb..0000000 --- a/man/joyPlot.Rd +++ /dev/null @@ -1,56 +0,0 @@ -\name{joyPlot} -\alias{joyPlot} -\title{Display a series of density curves.} -\usage{ - joyPlot(x,mar=c(5,4,4,2),newrange=c(0,1),border=NA,fill=NULL, - main="",xlab="",ylab="",xlim=NA,line_labels=names(x),xat=NULL, - xaxlab=NULL) -} -\arguments{ - \item{x}{A list of density curves or other objects with x and y values.} - \item{mar}{Margins for the plot.} - \item{newrange}{Passed to \samp{rescale} to scale the values to fit the - bands on the plot. See Details.} - \item{border}{The border colors for the polygons.} - \item{fill}{Optional fill colors for the polygons.} - \item{main}{Text for the title for the plot.} - \item{xlab,ylab}{The x and y axis labels.} - \item{xlim}{Optional limit for the x axis as \samp{density} returns - values outside the range of the values in \samp{x}.} - \item{line_labels}{Labels for the lines/polygons dieplayed.} - \item{xat}{Optional custom x tick positions.} - \item{xaxlab}{Optional custom x tick labels.} -} -\description{ - \samp{joyPlot} displays a matrix of density curves or other two - component lists whose names are \samp{x} and \samp{y}. The labels for - each line/polygon are displayed on the left axis of the plot. - The labels default to the names of the components of \samp{x} if these - are present. -} -\details{ - The density curves or other x/y lists will be scaled so that the largest - will fit into the one user unit band allocated for each curve by default. - If the second value of \samp{newrange} is changed, the heights of the - curves will change proportionately. See the third exampls. -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{plot}, \link{stackpoly}} -\examples{ - x1<-c(sample(20:50,20),sample(40:80,30)) - x2<-c(sample(10:40,30),sample(50:90,30)) - x3<-sample(20:90,50) - xdens1<-density(x1) - xdens2<-density(x2) - xdens3<-density(x3) - joyPlot(list(xdens1,xdens2,xdens3),main="joyPlot with lines", - xlab="Position",xlim=c(0,100)) - xlist<-list(first=xdens1,second=xdens2,third=xdens3) - joyPlot(xlist,main="joyPlot with polygons",xlab="Position", - fill=c("#ffcccc","#ccffcc","#ccccff"),xlim=c(0,100)) - joyPlot(xlist,main="joyPlot with overlapping polygons", - fill=c("#ffcccc","#ccffcc","#ccccff"),xlim=c(0,100), - newrange=c(0,1.5),xlab="Position") -} -\keyword{misc} diff --git a/man/kiteChart.Rd b/man/kiteChart.Rd deleted file mode 100644 index 20cf37c..0000000 --- a/man/kiteChart.Rd +++ /dev/null @@ -1,93 +0,0 @@ -\name{kiteChart} -\alias{kiteChart} -\title{ Magnitude by position chart. } -\description{ - Display numeric values as the widths of a polygon along a dimension such as time. -} -\usage{ - kiteChart(x,xlim=NA,ylim=NA,timex=TRUE,main="Kite chart", - xlab=ifelse(timex,"Time","Groups"),ylab=ifelse(timex,"Groups","Time"), - border=par("fg"),col=NULL,varpos=NA,varlabels=NA,varscale=FALSE, - timepos=NA,timelabels=NA,mar=c(5,4,4,4),axlab=c(1,2,3,4), - normalize=FALSE,shownorm=TRUE,...) -} -\arguments{ - \item{x}{Numeric matrix or data frame} - \item{xlim}{Horizontal extent of the chart. Defaults to 1:dim(x)[2].} - \item{ylim}{Vertical extent of the chart. Defaults to 0.5:dim(x)[1]+0.5.} - \item{timex}{Whether the "time" axis is x (horizontal) or not.} - \item{main,xlab,ylab}{As in \samp{plot}.} - \item{border}{The border color(s) for the polygons.} - \item{col}{The fill colors for the polygons.} - \item{varpos}{Optional positions for the "kite lines". Defaults to 1:dimx[1]. - (see Details)} - \item{varlabels}{Labels for the rows of values - defaults to the rownames, - or if these are missing, varpos[1:dim(x)[1]].} - \item{varscale}{Whether to show the maximum extent of each "kite line".} - \item{timepos}{The positions of the values along the x axis, usually times, - defaulting to 1:dim(x)[2].} - \item{timelabels}{Labels for the positions, defaulting to \samp{timepos}.} - \item{mar}{Plot margins. These leave space for the normalization multipliers - on the right or top side (see Details).} - \item{axlab}{Where to put axis tick labels and multipliers. See Details.} - \item{normalize}{Whether to scale each row of values to a maximum width of 1.} - \item{shownorm}{Whether to display the normalization multipliers.} - \item{...}{additional arguments passed to \samp{plot}.} -} -\details{ - \samp{kiteChart} displays each row of \samp{x} as a sequence of widths, allowing - the relationships between those values and the dimension along which they occur - (usually time) to be illustrated. - - The values in x are scaled to a maximum polygon width of 1 if \samp{normalize} - is TRUE. This is to avoid overlapping of the polygons. There may be some cases - where the values can be displayed directly. If normalized, the multipliers will - be displayed for each row on the right or top side of the chart unless \samp{shownorm} - is FALSE. Remember to specify the \samp{mar} argument if more space at the top - is needed. - - The \samp{axlab} argument allows the user to place the axis tick labels and - normalization multipliers on different axes. The default places the tick labels - on the bottom and left sides of the plot and the multipliers on the right or top. - Using \samp{axlab=c(3,4,1,2)} places the tick labels on the top and right and the - multipliers on the left or bottom. The \samp{mar} argument may have to be adjusted. - - The user can display raw values by default, or by setting \samp{varpos} to TRUE. - Setting \samp{varpos} to a vector of positions will place the "kite lines" on those - values. If there are no row names and the \samp{varlabels} argument is NA, the values - of \samp{varpos} will be used as labels for each "kite line". The maximum extent of - each "kite line" can be displayed by setting \samp{varscale} to TRUE. If - \samp{varscale} is TRUE, one extra line will be added to the top margin. If - \samp{varpos[1]} is not NA, \samp{normalize} is FALSE by default. -} -\value{The values of \samp{mar} that were current when \samp{kiteChart} was called.} -\author{Jim Lemon (Thanks to Michael Bedward for suggestions on the arguments and - Nikolaus Lampadariou for the suggestions on displaying raw values)} -\seealso{\link{polygon}} -\examples{ - testmat<-matrix(c(runif(50),sample(1:50,50),rnorm(50)+5, - sin(1:50)),ncol=50,byrow=TRUE) - kiteChart(testmat,varlabels=c("Uniform","Sample","Normal","Sine"), - timepos=seq(1,50,by=5),timex=FALSE) - # not enough space for the last label, add it - mtext("Sine",at=65,side=1,line=2) - # now show it with kite line maxima - kiteChart(testmat,varlabels=c("Uniform","Sample","Normal","Sine"), - timepos=seq(1,50,by=5),timex=FALSE,varscale=TRUE) - mtext("Sine",at=65,side=1,line=2) - musicmat<-matrix(c(c(0.5,0.4,0.3,0.25,0.2,0.15,0.1,rep(0.05,44))+runif(51,0,0.05), - c(0.1,0.2,0.3,0.35,0.4,0.5,0.4,rep(0.5,14),rep(0.4,15),rep(0.3,15))+runif(51,0,0.1), - rep(0.15,51)+runif(51,0,0.1), - c(rep(0,29),c(0.1,0.2,0.4,0.5,0.3,0.2,rep(0.05,16))+runif(22,0,0.05)), - c(rep(0,38),c(rep(0.05,6),0.08,0.15,0.20,0.25,0.2,0.25,0.3)+runif(13,0,0.05))), - ncol=51,byrow=TRUE) - kiteChart(musicmat,varlabels=c("Swing","Rock","Jazz","Disco","Rap"), - main="An utterly imaginary chart of music popularity", - timepos=seq(1,51,by=10),timelabels=seq(1950,2000,by=10),mar=c(5,4,4,2)) - # now flip it to vertical, normalize and show the normalization factors - kiteChart(musicmat,varlabels=c("Swing","Rock","Jazz","Disco","Rap"), - main="An utterly imaginary chart of music popularity",xlab="Style", - timepos=seq(1,51,by=10),timelabels=seq(1950,2000,by=10),mar=c(5,4,4,2), - timex=FALSE,normalize=TRUE,shownorm=TRUE) -} -\keyword{misc} diff --git a/man/l2010.Rd b/man/l2010.Rd deleted file mode 100644 index 5b80d9a..0000000 --- a/man/l2010.Rd +++ /dev/null @@ -1,14 +0,0 @@ -\name{l2010} -\alias{l2010} -\title{World lightning strike data from 2010} -\description{ - A list of two 50x100 matrices containing most of the world lightning strike - data from 2010. It was produced by \samp{makeDensityMatrix} from 171 file - (about 3 Gb) of data consisting in two geographic coordinates for the - approximate location of each recorded strike and an estimated intensity of the - strike in kVA. -} -\usage{ - data(l2010) -} -\keyword{misc} diff --git a/man/labbePlot.Rd b/man/labbePlot.Rd deleted file mode 100644 index 1818071..0000000 --- a/man/labbePlot.Rd +++ /dev/null @@ -1,65 +0,0 @@ -\name{labbePlot} -\alias{labbePlot} -\title{ Display a L'Abbe plot } -\description{ - Display the percentages of successes for two conditions to be compared as circles, - the area of which is proportional to the number of observations. -} -\usage{ - labbePlot(x,main="L'Abbe plot",xlab="Percent positive response with placebo", - ylab="Percent positive response with treatment",labels=NULL,col=NA, - circle.mag=0.5,add=FALSE,...) -} -\arguments{ - \item{x}{A list of either 2x2 tables or three element vectors (see Details).} - \item{main}{The title of the plot.} - \item{xlab,ylab}{The x and y axis labels as in \samp{plot}.} - \item{labels}{Text strings that will be displayed in the center of the circles.} - \item{col}{A list of colors for the circles.} - \item{circle.mag}{A fudge factor for very small or very large numbers of - observations.} - \item{add}{Whether to add the information in \samp{x} to an existing L'Abbe - plot.} - \item{...}{additional arguments passed to \samp{plot}.} -} -\details{ - The elements of \samp{x} may be tables in which rows represent the conditions - being compared, with the comparison condition first (often "placebo") and the - condition of interest (often "intervention") second. The columns represent the - counts of successes and failures. The elements of \samp{x} can also be vectors - with three numeric values, first the percentage of successes for the comparison - condition, second the percentage of successes for the condition of interest and - finally the number of observations. Tables and vectors can be mixed. - - The radius of each circle is the square root of the number of observations - multiplied by \samp{circle.mag}. This allows very small numbers of observations - to be expanded and very large numbers to be reduced in size. As the area of each - circle is proportional to the number of observations, \samp{circle.mag} must be - the same for all circles. The user may wish to expand or contract all the circles - on a plot so that they will fit within the box. - - The labels, if not NULL, are displayed on the circles. The function tries to work - out whether white or black text will be more easily read based on the background - color and displays the text accordingly. -} -\value{nil} -\author{Jim Lemon - thanks to Whitney Melroy for asking for it.} -\seealso{\link{draw.circle}} -\examples{ - # first fake something like the data from a clinical trial - didf<-data.frame(subject=1:50,interv=rep(c("therapist","ex-drinker"),each=25), - outcome=sample(c("more","less"),50,TRUE)) - # make it into a table - didf.tab<-table(didf$interv,didf$outcome) - # now mix in some raw percentages just for the example - didf2<-c(74,46,200) - didf3<-c(33,87,500) - x<-list(didf.tab,didf2,didf3) - labbecol<-list("red","green","blue") - labbePlot(x,main="Ex-drinkers vs therapists", - xlab="Percent reduced drinking (ex-drinkers)", - ylab="Percent reduced drinking (therapists)", - labels=list("A","B52","X117"),col=labbecol) - labbePlot(list(c(20,40,20)),col=list("purple"),labels=list("Z"),add=TRUE) -} -\keyword{misc} diff --git a/man/ladderplot.Rd b/man/ladderplot.Rd deleted file mode 100644 index 25f8a97..0000000 --- a/man/ladderplot.Rd +++ /dev/null @@ -1,89 +0,0 @@ -\name{ladderplot} -\Rdversion{1.1} -\alias{ladderplot} -\alias{ladderplot.default} -\title{ -Ladder Plot -} -\description{ -Makes a ladder plot, similar to \link[MASS]{parcoord} but with more -flexibility and graphical options. -} -\usage{ -ladderplot(x, ...) -\method{ladderplot}{default}(x, scale=FALSE, col=1, pch=19, lty=1, -xlim=c(0.5, ncol(x) + 0.5), ylim=range(x), vertical = TRUE, ordered=FALSE,...) -} -\arguments{ - \item{x}{ -A matrix or data frame with at least 2 columns. -} - \item{scale}{ -Logical, if the original data columns should be scaled to the unit (0-1) interval. -} - \item{col}{ -Color values to use for rows of \samp{x}. If longer than 1, its value is recycled. -} - \item{pch}{ -Point type to use. If longer than 1, its value is recycled. -} - \item{lty}{ -Line type to use. If longer than 1, its value is recycled. -} - \item{xlim, ylim}{ -Limits for axes. -} - \item{vertical}{ -Logical, if the orientation of the ladderplot should be vertical or horizontal. -} - \item{ordered}{ -Logical, if the columns in \samp{x} should be ordered. -} - \item{\dots}{ -Other arguments passed to the function \link{stripchart}. -} -} -\details{ -The function uses \link{stripchart} to plot 1-D scatter plots for each column - in \samp{x}. Then points are joined by lines for each rows of \samp{x}. -} -\value{ -Makes a plot as a side effect. -Returns \samp{NULL} invisibly. -} -\author{ -Peter Solymos -} -\seealso{ -\link{lines}, \link{points}, \link{stripchart} - -Almost identical function: \link[MASS]{parcoord} -} -\examples{ -x<-data.frame(A=c(1:10), B=c(2:11)+rnorm(10)) -y<-data.frame(x, C=c(1:10)+rnorm(10)) -opar <- par(mfrow=c(1,3)) -ladderplot(x) -ladderplot(x, col=1:10, vertical=FALSE) -ladderplot(y, col=1:10) -par(opar) - -## examples from parcoord -\dontrun{ -if (require(MASS)) { -opar <- par(mfrow=c(2,3)) -z1 <- state.x77[, c(7, 4, 6, 2, 5, 3)] -parcoord(z1, main="parcoord state.x77") -ladderplot(z1, pch=NA, scale=TRUE, main="ladderplot state.x77 original") -ladderplot(z1, main="ladderplot state.x77 original") -ir <- rbind(iris3[,,1], iris3[,,2], iris3[,,3]) -z2 <- log(ir)[, c(3, 4, 2, 1)] -parcoord(z2, col = 1 + (0:149)) -ladderplot(z2, scale=TRUE, col = 1 + (0:149), - main="ladderplot iris original") -ladderplot(z2, col = 1 + (0:149)) -par(opar) -} -} -} -\keyword{ aplot } diff --git a/man/legendg.Rd b/man/legendg.Rd deleted file mode 100644 index 03df9f9..0000000 --- a/man/legendg.Rd +++ /dev/null @@ -1,76 +0,0 @@ -\name{legendg} -\alias{legendg} -\title{Legend with grouped bars, lines or symbols} -\description{Displays a legend with more than one rectangle, symbol or line.} -\usage{ - legendg(x,y=NULL,legend,fill=NULL,col=par("col"), - border=list("black"),lty,lwd,pch=NULL,angle=45,density=NULL, - bty="o",bg=par("bg"),box.lwd=par("lwd"),box.lty=par("lty"), - box.col=par("fg"),pt.bg=NA,cex=1,pt.cex=cex,pt.lwd=lwd, - pt.space=1,xjust=0,yjust=1,x.intersp=1,y.intersp=1, - adj=c(0,0.5),text.width=NULL,text.col=par("col"),merge=FALSE, - trace=FALSE,plot=TRUE,ncol=1,horiz=FALSE,title=NULL, - inset=0,xpd,title.col=text.col) -} -\arguments{ - \item{x,y}{Position of the legend as in \samp{legend}.} - \item{legend}{Labels for the legend as in \samp{legend}.} - \item{fill}{List of fill colors for the rectangles.} - \item{col}{Color(s), perhaps as a list, for the symbols.} - \item{border}{Border color(s) for the rectangles.} - \item{lty}{Line type, currently ignored and set to 1.} - \item{lwd}{Line width, currently ignored.} - \item{pch}{List of symbols for the legend.} - \item{angle,density}{Currently ignored.} - \item{bty}{Legend box type to be displayed.} - \item{bg}{Background color for the legend.} - \item{box.lwd,box.lty,box.col}{Line width, type and color - for the surrounding box.} - \item{cex}{Character expansion for text.} - \item{pt.bg,pt.cex,pt.lwd}{Background color, character - expansion and line width for the symbols.} - \item{pt.space}{Spacing for the symbols as a multiplier - for \samp{strwidth("O")}.} - \item{xjust,yjust}{Justification for the legend.} - \item{x.intersp,y.intersp}{x and y character spacing for - the legend text.} - \item{adj}{Text adjustment.} - \item{text.width,text.col}{Width and color of the legend text.} - \item{merge}{Whether to merge points and lines.} - \item{trace}{Show how the legend is calculated.} - \item{plot}{Whether to plot the legend.} - \item{ncol}{Number of columns in the legend.} - \item{horiz}{Whether to display a horizontal legend.} - \item{title}{Title for the legend.} - \item{inset}{Inset distances for use with keywords.} - \item{xpd}{An optional value for \samp{par(xpd=)}.} - \item{title.col}{Color for the legend title.} -} -\value{ - The value returned by \samp{legend} returned invisibly. -} -\details{ - \samp{legendg} calls \samp{legend} to display a legend with a - blank space to the left of the labels. It then attempts to display - groups of colored rectangles or symbols in that space depending - upon the contents of either \samp{fill} or \samp{pch}. These - should be in the form of a list with the number of elements equal - to the number of labels, and one or more fills or symbols for each - label. \samp{legendg} will display up to four fills or symbols - next to each label, allowing the user to label a group of these - rather than just one per label. -} -\author{Jim Lemon} -\seealso{\link{legend}} -\examples{ - plot(0.5,0.5,xlim=c(0,1),ylim=c(0,1),type="n", - main="Test of grouped legend function") - legendg(0.5,0.8,c("one","two","three"),pch=list(1,2:3,4:6), - col=list(1,2:3,4:6),pt.space=1.5) - legendg(0.5,0.5,c("one","two","three"),fill=list(1,2:3,4:6)) - # fake a line/point with text points - legendg(0.2,0.25,c("letter","number"), - pch=list(c("-","A","-"),c("-","1","-")), - col=list(rep(2,3),rep(3,3))) -} -\keyword{misc} diff --git a/man/lengthKey.Rd b/man/lengthKey.Rd deleted file mode 100644 index ddd32d7..0000000 --- a/man/lengthKey.Rd +++ /dev/null @@ -1,32 +0,0 @@ -\name{lengthKey} -\alias{lengthKey} -\title{Key for interpreting lengths in a plot} -\description{Key for interpreting lengths in a plot} -\usage{ - lengthKey(x,y,tickpos,scale) -} -\arguments{ - \item{x,y}{The position of the left end of the key in user units.} - \item{tickpos}{The labels that will appear above the key.} - \item{scale}{A value that will scale the length of the key.} -} -\value{nil} -\details{ - \samp{lengthKey} displays a line with tick marks and the values in - \samp{tickpos} above those tickmarks. It is useful when line segments - on a plot represent numeric values. Note that if the plot does not have - a 1:1 aspect ratio, a length key is usually misleading. -} -\author{Jim Lemon} -\seealso{\link{segments}, \link{arrows}} -\examples{ - # manufacture a matrix of orientations in radians - o<-matrix(rep(pi*seq(0.1,0.8,by=0.1),7),ncol=8,byrow=TRUE) - m<-matrix(rnorm(56)+4,ncol=8,byrow=TRUE) - # get an empty plot of approximately 1:1 aspect ratio - plot(0,xlim=c(0.7,8.3),ylim=c(0.7,7.3),type="n") - vectorField(o,m,vecspec="rad") - # the scaling usually has to be worked out by trial and error - lengthKey(0.3,-0.5,c(0,5,10),0.24) -} -\keyword{misc} diff --git a/man/makeDensityMatrix.Rd b/man/makeDensityMatrix.Rd deleted file mode 100644 index d0c1fb0..0000000 --- a/man/makeDensityMatrix.Rd +++ /dev/null @@ -1,71 +0,0 @@ -\name{makeDensityMatrix} -\alias{makeDensityMatrix} -\title{Compute a matrix of counts from a list of x,y positions} -\description{ - Compute a matrix in which the counts in each cell represent the number of - occurrences of that cell's coordinates in a list of x,y cooordinate values, - optionally computing a second matrix of the average of the values attached - to the coordinate observations. -} -\usage{ - makeDensityMatrix(x,y,z=NULL,nx=100,ny=50,zfun=c("mean","sum"), - xlim=c(-180,180),ylim=c(-90,90),geocoord=TRUE) -} -\arguments{ - \item{x,y}{Vectors of x and y coordinates. These are usually combined in a - matrix or data frame of two columns.} - \item{z}{Optional values attached to each coordinate pair. If these are present, - it can be in a matrix or data frame of three columns, x, y and z.} - \item{nx}{The number of "x" cells in the output matrix.} - \item{ny}{The number of "y" cells in the output matrix.} - \item{zfun}{The function to apply to the summed values attached to each - coordinate pair. Currently defaults to mean, otherwise the sum is returned.} - \item{xlim}{The extreme coordinates in the horizontal direction (see Details).} - \item{ylim}{The extreme coordinates in the vertical direction (see Details).} - \item{geocoord}{Whether to correct the matrix values for the areal distortion - of the Mercator projection.} -} -\details{ - \samp{makeDensityMatrix} expects two vectors or a matrix or data frame with - at least two columns. The function was written for geographic coordinates, - but will also work for other numeric coordinates. An optional third vector - or column of values for each coordinate will be processed. - - Each coordinate pair adds to the count in that cell of the matrix. If there - is a third element, that value is added to a second matrix in the same - position. By default, the function computes the mean of all values in each - cell. If \samp{zfun="sum"}, the sum of values in each cell will be returned. - - As geograhic data sets may be very large, leading to memory problems, - \samp{makeDensityMatrix} can be run on small sections of the data set and the - resulting matrices added together as long as the coordinate limits are - consistent throughout. -} -\value{ - Either a matrix of counts of coordinate pairs within each cell or a list of - two such matrices, the second containing the mean or sum of values associated - with coordinate pairs. -} -\examples{ - x<-sample(1:20,400,TRUE) - y<-sample(1:20,400,TRUE) - z<-runif(400,5,20) - xyz<-makeDensityMatrix(x,y,z,nx=20,ny=20,xlim=c(1,10),ylim=c(1,10), - geocoord=FALSE) - par(mar=c(7,3,2,3)) - plot(0,xlim=c(1,10),ylim=c(1,10),type="n",xlab="",axes=FALSE) - box() - densityGrid(xyz,range.cex=c(1,4),xlim=c(1,10),ylim=c(1,10), - red=c(0,0.5,0.8,1),green=c(1,0.8,0.5,0),blue=0,pch=15) - color.legend(3,-0.7,7,-0.2,c(5,10,15,20), - rect.col=color.scale(1:4,cs1=c(0,0.5,0.8,1),cs2=c(1,0.8,0.5,0),cs3=0,alpha=1)) - par(xpd=TRUE) - text(5,0.3,"Intensity") - points(c(3.5,4.5,5.5,6.5),rep(-1.7,4),pch=15,cex=1:4) - text(c(3.5,4.5,5.5,6.5),rep(-1.3,4),1:4) - text(5,-1,"Density") - par(xpd=FALSE) -} -\author{Jim Lemon} -\seealso{\link{densityGrid}} -\keyword{misc} diff --git a/man/makeIntersectList.Rd b/man/makeIntersectList.Rd deleted file mode 100755 index 1e55125..0000000 --- a/man/makeIntersectList.Rd +++ /dev/null @@ -1,62 +0,0 @@ -\name{makeIntersectList} -\alias{makeIntersectList} -\title{Count set intersections} -\description{Create a list of set intersections from a matrix of indicators} -\usage{ - makeIntersectList(x,xnames=NULL,sep="+") -} -\arguments{ - \item{x}{A data frame or matrix where rows represent objects and columns - attributes. A \samp{1} or \samp{TRUE} indicates that the object (row) has - that attribute or is a member of that set (column). \samp{x} can also be - a matrix or data frame in which the first column contains object identifiers - and the second contains attribute codes.} - \item{xnames}{Optional user-supplied names for the attributes of x.} - \item{sep}{A character to use as a separator for attribute labels.} -} -\details{ - \samp{makeIntersectList} reads a matrix (or data frame where all values are the - same type) containing dichotomous values (either 0/1 or FALSE/TRUE) or labels - (see next paragraph). In the first type of input, each row represents an object - and each column represents a set. A value of 1 or TRUE indicates that that - object is a member of that set. The function creates a list of vectors that - correspond to all combinations of the sets (set intersections) and inserts the - counts of elements in each combination. If a row of \samp{x} is all zeros, - it will not be counted, but the second last element of the list returned - contains the count of rows in \samp{x} and thus non-members can be calculated. - - If a matrix (or data frame where all values are the same type) containing values - other than 0/1 or TRUE/FALSE, it will be passed to \samp{categoryReshape} for - conversion to a data frame as described above. See \samp{categoryReshape} for - details of this. - - makeIntersectList combines the set or attribute names to form - intersection names. For the intersection of sets A and B, the name will - be A+B (unless \samp{sep} is changed) and so on. These are the names that will - be displayed by \samp{intersectDiagram}. To change these, use the \samp{xnames} - argument. -} -\value{ - A list of the intersection counts or percentages, the total number of - objects and the attribute codes. -} -\keyword{misc} -\author{Jim Lemon} -\seealso{\link{intersectDiagram}, \link{pasteCols},\link{categoryReshape}} -\examples{ - # create a matrix where each row represents an element and - # a 1 (or TRUE) in each column indicates that the element is a member - # of that set. - setdf<-data.frame(A=sample(c(0,1),100,TRUE,prob=c(0.7,0.3)), - B=sample(c(0,1),100,TRUE,prob=c(0.7,0.3)), - C=sample(c(0,1),100,TRUE,prob=c(0.7,0.3)), - D=sample(c(0,1),100,TRUE,prob=c(0.7,0.3))) - makeIntersectList(setdf) - ns<-sample(1:8,20,TRUE) - objects<-0 - for(i in 1:length(ns)) objects<-c(objects,rep(i,ns[i])) - attributes<-"Z" - for(i in 1:length(ns)) attributes<-c(attributes,sample(LETTERS[1:8],ns[i])) - setdf2<-data.frame(objects[-1],attributes[-1]) - makeIntersectList(setdf2) -} diff --git a/man/maxEmptyRect.Rd b/man/maxEmptyRect.Rd deleted file mode 100644 index 35253f2..0000000 --- a/man/maxEmptyRect.Rd +++ /dev/null @@ -1,44 +0,0 @@ -\name{maxEmptyRect} -\alias{maxEmptyRect} -\title{ Find an empty space on a plot } -\description{ - Try to find the largest empty rectangle on a plot. -} -\usage{ - maxEmptyRect(ax,ay,x,y) -} -\arguments{ - \item{ax,ay}{The rectangle within which all of the points are contained. - Usually the limits of a plot.} - \item{x,y}{x and y positions of the points.} -} -\details{ - \samp{maxEmptyRect} searches the pairs of points on the plot to find - the largest rectangular space within which none of the points lie. - It does not guarantee that the space will be large enough to fit a - legend or text. - - Two alternatives are the \samp{largest.empty} function in the - \pkg{Hmisc} package and the \samp{emptyspace} function. \samp{maxEmptyRect} - appears to outperform \samp{emptyspace}, particularly in running time. - However, \samp{emptyspace} will sometimes find a "squarer" rectangle when - \samp{maxEmptyRect} finds a slightly larger narrow rectangle. -} -\value{ - A list containing the area of the rectangle and the coordinates of the - lower left and upper right corners (as used in \samp{rect}) of the rectangle - found. -} -\author{Hans Borchers} -\references{ - A. Naamad, D. T. Lee, and W.-L. Hsu (1984). On the Maximum Empty - Rectangle Problem. Discrete Applied Mathematics, 8: 267-277. -} -\examples{ - x<-runif(100) - y<-runif(100) - plot(x,y,main="Find the maximum empty rectangle",xlab="X",ylab="Y") - mer<-maxEmptyRect(c(0,1),c(0,1),x,y) - rect(mer$rect[1],mer$rect[2],mer$rect[3],mer$rect[4],border="red") -} -\keyword{misc} diff --git a/man/mtext3d.Rd b/man/mtext3d.Rd deleted file mode 100644 index 66f1509..0000000 --- a/man/mtext3d.Rd +++ /dev/null @@ -1,21 +0,0 @@ -\name{mtext3d} -\alias{mtext3d} -\title{ Display text in the margins of a 3D plot } -\description{ - Display text in the margins of a 3D plot. -} -\usage{ - mtext3d(edge,pmat,labels=TRUE,at=NULL,dist=0.3,xpd=NA,...) -} -\arguments{ - \item{edge}{ which axis to calculate.} - \item{pmat}{ matrix to transform coordinates. } - \item{labels}{ labels to display in the margin. } - \item{at}{ position on the axis. } - \item{dist}{ Offset of the axis. } - \item{xpd}{ set clipping for display. } - \item{...}{ additional arguments passed to ptext3d. } -} -\value{nil} -\author{Ben Bolker} -\keyword{misc} diff --git a/man/multhist.Rd b/man/multhist.Rd deleted file mode 100644 index 0df709c..0000000 --- a/man/multhist.Rd +++ /dev/null @@ -1,41 +0,0 @@ -\name{multhist} -\alias{multhist} -\title{Plot a multiple histogram, as a barplot} -\description{ - Given a list, plots a side-by-side barplot containing the histograms - of the elements -} -\usage{ - multhist(x,beside=TRUE,freq=NULL,probability=!freq,plot.it=TRUE,...) -} -\arguments{ - \item{x}{a list of numeric vectors} - \item{beside}{plot histogram bars for groups side-by-side?} - \item{freq}{logical; if 'TRUE', the histogram graphic is a representation - of frequencies, the 'counts' component of the result; if - 'FALSE', probability densities, component 'density', are - plotted (so that the histogram has a total area of one). - Defaults to 'TRUE' if 'probability' is not specified - (does not consider equidistant breaks as in \link{hist})} - \item{probability}{an alias for '!freq', for S compatibility} - \item{plot.it}{Whether or not to display the histogram.} - \item{...}{additional arguments to \link{hist} or \link{barplot}} -} -\value{ - A list including the return value for the first call to \samp{hist} (itself a list) - and the values for the bar heights. -} -\author{Ben Bolker} -\seealso{\link{hist},\link{barplot}} -\note{ - The 'inside' argument to \link{barplot} (which is not currently - implemented in barplot anyway) is deleted from the argument list. The - default value of NULL for \samp{freq} is for consistency with \samp{hist} - but is equivalent to TRUE. -} -\examples{ - set.seed(1234) - l <- list(runif(10)*10,1:10,c(1,1,1,1,4,8)) - multhist(l) -} -\keyword{hplot} diff --git a/man/multivari.Rd b/man/multivari.Rd deleted file mode 100755 index 3c80dcc..0000000 --- a/man/multivari.Rd +++ /dev/null @@ -1,156 +0,0 @@ -\name{multivari} -\alias{multivari} -\title{ -Function to draw a multivari chart -} -\description{ -A multivari chart of one quantitative response variable depending on two -to four categorical variables can be drawn. -} -\usage{ -multivari(var, fac1, fac2, fac3 = NULL, fac4 = NULL, data, sort = FALSE, - fun = mean, pch = list(15, 16, 17), col = list("black", "blue", "red"), - col0 = "black", cex = 1, fac.cex = 2, xlab.depth = 3, legend = FALSE, - main = paste("multivari chart of", var), add = FALSE, ...) -} -%- maybe also 'usage' for other objects documented here. -\arguments{ - \item{var}{variable name (character string) or column index of response - variable, required -} - \item{fac1}{variable name (character string) or column index of first - level factor, required; precedes \code{fac2} and \code{fac3} (if present) in the hierarchy (see Details) -} - \item{fac2}{variable name (character string) or column index of second - level factor, required; follows \code{fac1} and precedes \code{fac3} (if present) - in the hierarchy (see Details) -} - \item{fac3}{variable name (character string) or column index of third - level factor, optional; if present, \code{fac3} is the last factor in the hierarchy (see Details) -} - \item{fac4}{ -variable name (character string) or column index of fourth level factor, -optional; can only be specified if there is also a third level factor; -if present, this factor is the first in the hierarchy (see Details), and separate multivari charts for the first three factors are drawn for each level of this factor} - \item{data}{ -a data frame, required -} - \item{sort}{ -logical, specifying whether or not levels are sorted, when converting -character vectors to factors (a single choice for all factors is needed); default: \code{FALSE} -} - \item{fun}{ -a function to be used in aggregation; default: \code{mean} -} - \item{pch}{ - a list of length 2 or 3, depending on whether or not \code{fac3} is - specified; the ith list element can be an individual plotting symbol - (like the usual \code{pch} entry) or a vector of plot symbols for each - level of \code{fac_i} -} - \item{col}{ - a list of length 2 or 3, depending on whether or not \code{fac3} is - specified; the ith list element can be an individual color or a vector - of colors for each level of \code{fac_i}; this color specification is - used for the plot symbols of \code{fac_i} levels and for the lines - connecting the symbols for the next level in the hierarchy -} - \item{col0}{ -the color for the first line to be drawn -} - \item{cex}{ -the size of axis annotation text -(annotation of the fourth level header is 1.5 times this size) -} - \item{fac.cex}{ -a multiplier for \code{cex}; plot symbol sizes are \code{fac.cex*cex}; -default: 2 -} - \item{xlab.depth}{ -labels for the horizontal axis are printed down to this level of the -hierarchy (default: 3); if the depth is reduced, different plot symbols -should be used, and a legend should be drawn -} - \item{legend}{ -logical determining whether or not a legend should be drawn (default: -FALSE); the function determines wether top right or bottom right yields -a better position (it is not guaranteed that there is no overlab); if -this does not work well, one can manually draw a legend in the outer -margin -} - \item{main}{ -title, as usual; a default is provided -} - \item{add}{ -logical; add to an existing plot (which of course has to have suitable axis limits)?; default: FALSE; -note that horizontal axis labeling will always be printed by function multivari, while vertical axis labeling will be omitted for \code{add=TRUE} -} - \item{\dots}{ -further arguments to functions \code{plot}, \code{lines}, \code{points}, - \code{mtext} -} -} -\details{ -The function is inspired by Minitabs behavior for multivari charts -(see also Bruno Scibilia's blog which is linked in the references). It -does not attempt to visualize individual observations. - -A multivari chart mainly serves exploratory purposes. -It works particularly well with balanced data, but can also be used for messy data. -\code{multivari} can visualize the dependence of a single quantitative variable on up to four factors (i.e., interactions of order up to four can be visualized). The display is hierarchical: for factors later in the hierarchy, conditional means given level combinations of factors earlier in the hierarchy are displayed. Therefore, the order of the -factors can make a big difference in the display. If there is no natural -order, it may be worthwhile to inspect several orders. - -For interactions with two factors only, it is often preferrable to use -function \code{\link{interaction.plot}} or \code{\link{raw.means.plot}}. - -} -\value{ -a list of (lists of) data frames with summary statistics to be plotted -} - -\references{ -Scibilia, Bruno (2013). Using Multi-Vari Charts to Analyze Families of Variations. \url{https://blog.minitab.com/en/blog/using-variability-charts-to-analyze-call-center-wait-times}. -} - -\author{ -Ulrike Groemping -} -\seealso{ -See also \code{\link{interaction.plot}}, \code{\link{raw.means.plot}} -} -\examples{ -##---- Should be DIRECTLY executable !! ---- -##-- ==> Define data, use random, -##-- or do help(data=index) for the standard data sets. -\dontrun{ -require(car) -multivari("cycles", "len", "load", "amp", data=Wool, - col=list("black","red",c("grey70","grey45","grey20")), - pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2) -multivari("cycles", "load", "len", "amp", data=Wool, - col=list("black",c("red","blue","darkgreen"), - c("grey70","grey45","grey20")), - pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2) - -## create a fake fourth factor -fakedat <- rbind(cbind(newfac="blabla",Wool),cbind(newfac="albalb",Wool)) -## make it character for demonstrating the effect of sort option -fakedat$newfac <- as.character(fakedat$newfac) - -## default: sort order in the data is respected (order of unique is used) -multivari("cycles", "load", "len", "amp", "newfac", data=fakedat, - col=list("black",c("red","blue","darkgreen"), - c("grey70","grey45","grey20")), - pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2, cex=0.8) - -## sort=TRUE: levels are sorted (order of sort(unique)) -multivari("cycles", "load", "len", "amp", "newfac", data=fakedat, - col=list("black",c("red","blue","darkgreen"), - c("grey70","grey45","grey20")), - pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2, cex=0.8, - sort=TRUE) -} -} -\keyword{ hplot } -\keyword{ design } diff --git a/man/multsymbolbox.Rd b/man/multsymbolbox.Rd deleted file mode 100644 index 288e49f..0000000 --- a/man/multsymbolbox.Rd +++ /dev/null @@ -1,33 +0,0 @@ -\name{multsymbolbox} -\alias{multsymbolbox} -\title{Draw boxes filled with symbols} -\description{ - Draw boxes on the current figure filled with symbols representing - individual counts. -} -\usage{ - multsymbolbox(x1,y1,x2,y2,tot,relw=0.8,fg=par("fg"),bg=par("bg"), - box=TRUE,debug=FALSE,...) -} -\arguments{ - \item{x1}{numeric vector: left sides of boxes} - \item{y1}{numeric vector: bottom sides of boxes} - \item{x2}{numeric vector: right sides of boxes} - \item{y2}{numeric vector: top sides of boxes} - \item{tot}{numeric vector: total numbers of symbols to put in each box} - \item{relw}{relative width (relative to height) of symbols}n - \item{fg}{foreground color(s)} - \item{bg}{background color(s)} - \item{box}{(logical) draw box borders?} - \item{debug}{debug output?} - \item{\dots}{additional arguments to polygon() for drawing boxes} -} -\value{ - none -} -\author{Ben Bolker} -\examples{ - plot(1:10,1:10,type="n") - multsymbolbox(c(2,4),5,c(4,5),8,tot=c(10,8)) -} -\keyword{aplot} diff --git a/man/oz.windrose.Rd b/man/oz.windrose.Rd deleted file mode 100644 index 3b02afc..0000000 --- a/man/oz.windrose.Rd +++ /dev/null @@ -1,50 +0,0 @@ -\name{oz.windrose} -\alias{oz.windrose} -\title{Display an Australian wind rose} -\description{Displays a wind rose in the style used by the Australian - Bureau of Meteorology.} -\usage{ - oz.windrose(windagg,maxpct=20,wrmar=c(4,5,6,5),scale.factor=30, - speed.col=c("#dab286","#fe9a66","#ce6733","#986434"), - speed.width=NA,show.legend=TRUE,legend.pos=NA,...) -} -\arguments{ - \item{windagg}{A matrix of percentages with the rows representing - speed ranges and the columns indicating wind directions.} - \item{maxpct}{The maximum percentage displayed on the radial grid.} - \item{wrmar}{Plot margins for the diagram.} - \item{scale.factor}{The scale factor for the diagram.} - \item{speed.col}{Colors representing speed ranges.} - \item{speed.width}{Half widths of the bars representing speed ranges.} - \item{show.legend}{Logical indicating whether to display a legend.} - \item{legend.pos}{The vertical position of the wind rose legend. The - Australian Bureau of Meteorology displays the legend at the top of - the plot} - \item{...}{additional arguments passed to \samp{plot}.} -} -\details{ - \samp{oz.windrose} displays a wind rose in the style used by the Australian - Bureau of Meteorology. Each limb represents a bin of wind directions, and - there are conventionally eight bins. If \samp{windagg} has more than eight - columns, more limbs will be displayed. The rows of \samp{windagg} represent - the speed ranges used by the Australian Bureau of Meteorology (0, 0-10, - 10-20, 20-30 and over 30 in km/hour). The diameter of the central circle is - calculated as (percent calm observations)/(number of direction bins). The - remaining grid circles are spaced from the circumference of the "Calm" - circle. -} -\note{ - If a title is desired, remember to move the legend to the bottom - of the plot. If the function is passed values that do not sum to 100, the - resulting plot will at best be misleading. -} -\value{nil} -\author{Jim Lemon (thanks to Anna in the Sydney BoM office and Alejo for - finding the problem with heavily prevailing winds.)} -\seealso{\link{oz.windrose.legend}, \link{draw.circle}, \link{bin.wind.records}} -\examples{ - windagg<-matrix(c(8,0,0,0,0,0,0,0,4,6,2,1,6,3,0,4,2,8,5,3,5,2,1,1, - 5,5,2,4,1,4,1,2,1,2,4,0,3,1,3,1),nrow=5,byrow=TRUE) - oz.windrose(windagg) -} -\keyword{misc} diff --git a/man/oz.windrose.legend.Rd b/man/oz.windrose.legend.Rd deleted file mode 100644 index 2475a37..0000000 --- a/man/oz.windrose.legend.Rd +++ /dev/null @@ -1,31 +0,0 @@ -\name{oz.windrose.legend} -\alias{oz.windrose.legend} -\title{Display an Australian wind rose legend} -\description{ - Displays a wind rose legend in the style used by the Australian Bureau - of Meteorology. -} -\usage{ - oz.windrose.legend(maxpct=20,scale.factor=30, - speed.col=c("#dab286","#fe9a66","#ce6733","#986434"), - speed.width=NA,legend.pos=NA) -} -\arguments{ - \item{maxpct}{The maximum percentage to display on the radial grid.} - \item{scale.factor}{The scale factor for the plot.} - \item{speed.col}{Colors representing speed ranges.} - \item{speed.width}{Half widths of the bars representing speed ranges.} - \item{legend.pos}{The vertical position of the wind rose legend. The - Australian Bureau of Meteorology displays the legend at the top of - the plot} -} -\value{nil} -\author{Jim Lemon (thanks to Anna in the Sydney BoM office)} -\seealso{\link{oz.windrose}} -\examples{ - plot(0,xlim=c(-20,20),ylim=c(-20,20),type="n",axes=FALSE,xlab="",ylab="") - par(xpd=TRUE) - oz.windrose.legend() - par(xpd=FALSE) -} -\keyword{misc} diff --git a/man/p2p_arrows.Rd b/man/p2p_arrows.Rd deleted file mode 100644 index 77c2f25..0000000 --- a/man/p2p_arrows.Rd +++ /dev/null @@ -1,26 +0,0 @@ -\name{p2p_arrows} -\alias{p2p_arrows} -\title{Draw arrows between points} -\description{Displays arrows on an existing plot between specified - points.} -\usage{ - p2p_arrows(x1,y1,x2,y2,space=0.05,col=par("fg"),...) -} -\arguments{ - \item{x1}{Starting x positions for the labels.} - \item{y1}{Starting y positions for the labels.} - \item{x2}{Ending x positions for the labels.} - \item{y2}{Ending y positions for the labels.} - \item{space}{The proportion of the distance between the points to - leave as space before and after the arrow.} - \item{col}{Color(s) for the arrows.} - \item{...}{Extra arguments passed to \samp{arrows}.} -} -\details{ - \samp{p2p_arrows} displays arrows on a plot between one or more pairs - of specified points. -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{arrows}} -\keyword{misc} diff --git a/man/panes.Rd b/man/panes.Rd deleted file mode 100755 index fc38f5d..0000000 --- a/man/panes.Rd +++ /dev/null @@ -1,90 +0,0 @@ -\name{panes} -\alias{panes} -\title{Prepare a "panel" type layout} -\description{ - Split the graphics device into a "panel" type layout for a group of plots -} -\usage{ - panes(mat=NULL,widths=rep(1,ncol(mat)),heights=rep(1,nrow(mat)), - nrow=2,ncol=2,mar=c(0,0,1.6,0),oma=c(2.5,1,1,1)) -} -\arguments{ - \item{mat}{A matrix representing the number of panes to be created and - their order of plotting.} - \item{widths,heights}{The widths and heights of the panes. - See \samp{layout}.} - \item{nrow,ncol}{The numbers of rows and columns in the layout. - See \samp{par(mfrow)}.} - \item{mar}{The margins for each plot in the panes.} - \item{oma}{The outer margins for the entire group of panes.} -} -\details{ - \samp{panes} combines the information for displaying a set of plots in - a "panel" layout. The default values will usually produce the desired - result by calling \samp{par(mfrow)}. If \samp{mat} is not NULL, the - \samp{layout} function will be called instead of \samp{par(mfrow)}. - The two methods are included for the convenience of the user. - - Note that \samp{panes} does not produce any plots and that the user - must call \samp{tab.title} to get the "look" of the panel plot. The - overall title is usually centered at the left edge (as in the example) - or in the center of one of the plots in the bottom row. -} -\value{ - The values of \samp{par} options that existed when \samp{panes} was - called. This list is usually used to restore those values. -} -\author{Jim Lemon} -\seealso{\link{par},\link{layout}} -\examples{ - y<-runif(8) - oldpar<-panes(matrix(1:4,nrow=2,byrow=TRUE)) - par(mar=c(0,2,1.6,0)) - boxplot(y,axes=FALSE) - axis(2) - box() - par(mar=c(0,0,1.6,2)) - tab.title("Boxplot of y",tab.col="#88dd88") - barplot(y,axes=FALSE,col=2:9) - axis(4) - box() - tab.title("Barplot of y",tab.col="#88dd88") - par(mar=c(2,2,1.6,0)) - pie(y,col=2:9) - tab.title("Pie chart of y",tab.col="#88dd88") - box() - par(mar=c(2,0,1.6,2)) - plot(y,xaxs="i",xlim=c(0,9),axes=FALSE,col=2:9) - axis(4) - box() - tab.title("Scatterplot of y",tab.col="#88dd88") - # center the title at the left edge of the last plot - mtext("Test of panes function",at=0,side=1,line=0.8,cex=1.5) - panes(matrix(1:3,ncol=1),heights=c(0.7,0.8,1)) - par(mar=c(0,2,2,2)) - plot(sort(runif(7)),type="l",axes=FALSE) - axis(2,at=seq(0.1,0.9,by=0.2)) - box() - tab.title("Rising expectations",tab.col="#ee6666") - barplot(rev(sort(runif(7))),col="blue",axes=FALSE) - axis(2,at=seq(0.1,0.9,by=0.2)) - box() - tab.title("Diminishing returns",tab.col="#6666ee") - par(mar=c(4,2,2,2)) - tso<-c(0.2,0.3,0.5,0.4,0.6,0.8,0.1) - plot(tso,type="n",axes=FALSE,xlab="") -\dontrun{ - # the following needs a Unicode locale to work (and a suitable font) - # Few devices can plot these -- and not the default pdf() for checking. - points(1:7,tso,pch=c(rep(-0x263a,6),-0x2639),cex=2) -} - axis(1,at=1:7, - labels=c("Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday","Monday")) - axis(2,at=seq(0.1,0.9,by=0.2)) - box() - tab.title("The sad outcome",tab.col="#66ee66") - mtext("A lot of malarkey",side=1,line=2.5) - - par(oldpar) -} -\keyword{misc} diff --git a/man/pasteCols.Rd b/man/pasteCols.Rd deleted file mode 100644 index 448731d..0000000 --- a/man/pasteCols.Rd +++ /dev/null @@ -1,28 +0,0 @@ -\name{pasteCols} -\alias{pasteCols} -\title{Paste the columns of a matrix together} -\description{Paste the columns of a matrix together to form as - many "words" as there are columns.} -\usage{ - pasteCols(x,sep="") -} -\arguments{ - \item{x}{A matrix.} - \item{sep}{The separator to use in the \samp{paste} command.} -} -\details{ - \samp{pasteCols} pastes the columns of a matrix together to form a vector in - which each element is the concatenation of the elements in each of the columns - of the matrix. It is intended for producing identifiers from a matrix returned - by the \samp{combn} function. -} -\value{A vector of character strings.} -\keyword{misc} -\author{Jim Lemon} -\seealso{\link{makeIntersectList}} -\examples{ - # create a matrix of the combinations of the first five letters of the - # alphabet taken two at a time. - alpha5<-combn(LETTERS[1:5],2,simplify=TRUE) - pasteCols(alpha5,sep="+") -} diff --git a/man/paxis3d.Rd b/man/paxis3d.Rd deleted file mode 100644 index befcd2a..0000000 --- a/man/paxis3d.Rd +++ /dev/null @@ -1,44 +0,0 @@ -\name{paxis3d} -\alias{paxis3d} -\title{ Display text in the margins of a 3D plot } -\description{ - Display text in the margins of a 3D plot. -} -\usage{ - paxis3d(edge,pmat,at=NULL,labels=TRUE,tick=TRUE, - pos=NULL,nticks=5,ticklen=0.05,labdist=0.15,xpd=NA,...) -} -\arguments{ - \item{edge}{ which axis to calculate.} - \item{pmat}{ matrix to transform coordinates. } - \item{at}{ position on the axis. } - \item{labels}{ labels to display in the margin. } - \item{tick}{ whether to draw axis tick marks. } - \item{pos}{ axis position relative to other axes. } - \item{nticks}{ number of tick marks. } - \item{ticklen}{ length of tick marks as a proportion of plot dimensions. } - \item{labdist}{ distance of labels from axis. } - \item{xpd}{ parameter to set plot clipping. } - \item{...}{ additional arguments passed to ptext3d. } -} -\value{nil} -\author{Ben Bolker} -\examples{ - x <- 1:10 - y <- 1:10 - z <- outer(x,y,function(x,y) { 3*sin(2*pi*x)/(2*pi*x)+exp(y/10)+(x*y)/1000 }) - par(mar=c(5,10,2,2)) - pp <- perspx(x,y,z,ticktype="detailed",phi=30,theta=80,nticks=3,r=10, - axes=FALSE) - ## axis labels not drawn when axes=FALSE - paxis3d("X-",pp,at=c(1,2,9)) - paxis3d("Y+",pp) - paxis3d("Z-",pp) - mtext3d("X-",pp,expression(alpha^sqrt(beta))) - ## if you want labels parallel to axis, still have to figure out 'srt' - ## by trial and error - mtext3d("Y+",pp,expression("velocity ("*gamma*", furlongs/fortnight)"), - xpd=NA,srt=6) - mtext3d("Z-",pp,"Range\n(r*)",dist=0.5) -} -\keyword{misc} diff --git a/man/perspx.Rd b/man/perspx.Rd deleted file mode 100644 index 264024b..0000000 --- a/man/perspx.Rd +++ /dev/null @@ -1,29 +0,0 @@ -\name{perspx} -\alias{perspx} -\title{ Display perspective plot } -\description{ - Display an enhanced perspective plot with additional return values -} -\usage{ - perspx(x,y,z,...) -} -\arguments{ - \item{x,y,z}{ x, y and z coordinates to plot. } - \item{...}{ Other arguments passed to \samp{persp}. } -} -\details{ - Displays \samp{z} values plotted on an x,y grid. -} -\value{ - A list with three elements, the ranges of \samp{x}, \samp{y} and \samp{z}. -} -\author{Ben Bolker} -\examples{ - x <- 1:10 - y <- 1:10 - z <- outer(x,y,function(x,y) { 3*sin(2*pi*x)/(2*pi*x)+exp(y/10)+(x*y)/1000 }) - par(mar=c(5,10,2,2)) - pp <- perspx(x,y,z,ticktype="detailed",phi=30,theta=80,nticks=3,r=10, - axes=FALSE) -} -\keyword{misc} diff --git a/man/pie.labels.Rd b/man/pie.labels.Rd deleted file mode 100644 index 880204f..0000000 --- a/man/pie.labels.Rd +++ /dev/null @@ -1,50 +0,0 @@ -\name{pie.labels} -\alias{pie.labels} -\title{ Place labels on a pie chart } -\description{ - Places labels on a pie chart -} -\usage{ - pie.labels(x=0,y=0,angles,labels,radius=1.05,bg="white",border=TRUE, - minangle=NA,boxed=FALSE,explode=0,...) -} -\arguments{ - \item{x,y}{x and y position of the center of the pie chart} - \item{angles}{A numeric vector representing angles in radians. This is - the return value of \samp{floating.pie}.} - \item{labels}{Text strings to label each sector.} - \item{radius}{The radius at which to place the labels in user units. The - default is 1.05.} - \item{bg}{The color of the rectangles on which the labels are displayed.} - \item{border}{Whether to draw borders around the rectangles.} - \item{minangle}{Minimum angle between labels.} - \item{boxed}{Whether to use \samp{text} or \samp{boxed.labels} to display - the labels.} - \item{explode}{How much the pie chart has been "exploded".} - \item{...}{Arguments passed to \samp{text} or \samp{boxed.labels}.} -} -\value{nil} -\details{ - Labels may be placed within the pie (radius less than the pie radius), - on the edge or outside as in the examples below. If within the pie, it - is probably best to use \samp{boxed=TRUE}. - - If some labels overlap, passing a value in radians for \samp{minangle} - may be used to spread them out. -} -\note{ - Remember that \samp{x} and \samp{y} specify the center of the pie chart and - that the label positions are specified by angles and radii from that - center. -} -\author{Jim Lemon} -\seealso{\link{floating.pie}, \link{boxed.labels}, \link{spreadout}} -\examples{ - pieval<-c(2,1,3,94) - plot(0,xlim=c(1.5,5),ylim=c(1,5),type="n",axes=FALSE,xlab="",ylab="") - box() - bisect.angles<-floating.pie(3,3,pieval,explode=c(0.1,0.2,0.3,0)) - pie.labels(3,3,bisect.angles,c("two","one","three","ninety\nfour"), - minangle=0.2,,explode=c(0.1,0.2,0.3,0)) -} -\keyword{misc} diff --git a/man/pie3D.Rd b/man/pie3D.Rd deleted file mode 100644 index db8d480..0000000 --- a/man/pie3D.Rd +++ /dev/null @@ -1,87 +0,0 @@ -\name{pie3D} -\alias{pie3D} -\title{Display a 3D pie chart} -\description{ - Displays a 3D pie chart with optional labels. -} -\usage{ - pie3D(x,edges=NA,radius=1,height=0.1,theta=pi/6,start=0,border=par("fg"), - col=NULL,labels=NULL,labelpos=NULL,labelcol=par("fg"),labelcex=1.5, - sector.order=NULL,explode=0,shade=0.8,mar=c(4,4,4,4),pty="s",...) -} -\arguments{ - \item{x}{a numeric vector for which each value will be a sector} - \item{edges}{the number of lines forming an ellipse} - \item{radius}{the radius of the pie in user units} - \item{height}{the height of the pie in user units} - \item{theta}{The angle of viewing in radians} - \item{start}{The angle at which to start drawing sectors.} - \item{border}{The color of the sector border lines} - \item{col}{The colors of the sectors} - \item{labels}{Optional labels for each sector} - \item{labelpos}{Optional positions for the labels (see examples)} - \item{labelcol}{The color of the labels} - \item{labelcex}{The character expansion factor for the labels} - \item{sector.order}{Allows the operator to specify the order in - which the sectors are drawn.} - \item{explode}{The amount to "explode" the pie in user units} - \item{shade}{If > 0 and < 1, the proportion to reduce the - brightness of the sector color to get a better 3D effect.} - \item{mar}{Margins around the pie.} - \item{pty}{Whether to force a square plot region or not. (see Details)} - \item{...}{graphical parameters passed to \samp{plot}} -} -\value{ - The bisecting angle of the sectors in radians. -} -\details{ - \samp{pie3D} scales the values in \samp{x} so that they total 2*pi, - dropping zeros and NAs. It then displays an empty plot, calculates - the sequence for drawing the sectors and calls \samp{draw.tilted.sector} - to draw each sector. If labels are supplied, it will call \samp{pie3D.label} - to place these outside each sector. If supplied, the number of labels, label - positions and sector colors must be at least equal to the number of values - in \samp{x}. If the labels are long, it may help to reduce the radius of - the pie or change the position as in the example below. - - In order to make the dimensions of the pie reasonably accurate, a square plot - region (\samp{pty="s"}) is the default. If \samp{pty} is set to "m", the user - can change the margins, usually resulting in a non-square plot area. This will - probably distort the pie somewhat. -} -\note{ - Due to the somewhat primitive method used to draw sectors, a sector that - extends beyond both pi/2 and 3*pi/2 radians in either direction may not - display properly. Setting \samp{start} to pi/2 will often fix this, but - the user may have to adjust \samp{start} and the order of sectors in extreme - cases. The argument \samp{sector.order} allows the user to specify a vector - of integers that will override the calculation of the order in which the - sectors are drawn. This is usually necessary when a very large sector that - extends past 3*pi/2 is overlapped by a smaller sector next to it. As a last - resort, the user can try setting \samp{explode} to zero. This only draws - the top and outer sides of each sector. - - Also due to the sector drawing method, setting \samp{theta} to values smaller - than about pi/8 or larger than about pi/4 will produce obviously misaligned - sectors. - - Contributed fixes and improvements: - thanks to Jesse Brown for the "shade" fix and Qinghua Zhao for alerting me to - the problem with labels and margins -} -\author{Jim Lemon} -\seealso{\link{pie3D.labels}, \link{draw.tilted.sector}} -\examples{ - pieval<-c(2,4,6,8) - pielabels<- - c("We hate\n pies","We oppose\n pies","We don't\n care","We just love pies") - # grab the radial positions of the labels - lp<-pie3D(pieval,radius=0.9,labels=pielabels,explode=0.1,main="3D PIE OPINIONS") - # lengthen the last label and move it to the left - pielabels[4]<-"We cannot survive without our pies" - lp[4]<-4.8 - # specify some new colors - pie3D(pieval,radius=0.9,labels=pielabels,explode=0.1,main="3D PIE OPINIONS", - col=c("brown","#ddaa00","pink","#dd00dd"),labelpos=lp) -} -\keyword{misc} diff --git a/man/pie3D.labels.Rd b/man/pie3D.labels.Rd deleted file mode 100644 index 904d334..0000000 --- a/man/pie3D.labels.Rd +++ /dev/null @@ -1,46 +0,0 @@ -\name{pie3D.labels} -\alias{pie3D.labels} -\title{Display labels on a 3D pie chart} -\description{ - Displays labels on a 3D pie chart. -} -\usage{ - pie3D.labels(radialpos,radius=1,height=0.1,theta=pi/6, - labels,labelcol=par("fg"),labelcex=1.5,labelrad=1.25,minsep=0.3) -} -\arguments{ - \item{radialpos}{Position of the label in radians} - \item{radius}{the radius of the pie in user units} - \item{height}{the height of the pie in user units} - \item{theta}{The angle of viewing in radians} - \item{labels}{The label to display} - \item{labelcol}{The color of the labels} - \item{labelcex}{The character expansion factor for the labels} - \item{labelrad}{The expansion for the labels around the pie.} - \item{minsep}{The minimum angular separation between label positions.} -} -\value{ - nil -} -\details{ - \samp{pie3D.label} displays labels on a 3D pie chart. The positions - of the labels are given as angles in radians (usually the bisector of the - pie sectors). As the labels can be passed directly to \link{pie3D}, - this function would probably not be called by the user. - - \samp{pie3D.labels} tries to separate labels that are placed closer than - \samp{minsep} radians. This simple system will handle minor crowding of - labels. If labels are very crowded, capturing the return value of - \samp{pie3D} and editing the label positions may allow the user to avoid - manually placing labels. -} -\author{Jim Lemon} -\seealso{\link{pie3D}, \link{draw.tilted.sector}} -\examples{ - pieval<-c(2,4,6,8) - bisectors<-pie3D(pieval,explode=0.1,main="3D PIE OPINIONS") - pielabels<- - c("We hate\n pies","We oppose\n pies","We don't\n care","We just love pies") - pie3D.labels(bisectors,labels=pielabels) -} -\keyword{misc} diff --git a/man/placeLabels.Rd b/man/placeLabels.Rd deleted file mode 100644 index 8e230c7..0000000 --- a/man/placeLabels.Rd +++ /dev/null @@ -1,54 +0,0 @@ -\name{placeLabels} -\alias{placeLabels} -\title{ Place labels in boxes } -\description{ - Places labels in boxes on an existing plot -} -\usage{ - placeLabels(x,y=NA,labels,pointer=TRUE,cex=1,labelcol=par("fg"), - labelbg="white",border=par("fg"),pointercol=par("fg"), - pch=1,col=1,bg="white",flagcol="red") -} -\arguments{ - \item{x,y}{x and y position of the centers of the labels. \samp{x} can be an - \link{xy.coords} list.} - \item{labels}{Text strings} - \item{pointer}{Whether to draw a line segment from the label to the - points labeled.} - \item{cex}{Character expansion. See \samp{text}.} - \item{labelcol}{The color(s) of the text in the labels.} - \item{labelbg}{The background color(s) for the labels.} - \item{border}{The color(s) for the borders around the rectangles.} - \item{pointercol}{The color(s) of the pointer lines.} - \item{pch}{The symbol(s) to use when redisplaying the original points - (see Details).} - \item{col}{The color(s) of the original points.} - \item{bg}{The background color(s) of the original points.} - \item{flagcol}{The color to use for "flagging" each point.} -} -\details{ - \samp{placeLabels} steps through the points indexed by \samp{x} and - \samp{y}, allowing the operator to manually place the labels for each - point. Each point is "flagged" by displaying a small colored circle (red - by default). When the label for that point has been placed, the original - symbol is displayed and the next point is flagged. - - Each point and label can have different colors and backgrounds. -} -\note{ - This function is handy for one-off plots with a moderate number of - points. It can be very useful for plots with clumps of points. -} -\value{nil - adds labels to an existing plot.} -\author{Jim Lemon - thanks to Marna Wagley for the idea.} -\seealso{\link{spread.labels}, \link{thigmophobe.labels}} -\examples{ - # won't check because of the call to locator - \dontrun{ - x<-rnorm(10) - y<-rnorm(10) - plot(x,y) - placeLabels(x,y,LETTERS[1:10],flagcol="purple") - } -} -\keyword{misc} diff --git a/man/plotCI.Rd b/man/plotCI.Rd deleted file mode 100644 index 8d75ff6..0000000 --- a/man/plotCI.Rd +++ /dev/null @@ -1,77 +0,0 @@ -\name{plotCI} -\alias{plotCI} -\title{Plot confidence intervals/error bars} -\description{ - Given a set of x and y values and upper and lower bounds, - this function plots the points with error bars. -} -\usage{ - plotCI(x,y=NULL,uiw,liw=uiw,ui=NULL,li=NULL,err="y", - sfrac=0.01,gap=0,slty=par("lty"),add=FALSE,scol=NULL,pt.bg=par("bg"),...) -} -\arguments{ - \item{x}{The x coordinates of points in the plot} - \item{y}{The y coordinates of points in the plot} - \item{uiw}{The width of the upper portion of the confidence region, - or (if \samp{liw} is missing) the width of both halves of - the confidence region} - \item{liw}{The width of the lower portion of the confidence region (if - missing, the function assumes symmetric confidence bounds)} - \item{ui}{The absolute upper limit of the confidence region} - \item{li}{The absolute lower limit of the confidence region} - \item{err}{The direction of error bars: "x" for horizontal, "y" - for vertical ("xy" would be nice but is not implemented yet; don't - know quite how everything would be specified. See examples for - composing a plot with simultaneous horizontal and vertical error bars)} - \item{gap}{Size of gap in error bars around points - (default 0;gap=TRUE gives gap size of 0.01)} - \item{sfrac}{Scaling factor for the size of the "serifs" (end bars) on - the confidence bars, in x-axis units} - \item{add}{If FALSE (default), create a new plot; if TRUE, add error - bars to an existing plot.} - \item{slty}{Line type of error bars} - \item{scol}{Color of error bars: if \samp{col} is specified in the - optional arguments, \samp{scol} is set the same; otherwise it's set - to \samp{par(col)}} - \item{pt.bg}{Background color of points (use pch=21, pt.bg=par("bg") - to get open points superimposed on error bars)} - \item{\dots}{Any other parameters to be passed through to - \link{plot.default}, \link{points}, - \link{arrows}, etc. (e.g. \samp{lwd}, \samp{col}, \samp{pch}, - \samp{axes}, \samp{xlim}, \samp{ylim}). \samp{xlim} and - \samp{ylim} are set by default to include all of the data points and - error bars. \samp{xlab} and \samp{ylab} are set to the names of - \samp{x} and \samp{y}. If \samp{pch==NA}, no points are drawn - (e.g. leaving room for text labels instead)} -} -\value{ - invisible(x,y); creates a plot on the current device. -} -\author{Ben Bolker (documentation and tweaking of a function provided by - Bill Venables, additional feature ideas from Gregory Warnes)} -\seealso{\link{boxplot}} -\examples{ - y<-runif(10) - err<-runif(10) - plotCI(1:10,y,err,main="Basic plotCI") - plotCI(1:10,y,err,2*err,lwd=2,col="red",scol="blue", - main="Add colors to the points and error bars") - err.x<-runif(10) - err.y<-runif(10) - plotCI(1:10,y,err.y,pt.bg=par("bg"),pch=21,xlim=c(0,11), - main="plotCI with extra space on the x axis") - plotCI(1:10,y,err.x,pt.bg=par("bg"),pch=21,err="x",add=TRUE) - mtext("for adding horizontal error bars",3,0.5) - data(warpbreaks) - attach(warpbreaks) - wmeans<-by(breaks,tension,mean) - wsd<-by(breaks,tension,sd) - ## note that barplot() returns the midpoints of the bars, which plotCI - ## uses as x-coordinates - plotCI(barplot(wmeans,col="gray",ylim=c(0,max(wmeans+wsd))),wmeans,wsd,add=TRUE) - ## using labels instead of points - labs<-sample(LETTERS,replace=TRUE,size=10) - plotCI(1:10,y,err,pch=NA,gap=0.02,main="plotCI with labels at points") - text(1:10,y,labs) -} -\keyword{hplot} diff --git a/man/plotH.Rd b/man/plotH.Rd deleted file mode 100644 index 3586860..0000000 --- a/man/plotH.Rd +++ /dev/null @@ -1,71 +0,0 @@ -\name{plotH} -\alias{plotH} -\alias{plotH.formula} -\alias{plotH.default} -\title{Scatterplot with histogram-like bars.} -\description{ - Scatterplot with histogram-like bars; a modification of - \samp{plot(...,type="h")}. -} -\usage{ - plotH(x,...) - - \method{plotH}{formula}(x,data=NULL,xlab=names(mf)[2],ylab=names(mf)[1],...) - - \method{plotH}{default}(x,y,xlab=paste(deparse(substitute(x))), - ylab=paste(deparse(substitute(y))),width=0.6,ylim=NULL,col="gray",...) -} -\arguments{ - \item{x}{Vector of x-coordinates or a formula of the form y~x - (see below for y).} - \item{y}{Vector of y-coordinates.} - \item{xlab}{A string for labeling the x-axis.} - \item{ylab}{A string for labeling the y-axis.} - \item{data}{The data frame from which the formula should be evaluated.} - \item{width}{A numeric that indicates the width of the bars.} - \item{ylim}{A vector of length two that indicates the limits over which to - plot the y-axis. See details.} - \item{col}{A string that indicates the fill color for the bars.} - \item{...}{Additional arguments sent to the \samp{plot} or \samp{barplot} - functions.} -} -\details{ - \samp{plotH} is meant to be a modification of the type="h" version of - \samp{plot} such that the "bars" appears as actual rectangles rather than - vertical lines. It defaults so that the lower bound of the y-axis is 0; - change to \samp{ylim=NULL} to over-ride this default (and return to the - default used in \samp{plot}. - - A pass-through to \samp{barplot} is used if the \samp{x} (or "RHS") variable - is categorical. -} -\value{None, but a plot is produced.} -\note{This function is currently experimental.} -\author{Derek Ogle} -\seealso{\link{plot}, \link{barplot}} -\examples{ - d<-data.frame(x=c(1,5,10:20),y=runif(13)+1, - yn1=runif(13)-0.5,yn2=runif(13)-2, - g=factor(sample(c("A","B","C"),13,replace=TRUE))) - # new plotH function with formula notation - plotH(y~x,data=d) - # old plot() function with formula notation -- for comparison's purpose - plot(y~x,data=d,type="h") - # new function over-riding default ylim, increasing bar width, - # and changing bar color - plotH(y~x,data=d,ylim=range(d$y),width=0.9,col="red") - # handling some negative values - plotH(yn1~x,data=d) # not so good, because of default ylim - plotH(yn1~x,data=d,ylim=c(0,max(d$yn1))) # old look - # handling all negative values - plotH(yn2~x,data=d) - plotH(yn2~x,data=d,ylim=range(d$yn2)) # old look - # example of pass-through to barplot - smry<-by(d$y,d$g,mean) - plotH(levels(d$g),smry,ylab="Mean of Random Variable",xlab="Group") - # example of non-formula usage - x1 <- d$x - y1 <- d$y - plotH(x1,y1,col="blue") -} -\keyword{misc} diff --git a/man/plot_bg.Rd b/man/plot_bg.Rd deleted file mode 100644 index aaf894b..0000000 --- a/man/plot_bg.Rd +++ /dev/null @@ -1,18 +0,0 @@ -\name{plot_bg} -\alias{plot_bg} -\title{ Add a background color to a plot } -\description{Displays a colored rectangle over the entire area of a plot} -\usage{plot_bg(col="lightgray")} -\arguments{ - \item{col}{The color of the background} -} -\details{ - \samp{plot_bg} is probably only useful when part of the \samp{do.first} - argument in another plot function to add a background color to the plot. -} -\value{nil} -\author{Jim Lemon} -\examples{ - barp(1:5,do.first="plot_bg()",col=1:5) -} -\keyword{misc} diff --git a/man/plotrix-package.Rd b/man/plotrix-package.Rd deleted file mode 100755 index e678d06..0000000 --- a/man/plotrix-package.Rd +++ /dev/null @@ -1,64 +0,0 @@ -\name{plotrix-package} -\alias{plotrix-package} -\alias{plotrix} -\docType{package} -\title{ -Specialized plots and plotting accessories -} -\description{ -A large number of specialized plots and accessory functions like color -scaling, text placement and legends. -} -\details{ -%% \tabular{ll}{ -%% Package: \tab plotrix\cr -%% Version: \tab 3.8-1\cr -%% Date: \tab 2021-09-08\cr -%% License: \tab GPL (>=2)\cr -%% Packaged: \tab 2021-09-08 03:45:00 UTC; root\cr -%% Built: \tab R 4.0.3; ; 2021-09-08 03:45:00 UTC; linux\cr -%% } - The plotrix package is intended to provide a method for getting many sorts of - specialized plots quickly, yet allow easy customization of those plots - without learning a great deal of specialized syntax. There are three major - aims that can be represented as follows: - -Fast foods - -Think of plotrix as a graphics vending machine or fast graphics cafe. You walk - in, make your choice and get your lunch. It may not be exactly the lunch you - want, but you do get a pretty good lunch, fast. You can get junk food or - health food, you make the choice. - -Hot rods - -You can customize plotrix as much as you want. Like the ageing machinery that - is usually bolted into hot rods, the base graphics package is fairly easy to - understand. plotrix is modular. You can create a frame for your plot, then - you can add whatever bits you like to it instead of just taking the default - plot that is available. You can have wide wheels and chromed exhaust pipes if - you want. - -No black boxes - -If you want to go from pushing the fast food button to hot rodding, it's not - hard. The source code in the functions is written to be understood. If - something goes wrong, you can usually find where it happened right away and - work on it. This means that you can learn about how the functions do what - they do rather than just what they do. So that's how to write recursive - functions in R! - -Because plotrix encourages users to learn how it works, you usually begin to - do so pretty quickly. Users often decide to write their own versions of - plotrix functions and sometimes they contribute the results back into plotrix. - You may find that you like other graphics systems like grid or lattice better. - That's great, because one idea behind plotrix is that if you get into R and - can get things done quickly and easily, you'll stick with it and soon want to - get things done your way. -} -\author{ -Jim Lemon , and many others - -Maintainer: Jim Lemon -} -\keyword{ package } diff --git a/man/polar.plot.Rd b/man/polar.plot.Rd deleted file mode 100755 index 0b0f8de..0000000 --- a/man/polar.plot.Rd +++ /dev/null @@ -1,51 +0,0 @@ -\name{polar.plot} -\title{Plot values on a circular grid of 0 to 360 degrees} -\usage{ - polar.plot(lengths,polar.pos=NULL,labels,label.pos=NULL, - start=0,clockwise=FALSE,rp.type="r",loglen=FALSE,explab=FALSE,...) -} -\alias{polar.plot} -\arguments{ - \item{lengths}{numeric data vector. Magnitudes will be represented as - the radial positions of symbols, line ends or polygon vertices.} - \item{polar.pos}{numeric vector of positions on a 0:360 degree circle. - These will be converted to radians when passed to \samp{radial.plot}.} - \item{labels}{text labels to place on the periphery of the circle. This - defaults to labels every 20 degrees. For no labels, pass an empty string.} - \item{label.pos}{positions of the peripheral labels in degrees} - \item{start}{The position for zero degrees on the plot in degrees.} - \item{clockwise}{Whether to increase angles clockwise rather than the - default counterclockwise.} - \item{rp.type}{Whether to plot radial lines, symbols or a polygon.} - \item{loglen}{Whether to log transform the \samp{length} values. Only base - 10 logs are available.} - \item{explab}{Whether to use the default fixed (FALSE) or exponential (TRUE) - notation for the radial labels.} - \item{...}{additional arguments passed to \samp{radial.plot} and - then to \samp{plot}.} -} -\description{ - \samp{polar.plot} displays a plot of radial lines, symbols or a polygon - centered at the midpoint of the plot frame on a 0:360 circle. - Positions are interpreted as beginning at the right and moving - counterclockwise unless \samp{start} specifies another starting point or - \samp{clockwise} is TRUE. - - If \samp{add=TRUE} is passed as one of the additional arguments, the values - will be added to the current plot. If a \samp{radial.lim} argument was - passed on the initial plot, it must be passed again to add values or the - values will be displayed incorrectly. -} -\value{A list of the parameters altered by \link{radial.plot}.} -\author{Jim Lemon} -\keyword{misc} -\seealso{\link{radial.plot}} -\examples{ - testlen<-c(rnorm(36)*2+5) - testpos<-seq(0,350,by=10) - polar.plot(testlen,testpos,main="Test Polar Plot",lwd=3,line.col=4) - oldpar<-polar.plot(testlen,testpos,main="Test Clockwise Polar Plot", - radial.lim=c(0,15),start=90,clockwise=TRUE,lwd=3,line.col=4) - # reset everything - par(oldpar) -} diff --git a/man/polygon.shadow.Rd b/man/polygon.shadow.Rd deleted file mode 100644 index 5dc1c4e..0000000 --- a/man/polygon.shadow.Rd +++ /dev/null @@ -1,55 +0,0 @@ -\name{polygon.shadow} -\alias{polygon.shadow} -\title{Display a shadow effect for an arbitrary polygon} -\description{ - Displays a shadow effect on an existing plot -} -\usage{ - polygon.shadow(x,y=NULL,offset=NA,inflate=NA,col=c("#ffffff","#cccccc")) -} -\arguments{ - \item{x,y}{x and y coordinate of the vertices of the polygon. \samp{y} - can be missing if \samp{x} is a list with \samp{x} and \samp{y} components.} - \item{offset}{a vector containing the values of the x and y offsets for the - shadow. Defaults to 1/20 of the maximum x and y dimensions of the polygon.} - \item{col}{the colors of the shadow from the outer edge to the central part.} - \item{inflate}{the amount to "inflate" the shadow relative to the polygon - (i.e. the penumbra). Defaults to the values in \samp{offset}.} -} -\value{nil} -\details{ - \samp{polygon.shadow} is typically called just before drawing a polygon. - It displays a shadow effect by drawing the polygon ten times, beginning - with the first color in \samp{col} and stepping through to the second - color to create a "shadow" (or a "halo" if you prefer). Each successive - polygon is shrunk by 10\% of \samp{inflate}. The default shadow effect has - the light at the upper left. This effect may also be used as a text - background. -} -\note{ - The background must be a constant color or the shadow effect will not - look right. A good starting point for the two colors is the color of the - background and the RGB components of that color multiplied by 0.8. Use a - smaller multiplier for a darker shadow. -} -\author{Jim Lemon} -\seealso{\link{polygon}} -\examples{ - par(pty="s") - plot(1:5,type="n",main="Polygon Shadow test",xlab="",ylab="",axes=FALSE) - box() - # do a shadow on a yellow square - polygon(c(1,2.2,2.2,1),c(5,5,3.8,3.8),col="#ffff00") - polygon.shadow(c(1.2,2,2,1.2),c(4.8,4.8,4,4),col=c("#ffff00","#cccc00")) - polygon(c(1.2,2,2,1.2),c(4.8,4.8,4,4),col=c("#ff0000")) - # a green triangle on a light blue square with a big offset - polygon(c(4,5,5,4),c(2,2,1,1),col="#aaaaff") - polygon.shadow(c(4.5,4.8,4.2),c(1.7,1.2,1.2),col=c("#aaaaff","#8888cc"), - offset=c(0.1,-0.1),inflate=c(0.2,0.2)) - polygon(c(4.5,4.8,4.2),c(1.7,1.2,1.2),col=c("#00ff00")) - # now a circle as a background - polygon.shadow(cos(seq(0,2*pi,by=pi/20))+3,sin(seq(0,2*pi,by=pi/20))+3, - offset=c(0,0),inflate=c(0.1,0.1)) - text(3,3,"Polygon shadow\nas a circular\ntext background",cex=1.5) -} -\keyword{misc} diff --git a/man/print.brklist.Rd b/man/print.brklist.Rd deleted file mode 100644 index 3ba2ae6..0000000 --- a/man/print.brklist.Rd +++ /dev/null @@ -1,29 +0,0 @@ -\name{print.brklist} -\alias{print.brklist} -\title{Display the output of brkdnNest} -\description{ - Displays the list of values produced by \samp{brkdnNest}. -} -\usage{ - \method{print}{brklist}(x,...) -} -\arguments{ - \item{x}{a list of summary values produced by \samp{\link{brkdnNest}}} - \item{...}{additional arguments passed to \samp{print}.} -} -\details{ - \samp{print.brklist} displays frequency tables produced by \samp{brkdnNest}. - It is mainly for convenience, but does make a nicer display than when passed - directly to \samp{print} -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{brkdnNest}} -\examples{ - printbrktest<-data.frame(A=c(sample(1:10,99,TRUE),NA), - B=sample(c("Yes","No"),100,TRUE), - C=sample(LETTERS[1:3],100,TRUE)) - pbt<-brkdnNest(A~B+C,printbrktest) - print(pbt) -} -\keyword{misc} diff --git a/man/propbrk.Rd b/man/propbrk.Rd deleted file mode 100644 index 55b9825..0000000 --- a/man/propbrk.Rd +++ /dev/null @@ -1,29 +0,0 @@ -\name{propbrk} -\alias{propbrk} -\title{Calculate the proportion of specified values in a vector} -\description{ - Calculates the proportion of values in a vector that are equal to a specified - value. -} -\usage{ - propbrk(x,trueval=TRUE,na.rm=TRUE) -} -\arguments{ - \item{x}{a character, factor or numeric vector.} - \item{trueval}{the value to be matched in \samp{x}.} - \item{na.rm}{whether to remove NA values.} -} -\details{ - \samp{propbrk} calculates the proportion of values matching a specified value. - It is mainly to allow proportions to be calculated in the \samp{brkdnNest} - function. It always discards NAs in \samp{x} when summing the number equal to - \samp{trueval}, but respects the \samp{na.rm} argument when calculating the - total number of values in \samp{x}. -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{brkdnNest}} -\examples{ - propbrk(sample(LETTERS,100,TRUE),trueval="M") -} -\keyword{misc} diff --git a/man/psegments3d.Rd b/man/psegments3d.Rd deleted file mode 100644 index a215b55..0000000 --- a/man/psegments3d.Rd +++ /dev/null @@ -1,21 +0,0 @@ -\name{psegments3d} -\alias{psegments3d} -\title{ Draw segments on a 3D plot } -\description{ - Draw segments on a 3D plot defined by a list of coordinates -} -\usage{ - psegments3d(x,y=NULL,z=NULL,pmat,...) -} -\arguments{ - \item{x,y,z}{ x, y and z coordinates to plot. \samp{x} may be a list with - three components.} - \item{pmat}{ matrix to transform coordinates. } - \item{...}{ Other arguments passed to \samp{segments}. } -} -\details{ - Draws segments on a perspective plot. -} -\value{nil} -\author{Ben Bolker} -\keyword{misc} diff --git a/man/ptext3d.Rd b/man/ptext3d.Rd deleted file mode 100644 index 53d372e..0000000 --- a/man/ptext3d.Rd +++ /dev/null @@ -1,22 +0,0 @@ -\name{ptext3d} -\alias{ptext3d} -\title{ Display text on a 3D plot } -\description{ - Display text on a 3D plot defined by a list of coordinates -} -\usage{ - ptext3d(x,y=NULL,z=NULL,texts,pmat,...) -} -\arguments{ - \item{x,y,z}{ x, y and z coordinates to plot. \samp{x} may be a list with - three components.} - \item{pmat}{ matrix to transform coordinates. } - \item{texts}{ text to display. } - \item{...}{ Other arguments passed to \samp{segments}. } -} -\details{ - Draws text on a perspective plot. -} -\value{nil} -\author{Ben Bolker} -\keyword{misc} diff --git a/man/pyramid.plot.Rd b/man/pyramid.plot.Rd deleted file mode 100755 index 578e71a..0000000 --- a/man/pyramid.plot.Rd +++ /dev/null @@ -1,124 +0,0 @@ -\name{pyramid.plot} -\alias{pyramid.plot} -\title{Pyramid plot} -\description{ - Displays a pyramid (opposed horizontal bar) plot on the current - graphics device. -} -\usage{ - pyramid.plot(lx,rx,labels=NULL,top.labels=c("Male","Age","Female"), - main="",laxlab=NULL,raxlab=NULL,unit="\%",lxcol,rxcol,gap=1,space=0.2, - ppmar=c(4,2,4,2),labelcex=1,add=FALSE,xlim,show.values=FALSE,ndig=1, - do.first=NULL) -} -\arguments{ - \item{lx,rx}{Vectors or a matrix or data frame (see Details) which - should be of equal length.} - \item{labels}{Labels for the categories represented by each pair of - bars. There should be a label for each lx or rx value, even if empty. - If \samp{labels} is a matrix or data frame, the first two columns will - be used for the left and right category labels respectively.} - \item{top.labels}{The two categories represented on the left and right - sides of the plot and a heading for the labels in the center.} - \item{main}{Optional title for the plot.} - \item{laxlab}{Optional labels for the left x axis ticks.} - \item{raxlab}{Optional labels for the right x axis ticks.} - \item{unit}{The label for the units of the plot.} - \item{lxcol,rxcol}{Color(s) for the left and right sets of bars. Both of - these default to \samp{rainbow(length(labels))}.} - \item{gap}{One half of the space between the two sets of bars for the - \samp{labels} in user units.} - \item{space}{Space between the bars. Should be 0 <= space < 1.} - \item{ppmar}{Margins for the plot (see Details).} - \item{labelcex}{Expansion for the category labels.} - \item{add}{Whether to add bars to an existing plot. Usually this - involves overplotting a second set of bars, perhaps transparent.} - \item{xlim}{Optional x limit for the plot (see Details).} - \item{show.values}{Whether to display \samp{lx} and \samp{rx} at the - ends of the bars.} - \item{ndig}{The number of digits to round the values if displayed.} - \item{do.first}{Optional expression to evaluate before displaying anything.} -} -\details{ - \samp{pyramid.plot} is principally intended for population pyramids, - although it can display other types of opposed bar charts with suitable - modification of the arguments. If the user wants a different unit for - the display, just change \samp{unit} accordingly. The default gap of - two units is usually satisfactory for the four to six percent range - of most bars on population pyramids. If \samp{labels} is a matrix or - data frame of at least two columns, the first column will be displayed - on the on the left side of the gap in the center, and the second on the - right. This will almost always require increasing the gap width and - perhaps also specifying a wider plotting device. Displaying the values - will usually require increasing the left and/or right margins of the - plot, or setting \samp{xlim} larger than the largest value. - - If a gap width of zero is passed, the category labels will be displayed - at the left and right extents of the plot. This usually requires setting - \samp{xlim} to values larger than the maximum extent of \samp{lx} and - \samp{rx}. The user can pass two different values to \samp{xlim}, but - this is almost always a bad idea, as the lengths of the bars will not - be in the same proportion to the values on the left and right sides. - Both the bars and category labels are vertically centered on integer - values, allowing the user to easily add components to the plot. - - \samp{lx} and \samp{rx} are the values specifying the left and right - extents of the left and right bars respectively. If both are matrices - or data frames, \samp{pyramid.plot} will produce opposed stacked bars - with the first columns innermost. In this mode, colors are limited to - one per column. The stacked bar mode will in general not work with the - \samp{add} method or with a gap of zero. Note that the stacked bar - mode can get very messy very quickly. - - The \samp{add} argument allows one or more sets of bars to be plotted - on an existing plot. If these are not transparent, any bar that is - shorter than the bar that overplots it will disappear. Only some graphic - devices (e.g. \samp{pdf}) will handle transparency. - - In order to add bars, the function cannot restore the initial margin values - or the new bars will not plot properly. To automatically restore the plot - margins, call the function as in the example. -} -\value{ - The return value of \samp{par("mar")} when the function was called. -} -\author{Jim Lemon (thanks to Susumu Tanimura for the patch that omits - ticks for NA values in vector input and Igor Rebeiro for the space - argument)} -\seealso{\link{rect}} -\examples{ - xy.pop<-c(3.2,3.5,3.6,3.6,3.5,3.5,3.9,3.7,3.9,3.5,3.2,2.8,2.2,1.8, - 1.5,1.3,0.7,0.4) - xx.pop<-c(3.2,3.4,3.5,3.5,3.5,3.7,4,3.8,3.9,3.6,3.2,2.5,2,1.7,1.5, - 1.3,1,0.8) - agelabels<-c("0-4","5-9","10-14","15-19","20-24","25-29","30-34", - "35-39","40-44","45-49","50-54","55-59","60-64","65-69","70-74", - "75-79","80-44","85+") - mcol<-color.gradient(c(0,0,0.5,1),c(0,0,0.5,1),c(1,1,0.5,1),18) - fcol<-color.gradient(c(1,1,0.5,1),c(0.5,0.5,0.5,1),c(0.5,0.5,0.5,1),18) - par(mar=pyramid.plot(xy.pop,xx.pop,labels=agelabels, - main="Australian population pyramid 2002",lxcol=mcol,rxcol=fcol, - gap=0.5,show.values=TRUE)) - # three column matrices - avtemp<-c(seq(11,2,by=-1),rep(2:6,each=2),seq(11,2,by=-1)) - malecook<-matrix(avtemp+sample(-2:2,30,TRUE),ncol=3) - femalecook<-matrix(avtemp+sample(-2:2,30,TRUE),ncol=3) - # group by age - agegrps<-c("0-10","11-20","21-30","31-40","41-50","51-60", - "61-70","71-80","81-90","91+") - oldmar<-pyramid.plot(malecook,femalecook,labels=agegrps, - unit="Bowls per month",lxcol=c("#ff0000","#eeee88","#0000ff"), - rxcol=c("#ff0000","#eeee88","#0000ff"),laxlab=c(0,10,20,30), - raxlab=c(0,10,20,30),top.labels=c("Males","Age","Females"),gap=4, - do.first="plot_bg(\"#eedd55\")") - # put a box around it - box() - # give it a title - mtext("Porridge temperature by age and sex of bear",3,2,cex=1.5) - # stick in a legend - legend(par("usr")[1],11,c("Too hot","Just right","Too cold"), - fill=c("#ff0000","#eeee88","#0000ff")) - # don't forget to restore the margins and background - par(mar=oldmar,bg="transparent") -} -\keyword{misc} diff --git a/man/radial.grid.Rd b/man/radial.grid.Rd deleted file mode 100755 index 73d1f45..0000000 --- a/man/radial.grid.Rd +++ /dev/null @@ -1,33 +0,0 @@ -\name{radial.grid} -\alias{radial.grid} -\title{Display a radial grid} -\usage{ - radial.grid(labels=NA,label.pos=NULL,radlab=FALSE,radial.lim=NULL, - start=0,clockwise=FALSE,label.prop=1.1,grid.pos=seq(0.25,1,0.25), - rad.col="gray",grid.col="gray",grid.bg="transparent",show.radial.grid=TRUE, - start.plot=FALSE) -} -\arguments{ - \item{labels}{The labels to display around the circumference of the grid.} - \item{label.pos}{Radial positions for the labels.} - \item{radlab}{Whether to rotate the labels to a radial orientation.} - \item{radial.lim}{Optional radial limits for the circular plot. If specified, - these must be the same as the radial limits of the original plot.} - \item{start}{The zero position on the plot in the units of \samp{label.pos}.} - \item{clockwise}{Whether to increase angles clockwise rather than the - default counterclockwise.} - \item{label.prop}{Proportion of \samp{radial.lim} to place the labels.} - \item{grid.pos}{Radial positions for the circular grid lines.} - \item{rad.col}{Color for the radial grid lines.} - \item{grid.col}{Color for the circumferential grid lines.} - \item{grid.bg}{Background color for the radial grid.} - \item{show.radial.grid}{Whether to display the radial lines on the grid.} - \item{start.plot}{If TRUE, sets up a blank radial grid.} -} -\description{ - \samp{radial.grid} displays a radial grid for the \samp{radial.plot} and - \samp{radial.pie} functions. -} -\value{nil} -\author{Jim Lemon} -\keyword{misc} diff --git a/man/radial.pie.Rd b/man/radial.pie.Rd deleted file mode 100644 index 25cfd2d..0000000 --- a/man/radial.pie.Rd +++ /dev/null @@ -1,103 +0,0 @@ -\name{radial.pie} -\alias{radial.pie} -\title{ - Plot sectors/annuli on a circular grid of 0 to 2*pi radians -} -\description{ - Plot numeric values as sectors with optional annuli on a circular field in the - directions defined by angles in radians. -} -\usage{ - radial.pie(radial.extents,sector.edges=NULL, - sector.colors=NULL,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1), - alpha=1,labels=NA,label.pos=NULL,radlab=FALSE,start=0, - clockwise=FALSE,label.prop=1.1,radial.lim=NULL,main="",xlab="",ylab="", - mar=c(2,2,3,2),show.grid=TRUE,show.grid.labels=4,show.radial.grid=TRUE, - grid.col="gray",grid.bg="transparent",grid.unit=NULL, - radial.labels=NULL,boxed.radial=TRUE,add=FALSE,...) -} -\arguments{ - \item{radial.extents}{A numeric data vector or list. If \samp{radial.extents} - is a list, the elements of the list will be considered separate data vectors.} - \item{sector.edges}{A numeric vector of positions in radians. - These are interpreted as beginning at the right (0 radians) and moving - counterclockwise unless \samp{clockwise} is TRUE.} - \item{sector.colors}{Optional colors for the sectors and annuli. Defaults to - \samp{rainbow(nsectors)} with fading outward if annuli are specified.} - \item{cs1, cs2, cs3, alpha}{Color scaling arguments - see \link{color.scale}.} - \item{labels}{Character strings to be placed at the outer ends of - the lines. If set to NA, will suppress printing of labels, - but if missing, the radial positions will be used.} - \item{label.pos}{The positions of the labels around the plot in radians.} - \item{radlab}{Whether to rotate the outer labels to a radial orientation.} - \item{start}{Where to place the starting (zero) point. Defaults to the - 3 o'clock position.} - \item{clockwise}{Whether to interpret positive positions as clockwise from - the starting point. The default is counterclockwise.} - \item{label.prop}{The label position radius as a proportion of the - maximum line length.} - \item{radial.lim}{The inner and outer radial limits for the plot. Defaults - to the range of radial.extents, although zero to \samp{max(radial.extents)} - is often what is wanted.} - \item{main}{The title for the plot.} - \item{xlab,ylab}{Normally x and y axis labels are suppressed.} - \item{mar}{Margins for the plot. Allows the user to leave space for - legends, long labels, etc.} - \item{show.grid}{Logical - whether to draw a circular grid.} - \item{show.grid.labels}{Whether and where to display labels for the grid - - see Details.} - \item{show.radial.grid}{Whether to draw radial lines to the plot labels.} - \item{grid.col}{Color of the circular grid.} - \item{grid.bg}{Fill color of above.} - \item{grid.unit}{Optional unit description for the grid.} - \item{radial.labels}{Optional labels for the radial grid. The default is - the values of radial.lim.} - \item{boxed.radial}{Whether to use boxed.labels or text for radial labels.} - \item{add}{Whether to add one or more series to an existing plot.} - \item{...}{Additional arguments are passed to \samp{plot}.} -} -\value{ - The \samp{par} values that are changed in the function - as they were at the time \samp{radial.pie} was called. -} -\details{ - \samp{radial.pie} displays a plot of radial sectors with optional annular - sections centered at the midpoint of the plot frame, the lengths corresponding - to the numeric magnitudes of \samp{radial.extents}. - - If more series are added to an existing plot, - \samp{radial.pie} will try to maintain the current plot parameters. However, - it seems unlikely that adding series would be sensible in \samp{radial.pie}. - This argument may be dropped if it proves useless. - - The size of the labels on the outside of the plot can be adjusted by - setting \samp{par(cex.axis=)} and that of the labels inside by setting - \samp{par(cex.lab=)}. If \samp{radlab} is TRUE, the labels will be rotated - to a radial alignment. This may help when there are many values and labels. - If some labels are still crowded, try running \samp{label.pos} through the - \samp{spreadout} function. If the \samp{show.grid.labels} argument is a number - from 1 to 4, the labels will be placed along a horizontal or vertical radius. - The numbers represent the same positions as in \samp{axis}, with the default - (4) on the right. To suppress these labels, pass zero or FALSE. - - \samp{radial.pie} works somewhat differently from the \samp{radial.plot} - family and is still under development. I have released it in order to get - feedback to improve both the design and the programming. If successful, I - hope to merge the code with the \samp{radial.plot} function. -} -\author{Jim Lemon - thanks to Patrick Jemison for asking for it.} -\seealso{\link{radial.plot}} -\examples{ - pie1<-c(3,6,5,4,7,8,9,1,4) - pie2<-list(0:3,1:6,2:5,1:4,0:7,4:8,2:9,0:1,0:4) - pie3<-sample(10:60,36) - pie4<-list(sort(sample(1:60,8))) - for(sector in 2:36) pie4[[sector]]<-sort(sample(1:60,8)) - oldpar<-radial.pie(pie1,labels=LETTERS[1:9]) - radial.pie(pie2,labels=letters[2:10]) - radial.pie(pie3,labels=1:36) - radial.pie(pie4,labels=1:36) - # restore the par values - par(oldpar) -} -\keyword{misc} diff --git a/man/radial.plot.Rd b/man/radial.plot.Rd deleted file mode 100755 index 6770519..0000000 --- a/man/radial.plot.Rd +++ /dev/null @@ -1,199 +0,0 @@ -\name{radial.plot} -\alias{radial.plot} -\title{ - Plot values on a circular grid of 0 to 2*pi radians -} -\description{ - Plot numeric values as distances from the center of a circular field in the - directions defined by angles in radians. -} -\usage{ - radial.plot(lengths,radial.pos=NULL,labels=NA,label.pos=NULL,radlab=FALSE, - start=0,clockwise=FALSE,rp.type="r",label.prop=1.1,main="",xlab="",ylab="", - line.col=par("fg"),lty=par("lty"),lwd=par("lwd"),mar=c(2,2,3,2), - show.grid=TRUE,show.grid.labels=4,show.radial.grid=TRUE,rad.col="gray", - grid.col="gray",grid.bg="transparent",grid.left=FALSE,grid.unit=NULL, - point.symbols=1,point.col=par("fg"),show.centroid=FALSE,radial.lim=NULL, - radial.labels=NULL,boxed.radial=TRUE,poly.col=NA,add=FALSE, - loglen=FALSE,explab=FALSE,...) -} -\arguments{ - \item{lengths}{A numeric data vector or matrix. If \samp{lengths} - is a matrix, the rows will be considered separate data vectors.} - \item{radial.pos}{A numeric vector or matrix of positions in radians. - These are interpreted as beginning at the right (0 radians) and moving - counterclockwise. If \samp{radial.pos} is a matrix, the rows must - correspond to rows of \samp{lengths}.} - \item{labels}{Character strings to be placed at the outer ends of - the lines. If set to NULL, will suppress printing of labels, - but if missing, the radial positions will be used.} - \item{label.pos}{The positions of the labels around the plot in radians.} - \item{radlab}{Whether to rotate the outer labels to a radial orientation.} - \item{start}{Where to place the starting (zero) point. Defaults to the - 3 o'clock position.} - \item{clockwise}{Whether to interpret positive positions as clockwise from - the starting point. The default is counterclockwise.} - \item{rp.type}{Whether to draw (r)adial lines, a (p)olygon, (s)ymbols, (t)ext, - or some combination of these. If \samp{lengths} is a matrix and rp.type is - a vector, each row of \samp{lengths} can be displayed differently.} - \item{label.prop}{The label position radius as a proportion of the - maximum line length.} - \item{main}{The title for the plot.} - \item{xlab,ylab}{Normally x and y axis labels are suppressed.} - \item{line.col}{The color of the radial lines or polygons drawn.} - \item{lty}{The line type(s) to be used for polygons or radial lines.} - \item{lwd}{The line width(s) to be used for polygons or radial lines.} - \item{mar}{Margins for the plot. Allows the user to leave space for - legends, long labels, etc.} - \item{show.grid}{Logical - whether to draw a circular grid.} - \item{show.grid.labels}{Whether and where to display labels for the grid - - see Details.} - \item{show.radial.grid}{Whether to draw radial lines to the plot labels.} - \item{rad.col}{Color of the radial lines on the grid.} - \item{grid.col}{Color of the circumferential lines on the grid.} - \item{grid.bg}{Fill color of above.} - \item{grid.left}{Whether to place the radial grid labels on the left side.} - \item{grid.unit}{Optional unit description for the grid.} - \item{point.symbols}{The symbols for plotting (as in pch) or if - \samp{rp.type} is "t", the text that will be displayed.} - \item{point.col}{Colors for the symbols.} - \item{show.centroid}{Whether to display a centroid.} - \item{radial.lim}{The range of the grid circle. Defaults to - \samp{pretty(range(lengths))}, but if more than two values are passed, the - exact values will be displayed.} - \item{radial.labels}{Optional labels for the radial grid. The default is - the values of radial.lim, or if loglen is TRUE, the corresponding log - values.} - \item{boxed.radial}{Whether to use boxed.labels or text for radial labels.} - \item{poly.col}{Fill color if polygons are drawn. Use NA for no fill.} - \item{add}{Whether to add one or more series to an existing plot.} - \item{loglen}{Whether to log transform the \samp{length} values. Only base - 10 logs are available. Keep in mind that the values actually plotted will be - the logarithms, although the exponentiated logs are displayed.} - \item{explab}{Whether to use the default fixed (FALSE) or exponential (TRUE) - notation for the radial labels.} - \item{...}{Additional arguments are passed to \samp{plot}.} -} -\value{ - The \samp{par} values that are changed in the function - as they were at the time \samp{radial.plot} was called. -} -\details{ - \samp{radial.plot} displays a plot of radial lines, polygon(s), - symbols, text or a combination of these centered at the midpoint of - the plot frame, the lengths, vertices or positions corresponding - to the numeric magnitudes of the data values. Note that if log transformation is requested with \samp{loglen}, the values plotted will be the logs, not the values displayed on the plot. - If \samp{show.centroid} - is TRUE, an enlarged point at the centroid of values is displayed. The - centroid is calculated as the average of x and y values unless - \samp{rp.type="p"}. In this case, the barycenter of the polygon is - calculated. Make sure that these suit your purpose, otherwise calculate - the centroid that you really want and add it with the \samp{points} function. - Note that if the observations are not taken at equal intervals around the - circle, the centroid may not mean much. - - The \samp{text} option for \samp{rp.type} allows the user to place text at - each point. It is useful for adding labels at arbitrary points on an existing - plot or perhaps labelling points with letters or digits rather than different symbols. See the last example. - - If the user wants to plot several sets of lines, points or symbols by - passing matrices or data frames of \samp{lengths} and \samp{radial.pos}, - remember that these will be grouped by row, so transpose if the data are - grouped by columns. - - If more series are added to an existing plot, - \samp{radial.plot} will try to maintain the current plot parameters. - Resetting the parameters after doing the initial plot will almost certainly - mess up any series that are added. Series that are added will be plotted - "on top" of the existing plot, possibly overplotting other things. If the - added series have a larger range than the initial series, set \samp{radial.lim} - to account for this in the initial plot, and if \samp{radial.lim} is specified - in the initial plot, remember to repeat it for added series as in the example. - - The size of the labels on the outside of the plot can be adjusted by - setting \samp{par(cex.axis=)} and that of the labels inside by setting - \samp{par(cex.lab=)}. If \samp{radlab} is TRUE, the labels will be rotated - to a radial alignment. This may help when there are many values and labels. - If some labels are still crowded, try running \samp{label.pos} through the - \samp{spreadout} function. If the \samp{show.grid.labels} argument is a number - from 1 to 4, the labels will be placed along a horizontal or vertical radius. - The numbers represent the same positions as in \samp{axis}, with the default - (4) on the right. - - The radial.plot family of plots is useful for illustrating - cyclic data such as wind direction or speed (but see \samp{oz.windrose} - for both), activity at different times of the day, and so on. While - \samp{radial.plot} actually does the plotting, another function is usually - called for specific types of cyclic data. -} -\author{Jim Lemon} -\note{Thanks to - Jeremy Claisse and Antonio Hernandez Matias for the - \samp{lty} and \samp{rp.type} suggestions respectively - - Patrick Baker for the request that led to \samp{radlab} - - Thomas Steiner for the request for the \samp{radial.lim} and \samp{radial.labels} modifications - - Evan Daugharty for requesting the \samp{add} argument - - James MacCarthy for requesting better radial labels - - Steve Ellison for noticing that the return values of the functions had changed - - Don Dennerline for requesting the rank clock - - Mehdi Nellen for the different colors for the radial and circumferential lines for the grid - - Mayeul Kauffmann for noticing the radial label bug when a separate radial.grid was included - - Ogbos Okike for requesting a text option for rp.type - - Keziah Conroy for requesting the log option - -} -\seealso{\link{polar.plot},\link{clock24.plot}} -\examples{ - testlen<-runif(10,0,10) - testpos<-seq(0,18*pi/10,length=10) - testlab<-letters[1:10] - oldpar<-radial.plot(testlen,testpos,main="Test Radial Lines",line.col="red", - lwd=3,rad.col="lightblue") - testlen<-c(sin(seq(0,1.98*pi,length=100))+2+rnorm(100)/10) - testpos<-seq(0,1.98*pi,length=100) - radial.plot(testlen,testpos,rp.type="p",main="Test Polygon",line.col="blue", - labels=LETTERS[1:8],label.pos=seq(0,14*pi/8,length.out=8)) - # now do a 12 o'clock start with clockwise positive - radial.plot(testlen,testpos,start=pi/2,clockwise=TRUE,show.grid.labels=2, - rp.type="s",main="Test Symbols (clockwise)",radial.lim=c(0,3.5), - point.symbols=16,point.col="green",show.centroid=TRUE, - labels=LETTERS[1:6],label.pos=seq(0,10*pi/6,length.out=6)) - # one without the circular grid and multiple polygons - # see the "diamondplot" function for variation on this - posmat<-matrix(sample(2:9,30,TRUE),nrow=3) - radial.plot(posmat,labels=paste("X",1:10,sep=""),rp.type="p", - main="Spiderweb plot",line.col=2:4,show.grid=FALSE,lwd=1:3, - radial.lim=c(0,10)) - # dissolved ions in water - ions<-c(3.2,5,1,3.1,2.1,4.5) - ion.names<-c("Na","Ca","Mg","Cl","HCO3","SO4") - radial.plot(ions,labels=ion.names,rp.type="p",main="Dissolved ions in water", - grid.unit="meq/l",radial.lim=c(0,5),poly.col="yellow",show.grid.labels=3) - # add the names of the ions to the plot - radial.plot(ions,rp.type="t",point.symbols=ion.names,radial.lim=c(0,5), - add=TRUE) - # add points inside the polygon - radial.lim is supplied by plotrix_env - radial.plot(ions-0.4,rp.type="s",point.symbols=4,point.col="red",add=TRUE) - radmat<-matrix(c(sample(1:4,4),sample(1:4,4),sample(1:4,4),sample(1:4,4), - sample(1:4,4),sample(1:4,4),sample(1:4,4),sample(1:4,4), - sample(1:4,4),sample(1:4,4)),nrow=4) - # finally a rank clock - radial.plot(radmat,rp.type="l",radial.pos=seq(0,20*pi/11.1,length.out=10), - label.pos=seq(0,20*pi/11.1,length.out=10),start=pi/2,clockwise=TRUE, - labels=2001:2010,radial.lim=c(0.2,4),main="Rank clock") - legend(-1.7,4,c("Black","Red","Green","Blue"),col=1:4,lty=1) - par(xpd=oldpar$xpd,mar=oldpar$mar,pty=oldpar$pty) - # reset the margins - par(mar=c(5,4,4,2)) -} -\keyword{misc} diff --git a/man/radial.plot.labels.Rd b/man/radial.plot.labels.Rd deleted file mode 100755 index f1d74cd..0000000 --- a/man/radial.plot.labels.Rd +++ /dev/null @@ -1,55 +0,0 @@ -\name{radial.plot.labels} -\title{Display labels on a circular grid} -\usage{ - radial.plot.labels(lengths,radial.pos=NULL,units="radians",radial.lim=NULL, - start=0,clockwise=FALSE,labels,adj=NULL,pos=NULL,boxed.labels=FALSE,...) -} -\alias{radial.plot.labels} -\arguments{ - \item{lengths}{numeric data vector. Magnitudes will be represented as - the radial positions of symbols, line ends or polygon vertices.} - \item{radial.pos}{numeric vector of radial positions. These will be - converted to radians if the \samp{units} argument is not "radians".} - \item{units}{The units of \samp{radial.pos} may be degrees or 24 hour clock - positions. If \samp{units} is "polar" or "clock24" respectively, the - values of radial.pos will be converted into radians.} - \item{radial.lim}{Optional radial limits for the circular plot. These - must be the same as the radial limits of the original plot.} - \item{start}{The zero position on the plot in the units of \samp{radial.pos}.} - \item{clockwise}{Whether to increase angles clockwise rather than the - default counterclockwise.} - \item{labels}{text labels to display on the plot.} - \item{adj}{Text justification as in the \samp{text} function.} - \item{pos}{Text position as in the \samp{text} function.} - \item{boxed.labels}{Whether to use \samp{boxed.labels} or \samp{text}.} - \item{...}{additional arguments passed to \samp{boxed.labels} or - \samp{text}.} -} -\description{ - \samp{radial.plot.labels} displays a labels on a circular plot produced by - one of the radial.plot family of functions. -} -\details{ - Don't confuse this function with the \samp{radial.labels} argument in - the radial.plot function. This labels the values rather than the grid. -} -\value{nil} -\author{Jim Lemon} -\keyword{misc} -\seealso{\link{text}} -\examples{ - testlen<-c(rnorm(10)*2+5) - # do the labels in clock24 units - testpos<-c(6.74,8.3,10.55,12.33,13.75,15.9,17.15,19.36,21.02,23.27) - oldpar<-clock24.plot(testlen,testpos,main="Test radial.plot.labels", - rp.type="s",point.symbols=3,point.col="green") - radial.plot.labels(testlen,testpos,units="clock24",labels=LETTERS[1:10], - pos=3,col="red") - testangle<-c(25,42,67,94,128,173,191,234,268,307) - # now a polar plot - polar.plot(testlen,testangle,main="Test radial.plot.labels",rp.type="p", - poly.col="green") - radial.plot.labels(testlen,testangle,units="polar",labels=LETTERS[1:10]) - # reset par - par(oldpar) -} diff --git a/man/radialtext.Rd b/man/radialtext.Rd deleted file mode 100644 index a21287c..0000000 --- a/man/radialtext.Rd +++ /dev/null @@ -1,73 +0,0 @@ -\name{radialtext} -\alias{radialtext} -\title{Display text in a radial line} -\description{ - Displays a string in a radial line, rotating it to flow in the radial - direction and optionally scaling each letter's size according to its - distance from the center. -} -\usage{ - radialtext(x, center=c(0,0), start=NA, middle=1, end=NA, angle=0, - deg=NA, expand=0, stretch=1, nice=TRUE, cex=NA, ...) -} -\arguments{ - \item{x}{A character string.} - \item{center}{The center of the circular area in x/y user units.} - \item{start}{The starting distance of the string from the center in - x/y user units.} - \item{middle}{The middle distance of the string from the center in - x/y user units.} - \item{end}{The ending distance of the string from the center in - x/y user units.} - \item{angle}{The angular position of the string in radians.} - \item{deg}{The angular position of the string in degrees - (takes precedence if not NA).} - \item{expand}{Size expansion factor for characters, used only if - \samp{start} specified.} - \item{stretch}{How much to stretch the string for appearance, 1 for none.} - \item{nice}{TRUE to auto-flip text to keep it upright, FALSE to let - it be upside down.} - \item{cex}{The overall character expansion factor, NA for par("cex").} - \item{...}{Additional arguments passed to \samp{text}.} -} -\value{nil} -\details{ - This may not work on all devices, as not all graphic devices can rotate text to - arbitrary angles. The output looks best on a Postscript or similar device that can - rotate text without distortion. Rotated text often looks very ragged on small bitmaps. - If the user passes a value for \samp{start}, this will override a value for - \samp{middle} or \samp{end}. Likewise, a value for \samp{end} will override a - value for \samp{middle}. Also, a value for \samp{deg} overrides any value passed - to \samp{angle}. If \samp{expand} is 0, all characters will be the same size, - while a value of 1 will scale characters so that one that is twice - as far from the center will be twice as large. Negative values are permitted too, - but \samp{expand} is only used if \samp{start} was specified. -} -\author{Ted Toal} -\seealso{\link{text}, \link{arctext}} -\examples{ - plot(0, xlim=c(1,5), ylim=c(1,5), main="Test of radialtext", - xlab="", ylab="", type="n") - points(3, 3, pch=20) - radialtext("uncooked spaghetti", center=c(3,3), - col="blue") - radialtext("uncooked spaghetti", center=c(3,3), - start=1.2, angle=pi/4, cex=0.8) - radialtext("uncooked spaghetti", center=c(3,3), - middle=1.2, angle=pi/4+0.1, cex=0.8) - radialtext("uncooked spaghetti", center=c(3,3), - end=1.2, angle=pi/4+0.2, cex=0.8) - radialtext("uncooked spaghetti", center=c(3,3), - start=0.5, deg=135, cex=0.8, col="green") - radialtext("uncooked spaghetti", center=c(3,3), - start=0.5, deg=145, cex=0.8, stretch=2) - radialtext("uncooked spaghetti", center=c(3,3), - start=0.5, deg=20, expand=0, col="red") - radialtext("uncooked spaghetti", center=c(3,3), - start=0.5, deg=250, expand=0.35) - radialtext("uncooked spaghetti", center=c(3,3), - start=0.75, deg=225, expand=1, col="gold") - radialtext("uncooked spaghetti", center=c(3,3), - start=0.5, deg=325, expand=-0.25, cex=2) -} -\keyword{misc} diff --git a/man/raw.means.plot.Rd b/man/raw.means.plot.Rd deleted file mode 100644 index 8779e4d..0000000 --- a/man/raw.means.plot.Rd +++ /dev/null @@ -1,362 +0,0 @@ -\name{raw.means.plot} -\alias{raw.means.plot} -\alias{raw.means.plot2} -\title{ -raw.means.plot: Raw-Means Plots for Experimental Designs -} -\description{ -raw.means.plot is a function for visualizing results of experimental designs - with up to two factors. It plots both raw data (background) and factor/cell - means (foreground) to provide a more accurate visualization of the underlying - distribution. -} -\usage{ -raw.means.plot(data, col.offset = 2, col.x = 3, col.value = 4, na.rm = FALSE, - avoid.overlap = c("y", "x", "both"), y.factor = 1, y.amount = NULL, - x.amount = 0.05, pch = 21:25, lty = 1:5, bg.b.col = "darkgrey", - bg.f.col = NULL, fg.b.col = "black",fg.f.col = "black", type = "o", - pt.cex = 1, lwd = 1, xlab = "", ylab = "", ylim, max.offset = 0.2, - xaxis = TRUE, x.labels, xaxt = "n", plot = TRUE, legend = TRUE, mar = NULL, - reset.mar = TRUE, l.pos, yjust = 0.5, l.bty = "n", l.adj = c(0, 0.5), ...) - -raw.means.plot2(data, col.id, col.offset, col.x, col.value, - fun.aggregate = "mean", ...) - -} -\arguments{ - \item{data}{ - a \samp{data.frame} in long format (i.e., each datapoint one row, - see \samp{\link{reshape}} or the reshape package) that contains at least - three columns: one column coding the first factor (\samp{col.offset}), one - column coding the second factor (\samp{col.x}), and one column containing - the values (\samp{col.value}). -} - \item{col.id}{ - a \samp{character} scalar, specifiying the name of the column specifying the - id column. (only for \samp{raw.means.plot2}) -} - \item{col.offset}{ - a \samp{character} or \samp{numeric} (only \samp{raw.means.plot}) scalar, - specifiying either name or number of the column coding the different lines - (the offset or first factor). -} - \item{col.x}{ - a \samp{character} or \samp{numeric} (only \samp{raw.means.plot}) scalar, - specifiying either name or number of the column coding the x-axis factor. - Default is 3. -} - \item{col.value}{ - a \samp{character} or \samp{numeric} (only \samp{raw.means.plot}) scalar, - specifiying either name or number of the data column. Default is 4. -} - \item{na.rm}{ -\samp{logical} indicating whether \samp{NA} values should be stripped before - the computation proceeds. Default is \samp{FALSE}. Throws an error message - if FALSE and NAs are encountered. -} - \item{avoid.overlap}{ - character. What should happen to datapoints within one cell of the two - factors that have the same value. -\itemize{ - \item \samp{"y"} (the default) \link{jitter} is added so that - overlapping points are distinguishable on the \strong{y}-axis - \item \samp{"x"} \link{jitter} is added so that overlapping points - are distinguishable on the \strong{x}-axis - \item \samp{"both"} \link{jitter} is added so that overlapping points - are distinguishable on both the \strong{y}- and the \strong{x}-axis. - \item anything else. No jitter is added. -} -} - \item{y.factor}{ - \samp{factor} for controlling the amount of jitter on the y-axis - (will be passed to \link{jitter}). -} - \item{y.amount}{ - \samp{amount} for controlling the amount of jitter on the y-axis - (will be passed to \link{jitter}). -} - \item{x.amount}{ - \samp{amount} for controlling the amount of jitter on the x-axis - (will be passed to \link{jitter}). -} - \item{pch}{ - \samp{pch} values (plot symbols) taken for plotting the data. Note that - the same values are taken for raw data and means. see \link{points} - for more details. Recycled if too short (with warning). Default is 21:25, - because those are the only values that can be displayed filled and non-filled. - All other values should not be used. -} - \item{lty}{ -\samp{lty} values (line types) for connecting the means. See \link{par} - for more details. Recycled if too short (with warning). Default is 1:5. -} - \item{bg.b.col}{ - background border color: border color of raw data points. Silently recycled. Default: - \samp{"darkgrey"} -} - \item{bg.f.col}{ - background filling color: fill color of raw data points. Silently recycled. Default: - \samp{NULL} -} - \item{fg.b.col}{ - foreground border color: border color of mean data points. Silently recycled. Default: - \samp{black} -} - \item{fg.f.col}{ - foreground fill color: fill color for mean data points. Silently recycled. Default: - \samp{black} -} - \item{type}{ - same as type in \link{plot}. Default: \samp{o} ("overplotted") -} - \item{pt.cex}{ - \samp{numeric} specifying the \samp{cex} value used for plotting the points. - Default is 1. -} - \item{lwd}{ - \samp{numeric} specifying the \samp{lwd} value used for plotting the lines. - Default is 1. -} - \item{xlab}{ - x-axis label. Default: \samp{""} -} - \item{ylab}{ - y-axis label. Default: \samp{""} -} - \item{ylim}{ - the y-axis limits of the plot. If not specified (the default) will be taken - from data so that all raw data points are visible and a warning message is - displayed specifying the ylim. -} - \item{max.offset}{ - \samp{numeric}. maximal offset of factor levels from the offset factor - (\samp{col.offset}) specifying the different lines. The centre of each factor - on the x-axis is at full numbers (starting from 1 to ...). The maximum will - only be reached if the number of factor levels (from \samp{col.offset}) is - even. Default: 0.2. -} - \item{xaxis}{ - \samp{logical} value indicating whether or not the x-axis should be generated - by \samp{raw.means.plot}. If \samp{TRUE}, labels for the x-axis will be taken - either from the unique values of \samp{col.x} or can be specified with - \samp{x.labels}. -} - \item{x.labels}{ - \samp{character} vector specifiying \samp{col.x} levels. Only relevant if - \samp{xaxis=TRUE}. Then, the values given here will be displayed at the - x-axis for each factor level of \samp{col.x}. -} - \item{xaxt}{ - A character which specifies whether ot not the x-axis should be plotted by - the call to plot function. Interfers with the aforementioned \samp{xaxis} - argument and the automatic \samp{xaxis} function by \samp{raw.means.plot}. - Just there for completeness. Default \samp{"n"} (and should not be changed). -} - \item{plot}{ - \samp{logical}. Should the \samp{raw.means.plot} be drawn or not. If - \samp{TRUE} (the default) plot will be drawn. If \samp{FALSE} only the legend - will be drawn (if \samp{legend = TRUE}) See details. -} - \item{legend}{ - \samp{logical} indicating whether or not \samp{raw.means.plot} should - automatically add a legend on the right outside the plot area indicating - which line and points refer to which \samp{col.offset} factor levels. Default - is \samp{TRUE}. -} - \item{mar}{ - \samp{NULL} or \samp{numerical} vector of length 4 indicating the margins of - the plot (see \link{par}). If \samp{NULL} (the default) the right - margin (i.e., \samp{par("mar")[4]}) will be (imperfectly) guessed from the - \samp{col.offset} factors for placing the legend right to the plot. If length - is four this value will be taken. Ignored for \samp{plot = FALSE}. -} - \item{reset.mar}{ -\samp{logical} indicating if the margins (\samp{mar}) shall be resetted after - setting internally. Will be ignored if \samp{legend = FALSE}. Default is - \samp{TRUE} and should not be changed (especially with \samp{plot = FLASE}). -} - \item{l.pos}{ - \samp{numeric} vector of length 2 indicating the position of the legend. If - not specified automatically determined. See details. -} - \item{yjust}{ - how the legend is to be justified relative to the legend y location. A value - of 0 means top, 0.5 means centered and 1 means bottom justified. Default is - 0.5. -} - \item{l.bty}{ - the type of box to be drawn around the legend. The allowed values are - \samp{"o"} and \samp{"n"} (the default). -} - \item{l.adj}{ - \samp{numeric} of length 1 or 2; the string adjustment for legend text. Useful - for y-adjustment when labels are plotmath expression. see \link{legend} - and \link{plotmath} for more info. -} - \item{\dots}{ - further arguments which are either passed to plot or legend (or - \samp{raw.means.plot} for \samp{raw.means.plot2}). The following arguments - are passed to legend, all others are passed to plot: - \samp{"fill", "border", "angle", "density", "box.lwd", "box.lty", "box.col", - "pt.cex", "pt.lwd", "xjust", "x.intersp", "y.intersp", "text.width", - "text.col", "merge", "trace", "plot", "ncol", "horiz", "title", "inset", - "title.col", "title.adj"} -} - \item{fun.aggregate}{ - Function or function name used for aggregating the data across the two - factors. Default is \samp{"mean"}. (only for \samp{raw.means.plot2}) -} -} -\details{ - -\samp{raw.means.plot2} is probably the more useful function, as it allows for - using a data.frame with more than two-factors and aggregates across the other - factors, but needs a column specifying the experimental unit (e.g., - participant). - -\samp{raw.means.plot} is basically an advanced wrapper for two other - functions: \link{plot} and (if \samp{legend=TRUE}) - \link{legend}. Furthermore, raw data is plotted with a call to - \link{points} and the means with a call to \link{lines}. - -You can use \samp{raw.means.plot} to plot only a legend by setting - \samp{plot = FALSE} and \samp{legend = TRUE}. Then, \samp{raw.means.plot} - will draw an invisible plot with \samp{xlim = c(0,10)} and - \samp{ylim = c(0, 10)} and place the legend on this invisible plot. You - can specify \samp{l.pos} to position the legend, otherwise it will be plotted - at \samp{c(5,5)} (i.e., in the middle of the plot). Note that - \samp{xpd = TRUE} in the call to \samp{legend} (see \link{par}). -} -\value{ -Nothing. This function is invoked for its side effects. -} -\author{ -Henrik Singmann (\email{henrik.singmann@psychologie.uni-freiburg.de}) with - ideas from Jim Lemon -} -\seealso{ -\link{add.ps} can be used in addition to\samp{raw.means.plot} to - compare the factors at each x-axis position, by adding p-values from t-tests - to the x-axis. -} - - -\examples{ - -x <- data.frame(id = 1:150, offset = rep(c("Group A", "Group B", "Group C"), - each = 50), xaxis = sample(c("A", "B", "C", "D"),150, replace = TRUE), - data = c(rnorm(50, 10, 5), rnorm(50, 15,6), rnorm(50, 20, 5))) - -raw.means.plot(x) - -raw.means.plot(x, main = "Example", ylab = "Values", xlab = "Factor", - title = "Groups") - -raw.means.plot(x, "offset", "xaxis", "data") - -raw.means.plot(x, "xaxis", "offset", "data") - -raw.means.plot(x, 3, 2, 4) - -# different colors: -raw.means.plot(x, main = "Example", ylab = "Values", xlab = "Factor", - title = "Groups", fg.f.col = c("red","blue", "green")) - -x2 <- data.frame(id = 1:150, offset = rep(c("Group A", "Group B", "Group C"), - each = 50), xaxis = sample(c("A", "B", "C", "D"),150, replace = TRUE), - data = c(rnorm(50, 10, 5), rnorm(50, 15,6), rnorm(50, 20, 5))) - -layout(matrix(c(1,2,3,3), 2,2,byrow = TRUE), heights = c(7,1)) -raw.means.plot(x, main = "Data x1", ylab = "Values", xlab = "Factor", - legend = FALSE, mar = c(4,4,4,1)+0.1) -raw.means.plot(x2, main = "Data x2", ylab = "Values", xlab = "Factor", - legend = FALSE, mar = c(4,4,4,1)+0.1) -raw.means.plot(x2, plot = FALSE, title = "Groups") - - -y <- data.frame(id = 1:300, offset = rep(1, 300), - axis = sample(LETTERS[1:6],300, replace = TRUE), data = c(rnorm(100, 1), - rnorm(100), rnorm(100,1))) - -par(mfrow = c(2,2)) - -raw.means.plot(y, legend = FALSE) - -raw.means.plot(y, type = "p", legend = FALSE) - -raw.means.plot(y, type = "l", legend = FALSE) - -raw.means.plot(y, 3, 2, x.labels = "one group only") - - -# Example with overlapping points -z <- data.frame (id = 1:200, offset = rep(c("C 1", "C 2"), 200), - axis = sample(LETTERS[1:4], 200, replace = TRUE), - data = sample(1:20, 200, replace = TRUE)) - -# x versus y jitter -par(mfrow = c(2,2)) -raw.means.plot(z, avoid.overlap = "none", main = "no-jitter") -raw.means.plot(z, main = "y-axis jitter (default)") -raw.means.plot(z, avoid.overlap = "x", main = "x-axis jitter") -raw.means.plot(z, avoid.overlap = "both", main = "both-axis jitter") - - -# y-axis jitter (default) -par(mfrow = c(2,2)) -raw.means.plot(z, avoid.overlap = "none", main = "no jitter") -raw.means.plot(z, y.factor = 0.5, main = "smaller y-jitter") -raw.means.plot(z, main = "standard y-jitter") -raw.means.plot(z, y.factor = 2, main = "bigger y-jitter") - - -# x-axis jitter (default) -par(mfrow = c(2,2)) -raw.means.plot(z, avoid.overlap = "none", main = "no jitter") -raw.means.plot(z, avoid.overlap = "x", x.amount = 0.025, - main = "smaller x -jitter") -raw.means.plot(z, avoid.overlap = "x", main = "standard x-jitter") -raw.means.plot(z, avoid.overlap = "x", x.amount= 0.1, - main = "bigger x-jitter") - - - -\dontrun{ - -#The examples uses the OBrienKaiser dataset from car and needs reshape. -require(reshape) -require(car) -data(OBrienKaiser) -OBKnew <- cbind(factor(1:nrow(OBrienKaiser)), OBrienKaiser) -colnames(OBKnew)[1] <- "id" -OBK.long <- melt(OBKnew) -OBK.long[, c("measurement", "time")] <- - t(vapply(strsplit(as.character(OBK.long$variable), "\\\."), "[", c("", ""))) - -raw.means.plot2(OBK.long, "id", "measurement", "gender", "value") - -raw.means.plot2(OBK.long, "id", "treatment", "gender", "value") - -# also use add.ps: -# For this example the position at each x-axis are within-subject comparisons! -raw.means.plot2(OBK.long, "id", "measurement", "gender", "value") -add.ps(OBK.long, "id", "measurement", "gender", "value", paired = TRUE) - #reference is "fup" - -raw.means.plot2(OBK.long, "id", "measurement", "gender", "value") -add.ps(OBK.long, "id", "measurement", "gender", "value", ref.offset = 2, - paired = TRUE) #reference is "post" - -# Use R's standard (i.e., Welch test) -raw.means.plot2(OBK.long, "id", "treatment", "gender", "value") -add.ps(OBK.long, "id", "treatment", "gender", "value", - prefixes = c("p(control vs. A)", "p(control vs. B)")) - -# Use standard t-test -raw.means.plot2(OBK.long, "id", "treatment", "gender", "value") -add.ps(OBK.long, "id", "treatment", "gender", "value", var.equal = TRUE, - prefixes = c("p(control vs. A)", "p(control vs. B)")) - -} - -} diff --git a/man/rectFill.Rd b/man/rectFill.Rd deleted file mode 100644 index 1fac42c..0000000 --- a/man/rectFill.Rd +++ /dev/null @@ -1,36 +0,0 @@ -\name{rectFill} -\alias{rectFill} -\title{Draw a rectangle filled with symbols} -\description{ - Draws a rectangle on the current figure filled with arbitrary symbols. -} -\usage{ - rectFill(x1,y1,x2,y2,fg=par("fg"),bg=par("bg"),xinc=NA,yinc=NA, - pch=1,pch.cex=1,pch.col=par("fg"),...) -} -\arguments{ - \item{x1,y1,x2,y2}{Rectangle limits as in \samp{rect}.} - \item{fg}{Foreground color} - \item{bg}{Background color} - \item{xinc,yinc}{The x and y increments of spacing for the symbols.} - \item{pch}{Which symbol to use} - \item{pch.cex}{Character expansion for the symbols.} - \item{pch.col}{Color(s) for the symbols. } - \item{...}{Additional arguments to \samp{points} for the symbols.} -} -\details{ - \samp{rectFill} draws a rectangle and fills the rectangle with the - symbols requested. It is probably most useful as a substitute for - fill colors in a black and white environment. -} -\value{ nil } -\author{Jim Lemon} -\seealso{\link{rect}, \link{points}} -\examples{ - plot(1:7,type="n",xlab="",ylab="",main="Test of rectFill") - rectFill(1:6,1:6,2:7,2:7,bg=2:7,pch=c("+","*","o",".","#","^"), - xinc=c(0.2,0.1,0.2,0.1,0.2,0.2),yinc=c(0.2,0.1,0.2,0.1,0.2,0.2), - pch.col=1:6) - barp(matrix(runif(9),nrow=3),main="Black and white bar plot",pch=1:3) -} -\keyword{misc} diff --git a/man/rescale.Rd b/man/rescale.Rd deleted file mode 100644 index 9f6aad7..0000000 --- a/man/rescale.Rd +++ /dev/null @@ -1,31 +0,0 @@ -\name{rescale} -\title{Scale numbers into a new range} -\description{Scale a vector or matrix of numbers into a new range.} -\usage{ - rescale(x,newrange) -} -\alias{rescale} -\arguments{ - \item{x}{A numeric vector, matrix or data frame.} - \item{newrange}{The minimum and maximum value of the range into which - \samp{x} will be scaled.} -} -\details{ - \samp{rescale} performs a simple linear conversion of \samp{x} into the - range specified by \samp{newrange}. Only numeric vectors, matrices or data - frames with some variation will be accepted. NAs are now preserved - - formerly the function would fail. -} -\value{On success, the rescaled object, otherwise the original object.} -\author{Jim Lemon} -\examples{ - # scale one vector into the range of another - normal.counts<-rnorm(100) - normal.tab<-tabulate(cut(normal.counts,breaks=seq(-3,3,by=1))) - normal.density<-rescale(dnorm(seq(-3,3,length=100)),range(normal.tab)) - # now plot them - plot(c(-2.5,-1.5,-0.5,0.5,1.5,2.5),normal.tab,xlab="X values", - type="h",col="green") - lines(seq(-3,3,length=100),normal.density,col="blue") -} -\keyword{misc} diff --git a/man/revaxis.Rd b/man/revaxis.Rd deleted file mode 100644 index 2de4b85..0000000 --- a/man/revaxis.Rd +++ /dev/null @@ -1,40 +0,0 @@ -\name{revaxis} -\alias{revaxis} -\title{ Plot with axis direction(s) reversed } -\description{ - Reverses the sense of either or both the \samp{x} and \samp{y} axes. -} -\usage{ -revaxis(x, y, xrev=FALSE, yrev=TRUE, xside=if (yrev) 3 else 1, - yside=if (xrev) 4 else 2, xlab=NULL, ylab=NULL, bty=NULL, ...) - -} -\arguments{ - \item{x}{ Vector of \samp{x}-coordinates of the data to be plotted. } - \item{y}{ Vector of \samp{y}-coordinates of the data to be plotted. } - \item{xrev}{ Logical scalar; should the sense of the \samp{x}-axis - be reversed?} - \item{yrev}{ Logical scalar; should the sense of the \samp{y}-axis - be reversed?} - \item{xside}{ The side of the plot on which the \samp{x}-axis labels - should go.} - \item{yside}{ The side of the plot on which the \samp{y}-axis labels - should go.} - \item{xlab}{ Character string for labelling the \samp{x}-axis. } - \item{ylab}{ Character string for labelling the \samp{y}-axis. } - \item{bty}{ Single letter indicating the type of box to be drawn - around the plot. See \link{par} for the possible letters - and their meaning.} - \item{\dots}{ Other arguments to be passed to plot.} -} - -\value{ nil } -\author{Rolf Turner} -\seealso{ \link{plot}, \link{box}, \link{par}} - -\examples{ -x <- runif(20) -y <- runif(20) -revaxis(x,y,yside=4) -} -\keyword{ hplot } diff --git a/man/ruginv.Rd b/man/ruginv.Rd deleted file mode 100644 index f27e0bb..0000000 --- a/man/ruginv.Rd +++ /dev/null @@ -1,32 +0,0 @@ -\name{ruginv} -\alias{ruginv} -\title{Add an Inverse Rug to a Plot} -\description{Adds a \emph{rug} representation (1D plot) of the data to the plot, - but with the coloring inverted.} -\usage{ - ruginv(x,ticksize=0.03,side=1,lwd=0.5,col=par("fg"),col.ticks="white", - quiet=getOption("warn") < 0,...) -} -\arguments{ - \item{x}{A numeric vector.} - \item{ticksize}{The length of the ticks making up the 'rug'. Positive lengths - produce inward ticks.} - \item{side}{On which side of the plot box the rug will appear. Usually 1 - (bottom) or 3 (top).} - \item{lwd}{The line width of the ticks.} - \item{col}{Color of the background of the ticks.} - \item{col.ticks}{The color of the ticks.} - \item{quiet}{Logical indicating if there should be a warning about clipped - values.} - \item{...}{Further arguments passed to \link{polygon} when plotting the - background for the ticks.} -} -\author{Peter Solymos} -\seealso{\link{rug}} -\examples{ - require(stats) - plot(density(faithful$eruptions,bw=0.15)) - ruginv(faithful$eruptions,ticksize=-0.05) - ruginv(jitter(faithful$eruptions,amount=0.01),side=3,col="lightblue") -} -\keyword{misc} diff --git a/man/seats.Rd b/man/seats.Rd deleted file mode 100644 index 074e2ef..0000000 --- a/man/seats.Rd +++ /dev/null @@ -1,22 +0,0 @@ -\name{seats} -\alias{seats} -\title{Arrange N seats in M semicircular rows} -\description{Compute seat positions in a semicircular parliament} -\usage{seats(N, M, r0 = 2.5)} -\arguments{ - \item{N}{Total number of seats.} - \item{M}{Number of semicircular arcs on which to distribute the seats.} - \item{r0}{Radius of the inner arc in user units.} -} -\value{ - A data frame including: - \item{x}{The x positions of the seats to be plotted on semi-circular - arcs.} - \item{y}{The y positions of the seats to be plotted on semi-circular - arcs.} - \item{r}{The row numbers for each seat.} - \item{theta}{The angle of each seat, going from pi to zero radians.} -} -\author{Duncan Murdoch and Barry Rowlingson} -\seealso{\link{election}} -\keyword{misc} diff --git a/man/size_n_color.Rd b/man/size_n_color.Rd deleted file mode 100644 index 27dbe0b..0000000 --- a/man/size_n_color.Rd +++ /dev/null @@ -1,83 +0,0 @@ -\name{size_n_color} -\alias{size_n_color} -\title{Display circles with specified size and color} -\description{Display a plot of circles at specified locations, each with a - specified size and color.} -\usage{ - size_n_color(x=NULL,y,size,sizefun="sqrt",col,main="", - xlim=NA,xlab="",xat=NULL,xaxlab=NULL,xcex=1,xlas=0,xgrid=FALSE, - ylim=NA,ylab="",yat=NULL,yaxlab=NULL,ycex=1,ylas=1,ygrid=TRUE, - mar=c(5,4,4,2),boxit=TRUE,add=FALSE,...) -} -\arguments{ - \item{x,y}{Vectors or matrices of x and y positions for the symbols.} - \item{size}{Sizes for the symbols expressed as numbers.} - \item{sizefun}{The function to use for transforming the values to radii - of circles. Square root gives areas proportional to the values.} - \item{col}{Colors for the symbols (see Details).} - \item{main}{Title for the plot.} - \item{xlim,ylim}{Explicit x and y limits for the plot}. - \item{xlab,ylab}{Labels for the x and y axes.} - \item{xat,yat}{Where to place the ticks and tick labels on the axes.} - \item{xaxlab,yaxlab}{Tick labels for the x and y axes.} - \item{xcex,ycex}{Character expansions for the axis tick labels.} - \item{xlas,ylas}{Orientation for the axis tick labels (see \samp{par}).} - \item{xgrid,ygrid}{Whether to display a grid along the x or y direction.} - \item{mar}{Margins for the plot (see Details).} - \item{boxit}{Whether to draw a box around the plot.} - \item{add}{Whether to draw a new plot (FALSE) or add symbols to an existing - plot (TRUE).} - \item{...}{Additional arguments passed to \samp{plot}.} -} -\details{ - \samp{size_n_color} plots circles centered on the \samp{x} and \samp{y} - coordinates. The size and color of the circles may also be specified - individually, allowing four dimensions of variation to be displayed on the - plot. - - \samp{size_n_color} may also be used to display a "visual table" as in the second - example. Here the x and y coordinates are used to associate the symbols with - two categorical variables, underlying cause of death and year of observation. - If the x values are not passed to the function, it will try to space out the - circles evenly in a representation of the matrix. If the matrix is not square, - use a plotting device that has about the same proportion of height and width as - the matrix. -} -\value{nil} -\keyword{misc} -\author{Jim Lemon} -\seealso{\link{plot}, \link{points}, \link{par}} -\examples{ - meantemp<-c(19,22,25,29,21,20,16,27,23,26) - totalrain<-c(174,152,196,120,177,183,92,153,161,85) - numpumpkin<-c(53,47,61,63,38,42,48,71,66,29) - meanwt<-c(1.5,2.3,2.8,1.9,2.4,1.8,2.6,2.2,1.7) - size_n_color(meantemp,totalrain,meanwt/5,NA,xlim=c(15,30), - color.scale(numpumpkin,c(0.8,0),c(0.8,1),0), - xlab="Temperature (degrees C)",ylab="Rainfall (mm)", - main="Number and weight of pumpkins by temperature and rainfall", - xat=seq(15,30,by=5),yat=seq(80,200,by=20)) - color.legend(15,55,18.5,60,seq(40,70,by=10), - rect.col=color.scale(seq(40,70,by=10),c(0.8,0),c(0.8,1),0)) - points(15:18,rep(126,4),cex=seq(1.5,3.0,by=0.5)) - text(15:19,rep(134,5),c("1.5","2.0","2.5","3.0","kg")) - par(xpd=TRUE) - text(13.5,60,"Number of\npumpkins") - par(xpd=FALSE) - # now display a "visual table" of delayed registrations by underlying cause of - # death and year of observation. The sizes of the circles represent the log of - # the number of deaths and the colors represent the percentage of deaths that - # occurred in the year prior to registration or earlier - data(death_reg) - size_n_color(x=matrix(rep(1996:2010,each=22),nrow=22), - y=matrix(rep(1:22,15),nrow=22),size=t(death_reg[[1]])/200, - col=color.scale(t(death_reg[[2]]),c(0,0.8,1),c(1,0.2,0),0), - ylim=c(1,22),main="Delayed registrations by ICD chapter", - xlab="Year",xaxlab=1996:2010,xat=1996:2010,xcex=0.8, - yaxlab=colnames(death_reg[[1]]),ycex=0.8,ygrid=TRUE,mar=c(5,6,4,2)) - color.legend(1994,-3.5,2000,-2.5,seq(0,50,by=10),cex=0.8, - rect.col=color.scale(seq(0,50,by=10),c(0,0.8,1),c(1,0.2,0),0)) - par(xpd=TRUE) - text(1993.4,-2.5,"Pct.\nslow",cex=0.8) - par(xpd=FALSE) -} diff --git a/man/sizeplot.Rd b/man/sizeplot.Rd deleted file mode 100644 index 0df5f63..0000000 --- a/man/sizeplot.Rd +++ /dev/null @@ -1,41 +0,0 @@ -\name{sizeplot} -\alias{sizeplot} -\title{Plot with repeated symbols by size} -\description{ - Plots a set of (x,y) data with repeated points denoted by larger - symbol sizes -} -\usage{ - sizeplot(x, y, scale=1, pow=0.5, powscale=TRUE, size=c(1,4), add=FALSE, ...) -} -\arguments{ - \item{x}{x coordinates of data} - \item{y}{y coordinates of data} - \item{scale}{scaling factor for size of symbols} - \item{pow}{power exponent for size of symbols} - \item{powscale}{(logical) use power scaling for symbol size?} - \item{size}{(numeric vector) min and max size for scaling, if powscale=FALSE} - \item{add}{(logical) add to an existing plot?} - \item{\dots}{other arguments to \samp{plot()} or \samp{points()}} -} -\details{ - Most useful for plotting (e.g.) discrete data, where repeats are - likely. If all points are repeated equally, gives a warning. The - size of a point is given by \eqn{scale*n^pow}, where n is the number of - repeats, if powscale is TRUE, or it is scaled between size[1] and size[2], - if powscale is FALSE. -} -\value{ - A plot is produced on the current device, or points are added to the - current plot if \samp{add=TRUE}. -} -\author{Ben Bolker} -\seealso{\link{symbols}} -\examples{ - x <- c(0.1,0.1,0.1,0.1,0.1,0.2,0.2,0.2,0.2,0.3,0.3) - y <- c( 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5 ) - plot(x,y) - sizeplot(x,y) - sizeplot(x,y,pch=2) -} -\keyword{hplot} diff --git a/man/sizetree.Rd b/man/sizetree.Rd deleted file mode 100644 index 6753048..0000000 --- a/man/sizetree.Rd +++ /dev/null @@ -1,106 +0,0 @@ -\name{sizetree} -\alias{sizetree} -\title{Display a hierarchical breakdown of disjunct categories} -\description{Display a data frame in which the values in each successive - column represent subcategories of the previous column as stacked - rectangles.} -\usage{ - sizetree(x,left=0,top,right=1,lastcenter=NA,showval=TRUE,showcount=TRUE, - stacklabels=TRUE,firstcall=TRUE,col=NULL,border=NA,toplab=NULL,base.cex=1, - ...) -} -\arguments{ - \item{x}{A data frame in which each successive column represents - subcategories of the previous column.} - \item{left}{The left edge of the current stack of rectangles in user units.} - \item{top}{The top of the current stack of rectangles in user units.} - \item{right}{The right edge of the current stack of rectangles in user units.} - \item{lastcenter}{The center of the previous rectangle from which the next - breakdown of categories arises. There is almost no reason to change it.} - \item{showval}{Whether to display the values representing the categories.} - \item{showcount}{Whether to display the count for the categories.} - \item{stacklabels}{Whether to display the names of the dataframe beneath - the stacked rectangles.} - \item{firstcall}{A flag for the function - do not alter this.} - \item{col}{Optional fill colors for the rectangles. See Details} - \item{border}{Color for border around the rectangles. See details} - \item{toplab}{Optional labels to display a the top of each stack.} - \item{base.cex}{The base character expansion for the labels.} - \item{...}{additional arguments passed to \samp{plot}.} -} -\value{ nil } -\details{ - \samp{sizetree} displays disjunct hierarchical categories as stacked rectangles. - It accepts a data frame in which the values in the first column represent - categories, the values in the second column represent subcategories of the - first column, and so on. The first column will be displayed as a stack of - rectangles, the height of each proportional to the count for each category. - Each substack of rectangles in the second stack will represent the breakdown - of counts for its superordinate category and so on through the columns. - Empty categories are ignored and NAs will produce gaps, which will propagate - across subsequent stacks. - - The user can simply pass the data frame, which should only contain columns that - are hierarchical categories (example 1). The colors will probably not be ideal. - The user can pass the same colors for the all levels (example 2). If this is - done, \samp{sizetree} will try to match colors to categories when - the number of categories is diminishing (e.g. some levels are missing in the - sub-categories) and the columns of \samp{x} are factors with the same levels in - the same order. This will work if the category labels are the same in each level, - but remember to add the names to the colors before passing them to the function. - This will not work if there are more categories in the lower levels. If \samp{col} - is a list, this is not done, and the user will have to work out the correct colors - for each level. This is particularly important when the category labels and the - number of categories is different in different levels (example 3). - - In some sizetrees, the subcategory counts are very low compared to the overall - number of data objects. This results in rectangles that are very thin vertically. - One way to get better legibility of the labels is to use dark colors for the - rectangles, so that the labels are white, and no borders (set \samp{border} to NA). - The user can also select only part of the data frame \samp{x} to expand sections - of the sizetree as in the last example. - - The labels are sized to fit the vertical extent of the bars. However, it is - possible that the labels may extend horizontally beyond the bar(s). The - \samp{base.cex} argument can be used to shrink the labels if this happens. - Remember that \samp{base.cex} will shrink all the labels, not just the ones - that are too wide. - - The \samp{firstcall} argument is necessary for the function to initialize the - plot, as each breakdown involves a recursive call. If it is changed, the best - that can be expected is an uninformative plot. -} -\author{Jim Lemon} -\seealso{\link{plot}} -\examples{ - cat1<-factor(sample(c("None","Low","Medium","High","Extreme"),40,TRUE), - levels=c("None","Low","Medium","High","Extreme")) - cat2<-factor(sample(c("None","Low","Medium","High"),40,TRUE), - levels=c("None","Low","Medium","High")) - cat3<-factor(sample(c("None","Low","High"),40,TRUE), - levels=c("None","Low","High")) - hcats<-data.frame(cat1,cat2,cat3) - # throw in a few NAs - hcats$cat1[10]<-NA - hcats$cat2[c(15,20)]<-NA - hcats$cat3[c(11,14,25)]<-NA - # first let sizetree work out the colors - sizetree(hcats,main="Sizetree with automatic colors") - # now see what happens with a list of the same colors for each level - bhcol<-c("#ff8080","#dddd80","#80ff80","#0000ff","#80dddd") - sizetree(hcats,col=list(bhcol,bhcol,bhcol), - main="Sizetree with the same colors each level") - # finally, specify different colors for categories with different labels - sexhaireye<-data.frame(sex=factor(sample(c("Male","Female"),50,TRUE)), - hair=factor(sample(c("Blond","Red","Brown","Black"),50,TRUE)), - eye=factor(sample(c("Gold","Green","Blue"),50,TRUE))) - shecol<-list(c("pink","lightblue"),c("#000000","#dddd00","#886600","#ee8800"), - c("blue","gold","green")) - sizetree(sexhaireye,main="Sex, hair and eye color", - col=shecol,toplab=c("Sex","Hair color","Eye color")) - # now expand the female part of the sizetree - sizetree(sexhaireye[sexhaireye[,1]=="Female",], - main="Sex, hair and eye color (Females only)", - col=shecol,toplab=c("Sex","Hair color","Eye color")) -} -\keyword{misc} diff --git a/man/sliceArray.Rd b/man/sliceArray.Rd deleted file mode 100644 index ba550e7..0000000 --- a/man/sliceArray.Rd +++ /dev/null @@ -1,30 +0,0 @@ -\name{sliceArray} -\alias{sliceArray} -\title{Slice an array} -\description{ - Slices one dimension from an array by taking one element from the first dimension. -} -\usage{ - sliceArray(x,slice) -} -\arguments{ - \item{x}{An array} - \item{slice}{The index of the slice to take from the first dimension of the array.} -} -\details{ - \samp{sliceArray} builds an extractor string containing the value of \samp{slice} - as the first element and as many commas as needed to match the dimensions of the - array. It then applies the extractor function to \samp{x} and returns the result. - Note how the array "slice" swaps dimensions in the example. -} -\value{ - The desired slice of the array. -} -\author{Jim Lemon} -\seealso{\link{array}} -\examples{ - a1<-array(1:27,dim=c(3,3,3)) - a1 - sliceArray(a1,2) -} -\keyword{misc} diff --git a/man/smoothColors.Rd b/man/smoothColors.Rd deleted file mode 100644 index 2babe3d..0000000 --- a/man/smoothColors.Rd +++ /dev/null @@ -1,34 +0,0 @@ -\name{smoothColors} -\alias{smoothColors} -\title{Build a vector of color values} -\usage{ - smoothColors(...,alpha=NA) -} -\arguments{ - \item{...}{an arbitrary sequence of color names and integers beginning - and ending with a color name.} - \item{alpha}{optional \samp{alpha} (transparency) value.} -} -\description{ - \samp{smoothColors} calculates a sequence of colors. If two color names - in the arguments are separated by a number, that number of interpolated - colors will be inserted between the two color endpoints. Any number of - color names and integers may be passed, but the last argument must be - a color name. If more than one integer appears between two color names, - only the first will be used in the interpolation and the others will be - ignored. -} -\value{A vector of hexadecimal color values as used by \samp{col}.} -\note{ - For more R functions that transform numeric values into - colors or produce colors that can be used to represent values, see the - \pkg{colourschemes} package. -} -\author{Barry Rowlingson} -\seealso{\link{color.gradient},\link{rgb}} -\examples{ - plot(1:10,main="Test opaque colors",type="n",axes=FALSE) - box() - rect(1:7,1:7,3:9,3:9,col=smoothColors("red",2,"green",2,"blue")) -} -\keyword{misc} diff --git a/man/soil.texture.Rd b/man/soil.texture.Rd deleted file mode 100755 index 7f46226..0000000 --- a/man/soil.texture.Rd +++ /dev/null @@ -1,85 +0,0 @@ -\name{soil.texture} -\alias{soil.texture} -\title{Soil texture triangle plot} -\description{ - Display a USDA soil texture triangle with optional grid, labels and - soil texture points. -} -\usage{ -soil.texture(soiltexture=NULL, main="", at=seq(0.1, 0.9, by=0.1), - axis.labels=c("percent sand", "percent silt", - "percent clay"), - tick.labels=list(l=seq(10, 90, by=10), r=seq(10, 90, by=10), - b=seq(10, 90, by=10)), - show.names=TRUE, show.lines=TRUE, col.names="gray", - bg.names=par("bg"), show.grid=FALSE, col.axis="black", - col.lines="gray", col.grid="gray", lty.grid=3, - show.legend=FALSE, label.points=FALSE, point.labels=NULL, - col.symbols="black", pch=par("pch"), \dots) -} -\arguments{ - \item{soiltexture}{Matrix of soil textures where each row is a - soil sample and three columns contain the proportions of the - components sand, silt and clay in the range 0 to 1 or - percentages in the range 0 to 100.} - \item{main}{The title of the soil texture plot. Defaults to nothing.} - \item{at}{Positions on the three axes where ticks will be drawn.} - \item{axis.labels}{Labels for the axes.} - \item{tick.labels}{The tick labels for the three axes.} - \item{show.names}{Logical - whether to show the names of different - soil types within the soil triangle.} - \item{show.lines}{Logical - whether to show the boundaries of the - different soil types within the soil triangle.} - \item{col.names}{Color of the soil names. Defaults to gray.} - \item{bg.names}{Color to use when drawing a blank patch for the names - of soil types.} - \item{show.grid}{Logical - whether to show grid lines at each 10% - level of each soil component.} - \item{col.axis}{Color of the triangular axes, ticks and labels.} - \item{col.lines}{Color of the boundary lines. Defaults to gray.} - \item{col.grid}{Color of the grid lines. Defaults to gray.} - \item{lty.grid}{Type of line for the grid. Defaults to dashed.} - \item{show.legend}{Logical - whether to display a legend.} - \item{label.points}{Logical - whether to call - \link{thigmophobe.labels} to label the points.} - \item{point.labels}{Optional labels for the points or legend.} - \item{col.symbols}{Color of the symbols representing each value.} - \item{pch}{Symbols to use in plotting values.} - \item{\dots}{Additional arguments passed to \link{triax.points} - and then \samp{points}.} -} -\details{ - \samp{soil.texture} displays a triangular plot area on which soil - textures defined as proportions of sand, silt and clay can be plotted. - Optional grid, vertex labels, soil type divisions and names may also - be displayed. If a matrix of soil textures is present, these will be - plotted. -} -\value{If \samp{soiltexture} was included, a list of the \samp{x,y} - positions of the soil types plotted. If not, nil. -} -\note{This is now a special case of \samp{triax.plot}.} -\author{Sander Oom, Jim Lemon, and Michael Toews} -\references{ - U.S. Department of Agriculture, Natural Resources Conservation Service, - 2007. \emph{National Soil Survey Handbook}, title 430-VI.// - formerly - \samp{https://www.nrcs.usda.gov/wps/portal/nrcs/detail/soils/survey/class/taxonomy/?cid=nrcs142p2_053577} - - U.S. Department of Agriculture, Natural Resources Conservation Service, - 2007. \emph{Soil Texture Calculator}// - formerly - \samp{https://www.nrcs.usda.gov/wps/portal/nrcs/detail/soils/survey/class/taxonomy/?cid=nrcs142p2_053577} -} -\seealso{\link{get.soil.texture}, \link{triax.plot}} -\examples{ - data(soils) - soil.texture(main="NO DATA") - soil.texture(soils, main="DEFAULT", pch=2) - soil.texture(soils, main="LINES AND NAMES", show.lines=TRUE, - show.names=TRUE, pch=3) - soiltex.return<-soil.texture(soils[1:6,], main="GRID AND LEGEND", - show.grid=TRUE, pch=4, col.symbols=1:6, show.legend=TRUE) - par(soiltex.return$oldpar) -} -\keyword{misc} diff --git a/man/soil.texture.uk.Rd b/man/soil.texture.uk.Rd deleted file mode 100644 index 16f907d..0000000 --- a/man/soil.texture.uk.Rd +++ /dev/null @@ -1,88 +0,0 @@ -\name{soil.texture.uk} -\alias{soil.texture.uk} -\title{Soil texture triangle plot using UK conventions} -\description{ - Display a UK style soil texture triangle with optional grid, labels and - soil texture points. -} -\usage{ - soil.texture.uk(soiltexture = NULL, main = "",at = seq(0.1, 0.9, by = 0.1), - axis.labels = c("percent sand", "percent silt", "percent clay"), - tick.labels = list(l = seq(10, 90, by = 10), r = seq(10, 90, by = 10), - b = seq(10, 90, by = 10)), show.names = TRUE, - show.lines = TRUE, col.names = "gray", bg.names = par("bg"), - show.grid = FALSE, col.axis = "black", col.lines = "gray", - col.grid = "gray", lty.grid = 3, show.legend = FALSE, label.points = FALSE, - point.labels = NULL, col.symbols = "black", pch = par("pch"), - h1 = NA, h3 = NA, t1 = NA, t3 = NA, lwduk = 2, xpos = NA, ypos = NA, - snames = NA, cexuk = 1.1, ...) -} -\arguments{ - \item{soiltexture}{Matrix of soil textures where each row is a - soil sample and three columns containing the percentages of the - components sand, silt and clay in the range 0 to 100.} - \item{main}{The title of the soil texture plot. Defaults to nothing.} - \item{at}{Positions on the three axes where ticks will be drawn.} - \item{axis.labels}{Labels for the axes.} - \item{tick.labels}{The tick labels for the three axes.} - \item{show.names}{Logical - whether to show the names of different - soil types within the soil triangle.} - \item{show.lines}{Logical - whether to show the boundaries of the - different soil types within the soil triangle.} - \item{col.names}{Color of the soil names. Defaults to gray.} - \item{bg.names}{Color to use when drawing a blank patch for the names - of soil types.} - \item{show.grid}{Logical - whether to show grid lines at each 10% - level of each soil component.} - \item{col.axis}{Color of the triangular axes, ticks and labels.} - \item{col.lines}{Color of the boundary lines. Defaults to gray.} - \item{col.grid}{Color of the grid lines. Defaults to gray.} - \item{lty.grid}{Type of line for the grid. Defaults to dashed.} - \item{show.legend}{Logical - whether to display a legend.} - \item{label.points}{Logical - whether to call - \link{thigmophobe.labels} to label the points.} - \item{point.labels}{Optional labels for the points or legend.} - \item{col.symbols}{Color of the symbols representing each value.} - \item{pch}{Symbols to use in plotting values.} - \item{h1,h3,t1,t3}{Points used in drawing boundaries for soil types.} - \item{lwduk}{Line width for the boundaries} - \item{xpos,ypos}{Positions for the soil type labels.} - \item{snames}{Soil type labels.} - \item{cexuk}{Character expansion for the soil type labels.} - \item{...}{Additional arguments passed to \link{triax.points} - and then \samp{points}.} -} -\details{ - \samp{soil.texture.uk} displays a triangular plot area on which soil - textures defined as proportions of sand, silt and clay can be plotted. - It is similar to the \samp{soil.texture} function but uses the UK - display conventions. -} -\value{If \samp{soiltexture} was included, a list of the \samp{x,y} - positions of the soil types plotted. If not, nil. -} -\author{Julian Stander} -\seealso{\link{triax.plot}} -\examples{ - soils.sw.percent<-data.frame( - Sand=c(67,67,66,67,36,25,24,59,27,9,8,8,20, - 45,50,56,34,29,39,41,94,98,97,93,96,99), - Silt=c(17,16,9,8,39,48,54,27,46,70,68,68,66, - 34,30,24,48,53,46,48,2,2,2,4,1,1), - Clay=c(16,17,25,25,25,27,22,14,27,21,24,24, - 14,21,20,20,18,18,15,11,4,0,1,3,3,0)) - soils.sw.cols <- c(1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, - 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6) - soils.sw.names <- c("Ardington","Astrop","Atrim", - "Banbury","Beacon","Beckfoot") - soil.texture.uk(soils.sw.percent, - main = "Ternary Diagram for Some Soils from South West England", - col.lines = "black", col.names = "black", show.grid = TRUE, - col.grid = "blue", lty.grid = 2, pch = 16, cex = 1.0, - col.symbols = soils.sw.cols, h1 = NA, h3 = NA, t1 = NA, - t3 = NA , lwduk = 2, xpos = NA, ypos = NA, - snames = NA, cexuk = 1.1) - legend("topleft", legend = soils.sw.names, col = 1:max(soils.sw.cols), - pch = 16, cex = 1.1, title = "Location", bty = "n") -} -\keyword{misc} diff --git a/man/soils.Rd b/man/soils.Rd deleted file mode 100644 index 1594476..0000000 --- a/man/soils.Rd +++ /dev/null @@ -1,16 +0,0 @@ -\name{soils} -\alias{soils} -\title{Soil texture data from 125 soils} -\description{ - A set of 125 soil texture measurements from soils from various parts of the - world. -} -\usage{ - data(soils) -} -\source{ - T.H. Skaggs, L.M. Arya, P.J. Shouse and B.P. Mohanty (2001) - Estimating Particle-Size Distribution from Limited Soil Texture Data. - Soil Science Society of America Journal 65:1038-1044. -} -\keyword{misc} diff --git a/man/spread.labels.Rd b/man/spread.labels.Rd deleted file mode 100644 index 830ad47..0000000 --- a/man/spread.labels.Rd +++ /dev/null @@ -1,67 +0,0 @@ -\name{spread.labels} -\alias{spread.labels} -\title{ Spread labels for irregularly spaced values } -\description{ - Places labels for irregularly spaced values in a regular staggered order -} -\usage{ - spread.labels(x,y,labels=NULL,ony=NA,offsets=NA,between=FALSE, - linecol=par("fg"),srt=0,...) -} -\arguments{ - \item{x,y}{x and y data values} - \item{labels}{text strings} - \item{ony}{Whether to force the labels to be spread horizontally - (FALSE) or vertically (TRUE). Defaults to whichever way the points are - most spread out.} - \item{offsets}{How far away from the data points to place the labels. - Defaults to one quarter of the plot span for all, staggered on each side.} - \item{between}{Whether to place the labels between two sets of points.} - \item{linecol}{Optional colors for the lines drawn to the points.} - \item{srt}{Rotation of the labels in degrees.} - \item{...}{additional arguments passed to \samp{text}.} -} -\details{ - This function is mainly useful when labeling irregularly spaced data points - that are "spread out" along one dimension. It places the labels regularly - spaced and staggered on the long dimension of the data, drawing lines from - each label to the point it describes. - - If \samp{between} is TRUE, the function expects two points for each label - and will attempt to place the labels between two vertical lines of points. - Lines will be drawn from the ends of each label to the two corresponding - points. - - If spreading labels horizontally, the user may wish to rotate the labels by - 90 degrees (\samp{srt=90}). If long labels run off the edge of the plot, - increase the \samp{xlim} for extra room. -} -\value{nil} -\author{Jim Lemon} -\references{ - Cooke, L.J. & Wardle, J. (2005) Age and gender differences in - children's food preferences. British Journal of Nutrition, 93: 741-746. -} -\seealso{\samp{text}, \samp{spread.lab (TeachingDemos)}} -\examples{ - # spread labels out in the x dimension using defaults - x<-sort(rnorm(10)) - y<-rnorm(10)/10 - plot(x,y,ylim=c(-1,1),type="p") - nums<-c("one","two","three","four","five","six","seven","eight","nine","ten") - spread.labels(x,y,nums) - # food preferences of children by sex (Cooke & Wardle, 2005) - fpkids<-data.frame(Food=c("Fatty/sugary","Fruit","Starchy","Meat", - "Proc.meat","Eggs","Fish","Dairy","Vegetables"), - Female=c(4.21,4.22,3.98,3.57,3.55,3.46,3.34,3.26,3.13), - Male=c(4.35,4.13,4.02,3.9,3.81,3.64,3.45,3.27,2.96)) - plot(rep(1,9),fpkids$Female,xlim=c(0.8,2.2), - ylim=range(c(fpkids$Female,fpkids$Male)),xlab="Sex",xaxt="n", - ylab="Preference rating",main="Children's food preferences by sex", - col="red") - axis(1,at=1:2,labels=c("Female","Male")) - points(rep(2,9),fpkids$Male,col="blue",pch=2) - spread.labels(rep(1:2,each=9),c(fpkids$Female,fpkids$Male), - fpkids$Food,between=TRUE,linecol=c("red","blue")) -} -\keyword{misc} diff --git a/man/spreadout.Rd b/man/spreadout.Rd deleted file mode 100644 index 49704af..0000000 --- a/man/spreadout.Rd +++ /dev/null @@ -1,38 +0,0 @@ -\name{spreadout} -\alias{spreadout} -\title{Spread out a vector of numbers to a minimum interval} -\description{ - Spread out a vector of numbers so that there is a minimum interval - between any two numbers when in ascending or descending order. -} -\usage{ - spreadout(x,mindist) -} -\arguments{ - \item{x}{A numeric vector which may contain NAs.} - \item{mindist}{The minimum interval between any two values when in ascending - or descending order.} -} -\details{ - \samp{spreadout} starts at or near the middle of the vector and increases the - intervals between the ordered values. NAs are preserved. \samp{spreadout} - first tries to spread groups of values with intervals less than \samp{mindist} - out neatly away from the mean of the group. If this doesn't entirely succeed, - a second pass that forces values away from the middle is performed. - - \samp{spreadout} is currently used to avoid overplotting of axis tick labels - where they may be close together. -} -\value{ - On success, the spread out values. If there are less than two valid - values, the original vector is returned. -} -\author{Jim Lemon} -\examples{ - spreadout(c(1,3,3,3,3,5),0.2) - spreadout(c(1,2.5,2.5,3.5,3.5,5),0.2) - spreadout(c(5,2.5,2.5,NA,3.5,1,3.5,NA),0.2) - # this will almost always invoke the brute force second pass - spreadout(rnorm(10),0.5) -} -\keyword{misc} diff --git a/man/stackpoly.Rd b/man/stackpoly.Rd deleted file mode 100644 index 1858e0c..0000000 --- a/man/stackpoly.Rd +++ /dev/null @@ -1,80 +0,0 @@ -\name{stackpoly} -\alias{stackpoly} -\title{ - Display the columns of a matrix or data frame as stacked polygons -} -\description{ - Plot one or more columns of numeric values as the top edges of polygons - instead of lines. -} -\usage{ - stackpoly(x,y=NULL,main="",xlab="",ylab="",xat=NA,xaxlab=NA, - xlim=NA,ylim=NA,lty=1,lwd=1,border=NA,col=NULL,staxx=FALSE,stack=FALSE, - axis2=TRUE,axis4=TRUE,padj=0,...) -} -\arguments{ - \item{x}{A numeric data frame or matrix with the \samp{x} values. If - \samp{y} is NULL, these will become the \samp{y} values and the \samp{x} - positions will be the integers from 1 to dim(x)[1].} - \item{y}{The \samp{y} values.} - \item{main}{The title for the plot.} - \item{xlab,ylab}{x and y axis labels for the plot.} - \item{xat}{Where to put the optional xaxlabs.} - \item{xaxlab}{Optional labels for the x positions.} - \item{xlim}{Optional x limits.} - \item{ylim}{Optional y limits.} - \item{lty}{Line type for the polygon borders.} - \item{lwd}{Line width for the polygon borders.} - \item{border}{Color for the polygon borders.} - \item{col}{Color to fill the polygons. If NULL, \samp{rainbow} will be - called to generate the colors. If NA, the polygons will not be filled.} - \item{staxx}{Whether to call \samp{staxlab} to stagger the x axis labels.} - \item{stack}{Whether to stack the successive values on top of each other.} - \item{axis2}{Whether to display the left ordinate on the plot.} - \item{axis4}{Whether to display the right ordinate on the plot.} - \item{padj}{Vertical justfication of the x axis labels, defaulting to "top". - Can be a vector with an element for each label.} - \item{...}{Additional arguments passed to \samp{plot}.} -} -\value{ - nil -} -\details{ - \samp{stackpoly} is similar to a line plot with the area under the - lines filled with color(s). Ideally, each successive set of y values - is greater than the values in the previous set so that the polygons - form a rising series of crests. If \samp{stack} is TRUE, this is not a - problem unless some values of \samp{x} are negative. - - If \samp{x} or \samp{y} is a vector, not a matrix or list, the values will - be displayed as a "waterfall plot". - - The options for \samp{axis2} and \samp{axis4} can be used to produce - panel plots. See the last example. -} -\author{Jim Lemon and Thomas Petzoldt (waterfall plot option) - thanks to - Phil Novack-Gottshall for the mismatched x and y fix} -\seealso{\link{polygon}} -\examples{ - testx<-matrix(abs(rnorm(100)),nrow=10) - stackpoly(matrix(cumsum(testx),nrow=10),main="Test Stackpoly I", - xaxlab=c("One","Two","Three","Four","Five", - "Six","Seven","Eight","Nine","Ten"),border="black",staxx=TRUE) - stackpoly(testx,main="Test Stackpoly II", - xaxlab=c("One","Two","Three","Four","Five", - "Six","Seven","Eight","Nine","Ten"),border="black", - staxx=TRUE,stack=TRUE) - layout(matrix(1:2,nrow=1)) - oldmar<-par(mar=c(5,4,4,0)) - stackpoly(rev(sort(testx-mean(testx))), - main="Waterfall Plot (x-mean)",xat=seq(10,90,by=10), - xlab="Index",ylab="Value",lwd=3,col="green",border="black", - axis4=FALSE) - ylim<-par("usr")[3:4] - par(mar=c(5,0,4,4)) - stackpoly(rev(sort((testx-mean(testx))/sd(as.vector(testx)))), - ylim=ylim,main="Waterfall Plot ((x-mean)/sd)",xat=seq(10,90,by=10), - xlab="Index",lwd=3,col="lightblue",border="black",axis2=FALSE) - par(oldmar) -} -\keyword{misc} diff --git a/man/staircase.plot.Rd b/man/staircase.plot.Rd deleted file mode 100644 index 2ab0008..0000000 --- a/man/staircase.plot.Rd +++ /dev/null @@ -1,75 +0,0 @@ -\name{staircase.plot} -\alias{staircase.plot} -\title{Display a staircase plot} -\description{ - Displays a plot showing a sequence of changing totals and increments as - successive linked bars. -} -\usage{ - staircase.plot(heights,totals=NA,labels=NULL,halfwidth=0.3,main="", - mar=NA,total.col="blue",inc.col=NA,bg.col=NA,direction="e",las=1, - display.height=TRUE,stagger=FALSE,cex=par("cex"),prefix="",suffix="",...) -} -\arguments{ - \item{heights}{vector of numeric values or a matrix or data frame with at least - two columns. The first column must be numeric and the second may be numeric or - logical.} - \item{totals}{A vector of logicals or zero/non-zero values indicating whether - the corresponding height is a total (TRUE) or an increment (FALSE).} - \item{labels}{An optional vector of labels for the bars.} - \item{halfwidth}{Half of the width of a bar as a proportion. See Details.} - \item{main}{A title for the plot.} - \item{mar}{Margins for the plot. Defaults to 10 on the baseline axis, 3 on the - top and 1 on the other two sides.} - \item{total.col}{Color(s) for the bars representing successive totals.} - \item{inc.col}{Color(s) for the bars representing increments.} - \item{bg.col}{The background color for the plot.} - \item{direction}{Direction in which the bars should be presented. See Details.} - \item{las}{Orientation for the bar labels. See \samp{par}.} - \item{display.height}{Whether to display the totals and increments at the upper - ends of the bars. Defaults to TRUE.} - \item{stagger}{Whether to stagger the labels to avoid overlap.} - \item{cex}{The usual character expansion value.} - \item{prefix}{A prefix to the numbers displayed next to the bars (e.g. $).} - \item{suffix}{A suffix as for prefix (e.g. \%).} - \item{...}{arguments passed to \samp{plot}.} -} -\value{nil} -\details{ - Displays a plot representing successive changes in counts or values. For example, - if a research study attempts to contact a certain number of people and some - cannot be contacted, some decline to participate, some are ineligible, the final - sample will be smaller than the initial contact list. The first value will be the - total of attempts, there will be a number of decrements, and the last value will - be the actual sample. There may be intermediate totals specified. This produces - a visual display of the sampling procedure. See the example. - - The bars are placed at integer values on the axis representing the succession of - counts or values. The width of the bars is determined by the argument - \samp{halfwidth}. This defaults to 0.3, meaning that the bar extends 0.3 to each - side, so that the proportion of bar to space is 0.6 to 0.4. The succession of - bars is determined by the \samp{direction} argument. The default is "e" (east), - meaning that the first bar is at the left of the plot and subsequent bars are - placed to the right. The other three possibilities follow the conventional - compass layout. - - The \samp{prefix} and \samp{suffix} arguments allow the user to specify units - for the numbers displayed next to the bars. If a single value is passed, all - numbers will get the same prefix or suffix. Different prefixes or suffixes for - each number can be passed as vectors. - - The \samp{getFigCtr} function is called to center the plot title in the figure - region as the plot area is typically off center. -} -\author{Jim Lemon} -\seealso{\link{plot}, \link{getFigCtr}} -\examples{ - sample_size<-c(500,-72,428,-94,334,-45,289) - totals<-c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE) - labels<-c("Contact list","Uncontactable","","Declined","","Ineligible", - "Final sample") - staircase.plot(sample_size,totals,labels, - main="Acquisition of the sample (staircase.plot)", - total.col="gray",inc.col=2:4,bg.col="#eeeebb",direction="s") -} -\keyword{misc} diff --git a/man/staircasePlot.Rd b/man/staircasePlot.Rd deleted file mode 100644 index 7543930..0000000 --- a/man/staircasePlot.Rd +++ /dev/null @@ -1,77 +0,0 @@ -\name{staircasePlot} -\alias{staircasePlot} -\title{Display a staircase plot} -\description{ - Displays a plot showing a sequence of changing totals and increments as - successive linked bars. -} -\usage{ - staircasePlot(heights,totals=NA,labels=NULL,halfwidth=0.3,main="",mar=NA, - stair.info=list(total.col="blue",inc.col=NA,border=par("fg")),bg.col=NA, - direction="e",las=1,display.height=TRUE,stagger=FALSE,cex=par("cex"), - prefix="",suffix="",...) -} -\arguments{ - \item{heights}{vector of numeric values or a matrix or data frame with at least - two columns. The first column must be numeric and the second may be numeric or - logical.} - \item{totals}{A vector of logicals or zero/non-zero values indicating whether - the corresponding height is a total (TRUE) or an increment (FALSE).} - \item{labels}{An optional vector of labels for the bars.} - \item{halfwidth}{Half of the width of a bar as a proportion. See Details.} - \item{main}{A title for the plot.} - \item{mar}{Margins for the plot. Defaults to 10 on the baseline axis, 3 on the - top and 1 on the other two sides.} - \item{stair.info}{A list of arguments for the bars including color(s) - for the bars representing successive totals, and increments and the - border color.} - \item{bg.col}{The background color for the plot.} - \item{direction}{Direction in which the bars should be presented. See Details.} - \item{las}{Orientation for the bar labels. See \samp{par}.} - \item{display.height}{Whether to display the totals and increments at the upper - ends of the bars. Defaults to TRUE.} - \item{stagger}{Whether to stagger the labels to avoid overlap.} - \item{cex}{The usual character expansion value.} - \item{prefix}{A prefix to the numbers displayed next to the bars (e.g. $).} - \item{suffix}{A suffix as for prefix (e.g. \%).} - \item{...}{arguments passed to \samp{plot}.} -} -\value{nil} -\details{ - Displays a plot representing successive changes in counts or values. For example, - if a research study attempts to contact a certain number of people and some - cannot be contacted, some decline to participate, some are ineligible, the final - sample will be smaller than the initial contact list. The first value will be the - total of attempts, there will be a number of decrements, and the last value will - be the actual sample. There may be intermediate totals specified. This produces - a visual display of the sampling procedure. See the example. - - The bars are placed at integer values on the axis representing the succession of - counts or values. The width of the bars is determined by the argument - \samp{halfwidth}. This defaults to 0.3, meaning that the bar extends 0.3 to each - side, so that the proportion of bar to space is 0.6 to 0.4. The succession of - bars is determined by the \samp{direction} argument. The default is "e" (east), - meaning that the first bar is at the left of the plot and subsequent bars are - placed to the right. The other three possibilities follow the conventional - compass layout. - - The \samp{prefix} and \samp{suffix} arguments allow the user to specify units - for the numbers displayed next to the bars. If a single value is passed, all - numbers will get the same prefix or suffix. Different prefixes or suffixes for - each number can be passed as vectors. - - The \samp{getFigCtr} function is called to center the plot title in the figure - region as the plot area is typically off center. -} -\author{Jim Lemon} -\seealso{\link{plot}, \link{getFigCtr}} -\examples{ - sample_size<-c(500,-72,428,-94,334,-45,289) - totals<-c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE) - labels<-c("Contact list","Uncontactable","","Declined","","Ineligible", - "Final sample") - staircasePlot(sample_size,totals,labels, - main="Acquisition of the sample (staircasePlot)", - total.col="gray",inc.col=2:4,bg.col="#eeeebb",direction="s") -} -\keyword{misc} diff --git a/man/starPie.Rd b/man/starPie.Rd deleted file mode 100644 index 32b654b..0000000 --- a/man/starPie.Rd +++ /dev/null @@ -1,68 +0,0 @@ -\name{starPie} -\alias{starPie} -\title{A pie-like graphic object} -\usage{ - starPie(x,y,radext,values,maxval=NA,border=par("fg"),col=NA,prop.area=FALSE, - label="",labelpos=1) -} -\description{ - Display a polygon with each sector proportional to a vector of numeric values. -} -\arguments{ - \item{x,y}{The coordinate position for the center of the starPie.} - \item{radext}{The maximum distance from the center of the starPie to one vertex of - the polygon.} - \item{values}{A vector of numeric values.} - \item{maxval}{A maximum value for scaling the values to the radius. If NA, the - maximum value in \samp{values} will be used.} - \item{border}{The color to use for the borders of the polygon sectors.} - \item{col}{The color(s) to use for the fills of the polygon.} - \item{prop.area}{Whether to scale the values to the area (TRUE) or the - radial extent (FALSE) of the polygon sectors.} - \item{label}{Optional text labels for the starPies.} - \item{labelpos}{Positions of the labels relative to the starPies.} -} -\value{nil} -\details{ - \samp{starPie} displays a polygon centered on the \samp{x,y} position having - sectors of equal angular extent. The radial extent of each sector - is proportional to the values in the numeric vector \samp{lengths}. If the - \samp{prop.area} argument is TRUE, the proportion is based on the area of the - sector, and if \samp{prop.area} is FALSE, the proportion is on the radial extent. - As the function is intended to exaggerate the differences between different - starPies, the default produces sectors proportional to the squares of the - \samp{lengths}. - - \samp{starPie} is intended to display a visual analog of the relative value of - matched attributes of a number of similar objects or groups. Thus objects having - similar attributes will produce similar looking starPies. When constructing such - a matrix, it is necessary for \samp{maxval} to be specified, usually as the - overall maximum value in any of the attribute value vectors. If \samp{maxval} is - not specified in such a situation, only the relative values within each vector - will determine the radial extents of each starPie. There appears to be no reason - to have different sector colors for different objects, but the user can display - more than one set of starPies on a plot with different sector colors if - necessary. - - \samp{starPie} calls \samp{getYmult} to automatically adjust for both the aspect - and coordinate ratio of the plot. -} -\author{Jim Lemon} -\examples{ - date_mat<-data.frame(sex=rep(c("M","F"),each=10), - names=c("Abe","Bob","Col","Dave","Eddie","Frank","Geoff","Harry","Igor","Jack", - "Alice","Betty","Clare","Dora","Eva","Fran","Grace","Hilda","Iris","Joan"), - eating=sample(0:100,20),dancing=sample(0:100,20),movies=sample(0:100,20), - reading=sample(0:100,20),travel=sample(0:100,20)) - plot(0,xlim=c(0.5,10.5),ylim=c(0,3),type="n",axes=FALSE,xlab="",ylab="Sex", - main="Date matching matrix") - par(xpd=TRUE) - legend(0.7,-0.3,c("Eat out","Dance","Movies","Read","Travel"),fill=rainbow(5), - ncol=5) - par(xpd=FALSE) - box() - axis(2,at=c(0.9,2.4),labels=c("Male","Female")) - starPie(x=rep(1:10,2),y=rep(c(0.9,2.4),each=10),radext=0.5, - values=as.matrix(date_mat[,3:7]),label=as.character(date_mat[["names"]])) -} -\keyword{misc} diff --git a/man/staxlab.Rd b/man/staxlab.Rd deleted file mode 100644 index 6b0ae22..0000000 --- a/man/staxlab.Rd +++ /dev/null @@ -1,51 +0,0 @@ -\name{staxlab} -\alias{staxlab} -\title{ Place staggered or angled labels on an axis } -\description{ - Places labels on an axis in a regular staggered order or at an angle -} -\usage{ - staxlab(side=1,at,labels,nlines=2,top.line=0.5,line.spacing=0.8, - srt=NULL,ticklen=0.03,adj=1,...) -} -\arguments{ - \item{side}{axis on which to place the labels, as in \samp{axis}} - \item{at}{where to place the labels in user units, as in \samp{axis}} - \item{labels}{text strings} - \item{nlines}{How many lines to use to stagger the labels.} - \item{top.line}{Distance from the axis to place the first line of text.} - \item{line.spacing}{Spacing between lines of text labels.} - \item{srt}{Text rotation.} - \item{ticklen}{Proportion of plot height in user units to place text - below the plot.} - \item{adj}{horizontal adjustment of the labels.} - \item{...}{Additional arguments to be passed to \samp{mtext} or \samp{text}.} -} -\note{ - This function is mainly useful when either long axis labels or a large - number of labels are to be placed without overlapping. It staggers the - labels along the axis specified. The user may wish to increase the space - beneath the plot using \samp{mar} before calling \samp{staxlab}. It is - probably only useful on the bottom or left side of the plot. - - If \samp{srt} is not NULL, the labels will be rotated \samp{srt} degrees - and placed below the plot. This method will only place labels at the - bottom. Note that this option only works on the lower and left axes. -} -\value{nil} -\author{Jim Lemon (thanks to Tim Elwell-Sutton for the log axis fix)} -\seealso{\link{mtext}} -\examples{ - x<-rnorm(12) - plot(x,axes=FALSE) - box() - months<-c("January","February","March","April","May","June", - "July","August","September","October","November","December") - staxlab(1,1:12,months) - plot(x,axes=FALSE) - box() - staxlab(1,1:12,months,srt=45) - ylabels<-round(seq(min(x),max(x),length.out=10),3) - staxlab(2,ylabels,ylabels,srt=45) -} -\keyword{misc} diff --git a/man/std.error.Rd b/man/std.error.Rd deleted file mode 100644 index 4b5f578..0000000 --- a/man/std.error.Rd +++ /dev/null @@ -1,22 +0,0 @@ -\name{std.error} -\alias{std.error} -\title{Calculate standard error of the mean} -\description{ - Calculates the standard error of the mean. -} -\usage{ - std.error(x,na.rm) -} -\arguments{ - \item{x}{A vector of numerical observations.} - \item{na.rm}{Dummy argument to match other functions.} -} -\details{ - \samp{std.error} will accept a numeric vector. -} -\value{ - The conventional standard error of the mean = sd(x)/sqrt(sum(!is.na(x))) -} -\author{Jim Lemon} -\seealso{\link{sd}} -\keyword{misc} diff --git a/man/sumbrk.Rd b/man/sumbrk.Rd deleted file mode 100644 index e7f19cd..0000000 --- a/man/sumbrk.Rd +++ /dev/null @@ -1,26 +0,0 @@ -\name{sumbrk} -\alias{sumbrk} -\title{Count specified values in a vector} -\description{ - Counts the number of values in a vector that are equal to a specified value. -} -\usage{ - sumbrk(x,trueval=TRUE,na.rm=TRUE) -} -\arguments{ - \item{x}{a character, factor or numeric vector.} - \item{trueval}{the value to be matched in \samp{x}.} - \item{na.rm}{whether to remove NA values.} -} -\details{ - \samp{sumbrk} counts the values in \samp{x} matching a specified value. - It is mainly to allow these sums to be calculated in the \samp{brkdnNest} - function. -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{brkdnNest}} -\examples{ - sumbrk(sample(LETTERS,100,TRUE),trueval="M") -} -\keyword{misc} diff --git a/man/symbolbarplot.Rd b/man/symbolbarplot.Rd deleted file mode 100644 index 8e819cf..0000000 --- a/man/symbolbarplot.Rd +++ /dev/null @@ -1,51 +0,0 @@ -\name{symbolbarplot} -\alias{symbolbarplot} -\title{barplot filled with symbols} -\description{ - Produces a barplot where each piece of the barplot is filled with the - number of symbols equal to the size of the bar -} -\usage{ - symbolbarplot(height,width=1,space=NULL,names.arg=NULL, - legend.text=NULL,beside=FALSE,horiz=FALSE,col=heat.colors(NR), - border=par("fg"),main=NULL,sub=NULL,xlab=NULL,ylab=NULL,xlim=NULL, - ylim=NULL,axes=TRUE,axisnames=TRUE,inside=TRUE,plot=TRUE,rel.width=0.8, - symbol="circles",symbbox=TRUE,debug=FALSE,...) -} -\arguments{ - \item{height}{numeric vector or matrix of barplot heights} - \item{width}{width of bars} - \item{space}{space between bars} - \item{names.arg}{vector of names} - \item{legend.text}{vector of legend text} - \item{beside}{(logical) plot bars beside each other?} - \item{horiz}{(logical) horizontal barplot?} - \item{col}{vector of colors} - \item{border}{plot border?} - \item{main}{main title} - \item{sub}{subtitle} - \item{xlab}{x axis label} - \item{ylab}{y axis label} - \item{xlim}{x limits} - \item{ylim}{y limits} - \item{axes}{draw axes?} - \item{axisnames}{label horizontal axis?} - \item{inside}{draw lines dividing adjacent bars?} - \item{plot}{produce plot?} - \item{rel.width}{relative width of symbols} - \item{symbol}{which symbol to use} - \item{symbbox}{draw boxes for symbol boxes?} - \item{debug}{debug output?} - \item{\dots}{further arguments to multsymbolbox} -} -\value{ - Nil -} -\note{This is a mostly a hack of barplot()} -\author{Ben Bolker} -\examples{ - set.seed(1001) - bvals <- matrix(rpois(12,20),nrow=3) - b <- symbolbarplot(bvals) -} -\keyword{hplot} diff --git a/man/symbolbox.Rd b/man/symbolbox.Rd deleted file mode 100644 index 30c4867..0000000 --- a/man/symbolbox.Rd +++ /dev/null @@ -1,39 +0,0 @@ -\name{symbolbox} -\alias{symbolbox} -\title{Draw a box filled with symbols} -\description{ - Draws a box on the current figure that is filled with symbols - representing individual counts -} -\usage{ - symbolbox(x1,y1,x2,y2,tot,relw=0.5,fg=par("fg"),bg=par("bg"),box=TRUE, - debug = TRUE,...) -} -\arguments{ - \item{x1}{left side of box} - \item{y1}{bottom side of box} - \item{x2}{right side of box} - \item{y2}{top side of box} - \item{tot}{total number of symbols to put in the box} - \item{relw}{relative width (relative to height) of symbols} - \item{fg}{foreground color} - \item{bg}{background color} - \item{box}{(logical) draw box border?} - \item{debug}{debug output?} - \item{\dots}{additional arguments to polygon() for drawing box} -} -\details{ - tries to automatically figure out appropriate scaling to fit symbols - into the box -} -\value{ - none; draws on the current figure -} -\author{Ben Bolker} -\seealso{\link{multsymbolbox}} -\examples{ - plot(1:10,1:10,type="n") - symbolbox(2,5,3,7,tot=20) - symbolbox(6,2,10,6,tot=50,fg="blue",bg="magenta") -} -\keyword{aplot} diff --git a/man/tab.title.Rd b/man/tab.title.Rd deleted file mode 100644 index e6e21a5..0000000 --- a/man/tab.title.Rd +++ /dev/null @@ -1,42 +0,0 @@ -\name{tab.title} -\alias{tab.title} -\title{ - Display the title of a plot as a colored tab -} -\description{ - Display the title of a plot as a colored tab. -} -\usage{ - tab.title(label,text.col=par("fg"),tab.col=par("bg"),border=par("fg"), - lwd=par("lwd"),cex=1.5,pad.mult=1.6,radius=0) -} -\arguments{ - \item{label}{The title for the plot.} - \item{text.col}{The color for the title text.} - \item{tab.col}{The color for the tab fill.} - \item{border}{The color for the tab border.} - \item{lwd}{The line width for the border.} - \item{cex}{Character expansion for the title.} - \item{pad.mult}{How much higher to make the tab relative to the label.} - \item{radius}{What proportion of the tab corners to round off.} -} -\value{ - nil -} -\details{ - \samp{tab.title} displays the plot title in a colored tab. The tab can be - rounded at the upper corners by specifying the proportion of the tab - height to be rounded as a number between 0 and 1. If the tab is too high - to fit on the figure region, a warning will be displayed and the tab will - still be shown. -} -\author{Jim Lemon} -\seealso{\link{polygon}} -\examples{ - testx<-matrix(cumsum(rnorm(30)^2)+1,nrow=10) - stackpoly(testx,main="", - xaxlab=c("One","Two","Three","Four","Five", - "Six","Seven","Eight","Nine","Ten"),staxx=TRUE) - tab.title("Three Squiggly Lines",tab.col="yellow",radius=0.5) -} -\keyword{misc} diff --git a/man/taylor.diagram.Rd b/man/taylor.diagram.Rd deleted file mode 100644 index 5a1f029..0000000 --- a/man/taylor.diagram.Rd +++ /dev/null @@ -1,93 +0,0 @@ -\name{taylor.diagram} -\alias{taylor.diagram} -\title{ Taylor diagram } -\description{ Display a Taylor diagram} -\usage{ - taylor.diagram(ref,model,add=FALSE,col="red",pch=19,pos.cor=TRUE, - xlab="Standard deviation",ylab="",main="Taylor Diagram", - show.gamma=TRUE,ngamma=3,gamma.col=8,sd.arcs=0, - ref.sd=FALSE,sd.method="sample",grad.corr.lines=c(0.2,0.4,0.6,0.8,0.9), - pcex=1,cex.axis=1,normalize=FALSE,mar=c(4,3,4,3),...) -} -\arguments{ - \item{ref}{numeric vector - the reference values.} - \item{model}{numeric vector - the predicted model values.} - \item{add}{whether to draw the diagram or just add a point.} - \item{col}{the color for the points displayed.} - \item{pch}{the type of point to display.} - \item{pos.cor}{whether to display only positive (\samp{TRUE}) or all - values of correlation (\samp{FALSE}).} - \item{xlab,ylab}{plot axis labels.} - \item{main}{title for the plot.} - \item{show.gamma}{whether to display standard deviation arcs around - the reference point (only for \samp{pos.cor=TRUE}).} - \item{ngamma}{the number of gammas to display (default=3).} - \item{gamma.col}{color to use for the gamma arcs (only with pos.cor=TRUE).} - \item{sd.arcs}{whether to display arcs along the standard deviation axes - (see Details).} - \item{ref.sd}{whether to display the arc representing the reference - standard deviation.} - \item{sd.method}{Whether to use the sample or estimated population SD.} - \item{grad.corr.lines}{the values for the radial lines for correlation - values (see Details).} - \item{pcex}{character expansion for the plotted points.} - \item{cex.axis}{character expansion for the axis text.} - \item{normalize}{whether to normalize the models so that the reference - has a standard deviation of 1.} - \item{mar}{margins - only applies to the \samp{pos.cor=TRUE} plot.} - \item{...}{Additional arguments passed to \samp{plot}.} -} -\details{ - The Taylor diagram is used to display the quality of model predictions - against the reference values, typically direct observations. - - A diagram is built by plotting one model against the reference, - then adding alternative model points. If \samp{normalize=TRUE} - when plotting the first model, remember to set it to \samp{TRUE} - when plotting additional models. - - Two displays are available. One displays the entire range of correlations - from -1 to 1. Setting \samp{pos.cor} to \samp{FALSE} will produce this - display. The -1 to 1 display includes a radial grid for the correlation - values. When \samp{pos.cor} is set to \samp{TRUE}, only the - range from 0 to 1 will be displayed. The \samp{gamma} lines and the arc at - the reference standard deviation are optional in this display. - - Both the standard deviation arcs and the gamma lines are optional in the - \samp{pos.cor=TRUE} version. Setting \samp{sd.arcs} or \samp{grad.corr.lines} - to zero or FALSE will cause them not to be displayed. If more than one value is - passed for \samp{sd.arcs}, the function will try to use the values passed, - otherwise it will call \samp{pretty} to calculate the values. -} -\value{ - The values of \samp{par} that preceded the function. This allows the - user to add points to the diagram, then restore the original values. This - is only necessary when using the 0 to 1 correlation range. -} -\references{ - Taylor, K.E. (2001) Summarizing multiple aspects of model performance in a - single diagram. Journal of Geophysical Research, 106: 7183-7192. -} -\author{Olivier Eterradossi with modifications by Jim Lemon} -\examples{ - # fake some reference data - ref<-rnorm(30,sd=2) - # add a little noise - model1<-ref+rnorm(30)/2 - # add more noise - model2<-ref+rnorm(30) - # display the diagram with the better model - oldpar<-taylor.diagram(ref,model1) - # now add the worse model - taylor.diagram(ref,model2,add=TRUE,col="blue") - # get approximate legend position - lpos<-1.5*sd(ref) - # add a legend - legend(lpos,lpos,legend=c("Better","Worse"),pch=19,col=c("red","blue")) - # now restore par values - par(oldpar) - # show the "all correlation" display - taylor.diagram(ref,model1,pos.cor=FALSE) - taylor.diagram(ref,model2,add=TRUE,col="blue") -} -\keyword{misc} diff --git a/man/textbox.Rd b/man/textbox.Rd deleted file mode 100755 index b9af0ec..0000000 --- a/man/textbox.Rd +++ /dev/null @@ -1,67 +0,0 @@ -\name{textbox} -\alias{textbox} -\title{Add text box} -\description{ - Add text to plot, justified, in a box -} -\usage{ - textbox(x, y, textlist, justify=c('l','c','r'), cex=1, leading=0.5, box=TRUE, - adj=c(0,0), font=NULL, vfont=NULL, col=NULL, border=NULL, fill=NA, density=NULL, - angle=45, lty=par("lty"), lwd=par("lwd"), margin=0) -} -\arguments{ - \item{x}{x position: a vector with min. and max. x-position} - \item{y}{y position: location of the top of the box} - \item{textlist}{a vector of text strings} - \item{justify}{x alignment: 'l'=left, 'c'=center, 'r'=right.} - \item{cex}{character expansion} - \item{leading}{inter-line spacing} - \item{box}{whether to draw a box around the text} - \item{adj}{adjustment for x and y position, default is no adjustment, - see Details} - \item{font}{text font, see Details} - \item{vfont}{text font, see Details} - \item{col}{text color} - \item{border}{box border color} - \item{fill}{box fill color} - \item{density}{box shading line density, see Details} - \item{angle}{box shading line angle, see Details} - \item{lty}{box border and shading line types, see Details} - \item{lwd}{box border and shading line width, see Details} - \item{margin}{amount to adjust box border in or out. See Details} -} -\details{ - Draws text in the box by pasting the textlist vector together, splitting it - into words, and then adding words to the current line until the line is wide - enough before moving on to the next line. - - \samp{margin} may be a vector of 1, 2, or 4 values, corresponding to - adjustment of all borders (1 value), top/bottom and left/right borders - (2 values), or bottom/left/top/right borders (4 values). A positive value - moves text inwards from specified (x,y) position with border remaining at (x,y), - and a negative value moves the border outwards from (x,y) with the text - remaining at (x,y). - - The \samp{density} and \samp{angle} arguments have the same behavior as in the - \samp{rect} function. The \samp{adj, font} and \samp{vfont} arguments have the same - behavior as in the \samp{text} function. The \samp{lty} and \samp{lwd} - arguments have the same behavior as in the \samp{lines} function. -} -\value{ - y-position of bottom line of box, or y-position of next line if there is no box. -} -\author{Ben Bolker. Improvements by Ted Toal.} -\examples{ - plot.new() - textbox(c(0,0.2), 1, c("many words","more words","why not?", - "keep going",rep("and going",10))) - textbox(c(0.3,0.5), 1, c("keep going",rep("and going",10)), cex=0.45, - col="blue", border="red", fill="#00FFEE80", density=25, angle=60) - textbox(c(0.6,0.8), 1, c("keep going",rep("and going",10)), justify='c', cex=0.6, - leading=1, font=4, border="gold", lty=2, lwd=4, margin=0.025) - textbox(c(0.6,0.8), 0.5, c("keep going",rep("and going",10)), justify='r', cex=0.7, - col="purple", font=3, border="green", margin=-0.025) - lines(c(0,1), c(1,1), col="red", lty=2) - lines(c(0,1), c(0.5,0.5), col="red", lty=2) -} -\keyword{aplot} diff --git a/man/thigmophobe.Rd b/man/thigmophobe.Rd deleted file mode 100644 index 94791c4..0000000 --- a/man/thigmophobe.Rd +++ /dev/null @@ -1,43 +0,0 @@ -\name{thigmophobe} -\alias{thigmophobe} -\title{Find the direction away from the closest point} -\description{Find the direction away from the closest point} -\usage{ - thigmophobe(x,y=NULL,names=seq_along(z),xlog=par("xlog"),ylog=par("ylog"), - usr=par("usr"),pin=par("pin"),eps=.Machine$double.eps,pi=base::pi) -} -\arguments{ - \item{x,y}{Numeric data vectors. Typically the x/y coordinates of - plotted points. If arrays are passed, they will be silently coerced to - numeric vectors.} - \item{names}{Names for the vector of directions.} - \item{xlog,ylog}{Flags for logarithmic axes. See Note.} - \item{usr}{The extent of the plot in user units.} - \item{pin}{Extent of the plot in inches.} - \item{eps}{smallest number that can be represented on the system.} - \item{pi}{value of pi.} -} -\details{ - \samp{thigmophobe} returns the direction (as 1|2|3|4 - see pos= in - \samp{text}) away from the nearest point to each of the points - described by \samp{x} and \samp{y}. -} -\note{ - \samp{thigmophobe} is typically used to get the offsets to automatically - place labels on a scatterplot or similar using \samp{thigmophobe.labels} - to avoid overlapping labels. The name means "one who fears being touched". - - The \samp{plot.span}, \samp{xlog} and \samp{ylog} arguments were added to - allow \samp{thigmophobe} to be used outside of base graphics. -} -\value{ - A vector of directions away from the point nearest to each point. -} -\keyword{misc} -\author{Bill Venables} -\seealso{\link{thigmophobe.labels}} -\examples{ - x<-rnorm(10) - y<-rnorm(10) - thigmophobe(x,y) -} diff --git a/man/thigmophobe.labels.Rd b/man/thigmophobe.labels.Rd deleted file mode 100755 index ff0f88b..0000000 --- a/man/thigmophobe.labels.Rd +++ /dev/null @@ -1,66 +0,0 @@ -\name{thigmophobe.labels} -\title{Place labels away from the nearest point} -\usage{ - thigmophobe.labels(x,y,labels=NULL,text.pos=NULL,...) -} -\alias{thigmophobe.labels} -\arguments{ - \item{x,y}{Numeric data vectors or a list with two components. - Typically the x/y coordinates of plotted points.} - \item{labels}{A vector of strings that will be placed adjacent to - each point. Defaults to the indices of the coordinates.} - \item{text.pos}{An optional vector of text positions (see - \link{text}).} - \item{...}{additional arguments are passed to \samp{text}}. -} -\description{ - \samp{thigmophobe.labels} places labels adjacent to each point, - offsetting each label in the direction returned by - \samp{thigmophobe}. -} -\details{ - Typically used to automatically place labels on a scatterplot or - similar to avoid overlapping labels. \samp{thigmophobe.labels} - will sometimes place a label off the plot or fail to separate - labels in clusters of points. The user can manually adjust the - errant labels by running \samp{thigmophobe} first and saving - the returned vector. Then modify the position values to place - the labels properly and pass the edited vector to - \samp{thigmophobe.labels} as the \samp{text.pos} argument. This - takes precedence over the positions calculated by \samp{thigmophobe}. - - \samp{thigmophobe} will fail with only two labels, as it can't figure out - the nearest neighbors. If you really want to use this with two labels, just - eyeball the plot and work out in which direction the labels will go. Then - pass the directions to \samp{thigmophobe.labels} as the \samp{text.pos} - argument. When all else fails, look to \samp{placeLabels}. - - Both \samp{pointLabel} in the \pkg{maptools} package and \samp{spread.labs} - in the \pkg{TeachingDemos} package use more sophisticated algorithms to - place the labels and are worth a try if \samp{thigmophobe} just won't get it - right. -} -\value{ - A vector of directions away from the point nearest to each point. -} -\keyword{misc} -\author{Jim Lemon (thanks to Stephen Milborrow for finding the single point bug - and Erik Aronesty for finding the two point problem.)} -\seealso{\link{thigmophobe}, \link{text}} -\examples{ - x<-rnorm(20) - y<-rnorm(20) - xlim<-range(x) - xspace<-(xlim[2]-xlim[1])/20 - xlim<-c(xlim[1]-xspace,xlim[2]+xspace) - ylim<-range(y) - yspace<-(ylim[2]-ylim[1])/20 - ylim<-c(ylim[1]-yspace,ylim[2]+yspace) - plotlabels<- - c("one","two","three","four","five","six","seven","eight","nine","ten", - "eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen", - "eighteen","nineteen","twenty") - plot(x=x,y=y,xlim=xlim,ylim=ylim,main="Test thigmophobe.labels") - # skip the almost invisible yellow label, make them bold - thigmophobe.labels(x,y,plotlabels,col=c(2:6,8:12),font=2) -} diff --git a/man/triax.abline.Rd b/man/triax.abline.Rd deleted file mode 100644 index c9a9cdc..0000000 --- a/man/triax.abline.Rd +++ /dev/null @@ -1,42 +0,0 @@ -\name{triax.abline} -\alias{triax.abline} -\title{Lines for triangle plot} -\description{ - Display lines on a triangle plot. -} -\usage{ - triax.abline(b=NULL,r=NULL,l=NULL,col=par("col"),lty=par("lty"), - cc.axes=FALSE) -} -\arguments{ - \item{b}{Lines relating to the bottom axis.} - \item{r}{Lines relating to the right axis.} - \item{l}{Lines relating to the left axis.} - \item{col}{Color(s) of the lines.} - \item{lty}{Type(s) of the lines.} - \item{cc.axes}{Clockwise/counterclockwise axes and ticks.} -} -\details{ - \samp{triax.abline} displays one or more lines on a triangle plot. Lines - are oriented in the conventional way, horizontal for the left axis, - slanting up to the right for the right axis and up to the left for the - bottom axis. If \samp{cc.axes} is TRUE, the orientation is up-left for - the left axis, horizontal for the right axis and up-right for the bottom - axis. - - Remember to call \samp{triax.plot} with \samp{no.add=FALSE} and restore - the graphics parameters as in the example or the lines will not be - placed properly. -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{triax.plot}} -\examples{ - triax.return<-triax.plot(data.frame(bottom=0.4,right=0.3,left=0.3), - main="Triax ablines",no.add=FALSE) - triax.abline(l=0.3,col="red") - triax.abline(r=0.3,col="green") - triax.abline(b=0.4,col="blue") - par(triax.return$oldpar) -} -\keyword{misc} diff --git a/man/triax.fill.Rd b/man/triax.fill.Rd deleted file mode 100644 index cbe2232..0000000 --- a/man/triax.fill.Rd +++ /dev/null @@ -1,40 +0,0 @@ -\name{triax.fill} -\alias{triax.fill} -\title{Triangle plot fill} -\description{ - Fill a triangle plot with smaller triangles. -} -\usage{ - triax.fill(col) -} -\arguments{ - \item{col}{List of colors (see Details).} -} -\details{ - In order for \samp{triax.fill} to fill an existing plot that has - been created by a call to \samp{triax.plot}, the user must supply - a list of fill colors. The first element of the list must begin with - at least one value that can be interpreted as a color. The second - element must begin with at least three such values, and so on, adding - two values for each element of the list. Each list element will be - displayed as a row of colored triangles starting at the top of the - plot. The number of elements in the list determines the number of - rows that will be displayed. -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{triax.plot},\link{color.scale}} -\examples{ - # the data will be something like response at different proportions - fillval<-list(0,c(0,0.1,0),c(0,0.1,0.2,0.1,0), - c(0,0.1,0.2,0.3,0.2,0.1,0),c(0,0.1,0.2,0.3,0.4,0.3,0.2,0.1,0), - c(0,0.1,0.2,0.3,0.4,0.5,0.4,0.3,0.2,0.1,0), - c(0,0,0.1,0.2,0.3,0.4,0.5,0.4,0.3,0.2,0.1,0,0), - c(0,0,0,0.1,0.1,0.2,0.3,0.4,0.3,0.2,0.1,0.1,0,0,0)) - # use some method of converting values to colors - fillcol<-sapply(fillval,function(x) {x*10+1} ) - oldpar<-triax.plot(main="Test of triax.fill function") - triax.fill(fillcol) - par(oldpar) -} -\keyword{misc} diff --git a/man/triax.frame.Rd b/man/triax.frame.Rd deleted file mode 100644 index 76cfd45..0000000 --- a/man/triax.frame.Rd +++ /dev/null @@ -1,42 +0,0 @@ -\name{triax.frame} -\alias{triax.frame} -\title{Triangle plot frame} -\description{ - Display a three axis frame with optional grid. -} -\usage{ - triax.frame(at=seq(0.1,0.9,by=0.1),axis.labels=NULL, - tick.labels=NULL,col.axis="black",cex.axis=1,cex.ticks=1, - align.labels=TRUE,show.grid=FALSE,col.grid="gray",lty.grid=par("lty"), - cc.axes=FALSE) -} -\arguments{ - \item{at}{The tick positions on the three axes.} - \item{axis.labels}{Labels for the three axes in the order bottom, right - left. Defaults to the column names.} - \item{tick.labels}{The tick labels for the axes. - Defaults to argument \samp{at} (proportions).} - \item{col.axis}{Color of the triangular axes, ticks and labels.} - \item{cex.axis}{Character expansion for axis labels.} - \item{cex.ticks}{Character expansion for the tick labels.} - \item{align.labels}{Logical - whether to align axis and tick labels with - the axes.} - \item{show.grid}{Whether to display grid lines at the ticks.} - \item{col.grid}{Color of the grid lines. Defaults to gray.} - \item{lty.grid}{Type of line for the grid.} - \item{cc.axes}{Whether to align the axes clockwise or counterclockwise.} -} -\details{ - \samp{triax.frame} displays a triangular plot area on which proportions - or percentages may be displayed. An optional grid may also be displayed. - If \samp{cc.axes} is TRUE, both the axes and axis ticks will be in - reverse order. -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{triax.points},\link{triax.abline},\link{triax.fill}} -\examples{ - triax.plot(main="DEFAULT") - triax.plot(main="Clockwise axes",cc.axes=TRUE) -} -\keyword{misc} diff --git a/man/triax.plot.Rd b/man/triax.plot.Rd deleted file mode 100644 index edc2ddd..0000000 --- a/man/triax.plot.Rd +++ /dev/null @@ -1,89 +0,0 @@ -\name{triax.plot} -\alias{triax.plot} -\title{Triangle plot} -\description{ - Display a triangle plot with optional grid. -} -\usage{ - triax.plot(x=NULL,main="",at=seq(0.1,0.9,by=0.1), - axis.labels=NULL,tick.labels=NULL,col.axis="black",cex.axis=1, - cex.ticks=1, - align.labels=TRUE,show.grid=FALSE,col.grid="gray",lty.grid=par("lty"), - cc.axes=FALSE,show.legend=FALSE,label.points=FALSE,point.labels=NULL, - col.symbols="black",pch=par("pch"),mar=c(5,2,4,2),no.add=TRUE,...) -} -\arguments{ - \item{x}{Matrix where each row is three proportions or percentages - that must sum to 1 or 100 respectively.} - \item{main}{The title of the triangle plot. Defaults to nothing.} - \item{at}{The tick positions on the three axes.} - \item{axis.labels}{Labels for the three axes in the order left, right, - bottom. Defaults to the column names.} - \item{tick.labels}{The tick labels for the three axes as a list with - three components l, r and b (left, right and bottom). - Defaults to argument \samp{at} (proportions).} - \item{col.axis}{Color of the triangular axes, ticks and labels.} - \item{cex.axis}{Character expansion for axis labels.} - \item{cex.ticks}{Character expansion for the tick labels.} - \item{align.labels}{Logical - whether to align axis and tick labels with - the axes.} - \item{show.grid}{Whether to display grid lines at the ticks.} - \item{col.grid}{Color of the grid lines. Defaults to gray.} - \item{lty.grid}{Type of line for the grid.} - \item{cc.axes}{Whether axes and axis ticks should be clockwise or - counterclockwise.} - \item{show.legend}{Logical - whether to display a legend.} - \item{label.points}{Logical - whether to call \samp{thigmophobe.labels} to - label the points.} - \item{point.labels}{Optional labels for the points and/or legend.} - \item{col.symbols}{Color of the symbols representing each value.} - \item{pch}{Symbols to use in plotting values.} - \item{mar}{Margins for the triangle plot.} - \item{no.add}{Whether to restore the previous plotting parameters - (\samp{TRUE}) or leave them, allowing more points to be added.} - \item{...}{Additional arguments passed to \samp{points}.} -} -\details{ - \samp{triax.plot} displays a triangular plot area on which proportions - or percentages are displayed. A grid or legend may also be displayed. -} -\note{ - A three axis plot can only properly display one or more - sets of three proportions that each sum to 1 (or percentages that sum - to 100). Other values may be scaled to proportions (or percentages), - but unless each set of three sums to 1 (or 100), they will not plot - properly and \samp{triax.points} will complain appropriately. Note also - that \samp{triax.plot} will only display properly in a square plot, - which is forced by \samp{par(pty="s")}. - - In case the user does want to plot values with different sums, the - axis tick labels can be set to different ranges to accomodate this. - \samp{triax.points} will still complain, but it will plot the values. - - If planning to add points with \samp{triax.points} call \samp{triax.plot} - with \samp{no.add=FALSE} and restore plotting parameters after the - points are added. -} -\value{ - A list containing \samp{xypos} (the \samp{x,y} positions plotted) - and \samp{oldpar} (the plotting parameters at the time \samp{triax.plot} - was called). -} -\author{ - Jim Lemon - thanks to Ben Daughtry for the info on counterclockwise axes. -} -\seealso{ - \link{triax.points}, \link{triax.abline}, \link{thigmophobe.labels} -} -\examples{ - data(soils) - triax.plot(soils[1:10,],main="DEFAULT") - triax.plot(soils[1:10,],main="PERCENTAGES (Counterclockwise axes)", - tick.labels=list(l=seq(10,90,by=10),r=seq(10,90,by=10),b=seq(10,90,by=10)), - pch=3,cc.axes=TRUE) - triax.return<-triax.plot(soils[1:6,],main="GRID AND LEGEND", - show.grid=TRUE,show.legend=TRUE,col.symbols=1:6,pch=4) - # triax.plot changes a few parameters - par(triax.return$oldpar) -} -\keyword{misc} diff --git a/man/triax.points.Rd b/man/triax.points.Rd deleted file mode 100644 index 485a54d..0000000 --- a/man/triax.points.Rd +++ /dev/null @@ -1,48 +0,0 @@ -\name{triax.points} -\alias{triax.points} -\title{Triangle plot points} -\description{ - Display points on a triangle plot. -} -\usage{ - triax.points(x,show.legend=FALSE,label.points=FALSE, - point.labels=NULL,col.symbols=par("fg"),pch=par("pch"), - bg.symbols=par("bg"),cc.axes=FALSE,...) -} -\arguments{ - \item{x}{Matrix or data frame where each row is three proportions or - percentages that must sum to 1 or 100 respectively.} - \item{show.legend}{Logical - whether to display a legend.} - \item{label.points}{Logical - whether to call \samp{thigmophobe.labels} - to label the points.} - \item{point.labels}{Optional labels for the points and/or legend.} - \item{col.symbols}{Color of the symbols representing each value.} - \item{pch}{Symbols to use in plotting values.} - \item{bg.symbols}{Background color for plotting symbols.} - \item{cc.axes}{Clockwise or counterclockwise axes and ticks.} - \item{...}{Additional arguments passed to \samp{points}.} -} -\details{ - In order for \samp{triax.points} to add points to an existing plot, - the argument \samp{no.add} in the initial call to \samp{triax.plot} - must be set to \samp{FALSE}. Failing to do this will result in the - points being plotted in the wrong places. It is then up to the user - to call \samp{par} as in the example below to restore plotting - parameters altered during the triangle plot. - - \samp{triax.points} displays each triplet of proportions or percentages - as a symbol on the triangle plot. Unless each triplet sums to 1 - (or 100), they will not plot properly and \samp{triax.points} will - complain appropriately. -} -\value{A list of the \samp{x,y} positions plotted.} -\author{Jim Lemon} -\seealso{\link{triax.plot},\link{thigmophobe.labels}} -\examples{ - data(soils) - triax.return<-triax.plot(soils[1:10,], - main="Adding points to a triangle plot",no.add=FALSE) - triax.points(soils[11:20,],col.symbols="green",pch=3) - par(triax.return$oldpar) -} -\keyword{misc} diff --git a/man/tsxpos.Rd b/man/tsxpos.Rd deleted file mode 100644 index f4a38a2..0000000 --- a/man/tsxpos.Rd +++ /dev/null @@ -1,42 +0,0 @@ -\name{tsxpos} -\title{Calculate equispaced x positions.} -\description{Calculate equispaced x positions of values that have been - plotted with the plot command.} -\usage{ - tsxpos(x,xlim,nint) -} -\alias{tsxpos} -\arguments{ - \item{x}{A vector of numeric values or a time series object created with - the ts function.} - \item{xlim}{Explicit x limits for the x positions.} - \item{nint}{The number of \emph{intervals} between x positions.} -} -\details{ - \samp{tsxpos} calculates equispaced x positions for a vector of values or - a time series created with the \samp{ts} command from the \pkg{stats} package. - It assumes that the default x limits have been used in the existing plot. It - adds the appropriate padding if \samp{par("xaxs")} is "r". It is mainly useful - when x axis labels or some other markers are to be added to a time series plot. - - A plot device must be open. If the user wishes to specify explicit x limits - or the number of intervals (not values), these will override the calculations - from the x values. -} -\value{The calculated x positions in user units.} -\author{Jim Lemon (thanks to Prof J.C. Nash for the idea)} -\examples{ - # create a vector of numbers - y<-rnorm(28) - par(mfrow=c(2,1),mar=c(6,4,4,2)) - plot(y,main="Plot of the values") - # convert it into a time series object - yt<-ts(y,start=2011,frequency=12) - # don't use the default axis - plot(yt,main="Plot of the time series",xaxt="n",xlab="Month") - labelpos<-tsxpos(yt) - # display an axis showing the months only - staxlab(1,labelpos,rep(month.abb,length.out=28)) - par(mfrow=c(1,1),mar=c(5,4,4,2)) -} -\keyword{misc} diff --git a/man/twoord.plot.Rd b/man/twoord.plot.Rd deleted file mode 100644 index b7f9c15..0000000 --- a/man/twoord.plot.Rd +++ /dev/null @@ -1,146 +0,0 @@ -\name{twoord.plot} -\alias{twoord.plot} -\title{ Plot with two ordinates } -\description{ - Two sets of values are displayed on the same plot with different ordinate - scales on the left and right. -} -\usage{ - twoord.plot(lx,ly,rx,ry,data=NULL,main="",xlim=NULL,lylim=NULL,rylim=NULL, - mar=c(5,4,4,4),lcol=1,rcol=2,xlab="",lytickpos=NA,ylab="",ylab.at=NA, - rytickpos=NA,rylab="",rylab.at=NA,lpch=1,rpch=2, - type="b",xtickpos=NULL,xticklab=NULL,halfwidth=0.4,axislab.cex=1, - do.first=NULL,xaxt="s",...) -} -\arguments{ - \item{lx,ly,rx,ry}{y and optional x values for the plot} - \item{data}{an optional data frame from which to obtain the above values} - \item{main}{Title for the plot} - \item{xlim}{optional x limits as in \samp{plot}} - \item{lylim,rylim}{optional y limits for the left and right axes - respectively} - \item{mar}{optional margin adjustment, defaults to \samp{c(5,4,4,4)}} - \item{lcol,rcol}{colors to distinguish the two sets of values} - \item{xlab}{X axis label as in \samp{plot}} - \item{lytickpos}{Optional positions for the left axis tick labels.} - \item{ylab}{Left Y axis label as in \samp{plot}} - \item{ylab.at}{Optional position for the left Y axis label} - \item{rytickpos}{Optional positions for the right axis tick labels.} - \item{rylab}{Right Y axis label} - \item{rylab.at}{Optional position for the right Y axis label} - \item{lpch,rpch}{plot symbols to distinguish the two sets of values} - \item{type}{as in \samp{plot}} - \item{xtickpos}{Optional positions for x-axis tick labels.} - \item{xticklab}{Optional labels for x-axis. Useful for things like dates.} - \item{halfwidth}{Half the width of the bars in user units. The bars are - centered on successive integers if no \samp{x} values are supplied.} - \item{axislab.cex}{Character expansion for the axis labels and tick labels.} - \item{do.first}{Optional command(s) that will be executed immediately after - the blank plot is displayed.} - \item{xaxt}{Whether to display the x-axis - "n" = no.} - \item{...}{additional arguments passed to \samp{plot} and \samp{points}.} -} -\value{nil} -\details{ - \samp{twoord.plot} automates the process of displaying two sets of - values that have different ranges on the same plot. It is principally - useful in illustrating some relationship between the values across the - observations. It is assumed that the \samp{lx} and \samp{rx} values - are at least adjacent, and probably overlapping. - - It is best to pass all the arguments \samp{lx, ly, rx, ry}, but the - function will attempt to substitute sensible x values if one or two - are missing. - - If at least one of the \samp{type} arguments is "bar", bars will be plotted - instead of points or lines. It is best to plot the bars first (i.e. relative - to the left axis) if the other type is points or lines, as the bars will - usually obscure at least some of the points or lines. Using NA for the color - of the bars will partially correct this. If both types are to be bars, - remember to pass somewhat different x values or the bars will be overplotted. - - Note that more values can be added to the plot using \samp{points} or - \samp{lines}, but remember that these will be plotted relative to the left - ordinate. - - The \samp{do.first} argument is useful for adding a background color or grid - to the plot as shown in the first two examples. -} -\note{ - There are many objections to the use of plots with two different - ordinate scales, and some of them are even sensible and supported by - controlled observation. Many of the objections rest on assertions that the - spatial arrangement of the values plotted will override all other - evidence. Here are two: - - The viewer will assume that the vertical position of the data points - indicates a quantitative relationship. - - To some extent. It is probably not a good idea to have the spatial - relationship of the points opposed to their numerical relationship. That - is to say, if one set of values is in the range of 0-10 and the other - 20-100, it is best to arrange the plot so that the latter values are - not plotted below the former. See the second example, which illustrates - a method for separating the two series and offsetting the axes. - - The viewer will assume that an intersection of lines indicates an - intersection of values. - - If the visual elements representing values can be arranged to avoid - intersections, so much the better. Many people have no trouble - distinguishing which visual elements are linked to which axis as long as - they are both coded similarly, usually with colors and/or symbols. In the - special case where there is an underlying relationship between the two - such as the probability of that value occurring under some conditions, it - may help to mark the point(s) where this occurs. - - It may be useful to consider \samp{gap.plot} or separate plots as an - alternative. -} -\author{Jim Lemon (thanks to Christophe Dutang for the idea of using bars - and lines in the same plot, Clair Crossupton for pointing out that - dates on the x-axis weren't very good, Jacob Kasper for the axis - character expansion and Ye Lin for finally motivating me to add the - do.first argument.)} -\seealso{\link{plot}} -\examples{ - xval1 <- seq.Date(as.Date("2017-01-02"), - as.Date("2017-01-10"), by="day") - xval2 <- seq.Date(as.Date("2017-01-01"), - as.Date("2017-01-15"), by="day") - going_up<-seq(3,7,by=0.5)+rnorm(9) - going_down<-rev(60:74)+rnorm(15) - twoord.plot(2:10,going_up,1:15,going_down,xlab="Sequence", - ylab="Ascending values",rylab="Descending values",lcol=4, - main="Plot with two ordinates - points and lines", - do.first="plot_bg();grid(col=\"white\",lty=1)") - axis.Date(1,xval2) - # now separate the lines - twoord.plot(2:10,going_up,1:15,going_down,xlab="Sequence", - lylim=range(going_up)+c(-1,10),rylim=range(going_down)+c(-10,2), - ylab="Ascending values",ylab.at=5,rylab="Descending values", - rylab.at=65,lcol=4,main="Plot with two ordinates - separated lines", - lytickpos=3:7,rytickpos=seq(55,75,by=5), - do.first="plot_bg();grid(col=\"white\",lty=1)") - twoord.plot(2:10,going_up,1:15,going_down,xlab="Sequence", - lylim=range(going_up)+c(-1,10),rylim=range(going_down)+c(-10,2), - type=c("bar","l"),ylab="Ascending values",ylab.at=5, - rylab="Descending values",rylab.at=65, - main="Bars on left axis, lines on right axis", - lytickpos=3:7,rytickpos=seq(55,75,by=5), - lcol=3,rcol=4,do.first="plot_bg()") - twoord.plot(2:10,going_up,1:15,going_down,xlab="Sequence", - lylim=c(-3,8),rylim=c(50,100),type=c("l","bar"), - ylab="Ascending values",rylab="Descending values", - lytickpos=3:7,rytickpos=seq(55,75,by=5),ylab.at=5,rylab.at=65, - main="Lines on left axis, bars on right axis", - lcol=3,rcol=4,do.first="plot_bg(\"yellow\")") - # histogram with density curve superimposed - xhist<-hist(rnorm(100),plot=FALSE) - xdens<-dnorm(seq(-3,3,by=0.05)) - twoord.plot(xhist$mids,xhist$counts,seq(-3,3,by=0.05), - xdens,type=c("bar","l"),lcol=4,rcol=2,ylab="Counts", - rylab="Density",main="Histogram and density curve", - halfwidth=0.2,lylim=c(0,max(xhist$counts)+1),rylim=c(0,0.45),lwd=2) -} -\keyword{misc} diff --git a/man/twoord.stackplot.Rd b/man/twoord.stackplot.Rd deleted file mode 100644 index 8798cce..0000000 --- a/man/twoord.stackplot.Rd +++ /dev/null @@ -1,88 +0,0 @@ -\name{twoord.stackplot} -\alias{twoord.stackplot} -\title{Multiple (stack) plot with two ordinates} -\description{ - Two set of data are plotted on two different ordinate scales. -} -\usage{ -twoord.stackplot(lx, rx, ldata, rdata, lcol, rcol, ltype, rtype, - border, rylab, lylab, xlab, ..., incrylim=NULL, - halfwidth=0.4, leftfront=FALSE, mar = c(5, 4, 4, 4)) -} -\arguments{ - \item{lx,rx}{x-values for left/right data.} - \item{ldata,rdata}{data on the left/right y-axes.} - \item{lcol, rcol}{colors to be used for left/right data.} - \item{ltype, rtype}{line types to be used for left/right data, see details.} - \item{border}{color for the border of barplot} - \item{rylab,lylab}{labels for the left/right y-axes.} - \item{xlab}{labels for the x-axis.} - \item{...}{further arguments to be passed to \samp{plot}.} - \item{incrylim}{a number to increase the limits of y-axes.} - \item{halfwidth}{half the width of the bars in user units. - The bars are centered on successive integers if no x values are supplied} - \item{leftfront}{if \samp{TRUE}, plot the left data on the front layer.} - \item{mar}{optional margin adjustment, defaults to c(5,4,4,4).} -} -\details{ -\samp{twoord.stackplot} works in the same way as \samp{twoord.plot} - on which it is heavily inspired. The functions let the user plot - multiple curve/point or bar plots on the same graph with two different axes. - The line type can be one of the following \samp{"l"} for lines, - \samp{"p"} for points, \samp{"b"} for both points and line, - \samp{"o"} for overplotted, \samp{"bar"} for barplot. -} -\value{ nil } -\seealso{\link{twoord.plot}} -\author{ Christophe Dutang } -\examples{ -# plot data -# - -time <- 0:25 - -A <- 1+1/2*sin(time/2) -B <- A + rnorm(length(A), sd=1/10) -B <- B + rnorm(length(A), sd=1/10) - -sizeA <- floor(450*(1 + 1/4*sin(time/2+2))*(1+.1)) -sizeB <- 1000-sizeA - -C <- (A*sizeA + B*sizeB)/(sizeA+sizeB) - - -#typical usage -# - -twoord.stackplot(lx=time, rx=time, ldata=cbind(sizeA, sizeB), - rdata=cbind(A, B, C), lcol=c("grey80", "white"), - rcol=c("blue", "red","black"), ltype="bar", rtype=c("l","p","o"), - border="grey80", lylab="Size", rylab="A,B,C", xlab="Time", - main="a plot", incrylim=2/100) - -#add a legend -# - -par(xpd=TRUE) #extend the area of plotting -par(new=TRUE) #to add new graph "layers" -plot(0:1, 0:1, type="n", xlab="",ylab="", axes=FALSE) #redo the x/y limits - -#first legend -legend(-0.18, 1.2, leg=c("Size A", "Size B"), fill=c("grey80", "white")) -#second legend -legend(.97, -0.08, leg=c("A", "B", "C"), col=c("blue", "red","black"), - pch=c(NA, 19, 19), lty=c(1,NA,1)) - -par(xpd=FALSE, new=FALSE) #default setting - - - -#reverse the order of plotting -twoord.stackplot(lx=time, rx=time, ldata=cbind(sizeA, sizeB), - rdata=cbind(A, B, C), lcol=c("grey80", "white"), - rcol=c("blue", "red","black"), ltype="bar", rtype=c("l","p","o"), - border="grey80", lylab="Size", rylab="A,B,C", xlab="Time", - main="a plot", incrylim=2/100, leftfront=TRUE) - -} -\keyword{misc} diff --git a/man/valid.n.Rd b/man/valid.n.Rd deleted file mode 100644 index 9430238..0000000 --- a/man/valid.n.Rd +++ /dev/null @@ -1,21 +0,0 @@ -\name{valid.n} -\alias{valid.n} -\title{ - Find the number of valid (not NA) values -} -\description{ - Finds the number of valid (not NA) or total values in an object. -} -\usage{ - valid.n(x,na.rm=TRUE) -} -\arguments{ - \item{x}{An object.} - \item{na.rm}{Whether to count all values (FALSE) or only those not NA.} -} -\details{ - \samp{valid.n} finds the number of valid values of the object if \samp{na.rm=TRUE}. -} -\value{The number of valid values or the length of the object.} -\author{Jim Lemon} -\keyword{misc} diff --git a/man/vectorField.Rd b/man/vectorField.Rd deleted file mode 100644 index 24776ea..0000000 --- a/man/vectorField.Rd +++ /dev/null @@ -1,64 +0,0 @@ -\name{vectorField} -\alias{vectorField} -\title{Display magnitude/direction vectors} -\description{Display magnitude/direction vectors as arrows on an existing plot.} -\usage{ - -vectorField(u,v,xpos=NA,ypos=NA,scale=1,headspan=0.1, - vecspec=c("lonlat","rad","deg"),col=par("fg")) -} -\arguments{ - \item{u,v}{x (longitude) and y (latitude) offsets OR - orientation and magnitude in either radians or degrees. See details.} - \item{xpos,ypos}{The centers of the vectors in user units.} - \item{scale}{The proportion of each cell that the maximal vector will fill. - See details.} - \item{headspan}{The extent of the heads of the arrows as a proportion of - cell size.} - \item{vecspec}{How the vectors are described. See details} - \item{col}{Color(s) for the arrows.} -} -\value{ nil } -\details{ - \samp{vectorField} displays arrows on an existing plot. Each arrow is specified - by a position on the plot \samp{xpos,ypos} and either x/y offsets or - orientation and magnitude. The default is x/y offsets, and the user must - specify whether radians or degrees are used if the orientation/magnitude option - is used. - - If the first four arguments are matrices, there must be no missing values. If - these arguments are vectors, the calculation of the scaling of the magnitudes - and length of the arrowheads may be slightly different. -} -\author{Jim Lemon (original code by Robin Hankin and Brian Ripley)} -\seealso{\link{arrows}} -\examples{ - \dontrun{ - # this requires the maps package, and just wouldn't pass check - require(maps) - map("world",xlim=c(110,155),ylim=c(-40,-10)) - par(xpd=TRUE) - text(132,-5,"Approximate magnetic deviation - Australia",cex=1.5) - par(xpd=FALSE) - long<-rep(seq(117.5,152.5,by=5),6) - lat<-rep(c(-12.5,-17.5,-22.5,-27.5,-32.5,-37.5),each=8) - # just show the direction, don't have a magnitude difference - mag<-rep(1,48) - devdeg<-c(110,98,85,65,65,65,65,65, - 115,100,90,80,72,66,63,55, - 130,100,90,82,72,67,62,54, - 122,111,95,86,70,67,56,48, - 118,116,110,87,74,68,62,45, - 128,115,107,90,78,66,53,45) - vectorField(devdeg,mag,long,lat,scale=0.7,vecspec="deg") - } - # do a magnitude/direction plot with radians - plot(1:10,type="n",main="Random vectors") - mag<-runif(100)+1 - dir<-runif(100)*2*pi - xpos<-rep(1:10,10) - ypos<-rep(1:10,each=10) - vectorcol<-sample(colors(),100) - vectorField(dir,mag,xpos,ypos,scale=0.8,vecspec="rad",col=vectorcol) -} -\keyword{misc} diff --git a/man/violin_plot.Rd b/man/violin_plot.Rd deleted file mode 100644 index 4fc8c3d..0000000 --- a/man/violin_plot.Rd +++ /dev/null @@ -1,76 +0,0 @@ -\name{violin_plot} -\alias{violin_plot} -\title{Display a "violin" plot} -\description{Displays violin plots (rotated kernel density plots on each - side of boxplots).} -\usage{ - violin_plot(X=rnorm(50),at,add=FALSE,na.rm=TRUE,bw,violin_width, - violin_end_width=0.005,equal_width=TRUE,show_box=TRUE,box_width=0.01, - box_col="black",show_outliers=TRUE,outlier_pch=NA,range=1.5,xlim,ylim, - axes=TRUE,ann=TRUE,xlab="",ylab="",x_axis_labels,main="Violin Plot", - col="red",median_col="white",show_mean=FALSE,mean_pch=19, - mean_pch_col="yellow",...) -} -\arguments{ - \item{X}{A vector or matrix or data frame of numeric values.} - \item{at}{Horizontal position(s) for the violin plot(s).} - \item{add}{Whether this violin should be added to an existing plot.} - \item{na.rm}{Remove NA values. Passed to functions such as - \samp{boxplot} or \samp{density}.} - \item{bw}{Vector or bandwidth values for \samp{density}. Will be - recycled. If not provided then will be calculated using \samp{bw.nrd0}.} - \item{violin_width}{Multiplier to scale the width of the \samp{violin}.} - \item{violin_end_width}{Multiplier to scale the width of the ends of the - violin.} - \item{equal_width}{Should all violin widths be equal?} - \item{show_box}{Whether to display the box.} - \item{box_width}{Multiplier for the width of internal boxes.} - \item{box_col}{Fill color for the internal rectangle.} - \item{show_outliers}{Whther to display outliers as points.} - \item{outlier_pch}{Symbol for displaying outliers.} - \item{range}{Passed to \samp{boxplot}.} - \item{xlim,ylim}{Explicitly set the plot limits.} - \item{axes}{Logical value indicating whether both axes should be - drawn on the plot.} - \item{ann}{Annotate the plots with axis titles and overall titles.} - \item{xlab,ylab}{Labels for the X and Y axes.} - \item{x_axis_labels}{Labels for the violins.} - \item{main}{Title for the violin plot.} - \item{col}{Fill color for the violin(s). Will be recycled.} - \item{median_col}{Fill color for the median mark.} - \item{show_mean}{Whether to plot the mean as well as the median.} - \item{mean_pch}{Symbol to use for the mean.} - \item{mean_pch_col}{Fill color for the mean symbol.} - \item{...}{Extra arguments passed to \samp{polygon} used for - representing violin(s).} -} -\details{ - \samp{violin_plot} displays one or more violin plots by drawing - rotated kernel density curves on each side of box plots. -} -\value{nil} -\author{Darshan Baral} -\examples{ - # plotting a data frame - violin_plot(mtcars) - - set.seed(42) - normvar<-c(rnorm(49),-3) - unifvar<-runif(50,-2,2) - normvar2<-rnorm(45) - - # plotting a matrix - violin_plot(matrix(c(normvar,unifvar),ncol=2), - main="Default Plot",x_axis_labels=c("Normal","Uniform")) - - # plotting with different colors and with at specified - violin_plot(matrix(c(normvar,unifvar),ncol=2),at=1:3, - main="Different colors and extra space", - x_axis_labels=c("Normal","Uniform","Normal"), - show_outliers=TRUE,col=c("blue","red"),median_col="lightgray", - pch=6) - - # adding a violin to existing plot - violin_plot(normvar2,at=3,add=TRUE,col="green",violin_width=1) -} -\keyword{misc} diff --git a/man/weighted.hist.Rd b/man/weighted.hist.Rd deleted file mode 100644 index 72247e1..0000000 --- a/man/weighted.hist.Rd +++ /dev/null @@ -1,59 +0,0 @@ -\name{weighted.hist} -\alias{weighted.hist} -\title{ - Display a weighted histogram -} -\description{ - Calculate the counts of the weighted values in specified bins and - optionally display either a frequency or density histogram. -} -\usage{ - weighted.hist(x,w,breaks="Sturges",col=NULL,plot=TRUE, - freq=TRUE,ylim=NA,ylab=NULL,xaxis=TRUE,...) -} -\arguments{ - \item{x}{A vector of numeric values} - \item{w}{A vector of weights at least as long as x.} - \item{breaks}{The endpoints of the ranges into which to count the weighted - values.} - \item{col}{An optional vector of colors for the bars of the histogram.} - \item{plot}{Whether to plot a histogram.} - \item{freq}{Whether to plot counts or densities.} - \item{ylim}{The limits of the plot ordinate.} - \item{ylab}{Label for the ordinate.} - \item{xaxis}{Whether to display an X axis.} - \item{...}{additional arguments passed to \samp{barplot}.} -} -\details{ - \samp{weighted.hist} calculates the weighted counts of values falling - into the ranges specified by \samp{breaks}. Instead of counting each - value as 1, it counts the corresponding value in \samp{w} (the weight). - - \samp{breaks} may be specified by a monotonically increasing vector - of numbers that are interpreted as the endpoints of the ranges, a - single number representing the number of ranges desired or the name - of the function to calculate the ranges (see \link{hist}). - If a vector of numbers is passed that does not include all values in - \samp{x}, the user is warned. -} -\value{A list containing: - -breaks - The endpoints of the intervals - -counts - The weighted counts - -density - The weighted counts divided by their sum. - -mids - The midpoints of the intervals and the bars displayed. - -xname - the name of \samp{x}. -} -\author{Jim Lemon and Hadley Wickham - thanks to Ben Graf for asking for a - custom x axis option and Martin Maechler for fixing the barplot problem} -\seealso{\link{hist}} -\examples{ - testx<-sample(1:10,300,TRUE) - testw<-seq(1,4,by=0.01) - weighted.hist(testx,testw,breaks=1:10,main="Test weighted histogram") -} -\keyword{misc} diff --git a/man/zoomInPlot.Rd b/man/zoomInPlot.Rd deleted file mode 100644 index b7d9e58..0000000 --- a/man/zoomInPlot.Rd +++ /dev/null @@ -1,44 +0,0 @@ -\name{zoomInPlot} -\alias{zoomInPlot} -\title{ - Display a plot with a rectangular section expanded in an adjacent plot -} -\description{ - Display one plot on the left half of a device and an expanded section of that - plot on the right half of the device with connecting lines showing the expansion. -} -\usage{ - zoomInPlot(x,y=NULL,xlim=NULL,ylim=NULL,rxlim=xlim,rylim=ylim,xend=NA, - zoomtitle=NULL,titlepos=NA,...) -} -\arguments{ - \item{x,y}{numeric data vectors. If \samp{y} is not specified, it is set equal - to \samp{x} and \samp{x} is set to \samp{1:length(y)}.} - \item{xlim,ylim}{Limits for the initial plot.} - \item{rxlim,rylim}{Limits for the expanded plot. These must be within the above.} - \item{xend}{Where to end the segments that indicate the expansion. Defaults to - just left of the tick labels on the left ordinate.} - \item{zoomtitle}{The title of the plot, display in the top center.} - \item{titlepos}{The horizontal position of the title in user units of the - zoomed plot.} - \item{...}{additional arguments passed to \samp{plot}.} -} -\details{ - \samp{zoomInPlot} sets up a two column layout in the current device and calls - \samp{plot} to display a plot in the left column. It then draws a rectangle - corresponding to the \samp{rxlim} and \samp{rylim} arguments and displays a - second plot of that rectangle in the right column. It is currently very simple - and will probably become more flexible in future versions. - - It just has. If \samp{rxlim} is set to NA, \samp{locator} will be called and - the user can define the zoomed rectangle by clicking on each corner. This is a - shameless ripoff of a suggestion by Greg Snow on the help list. Thanks, Greg. -} -\value{nil} -\author{Jim Lemon} -\seealso{\link{plot}} -\examples{ - zoomInPlot(rnorm(100),rnorm(100),rxlim=c(-1,1),rylim=c(-1,1), - zoomtitle="Zoom In Plot",titlepos=-1.5) -} -\keyword{misc} diff --git a/pkgdown.js b/pkgdown.js new file mode 100644 index 0000000..0a5573a --- /dev/null +++ b/pkgdown.js @@ -0,0 +1,162 @@ +/* http://gregfranko.com/blog/jquery-best-practices/ */ +(function ($) { + $(function () { + + $('nav.navbar').headroom(); + + Toc.init({ + $nav: $("#toc"), + $scope: $("main h2, main h3, main h4, main h5, main h6") + }); + + if ($('#toc').length) { + $('body').scrollspy({ + target: '#toc', + offset: $("nav.navbar").outerHeight() + 1 + }); + } + + // Activate popovers + $('[data-bs-toggle="popover"]').popover({ + container: 'body', + html: true, + trigger: 'focus', + placement: "top", + sanitize: false, + }); + + $('[data-bs-toggle="tooltip"]').tooltip(); + + /* Clipboard --------------------------*/ + + function changeTooltipMessage(element, msg) { + var tooltipOriginalTitle = element.getAttribute('data-bs-original-title'); + element.setAttribute('data-bs-original-title', msg); + $(element).tooltip('show'); + element.setAttribute('data-bs-original-title', tooltipOriginalTitle); + } + + if (ClipboardJS.isSupported()) { + $(document).ready(function () { + var copyButton = ""; + + $("div.sourceCode").addClass("hasCopyButton"); + + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); + + // Initialize tooltips: + $('.btn-copy-ex').tooltip({ container: 'body' }); + + // Initialize clipboard: + var clipboard = new ClipboardJS('[data-clipboard-copy]', { + text: function (trigger) { + return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); + } + }); + + clipboard.on('success', function (e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); + + clipboard.on('error', function (e) { + changeTooltipMessage(e.trigger, 'Press Ctrl+C or Command+C to copy'); + }); + + }); + } + + /* Search marking --------------------------*/ + var url = new URL(window.location.href); + var toMark = url.searchParams.get("q"); + var mark = new Mark("main#main"); + if (toMark) { + mark.mark(toMark, { + accuracy: { + value: "complementary", + limiters: [",", ".", ":", "/"], + } + }); + } + + /* Search --------------------------*/ + /* Adapted from https://github.com/rstudio/bookdown/blob/2d692ba4b61f1e466c92e78fd712b0ab08c11d31/inst/resources/bs4_book/bs4_book.js#L25 */ + // Initialise search index on focus + var fuse; + $("#search-input").focus(async function (e) { + if (fuse) { + return; + } + + $(e.target).addClass("loading"); + var response = await fetch($("#search-input").data("search-index")); + var data = await response.json(); + + var options = { + keys: ["what", "text", "code"], + ignoreLocation: true, + threshold: 0.1, + includeMatches: true, + includeScore: true, + }; + fuse = new Fuse(data, options); + + $(e.target).removeClass("loading"); + }); + + // Use algolia autocomplete + var options = { + autoselect: true, + debug: true, + hint: false, + minLength: 2, + }; + var q; + async function searchFuse(query, callback) { + await fuse; + + var items; + if (!fuse) { + items = []; + } else { + q = query; + var results = fuse.search(query, { limit: 20 }); + items = results + .filter((x) => x.score <= 0.75) + .map((x) => x.item); + if (items.length === 0) { + items = [{ dir: "Sorry 😿", previous_headings: "", title: "No results found.", what: "No results found.", path: window.location.href }]; + } + } + callback(items); + } + $("#search-input").autocomplete(options, [ + { + name: "content", + source: searchFuse, + templates: { + suggestion: (s) => { + if (s.title == s.what) { + return `${s.dir} >
    ${s.title}
    `; + } else if (s.previous_headings == "") { + return `${s.dir} >
    ${s.title}
    > ${s.what}`; + } else { + return `${s.dir} >
    ${s.title}
    > ${s.previous_headings} > ${s.what}`; + } + }, + }, + }, + ]).on('autocomplete:selected', function (event, s) { + window.location.href = s.path + "?q=" + q + "#" + s.id; + }); + }); +})(window.jQuery || window.$) + +document.addEventListener('keydown', function (event) { + // Check if the pressed key is '/' + if (event.key === '/') { + event.preventDefault(); // Prevent any default action associated with the '/' key + document.getElementById('search-input').focus(); // Set focus to the search input + } +}); diff --git a/pkgdown.yml b/pkgdown.yml new file mode 100644 index 0000000..83a5ba0 --- /dev/null +++ b/pkgdown.yml @@ -0,0 +1,5 @@ +pandoc: 3.1.11 +pkgdown: 2.2.0 +pkgdown_sha: ~ +articles: {} +last_built: 2026-02-13T14:30Z diff --git a/plotrix.Rproj b/plotrix.Rproj deleted file mode 100644 index d43959e..0000000 --- a/plotrix.Rproj +++ /dev/null @@ -1,18 +0,0 @@ -Version: 1.0 - -RestoreWorkspace: Default -SaveWorkspace: Default -AlwaysSaveHistory: Default - -EnableCodeIndexing: Yes -UseSpacesForTab: Yes -NumSpacesForTab: 2 -Encoding: UTF-8 - -RnwWeave: knitr -LaTeX: pdfLaTeX - -AutoAppendNewline: Yes - -BuildType: Package -PackageInstallArgs: --no-multiarch --with-keep.source diff --git a/reference/Rplot001.png b/reference/Rplot001.png new file mode 100644 index 0000000..37433f5 Binary files /dev/null and b/reference/Rplot001.png differ diff --git a/reference/Rplot002.png b/reference/Rplot002.png new file mode 100644 index 0000000..16785b3 Binary files /dev/null and b/reference/Rplot002.png differ diff --git a/reference/ablineclip-1.png b/reference/ablineclip-1.png new file mode 100644 index 0000000..301d282 Binary files /dev/null and b/reference/ablineclip-1.png differ diff --git a/reference/ablineclip.html b/reference/ablineclip.html new file mode 100644 index 0000000..77e13b8 --- /dev/null +++ b/reference/ablineclip.html @@ -0,0 +1,128 @@ + +Add a straight line to a plot — ablineclip • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    As abline, but has arguments x1,x2,y1,y2 as in clip.

    +
    + +
    +

    Usage

    +
    ablineclip(a=NULL,b=NULL,h=NULL,v=NULL,reg=NULL,coef=NULL,untf=FALSE,
    +  x1=NULL,x2=NULL,y1=NULL,y2=NULL,...)
    +
    + +
    +

    Arguments

    +

    +
    a
    +

    Intercept.

    + +
    b
    +

    Slope.

    + +
    h
    +

    the y-value(s) for horizontal line(s).

    + +
    v
    +

    the x-value(s) for vertical line(s).

    + +
    reg
    +

    Fitted lm object.

    + +
    coef
    +

    Coefficients, typically intercept and slope.

    + +
    untf
    +

    How to plot on log coordinates, see abline.

    + +
    x1,x2,y1,y2
    +

    Clipping limits, see clip.

    + +
    ...
    +

    Further arguments passed to abline.

    + +
    +
    +

    Details

    +

    ablineclip sets a new clipping region and then calls abline. + If any of the four clipping limits is NULL, the values from par("usr") + are substituted. After the call to abline, the old clipping region + is restored. In order to make clip work, there is a call to abline that draws a line off the plot.

    +

    Multiple lines of the same type can be drawn in a single call, but the clipping region must be the same for each group of lines. Thanks to Berry Boessenkool for pointing this out.

    +
    +
    +

    Value

    +

    None. Adds to the current plot.

    +
    +
    +

    Author

    +

    Remko Duursma

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     x <- rnorm(100)
    + y <- x + rnorm(100)
    + lmfit <- lm(y~x)
    + plot(x, y, xlim=c(-3.5, 3.5))
    + ablineclip(lmfit, x1 = -2, x2 = 2, lty = 2)
    + ablineclip(h = 0, x1 = -2,x2 = 2,lty = 3, col = "red")
    + ablineclip(v = 0, y1 = -2.5, y2 = 1.5, lty=4, col = "green")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/ablineclip.md b/reference/ablineclip.md new file mode 100644 index 0000000..3f4bef6 --- /dev/null +++ b/reference/ablineclip.md @@ -0,0 +1,85 @@ +# Add a straight line to a plot + +As `abline`, but has arguments `x1,x2,y1,y2` as in `clip`. + +## Usage + +``` r +ablineclip(a=NULL,b=NULL,h=NULL,v=NULL,reg=NULL,coef=NULL,untf=FALSE, + x1=NULL,x2=NULL,y1=NULL,y2=NULL,...) +``` + +## Arguments + +- a: + + Intercept. + +- b: + + Slope. + +- h: + + the y-value(s) for horizontal line(s). + +- v: + + the x-value(s) for vertical line(s). + +- reg: + + Fitted lm object. + +- coef: + + Coefficients, typically intercept and slope. + +- untf: + + How to plot on log coordinates, see `abline`. + +- x1,x2,y1,y2: + + Clipping limits, see `clip`. + +- ...: + + Further arguments passed to `abline`. + +## Details + +`ablineclip` sets a new clipping region and then calls `abline`. If any +of the four clipping limits is NULL, the values from `par("usr")` are +substituted. After the call to `abline`, the old clipping region is +restored. In order to make `clip` work, there is a call to `abline` that +draws a line off the plot. + +Multiple lines of the same type can be drawn in a single call, but the +clipping region must be the same for each group of lines. Thanks to +Berry Boessenkool for pointing this out. + +## Value + +None. Adds to the current plot. + +## Author + +Remko Duursma + +## See also + +[abline](https://rdrr.io/r/graphics/abline.html), +[clip](https://rdrr.io/r/graphics/clip.html) + +## Examples + +``` r + x <- rnorm(100) + y <- x + rnorm(100) + lmfit <- lm(y~x) + plot(x, y, xlim=c(-3.5, 3.5)) + ablineclip(lmfit, x1 = -2, x2 = 2, lty = 2) + ablineclip(h = 0, x1 = -2,x2 = 2,lty = 3, col = "red") + ablineclip(v = 0, y1 = -2.5, y2 = 1.5, lty=4, col = "green") +``` diff --git a/reference/add.ps.html b/reference/add.ps.html new file mode 100644 index 0000000..06e7015 --- /dev/null +++ b/reference/add.ps.html @@ -0,0 +1,175 @@ + +add p-values from t-tests — add.ps • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Adds p-values comparing the different cells at each x-axis position with a + reference cell. Uses a syntax similar to raw.means.plot2.

    +
    + +
    +

    Usage

    +
    add.ps(data, col.id, col.offset, col.x, col.value, fun.aggregate = "mean",
    + ref.offset = 1, prefixes,alternative = c("two.sided", "less", "greater"),
    + mu = 0, paired = FALSE, var.equal = FALSE, lty = 0, ...)
    +
    + +
    +

    Arguments

    +

    +
    data
    +

    A data.frame

    + +
    col.id
    +

    character vector specifying the id column.

    + +
    col.offset
    +

    character vector specifying the offset column.

    + +
    col.x
    +

    character vector specifying the x-axis column.

    + +
    col.value
    +

    character vector specifying the data column.

    + +
    fun.aggregate
    +

    Function or function name used for aggregating the results. Default is + "mean".

    + +
    ref.offset
    +

    Scalar numeric indicating the reference level to be tested against. + The default is 1 corresponding to levels(factor(d[,col.offset]))[1].

    + +
    prefixes
    +

    character vector of the indices for the p-values. If missing + corresponds to levels(factor(d.new[,col.offset]))[-ref.offset].

    + +
    alternative
    +

    same as in t.test

    + +
    mu
    +

    same as in t.test

    + +
    paired
    +

    same as in t.test

    + +
    var.equal
    +

    same as in t.test

    + +
    lty
    +

    line type of axis, Default is 0 (i.e., no line).

    + +
    ...
    +

    further arguments passed to axis.

    + +
    +
    +

    Details

    +

    This function computes t-tests comparing the values at each x-axis position + for each condition against the reference condition at and adds the p-values + to the axis.

    +

    This functions uses the same syntax as raw.means.plot2 and + should be used in addition to it. Note that values are ordered according to + the col.id so paired = TRUE should be fine.

    +
    +
    +

    Value

    +

    axis is plotted.

    +
    +
    +

    Author

    +

    Henrik Singmann

    +
    +
    +

    See also

    +

    raw.means.plot as the accompanying main functions.

    +
    + +
    +

    Examples

    +
    if (FALSE) { # \dontrun{
    +#The examples uses the OBrienKaiser dataset from car and needs reshape.
    +# This extends the examples from raw.means.plot
    +require(reshape)
    +require(car)
    +data(OBrienKaiser)
    +OBKnew <- cbind(factor(1:nrow(OBrienKaiser)), OBrienKaiser)
    +colnames(OBKnew)[1] <- "id"
    +OBK.long <- melt(OBKnew)
    +OBK.long[, c("measurement", "time")] <-
    + t(vapply(strsplit(as.character(OBK.long$variable), "\\."),  "[", c("", "")))
    +
    +# For this example the position at each x-axis are within-subject comparisons!
    +raw.means.plot2(OBK.long, "id", "measurement", "gender", "value")
    + add.ps(OBK.long, "id", "measurement", "gender", "value", paired = TRUE)
    + #reference is "fup"
    +
    +raw.means.plot2(OBK.long, "id", "measurement", "gender", "value")
    +add.ps(OBK.long, "id", "measurement", "gender", "value", ref.offset = 2,
    + paired = TRUE) #reference is "post"
    +
    +# Use R's standard (i.e., Welch test)
    +raw.means.plot2(OBK.long, "id", "treatment", "gender", "value")
    +add.ps(OBK.long, "id", "treatment", "gender", "value",
    + prefixes = c("p(control vs. A)", "p(control vs. B)"))
    +
    +# Use standard t-test
    +raw.means.plot2(OBK.long, "id", "treatment", "gender", "value")
    +add.ps(OBK.long, "id", "treatment", "gender", "value", var.equal = TRUE,
    + prefixes = c("p(control vs. A)", "p(control vs. B)"))
    +
    +} # }
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/add.ps.md b/reference/add.ps.md new file mode 100644 index 0000000..70388bf --- /dev/null +++ b/reference/add.ps.md @@ -0,0 +1,133 @@ +# add p-values from t-tests + +Adds p-values comparing the different cells at each x-axis position with +a reference cell. Uses a syntax similar to `raw.means.plot2`. + +## Usage + +``` r +add.ps(data, col.id, col.offset, col.x, col.value, fun.aggregate = "mean", + ref.offset = 1, prefixes,alternative = c("two.sided", "less", "greater"), + mu = 0, paired = FALSE, var.equal = FALSE, lty = 0, ...) +``` + +## Arguments + +- data: + + A `data.frame` + +- col.id: + + `character` vector specifying the id column. + +- col.offset: + + `character` vector specifying the offset column. + +- col.x: + + `character` vector specifying the x-axis column. + +- col.value: + + `character` vector specifying the data column. + +- fun.aggregate: + + Function or function name used for aggregating the results. Default is + `"mean"`. + +- ref.offset: + + Scalar `numeric` indicating the reference level to be tested against. + The default is 1 corresponding to `levels(factor(d[,col.offset]))[1]`. + +- prefixes: + + `character` vector of the indices for the p-values. If missing + corresponds to `levels(factor(d.new[,col.offset]))[-ref.offset]`. + +- alternative: + + same as in [t.test](https://rdrr.io/r/stats/t.test.html) + +- mu: + + same as in [t.test](https://rdrr.io/r/stats/t.test.html) + +- paired: + + same as in [t.test](https://rdrr.io/r/stats/t.test.html) + +- var.equal: + + same as in [t.test](https://rdrr.io/r/stats/t.test.html) + +- lty: + + line type of axis, Default is 0 (i.e., no line). + +- ...: + + further arguments passed to axis. + +## Details + +This function computes t-tests comparing the values at each x-axis +position for each condition against the reference condition at and adds +the p-values to the axis. + +This functions uses the same syntax as +[raw.means.plot2](raw.means.plot.md) and should be used in addition to +it. Note that values are ordered according to the `col.id` so +`paired = TRUE` should be fine. + +## Value + +axis is plotted. + +## Author + +Henrik Singmann + +## See also + +[raw.means.plot](raw.means.plot.md) as the accompanying main functions. + +## Examples + +``` r +if (FALSE) { # \dontrun{ +#The examples uses the OBrienKaiser dataset from car and needs reshape. +# This extends the examples from raw.means.plot +require(reshape) +require(car) +data(OBrienKaiser) +OBKnew <- cbind(factor(1:nrow(OBrienKaiser)), OBrienKaiser) +colnames(OBKnew)[1] <- "id" +OBK.long <- melt(OBKnew) +OBK.long[, c("measurement", "time")] <- + t(vapply(strsplit(as.character(OBK.long$variable), "\\."), "[", c("", ""))) + +# For this example the position at each x-axis are within-subject comparisons! +raw.means.plot2(OBK.long, "id", "measurement", "gender", "value") + add.ps(OBK.long, "id", "measurement", "gender", "value", paired = TRUE) + #reference is "fup" + +raw.means.plot2(OBK.long, "id", "measurement", "gender", "value") +add.ps(OBK.long, "id", "measurement", "gender", "value", ref.offset = 2, + paired = TRUE) #reference is "post" + +# Use R's standard (i.e., Welch test) +raw.means.plot2(OBK.long, "id", "treatment", "gender", "value") +add.ps(OBK.long, "id", "treatment", "gender", "value", + prefixes = c("p(control vs. A)", "p(control vs. B)")) + +# Use standard t-test +raw.means.plot2(OBK.long, "id", "treatment", "gender", "value") +add.ps(OBK.long, "id", "treatment", "gender", "value", var.equal = TRUE, + prefixes = c("p(control vs. A)", "p(control vs. B)")) + +} # } +``` diff --git a/reference/addtable2plot-1.png b/reference/addtable2plot-1.png new file mode 100644 index 0000000..994c217 Binary files /dev/null and b/reference/addtable2plot-1.png differ diff --git a/reference/addtable2plot.html b/reference/addtable2plot.html new file mode 100644 index 0000000..a9e319d --- /dev/null +++ b/reference/addtable2plot.html @@ -0,0 +1,158 @@ + +Add a table of values to a plot — addtable2plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a table of values at a user-specified position on an existing plot

    +
    + +
    +

    Usage

    +
    addtable2plot(x,y=NULL,table,lwd=par("lwd"),bty="n",bg=par("bg"),
    +  cex=1,xjust=0,yjust=1,xpad=0.1,ypad=0.5,box.col=par("fg"),text.col=par("fg"),
    +  display.colnames=TRUE,display.rownames=FALSE,hlines=FALSE,vlines=FALSE,
    +  title=NULL)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    Either x and y coordinates to locate the table or an + xy.coords object.

    + +
    table
    +

    A data frame, matrix or similar object that will be displayed.

    + +
    lwd
    +

    The line width for the box and horizontal dividers.

    + +
    bty
    +

    Whether to draw a box around the table ("o") or not ("n").

    + +
    bg
    +

    The background color for the table.

    + +
    cex
    +

    Character expansion for the table.

    + +
    xjust,yjust
    +

    Positioning for the table relative to x,y.

    + +
    xpad,ypad
    +

    The amount of padding around text in the cells as a + proportion of the maximum width and height of the strings in each column.

    + +
    box.col
    +

    The color for the box and lines.

    + +
    text.col
    +

    The color for the text.

    + +
    display.colnames
    +

    Whether to display the column names in the table.

    + +
    display.rownames
    +

    Whether to display the row names in the table.

    + +
    hlines
    +

    Whether to draw horizontal lines between each row of the table.

    + +
    vlines
    +

    Whether to draw vertical lines between each column of the table.

    + +
    title
    +

    Optional title placed over the table.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    addtable2plot displays the values in table at a position in user + coordinates specified by x,y. The two justification arguments, + xjust and yjust are the same as in the legend function, + and addtable2plot has been programmed to be as similar to legend + as possible. The function now accepts the positional arguments such as + "topright" if passed as x. The defaults are those that were most + popular in scientific journals at the time of programming.

    +

    If bg is a matrix of colors of the same dimensions as x, those + colors will be the backgrounds of the cells. The default is no background color.

    +
    +
    +

    Author

    +

    Original by John Kane, mods by Jim Lemon and Brian Diggs. Thanks to + Andrija Djurovic for asking for the individual cell colors and Gabor Grothendieck + for alerting me to the problem of widely varying column widths.

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     testdf <- data.frame(Before = c(10, 7, 5, 9), During = c(8, 6, 2, 5),
    +  After = c(5, 3, 4, 3))
    + rownames(testdf) <- c("Red", "Green", "Blue", "Lightblue")
    + barp(testdf, main = "Test addtable2plot", ylab = "Value",
    +  names.arg = colnames(testdf), col = 2:5)
    + # show most of the options including the christmas tree colors
    + abg <- matrix(c(2, 3, 5, 6, 7, 8), nrow=4, ncol=3)
    + addtable2plot(2, 8, testdf, bty = "o", display.rownames = TRUE, hlines = TRUE,
    +  vlines = TRUE, title = "The table", bg = abg)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/addtable2plot.md b/reference/addtable2plot.md new file mode 100644 index 0000000..3896c46 --- /dev/null +++ b/reference/addtable2plot.md @@ -0,0 +1,120 @@ +# Add a table of values to a plot + +Displays a table of values at a user-specified position on an existing +plot + +## Usage + +``` r +addtable2plot(x,y=NULL,table,lwd=par("lwd"),bty="n",bg=par("bg"), + cex=1,xjust=0,yjust=1,xpad=0.1,ypad=0.5,box.col=par("fg"),text.col=par("fg"), + display.colnames=TRUE,display.rownames=FALSE,hlines=FALSE,vlines=FALSE, + title=NULL) +``` + +## Arguments + +- x,y: + + Either x and y coordinates to locate the table or an `xy.coords` + object. + +- table: + + A data frame, matrix or similar object that will be displayed. + +- lwd: + + The line width for the box and horizontal dividers. + +- bty: + + Whether to draw a box around the table ("o") or not ("n"). + +- bg: + + The background color for the table. + +- cex: + + Character expansion for the table. + +- xjust,yjust: + + Positioning for the table relative to `x,y`. + +- xpad,ypad: + + The amount of padding around text in the cells as a proportion of the + maximum width and height of the strings in each column. + +- box.col: + + The color for the box and lines. + +- text.col: + + The color for the text. + +- display.colnames: + + Whether to display the column names in the table. + +- display.rownames: + + Whether to display the row names in the table. + +- hlines: + + Whether to draw horizontal lines between each row of the table. + +- vlines: + + Whether to draw vertical lines between each column of the table. + +- title: + + Optional title placed over the table. + +## Value + +nil + +## Details + +`addtable2plot` displays the values in `table` at a position in user +coordinates specified by `x,y`. The two justification arguments, `xjust` +and `yjust` are the same as in the `legend` function, and +`addtable2plot` has been programmed to be as similar to `legend` as +possible. The function now accepts the positional arguments such as +"topright" if passed as `x`. The defaults are those that were most +popular in scientific journals at the time of programming. + +If `bg` is a matrix of colors of the same dimensions as `x`, those +colors will be the backgrounds of the cells. The default is no +background color. + +## Author + +Original by John Kane, mods by Jim Lemon and Brian Diggs. Thanks to +Andrija Djurovic for asking for the individual cell colors and Gabor +Grothendieck for alerting me to the problem of widely varying column +widths. + +## See also + +[legend](https://rdrr.io/r/graphics/legend.html) + +## Examples + +``` r + testdf <- data.frame(Before = c(10, 7, 5, 9), During = c(8, 6, 2, 5), + After = c(5, 3, 4, 3)) + rownames(testdf) <- c("Red", "Green", "Blue", "Lightblue") + barp(testdf, main = "Test addtable2plot", ylab = "Value", + names.arg = colnames(testdf), col = 2:5) + # show most of the options including the christmas tree colors + abg <- matrix(c(2, 3, 5, 6, 7, 8), nrow=4, ncol=3) + addtable2plot(2, 8, testdf, bty = "o", display.rownames = TRUE, hlines = TRUE, + vlines = TRUE, title = "The table", bg = abg) +``` diff --git a/reference/arctext-1.png b/reference/arctext-1.png new file mode 100644 index 0000000..e9bea65 Binary files /dev/null and b/reference/arctext-1.png differ diff --git a/reference/arctext.html b/reference/arctext.html new file mode 100644 index 0000000..db105e4 --- /dev/null +++ b/reference/arctext.html @@ -0,0 +1,146 @@ + +Display text on a circular arc — arctext • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a character string on the circumference of an imaginary + circle on an existing plot.

    +
    + +
    +

    Usage

    +
    arctext(x,center=c(0,0),radius=1,start=NULL,middle=pi/2,end=NULL,stretch=1,
    + clockwise=TRUE,cex=NULL,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A character string.

    + +
    center
    +

    The center of the circular arc in x/y user units.

    + +
    radius
    +

    The radius of the arc in user units.

    + +
    start
    +

    The starting position of the string in radians.

    + +
    middle
    +

    The middle position of the string in radians.

    + +
    end
    +

    The end position of the string in radians.

    + +
    stretch
    +

    How much to stretch the string for appearance.

    + +
    clockwise
    +

    Whether to print the string in the clockwise direction.

    + +
    cex
    +

    The character expansion factor.

    + +
    ...
    +

    additional arguments passed to text.

    + +
    +
    +

    Details

    +

    arctext displays a string along a circular arc, rotating each + letter. This may not work on all devices, as not all graphic devices + can rotate text to arbitrary angles. The output looks best on a + Postscript or similar device that can rotate text without distortion. + Rotated text often looks very ragged on small bitmaps.

    +

    If the user passes a value for + start, this will override any value passed to middle. + If the plot area is not square, see par(pty="s"), the arc will + be somewhat elliptical.

    +

    If the clockwise argument is TRUE, the string will be displayed + in a clockwise direction and the orientation of the characters will be + rotated pi radians (180 degrees). This is useful when the string + is to be displayed on the bottom of the circumference.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon - Thanks to Suhas Parandekar for the idea, Ted Toal + for greatly improving the placement of the text and Andy South for + providing the initial code for the clockwise argument.

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     plot(0, xlim = c(1, 5),ylim = c(1, 5),main = "Test of arctext", xlab = "",
    +  ylab = "", type = "n")
    + arctext("bendy like spaghetti", center = c(3,3), col = "blue")
    + arctext("bendy like spaghetti", center = c(3,3), radius = 1.5, start = pi,
    +  cex = 2)
    + arctext("bendy like spaghetti", center = c(3, 3),radius = 0.5,
    +  start = pi/2, stretch = 1.2)
    + arctext("bendy like spaghetti", center = c(3, 3), radius = 1.7,
    +  start = 4 * pi / 3, cex = 1.3, clockwise = FALSE)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/arctext.md b/reference/arctext.md new file mode 100644 index 0000000..7d2cad5 --- /dev/null +++ b/reference/arctext.md @@ -0,0 +1,98 @@ +# Display text on a circular arc + +Displays a character string on the circumference of an imaginary circle +on an existing plot. + +## Usage + +``` r +arctext(x,center=c(0,0),radius=1,start=NULL,middle=pi/2,end=NULL,stretch=1, + clockwise=TRUE,cex=NULL,...) +``` + +## Arguments + +- x: + + A character string. + +- center: + + The center of the circular arc in x/y user units. + +- radius: + + The radius of the arc in user units. + +- start: + + The starting position of the string in radians. + +- middle: + + The middle position of the string in radians. + +- end: + + The end position of the string in radians. + +- stretch: + + How much to stretch the string for appearance. + +- clockwise: + + Whether to print the string in the clockwise direction. + +- cex: + + The character expansion factor. + +- ...: + + additional arguments passed to `text`. + +## Details + +`arctext` displays a string along a circular arc, rotating each letter. +This may not work on all devices, as not all graphic devices can rotate +text to arbitrary angles. The output looks best on a Postscript or +similar device that can rotate text without distortion. Rotated text +often looks very ragged on small bitmaps. + +If the user passes a value for `start`, this will override any value +passed to `middle`. If the plot area is not square, see `par(pty="s")`, +the arc will be somewhat elliptical. + +If the `clockwise` argument is TRUE, the string will be displayed in a +clockwise direction and the orientation of the characters will be +rotated `pi` radians (180 degrees). This is useful when the string is to +be displayed on the bottom of the circumference. + +## Value + +nil + +## Author + +Jim Lemon - Thanks to Suhas Parandekar for the idea, Ted Toal for +greatly improving the placement of the text and Andy South for providing +the initial code for the clockwise argument. + +## See also + +[text](https://rdrr.io/r/graphics/text.html) + +## Examples + +``` r + plot(0, xlim = c(1, 5),ylim = c(1, 5),main = "Test of arctext", xlab = "", + ylab = "", type = "n") + arctext("bendy like spaghetti", center = c(3,3), col = "blue") + arctext("bendy like spaghetti", center = c(3,3), radius = 1.5, start = pi, + cex = 2) + arctext("bendy like spaghetti", center = c(3, 3),radius = 0.5, + start = pi/2, stretch = 1.2) + arctext("bendy like spaghetti", center = c(3, 3), radius = 1.7, + start = 4 * pi / 3, cex = 1.3, clockwise = FALSE) +``` diff --git a/reference/axis.break-1.png b/reference/axis.break-1.png new file mode 100644 index 0000000..3b9d8e2 Binary files /dev/null and b/reference/axis.break-1.png differ diff --git a/reference/axis.break-2.png b/reference/axis.break-2.png new file mode 100644 index 0000000..c918366 Binary files /dev/null and b/reference/axis.break-2.png differ diff --git a/reference/axis.break.html b/reference/axis.break.html new file mode 100644 index 0000000..795ca2f --- /dev/null +++ b/reference/axis.break.html @@ -0,0 +1,132 @@ + +Place a "break" mark on an axis — axis.break • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Places a "break" mark on an axis on an existing plot.

    +
    + +
    +

    Usage

    +
    axis.break(axis=1,breakpos=NULL,pos=NULL,bgcol="white",breakcol="black",
    +  style="slash",brw=0.02)
    +
    + +
    +

    Arguments

    +

    +
    axis
    +

    which axis to break

    + +
    breakpos
    +

    where to place the break in user units

    + +
    pos
    +

    position of the axis (see axis).

    + +
    bgcol
    +

    the color of the plot background

    + +
    breakcol
    +

    the color of the "break" marker

    + +
    style
    +

    Either gap, slash or zigzag

    + +
    brw
    +

    break width relative to plot width

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    The pos argument is not needed unless the user has specified a + different position from the default for the axis to be broken.

    +
    +
    +

    Note

    +

    There is some controversy about the propriety of using discontinuous + coordinates for plotting, and thus axis breaks. Discontinuous coordinates + allow widely separated groups of values or outliers to appear without + devoting too much of the plot to empty space. The major objection seems + to be that the reader will be misled by assuming continuous coordinates. + The gap style that clearly separates the two sections of the plot + is probably best for avoiding this.

    +
    +
    +

    Author

    +

    Jim Lemon and Ben Bolker

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     plot(3:10, main = "Axis break test")
    + # put a break at the default axis and position
    + axis.break()
    + axis.break(2, 2.9, style = "zigzag")
    +
    + twogrp <- c(rnorm(10) + 4, rnorm(10) + 20)
    + gap.plot(twogrp,gap = c(8,16), xlab = "Index", ylab = "Group values",
    +  main = "Two separated groups with gap axis break",
    +  col = c(rep(2, 10), rep(3, 10)), ytics = c(3, 5, 18, 20))
    + legend(12, 6, c("Low group", "High group"), pch = 1, col = 2:3)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/axis.break.md b/reference/axis.break.md new file mode 100644 index 0000000..cf65aa4 --- /dev/null +++ b/reference/axis.break.md @@ -0,0 +1,83 @@ +# Place a "break" mark on an axis + +Places a "break" mark on an axis on an existing plot. + +## Usage + +``` r +axis.break(axis=1,breakpos=NULL,pos=NULL,bgcol="white",breakcol="black", + style="slash",brw=0.02) +``` + +## Arguments + +- axis: + + which axis to break + +- breakpos: + + where to place the break in user units + +- pos: + + position of the axis (see + [axis](https://rdrr.io/r/graphics/axis.html)). + +- bgcol: + + the color of the plot background + +- breakcol: + + the color of the "break" marker + +- style: + + Either `gap`, `slash` or `zigzag` + +- brw: + + break width relative to plot width + +## Value + +nil + +## Details + +The `pos` argument is not needed unless the user has specified a +different position from the default for the axis to be broken. + +## Note + +There is some controversy about the propriety of using discontinuous +coordinates for plotting, and thus axis breaks. Discontinuous +coordinates allow widely separated groups of values or outliers to +appear without devoting too much of the plot to empty space. The major +objection seems to be that the reader will be misled by assuming +continuous coordinates. The `gap` style that clearly separates the two +sections of the plot is probably best for avoiding this. + +## Author + +Jim Lemon and Ben Bolker + +## See also + +[gap.plot](gap.plot.md) + +## Examples + +``` r + plot(3:10, main = "Axis break test") + # put a break at the default axis and position + axis.break() + axis.break(2, 2.9, style = "zigzag") + + twogrp <- c(rnorm(10) + 4, rnorm(10) + 20) + gap.plot(twogrp,gap = c(8,16), xlab = "Index", ylab = "Group values", + main = "Two separated groups with gap axis break", + col = c(rep(2, 10), rep(3, 10)), ytics = c(3, 5, 18, 20)) + legend(12, 6, c("Low group", "High group"), pch = 1, col = 2:3) +``` diff --git a/reference/axis.mult-1.png b/reference/axis.mult-1.png new file mode 100644 index 0000000..3b54ede Binary files /dev/null and b/reference/axis.mult-1.png differ diff --git a/reference/axis.mult.html b/reference/axis.mult.html new file mode 100644 index 0000000..fdbeee8 --- /dev/null +++ b/reference/axis.mult.html @@ -0,0 +1,135 @@ + +Display an axis with values having a multiplier — axis.mult • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    An axis is displayed on an existing plot where the tick values are divided + by a multiplier and the multiplier is displayed next to the axis.

    +
    + +
    +

    Usage

    +
    axis.mult(side=1,at=NULL,labels,mult=1,mult.label,mult.line,
    +  mult.labelpos=NULL,...)
    +
    + +
    +

    Arguments

    +

    +
    side
    +

    which side to display

    + +
    at
    +

    where to place the tick marks - defaults to axTicks()

    + +
    labels
    +

    tick labels - defaults to at/mult

    + +
    mult
    +

    the multiplier factor

    + +
    mult.label
    +

    the label to show the multiplier - defaults to "x mult"

    + +
    mult.line
    +

    the margin line upon which to show the multiplier

    + +
    mult.labelpos
    +

    where to place mult.label - defaults to centered + and outside the axis tick labels

    + +
    ...
    +

    additional arguments passed to axis.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    axis.mult automates the process of displaying an axis with a + multiplier applied to the tick values. By default it will divide the + default axis tick labels by mult and place mult.label + where xlab or ylab would normally appear. Thus the plot + call should set the relevant label to an empty string in such cases. + It is simplest to call plot with axes=FALSE and then + display the box and any standard axes before calling axis.mult.

    +
    +
    +

    Note

    +

    While axis.mult will try to display an axis on any side, the top + and right margins will require adjustment using par for + axis.mult to display properly.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     plot(1:10 * 0.001, 1:10 * 100,axes = FALSE, xlab = "", ylab = "",
    +  main = "Axis multipliers")
    + box()
    + axis.mult(1, mult = 0.001)
    + axis.mult(2, mult = 100)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/axis.mult.md b/reference/axis.mult.md new file mode 100644 index 0000000..d6bb7d2 --- /dev/null +++ b/reference/axis.mult.md @@ -0,0 +1,86 @@ +# Display an axis with values having a multiplier + +An axis is displayed on an existing plot where the tick values are +divided by a multiplier and the multiplier is displayed next to the +axis. + +## Usage + +``` r +axis.mult(side=1,at=NULL,labels,mult=1,mult.label,mult.line, + mult.labelpos=NULL,...) +``` + +## Arguments + +- side: + + which side to display + +- at: + + where to place the tick marks - defaults to `axTicks()` + +- labels: + + tick labels - defaults to at/mult + +- mult: + + the multiplier factor + +- mult.label: + + the label to show the multiplier - defaults to "x mult" + +- mult.line: + + the margin line upon which to show the multiplier + +- mult.labelpos: + + where to place `mult.label` - defaults to centered and outside the + axis tick labels + +- ...: + + additional arguments passed to `axis`. + +## Value + +nil + +## Details + +`axis.mult` automates the process of displaying an axis with a +multiplier applied to the tick values. By default it will divide the +default axis tick labels by `mult` and place `mult.label` where `xlab` +or `ylab` would normally appear. Thus the plot call should set the +relevant label to an empty string in such cases. It is simplest to call +`plot` with `axes=FALSE` and then display the box and any standard axes +before calling `axis.mult`. + +## Note + +While `axis.mult` will try to display an axis on any side, the top and +right margins will require adjustment using `par` for `axis.mult` to +display properly. + +## Author + +Jim Lemon + +## See also + +[axis](https://rdrr.io/r/graphics/axis.html), +[mtext](https://rdrr.io/r/graphics/mtext.html) + +## Examples + +``` r + plot(1:10 * 0.001, 1:10 * 100,axes = FALSE, xlab = "", ylab = "", + main = "Axis multipliers") + box() + axis.mult(1, mult = 0.001) + axis.mult(2, mult = 100) +``` diff --git a/reference/barNest-1.png b/reference/barNest-1.png new file mode 100644 index 0000000..b2db474 Binary files /dev/null and b/reference/barNest-1.png differ diff --git a/reference/barNest-2.png b/reference/barNest-2.png new file mode 100644 index 0000000..4f0789c Binary files /dev/null and b/reference/barNest-2.png differ diff --git a/reference/barNest-3.png b/reference/barNest-3.png new file mode 100644 index 0000000..c4073d9 Binary files /dev/null and b/reference/barNest-3.png differ diff --git a/reference/barNest-4.png b/reference/barNest-4.png new file mode 100644 index 0000000..ab05174 Binary files /dev/null and b/reference/barNest-4.png differ diff --git a/reference/barNest-5.png b/reference/barNest-5.png new file mode 100644 index 0000000..0ce10ec Binary files /dev/null and b/reference/barNest-5.png differ diff --git a/reference/barNest-6.png b/reference/barNest-6.png new file mode 100644 index 0000000..080647c Binary files /dev/null and b/reference/barNest-6.png differ diff --git a/reference/barNest-7.png b/reference/barNest-7.png new file mode 100644 index 0000000..28e68cc Binary files /dev/null and b/reference/barNest-7.png differ diff --git a/reference/barNest-8.png b/reference/barNest-8.png new file mode 100644 index 0000000..28303a3 Binary files /dev/null and b/reference/barNest-8.png differ diff --git a/reference/barNest-9.png b/reference/barNest-9.png new file mode 100644 index 0000000..ee289c0 Binary files /dev/null and b/reference/barNest-9.png differ diff --git a/reference/barNest.html b/reference/barNest.html new file mode 100644 index 0000000..cb94894 --- /dev/null +++ b/reference/barNest.html @@ -0,0 +1,275 @@ + +Display a nested breakdown of numeric values — barNest • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Breaks down the elements of a data frame by one or more + categorical elements and displays the breakdown as a bar plot.

    +
    + +
    +

    Usage

    +
    barNest(formula=NULL,data=NULL,FUN=c("mean","sd","sd","valid.n"),ylim=NULL,
    + main="",xlab="",ylab="",shrink=0.1,errbars=FALSE,col=NA,
    + labelcex=1,lineht=NULL,showall=TRUE,Nwidths=FALSE,barlabels=NULL,
    + showlabels=TRUE,mar=NULL,arrow.cap=NULL,trueval=TRUE)
    +
    + +
    +

    Arguments

    +

    +
    formula
    +

    A formula with a numeric element of a data frame on the left and + one or more categorical elements on the right.

    + +
    data
    +

    A data frame containing the elements in formula.

    + +
    FUN
    +

    The functions to apply to x.

    + +
    ylim
    +

    Optional y limits for the plot, usually necessary for counts.

    + +
    main
    +

    Title for the plot.

    + +
    xlab,ylab
    +

    Axis labels for the plot. The x axis label is typically blank

    + +
    shrink
    +

    The proportion to shrink the width of the bars at each level.

    + +
    errbars
    +

    Whether to display error bars on the lowest level of breakdown.

    + +
    col
    +

    The colors to use to fill the bars. See Details.

    + +
    labelcex
    +

    Character size for the group labels.

    + +
    lineht
    +

    The height of a line of text in the lower margin of the plot in user + units. This will be calculated by the function if a value is not passed.

    + +
    showall
    +

    Whether to display bars for the entire breakdown.

    + +
    Nwidths
    +

    Whether to scale the widths of the bars to the number of + observations.

    + +
    barlabels
    +

    Optional group labels that may be useful if the factors used to + break down the numeric variable are fairly long strings.

    + +
    showlabels
    +

    Whether to display the labels below the bars.

    + +
    mar
    +

    If not NULL, a four element vector to set the plot margins. If new + margins are set, the user must reset the margins after the function exits.

    + +
    arrow.cap
    +

    The width of the "cap" on error bars in user units, + calculated on the basis of the number of bars in the final breakdown if NA.

    + +
    trueval
    +

    If this is not NA, the call to brkdnNest will return the + proportions of the response variable that are equal to trueval. + See Details.

    + +
    +
    +

    Value

    +

    The summary list produced by brkdnNest.

    +
    +
    +

    Details

    +

    barNest displays a bar plot illustrating the hierarchic breakdown of + the elements of a data frame. The breakdown is performed by brkdnNest + and the actual display is performed by drawNestedBars. The heights of + the bars will be proportional to the values returned by the first function in + FUN. If showall is TRUE, the entire nested breakdown will be + displayed. This can be useful in visualizing the relationship between groups + and subgroups in a compact format.

    +

    barNest assumes that there will be four breakdowns in the list + returned by brkdnNest in the order summary measure, upper dispersion + value, lower dispersion value and number of valid observations. If + Nwidths=FALSE, it may work with only three and if errbars=FALSE + as well, it may work with only one.

    +

    If Nwidths=TRUE, the bar widths will be scaled to the relative number + of observations per group. When the numbers of observations are very different, + the labels for those bars with small numbers of observations will probably + overlap.

    +

    A number of functions can be passed in the FUN argument. Three + functions, propbrk, sumbrk and valid.n will work as + summary measures, giving proportions or sums of particular values of a + discrete variable and counts in each group and subgroup respectively. + Binomial confidence limits can be added to the proportions returned by + propbrk with binciWl and binciWu as in the second last + example. If valid.n is the first element of FUN, the "overall" + bar and label will be suppressed, as they are not informative. It is up to + the user to decide whether any "error bars" displayed are meaningful.

    +

    The colors of the bars are determined by col. If showall is + FALSE, the user only need pass a vector of colors, usually the same length + as the number of categories in the final (last on the right side) element in + the formula. If showall is TRUE and the user wants to color all of the + bars, a list with as many elements as there are levels in the breakdown + should be passed. Each element should be a vector of colors, again usually + the same length as the number of categories. As the categorical variables are + likely to be factors, it is important to remember that the colors must be in + the correct order for the levels of the factors. When the levels are not in + the default alphanumeric order, it is quite easy to get this wrong. As a + barNest plot with more than a few factors and levels in each factor is + quite dense, easily distinguished colors for each level of the breakdown may + be preferable. As with some other plots, trying to cram too much information + into a single illustration may not work well.

    +
    +
    +

    Author

    +

    Jim Lemon and Ofir Levy

    +
    +
    +

    References

    +

    Lemon, J. & Levy, O. (2011) barNest: Illustrating nested summary measures. + Statistical Computing and Graphics Newsletter of the American Statistical + Association, 21(2): 5-10.

    +
    +
    +

    See also

    +

    brkdnNest, drawNestedBars, superbarplot(UsingR)

    +
    + +
    +

    Examples

    +
     # recreate the Titanic data frame and show the three way breakdown
    + titanic<-data.frame(
    +  class=c(rep("1st",325),rep("2nd",285),rep("3rd",706),rep("Crew",885)),
    +  age=c(rep("Adult",319),rep("Child",6),rep("Adult",261),rep("Child",24),
    +  rep("Adult",627),rep("Child",79),rep("Adult",885)),
    +  sex=c(rep("M",175),rep("F",144),rep("M",5),rep("F",1),
    +  rep("M",168),rep("F",93),rep("M",11),rep("F",13),
    +  rep("M",462),rep("F",165),rep("M",48),rep("F",31),
    +  rep("M",862),rep("F",23)),
    +  survived=c(rep("Yes",57),rep("No",118),rep("Yes",140),rep("No",4),rep("Yes",6),
    +  rep("Yes",14),rep("No",154),rep("Yes",80),rep("No",13),rep("Yes",24),
    +  rep("Yes",75),rep("No",387),rep("Yes",76),rep("No",89),
    +  rep("Yes",13),rep("No",35),rep("Yes",14),rep("No",17),
    +  rep("Yes",192),rep("No",670),rep("Yes",20),rep("No",3)))
    + require(plotrix)
    + titanic.colors<-list("gray90",c("#0000ff","#7700ee","#aa00cc","#dd00aa"),
    +  c("#ddcc00","#ee9900"),c("pink","lightblue"))
    + barNest(survived~class+age+sex,titanic,col=titanic.colors,showall=TRUE,
    +  main="Titanic survival by class, age and sex",ylab="Proportion surviving",
    +  FUN=c("propbrk","binciWu","binciWl","valid.n"),shrink=0.15,trueval="Yes")
    +
    + barNest(survived~class+age+sex,titanic,col=titanic.colors,showall=TRUE,
    +  main="Titanic survival by class, age and sex (scaled bar widths)",
    +  ylab="Proportion surviving",FUN=c("propbrk","binciWu","binciWl","valid.n"),
    +  shrink=0.15,trueval="Yes",Nwidths=TRUE)
    +
    + # now show the actual numbers of passengers
    + barNest(survived~class+age+sex,titanic,col=titanic.colors,showall=TRUE,
    +  main="Titanic passengers and crew by class, age and sex",
    +  ylab="Number",FUN="valid.n",shrink=0.15)
    +
    + # to see this properly displayed, start a wide plot window
    + # x11(width=10)
    + test.df<-data.frame(Age=rnorm(100,35,10),
    +  Sex=sample(c("Male","Female"),100,TRUE),
    +  Marital=sample(c("Div","Mar","Sing","Wid"),100,TRUE),
    +  Employ=sample(c("FT","PT","Un"),100,TRUE))
    + test.col<-list(Overall="gray",Sex=c("pink","lightblue"),
    +  Marital=c("mediumpurple","orange","tan","lightgreen"),
    +  Employ=c("#1affd8","#caeecc","#ff90d0"))
    + barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Mean age (years)",
    +  main="Mean age by subgroups",errbars=TRUE,col=test.col)
    +
    + barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Mean age (years)",
    +  main="Mean age by subgroups (widths scaled to Ns)",errbars=TRUE,col=test.col,
    +  Nwidths=TRUE)
    +
    + # set up functions for 20th and 80th percentiles
    + q20<-function(x,na.rm=TRUE) return(quantile(x,probs=0.2,na.rm=TRUE))
    + q80<-function(x,na.rm=TRUE) return(quantile(x,probs=0.8,na.rm=TRUE))
    + # show the asymmetric dispersion measures
    + barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Mean age (years)",
    +  main="Use median and quantiles for dispersion",
    +  FUN=c("median","q80","q20","valid.n"),
    +  errbars=TRUE,col=test.col)
    +#> Error in q80(c(30.2729751788185, 42.0875306053113, 19.7104128534038, 37.374253451732, 21.871857535292, 42.4702858708636, 19.3748156535415, 35.7105335956778, 28.6046522979303, 26.5480426144814, 41.7524469808172, 46.5337579392521, 18.134952575578, 25.9718505077993, 48.1763369782387, 46.0018974454478, 47.0376783938691, 20.6872922311001, 48.8291086057034, 35.0312594041218, 34.2211317561242, 39.4142822592846, 36.2892289622369, 26.6978573963638, 29.9640709028839, 23.0635881799008, 27.4827667710908, 49.5584140300823, 26.713964672107, 37.8977446037578, 30.1994651572887, 28.9517064578479, 49.6011018039623, 36.496793540957, 20.666788997018, 34.8969668137141, 32.8776396516206, 25.9365982143577, 13.9784752110473, 53.93360463671, 25.3187416297593, 33.9739696362312, 37.3995957212182, 35.6089889324996, 13.2242397172451, 33.821398567506, 36.1229478740626, 35.0788619766754, 53.7774387154249, 56.5875655364964, 42.0971452224005, 42.6698337875431, 31.9178857917449, 45.1200184856141, 25.8094840306469, 40.6338007724989, 38.224827493153, 38.666743632573, 46.2983515341746, 25.5850192406856, 37.1783764294473, 49.154122930517, 31.1626695207393, 33.2591362641221, 32.7825548286618, 24.9047127751742, 39.8072526626885, 51.0440732826108, 19.8497547117929, 20.8397608550649, 43.7677732655608, 41.2413241262139, 56.1227728781614, 31.4387558427738, 24.3553579134843, 45.7711653845397, 46.8157556654405, 36.9839209464341, 30.9959475059186, 41.1615428073265, 54.7415674798341, 53.8466232423526, 19.1137945340634, 29.6007683588956, 23.3053853634955, 40.5910598857455, 16.8065275338205, 38.9334397239581, 35.4213410586766, 46.7966417694769, 32.4307882381581, 24.4366390219833, 36.9877720512642, 41.5053355166639, 38.4391333708039, 49.7753231212208, 35.7202569848562, 56.2644453405315, 20.2380309433499, 39.0788849977307), na.rm = TRUE): could not find function "q80"
    + barNest(formula=Employ~Sex+Marital,data=test.df,ylab="Proportion unemployed",
    +  main="Proportion unemployed by sex and marital status",
    +  FUN=c("propbrk","binciWu","binciWl","valid.n"),
    +  errbars=TRUE,col=test.col,trueval="Un")
    +
    + barNest(formula=Employ~Sex+Marital,data=test.df,ylab="Proportion unemployed",
    +  main="Proportion unemployed by sex and marital status (scaled bar widths)",
    +  FUN=c("propbrk","binciWu","binciWl","valid.n"),
    +  errbars=TRUE,col=test.col,trueval="Un",Nwidths=TRUE)
    +
    + barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Counts",
    +  main="Show the counts in subgroups (final level only)",FUN="valid.n",
    +  col=test.col,showall=FALSE,ylim=c(0,10))
    +
    + barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Counts",
    +  main="Show all the counts in subgroups",FUN="valid.n",mar=c(5,5,4,2),
    +  col=test.col)
    +
    + 
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/barNest.md b/reference/barNest.md new file mode 100644 index 0000000..d560764 --- /dev/null +++ b/reference/barNest.md @@ -0,0 +1,241 @@ +# Display a nested breakdown of numeric values + +Breaks down the elements of a data frame by one or more categorical +elements and displays the breakdown as a bar plot. + +## Usage + +``` r +barNest(formula=NULL,data=NULL,FUN=c("mean","sd","sd","valid.n"),ylim=NULL, + main="",xlab="",ylab="",shrink=0.1,errbars=FALSE,col=NA, + labelcex=1,lineht=NULL,showall=TRUE,Nwidths=FALSE,barlabels=NULL, + showlabels=TRUE,mar=NULL,arrow.cap=NULL,trueval=TRUE) +``` + +## Arguments + +- formula: + + A formula with a numeric element of a data frame on the left and one + or more categorical elements on the right. + +- data: + + A data frame containing the elements in `formula`. + +- FUN: + + The functions to apply to x. + +- ylim: + + Optional y limits for the plot, usually necessary for counts. + +- main: + + Title for the plot. + +- xlab,ylab: + + Axis labels for the plot. The x axis label is typically blank + +- shrink: + + The proportion to shrink the width of the bars at each level. + +- errbars: + + Whether to display error bars on the lowest level of breakdown. + +- col: + + The colors to use to fill the bars. See Details. + +- labelcex: + + Character size for the group labels. + +- lineht: + + The height of a line of text in the lower margin of the plot in user + units. This will be calculated by the function if a value is not + passed. + +- showall: + + Whether to display bars for the entire breakdown. + +- Nwidths: + + Whether to scale the widths of the bars to the number of observations. + +- barlabels: + + Optional group labels that may be useful if the factors used to break + down the numeric variable are fairly long strings. + +- showlabels: + + Whether to display the labels below the bars. + +- mar: + + If not NULL, a four element vector to set the plot margins. If new + margins are set, the user must reset the margins after the function + exits. + +- arrow.cap: + + The width of the "cap" on error bars in user units, calculated on the + basis of the number of bars in the final breakdown if NA. + +- trueval: + + If this is not NA, the call to `brkdnNest` will return the proportions + of the response variable that are equal to `trueval`. See Details. + +## Value + +The summary list produced by brkdnNest. + +## Details + +`barNest` displays a bar plot illustrating the hierarchic breakdown of +the elements of a data frame. The breakdown is performed by `brkdnNest` +and the actual display is performed by `drawNestedBars`. The heights of +the bars will be proportional to the values returned by the first +function in `FUN`. If `showall` is TRUE, the entire nested breakdown +will be displayed. This can be useful in visualizing the relationship +between groups and subgroups in a compact format. + +`barNest` assumes that there will be four breakdowns in the list +returned by `brkdnNest` in the order summary measure, upper dispersion +value, lower dispersion value and number of valid observations. If +`Nwidths=FALSE`, it may work with only three and if `errbars=FALSE` as +well, it may work with only one. + +If `Nwidths=TRUE`, the bar widths will be scaled to the relative number +of observations per group. When the numbers of observations are very +different, the labels for those bars with small numbers of observations +will probably overlap. + +A number of functions can be passed in the `FUN` argument. Three +functions, `propbrk`, `sumbrk` and `valid.n` will work as summary +measures, giving proportions or sums of particular values of a discrete +variable and counts in each group and subgroup respectively. Binomial +confidence limits can be added to the proportions returned by `propbrk` +with `binciWl` and `binciWu` as in the second last example. If `valid.n` +is the first element of `FUN`, the "overall" bar and label will be +suppressed, as they are not informative. It is up to the user to decide +whether any "error bars" displayed are meaningful. + +The colors of the bars are determined by `col`. If `showall` is FALSE, +the user only need pass a vector of colors, usually the same length as +the number of categories in the final (last on the right side) element +in the formula. If `showall` is TRUE and the user wants to color all of +the bars, a list with as many elements as there are levels in the +breakdown should be passed. Each element should be a vector of colors, +again usually the same length as the number of categories. As the +categorical variables are likely to be factors, it is important to +remember that the colors must be in the correct order for the levels of +the factors. When the levels are not in the default alphanumeric order, +it is quite easy to get this wrong. As a `barNest` plot with more than a +few factors and levels in each factor is quite dense, easily +distinguished colors for each level of the breakdown may be preferable. +As with some other plots, trying to cram too much information into a +single illustration may not work well. + +## Author + +Jim Lemon and Ofir Levy + +## References + +Lemon, J. & Levy, O. (2011) barNest: Illustrating nested summary +measures. Statistical Computing and Graphics Newsletter of the American +Statistical Association, 21(2): 5-10. + +## See also + +[brkdnNest](brkdnNest.md), [drawNestedBars](drawNestedBars.md), +superbarplot(UsingR) + +## Examples + +``` r + # recreate the Titanic data frame and show the three way breakdown + titanic<-data.frame( + class=c(rep("1st",325),rep("2nd",285),rep("3rd",706),rep("Crew",885)), + age=c(rep("Adult",319),rep("Child",6),rep("Adult",261),rep("Child",24), + rep("Adult",627),rep("Child",79),rep("Adult",885)), + sex=c(rep("M",175),rep("F",144),rep("M",5),rep("F",1), + rep("M",168),rep("F",93),rep("M",11),rep("F",13), + rep("M",462),rep("F",165),rep("M",48),rep("F",31), + rep("M",862),rep("F",23)), + survived=c(rep("Yes",57),rep("No",118),rep("Yes",140),rep("No",4),rep("Yes",6), + rep("Yes",14),rep("No",154),rep("Yes",80),rep("No",13),rep("Yes",24), + rep("Yes",75),rep("No",387),rep("Yes",76),rep("No",89), + rep("Yes",13),rep("No",35),rep("Yes",14),rep("No",17), + rep("Yes",192),rep("No",670),rep("Yes",20),rep("No",3))) + require(plotrix) + titanic.colors<-list("gray90",c("#0000ff","#7700ee","#aa00cc","#dd00aa"), + c("#ddcc00","#ee9900"),c("pink","lightblue")) + barNest(survived~class+age+sex,titanic,col=titanic.colors,showall=TRUE, + main="Titanic survival by class, age and sex",ylab="Proportion surviving", + FUN=c("propbrk","binciWu","binciWl","valid.n"),shrink=0.15,trueval="Yes") + + barNest(survived~class+age+sex,titanic,col=titanic.colors,showall=TRUE, + main="Titanic survival by class, age and sex (scaled bar widths)", + ylab="Proportion surviving",FUN=c("propbrk","binciWu","binciWl","valid.n"), + shrink=0.15,trueval="Yes",Nwidths=TRUE) + + # now show the actual numbers of passengers + barNest(survived~class+age+sex,titanic,col=titanic.colors,showall=TRUE, + main="Titanic passengers and crew by class, age and sex", + ylab="Number",FUN="valid.n",shrink=0.15) + + # to see this properly displayed, start a wide plot window + # x11(width=10) + test.df<-data.frame(Age=rnorm(100,35,10), + Sex=sample(c("Male","Female"),100,TRUE), + Marital=sample(c("Div","Mar","Sing","Wid"),100,TRUE), + Employ=sample(c("FT","PT","Un"),100,TRUE)) + test.col<-list(Overall="gray",Sex=c("pink","lightblue"), + Marital=c("mediumpurple","orange","tan","lightgreen"), + Employ=c("#1affd8","#caeecc","#ff90d0")) + barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Mean age (years)", + main="Mean age by subgroups",errbars=TRUE,col=test.col) + + barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Mean age (years)", + main="Mean age by subgroups (widths scaled to Ns)",errbars=TRUE,col=test.col, + Nwidths=TRUE) + + # set up functions for 20th and 80th percentiles + q20<-function(x,na.rm=TRUE) return(quantile(x,probs=0.2,na.rm=TRUE)) + q80<-function(x,na.rm=TRUE) return(quantile(x,probs=0.8,na.rm=TRUE)) + # show the asymmetric dispersion measures + barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Mean age (years)", + main="Use median and quantiles for dispersion", + FUN=c("median","q80","q20","valid.n"), + errbars=TRUE,col=test.col) +#> Error in q80(c(30.2729751788185, 42.0875306053113, 19.7104128534038, 37.374253451732, 21.871857535292, 42.4702858708636, 19.3748156535415, 35.7105335956778, 28.6046522979303, 26.5480426144814, 41.7524469808172, 46.5337579392521, 18.134952575578, 25.9718505077993, 48.1763369782387, 46.0018974454478, 47.0376783938691, 20.6872922311001, 48.8291086057034, 35.0312594041218, 34.2211317561242, 39.4142822592846, 36.2892289622369, 26.6978573963638, 29.9640709028839, 23.0635881799008, 27.4827667710908, 49.5584140300823, 26.713964672107, 37.8977446037578, 30.1994651572887, 28.9517064578479, 49.6011018039623, 36.496793540957, 20.666788997018, 34.8969668137141, 32.8776396516206, 25.9365982143577, 13.9784752110473, 53.93360463671, 25.3187416297593, 33.9739696362312, 37.3995957212182, 35.6089889324996, 13.2242397172451, 33.821398567506, 36.1229478740626, 35.0788619766754, 53.7774387154249, 56.5875655364964, 42.0971452224005, 42.6698337875431, 31.9178857917449, 45.1200184856141, 25.8094840306469, 40.6338007724989, 38.224827493153, 38.666743632573, 46.2983515341746, 25.5850192406856, 37.1783764294473, 49.154122930517, 31.1626695207393, 33.2591362641221, 32.7825548286618, 24.9047127751742, 39.8072526626885, 51.0440732826108, 19.8497547117929, 20.8397608550649, 43.7677732655608, 41.2413241262139, 56.1227728781614, 31.4387558427738, 24.3553579134843, 45.7711653845397, 46.8157556654405, 36.9839209464341, 30.9959475059186, 41.1615428073265, 54.7415674798341, 53.8466232423526, 19.1137945340634, 29.6007683588956, 23.3053853634955, 40.5910598857455, 16.8065275338205, 38.9334397239581, 35.4213410586766, 46.7966417694769, 32.4307882381581, 24.4366390219833, 36.9877720512642, 41.5053355166639, 38.4391333708039, 49.7753231212208, 35.7202569848562, 56.2644453405315, 20.2380309433499, 39.0788849977307), na.rm = TRUE): could not find function "q80" + barNest(formula=Employ~Sex+Marital,data=test.df,ylab="Proportion unemployed", + main="Proportion unemployed by sex and marital status", + FUN=c("propbrk","binciWu","binciWl","valid.n"), + errbars=TRUE,col=test.col,trueval="Un") + + barNest(formula=Employ~Sex+Marital,data=test.df,ylab="Proportion unemployed", + main="Proportion unemployed by sex and marital status (scaled bar widths)", + FUN=c("propbrk","binciWu","binciWl","valid.n"), + errbars=TRUE,col=test.col,trueval="Un",Nwidths=TRUE) + + barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Counts", + main="Show the counts in subgroups (final level only)",FUN="valid.n", + col=test.col,showall=FALSE,ylim=c(0,10)) + + barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab="Counts", + main="Show all the counts in subgroups",FUN="valid.n",mar=c(5,5,4,2), + col=test.col) + + +``` diff --git a/reference/barlabels-1.png b/reference/barlabels-1.png new file mode 100644 index 0000000..683ad24 Binary files /dev/null and b/reference/barlabels-1.png differ diff --git a/reference/barlabels-2.png b/reference/barlabels-2.png new file mode 100644 index 0000000..c548fd7 Binary files /dev/null and b/reference/barlabels-2.png differ diff --git a/reference/barlabels-3.png b/reference/barlabels-3.png new file mode 100644 index 0000000..1d069ff Binary files /dev/null and b/reference/barlabels-3.png differ diff --git a/reference/barlabels-4.png b/reference/barlabels-4.png new file mode 100644 index 0000000..d02d9f0 Binary files /dev/null and b/reference/barlabels-4.png differ diff --git a/reference/barlabels.html b/reference/barlabels.html new file mode 100644 index 0000000..21cc3a9 --- /dev/null +++ b/reference/barlabels.html @@ -0,0 +1,141 @@ + +Label the bars on a barplot — barlabels • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays labels on a plot, usually a bar plot.

    +
    + +
    +

    Usage

    +
    barlabels(xpos,ypos,labels=NULL,cex=1,prop=0.5,miny=0,offset=0,nobox=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    xpos
    +

    A vector, matrix or data frame of x positions for the labels.

    + +
    ypos
    +

    A vector, matrix or data frame of y values for the labels.

    + +
    labels
    +

    The labels to display. Defaults to the values of ypos.

    + +
    cex
    +

    Relative size of the labels. See text.

    + +
    prop
    +

    The proportion of ypos at which to place the labels. + Defaults to 0.5 (the middle).

    + +
    miny
    +

    The minimum value at which to display labels.

    + +
    offset
    +

    Amount to horizontally offset successive labels in case + of vertical overlaps.

    + +
    nobox
    +

    Whether to call boxed.labels or text.

    + +
    ...
    +

    Extra arguments passed to boxed.labels or text.

    + +
    +
    +

    Details

    +

    barlabels places labels on a plot at horizontal positions xpos + and vertical positions ypos * prop. The typical use of this + function is to place labels on bars, by default in the middle of the bars.

    +

    To put labels just over the tops of the bars, set prop to 1 and add a + constant amount to ypos.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     heights<-c(14,20,9,31,17)
    + barpos<-barplot(heights,main="A redundant bar plot")
    + # show the usual value labels on the bars
    + barlabels(barpos,heights)
    +
    + # now with stacked bars and offsets
    + heights<-matrix(sample(c(1,2,10,15),20,TRUE),ncol=4)
    + barpos<-barplot(heights,main="A redundant stacked bar plot")
    + barlabels(barpos,heights,offset=0.1)
    +
    + # do it again without stacking
    + barpos<-barplot(heights,main="An unstacked redundant bar plot",
    +  beside=TRUE)
    + barlabels(barpos,heights)
    +
    + # finally use barp for the plot
    + barpos<-barp(heights,main="A fourth and final bar plot",col=2:6,
    +  names.arg=paste("Day",1:4))
    + barlabels(barpos$x,barpos$y,matrix(LETTERS[1:5],nrow=5,ncol=4))
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/barlabels.md b/reference/barlabels.md new file mode 100644 index 0000000..8ca097a --- /dev/null +++ b/reference/barlabels.md @@ -0,0 +1,94 @@ +# Label the bars on a barplot + +Displays labels on a plot, usually a bar plot. + +## Usage + +``` r +barlabels(xpos,ypos,labels=NULL,cex=1,prop=0.5,miny=0,offset=0,nobox=FALSE,...) +``` + +## Arguments + +- xpos: + + A vector, matrix or data frame of x positions for the labels. + +- ypos: + + A vector, matrix or data frame of y values for the labels. + +- labels: + + The labels to display. Defaults to the values of ypos. + +- cex: + + Relative size of the labels. See `text`. + +- prop: + + The proportion of `ypos` at which to place the labels. Defaults to 0.5 + (the middle). + +- miny: + + The minimum value at which to display labels. + +- offset: + + Amount to horizontally offset successive labels in case of vertical + overlaps. + +- nobox: + + Whether to call `boxed.labels` or `text`. + +- ...: + + Extra arguments passed to `boxed.labels` or `text`. + +## Details + +`barlabels` places labels on a plot at horizontal positions `xpos` and +vertical positions `ypos` \* `prop`. The typical use of this function is +to place labels on bars, by default in the middle of the bars. + +To put labels just over the tops of the bars, set `prop` to 1 and add a +constant amount to `ypos`. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[boxed.labels](boxed.labels.md) + +## Examples + +``` r + heights<-c(14,20,9,31,17) + barpos<-barplot(heights,main="A redundant bar plot") + # show the usual value labels on the bars + barlabels(barpos,heights) + + # now with stacked bars and offsets + heights<-matrix(sample(c(1,2,10,15),20,TRUE),ncol=4) + barpos<-barplot(heights,main="A redundant stacked bar plot") + barlabels(barpos,heights,offset=0.1) + + # do it again without stacking + barpos<-barplot(heights,main="An unstacked redundant bar plot", + beside=TRUE) + barlabels(barpos,heights) + + # finally use barp for the plot + barpos<-barp(heights,main="A fourth and final bar plot",col=2:6, + names.arg=paste("Day",1:4)) + barlabels(barpos$x,barpos$y,matrix(LETTERS[1:5],nrow=5,ncol=4)) +``` diff --git a/reference/barp-1.png b/reference/barp-1.png new file mode 100644 index 0000000..a24e0e6 Binary files /dev/null and b/reference/barp-1.png differ diff --git a/reference/barp-2.png b/reference/barp-2.png new file mode 100644 index 0000000..6a58203 Binary files /dev/null and b/reference/barp-2.png differ diff --git a/reference/barp-3.png b/reference/barp-3.png new file mode 100644 index 0000000..2d534a6 Binary files /dev/null and b/reference/barp-3.png differ diff --git a/reference/barp-4.png b/reference/barp-4.png new file mode 100644 index 0000000..d417615 Binary files /dev/null and b/reference/barp-4.png differ diff --git a/reference/barp.html b/reference/barp.html new file mode 100644 index 0000000..0bd39a0 --- /dev/null +++ b/reference/barp.html @@ -0,0 +1,268 @@ + +A bar plotting routine — barp • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display a bar plot

    +
    + +
    +

    Usage

    +
    barp(height,width=0.4,names.arg=NULL,legend.lab=NULL,legend.pos=NULL,
    + col=NULL,border=par("fg"),main=NULL,xlab="",ylab="",xlim=NULL,ylim=NULL,
    + x=NULL,staxx=FALSE,staxy=FALSE, height.at=NULL,height.lab=NULL,
    + cex.axis=par("cex.axis"),pch=NULL,cylindrical=FALSE,shadow=FALSE,
    + do.first=NULL,ylog=FALSE,srt=NULL,...)
    +
    + +
    +

    Arguments

    +

    +
    height
    +

    A numeric vector, matrix or data frame that will be represented + as the heights of bars.

    + +
    width
    +

    Half the width of a single bar or group of bars in X axis units.

    + +
    names.arg
    +

    The labels for the bars or groups of bars.

    + +
    legend.lab
    +

    Labels for an optional legend. If NULL, no legend is + displayed.

    + +
    legend.pos
    +

    Optional position for the legend as a list with x + and y components. If this is NULL, locator will be called.

    + +
    col
    +

    The fill colors for the bars. The default is no fill.

    + +
    border
    +

    The border for the bars.

    + +
    main
    +

    The title at the top of the plot.

    + +
    xlab,ylab
    +

    The labels for the X and Y axes respectively.

    + +
    xlim,ylim
    +

    Optional horizontal and vertical limits for the plot.

    + +
    x
    +

    Optional horizontal positions for the bars. Defaults to 1:length(height).

    + +
    staxx,staxy
    +

    Whether to use staxlab to stagger the + X or Y axis tick labels. Can also omit the X or Y axes.

    + +
    height.at
    +

    Optional positions of the tick marks on the Y axis.

    + +
    height.lab
    +

    Optional tick labels for the Y axis.

    + +
    cex.axis
    +

    Character expansion for the axis labels.

    + +
    pch
    +

    Symbol(s) to fill the bars. See Details.

    + +
    cylindrical
    +

    Whether to give the bars a cylindrical appearance + by shading them.

    + +
    shadow
    +

    Whether to place a shadow behind the bars.

    + +
    do.first
    +

    An optional string that will be evaluated before anything + else is displayed on the plot. Useful for background colors or lines.

    + +
    ylog
    +

    Logical for whether a log scale is to be used. see details.

    + +
    srt
    +

    Rotation of axis labels if staxx or staxy is TRUE (see + staxlab).

    + +
    ...
    +

    arguments passed to plot

    +

    .

    +
    +
    +

    Value

    +

    A list containing two components of the same form as height:

    +
    x
    +

    The centers of the bars displayed.

    + +
    y
    +

    The heights of the bars.

    + +
    +
    +

    Details

    +

    barp displays a bar plot similar to barplot but with axes and + horizontal bar positions more like plot. Bars or groups of bars are + centered on integral X values by default, and so both the width and spacing of + the bars are controlled by a single number. If the user passes explicit x + values, those values will determine the spacing. If height is a vector, + single bars representing each value will be displayed centered at + 1:length(height) unless the user has specified x values. + If height is a matrix, 2D array, or data frame, a group of bars will be + drawn for each column, with the values of the group taken from the rows of that + column. Explicit x values cannot be used with a matrix, however, by adjusting the + values of x, grouped bars can be displayed.

    +

    The values from freq or brkdn in the prettyR package can + be used as the height argument. The value from table can also be + passed as height, as can a 2D array returned from the by function.

    +

    Bars are empty by default but fill colors can be defined in several ways. + If a single color is passed, all bars will be the same color. If height + is a vector, colors will be recycled or some will be ignored if the length of + col is + not equal to that of height. If height is a matrix or data frame, + the user may pass a vector of colors equal to the number of rows in height + or a matrix of colors of the same dimensions as height. Other sequences + of color will probably not result in an easy to interpret plot.

    +

    barp is intended to simplify illustrating categorical data for which both + the variable designations and the categories are names, as on many multiple + choice questions. height.at and height.lab allow the user to place + labels on the vertical axis, usually representing the options. If staxx + or staxy are TRUE, the labels on the horizontal or vertical axes + respectively will be staggered, allowing the user to use many or lengthy variable + or value labels. If srt is not NULL, these labels will be rotated + counterclockwise by that value as angles in degrees instead of staggered.

    +

    If staxx or staxy are set to NA, the respective axis will not + be displayed.

    +

    barp allows two enhancements that may be useful in those areas where fancy + plots are appreciated. One is to give the bars a cylindrical look by shading the + color. The other is to place an apparent shadow behind each bar. Both of these + effects appear as though the light is coming from the upper left, and this is + hard coded. You can add error bars by calling dispersion, but many advise + against this.

    +

    If legend.lab is not NULL, a legend will be displayed. If + legend.pos is NULL, locator is called to place the legend. On + Windows, the alert may not appear on the console, and the function will + appear to hang unless the user clicks on the console window or the plot.

    +

    The ylog argument produces a log scale on the y axis. Currently, + neither pretty nor axTicks seems to produce a nice set of axis + ticks, so it is best to pass the positions of these in height.at.

    +

    If the pch argument is not NULL, barp will display white bars filled + with the symbols specified in pch. With grouped bars, this must be a + matrix with the same form as the col argument. This option allows a + black and white bar plot to be produced.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     # get some extra room on the left
    + par(mar=c(5,5,4,2))
    + # make up some happiness data, as so many seem to do
    + happyday<-data.frame(Monday=c(2.3,3.4),Tuesday=c(2.8,3.3),Wednesday=c(3.2,3.1),
    + Thursday=c(3.6,2.8),Friday=c(4.2,2.6),Saturday=c(4.5,2.9),Sunday=c(4.1,2.8))
    + happylabels<-c("Utterly dashed","Rather mopey","Indifferent","Somewhat elated",
    +  "Euphoric")
    + barp(happyday,names.arg=names(happyday),legend.lab=c("Slaves","Unemployed"),
    +  legend.pos=list(x=2,y=4.5),col=c("#ee7700","#3333ff"),main="9AM happiness by weekday",
    +  xlab="Day of week",ylab="Happiness rating",ylim=c(1,5),staxx=TRUE,staxy=TRUE,
    +  height.at=1:5,height.lab=happylabels,cex.axis=0.9,cylindrical=TRUE,
    +  shadow=TRUE)
    +
    + # now do a plot with colors scaled to the sex ratio (real data!)
    + sexratio<-c(0.24,0.35,0.09,0.59,0.63,0.34,0.7,0.6)
    + # the fun ratings are once again a pack of lies
    + funrating<-c(3.2,3.5,1.5,5.4,4.5,2.7,6.8,4.9)
    + funstudy<-c("Astronomy","Chemistry","Economics","Anthropology","Linguistics",
    +  "Math/Stats","Psychology","Sociology")
    + funlabels<-c("Torture","Agony","Boredom","Neutral","Entertaining","Exhilarating",
    +  "Maniacal")
    + # xrange is used to get the colors to match the 0-100% scale
    + barp(funrating,names.arg=funstudy,main="Fun ratings for various areas of study",
    +  col=color.scale(sexratio,c(0.2,1),c(0.2,0.4),c(1,0.4),xrange=c(0,1)),
    +  xlab="Study",ylab="Rating",height.at=1:7,height.lab=funlabels,ylim=c(1,7),
    +  staxx=TRUE,staxy=TRUE,cex.axis=0.9)
    + # here we want the full scale from zero to one
    + color.legend(2,6,4,6.4,legend=c("100% guys","100% girls"),
    +  rect.col=color.scale(seq(0,1,by=0.25),c(0.2,1),c(0.2,0.4),c(1,0.4)))
    +
    + par(mar=c(5,4,4,2))
    + # use barp to display a multiple histogram with a shaded background
    + # notice how the expression uses local variables inside the barp function
    + gradbg<-"gradient.rect(xlim[1],ylim[1],xlim[2],ylim[2],
    +  c(1,0.5,1),c(1,0.5,1),c(1,0.5,1),gradient=\"y\",nslices=100)"
    + h1<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2)))
    + h2<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2)))
    + h3<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2)))
    + hmat<-matrix(c(h1,h2,h3),nrow=3,byrow=TRUE)
    + barp(hmat,names.arg=names(h1),width=0.45,col=2:4,do.first=gradbg,
    +  main="Multiple histogram using barp",xlab="Bins",ylab="Frequency")
    + legend(3.8,50,c("h1","h2","h3"),fill=2:4)
    +
    + # now display a positive/negative plot
    + barp(c(2,-3,4,-5,6,-7,8),main="Positive/negative plot",
    +  xlab="Alternating colors",ylab="For alternating values",
    +  col=2+(c(2,-3,4,-5,6,-7,8)>0))
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/barp.md b/reference/barp.md new file mode 100644 index 0000000..ee3c3ef --- /dev/null +++ b/reference/barp.md @@ -0,0 +1,246 @@ +# A bar plotting routine + +Display a bar plot + +## Usage + +``` r +barp(height,width=0.4,names.arg=NULL,legend.lab=NULL,legend.pos=NULL, + col=NULL,border=par("fg"),main=NULL,xlab="",ylab="",xlim=NULL,ylim=NULL, + x=NULL,staxx=FALSE,staxy=FALSE, height.at=NULL,height.lab=NULL, + cex.axis=par("cex.axis"),pch=NULL,cylindrical=FALSE,shadow=FALSE, + do.first=NULL,ylog=FALSE,srt=NULL,...) +``` + +## Arguments + +- height: + + A numeric vector, matrix or data frame that will be represented as the + heights of bars. + +- width: + + Half the width of a single bar or group of bars in X axis units. + +- names.arg: + + The labels for the bars or groups of bars. + +- legend.lab: + + Labels for an optional legend. If NULL, no legend is displayed. + +- legend.pos: + + Optional position for the legend as a list with `x` and `y` + components. If this is NULL, `locator` will be called. + +- col: + + The fill colors for the bars. The default is no fill. + +- border: + + The border for the bars. + +- main: + + The title at the top of the plot. + +- xlab,ylab: + + The labels for the X and Y axes respectively. + +- xlim,ylim: + + Optional horizontal and vertical limits for the plot. + +- x: + + Optional horizontal positions for the bars. Defaults to + 1:length(height). + +- staxx,staxy: + + Whether to use [staxlab](staxlab.md) to stagger the X or Y axis tick + labels. Can also omit the X or Y axes. + +- height.at: + + Optional positions of the tick marks on the Y axis. + +- height.lab: + + Optional tick labels for the Y axis. + +- cex.axis: + + Character expansion for the axis labels. + +- pch: + + Symbol(s) to fill the bars. See Details. + +- cylindrical: + + Whether to give the bars a cylindrical appearance by shading them. + +- shadow: + + Whether to place a shadow behind the bars. + +- do.first: + + An optional string that will be evaluated before anything else is + displayed on the plot. Useful for background colors or lines. + +- ylog: + + Logical for whether a log scale is to be used. see details. + +- srt: + + Rotation of axis labels if staxx or staxy is TRUE (see `staxlab`). + +- ...: + + arguments passed to `plot` + +. + +## Value + +A list containing two components of the same form as `height`: + +- x: + + The centers of the bars displayed. + +- y: + + The heights of the bars. + +## Details + +`barp` displays a bar plot similar to `barplot` but with axes and +horizontal bar positions more like `plot`. Bars or groups of bars are +centered on integral X values by default, and so both the width and +spacing of the bars are controlled by a single number. If the user +passes explicit `x` values, those values will determine the spacing. If +`height` is a vector, single bars representing each value will be +displayed centered at `1:length(height)` unless the user has specified +`x` values. If `height` is a matrix, 2D array, or data frame, a group of +bars will be drawn for each column, with the values of the group taken +from the rows of that column. Explicit x values cannot be used with a +matrix, however, by adjusting the values of x, grouped bars can be +displayed. + +The values from `freq` or `brkdn` in the prettyR package can be used as +the `height` argument. The value from `table` can also be passed as +`height`, as can a 2D array returned from the `by` function. + +Bars are empty by default but fill colors can be defined in several +ways. If a single color is passed, all bars will be the same color. If +`height` is a vector, colors will be recycled or some will be ignored if +the length of `col` is not equal to that of `height`. If `height` is a +matrix or data frame, the user may pass a vector of colors equal to the +number of rows in `height` or a matrix of colors of the same dimensions +as `height`. Other sequences of color will probably not result in an +easy to interpret plot. + +`barp` is intended to simplify illustrating categorical data for which +both the variable designations and the categories are names, as on many +multiple choice questions. `height.at` and `height.lab` allow the user +to place labels on the vertical axis, usually representing the options. +If `staxx` or `staxy` are TRUE, the labels on the horizontal or vertical +axes respectively will be staggered, allowing the user to use many or +lengthy variable or value labels. If `srt` is not NULL, these labels +will be rotated counterclockwise by that value as angles in degrees +instead of staggered. + +If `staxx` or `staxy` are set to NA, the respective axis will not be +displayed. + +`barp` allows two enhancements that may be useful in those areas where +fancy plots are appreciated. One is to give the bars a cylindrical look +by shading the color. The other is to place an apparent shadow behind +each bar. Both of these effects appear as though the light is coming +from the upper left, and this is hard coded. You can add error bars by +calling `dispersion`, but many advise against this. + +If `legend.lab` is not NULL, a legend will be displayed. If `legend.pos` +is NULL, `locator` is called to place the legend. On Windows, the alert +may not appear on the console, and the function will appear to hang +unless the user clicks on the console window or the plot. + +The `ylog` argument produces a log scale on the y axis. Currently, +neither `pretty` nor `axTicks` seems to produce a nice set of axis +ticks, so it is best to pass the positions of these in `height.at`. + +If the `pch` argument is not NULL, barp will display white bars filled +with the symbols specified in `pch`. With grouped bars, this must be a +matrix with the same form as the `col` argument. This option allows a +black and white bar plot to be produced. + +## Author + +Jim Lemon + +## See also + +[staxlab](staxlab.md), +[barplot](https://rdrr.io/r/graphics/barplot.html), +[cylindrect](cylindrect.md), [gradient.rect](gradient.rect.md) + +## Examples + +``` r + # get some extra room on the left + par(mar=c(5,5,4,2)) + # make up some happiness data, as so many seem to do + happyday<-data.frame(Monday=c(2.3,3.4),Tuesday=c(2.8,3.3),Wednesday=c(3.2,3.1), + Thursday=c(3.6,2.8),Friday=c(4.2,2.6),Saturday=c(4.5,2.9),Sunday=c(4.1,2.8)) + happylabels<-c("Utterly dashed","Rather mopey","Indifferent","Somewhat elated", + "Euphoric") + barp(happyday,names.arg=names(happyday),legend.lab=c("Slaves","Unemployed"), + legend.pos=list(x=2,y=4.5),col=c("#ee7700","#3333ff"),main="9AM happiness by weekday", + xlab="Day of week",ylab="Happiness rating",ylim=c(1,5),staxx=TRUE,staxy=TRUE, + height.at=1:5,height.lab=happylabels,cex.axis=0.9,cylindrical=TRUE, + shadow=TRUE) + + # now do a plot with colors scaled to the sex ratio (real data!) + sexratio<-c(0.24,0.35,0.09,0.59,0.63,0.34,0.7,0.6) + # the fun ratings are once again a pack of lies + funrating<-c(3.2,3.5,1.5,5.4,4.5,2.7,6.8,4.9) + funstudy<-c("Astronomy","Chemistry","Economics","Anthropology","Linguistics", + "Math/Stats","Psychology","Sociology") + funlabels<-c("Torture","Agony","Boredom","Neutral","Entertaining","Exhilarating", + "Maniacal") + # xrange is used to get the colors to match the 0-100% scale + barp(funrating,names.arg=funstudy,main="Fun ratings for various areas of study", + col=color.scale(sexratio,c(0.2,1),c(0.2,0.4),c(1,0.4),xrange=c(0,1)), + xlab="Study",ylab="Rating",height.at=1:7,height.lab=funlabels,ylim=c(1,7), + staxx=TRUE,staxy=TRUE,cex.axis=0.9) + # here we want the full scale from zero to one + color.legend(2,6,4,6.4,legend=c("100% guys","100% girls"), + rect.col=color.scale(seq(0,1,by=0.25),c(0.2,1),c(0.2,0.4),c(1,0.4))) + + par(mar=c(5,4,4,2)) + # use barp to display a multiple histogram with a shaded background + # notice how the expression uses local variables inside the barp function + gradbg<-"gradient.rect(xlim[1],ylim[1],xlim[2],ylim[2], + c(1,0.5,1),c(1,0.5,1),c(1,0.5,1),gradient=\"y\",nslices=100)" + h1<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2))) + h2<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2))) + h3<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2))) + hmat<-matrix(c(h1,h2,h3),nrow=3,byrow=TRUE) + barp(hmat,names.arg=names(h1),width=0.45,col=2:4,do.first=gradbg, + main="Multiple histogram using barp",xlab="Bins",ylab="Frequency") + legend(3.8,50,c("h1","h2","h3"),fill=2:4) + + # now display a positive/negative plot + barp(c(2,-3,4,-5,6,-7,8),main="Positive/negative plot", + xlab="Alternating colors",ylab="For alternating values", + col=2+(c(2,-3,4,-5,6,-7,8)>0)) +``` diff --git a/reference/battleship.plot-1.png b/reference/battleship.plot-1.png new file mode 100644 index 0000000..f92b945 Binary files /dev/null and b/reference/battleship.plot-1.png differ diff --git a/reference/battleship.plot.html b/reference/battleship.plot.html new file mode 100644 index 0000000..c5b3b0f --- /dev/null +++ b/reference/battleship.plot.html @@ -0,0 +1,154 @@ + +Display a matrix of values as the widths of stacked rectangles — battleship.plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    battleship.plot displays a matrix of rectangles, with widths + proportional to the values in x. The values are scaled so that half the + width of the largest rectangle is equal to maxxspan in user units. This + prevents the rectangles from overlapping. The user can adjust the spacing of the + stacks of rectangles by changing maxxspan. Similarly, maxyspan controls + the spacing between rectangles in the vertical direction.

    +

    The labels for each stack of plots (the columns of x) are displayed at the top + of the plot, angled at 45 degrees. The labels for each row of rectangles in the + stacks (the rows of x) are displayed at the left. Long labels for either may + require adjusting the mar argument.

    +

    The function will try to extract the labels xaxlab and yaxlab from + the matrix column and row names respectively if none are passed.

    +
    + +
    +

    Usage

    +
    battleship.plot(x,mar=c(2,5,5,1),col="white",border="black",
    + main="",xlab="",ylab="",xaxlab=NULL,yaxlab=NULL,cex.labels=1,
    + maxxspan=0.45,maxyspan=0.45)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A matrix or data frame containing numeric values. See the example.

    + +
    mar
    +

    Margins for the plot.

    + +
    col
    +

    The fill colors for the rectangles.

    + +
    border
    +

    The border colors for the rectangles.

    + +
    main
    +

    The title for the plot (i.e. main).

    + +
    xlab,ylab
    +

    The x and y axis labels.

    + +
    xaxlab,yaxlab
    +

    Optional labels for the rows and columns.

    + +
    cex.labels
    +

    Character expansion for the row and column labels.

    + +
    maxxspan,maxyspan
    +

    Scaling factor for the widths and heights of the + rectangles so that they don't overlap.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon - thanks to Adam Maltese for the suggestion

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     x<-matrix(sample(10:50,100,TRUE),10)
    + xaxlab=c("One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten")
    + yaxlab=c("First","Second","Third","Fourth","Fifth","Sixth","Seventh",
    +  "Eighth","Ninth","Tenth")
    + battleship.plot(x,xlab="The battle has just begun",main="Battleship1",
    +  xaxlab=xaxlab,yaxlab=yaxlab)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/battleship.plot.md b/reference/battleship.plot.md new file mode 100644 index 0000000..7294916 --- /dev/null +++ b/reference/battleship.plot.md @@ -0,0 +1,88 @@ +# Display a matrix of values as the widths of stacked rectangles + +`battleship.plot` displays a matrix of rectangles, with widths +proportional to the values in `x`. The values are scaled so that half +the width of the largest rectangle is equal to `maxxspan` in user units. +This prevents the rectangles from overlapping. The user can adjust the +spacing of the stacks of rectangles by changing `maxxspan`. Similarly, +maxyspan controls the spacing between rectangles in the vertical +direction. + +The labels for each stack of plots (the columns of x) are displayed at +the top of the plot, angled at 45 degrees. The labels for each row of +rectangles in the stacks (the rows of x) are displayed at the left. Long +labels for either may require adjusting the `mar` argument. + +The function will try to extract the labels `xaxlab` and `yaxlab` from +the matrix column and row names respectively if none are passed. + +## Usage + +``` r +battleship.plot(x,mar=c(2,5,5,1),col="white",border="black", + main="",xlab="",ylab="",xaxlab=NULL,yaxlab=NULL,cex.labels=1, + maxxspan=0.45,maxyspan=0.45) +``` + +## Arguments + +- x: + + A matrix or data frame containing numeric values. See the example. + +- mar: + + Margins for the plot. + +- col: + + The fill colors for the rectangles. + +- border: + + The border colors for the rectangles. + +- main: + + The title for the plot (i.e. `main`). + +- xlab,ylab: + + The x and y axis labels. + +- xaxlab,yaxlab: + + Optional labels for the rows and columns. + +- cex.labels: + + Character expansion for the row and column labels. + +- maxxspan,maxyspan: + + Scaling factor for the widths and heights of the rectangles so that + they don't overlap. + +## Value + +nil + +## Author + +Jim Lemon - thanks to Adam Maltese for the suggestion + +## See also + +[plot](https://rdrr.io/r/graphics/plot.default.html), +[staxlab](staxlab.md) + +## Examples + +``` r + x<-matrix(sample(10:50,100,TRUE),10) + xaxlab=c("One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten") + yaxlab=c("First","Second","Third","Fourth","Fifth","Sixth","Seventh", + "Eighth","Ninth","Tenth") + battleship.plot(x,xlab="The battle has just begun",main="Battleship1", + xaxlab=xaxlab,yaxlab=yaxlab) +``` diff --git a/reference/bin.wind.records.html b/reference/bin.wind.records.html new file mode 100644 index 0000000..20ba010 --- /dev/null +++ b/reference/bin.wind.records.html @@ -0,0 +1,121 @@ + +Classify wind direction and speed records — bin.wind.records • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Classifies wind direction and speed records into a matrix of + percentages of observations in speed and direction bins.

    +
    + +
    +

    Usage

    +
    bin.wind.records(winddir,windspeed,ndir=8,radians=FALSE,
    +  speed.breaks=c(0,10,20,30))
    +
    + +
    +

    Arguments

    +

    +
    winddir
    +

    A vector of wind directions.

    + +
    windspeed
    +

    A vector of wind speeds corresponding to the above + directions.

    + +
    ndir
    +

    Number of direction bins in a compass circle.

    + +
    radians
    +

    Whether wind directions are in radians.

    + +
    speed.breaks
    +

    Minimum wind speed for each speed bin.

    + +
    +
    +

    Details

    +

    bin.wind.records bins a number of wind direction and speed + records into a matrix of percentages of observations that can be used to + display a cumulative wind rose with oz.windrose The defaults are those + used by the Australian Bureau of Meteorology.

    +
    +
    +

    Value

    +

    A matrix of percentages in which the rows represent wind speed categories and + the columns represent wind direction categories.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     winddir<-sample(0:360,100,TRUE)
    + windspeed<-sample(0:40,100,TRUE)
    + bin.wind.records(winddir,windspeed)
    +#>      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
    +#> [1,]    0    1    3    1    1    1    0    3
    +#> [2,]    3    4    2    1    3    0    5    2
    +#> [3,]    4    0    4    4    2    4    2    3
    +#> [4,]    1    3    0    1    2    2    3    7
    +#> [5,]    3    4    3    2    6    3    3    4
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/bin.wind.records.md b/reference/bin.wind.records.md new file mode 100644 index 0000000..08fd6da --- /dev/null +++ b/reference/bin.wind.records.md @@ -0,0 +1,67 @@ +# Classify wind direction and speed records + +Classifies wind direction and speed records into a matrix of percentages +of observations in speed and direction bins. + +## Usage + +``` r +bin.wind.records(winddir,windspeed,ndir=8,radians=FALSE, + speed.breaks=c(0,10,20,30)) +``` + +## Arguments + +- winddir: + + A vector of wind directions. + +- windspeed: + + A vector of wind speeds corresponding to the above directions. + +- ndir: + + Number of direction bins in a compass circle. + +- radians: + + Whether wind directions are in radians. + +- speed.breaks: + + Minimum wind speed for each speed bin. + +## Details + +`bin.wind.records` bins a number of wind direction and speed records +into a matrix of percentages of observations that can be used to display +a cumulative wind rose with `oz.windrose` The defaults are those used by +the Australian Bureau of Meteorology. + +## Value + +A matrix of percentages in which the rows represent wind speed +categories and the columns represent wind direction categories. + +## Author + +Jim Lemon + +## See also + +[oz.windrose](oz.windrose.md) + +## Examples + +``` r + winddir<-sample(0:360,100,TRUE) + windspeed<-sample(0:40,100,TRUE) + bin.wind.records(winddir,windspeed) +#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] +#> [1,] 0 1 3 1 1 1 0 3 +#> [2,] 3 4 2 1 3 0 5 2 +#> [3,] 4 0 4 4 2 4 2 3 +#> [4,] 1 3 0 1 2 2 3 7 +#> [5,] 3 4 3 2 6 3 3 4 +``` diff --git a/reference/binciW.html b/reference/binciW.html new file mode 100644 index 0000000..cd02358 --- /dev/null +++ b/reference/binciW.html @@ -0,0 +1,105 @@ + +Binomial confidence limits — binciW • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Calculates binomial confidence limits using the Wilson approximation.

    +
    + +
    +

    Usage

    +
    binciW(x,n,alpha=0.05,cc=FALSE)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    The number of successes or failures for which the CI is to be calculated.

    + +
    n
    +

    The number of trials as above.

    + +
    alpha
    +

    The desired coverage - 0.05 produces 95 percent coverage

    + +
    cc
    +

    Whether to apply a continuity correction

    + +
    +
    +

    Details

    +

    binciW calculates binomial confidence limits for the + given number of successes and trials. It is mainly to allow binomial + confidence limits to be calculated in the brkdnNest function, + which is why the upper and lower CIs are called separately.

    +
    +
    +

    Value

    +

    The lower and upper binomial confidence limits

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     binciW(5,42)
    +#> [1] 0.05193803 0.25000390
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/binciW.md b/reference/binciW.md new file mode 100644 index 0000000..90f2f47 --- /dev/null +++ b/reference/binciW.md @@ -0,0 +1,54 @@ +# Binomial confidence limits + +Calculates binomial confidence limits using the Wilson approximation. + +## Usage + +``` r +binciW(x,n,alpha=0.05,cc=FALSE) +``` + +## Arguments + +- x: + + The number of successes or failures for which the CI is to be + calculated. + +- n: + + The number of trials as above. + +- alpha: + + The desired coverage - 0.05 produces 95 percent coverage + +- cc: + + Whether to apply a continuity correction + +## Details + +`binciW` calculates binomial confidence limits for the given number of +successes and trials. It is mainly to allow binomial confidence limits +to be calculated in the `brkdnNest` function, which is why the upper and +lower CIs are called separately. + +## Value + +The lower and upper binomial confidence limits + +## Author + +Jim Lemon + +## See also + +[binciWl](binciWl.md), [binciWu](binciWu.md) + +## Examples + +``` r + binciW(5,42) +#> [1] 0.05193803 0.25000390 +``` diff --git a/reference/binciWl.html b/reference/binciWl.html new file mode 100644 index 0000000..2217ce1 --- /dev/null +++ b/reference/binciWl.html @@ -0,0 +1,105 @@ + +Lower binomial confidence limit — binciWl • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Returns the lower binomial confidence limit using the Wilson approximation.

    +
    + +
    +

    Usage

    +
    binciWl(x,n,alpha=0.05,trueval=TRUE,na.rm=TRUE)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    The number of successes or failures for which the CI is to be calculated.

    + +
    n
    +

    The number of trials as above.

    + +
    alpha
    +

    The desired coverage - 0.05 produces 95 percent coverage

    + +
    trueval
    +

    The value representing the outcome of interest for the CI.

    + +
    na.rm
    +

    Argument needed to make this work

    + +
    +
    +

    Details

    +

    binciWl now calls binciW and returns the lower limit.

    +
    +
    +

    Value

    +

    The lower binomial confidence limit

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     binciWl(c(rep(5,TRUE),rep(37,FALSE)))
    +#> [1] 0
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/binciWl.md b/reference/binciWl.md new file mode 100644 index 0000000..c3bf44c --- /dev/null +++ b/reference/binciWl.md @@ -0,0 +1,56 @@ +# Lower binomial confidence limit + +Returns the lower binomial confidence limit using the Wilson +approximation. + +## Usage + +``` r +binciWl(x,n,alpha=0.05,trueval=TRUE,na.rm=TRUE) +``` + +## Arguments + +- x: + + The number of successes or failures for which the CI is to be + calculated. + +- n: + + The number of trials as above. + +- alpha: + + The desired coverage - 0.05 produces 95 percent coverage + +- trueval: + + The value representing the outcome of interest for the CI. + +- na.rm: + + Argument needed to make this work + +## Details + +`binciWl` now calls `binciW` and returns the lower limit. + +## Value + +The lower binomial confidence limit + +## Author + +Jim Lemon + +## See also + +[binciWu](binciWu.md) + +## Examples + +``` r + binciWl(c(rep(5,TRUE),rep(37,FALSE))) +#> [1] 0 +``` diff --git a/reference/binciWu.html b/reference/binciWu.html new file mode 100644 index 0000000..87d0c35 --- /dev/null +++ b/reference/binciWu.html @@ -0,0 +1,105 @@ + +Upper binomial confidence limit — binciWu • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Returns the upper binomial confidence limit using the Wilson approximation.

    +
    + +
    +

    Usage

    +
    binciWu(x,n,alpha=0.05,trueval=TRUE,na.rm=TRUE)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    The number of successes or failures for which the CI is to be calculated.

    + +
    n
    +

    The number of trials as above.

    + +
    alpha
    +

    The desired coverage - 0.05 produces 95 percent coverage

    + +
    trueval
    +

    The value representing the outcome of interest for the CI.

    + +
    na.rm
    +

    Argument needed to make this work

    + +
    +
    +

    Details

    +

    binciWu now calls binciW and returns the upper limit.

    +
    +
    +

    Value

    +

    The upper binomial confidence interval

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     binciWl(c(rep(5,TRUE),rep(37,FALSE)))
    +#> [1] 0
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/binciWu.md b/reference/binciWu.md new file mode 100644 index 0000000..e1351f8 --- /dev/null +++ b/reference/binciWu.md @@ -0,0 +1,56 @@ +# Upper binomial confidence limit + +Returns the upper binomial confidence limit using the Wilson +approximation. + +## Usage + +``` r +binciWu(x,n,alpha=0.05,trueval=TRUE,na.rm=TRUE) +``` + +## Arguments + +- x: + + The number of successes or failures for which the CI is to be + calculated. + +- n: + + The number of trials as above. + +- alpha: + + The desired coverage - 0.05 produces 95 percent coverage + +- trueval: + + The value representing the outcome of interest for the CI. + +- na.rm: + + Argument needed to make this work + +## Details + +`binciWu` now calls `binciW` and returns the upper limit. + +## Value + +The upper binomial confidence interval + +## Author + +Jim Lemon + +## See also + +[binciWl](binciWl.md) + +## Examples + +``` r + binciWl(c(rep(5,TRUE),rep(37,FALSE))) +#> [1] 0 +``` diff --git a/reference/box.heresy-1.png b/reference/box.heresy-1.png new file mode 100644 index 0000000..c872e1d Binary files /dev/null and b/reference/box.heresy-1.png differ diff --git a/reference/box.heresy-2.png b/reference/box.heresy-2.png new file mode 100644 index 0000000..7d84259 Binary files /dev/null and b/reference/box.heresy-2.png differ diff --git a/reference/box.heresy.html b/reference/box.heresy.html new file mode 100644 index 0000000..fc9f89e --- /dev/null +++ b/reference/box.heresy.html @@ -0,0 +1,213 @@ + +Display a sort of box plot — box.heresy • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    box.heresy displays a box plot in which a symbol represents a measure of + central tendency, a surrounding box that represents an "inner" measure of dispersion + (e.g. standard error) and whiskers represent an "outer" measure of dispersion + (e.g. standard deviation). The function is pretty basic at this time and will + probably change a bit.

    +

    The argument "intervals" is particularly important, and can wreak + havoc on the resulting plot. The default of FALSE means that the + values passed to the inner and outer measures of dispersion are + absolute, not intervals away from the measure of central tendency. + Mixing absolute and relative values will always lead to errors and + typically a very strange looking plot. It is probably easiest to + calculate the absolute values before calling box.heresy. The first and + second examples show how intervals=FALSE and intervals=TRUE can be used.

    +

    One of the first changes is to allow varying box widths. The user can specify + the box widths as a vector of numeric values at least as long as the number + of boxes to be displayed. The usual reason for doing this is to display widths + that are proportional to the number of observations. A useful start is to pass + boxwidth as the number of observations and let the function work it out.

    +
    + +
    +

    Usage

    +
    box.heresy(x,y,uinner,linner,ulim,llim,boxwidth=NULL,
    +  intervals=FALSE,arrow.cap=NULL,pch=22,main="",xlab="",ylab="",
    +  xaxlab=NULL,col="white",do.first=NULL,...)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    Vectors of numeric values representing measures of central tendency.

    + +
    uinner,linner
    +

    Vectors of numeric values representing "inner" measures of + dispersion.

    + +
    ulim,llim
    +

    Vectors of numeric values representing "outer" measures of + dispersion.

    + +
    boxwidth
    +

    Optional widths for the boxes.

    + +
    intervals
    +

    Whether the values for dispersion are intervals (TRUE) or + absolute limits (FALSE).

    + +
    arrow.cap
    +

    The width of the cap on the "whiskers" relative to the width + of the plot. Defaults to the same width as the outer box.

    + +
    pch
    +

    The symbol to be used to represent the measure(s) of central tendency + in the box.

    + +
    main
    +

    The title for the plot (i.e. main).

    + +
    xlab,ylab
    +

    The x and y axis labels.

    + +
    xaxlab
    +

    Optional labels for the boxes.

    + +
    col
    +

    The fill colors for the "inner" rectangles.

    + +
    do.first
    +

    An expression that will be evaluated before anything is displayed.

    + +
    ...
    +

    additional arguments passed to the dispersion function.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon - thanks to Gianni Lavaredo for the suggestion

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     y1<-runif(20,2,10)
    + y2<-rnorm(30,6,2)
    + y3<-sample(0:20,40,TRUE)
    + Ns<-c(20,30,40)
    + ymean<-c(mean(y1),mean(y2),mean(y3))
    + y1inner<-quantile(y1,probs=c(.16,.84))
    + y2inner<-c(ymean[2]+sd(y2),ymean[2]-sd(y2))
    + y3inner<-quantile(y3,probs=c(.16,.84))
    + uinner<-c(y1inner[1],y2inner[1],y3inner[1])
    + linner<-c(y1inner[2],y2inner[2],y3inner[2])
    + ulim<-c(max(y1),max(y2),max(y3))
    + llim<-c(min(y1),min(y2),min(y3))
    + box.heresy(ymean,uinner=uinner,linner=linner,ulim=ulim,llim=llim,boxwidth=Ns,
    +  main="Boxplot of means, central spread and range",xlab="Distribution",
    +  xaxlab=c("Uniform","Normal","Sample"))
    +#> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored
    +#> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored
    +#> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored
    +#> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored
    +#> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored
    +#> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored
    +
    + y1outer<-
    + y<-runif(5)
    + ulim<-runif(5)
    + llim<-runif(5)
    + uinner<-ulim/2
    + linner<-llim/2
    + box.heresy(y,uinner=uinner,linner=linner,ulim=ulim,llim=llim,
    +  intervals=TRUE,main="The heretical boxplot",
    +  xlab="Number of observations",ylab="Value")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/box.heresy.md b/reference/box.heresy.md new file mode 100644 index 0000000..43866bf --- /dev/null +++ b/reference/box.heresy.md @@ -0,0 +1,137 @@ +# Display a sort of box plot + +`box.heresy` displays a box plot in which a symbol represents a measure +of central tendency, a surrounding box that represents an "inner" +measure of dispersion (e.g. standard error) and whiskers represent an +"outer" measure of dispersion (e.g. standard deviation). The function is +pretty basic at this time and will probably change a bit. + +The argument "intervals" is particularly important, and can wreak havoc +on the resulting plot. The default of FALSE means that the values passed +to the inner and outer measures of dispersion are absolute, not +intervals away from the measure of central tendency. Mixing absolute and +relative values will always lead to errors and typically a very strange +looking plot. It is probably easiest to calculate the absolute values +before calling box.heresy. The first and second examples show how +intervals=FALSE and intervals=TRUE can be used. + +One of the first changes is to allow varying box widths. The user can +specify the box widths as a vector of numeric values at least as long as +the number of boxes to be displayed. The usual reason for doing this is +to display widths that are proportional to the number of observations. A +useful start is to pass `boxwidth` as the number of observations and let +the function work it out. + +## Usage + +``` r +box.heresy(x,y,uinner,linner,ulim,llim,boxwidth=NULL, + intervals=FALSE,arrow.cap=NULL,pch=22,main="",xlab="",ylab="", + xaxlab=NULL,col="white",do.first=NULL,...) +``` + +## Arguments + +- x,y: + + Vectors of numeric values representing measures of central tendency. + +- uinner,linner: + + Vectors of numeric values representing "inner" measures of dispersion. + +- ulim,llim: + + Vectors of numeric values representing "outer" measures of dispersion. + +- boxwidth: + + Optional widths for the boxes. + +- intervals: + + Whether the values for dispersion are intervals (TRUE) or absolute + limits (FALSE). + +- arrow.cap: + + The width of the cap on the "whiskers" relative to the width of the + plot. Defaults to the same width as the outer box. + +- pch: + + The symbol to be used to represent the measure(s) of central tendency + in the box. + +- main: + + The title for the plot (i.e. `main`). + +- xlab,ylab: + + The x and y axis labels. + +- xaxlab: + + Optional labels for the boxes. + +- col: + + The fill colors for the "inner" rectangles. + +- do.first: + + An expression that will be evaluated before anything is displayed. + +- ...: + + additional arguments passed to the `dispersion` function. + +## Value + +nil + +## Author + +Jim Lemon - thanks to Gianni Lavaredo for the suggestion + +## See also + +[plot](https://rdrr.io/r/graphics/plot.default.html), +[boxplot](https://rdrr.io/r/graphics/boxplot.html) + +## Examples + +``` r + y1<-runif(20,2,10) + y2<-rnorm(30,6,2) + y3<-sample(0:20,40,TRUE) + Ns<-c(20,30,40) + ymean<-c(mean(y1),mean(y2),mean(y3)) + y1inner<-quantile(y1,probs=c(.16,.84)) + y2inner<-c(ymean[2]+sd(y2),ymean[2]-sd(y2)) + y3inner<-quantile(y3,probs=c(.16,.84)) + uinner<-c(y1inner[1],y2inner[1],y3inner[1]) + linner<-c(y1inner[2],y2inner[2],y3inner[2]) + ulim<-c(max(y1),max(y2),max(y3)) + llim<-c(min(y1),min(y2),min(y3)) + box.heresy(ymean,uinner=uinner,linner=linner,ulim=ulim,llim=llim,boxwidth=Ns, + main="Boxplot of means, central spread and range",xlab="Distribution", + xaxlab=c("Uniform","Normal","Sample")) +#> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored +#> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored +#> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored +#> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored +#> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored +#> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored + + y1outer<- + y<-runif(5) + ulim<-runif(5) + llim<-runif(5) + uinner<-ulim/2 + linner<-llim/2 + box.heresy(y,uinner=uinner,linner=linner,ulim=ulim,llim=llim, + intervals=TRUE,main="The heretical boxplot", + xlab="Number of observations",ylab="Value") +``` diff --git a/reference/boxed.labels-1.png b/reference/boxed.labels-1.png new file mode 100644 index 0000000..a90b28f Binary files /dev/null and b/reference/boxed.labels-1.png differ diff --git a/reference/boxed.labels-2.png b/reference/boxed.labels-2.png new file mode 100644 index 0000000..0e54427 Binary files /dev/null and b/reference/boxed.labels-2.png differ diff --git a/reference/boxed.labels-3.png b/reference/boxed.labels-3.png new file mode 100644 index 0000000..520519f Binary files /dev/null and b/reference/boxed.labels-3.png differ diff --git a/reference/boxed.labels.html b/reference/boxed.labels.html new file mode 100644 index 0000000..25e658d --- /dev/null +++ b/reference/boxed.labels.html @@ -0,0 +1,166 @@ + +Place labels in boxes — boxed.labels • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Places labels in boxes on an existing plot

    +
    + +
    +

    Usage

    +
    boxed.labels(x,y=NULL,labels,
    +  bg=ifelse(match(par("bg"),"transparent",0),"white",par("bg")),
    +  border=TRUE,xpad=1.2,ypad=1.2,srt=0,cex=1,adj=0.5,xlog=FALSE,ylog=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    x and y position of the centers of the labels. x can be an + xy.coords list.

    + +
    bg
    +

    The fill color of the rectangles on which the labels are displayed + (see Details).

    + +
    labels
    +

    Text strings

    + +
    border
    +

    Whether to draw borders around the rectangles.

    + +
    xpad,ypad
    +

    The proportion of the rectangles to the + extent of the text within.

    + +
    srt
    +

    Rotation of the labels. If 90 or 270 degrees, the box will be + rotated 90 degrees.

    + +
    cex
    +

    Character expansion. See text.

    + +
    adj
    +

    left/right adjustment. If this is set outside the function, + the box will not be aligned properly.

    + +
    xlog
    +

    Whether the X axis is a log axis

    + +
    ylog
    +

    Whether the Y axis is a log axis

    + +
    ...
    +

    additional arguments passed to text.

    + +
    +
    +

    Details

    +

    The label(s) are displayed on a rectangular background. This may be useful + for visibility and is the reason that "transparent" background is not available. + With the default textcol=NA, the function tries to work out whether white + or black text will be more easily read based on the background color and displays + the text accordingly. If the user specifies text colors in the additional + arguments, these colors will override the automatic white/black above - see the + last example.

    +

    Only right angle rotations are allowed in boxed.labels. Important + change: xpad and ypad are now the full proportion of + the box to text, not half. The user can now call cylindrect or + gradient.rect for the background rectangle.

    +
    +
    +

    Note

    +

    This function is best for regularly spaced labels where overlapping is + not a problem. See thigmophobe.labels for placing labels + where overlap is likely.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon - thanks to Thorn Thaler for the code allowing + user-specified text colors and Flemming Skjoth for the log axis correction

    +
    + + +
    +

    Examples

    +
     x<-rnorm(10)
    + y<-rnorm(10)
    + plot(x,y,type="p")
    + nums<-c("one","two","three","four","five","six","seven","eight","nine","ten")
    + boxed.labels(x,y-0.1,nums)
    +
    + # now label a barplot
    + xpos<-barp(c(1,3,2,4))
    + boxed.labels(xpos$x,0.5,nums[1:4])
    + # and add labels below the x axis ticks
    + boxed.labels(xpos$x,-0.4,c("First","Second","Third","Fourth"))
    +
    + # perform a PCA on the "swiss" dataset and plot the first two components
    + data(swiss)
    + swiss.pca<-prcomp(swiss)
    + plot(swiss.pca$rotation[,1:2],xlim=c(-1,0.2),main="PCA of swiss dataset",
    +  type="n")
    + boxed.labels(swiss.pca$rotation[1:6],swiss.pca$rotation[7:12],ypad=1.5,
    +  colnames(swiss),bg=c("red","purple","blue","blue","darkgreen","red"),
    +  col="yellow")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/boxed.labels.md b/reference/boxed.labels.md new file mode 100644 index 0000000..c46f165 --- /dev/null +++ b/reference/boxed.labels.md @@ -0,0 +1,121 @@ +# Place labels in boxes + +Places labels in boxes on an existing plot + +## Usage + +``` r +boxed.labels(x,y=NULL,labels, + bg=ifelse(match(par("bg"),"transparent",0),"white",par("bg")), + border=TRUE,xpad=1.2,ypad=1.2,srt=0,cex=1,adj=0.5,xlog=FALSE,ylog=FALSE,...) +``` + +## Arguments + +- x,y: + + x and y position of the centers of the labels. `x` can be an + [xy.coords](https://rdrr.io/r/grDevices/xy.coords.html) list. + +- bg: + + The fill color of the rectangles on which the labels are displayed + (see Details). + +- labels: + + Text strings + +- border: + + Whether to draw borders around the rectangles. + +- xpad,ypad: + + The proportion of the rectangles to the extent of the text within. + +- srt: + + Rotation of the labels. If 90 or 270 degrees, the box will be rotated + 90 degrees. + +- cex: + + Character expansion. See `text`. + +- adj: + + left/right adjustment. If this is set outside the function, the box + will not be aligned properly. + +- xlog: + + Whether the X axis is a log axis + +- ylog: + + Whether the Y axis is a log axis + +- ...: + + additional arguments passed to `text`. + +## Details + +The label(s) are displayed on a rectangular background. This may be +useful for visibility and is the reason that "transparent" background is +not available. With the default `textcol=NA`, the function tries to work +out whether white or black text will be more easily read based on the +background color and displays the text accordingly. If the user +specifies text colors in the additional arguments, these colors will +override the automatic white/black above - see the last example. + +Only right angle rotations are allowed in `boxed.labels`. *Important +change*: `xpad` and `ypad` are now the full proportion of the box to +text, not half. The user can now call `cylindrect` or `gradient.rect` +for the background rectangle. + +## Note + +This function is best for regularly spaced labels where overlapping is +not a problem. See [thigmophobe.labels](thigmophobe.labels.md) for +placing labels where overlap is likely. + +## Value + +nil + +## Author + +Jim Lemon - thanks to Thorn Thaler for the code allowing user-specified +text colors and Flemming Skjoth for the log axis correction + +## See also + +[spread.labels](spread.labels.md), +[thigmophobe.labels](thigmophobe.labels.md) + +## Examples + +``` r + x<-rnorm(10) + y<-rnorm(10) + plot(x,y,type="p") + nums<-c("one","two","three","four","five","six","seven","eight","nine","ten") + boxed.labels(x,y-0.1,nums) + + # now label a barplot + xpos<-barp(c(1,3,2,4)) + boxed.labels(xpos$x,0.5,nums[1:4]) + # and add labels below the x axis ticks + boxed.labels(xpos$x,-0.4,c("First","Second","Third","Fourth")) + + # perform a PCA on the "swiss" dataset and plot the first two components + data(swiss) + swiss.pca<-prcomp(swiss) + plot(swiss.pca$rotation[,1:2],xlim=c(-1,0.2),main="PCA of swiss dataset", + type="n") + boxed.labels(swiss.pca$rotation[1:6],swiss.pca$rotation[7:12],ypad=1.5, + colnames(swiss),bg=c("red","purple","blue","blue","darkgreen","red"), + col="yellow") +``` diff --git a/reference/brkdn.plot-1.png b/reference/brkdn.plot-1.png new file mode 100644 index 0000000..7859cad Binary files /dev/null and b/reference/brkdn.plot-1.png differ diff --git a/reference/brkdn.plot-2.png b/reference/brkdn.plot-2.png new file mode 100644 index 0000000..0e7900f Binary files /dev/null and b/reference/brkdn.plot-2.png differ diff --git a/reference/brkdn.plot.html b/reference/brkdn.plot.html new file mode 100644 index 0000000..b87309b --- /dev/null +++ b/reference/brkdn.plot.html @@ -0,0 +1,210 @@ + +A point/line plotting routine — brkdn.plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display a point/line plot of breakdowns of one or more variables.

    +
    + +
    +

    Usage

    +
    brkdn.plot(vars,groups=NULL,obs=NULL,data,mct="mean",md="std.error",
    + stagger=NULL,dispbar=TRUE,main="Breakdown plot",xlab=NULL,ylab=NULL,xaxlab=NA,
    + ylim=NA,type="b",pch=1,lty=1,col=par("fg"),staxx=FALSE,yat=NULL,...)
    +
    + +
    +

    Arguments

    +

    +
    vars
    +

    The names or indices of one or more columns in a data frame. + The columns must contain numeric data. If only one variable is to be + broken down, vars can be a formula.

    + +
    groups
    +

    The name or index of a column in a data frame that classifies + the values in vars into different, usually fixed effect, levels.

    + +
    obs
    +

    The name or index of a column in a data frame that classifies + the values in vars into different, usually random effect, levels.

    + +
    data
    +

    The data frame.

    + +
    mct
    +

    The measure of central tendency to calculate for each group.

    + +
    md
    +

    The measure of dispersion to calculate, NA for none.

    + +
    stagger
    +

    The amount to offset the successive values at each horizontal + position as a proportion of the width of the plot. The calculated default + is usually adequate. Pass zero for none.

    + +
    dispbar
    +

    Whether to display the measures of dispersion as bars.

    + +
    main
    +

    The title at the top of the plot.

    + +
    xlab,ylab
    +

    The labels for the X and Y axes respectively. There are + defaults, but they are basic.

    + +
    xaxlab
    +

    Optional labels for the horizontal axis ticks.

    + +
    ylim
    +

    Optional vertical limits for the plot.

    + +
    type
    +

    Whether to plot symbols, lines or both (as in plot).

    + +
    pch
    +

    Symbol(s) to plot.

    + +
    lty
    +

    Line type(s) to plot.

    + +
    col
    +

    Color(s) for the symbols and lines.

    + +
    staxx
    +

    Whether to call staxlab to display the X axis + labels.

    + +
    yat
    +

    Optional y axis tick positions.

    + +
    ...
    +

    additional arguments passed to plot.

    + +
    +
    +

    Value

    +

    A list of two matrices of dimension length(levels(groups)) by + length(levels(obs)). The first contains the measures of central + tendency calculated and its name is the name of the function passed as + mct. The second contains the measures of dispersion and its name + is the name of the function passed as md.

    +

    If both groups and obs are not NULL, the rows of each matrix + will be the groups and the columns the obs. If obs + is NULL, the rows will be the groups and the columns the vars. + If groups is NULL, the rows will be the vars and the columns + the obs. That is, if vars has more than one element, if + obs is NULL, the elements of vars will be considered to + represent observations, while if groups is NULL, they will be + considered to represent groups. At least one of groups and obs + must be not NULL or there is no point in using brkdn.plot.

    +
    +
    +

    Details

    +

    brkdn.plot displays a plot useful for visualizing the breakdown of a + response measure by two factors, or more than one response measure by either + a factor representing something like levels of treatment (groups) or + something like repeated observations (obs). For example, if + observations are made at different times on data objects that receive + different treatments, the groups factor will display the measures + of central tendency as points/lines with the same color, symbol and line type, + while the obs factor will be represented as horizontal positions on the + plot. If obs is numeric, its unique values will be used as the + positions, if not, 1 to the number of unique values. This is a common way of + representing changes over time intervals for experimental groups.

    +

    If only one numeric variable is to be broken down, vars may be a + formula like var~groups+obs. The position of the two factors to break + down the variable is fixed - the second term will be interpreted as "groups" + and the third, if present, will be interpreted as "obs".

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     test.df<-data.frame(a=rnorm(80)+4,b=rnorm(80)+4,c=rep(LETTERS[1:4],each=20),
    +  d=rep(rep(letters[1:4],each=4),5))
    + # first use the default values
    + brkdn.plot("a","c","d",test.df,pch=1:4,col=1:4)
    +
    +#> $mean
    +#>          [,1]     [,2]     [,3]     [,4]
    +#> [1,] 3.699047 2.979673 3.835690 3.831803
    +#> [2,] 4.468245 3.811462 3.441621 4.518820
    +#> [3,] 4.448392 3.251773 4.184449 3.919098
    +#> [4,] 3.994852 3.641499 4.660812 4.836524
    +#> 
    +#> $std.error
    +#>           [,1]      [,2]      [,3]      [,4]
    +#> [1,] 0.1923569 0.6483281 0.2327485 0.3658918
    +#> [2,] 0.5357199 0.3643665 0.4458449 0.2081409
    +#> [3,] 0.4055370 0.2588084 0.3498931 0.3801542
    +#> [4,] 0.6290630 0.7705355 0.4545133 0.3695867
    +#> 
    + # now jazz it up a bit using medians and median absolute deviations
    + # and some enhancements
    + bp<-brkdn.plot(a~c+d,data=test.df,main="Test of the breakdown plot",
    +  mct="median",md="mad",xlab="Temperature range", ylab="Cognition",
    +  xaxlab=c("10-15","16-20","21-25","25-30"),pch=1:4,lty=1:4,col=1:4)
    + es<-emptyspace(bp)
    + legend(es,legend=c("Sydney","Gosford","Karuah","Brisbane"),pch=1:4,
    +  col=1:4,lty=1:4,xjust=0.5,yjust=0.5)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/brkdn.plot.md b/reference/brkdn.plot.md new file mode 100644 index 0000000..9c5f37b --- /dev/null +++ b/reference/brkdn.plot.md @@ -0,0 +1,172 @@ +# A point/line plotting routine + +Display a point/line plot of breakdowns of one or more variables. + +## Usage + +``` r +brkdn.plot(vars,groups=NULL,obs=NULL,data,mct="mean",md="std.error", + stagger=NULL,dispbar=TRUE,main="Breakdown plot",xlab=NULL,ylab=NULL,xaxlab=NA, + ylim=NA,type="b",pch=1,lty=1,col=par("fg"),staxx=FALSE,yat=NULL,...) +``` + +## Arguments + +- vars: + + The names or indices of one or more columns in a data frame. The + columns must contain numeric data. If only one variable is to be + broken down, vars can be a formula. + +- groups: + + The name or index of a column in a data frame that classifies the + values in `vars` into different, usually fixed effect, levels. + +- obs: + + The name or index of a column in a data frame that classifies the + values in `vars` into different, usually random effect, levels. + +- data: + + The data frame. + +- mct: + + The measure of central tendency to calculate for each group. + +- md: + + The measure of dispersion to calculate, NA for none. + +- stagger: + + The amount to offset the successive values at each horizontal position + as a proportion of the width of the plot. The calculated default is + usually adequate. Pass zero for none. + +- dispbar: + + Whether to display the measures of dispersion as bars. + +- main: + + The title at the top of the plot. + +- xlab,ylab: + + The labels for the X and Y axes respectively. There are defaults, but + they are basic. + +- xaxlab: + + Optional labels for the horizontal axis ticks. + +- ylim: + + Optional vertical limits for the plot. + +- type: + + Whether to plot symbols, lines or both (as in `plot`). + +- pch: + + Symbol(s) to plot. + +- lty: + + Line type(s) to plot. + +- col: + + Color(s) for the symbols and lines. + +- staxx: + + Whether to call [staxlab](staxlab.md) to display the X axis labels. + +- yat: + + Optional y axis tick positions. + +- ...: + + additional arguments passed to `plot`. + +## Value + +A list of two matrices of dimension `length(levels(groups))` by +`length(levels(obs))`. The first contains the measures of central +tendency calculated and its name is the name of the function passed as +`mct`. The second contains the measures of dispersion and its name is +the name of the function passed as `md`. + +If both `groups` and `obs` are not NULL, the rows of each matrix will be +the `groups` and the columns the `obs`. If `obs` is NULL, the rows will +be the `groups` and the columns the `vars`. If `groups` is NULL, the +rows will be the `vars` and the columns the `obs`. That is, if `vars` +has more than one element, if `obs` is NULL, the elements of `vars` will +be considered to represent observations, while if `groups` is NULL, they +will be considered to represent groups. At least one of `groups` and +`obs` must be not NULL or there is no point in using `brkdn.plot`. + +## Details + +`brkdn.plot` displays a plot useful for visualizing the breakdown of a +response measure by two factors, or more than one response measure by +either a factor representing something like levels of treatment +(`groups`) or something like repeated observations (`obs`). For example, +if observations are made at different times on data objects that receive +different treatments, the `groups` factor will display the measures of +central tendency as points/lines with the same color, symbol and line +type, while the `obs` factor will be represented as horizontal positions +on the plot. If `obs` is numeric, its unique values will be used as the +positions, if not, 1 to the number of unique values. This is a common +way of representing changes over time intervals for experimental groups. + +If only one numeric variable is to be broken down, `vars` may be a +formula like `var~groups+obs`. The position of the two factors to break +down the variable is fixed - the second term will be interpreted as +"groups" and the third, if present, will be interpreted as "obs". + +## Author + +Jim Lemon + +## See also + +[dispersion](dispersion.md) + +## Examples + +``` r + test.df<-data.frame(a=rnorm(80)+4,b=rnorm(80)+4,c=rep(LETTERS[1:4],each=20), + d=rep(rep(letters[1:4],each=4),5)) + # first use the default values + brkdn.plot("a","c","d",test.df,pch=1:4,col=1:4) + +#> $mean +#> [,1] [,2] [,3] [,4] +#> [1,] 3.699047 2.979673 3.835690 3.831803 +#> [2,] 4.468245 3.811462 3.441621 4.518820 +#> [3,] 4.448392 3.251773 4.184449 3.919098 +#> [4,] 3.994852 3.641499 4.660812 4.836524 +#> +#> $std.error +#> [,1] [,2] [,3] [,4] +#> [1,] 0.1923569 0.6483281 0.2327485 0.3658918 +#> [2,] 0.5357199 0.3643665 0.4458449 0.2081409 +#> [3,] 0.4055370 0.2588084 0.3498931 0.3801542 +#> [4,] 0.6290630 0.7705355 0.4545133 0.3695867 +#> + # now jazz it up a bit using medians and median absolute deviations + # and some enhancements + bp<-brkdn.plot(a~c+d,data=test.df,main="Test of the breakdown plot", + mct="median",md="mad",xlab="Temperature range", ylab="Cognition", + xaxlab=c("10-15","16-20","21-25","25-30"),pch=1:4,lty=1:4,col=1:4) + es<-emptyspace(bp) + legend(es,legend=c("Sydney","Gosford","Karuah","Brisbane"),pch=1:4, + col=1:4,lty=1:4,xjust=0.5,yjust=0.5) +``` diff --git a/reference/brkdnNest.html b/reference/brkdnNest.html new file mode 100644 index 0000000..ba7b32a --- /dev/null +++ b/reference/brkdnNest.html @@ -0,0 +1,323 @@ + +Perform a nested breakdown of numeric values — brkdnNest • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Breaks down a numeric or categorical element of a data frame + by one or more categorical elements.

    +
    + +
    +

    Usage

    +
    brkdnNest(formula,data,FUN=c("mean","sd","sd","valid.n"),label1="Overall",
    +  trueval=TRUE)
    +
    + +
    +

    Arguments

    +

    +
    formula
    +

    A formula with a numeric element of a data frame on the left and + one or more categorical elements on the right.

    + +
    data
    +

    A data frame containing the elements in formula.

    + +
    FUN
    +

    The functions to be applied to successive breakdowns.

    + +
    label1
    +

    The label to use for the overall value of the first function.

    + +
    trueval
    +

    The value to use in calculating proportions or sums of a + categorical response variable. See Details.

    + +
    +
    +

    Value

    +

    A list with as many elements as there are functions in FUN. It is + probably best to always specify four functions (summary measure, upper + dispersion measure, lower dispersion measure and number of valid observations) + even if this is redundant as in the default.

    +

    This function is similar to brkdn in the prettyR package, but + is structured to be used with the barNest function. It produces one + or more measures for the overall data, then the subsets of the data defined by + the first variable to the right of the tilde, then the subsets defined by + the first and second variable, and so on.

    +
    +
    +

    Details

    +

    brkdnNest performs a nested breakdown of an element of a data frame + by one or more categorical elements. For each category and optional + subcategories, the variable on the left of the formula is summarized as + specified by the functions named in FUN.

    +

    If trueval is not NA, brkdnNest will calculate the proportion of + trueval values in the response variable out of the total valid + responses. If the function valid.n is the first function in + FUN, the counts of the groups and subgroups will be returned.

    +

    Two specialized summary functions are defined within brkdnNest. + sumbrk returns the count of values in a factor equal to trueval, + and propbrk returns the proportion of values equal to + trueval. Be aware that if a categorical variable is specified on + the left of the formula, functions which expect numeric data such as + mean should not be included in FUN.

    +

    The user should take care when specifying different summary functions. + barNest expects a summary measure as the first component of the list + and measures of dispersion as the second and third. If two different measures + of dispersion are passed, the first must calculate the upper and the second + the lower measure.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     brkdntest<-data.frame(Age=rnorm(100,25,10),
    +  Sex=factor(sample(c("M","F"),100,TRUE)),
    +  Marital=sample(c("M","X","S","W"),100,TRUE),
    +  Employ=sample(c("FT","PT","NO"),100,TRUE))
    + brkdnNest(formula=Age~Sex+Marital+Employ,data=brkdntest)
    +#> mean 
    +#> Overall 24.35412 
    +#> 	 F 24.13515 
    +#> 	 	 M 25.31509 
    +#> 	 	 	 FT 31.67157 
    +#> 	 	 	 NO 22.29443 
    +#> 	 	 	 PT 25.10499 
    +#> 	 	 S 24.41918 
    +#> 	 	 	 FT 25.42455 
    +#> 	 	 	 NO 23.3728 
    +#> 	 	 	 PT 23.43842 
    +#> 	 	 W 22.42168 
    +#> 	 	 	 FT 21.64662 
    +#> 	 	 	 NO 22.58689 
    +#> 	 	 	 PT 22.72152 
    +#> 	 	 X 24.78159 
    +#> 	 	 	 FT 30.33997 
    +#> 	 	 	 NO 25.23715 
    +#> 	 	 	 PT 22.70102 
    +#> 	 M 24.5645 
    +#> 	 	 M 23.63738 
    +#> 	 	 	 FT 28.11792 
    +#> 	 	 	 NO 17.77709 
    +#> 	 	 	 PT 24.74118 
    +#> 	 	 S 23.93357 
    +#> 	 	 	 FT NA 
    +#> 	 	 	 NO 23.76369 
    +#> 	 	 	 PT 24.14591 
    +#> 	 	 W 25.56561 
    +#> 	 	 	 FT 23.34187 
    +#> 	 	 	 NO 26.68862 
    +#> 	 	 	 PT 29.63132 
    +#> 	 	 X 24.85928 
    +#> 	 	 	 FT 16.16233 
    +#> 	 	 	 NO 27.6349 
    +#> 	 	 	 PT 25.96954 
    +#> sd 
    +#> Overall 7.992469 
    +#> 	 F 8.211191 
    +#> 	 	 M 11.9396 
    +#> 	 	 	 FT 5.639837 
    +#> 	 	 	 NO 15.28303 
    +#> 	 	 	 PT 12.05139 
    +#> 	 	 S 7.808277 
    +#> 	 	 	 FT 7.408498 
    +#> 	 	 	 NO 6.406452 
    +#> 	 	 	 PT 10.39316 
    +#> 	 	 W 4.692401 
    +#> 	 	 	 FT 2.389779 
    +#> 	 	 	 NO 6.364952 
    +#> 	 	 	 PT 4.700077 
    +#> 	 	 X 9.276618 
    +#> 	 	 	 FT 15.87114 
    +#> 	 	 	 NO 7.312338 
    +#> 	 	 	 PT 9.092153 
    +#> 	 M 7.85256 
    +#> 	 	 M 10.41646 
    +#> 	 	 	 FT 8.794668 
    +#> 	 	 	 NO 8.27566 
    +#> 	 	 	 PT 12.65671 
    +#> 	 	 S 6.783078 
    +#> 	 	 	 FT NA 
    +#> 	 	 	 NO 6.817546 
    +#> 	 	 	 PT 7.785475 
    +#> 	 	 W 5.269618 
    +#> 	 	 	 FT 4.452918 
    +#> 	 	 	 NO 6.058298 
    +#> 	 	 	 PT 5.141074 
    +#> 	 	 X 8.369062 
    +#> 	 	 	 FT 7.185825 
    +#> 	 	 	 NO 8.561454 
    +#> 	 	 	 PT 6.62298 
    +#> sd 
    +#> Overall 7.992469 
    +#> 	 F 8.211191 
    +#> 	 	 M 11.9396 
    +#> 	 	 	 FT 5.639837 
    +#> 	 	 	 NO 15.28303 
    +#> 	 	 	 PT 12.05139 
    +#> 	 	 S 7.808277 
    +#> 	 	 	 FT 7.408498 
    +#> 	 	 	 NO 6.406452 
    +#> 	 	 	 PT 10.39316 
    +#> 	 	 W 4.692401 
    +#> 	 	 	 FT 2.389779 
    +#> 	 	 	 NO 6.364952 
    +#> 	 	 	 PT 4.700077 
    +#> 	 	 X 9.276618 
    +#> 	 	 	 FT 15.87114 
    +#> 	 	 	 NO 7.312338 
    +#> 	 	 	 PT 9.092153 
    +#> 	 M 7.85256 
    +#> 	 	 M 10.41646 
    +#> 	 	 	 FT 8.794668 
    +#> 	 	 	 NO 8.27566 
    +#> 	 	 	 PT 12.65671 
    +#> 	 	 S 6.783078 
    +#> 	 	 	 FT NA 
    +#> 	 	 	 NO 6.817546 
    +#> 	 	 	 PT 7.785475 
    +#> 	 	 W 5.269618 
    +#> 	 	 	 FT 4.452918 
    +#> 	 	 	 NO 6.058298 
    +#> 	 	 	 PT 5.141074 
    +#> 	 	 X 8.369062 
    +#> 	 	 	 FT 7.185825 
    +#> 	 	 	 NO 8.561454 
    +#> 	 	 	 PT 6.62298 
    +#> valid.n 
    +#> Overall 100 
    +#> 	 F 49 
    +#> 	 	 M 9 
    +#> 	 	 	 FT 2 
    +#> 	 	 	 NO 4 
    +#> 	 	 	 PT 3 
    +#> 	 	 S 16 
    +#> 	 	 	 FT 8 
    +#> 	 	 	 NO 3 
    +#> 	 	 	 PT 5 
    +#> 	 	 W 13 
    +#> 	 	 	 FT 3 
    +#> 	 	 	 NO 5 
    +#> 	 	 	 PT 5 
    +#> 	 	 X 11 
    +#> 	 	 	 FT 2 
    +#> 	 	 	 NO 3 
    +#> 	 	 	 PT 6 
    +#> 	 M 51 
    +#> 	 	 M 13 
    +#> 	 	 	 FT 4 
    +#> 	 	 	 NO 4 
    +#> 	 	 	 PT 5 
    +#> 	 	 S 9 
    +#> 	 	 	 FT 0 
    +#> 	 	 	 NO 5 
    +#> 	 	 	 PT 4 
    +#> 	 	 W 13 
    +#> 	 	 	 FT 7 
    +#> 	 	 	 NO 3 
    +#> 	 	 	 PT 3 
    +#> 	 	 X 16 
    +#> 	 	 	 FT 3 
    +#> 	 	 	 NO 7 
    +#> 	 	 	 PT 6 
    + # show the proportion of unemployed with binomial confidence intervals
    + brkdnNest(formula=Employ~Sex+Marital,data=brkdntest,
    +  FUN=c("propbrk","binciWu","binciWl"),trueval="NO")
    +#> propbrk 
    +#> Overall 0.34 
    +#> 	 F 0.3061224 
    +#> 	 	 M 0.4444444 
    +#> 	 	 S 0.1875 
    +#> 	 	 W 0.3846154 
    +#> 	 	 X 0.2727273 
    +#> 	 M 0.372549 
    +#> 	 	 M 0.3076923 
    +#> 	 	 S 0.5555556 
    +#> 	 	 W 0.2307692 
    +#> 	 	 X 0.4375 
    +#> binciWu 
    +#> Overall 0.4372227 
    +#> 	 F 0.4452789 
    +#> 	 	 M 0.7333487 
    +#> 	 	 S 0.4300888 
    +#> 	 	 W 0.6447711 
    +#> 	 	 X 0.5656453 
    +#> 	 M 0.5097479 
    +#> 	 	 M 0.5763066 
    +#> 	 	 S 0.8112215 
    +#> 	 	 W 0.5025638 
    +#> 	 	 X 0.6682144 
    +#> binciWl 
    +#> Overall 0.2546152 
    +#> 	 F 0.1951549 
    +#> 	 	 M 0.1887785 
    +#> 	 	 S 0.06591599 
    +#> 	 	 W 0.1770971 
    +#> 	 	 X 0.09746059 
    +#> 	 M 0.2532052 
    +#> 	 	 M 0.126807 
    +#> 	 	 S 0.2666513 
    +#> 	 	 W 0.08179529 
    +#> 	 	 X 0.2309865 
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/brkdnNest.md b/reference/brkdnNest.md new file mode 100644 index 0000000..30a6997 --- /dev/null +++ b/reference/brkdnNest.md @@ -0,0 +1,274 @@ +# Perform a nested breakdown of numeric values + +Breaks down a numeric or categorical element of a data frame by one or +more categorical elements. + +## Usage + +``` r +brkdnNest(formula,data,FUN=c("mean","sd","sd","valid.n"),label1="Overall", + trueval=TRUE) +``` + +## Arguments + +- formula: + + A formula with a numeric element of a data frame on the left and one + or more categorical elements on the right. + +- data: + + A data frame containing the elements in `formula`. + +- FUN: + + The functions to be applied to successive breakdowns. + +- label1: + + The label to use for the overall value of the first function. + +- trueval: + + The value to use in calculating proportions or sums of a categorical + response variable. See Details. + +## Value + +A list with as many elements as there are functions in `FUN`. It is +probably best to always specify four functions (summary measure, upper +dispersion measure, lower dispersion measure and number of valid +observations) even if this is redundant as in the default. + +This function is similar to `brkdn` in the prettyR package, but is +structured to be used with the `barNest` function. It produces one or +more measures for the overall data, then the subsets of the data defined +by the first variable to the right of the tilde, then the subsets +defined by the first and second variable, and so on. + +## Details + +`brkdnNest` performs a nested breakdown of an element of a data frame by +one or more categorical elements. For each category and optional +subcategories, the variable on the left of the formula is summarized as +specified by the functions named in `FUN`. + +If `trueval` is not NA, brkdnNest will calculate the proportion of +`trueval` values in the response variable out of the total valid +responses. If the function `valid.n` is the first function in `FUN`, the +counts of the groups and subgroups will be returned. + +Two specialized summary functions are defined within `brkdnNest`. +`sumbrk` returns the count of values in a factor equal to `trueval`, and +`propbrk` returns the proportion of values equal to `trueval`. Be aware +that if a categorical variable is specified on the left of the formula, +functions which expect numeric data such as `mean` should not be +included in `FUN`. + +The user should take care when specifying different summary functions. +`barNest` expects a summary measure as the first component of the list +and measures of dispersion as the second and third. If two different +measures of dispersion are passed, the first must calculate the upper +and the second the lower measure. + +## Author + +Jim Lemon + +## See also + +[by](https://rdrr.io/r/base/by.html) + +## Examples + +``` r + brkdntest<-data.frame(Age=rnorm(100,25,10), + Sex=factor(sample(c("M","F"),100,TRUE)), + Marital=sample(c("M","X","S","W"),100,TRUE), + Employ=sample(c("FT","PT","NO"),100,TRUE)) + brkdnNest(formula=Age~Sex+Marital+Employ,data=brkdntest) +#> mean +#> Overall 24.35412 +#> F 24.13515 +#> M 25.31509 +#> FT 31.67157 +#> NO 22.29443 +#> PT 25.10499 +#> S 24.41918 +#> FT 25.42455 +#> NO 23.3728 +#> PT 23.43842 +#> W 22.42168 +#> FT 21.64662 +#> NO 22.58689 +#> PT 22.72152 +#> X 24.78159 +#> FT 30.33997 +#> NO 25.23715 +#> PT 22.70102 +#> M 24.5645 +#> M 23.63738 +#> FT 28.11792 +#> NO 17.77709 +#> PT 24.74118 +#> S 23.93357 +#> FT NA +#> NO 23.76369 +#> PT 24.14591 +#> W 25.56561 +#> FT 23.34187 +#> NO 26.68862 +#> PT 29.63132 +#> X 24.85928 +#> FT 16.16233 +#> NO 27.6349 +#> PT 25.96954 +#> sd +#> Overall 7.992469 +#> F 8.211191 +#> M 11.9396 +#> FT 5.639837 +#> NO 15.28303 +#> PT 12.05139 +#> S 7.808277 +#> FT 7.408498 +#> NO 6.406452 +#> PT 10.39316 +#> W 4.692401 +#> FT 2.389779 +#> NO 6.364952 +#> PT 4.700077 +#> X 9.276618 +#> FT 15.87114 +#> NO 7.312338 +#> PT 9.092153 +#> M 7.85256 +#> M 10.41646 +#> FT 8.794668 +#> NO 8.27566 +#> PT 12.65671 +#> S 6.783078 +#> FT NA +#> NO 6.817546 +#> PT 7.785475 +#> W 5.269618 +#> FT 4.452918 +#> NO 6.058298 +#> PT 5.141074 +#> X 8.369062 +#> FT 7.185825 +#> NO 8.561454 +#> PT 6.62298 +#> sd +#> Overall 7.992469 +#> F 8.211191 +#> M 11.9396 +#> FT 5.639837 +#> NO 15.28303 +#> PT 12.05139 +#> S 7.808277 +#> FT 7.408498 +#> NO 6.406452 +#> PT 10.39316 +#> W 4.692401 +#> FT 2.389779 +#> NO 6.364952 +#> PT 4.700077 +#> X 9.276618 +#> FT 15.87114 +#> NO 7.312338 +#> PT 9.092153 +#> M 7.85256 +#> M 10.41646 +#> FT 8.794668 +#> NO 8.27566 +#> PT 12.65671 +#> S 6.783078 +#> FT NA +#> NO 6.817546 +#> PT 7.785475 +#> W 5.269618 +#> FT 4.452918 +#> NO 6.058298 +#> PT 5.141074 +#> X 8.369062 +#> FT 7.185825 +#> NO 8.561454 +#> PT 6.62298 +#> valid.n +#> Overall 100 +#> F 49 +#> M 9 +#> FT 2 +#> NO 4 +#> PT 3 +#> S 16 +#> FT 8 +#> NO 3 +#> PT 5 +#> W 13 +#> FT 3 +#> NO 5 +#> PT 5 +#> X 11 +#> FT 2 +#> NO 3 +#> PT 6 +#> M 51 +#> M 13 +#> FT 4 +#> NO 4 +#> PT 5 +#> S 9 +#> FT 0 +#> NO 5 +#> PT 4 +#> W 13 +#> FT 7 +#> NO 3 +#> PT 3 +#> X 16 +#> FT 3 +#> NO 7 +#> PT 6 + # show the proportion of unemployed with binomial confidence intervals + brkdnNest(formula=Employ~Sex+Marital,data=brkdntest, + FUN=c("propbrk","binciWu","binciWl"),trueval="NO") +#> propbrk +#> Overall 0.34 +#> F 0.3061224 +#> M 0.4444444 +#> S 0.1875 +#> W 0.3846154 +#> X 0.2727273 +#> M 0.372549 +#> M 0.3076923 +#> S 0.5555556 +#> W 0.2307692 +#> X 0.4375 +#> binciWu +#> Overall 0.4372227 +#> F 0.4452789 +#> M 0.7333487 +#> S 0.4300888 +#> W 0.6447711 +#> X 0.5656453 +#> M 0.5097479 +#> M 0.5763066 +#> S 0.8112215 +#> W 0.5025638 +#> X 0.6682144 +#> binciWl +#> Overall 0.2546152 +#> F 0.1951549 +#> M 0.1887785 +#> S 0.06591599 +#> W 0.1770971 +#> X 0.09746059 +#> M 0.2532052 +#> M 0.126807 +#> S 0.2666513 +#> W 0.08179529 +#> X 0.2309865 +``` diff --git a/reference/bumpchart-1.png b/reference/bumpchart-1.png new file mode 100644 index 0000000..62d9dd7 Binary files /dev/null and b/reference/bumpchart-1.png differ diff --git a/reference/bumpchart-2.png b/reference/bumpchart-2.png new file mode 100644 index 0000000..48e59e8 Binary files /dev/null and b/reference/bumpchart-2.png differ diff --git a/reference/bumpchart.html b/reference/bumpchart.html new file mode 100644 index 0000000..39544e0 --- /dev/null +++ b/reference/bumpchart.html @@ -0,0 +1,166 @@ + +Display a "bumps" (sequential ranking) chart — bumpchart • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display a chart with two of more columns of points in order of ascending values + with lines connecting the points in a row.

    +
    + +
    +

    Usage

    +
    bumpchart(y,top.labels=colnames(y),labels=rep(rownames(y),2),rank=TRUE,
    +  mar=c(2,8,5,8),pch=19,col=par("fg"),lty=1,lwd=1,arrows=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    y
    +

    A numeric matrix or data frame which may contain NAs.

    + +
    top.labels
    +

    The strings that will appear at the top of each column of + points on the plot.

    + +
    labels
    +

    The strings that will appear next to the outer columns of + points.

    + +
    rank
    +

    Whether to rank the values in y before plotting.

    + +
    mar
    +

    The margins to use for the bumps chart. Alter to your taste.

    + +
    pch
    +

    The symbols to use when plotting the points.

    + +
    col
    +

    The colors to use.

    + +
    lty
    +

    The line types to use.

    + +
    lwd
    +

    The line widths to use.

    + +
    arrows
    +

    Whether to join the points with lines (FALSE) or arrows (TRUE).

    + +
    ...
    +

    Additional arguments passed to matplot or arrows.

    + +
    +
    +

    Details

    +

    bumpchart calls matplot to plot the values in the transposed + y matrix or data frame, joining the points with lines. At the left and + right edges of the plot, the labels identifying each row of points are + displayed. These labels may now be different for each side of the plot, + for example if the values of y are to be included. Remember that + due to the transposition of the values for plotting, the labels on the + right have to precede those on the left - see the second example.

    +

    This type of plot is often used to show the changing positions of + entities over time, like the ranking in surveys in different years. For a + similar, but more flexible plot, see ladderplot.

    +

    Because of the way matplot plots the values, the order of everything is + reversed. As the typical display of ranks is with rank 1 at the top, the + actual rank positions are used to plot the values. + This places the lowest scores at the bottom of the plot and the highest at + the top.

    +

    Any arguments that are included in ... will be passed to matplot + if the arrows argument is FALSE, and to the arrows function if + the arrows argument is TRUE as in the first example.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     # percentage of those over 25 years having completed high school
    + # in 10 cities in the USA in 1990 and 2000
    + educattn<-matrix(c(90.4,90.3,75.7,78.9,66,71.8,70.5,70.4,68.4,67.9,
    +  67.2,76.1,68.1,74.7,68.5,72.4,64.3,71.2,73.1,77.8),ncol=2,byrow=TRUE)
    + rownames(educattn)<-c("Anchorage AK","Boston MA","Chicago IL",
    +  "Houston TX","Los Angeles CA","Louisville KY","New Orleans LA",
    +  "New York NY","Philadelphia PA","Washington DC")
    + colnames(educattn)<-c(1990,2000)
    + bumpchart(educattn,main="Rank for high school completion by over 25s",
    +  arrows=TRUE,length=0.2)
    +
    + vallab<-c(paste(educattn[,2],rownames(educattn),sep="-"),
    +  paste(rownames(educattn),educattn[,1],sep="-"))
    + # now show the raw percentages and add central ticks
    + bumpchart(educattn,rank=FALSE,labels=vallab,
    +  main="Percentage high school completion by over 25s",
    +  lty=1:10,lwd=1,col=rainbow(10))
    + # margins have been reset, so use
    + par(xpd=TRUE)
    + boxed.labels(1.5,seq(65,90,by=5),seq(65,90,by=5))
    +
    + par(xpd=FALSE)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/bumpchart.md b/reference/bumpchart.md new file mode 100644 index 0000000..41f2987 --- /dev/null +++ b/reference/bumpchart.md @@ -0,0 +1,120 @@ +# Display a "bumps" (sequential ranking) chart + +Display a chart with two of more columns of points in order of ascending +values with lines connecting the points in a row. + +## Usage + +``` r +bumpchart(y,top.labels=colnames(y),labels=rep(rownames(y),2),rank=TRUE, + mar=c(2,8,5,8),pch=19,col=par("fg"),lty=1,lwd=1,arrows=FALSE,...) +``` + +## Arguments + +- y: + + A numeric matrix or data frame which may contain NAs. + +- top.labels: + + The strings that will appear at the top of each column of points on + the plot. + +- labels: + + The strings that will appear next to the outer columns of points. + +- rank: + + Whether to rank the values in `y` before plotting. + +- mar: + + The margins to use for the bumps chart. Alter to your taste. + +- pch: + + The symbols to use when plotting the points. + +- col: + + The colors to use. + +- lty: + + The line types to use. + +- lwd: + + The line widths to use. + +- arrows: + + Whether to join the points with lines (FALSE) or arrows (TRUE). + +- ...: + + Additional arguments passed to `matplot` or `arrows`. + +## Details + +`bumpchart` calls `matplot` to plot the values in the transposed `y` +matrix or data frame, joining the points with lines. At the left and +right edges of the plot, the labels identifying each row of points are +displayed. These labels may now be different for each side of the plot, +for example if the values of `y` are to be included. Remember that due +to the transposition of the values for plotting, the labels on the right +have to precede those on the left - see the second example. + +This type of plot is often used to show the changing positions of +entities over time, like the ranking in surveys in different years. For +a similar, but more flexible plot, see [ladderplot](ladderplot.md). + +Because of the way `matplot` plots the values, the order of everything +is reversed. As the typical display of ranks is with rank 1 at the top, +the actual rank positions are used to plot the values. This places the +lowest scores at the bottom of the plot and the highest at the top. + +Any arguments that are included in `...` will be passed to `matplot` if +the `arrows` argument is FALSE, and to the `arrows` function if the +`arrows` argument is TRUE as in the first example. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[matplot](https://rdrr.io/r/graphics/matplot.html) + +## Examples + +``` r + # percentage of those over 25 years having completed high school + # in 10 cities in the USA in 1990 and 2000 + educattn<-matrix(c(90.4,90.3,75.7,78.9,66,71.8,70.5,70.4,68.4,67.9, + 67.2,76.1,68.1,74.7,68.5,72.4,64.3,71.2,73.1,77.8),ncol=2,byrow=TRUE) + rownames(educattn)<-c("Anchorage AK","Boston MA","Chicago IL", + "Houston TX","Los Angeles CA","Louisville KY","New Orleans LA", + "New York NY","Philadelphia PA","Washington DC") + colnames(educattn)<-c(1990,2000) + bumpchart(educattn,main="Rank for high school completion by over 25s", + arrows=TRUE,length=0.2) + + vallab<-c(paste(educattn[,2],rownames(educattn),sep="-"), + paste(rownames(educattn),educattn[,1],sep="-")) + # now show the raw percentages and add central ticks + bumpchart(educattn,rank=FALSE,labels=vallab, + main="Percentage high school completion by over 25s", + lty=1:10,lwd=1,col=rainbow(10)) + # margins have been reset, so use + par(xpd=TRUE) + boxed.labels(1.5,seq(65,90,by=5),seq(65,90,by=5)) + + par(xpd=FALSE) +``` diff --git a/reference/categoryReshape.html b/reference/categoryReshape.html new file mode 100644 index 0000000..429bd46 --- /dev/null +++ b/reference/categoryReshape.html @@ -0,0 +1,126 @@ + +Convert object label/attribute label coding. — categoryReshape • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Convert object label/attribute label coding to an object by + attribute data frame.

    +
    + +
    +

    Usage

    +
    categoryReshape(x)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A matrix or data frame with at least two columns.

    + +
    +
    +

    Details

    +

    categoryReshape attempts to convert the first two columns of its input + into a data frame in which rows represent objects and columns attributes. For + each object, a value of 1 indicates that the object has that attribute, and a + value of 0 that it does not. In set membership terms, a 1 indicates that the + object is a member of that set and a 0 that it is not.

    +
    +
    +

    Value

    +

    A data frame (see Details).

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     ns<-sample(1:8,20,TRUE)
    + objects<-0
    + for(i in 1:length(ns)) objects<-c(objects,rep(i,ns[i]))
    + attributes<-"Z"
    + for(i in 1:length(ns)) attributes<-c(attributes,sample(LETTERS[1:8],ns[i]))
    + setdf<-data.frame(objects[-1],attributes[-1])
    + categoryReshape(setdf)
    +#>    A B C D E F G H
    +#> 1  1 0 1 0 1 1 0 0
    +#> 2  0 1 0 0 0 0 1 1
    +#> 3  0 0 1 1 1 1 1 1
    +#> 4  0 1 0 0 0 0 0 0
    +#> 5  1 1 1 1 1 1 0 1
    +#> 6  0 0 0 0 0 1 0 0
    +#> 7  1 1 1 1 1 0 0 0
    +#> 8  1 1 1 1 1 1 1 0
    +#> 9  0 1 1 1 1 1 1 1
    +#> 10 1 1 1 1 1 1 1 1
    +#> 11 0 1 1 1 1 1 0 1
    +#> 12 1 1 1 1 1 1 0 1
    +#> 13 0 1 0 0 0 0 0 0
    +#> 14 1 0 1 1 1 1 0 0
    +#> 15 1 0 1 1 0 1 0 0
    +#> 16 0 1 1 1 1 1 1 1
    +#> 17 0 1 1 1 0 0 1 1
    +#> 18 0 0 0 0 1 0 1 0
    +#> 19 1 0 0 0 1 0 0 0
    +#> 20 1 1 0 1 0 1 1 0
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/categoryReshape.md b/reference/categoryReshape.md new file mode 100644 index 0000000..91c7843 --- /dev/null +++ b/reference/categoryReshape.md @@ -0,0 +1,70 @@ +# Convert object label/attribute label coding. + +Convert object label/attribute label coding to an object by attribute +data frame. + +## Usage + +``` r +categoryReshape(x) +``` + +## Arguments + +- x: + + A matrix or data frame with at least two columns. + +## Details + +`categoryReshape` attempts to convert the first two columns of its input +into a data frame in which rows represent objects and columns +attributes. For each object, a value of 1 indicates that the object has +that attribute, and a value of 0 that it does not. In set membership +terms, a 1 indicates that the object is a member of that set and a 0 +that it is not. + +## Value + +A data frame (see Details). + +## Author + +Jim Lemon + +## See also + +[makeIntersectList](makeIntersectList.md) + +## Examples + +``` r + ns<-sample(1:8,20,TRUE) + objects<-0 + for(i in 1:length(ns)) objects<-c(objects,rep(i,ns[i])) + attributes<-"Z" + for(i in 1:length(ns)) attributes<-c(attributes,sample(LETTERS[1:8],ns[i])) + setdf<-data.frame(objects[-1],attributes[-1]) + categoryReshape(setdf) +#> A B C D E F G H +#> 1 1 0 1 0 1 1 0 0 +#> 2 0 1 0 0 0 0 1 1 +#> 3 0 0 1 1 1 1 1 1 +#> 4 0 1 0 0 0 0 0 0 +#> 5 1 1 1 1 1 1 0 1 +#> 6 0 0 0 0 0 1 0 0 +#> 7 1 1 1 1 1 0 0 0 +#> 8 1 1 1 1 1 1 1 0 +#> 9 0 1 1 1 1 1 1 1 +#> 10 1 1 1 1 1 1 1 1 +#> 11 0 1 1 1 1 1 0 1 +#> 12 1 1 1 1 1 1 0 1 +#> 13 0 1 0 0 0 0 0 0 +#> 14 1 0 1 1 1 1 0 0 +#> 15 1 0 1 1 0 1 0 0 +#> 16 0 1 1 1 1 1 1 1 +#> 17 0 1 1 1 0 0 1 1 +#> 18 0 0 0 0 1 0 1 0 +#> 19 1 0 0 0 1 0 0 0 +#> 20 1 1 0 1 0 1 1 0 +``` diff --git a/reference/centipede.plot-1.png b/reference/centipede.plot-1.png new file mode 100644 index 0000000..5fd728e Binary files /dev/null and b/reference/centipede.plot-1.png differ diff --git a/reference/centipede.plot-2.png b/reference/centipede.plot-2.png new file mode 100644 index 0000000..11c84fe Binary files /dev/null and b/reference/centipede.plot-2.png differ diff --git a/reference/centipede.plot.html b/reference/centipede.plot.html new file mode 100644 index 0000000..1b593d3 --- /dev/null +++ b/reference/centipede.plot.html @@ -0,0 +1,188 @@ + +Display a centipede plot — centipede.plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a centipede plot on the current graphics device.

    +
    + +
    +

    Usage

    +
    centipede.plot(segs,mct="mean",lower.limit="std.error",
    +  upper.limit=lower.limit,left.labels=NULL,right.labels=NULL,sort.segs=TRUE,
    +  main="",xlab=NA,pch=21,vgrid=NA,hgrid=NA,gridcol="lightgray",mar=NA,col=par("fg"),
    +  bg="green",...)
    +
    + +
    +

    Arguments

    +

    +
    segs
    +

    a matrix of midpoints and limits calculated by + get.segs OR a dstat object returned by + brkdn.

    + +
    mct
    +

    The function to use in calculating the midpoint of each + segment.

    + +
    lower.limit
    +

    The functions to use in calculating the + lower limits for each subset of the data.

    + +
    upper.limit
    +

    The functions to use in calculating the + upper limits.

    + +
    left.labels
    +

    The variable or subset labels to place at the left margin of + the plot. Default values are provided.

    + +
    right.labels
    +

    The variable or subset labels to place at the right margin + of the plot.

    + +
    sort.segs
    +

    Whether to sort the segments in ascending order.

    + +
    main
    +

    Optional title for the plot.

    + +
    xlab
    +

    Optional x axis label for the plot. The default NA + displays a text label showing the midpoint and limit functions.

    + +
    pch
    +

    The symbols to use when plotting midpoints.

    + +
    vgrid
    +

    Optional vertical line(s) to display on the plot. Defaults to + NA (none).

    + +
    hgrid
    +

    Optional horizontal grid lines to display on the plot. Defaults + to NA (none).

    + +
    gridcol
    +

    The color for the vgrid and hgrid lines.

    + +
    mar
    +

    Margin widths for the plot. Defaults to c(4,5,1,4) or + c(4,5,3,4) if there is a title.

    + +
    col
    +

    The color(s) of the limit lines and borders of the midpoint + markers.

    + +
    bg
    +

    The color(s) to fill the midpoint markers.

    + +
    ...
    +

    additional arguments passed to plot.

    + +
    +
    +

    Details

    +

    centipede.plot displays one or more midpoints and limits as + filled circles with horizontal error bars. It places labels on the left and + right sides of the plot. If these labels are long, it may be necessary to + pass explicit values to the mar argument to leave enough room.

    +

    The vgrid argument is usually used to display an average value for + all of the midpoints. If one or more values are passed in this argument, + they will be displayed as vertical lines spanning the plot. The hgrid + argument acts like the grid function, drawing dashed horizontal lines + across the plot. If hgrid=NULL, these lines will be drawn under the + values displayed, which will be 1 to the number of values on the vertical axis. + The user can pass explicit values if desired. With horizontal and optionally + vertical grid lines, the centipede plot is practically equivalent to a dotplot + with error bars.

    +

    Similarly, centipede plots typically have a large number of subsets, and + it may be necessary to start the graphics device with an aspect ratio that + will prevent crowding of the labels when over 30 segments are displayed.

    +

    The matrix segs may be entered manually or read from a file. + The first row specifies midpoints, the second and third rows the lower + and upper limits respectively and the fourth row the number of valid + observations. If there are no values for number of valid observations, + just pass vector of blank strings with the right.labels argument. + If a dstat object is passed as segs, the function will calculate + the lower and upper values according to the relevant arguments. This type of + plot is also known as a caterpillar plot or a league table.

    +
    +
    +

    Value

    +

    nil.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     testcp<-list("",40)
    + for(i in 1:40) testcp[[i]]<-rnorm(sample(1:8,1)*50)
    + segs<-get.segs(testcp)
    + centipede.plot(segs,main="Test centipede plot",vgrid=0)
    +
    +#> Warning: argument 1 does not name a graphical parameter
    + # now leave out the number of valid observations, pass x labels and no right labels
    + centipede.plot(segs[1:3,],main="Test centipede plot",vgrid=0,mar=c(4,5,3,2),
    +  left.labels=paste("X",1:40,sep=""),right.labels=rep("",40))
    +
    +#> Warning: argument 1 does not name a graphical parameter
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/centipede.plot.md b/reference/centipede.plot.md new file mode 100644 index 0000000..0cd3913 --- /dev/null +++ b/reference/centipede.plot.md @@ -0,0 +1,149 @@ +# Display a centipede plot + +Displays a centipede plot on the current graphics device. + +## Usage + +``` r +centipede.plot(segs,mct="mean",lower.limit="std.error", + upper.limit=lower.limit,left.labels=NULL,right.labels=NULL,sort.segs=TRUE, + main="",xlab=NA,pch=21,vgrid=NA,hgrid=NA,gridcol="lightgray",mar=NA,col=par("fg"), + bg="green",...) +``` + +## Arguments + +- segs: + + a matrix of midpoints and limits calculated by [get.segs](get.segs.md) + OR a `dstat` object returned by `brkdn`. + +- mct: + + The function to use in calculating the midpoint of each segment. + +- lower.limit: + + The functions to use in calculating the lower limits for each subset + of the data. + +- upper.limit: + + The functions to use in calculating the upper limits. + +- left.labels: + + The variable or subset labels to place at the left margin of the plot. + Default values are provided. + +- right.labels: + + The variable or subset labels to place at the right margin of the + plot. + +- sort.segs: + + Whether to sort the segments in ascending order. + +- main: + + Optional title for the plot. + +- xlab: + + Optional x axis label for the plot. The default NA displays a text + label showing the midpoint and limit functions. + +- pch: + + The symbols to use when plotting midpoints. + +- vgrid: + + Optional vertical line(s) to display on the plot. Defaults to NA + (none). + +- hgrid: + + Optional horizontal grid lines to display on the plot. Defaults to NA + (none). + +- gridcol: + + The color for the vgrid and hgrid lines. + +- mar: + + Margin widths for the plot. Defaults to c(4,5,1,4) or c(4,5,3,4) if + there is a title. + +- col: + + The color(s) of the limit lines and borders of the midpoint markers. + +- bg: + + The color(s) to fill the midpoint markers. + +- ...: + + additional arguments passed to `plot`. + +## Details + +`centipede.plot` displays one or more midpoints and limits as filled +circles with horizontal error bars. It places labels on the left and +right sides of the plot. If these labels are long, it may be necessary +to pass explicit values to the `mar` argument to leave enough room. + +The `vgrid` argument is usually used to display an average value for all +of the midpoints. If one or more values are passed in this argument, +they will be displayed as vertical lines spanning the plot. The `hgrid` +argument acts like the `grid` function, drawing dashed horizontal lines +across the plot. If `hgrid=NULL`, these lines will be drawn under the +values displayed, which will be 1 to the number of values on the +vertical axis. The user can pass explicit values if desired. With +horizontal and optionally vertical grid lines, the centipede plot is +practically equivalent to a dotplot with error bars. + +Similarly, centipede plots typically have a large number of subsets, and +it may be necessary to start the graphics device with an aspect ratio +that will prevent crowding of the labels when over 30 segments are +displayed. + +The matrix `segs` may be entered manually or read from a file. The first +row specifies midpoints, the second and third rows the lower and upper +limits respectively and the fourth row the number of valid observations. +If there are no values for number of valid observations, just pass +vector of blank strings with the `right.labels` argument. If a `dstat` +object is passed as `segs`, the function will calculate the lower and +upper values according to the relevant arguments. This type of plot is +also known as a caterpillar plot or a league table. + +## Value + +nil. + +## Author + +Jim Lemon + +## See also + +[get.segs](get.segs.md) + +## Examples + +``` r + testcp<-list("",40) + for(i in 1:40) testcp[[i]]<-rnorm(sample(1:8,1)*50) + segs<-get.segs(testcp) + centipede.plot(segs,main="Test centipede plot",vgrid=0) + +#> Warning: argument 1 does not name a graphical parameter + # now leave out the number of valid observations, pass x labels and no right labels + centipede.plot(segs[1:3,],main="Test centipede plot",vgrid=0,mar=c(4,5,3,2), + left.labels=paste("X",1:40,sep=""),right.labels=rep("",40)) + +#> Warning: argument 1 does not name a graphical parameter +``` diff --git a/reference/clean.args.html b/reference/clean.args.html new file mode 100644 index 0000000..b5342c1 --- /dev/null +++ b/reference/clean.args.html @@ -0,0 +1,128 @@ + +Remove inappropriate arguments from an argument list — clean.args • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Takes a list of arguments and eliminates those that are not + appropriate for passing to a particular function (and hence + would produce an error if passed).

    +
    + +
    +

    Usage

    +
    clean.args(argstr,fn,exclude.repeats=FALSE,exclude.other=NULL,dots.ok=TRUE)
    + remove.args(argstr,fn)
    +
    + +
    +

    Arguments

    +

    +
    argstr
    +

    a named list of arguments, e.g. from \dots

    + +
    fn
    +

    a function

    + +
    exclude.repeats
    +

    (logical) remove repeated arguments?

    + +
    exclude.other
    +

    a character vector of names of additional arguments to remove

    + +
    dots.ok
    +

    should "..." be allowed in the argument list?

    + +
    +
    +

    Value

    +

    clean.args returns a list which is a copy of argstr with + arguments inappropriate for fn removed; remove.args + removes the arguments for fn from the list.

    +
    +
    +

    Author

    +

    Ben Bolker

    +
    + +
    +

    Examples

    +
     tststr <- list(n=2,mean=0,sd=1,foo=4,bar=6) 
    + clean.args(tststr,rnorm)
    +#> $n
    +#> [1] 2
    +#> 
    +#> $mean
    +#> [1] 0
    +#> 
    +#> $sd
    +#> [1] 1
    +#> 
    + try(do.call("rnorm",tststr))
    +#> Error in rnorm(n = 2, mean = 0, sd = 1, foo = 4, bar = 6) : 
    +#>   unused arguments (foo = 4, bar = 6)
    + do.call("rnorm",clean.args(tststr,rnorm))
    +#> [1]  1.061975 -2.725278
    + remove.args(tststr,rnorm)
    +#> $foo
    +#> [1] 4
    +#> 
    +#> $bar
    +#> [1] 6
    +#> 
    + ## add example of combining arg. lists?
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/clean.args.md b/reference/clean.args.md new file mode 100644 index 0000000..6526f40 --- /dev/null +++ b/reference/clean.args.md @@ -0,0 +1,73 @@ +# Remove inappropriate arguments from an argument list + +Takes a list of arguments and eliminates those that are not appropriate +for passing to a particular function (and hence would produce an error +if passed). + +## Usage + +``` r +clean.args(argstr,fn,exclude.repeats=FALSE,exclude.other=NULL,dots.ok=TRUE) + remove.args(argstr,fn) +``` + +## Arguments + +- argstr: + + a named list of arguments, e.g. from `\dots` + +- fn: + + a function + +- exclude.repeats: + + (logical) remove repeated arguments? + +- exclude.other: + + a character vector of names of additional arguments to remove + +- dots.ok: + + should "..." be allowed in the argument list? + +## Value + +`clean.args` returns a list which is a copy of `argstr` with arguments +inappropriate for `fn` removed; `remove.args` removes the arguments for +`fn` from the list. + +## Author + +Ben Bolker + +## Examples + +``` r + tststr <- list(n=2,mean=0,sd=1,foo=4,bar=6) + clean.args(tststr,rnorm) +#> $n +#> [1] 2 +#> +#> $mean +#> [1] 0 +#> +#> $sd +#> [1] 1 +#> + try(do.call("rnorm",tststr)) +#> Error in rnorm(n = 2, mean = 0, sd = 1, foo = 4, bar = 6) : +#> unused arguments (foo = 4, bar = 6) + do.call("rnorm",clean.args(tststr,rnorm)) +#> [1] 1.061975 -2.725278 + remove.args(tststr,rnorm) +#> $foo +#> [1] 4 +#> +#> $bar +#> [1] 6 +#> + ## add example of combining arg. lists? +``` diff --git a/reference/clock24.plot-1.png b/reference/clock24.plot-1.png new file mode 100644 index 0000000..63dfe59 Binary files /dev/null and b/reference/clock24.plot-1.png differ diff --git a/reference/clock24.plot-2.png b/reference/clock24.plot-2.png new file mode 100644 index 0000000..9794a32 Binary files /dev/null and b/reference/clock24.plot-2.png differ diff --git a/reference/clock24.plot.html b/reference/clock24.plot.html new file mode 100644 index 0000000..57d3d82 --- /dev/null +++ b/reference/clock24.plot.html @@ -0,0 +1,154 @@ + +Plot values on a 24 hour "clockface" — clock24.plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    clock24.plot displays a plot of radial lines, symbols or a polygon + centered at the midpoint of the plot frame on a 24 hour 'clockface'. + In contrast to the default behavior of radial.plot, the positions + are interpreted as beginning at vertical (000) and moving clockwise.

    +

    If add=TRUE is passed as one of the additional arguments, the values + will be added to the current plot. If a radial.lim argument was + passed on the initial plot, it must be passed again to add values or the + values will be displayed incorrectly.

    +
    + +
    +

    Usage

    +
    clock24.plot(lengths,clock.pos,labels=0:23,minutes=FALSE,
    +  hm2dec=FALSE,label.pos=NULL,rp.type="r",loglen=FALSE,explab=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    lengths
    +

    numeric data vector. Magnitudes will be represented as + line lengths, or symbol or polygon vertex positions.

    + +
    clock.pos
    +

    numeric vector of positions on the 'clockface'. + These must be in decimal hours and will be rescaled to radians.

    + +
    labels
    +

    Labels to place at the circumference.

    + +
    minutes
    +

    Whether to add minutes (".00") to the labels.

    + +
    hm2dec
    +

    Whether to convert HH:MM clock positions to decimal hours.

    + +
    label.pos
    +

    Radial positions of the labels.

    + +
    rp.type
    +

    Whether to plot radial lines, symbols or a polygon.

    + +
    loglen
    +

    Whether to log transform the length values. Only base + 10 logs are available.

    + +
    explab
    +

    Whether to use the default fixed (FALSE) or exponential (TRUE) + notation for the radial labels.

    + +
    ...
    +

    additional arguments are passed to radial.plot and + then to plot.

    + +
    +
    +

    Value

    +

    A list of the parameters altered by radial.plot.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     testlen<-rnorm(24)*2+5
    + testpos<-0:23+rnorm(24)/4
    + clock24.plot(testlen,testpos,main="Test Clock24 (lines)",show.grid=FALSE,
    +  line.col="green",lwd=3)
    +
    + if(dev.interactive()) par(ask=TRUE)
    + # now do a 'daylight' plot
    + oldpar<-clock24.plot(testlen[7:19],testpos[7:19],
    +  main="Test Clock24 daytime (symbols)",
    +  point.col="blue",rp.type="s",lwd=3)
    +
    + # reset everything
    + par(oldpar)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/clock24.plot.md b/reference/clock24.plot.md new file mode 100644 index 0000000..e4c5384 --- /dev/null +++ b/reference/clock24.plot.md @@ -0,0 +1,94 @@ +# Plot values on a 24 hour "clockface" + +`clock24.plot` displays a plot of radial lines, symbols or a polygon +centered at the midpoint of the plot frame on a 24 hour 'clockface'. In +contrast to the default behavior of `radial.plot`, the positions are +interpreted as beginning at vertical (000) and moving clockwise. + +If `add=TRUE` is passed as one of the additional arguments, the values +will be added to the current plot. If a `radial.lim` argument was passed +on the initial plot, it must be passed again to add values or the values +will be displayed incorrectly. + +## Usage + +``` r +clock24.plot(lengths,clock.pos,labels=0:23,minutes=FALSE, + hm2dec=FALSE,label.pos=NULL,rp.type="r",loglen=FALSE,explab=FALSE,...) +``` + +## Arguments + +- lengths: + + numeric data vector. Magnitudes will be represented as line lengths, + or symbol or polygon vertex positions. + +- clock.pos: + + numeric vector of positions on the 'clockface'. These must be in + decimal hours and will be rescaled to radians. + +- labels: + + Labels to place at the circumference. + +- minutes: + + Whether to add minutes (".00") to the labels. + +- hm2dec: + + Whether to convert HH:MM clock positions to decimal hours. + +- label.pos: + + Radial positions of the labels. + +- rp.type: + + Whether to plot radial lines, symbols or a polygon. + +- loglen: + + Whether to log transform the `length` values. Only base 10 logs are + available. + +- explab: + + Whether to use the default fixed (FALSE) or exponential (TRUE) + notation for the radial labels. + +- ...: + + additional arguments are passed to `radial.plot` and then to `plot`. + +## Value + +A list of the parameters altered by [radial.plot](radial.plot.md). + +## Author + +Jim Lemon + +## See also + +[polar.plot](polar.plot.md),[radial.plot](radial.plot.md) + +## Examples + +``` r + testlen<-rnorm(24)*2+5 + testpos<-0:23+rnorm(24)/4 + clock24.plot(testlen,testpos,main="Test Clock24 (lines)",show.grid=FALSE, + line.col="green",lwd=3) + + if(dev.interactive()) par(ask=TRUE) + # now do a 'daylight' plot + oldpar<-clock24.plot(testlen[7:19],testpos[7:19], + main="Test Clock24 daytime (symbols)", + point.col="blue",rp.type="s",lwd=3) + + # reset everything + par(oldpar) +``` diff --git a/reference/clplot-1.png b/reference/clplot-1.png new file mode 100644 index 0000000..e262901 Binary files /dev/null and b/reference/clplot-1.png differ diff --git a/reference/clplot.html b/reference/clplot.html new file mode 100644 index 0000000..509510b --- /dev/null +++ b/reference/clplot.html @@ -0,0 +1,124 @@ + +Plot lines with colors determined by values. — clplot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    clplot displays a plot of lines for which the colors are dependent + upon the x and y values. clplot is similar to color.scale.lines + except that while the latter calculates a color for each unique value, + clplot assigns colors to groups of values within the cutpoints defined + by levels.

    +
    + +
    +

    Usage

    +
    clplot(x,y,ylab=deparse(substitute(y)),xlab=deparse(substitute(x)),
    +  levels=seq(min(y)+(max(y)-min(y))/5,max(y)-(max(y)-min(y))/5,length.out=4),
    +  cols=c("black","blue","green","orange","red"),lty=1,showcuts=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    numeric data vectors.

    + +
    ylab,xlab
    +

    Labels for the X and Y axes.

    + +
    levels
    +

    Cut points to assign colors to the values of x and + y.

    + +
    cols
    +

    The colors to be assigned.

    + +
    lty
    +

    The line type.

    + +
    showcuts
    +

    Whether to show the positions of the cut points.

    + +
    ...
    +

    additional arguments passed to plot or lines.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Carl Witthoft

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     x<-seq(1,100)
    + y<-sin(x/5)+x/20
    + clplot(x,y,main="Test of clplot")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/clplot.md b/reference/clplot.md new file mode 100644 index 0000000..fd37f41 --- /dev/null +++ b/reference/clplot.md @@ -0,0 +1,65 @@ +# Plot lines with colors determined by values. + +`clplot` displays a plot of lines for which the colors are dependent +upon the x and y values. `clplot` is similar to `color.scale.lines` +except that while the latter calculates a color for each unique value, +`clplot` assigns colors to groups of values within the cutpoints defined +by `levels`. + +## Usage + +``` r +clplot(x,y,ylab=deparse(substitute(y)),xlab=deparse(substitute(x)), + levels=seq(min(y)+(max(y)-min(y))/5,max(y)-(max(y)-min(y))/5,length.out=4), + cols=c("black","blue","green","orange","red"),lty=1,showcuts=FALSE,...) +``` + +## Arguments + +- x,y: + + numeric data vectors. + +- ylab,xlab: + + Labels for the X and Y axes. + +- levels: + + Cut points to assign colors to the values of `x` and `y`. + +- cols: + + The colors to be assigned. + +- lty: + + The line type. + +- showcuts: + + Whether to show the positions of the cut points. + +- ...: + + additional arguments passed to `plot` or `lines`. + +## Value + +nil + +## Author + +Carl Witthoft + +## See also + +[plot](https://rdrr.io/r/graphics/plot.default.html) + +## Examples + +``` r + x<-seq(1,100) + y<-sin(x/5)+x/20 + clplot(x,y,main="Test of clplot") +``` diff --git a/reference/cluster.overplot.html b/reference/cluster.overplot.html new file mode 100644 index 0000000..9279264 --- /dev/null +++ b/reference/cluster.overplot.html @@ -0,0 +1,131 @@ + +Shift overlying points into clusters — cluster.overplot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    cluster.overplot checks for overlying points in the x and y + coordinates passed. Those points that are overlying are moved to form + a small cluster of up to nine points. For large numbers of overlying + points, see count.overplot or sizeplot. + If you are unsure of the number of overplots in your data, run + count.overplot first to see if there are any potential clusters + larger than nine.

    +
    + +
    +

    Usage

    +
    cluster.overplot(x,y,away=NULL,tol=NULL,...)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    Numeric data vectors or the first two columns of a matrix + or data frame. Typically the x/y coordinates of points to be plotted.

    + +
    away
    +

    How far to move overlying points in user units. Defaults to + the width of a lower case "o" in the x direction and 5/8 of the + height of a lower case "o" in the y direction. Must have both values.

    + +
    tol
    +

    The largest distance between points that will be considered + to be overlying. Defaults to 1/2 of the width of a lower case "o" in + the x direction and 1/2 of the height of a lower case "o" in the y + direction.

    + +
    ...
    +

    additional arguments returned as they are passed.

    + +
    +
    +

    Value

    +

    A list with two components. For unique x-y pairs the elements will be + the same as in the original. For overlying points up to eight additional + points will be generated that will create a cluster of points instead of one.

    +
    +
    +

    Author

    +

    Jim Lemon - thanks to Markus Elze for the test for a current graphics + device

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     xy.mat<-cbind(sample(1:10,200,TRUE),sample(1:10,200,TRUE))
    + clusteredpoints<-
    +  cluster.overplot(xy.mat,col=rep(c("red","green"),each=100),
    +  away=rep(0.2,2))
    +#> Error in strwidth("o"): plot.new has not been called yet
    + plot(clusteredpoints,col=clusteredpoints$col,
    +  main="Cluster overplot test")
    +#> Error: object 'clusteredpoints' not found
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/cluster.overplot.md b/reference/cluster.overplot.md new file mode 100644 index 0000000..aa72e7a --- /dev/null +++ b/reference/cluster.overplot.md @@ -0,0 +1,68 @@ +# Shift overlying points into clusters + +`cluster.overplot` checks for overlying points in the x and y +coordinates passed. Those points that are overlying are moved to form a +small cluster of up to nine points. For large numbers of overlying +points, see [count.overplot](count.overplot.md) or +[sizeplot](sizeplot.md). If you are unsure of the number of overplots in +your data, run `count.overplot` first to see if there are any potential +clusters larger than nine. + +## Usage + +``` r +cluster.overplot(x,y,away=NULL,tol=NULL,...) +``` + +## Arguments + +- x,y: + + Numeric data vectors or the first two columns of a matrix or data + frame. Typically the x/y coordinates of points to be plotted. + +- away: + + How far to move overlying points in user units. Defaults to the width + of a lower case "o" in the x direction and 5/8 of the height of a + lower case "o" in the y direction. Must have both values. + +- tol: + + The largest distance between points that will be considered to be + overlying. Defaults to 1/2 of the width of a lower case "o" in the x + direction and 1/2 of the height of a lower case "o" in the y + direction. + +- ...: + + additional arguments returned as they are passed. + +## Value + +A list with two components. For unique x-y pairs the elements will be +the same as in the original. For overlying points up to eight additional +points will be generated that will create a cluster of points instead of +one. + +## Author + +Jim Lemon - thanks to Markus Elze for the test for a current graphics +device + +## See also + +[count.overplot](count.overplot.md),[sizeplot](sizeplot.md) + +## Examples + +``` r + xy.mat<-cbind(sample(1:10,200,TRUE),sample(1:10,200,TRUE)) + clusteredpoints<- + cluster.overplot(xy.mat,col=rep(c("red","green"),each=100), + away=rep(0.2,2)) +#> Error in strwidth("o"): plot.new has not been called yet + plot(clusteredpoints,col=clusteredpoints$col, + main="Cluster overplot test") +#> Error: object 'clusteredpoints' not found +``` diff --git a/reference/clustered.dotplots-1.png b/reference/clustered.dotplots-1.png new file mode 100644 index 0000000..7c97ac6 Binary files /dev/null and b/reference/clustered.dotplots-1.png differ diff --git a/reference/clustered.dotplots-2.png b/reference/clustered.dotplots-2.png new file mode 100644 index 0000000..c342ef8 Binary files /dev/null and b/reference/clustered.dotplots-2.png differ diff --git a/reference/clustered.dotplots-3.png b/reference/clustered.dotplots-3.png new file mode 100644 index 0000000..31f2b0a Binary files /dev/null and b/reference/clustered.dotplots-3.png differ diff --git a/reference/clustered.dotplots-4.png b/reference/clustered.dotplots-4.png new file mode 100644 index 0000000..0cf042f Binary files /dev/null and b/reference/clustered.dotplots-4.png differ diff --git a/reference/clustered.dotplots-5.png b/reference/clustered.dotplots-5.png new file mode 100644 index 0000000..9a7f952 Binary files /dev/null and b/reference/clustered.dotplots-5.png differ diff --git a/reference/clustered.dotplots.html b/reference/clustered.dotplots.html new file mode 100644 index 0000000..33d6775 --- /dev/null +++ b/reference/clustered.dotplots.html @@ -0,0 +1,157 @@ + +Display the frequencies of two categories — clustered.dotplots • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    clustered.dotplots displays a contingency table as clusters of + symbols on a plot. It expects xgroup and ygroup to contain + all or some of the combinations of their unique values. It also expects + freq to contain the number of instances of each combination.

    +
    + +
    +

    Usage

    +
    clustered.dotplots(xgroup, ygroup, freq, type = "circles",
    + main="",xlab="",ylab="",x_las=1,y_las=1,axes=TRUE,size=1,...)
    +
    + +
    +

    Arguments

    +

    +
    xgroup,ygroup
    +

    Vectors that specify the two groupings to be + displayed (see Details).

    + +
    freq
    +

    The frequencies in the two groupings.

    + +
    type
    +

    The type of symbols to use as "dots".

    + +
    main,xlab,ylab
    +

    As in plot.

    + +
    x_las,y_las
    +

    Orientation of the axis tick labels.

    + +
    axes
    +

    Whether to display axes.

    + +
    size
    +

    Spacing for the clusters.

    + +
    ...
    +

    additional arguments passed to "points".

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Darshan Baral

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     df <- structure(list(set = c("09t0101 TJ", "09t0102 MW", "09t0201 EH", 
    + "09t0202 NH", "09t0101 TJ", "09t0102 MW", "09t0201 EH", "09t0202 NH", 
    + "09t0101 TJ", "09t0102 MW", "09t0201 EH", "09t0202 NH", "09t0101 TJ", 
    + "09t0102 MW", "09t0201 EH", "09t0202 NH", "09t0202 NH"), grade = c("1", 
    + "1", "1", "1", "2", "2", "2", "2", "3", "3", "3", "3", "4", "4", 
    + "4", "4", "5"), freq = c(7, 8, 2, 3, 11, 4, 11, 3, 3, 8, 3, 8, 
    + 3, 9, 3, 2, 5)), .Names = c("set", "grade", "freq"), row.names = c(NA, 
    + 17L), class = "data.frame")
    + clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq)
    +
    + clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq,
    +  col = "gray")
    +
    + clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq,
    +  type = "points")
    +
    + clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq,
    +  type = "points", pch = 19, col = "red")
    +
    + # this will cause an error
    + # clustered.dotplots(xgroup = mtcars$cyl, ygroup = mtcars$gear,
    + #  freq = mtcars$carb)
    + # how to fix it
    + cumcars<-by(mtcars$carb,list(mtcars$cyl,mtcars$gear),valid.n)
    + mtcars2<-data.frame(cyl=NA,gear=NA,carb=NA)
    + rownum<-1
    + for(cyl in dimnames(cumcars)[[1]]) {
    +  for(gear in dimnames(cumcars)[[2]]) {
    +   if(!is.na(cumcars[cyl,gear])) {
    +    mtcars2[rownum,]<-c(as.numeric(cyl),as.numeric(gear),cumcars[cyl,gear])
    +    rownum<-rownum+1
    +   }
    +  }
    + }
    + clustered.dotplots(xgroup = mtcars2$cyl, ygroup = mtcars2$gear,
    +  freq = mtcars2$carb,main="Cars by number of cylinders and gears",
    +  xlab="Number of cylinders",ylab="Number of gears",type="points",pch=5)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/clustered.dotplots.md b/reference/clustered.dotplots.md new file mode 100644 index 0000000..ad687b0 --- /dev/null +++ b/reference/clustered.dotplots.md @@ -0,0 +1,101 @@ +# Display the frequencies of two categories + +`clustered.dotplots` displays a contingency table as clusters of symbols +on a plot. It expects `xgroup` and `ygroup` to contain all or some of +the combinations of their unique values. It also expects `freq` to +contain the number of instances of each combination. + +## Usage + +``` r +clustered.dotplots(xgroup, ygroup, freq, type = "circles", + main="",xlab="",ylab="",x_las=1,y_las=1,axes=TRUE,size=1,...) +``` + +## Arguments + +- xgroup,ygroup: + + Vectors that specify the two groupings to be displayed (see Details). + +- freq: + + The frequencies in the two groupings. + +- type: + + The type of symbols to use as "dots". + +- main,xlab,ylab: + + As in plot. + +- x_las,y_las: + + Orientation of the axis tick labels. + +- axes: + + Whether to display axes. + +- size: + + Spacing for the clusters. + +- ...: + + additional arguments passed to "points". + +## Value + +nil + +## Author + +Darshan Baral + +## See also + +[cluster.overplot](cluster.overplot.md) + +## Examples + +``` r + df <- structure(list(set = c("09t0101 TJ", "09t0102 MW", "09t0201 EH", + "09t0202 NH", "09t0101 TJ", "09t0102 MW", "09t0201 EH", "09t0202 NH", + "09t0101 TJ", "09t0102 MW", "09t0201 EH", "09t0202 NH", "09t0101 TJ", + "09t0102 MW", "09t0201 EH", "09t0202 NH", "09t0202 NH"), grade = c("1", + "1", "1", "1", "2", "2", "2", "2", "3", "3", "3", "3", "4", "4", + "4", "4", "5"), freq = c(7, 8, 2, 3, 11, 4, 11, 3, 3, 8, 3, 8, + 3, 9, 3, 2, 5)), .Names = c("set", "grade", "freq"), row.names = c(NA, + 17L), class = "data.frame") + clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq) + + clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq, + col = "gray") + + clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq, + type = "points") + + clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq, + type = "points", pch = 19, col = "red") + + # this will cause an error + # clustered.dotplots(xgroup = mtcars$cyl, ygroup = mtcars$gear, + # freq = mtcars$carb) + # how to fix it + cumcars<-by(mtcars$carb,list(mtcars$cyl,mtcars$gear),valid.n) + mtcars2<-data.frame(cyl=NA,gear=NA,carb=NA) + rownum<-1 + for(cyl in dimnames(cumcars)[[1]]) { + for(gear in dimnames(cumcars)[[2]]) { + if(!is.na(cumcars[cyl,gear])) { + mtcars2[rownum,]<-c(as.numeric(cyl),as.numeric(gear),cumcars[cyl,gear]) + rownum<-rownum+1 + } + } + } + clustered.dotplots(xgroup = mtcars2$cyl, ygroup = mtcars2$gear, + freq = mtcars2$carb,main="Cars by number of cylinders and gears", + xlab="Number of cylinders",ylab="Number of gears",type="points",pch=5) +``` diff --git a/reference/color.axis.html b/reference/color.axis.html new file mode 100644 index 0000000..b05b06c --- /dev/null +++ b/reference/color.axis.html @@ -0,0 +1,101 @@ + +Display an axis in a specified color — color.axis • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    color.axis displays an axis in the specified color.

    +
    + +
    +

    Usage

    +
    color.axis(side=1,at=NULL,labels=TRUE,axlab=NA,axlab.at=NA,
    +  col=par("fg"),cex.axis=par("cex.axis"),cex=par("cex"))
    +
    + +
    +

    Arguments

    +

    +
    side
    +

    Which axis - see axis.

    + +
    at
    +

    Positions for the tick labels.

    + +
    labels
    +

    Tick labels.

    + +
    axlab
    +

    Optional axis label.

    + +
    axlab.at
    +

    Where to position the axis label - defaults to centered.

    + +
    col
    +

    Color for the axis.

    + +
    cex.axis
    +

    Character expansion for the tick labels.

    + +
    cex
    +

    Character expansion for the axis label.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/color.axis.md b/reference/color.axis.md new file mode 100644 index 0000000..0a9256d --- /dev/null +++ b/reference/color.axis.md @@ -0,0 +1,52 @@ +# Display an axis in a specified color + +`color.axis` displays an axis in the specified color. + +## Usage + +``` r +color.axis(side=1,at=NULL,labels=TRUE,axlab=NA,axlab.at=NA, + col=par("fg"),cex.axis=par("cex.axis"),cex=par("cex")) +``` + +## Arguments + +- side: + + Which axis - see axis. + +- at: + + Positions for the tick labels. + +- labels: + + Tick labels. + +- axlab: + + Optional axis label. + +- axlab.at: + + Where to position the axis label - defaults to centered. + +- col: + + Color for the axis. + +- cex.axis: + + Character expansion for the tick labels. + +- cex: + + Character expansion for the axis label. + +## Value + +nil + +## Author + +Jim Lemon diff --git a/reference/color.gradient.html b/reference/color.gradient.html new file mode 100644 index 0000000..d816132 --- /dev/null +++ b/reference/color.gradient.html @@ -0,0 +1,116 @@ + +Calculate an arbitrary sequence of colors — color.gradient • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    color.gradient is now just a call to color.scale with a + vector of equally spaced integers (1:nslices). The function is kept for + backward compatibility.

    +
    + +
    +

    Usage

    +
    color.gradient(reds,greens,blues,nslices=50)
    +
    + +
    +

    Arguments

    +

    +
    reds,greens,blues
    +

    vectors of the values of the color components + as 0 to 1.

    + +
    nslices
    +

    The number of color "slices".

    + +
    +
    +

    Note

    +

    The function is mainly useful for defining a set of colors to represent + a known number of gradations. Such a set can be used to assign a grade + to a small number of values (e.g. points on a scatterplot - but see + color.scale for large numbers) and display a color bar using + gradient.rect as a legend.

    +
    +
    +

    Value

    +

    A vector of hexadecimal color values as used by col.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     # try it with red and blue endpoints and green midpoints.
    + color.gradient(c(0,1),c(1,0.6,0.4,0.3,0),c(0.1,0.6))
    +#>  [1] "#00FF1AFF" "#05F71CFF" "#0AEE1FFF" "#10E621FF" "#15DD24FF" "#1AD527FF"
    +#>  [7] "#1FCC29FF" "#24C32CFF" "#2ABB2EFF" "#2FB331FF" "#34AA34FF" "#39A236FF"
    +#> [13] "#3E9939FF" "#44993BFF" "#49943EFF" "#4E9041FF" "#538B43FF" "#588646FF"
    +#> [19] "#5E8248FF" "#637D4BFF" "#68794EFF" "#6D7450FF" "#726F53FF" "#786B55FF"
    +#> [25] "#7D6658FF" "#82665BFF" "#87645DFF" "#8D6160FF" "#925F62FF" "#975D65FF"
    +#> [31] "#9C5A68FF" "#A1586AFF" "#A7566DFF" "#AC536FFF" "#B15172FF" "#B64F75FF"
    +#> [37] "#BB4D77FF" "#C14D7AFF" "#C6467CFF" "#CB407FFF" "#D03982FF" "#D53384FF"
    +#> [43] "#DB2D87FF" "#E02689FF" "#E5208CFF" "#EA1A8FFF" "#EF1391FF" "#F50D94FF"
    +#> [49] "#FA0696FF" "#FF0099FF"
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/color.gradient.md b/reference/color.gradient.md new file mode 100644 index 0000000..a2dcf63 --- /dev/null +++ b/reference/color.gradient.md @@ -0,0 +1,57 @@ +# Calculate an arbitrary sequence of colors + +`color.gradient` is now just a call to `color.scale` with a vector of +equally spaced integers (1:nslices). The function is kept for backward +compatibility. + +## Usage + +``` r +color.gradient(reds,greens,blues,nslices=50) +``` + +## Arguments + +- reds,greens,blues: + + vectors of the values of the color components as 0 to 1. + +- nslices: + + The number of color "slices". + +## Note + +The function is mainly useful for defining a set of colors to represent +a known number of gradations. Such a set can be used to assign a grade +to a small number of values (e.g. points on a scatterplot - but see +`color.scale` for large numbers) and display a color bar using +`gradient.rect` as a legend. + +## Value + +A vector of hexadecimal color values as used by `col`. + +## Author + +Jim Lemon + +## See also + +[rescale](rescale.md),[approx](https://rdrr.io/r/stats/approxfun.html),[color.scale](color.scale.md) + +## Examples + +``` r + # try it with red and blue endpoints and green midpoints. + color.gradient(c(0,1),c(1,0.6,0.4,0.3,0),c(0.1,0.6)) +#> [1] "#00FF1AFF" "#05F71CFF" "#0AEE1FFF" "#10E621FF" "#15DD24FF" "#1AD527FF" +#> [7] "#1FCC29FF" "#24C32CFF" "#2ABB2EFF" "#2FB331FF" "#34AA34FF" "#39A236FF" +#> [13] "#3E9939FF" "#44993BFF" "#49943EFF" "#4E9041FF" "#538B43FF" "#588646FF" +#> [19] "#5E8248FF" "#637D4BFF" "#68794EFF" "#6D7450FF" "#726F53FF" "#786B55FF" +#> [25] "#7D6658FF" "#82665BFF" "#87645DFF" "#8D6160FF" "#925F62FF" "#975D65FF" +#> [31] "#9C5A68FF" "#A1586AFF" "#A7566DFF" "#AC536FFF" "#B15172FF" "#B64F75FF" +#> [37] "#BB4D77FF" "#C14D7AFF" "#C6467CFF" "#CB407FFF" "#D03982FF" "#D53384FF" +#> [43] "#DB2D87FF" "#E02689FF" "#E5208CFF" "#EA1A8FFF" "#EF1391FF" "#F50D94FF" +#> [49] "#FA0696FF" "#FF0099FF" +``` diff --git a/reference/color.id.html b/reference/color.id.html new file mode 100644 index 0000000..6e661ca --- /dev/null +++ b/reference/color.id.html @@ -0,0 +1,96 @@ + +Identify closest match to a color — color.id • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Given a color specified as a hex string, find the closest match in the + table of known (named) colors

    +
    + +
    +

    Usage

    +
    color.id(col)
    +
    + +
    +

    Arguments

    +

    +
    col
    +

    a color specified as a hex string

    + +
    +
    +

    Details

    +

    finds the color with the minimum squared distance in RGB space

    +
    +
    +

    Value

    +

    the name of the closest match

    +
    +
    +

    Author

    +

    Ben Bolker

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     color.id("#cc00cc")
    +#> [1] "magenta3"
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/color.id.md b/reference/color.id.md new file mode 100644 index 0000000..7a911ec --- /dev/null +++ b/reference/color.id.md @@ -0,0 +1,39 @@ +# Identify closest match to a color + +Given a color specified as a hex string, find the closest match in the +table of known (named) colors + +## Usage + +``` r +color.id(col) +``` + +## Arguments + +- col: + + a color specified as a hex string + +## Details + +finds the color with the minimum squared distance in RGB space + +## Value + +the name of the closest match + +## Author + +Ben Bolker + +## See also + +[col2rgb](https://rdrr.io/r/grDevices/col2rgb.html),[colors](https://rdrr.io/r/grDevices/colors.html) + +## Examples + +``` r + color.id("#cc00cc") +#> [1] "magenta3" +``` diff --git a/reference/color.legend-1.png b/reference/color.legend-1.png new file mode 100644 index 0000000..719ddf8 Binary files /dev/null and b/reference/color.legend-1.png differ diff --git a/reference/color.legend.html b/reference/color.legend.html new file mode 100644 index 0000000..1bb258c --- /dev/null +++ b/reference/color.legend.html @@ -0,0 +1,145 @@ + +Legend matching categories or values to colors — color.legend • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display a color legend on a plot

    +
    + +
    +

    Usage

    +
    color.legend(xl,yb,xr,yt,legend,rect.col,cex=1,align="lt",gradient="x",...)
    +
    + +
    +

    Arguments

    +

    +
    xl,yb,xr,yt
    +

    The lower left and upper right coordinates of the + rectange of colors in user coordinates.

    + +
    legend
    +

    The labels that will appear next to some or all of the colors.

    + +
    rect.col
    +

    The colors that will fill the rectangle.

    + +
    cex
    +

    Character expansion factor for the labels.

    + +
    align
    +

    How to align the labels relative to the color rectangle.

    + +
    gradient
    +

    Whether to have a horizontal (x) or vertical (y) color + gradient.

    + +
    ...
    +

    Additional arguments passed to text.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    color.legend displays a rectangle defined by the first four arguments + filled with smaller rectangles of color defined by the rect.col argument. + Labels, defined by the legend argument, are placed next to the color + rectangle. The position of the labels is determined by whether the color + rectangle is horizontal or vertical and the align argument. The default + value of lt places the labels at the left of a vertical rectangle or the + top of a horizontal one. rb puts them on the other side. To have the + labels in the same color as the rectangles, include a col argument that + will be passed to text as in the example.

    +

    There can be fewer labels than colors. The labels will be evenly spaced along + the rectangle in this case. It is possible to use empty labels to get uneven + spacing. The user can pass more labels than colors, but the labels will almost + certainly be crowded and I have only found one use for this. If the user wants + the labels at the intersection of the boxes rather than in the center, see the + alternative specification for the labels in the example (thanks Claudia Tebaldi). + To have complete control over the labels, see gradient.rect and + text or mtext.

    +

    colorlegend in the shape package offers a different approach, + creating a large number of colors from a color generating function (a bit + like color.gradient) and then allowing the user to specify tick + marks at arbitrary points along the color bar.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     # get some extra room
    + par(mar=c(7,4,4,6))
    + testcol<-color.gradient(c(0,1),0,c(1,0),nslices=5)
    + col.labels<-c("Cold","Warm","Hot")
    + # this will put the labels at the intersections
    + # col.labels<-c("","Cold","","Warm","","Warmer","","Hot","")
    + color2D.matplot(matrix(rnorm(100),nrow=10),c(1,0),0,c(0,1),
    +  main="Test color legends")
    + color.legend(11,6,11.8,9,col.labels,testcol,gradient="y")
    + color.legend(10.2,2,11,5,col.labels,testcol,align="rb",gradient="y")
    + color.legend(0.5,-2,3.5,-1.2,col.labels,testcol)
    + color.legend(7,-1.8,10,-1,col.labels,testcol,align="rb",col=testcol[c(1,3,5)])
    +
    + par(mar=c(5,4,4,2))
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/color.legend.md b/reference/color.legend.md new file mode 100644 index 0000000..fe083e4 --- /dev/null +++ b/reference/color.legend.md @@ -0,0 +1,99 @@ +# Legend matching categories or values to colors + +Display a color legend on a plot + +## Usage + +``` r +color.legend(xl,yb,xr,yt,legend,rect.col,cex=1,align="lt",gradient="x",...) +``` + +## Arguments + +- xl,yb,xr,yt: + + The lower left and upper right coordinates of the rectange of colors + in user coordinates. + +- legend: + + The labels that will appear next to some or all of the colors. + +- rect.col: + + The colors that will fill the rectangle. + +- cex: + + Character expansion factor for the labels. + +- align: + + How to align the labels relative to the color rectangle. + +- gradient: + + Whether to have a horizontal (x) or vertical (y) color gradient. + +- ...: + + Additional arguments passed to `text`. + +## Value + +nil + +## Details + +`color.legend` displays a rectangle defined by the first four arguments +filled with smaller rectangles of color defined by the `rect.col` +argument. Labels, defined by the `legend` argument, are placed next to +the color rectangle. The position of the labels is determined by whether +the color rectangle is horizontal or vertical and the `align` argument. +The default value of `lt` places the labels at the left of a vertical +rectangle or the top of a horizontal one. `rb` puts them on the other +side. To have the labels in the same color as the rectangles, include a +`col` argument that will be passed to `text` as in the example. + +There can be fewer labels than colors. The labels will be evenly spaced +along the rectangle in this case. It is possible to use empty labels to +get uneven spacing. The user can pass more labels than colors, but the +labels will almost certainly be crowded and I have only found one use +for this. If the user wants the labels at the intersection of the boxes +rather than in the center, see the alternative specification for the +labels in the example (thanks Claudia Tebaldi). To have complete control +over the labels, see [gradient.rect](gradient.rect.md) and +[text](https://rdrr.io/r/graphics/text.html) or +[mtext](https://rdrr.io/r/graphics/mtext.html). + +`colorlegend` in the shape package offers a different approach, creating +a large number of colors from a color generating function (a bit like +`color.gradient`) and then allowing the user to specify tick marks at +arbitrary points along the color bar. + +## Author + +Jim Lemon + +## See also + +[color.gradient](color.gradient.md), [gradient.rect](gradient.rect.md) + +## Examples + +``` r + # get some extra room + par(mar=c(7,4,4,6)) + testcol<-color.gradient(c(0,1),0,c(1,0),nslices=5) + col.labels<-c("Cold","Warm","Hot") + # this will put the labels at the intersections + # col.labels<-c("","Cold","","Warm","","Warmer","","Hot","") + color2D.matplot(matrix(rnorm(100),nrow=10),c(1,0),0,c(0,1), + main="Test color legends") + color.legend(11,6,11.8,9,col.labels,testcol,gradient="y") + color.legend(10.2,2,11,5,col.labels,testcol,align="rb",gradient="y") + color.legend(0.5,-2,3.5,-1.2,col.labels,testcol) + color.legend(7,-1.8,10,-1,col.labels,testcol,align="rb",col=testcol[c(1,3,5)]) + + par(mar=c(5,4,4,2)) +``` diff --git a/reference/color.scale-1.png b/reference/color.scale-1.png new file mode 100644 index 0000000..124156f Binary files /dev/null and b/reference/color.scale-1.png differ diff --git a/reference/color.scale-2.png b/reference/color.scale-2.png new file mode 100644 index 0000000..be69f68 Binary files /dev/null and b/reference/color.scale-2.png differ diff --git a/reference/color.scale.html b/reference/color.scale.html new file mode 100644 index 0000000..8408430 --- /dev/null +++ b/reference/color.scale.html @@ -0,0 +1,207 @@ + +Turn values into colors. — color.scale • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Transform numeric values into colors using RGB, HSV or HCL

    +
    + +
    +

    Usage

    +
    color.scale(x,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1),alpha=1,
    +  extremes=NA,na.color=NA,xrange=NULL,color.spec="rgb")
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    a numeric vector, matrix or data frame

    + +
    cs1,cs2,cs3
    +

    color parameters for scaling x

    + +
    alpha
    +

    Value for transparency in colors. If more than one value is + passed, the alpha values will be transformed like the colors.

    + +
    extremes
    +

    The colors for the extreme values of x (RGB only).

    + +
    na.color
    +

    The color to use for NA values of x.

    + +
    xrange
    +

    An explicit range to use in the transformation.

    + +
    color.spec
    +

    The color specification to use in the transformation. + Anything other than "rgb", "hsv" or "hcl" will almost certainly fail.

    + +
    +
    +

    Details

    +

    color.scale calculates a sequence of colors by a linear + transformation of the numeric values supplied into the ranges + for the three color parameters. If only one number is supplied for a + color range, that color remains constant for all values of x. + If more than two values are supplied, the x values will be + split into equal ranges (one less than the number of colors) and + the transformation carried out on each range. Values for a color + range must be between 0 and 1 for the RGB or HSV specifications, and + between 0 and 360 (cs1) and 0 to 100 (cs2 and cs3) for the HCL + specifications.

    +

    IMPORTANT: If x has fewer values than the number of values + in the color parameters, it will usually return incorrect + colors. This is usually only a problem when using color.legend + with a small number of rectangles in the legend as color.legend + calls color.scale to calculate the color rectangles.

    +

    If extremes is not NA, the ranges will be calculated from + its values using col2rgb, even if ranges are also supplied. + extremes allows the user to just pass the extreme color values + in any format that col2rgb will accept. Note that this forces + the color specification to RGB.

    +

    If the user wants to specify a range of values with xrange, + it must at least include the range of x values. This can be useful + when there is a notional range like 0-100% that the values do not + cover, or when several series of values with different ranges are + to be assigned the same color scale.

    +

    The user may not want the color scheme to be continuous across some + critical point, often zero. In this case, color.scale can be called + separately for the values below and above zero. I may get around to + adding an argument to do this in one shot. Until then, see the second + example for color2D.matplot and also the diverge.hcl and + diverge.hsv functions in the colorspace package.

    +

    When passing more than one alpha value, it will be transformed like the + colors. This allows matrices with concentrations of high values to be + overplotted to illustrate group locations and separations. See the iris + example in color2D.matplot.

    +
    +
    +

    Note

    +

    The function is useful for highlighting a numeric dimension or adding + an extra "dimension" to a plot.

    +

    There are quite a few R functions that transform numeric values into + colors or produce colors that can be used to represent values. Two + packages that might be of interest are RColorBrewer and + colourschemes. See the last example for approximating other color + scales with color.scale.

    +
    +
    +

    Value

    +

    A vector or matrix of hexadecimal color values.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     # go from green through yellow to red with no blue
    + x<-rnorm(20)
    + y<-rnorm(20)
    + # use y for the color scale
    + plot(x,y,col=color.scale(y,c(0,1,1),c(1,1,0),0),main="Color scale plot",
    +  pch=16,cex=2)
    +
    + plot(1:10,rep(1:3,length.out=10),axes=FALSE,type="n",xlim=c(0,11),ylim=c(0,4),
    +  main="Test of RGB, HSV and HCL",xlab="",ylab="Color specification")
    + axis(2,at=1:3,labels=c("HCL","HSV","RGB"))
    + points(1:10,rep(1,10),pch=19,cex=8,col=color.scale(1:10,c(0,300),35,85,
    +  color.spec="hcl"))
    + points(1:10,rep(2,10),pch=19,cex=8,col=color.scale(1:10,c(0,1),
    +  0.8,1,color.spec="hsv"))
    + points(1:10,rep(3,10),pch=19,cex=8,col=color.scale(1:10,c(1,0.5,0),
    +  c(0,0.5,0),c(0,0,1),color.spec="rgb"))
    +
    + if (FALSE) { # \dontrun{
    +  # requires viridisLite
    +  library(viridisLite)
    +  plot(0,xlim=c(-1,1),ylim=c(-1,1),type="n",axes=FALSE,
    +   main="Approximating other color scales",xlab="",ylab="")
    +  gradient.rect(-1,0.8,1,0.95,nslices=50,
    +   col=color.scale(1:50,1,
    +   c(0,0.3,0.6,0.8,1,1),
    +   c(0,0,0,0,0,0,1)))
    +  text(0,1,"color.scale")
    +  gradient.rect(-1,0.65,1,0.8,col=heat.colors(50))
    +  text(0,0.6,"heat.colors")
    +  gradient.rect(-1,0.3,1,0.45,nslices=50,
    +   col=color.scale(1:50,c(0,0.2,0.9,0.95,0.95),
    +   c(0.7,0.8,0.9,0.7,0.95),
    +   c(0.1,0,0,0.35,0.95)))
    +  text(0,0.5,"color.scale")
    +  gradient.rect(-1,0.15,1,0.3,col=terrain.colors(50))
    +  text(0,0.1,"terrain.colors")
    +  gradient.rect(-1,-0.2,1,-0.05,nslices=50,
    +   col=color.scale(1:50,c(0.3,0,0.3,0.1,1,0.95,1),
    +   c(0,0.3,0.9,1,1,0.85,0.85),
    +   c(1,1,0.9,0.1,0,0.5,0.5)))
    +  text(0,0,"color.scale")
    +  gradient.rect(-1,-0.35,1,-0.2,col=topo.colors(50))
    +  text(0,-0.4,"topo.colors")
    +  gradient.rect(-1,-0.7,1,-0.55,nslices=50,
    +   col=color.scale(1:50,c(0.3,0.2,0,0.4,0.95),
    +   c(0.1,0.3,0.6,0.75,0.95),
    +   c(0.3,0.6,0.5,0.4,0)))
    +  text(0,-0.5,"color.scale")
    +  gradient.rect(-1,-0.85,1,-0.7,col=viridis(50))
    +  text(0,-0.9,"viridis")
    + } # }
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/color.scale.lines-1.png b/reference/color.scale.lines-1.png new file mode 100644 index 0000000..94fcf36 Binary files /dev/null and b/reference/color.scale.lines-1.png differ diff --git a/reference/color.scale.lines.html b/reference/color.scale.lines.html new file mode 100644 index 0000000..701b1a6 --- /dev/null +++ b/reference/color.scale.lines.html @@ -0,0 +1,136 @@ + +Line segments with scaled colors — color.scale.lines • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display line segments with colors scaled to numeric values.

    +
    + +
    +

    Usage

    +
    color.scale.lines(x,y,reds,greens,blues,col=NA,colvar=NA,...)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    Numeric vectors or a list with at least two components, + the first two of which must be named x and y.

    + +
    reds,greens,blues
    +

    Color ranges into which to scale the + numeric values.

    + +
    col
    +

    One or more colors to use for the resultant lines. Will + be recycled if necessary.

    + +
    colvar
    +

    A numeric vector from which to scale the colors.

    + +
    ...
    +

    Additional arguments passed to segments.

    + +
    +
    +

    Details

    +

    color.scale.lines displays line segments that can be individually + colored according to a variety of methods. In order of precedence, if + col is not NA, the color values passed will be used. If + colvar is not NA, the function will call color.scale with + the three color range arguments to determine the line colors. If + colvar is the same length as length(x)-1, exactly enough + colors for the number of lines displayed will be calculated. If shorter, + some colors will be recycled and if longer, some colors will not be used. + Finally, the values in y will be color-scaled if both of the above + arguments are NA. Thus the user can pass predetermined colors, use colors + scaled from an arbitrary vector of numerical values or use the y + values. See color.scale for an explanation of specifying color + ranges.

    +
    +
    +

    Note

    +

    The function is useful for highlighting a numeric dimension or adding + an extra "dimension" to a plot.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     # color a random walk "hot" (red) to "cold" (blue) on its distance
    + # from the starting point
    + x<-c(0,cumsum(rnorm(99)))
    + y<-c(0,cumsum(rnorm(99)))
    + xydist<-sqrt(x*x+y*y)
    + plot(x,y,main="Random walk plot",xlab="X",ylab="Y",type="n")
    + color.scale.lines(x,y,c(1,1,0),0,c(0,1,1),colvar=xydist,lwd=2)
    + boxed.labels(x,y,labels=1:100,border=FALSE,cex=0.5)
    + # now color the lines to show whether each step went away from
    + # or toward the starting position
    + color.scale.lines(x,y,col=2+(diff(xydist)>0))
    + boxed.labels(x,y,labels=1:100,border=FALSE,cex=0.5)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/color.scale.lines.md b/reference/color.scale.lines.md new file mode 100644 index 0000000..ce18295 --- /dev/null +++ b/reference/color.scale.lines.md @@ -0,0 +1,82 @@ +# Line segments with scaled colors + +Display line segments with colors scaled to numeric values. + +## Usage + +``` r +color.scale.lines(x,y,reds,greens,blues,col=NA,colvar=NA,...) +``` + +## Arguments + +- x,y: + + Numeric vectors or a list with at least two components, the first two + of which must be named x and y. + +- reds,greens,blues: + + Color ranges into which to scale the numeric values. + +- col: + + One or more colors to use for the resultant lines. Will be recycled if + necessary. + +- colvar: + + A numeric vector from which to scale the colors. + +- ...: + + Additional arguments passed to `segments`. + +## Details + +`color.scale.lines` displays line segments that can be individually +colored according to a variety of methods. In order of precedence, if +`col` is not NA, the color values passed will be used. If `colvar` is +not NA, the function will call `color.scale` with the three color range +arguments to determine the line colors. If `colvar` is the same length +as `length(x)-1`, exactly enough colors for the number of lines +displayed will be calculated. If shorter, some colors will be recycled +and if longer, some colors will not be used. Finally, the values in `y` +will be color-scaled if both of the above arguments are NA. Thus the +user can pass predetermined colors, use colors scaled from an arbitrary +vector of numerical values or use the `y` values. See `color.scale` for +an explanation of specifying color ranges. + +## Note + +The function is useful for highlighting a numeric dimension or adding an +extra "dimension" to a plot. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[color.scale](color.scale.md) + +## Examples + +``` r + # color a random walk "hot" (red) to "cold" (blue) on its distance + # from the starting point + x<-c(0,cumsum(rnorm(99))) + y<-c(0,cumsum(rnorm(99))) + xydist<-sqrt(x*x+y*y) + plot(x,y,main="Random walk plot",xlab="X",ylab="Y",type="n") + color.scale.lines(x,y,c(1,1,0),0,c(0,1,1),colvar=xydist,lwd=2) + boxed.labels(x,y,labels=1:100,border=FALSE,cex=0.5) + # now color the lines to show whether each step went away from + # or toward the starting position + color.scale.lines(x,y,col=2+(diff(xydist)>0)) + boxed.labels(x,y,labels=1:100,border=FALSE,cex=0.5) +``` diff --git a/reference/color.scale.md b/reference/color.scale.md new file mode 100644 index 0000000..f2191c9 --- /dev/null +++ b/reference/color.scale.md @@ -0,0 +1,164 @@ +# Turn values into colors. + +Transform numeric values into colors using RGB, HSV or HCL + +## Usage + +``` r +color.scale(x,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1),alpha=1, + extremes=NA,na.color=NA,xrange=NULL,color.spec="rgb") +``` + +## Arguments + +- x: + + a numeric vector, matrix or data frame + +- cs1,cs2,cs3: + + color parameters for scaling `x` + +- alpha: + + Value for transparency in colors. If more than one value is passed, + the alpha values will be transformed like the colors. + +- extremes: + + The colors for the extreme values of `x` (RGB only). + +- na.color: + + The color to use for NA values of `x`. + +- xrange: + + An explicit range to use in the transformation. + +- color.spec: + + The color specification to use in the transformation. Anything other + than "rgb", "hsv" or "hcl" will almost certainly fail. + +## Details + +`color.scale` calculates a sequence of colors by a linear transformation +of the numeric values supplied into the ranges for the three color +parameters. If only one number is supplied for a color range, that color +remains constant for all values of `x`. If more than two values are +supplied, the `x` values will be split into equal ranges (one less than +the number of colors) and the transformation carried out on each range. +Values for a color range must be between 0 and 1 for the RGB or HSV +specifications, and between 0 and 360 (cs1) and 0 to 100 (cs2 and cs3) +for the HCL specifications. + +IMPORTANT: If `x` has fewer values than the number of values in the +color parameters, it will usually return incorrect colors. This is +usually only a problem when using `color.legend` with a small number of +rectangles in the legend as `color.legend` calls `color.scale` to +calculate the color rectangles. + +If `extremes` is not NA, the ranges will be calculated from its values +using `col2rgb`, even if ranges are also supplied. `extremes` allows the +user to just pass the extreme color values in any format that `col2rgb` +will accept. Note that this forces the color specification to RGB. + +If the user wants to specify a range of values with `xrange`, it must at +least include the range of x values. This can be useful when there is a +notional range like 0-100% that the values do not cover, or when several +series of values with different ranges are to be assigned the same color +scale. + +The user may not want the color scheme to be continuous across some +critical point, often zero. In this case, `color.scale` can be called +separately for the values below and above zero. I may get around to +adding an argument to do this in one shot. Until then, see the second +example for `color2D.matplot` and also the `diverge.hcl` and +`diverge.hsv` functions in the colorspace package. + +When passing more than one alpha value, it will be transformed like the +colors. This allows matrices with concentrations of high values to be +overplotted to illustrate group locations and separations. See the iris +example in `color2D.matplot`. + +## Note + +The function is useful for highlighting a numeric dimension or adding an +extra "dimension" to a plot. + +There are quite a few R functions that transform numeric values into +colors or produce colors that can be used to represent values. Two +packages that might be of interest are RColorBrewer and colourschemes. +See the last example for approximating other color scales with +`color.scale`. + +## Value + +A vector or matrix of hexadecimal color values. + +## Author + +Jim Lemon + +## See also + +[rescale](rescale.md), +[col2rgb](https://rdrr.io/r/grDevices/col2rgb.html), +[smoothColors](smoothColors.md) + +## Examples + +``` r + # go from green through yellow to red with no blue + x<-rnorm(20) + y<-rnorm(20) + # use y for the color scale + plot(x,y,col=color.scale(y,c(0,1,1),c(1,1,0),0),main="Color scale plot", + pch=16,cex=2) + + plot(1:10,rep(1:3,length.out=10),axes=FALSE,type="n",xlim=c(0,11),ylim=c(0,4), + main="Test of RGB, HSV and HCL",xlab="",ylab="Color specification") + axis(2,at=1:3,labels=c("HCL","HSV","RGB")) + points(1:10,rep(1,10),pch=19,cex=8,col=color.scale(1:10,c(0,300),35,85, + color.spec="hcl")) + points(1:10,rep(2,10),pch=19,cex=8,col=color.scale(1:10,c(0,1), + 0.8,1,color.spec="hsv")) + points(1:10,rep(3,10),pch=19,cex=8,col=color.scale(1:10,c(1,0.5,0), + c(0,0.5,0),c(0,0,1),color.spec="rgb")) + + if (FALSE) { # \dontrun{ + # requires viridisLite + library(viridisLite) + plot(0,xlim=c(-1,1),ylim=c(-1,1),type="n",axes=FALSE, + main="Approximating other color scales",xlab="",ylab="") + gradient.rect(-1,0.8,1,0.95,nslices=50, + col=color.scale(1:50,1, + c(0,0.3,0.6,0.8,1,1), + c(0,0,0,0,0,0,1))) + text(0,1,"color.scale") + gradient.rect(-1,0.65,1,0.8,col=heat.colors(50)) + text(0,0.6,"heat.colors") + gradient.rect(-1,0.3,1,0.45,nslices=50, + col=color.scale(1:50,c(0,0.2,0.9,0.95,0.95), + c(0.7,0.8,0.9,0.7,0.95), + c(0.1,0,0,0.35,0.95))) + text(0,0.5,"color.scale") + gradient.rect(-1,0.15,1,0.3,col=terrain.colors(50)) + text(0,0.1,"terrain.colors") + gradient.rect(-1,-0.2,1,-0.05,nslices=50, + col=color.scale(1:50,c(0.3,0,0.3,0.1,1,0.95,1), + c(0,0.3,0.9,1,1,0.85,0.85), + c(1,1,0.9,0.1,0,0.5,0.5))) + text(0,0,"color.scale") + gradient.rect(-1,-0.35,1,-0.2,col=topo.colors(50)) + text(0,-0.4,"topo.colors") + gradient.rect(-1,-0.7,1,-0.55,nslices=50, + col=color.scale(1:50,c(0.3,0.2,0,0.4,0.95), + c(0.1,0.3,0.6,0.75,0.95), + c(0.3,0.6,0.5,0.4,0))) + text(0,-0.5,"color.scale") + gradient.rect(-1,-0.85,1,-0.7,col=viridis(50)) + text(0,-0.9,"viridis") + } # } +``` diff --git a/reference/color2D.matplot-1.png b/reference/color2D.matplot-1.png new file mode 100644 index 0000000..86747fb Binary files /dev/null and b/reference/color2D.matplot-1.png differ diff --git a/reference/color2D.matplot-2.png b/reference/color2D.matplot-2.png new file mode 100644 index 0000000..65873dd Binary files /dev/null and b/reference/color2D.matplot-2.png differ diff --git a/reference/color2D.matplot-3.png b/reference/color2D.matplot-3.png new file mode 100644 index 0000000..38c777c Binary files /dev/null and b/reference/color2D.matplot-3.png differ diff --git a/reference/color2D.matplot-4.png b/reference/color2D.matplot-4.png new file mode 100644 index 0000000..bc304b0 Binary files /dev/null and b/reference/color2D.matplot-4.png differ diff --git a/reference/color2D.matplot-5.png b/reference/color2D.matplot-5.png new file mode 100644 index 0000000..847e8fb Binary files /dev/null and b/reference/color2D.matplot-5.png differ diff --git a/reference/color2D.matplot-6.png b/reference/color2D.matplot-6.png new file mode 100644 index 0000000..afed2db Binary files /dev/null and b/reference/color2D.matplot-6.png differ diff --git a/reference/color2D.matplot.html b/reference/color2D.matplot.html new file mode 100644 index 0000000..7425283 --- /dev/null +++ b/reference/color2D.matplot.html @@ -0,0 +1,283 @@ + +Display a numeric matrix as color matrix — color2D.matplot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display the values of a numeric 2D matrix or data frame as colored + rectangles or hexagons.

    +
    + +
    +

    Usage

    +
    color2D.matplot(x,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1),
    +  extremes=NA,cellcolors=NA,show.legend=FALSE,nslices=10,xlab="Column",
    +  ylab="Row",do.hex=FALSE,axes=TRUE,show.values=FALSE,vcol=NA,vcex=1,
    +  border="black",na.color=NA,xrange=NULL,color.spec="rgb",yrev=TRUE,
    +  xat=NULL,yat=NULL,Hinton=FALSE,add=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    data values

    + +
    cs1,cs2,cs3
    +

    the color parameters that will be scaled to represent + the range of numeric values. (see color.scale)

    + +
    extremes
    +

    The colors for the extreme values of x. Takes + precedence over the color ranges.

    + +
    cellcolors
    +

    A precalculated matrix of cell colors. This must have + the same number of rows and columns as the matrix or it will be + uninformative. It can be a vector, but be careTakes precedence over both extremes + and color ranges.

    + +
    show.legend
    +

    whether to display a color legend with the + extreme numeric values in the lower left corner of the plot. This will + force the color specification to "rgb", so if this is different from + the color specification requested, call color.legend separately.

    + +
    nslices
    +

    The number of color "slices" in the legend.

    + +
    xlab,ylab
    +

    axis labels for the plot.

    + +
    do.hex
    +

    plot packed hexagons instead of rectangles.

    + +
    axes
    +

    Whether to suppress the default axis labelling.

    + +
    show.values
    +

    Whether to display the numeric values of x. + This also controls the number of decimal places displayed.

    + +
    vcol
    +

    The color for the value display. If NA, the values are displayed + in black or white depending upon the darkness of the cell color.

    + +
    vcex
    +

    The character expansion for the value display.

    + +
    border
    +

    The color(s) for the borders of the cells. Pass NA + if no border is wanted.

    + +
    na.color
    +

    The color to use for NA values of x.

    + +
    xrange
    +

    An explicit range for the transformation of colors. + see color.scale

    + +
    color.spec
    +

    The color specification system to use.

    + +
    yrev
    +

    Whether to reverse the order of the y-axis to display the + cells in "reading" order (left to right and top to bottom) if TRUE, + or in the order of a typical plot (left to right and bottom to top) if + FALSE.

    + +
    xat,yat
    +

    Values at which to place tick marks to override pretty.

    + +
    Hinton
    +

    Whether to display a Hinton diagram in which the magnitude of + cell values is proportional to the size of the squares and the sign is + indicated by the color of the squares.

    + +
    add
    +

    If TRUE, no plot is created and the rectangles are displayed over + whatever is on the current device (see the "iris" example).

    + +
    ...
    +

    arguments passed to plot.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    Displays a plot with the same number of rectangular or hexagonal cells as + there are numeric values in the matrix or data frame. Each rectangle is + colored to represent its corresponding value. The rectangles are arranged + in the conventional display of a 2D matrix with rows beginning at the top + and columns at the left. To get the rows beginning at the bottom, use + yrev=FALSE. The color scale defaults to black for the minimum + value and white for the maximum.

    +

    The user will have to adjust the plot device dimensions to get regular + squares or hexagons, especially when the matrix is not square. As the + margins are not equivalent for all display devices, this is currently + a matter of trial and error. Drawing hexagons is quite slow.

    +

    show.values and show.legend are also used to control the + number of decimal places displayed if the values or legend are shown. + TRUE will give one decimal place, 2 two, and so on.

    +

    if Hinton is TRUE, a Hinton diagram in which the sizes of the + squares are proportional to the absolute value of x and the colors + of the squares indicate the sign of the x values will be displayed. + This only works with squares.

    +

    If add is true, the color matrix is added to the current plot. This + is probably only useful when displaying plots that are mostly transparent.

    +
    +
    +

    Note

    +

    The function image performs almost the same when passed a + matrix of values without grid positions, except that it assigns values to + a specified list of colors rather than calculating a color for each distinct + value.

    +
    +
    +

    Author

    +

    Jim Lemon (thanks to Ashoka Polpitiya for axes)

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     x<-matrix(rnorm(1024),nrow=32)
    + # simulate a correlation matrix with values -0.5 to 0.5
    + x<-rescale(x,c(-0.5,0.5))
    + # add a column with the extreme values (-1,1) to calculate
    + # the colors, then drop the extra column in the result
    + cellcol<-color.scale(cbind(x,c(-1,rep(1,31))),c(0,1),0,c(1,0))[,1:32]
    + color2D.matplot(x,cellcolors=cellcol,main="Blue to red correlations")
    + # do the legend call separately to get the full range
    + color.legend(0,-4,10,-3,legend=c(-1,-0.5,0,0.5,1),
    +  rect.col=color.scale(c(-1,-0.5,0,0.5,1),c(0,1),0,c(1,0)),align="rb")
    +
    + x<-matrix(rnorm(100),nrow=10)
    + # generate colors that show negative values in red to brown
    + # and positive in blue-green to green
    + cellcol<-matrix(rep("#000000",100),nrow=10)
    + cellcol[x<0]<-color.scale(x[x<0],c(1,0.8),c(0,0.8),0)
    + cellcol[x>0]<-color.scale(x[x>0],0,c(0.8,1),c(0.8,0))
    + # now do hexagons without borders
    + color2D.matplot(x,cellcolors=cellcol,xlab="Columns",ylab="Rows",
    +  do.hex=TRUE,main="2D matrix plot (hexagons)",border=NA)
    + # for this one, we have to do the color legend separately
    + # because of the two part color scaling
    + legval<-seq(min(x),max(x),length.out=6)
    + legcol<-rep("#000000",6)
    + legcol[legval<0]<-color.scale(legval[legval<0],c(1,0.8),c(0,0.8),0)
    + legcol[legval>0]<-color.scale(legval[legval>0],0,c(0.8,1),c(0.8,0))
    + color.legend(0,-1.8,3,-1.4,round(c(min(x),0,max(x)),1),rect.col=legcol)
    +
    + # do a color only association plot
    + xt<-table(sample(1:10,100,TRUE),sample(1:10,100,TRUE))
    + observed<-xt[,rev(1:dim(xt)[2])]
    + expected<-outer(rowSums(observed),colSums(observed),"*")/sum(xt)
    + deviates<-(observed-expected)/sqrt(expected)
    + cellcol<-matrix(rep("#000000",100),nrow=10)
    + cellcol[deviates<0]<-
    +  color.scale(deviates[deviates<0],c(1,0.8),c(0,0.5),0)
    + cellcol[deviates>0]<-
    +  color.scale(deviates[deviates>0],0,c(0.7,0.8),c(0.5,0))
    + color2D.matplot(x=round(deviates,2),cellcolors=cellcol,
    +  show.values=TRUE,main="Association plot")
    +
    + # Hinton diagram
    + border.col<-color.scale(x,extremes=2:3)
    + color2D.matplot(x,extremes=c(2,3),main="Hinton diagram (green +, red -)",
    +  Hinton=TRUE,border=border.col)
    +
    + # waffle plot of percentages with two contributing elements
    + waffle.col<-fill.corner(c(rep("red",18),rep("blue",45)),10,10)
    + color2D.matplot(matrix(1:100,nrow=10),cellcolors=waffle.col,yrev=FALSE,
    +  border="lightgray",xlab="",ylab="",main="Waffle plot",axes=FALSE)
    +
    + # coarse density plot of the iris petal data
    + spnames<-unique(iris$Species)
    + spcols<-c("red","green","blue")
    + matmax<-list()
    + cindx<-1
    + for(isp in spnames) {
    +  petal_mat<-makeDensityMatrix(iris[iris$Species == isp,"Petal.Length"],
    +   iris[iris$Species == isp,"Petal.Width"],
    +   nx=20,ny=20,xlim=c(1,7),ylim=c(0,2.5),geocoord=FALSE)
    +  # center the maximum markers in the cells
    +  matmax[[cindx]]<-lapply(find_max_cell(petal_mat),"-",0.5)
    +  if(isp == "setosa")
    +   color2D.matplot(petal_mat,main="Iris petal length by petal width",
    +    xlab="Petal length (cm)",ylab="Petal width (cm)",axes=FALSE,
    +    cellcolors=color.scale(petal_mat,extremes=spcols[cindx],alpha=c(0,1)),
    +    border=NA,yrev=FALSE)
    +  else
    +   color2D.matplot(petal_mat,border=NA,yrev=FALSE,add=TRUE,
    +   cellcolors=color.scale(petal_mat,extremes=spcols[cindx],alpha=c(0,1)))
    +  cindx<-cindx+1
    + }
    +#> Range of density (>0) - 1 20 
    +#> Range of density (>0) - 1 9 
    +#> Range of density (>0) - 1 6 
    + axis(1,at=seq(0,20,by=3.33),labels=1:7)
    + axis(2,at=seq(0,20,length.out=4),labels=seq(1,2.5,by=0.5))
    + legend(1,6,paste0(spnames,"(",1:3,")"),fill=c("red","green","blue"))
    + for(cindx in 1:3)
    +  text(matmax[[cindx]],as.character(cindx),col="white",cex=1.5)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/color2D.matplot.md b/reference/color2D.matplot.md new file mode 100644 index 0000000..624abc0 --- /dev/null +++ b/reference/color2D.matplot.md @@ -0,0 +1,248 @@ +# Display a numeric matrix as color matrix + +Display the values of a numeric 2D matrix or data frame as colored +rectangles or hexagons. + +## Usage + +``` r +color2D.matplot(x,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1), + extremes=NA,cellcolors=NA,show.legend=FALSE,nslices=10,xlab="Column", + ylab="Row",do.hex=FALSE,axes=TRUE,show.values=FALSE,vcol=NA,vcex=1, + border="black",na.color=NA,xrange=NULL,color.spec="rgb",yrev=TRUE, + xat=NULL,yat=NULL,Hinton=FALSE,add=FALSE,...) +``` + +## Arguments + +- x: + + data values + +- cs1,cs2,cs3: + + the color parameters that will be scaled to represent the range of + numeric values. (see `color.scale`) + +- extremes: + + The colors for the extreme values of `x`. Takes precedence over the + color ranges. + +- cellcolors: + + A precalculated matrix of cell colors. This must have the same number + of rows and columns as the matrix or it will be uninformative. It can + be a vector, but be careTakes precedence over both `extremes` and + color ranges. + +- show.legend: + + whether to display a color legend with the extreme numeric values in + the lower left corner of the plot. This will force the color + specification to "rgb", so if this is different from the color + specification requested, call `color.legend` separately. + +- nslices: + + The number of color "slices" in the legend. + +- xlab,ylab: + + axis labels for the plot. + +- do.hex: + + plot packed hexagons instead of rectangles. + +- axes: + + Whether to suppress the default axis labelling. + +- show.values: + + Whether to display the numeric values of `x`. This also controls the + number of decimal places displayed. + +- vcol: + + The color for the value display. If NA, the values are displayed in + black or white depending upon the darkness of the cell color. + +- vcex: + + The character expansion for the value display. + +- border: + + The color(s) for the borders of the cells. Pass NA if no border is + wanted. + +- na.color: + + The color to use for NA values of `x`. + +- xrange: + + An explicit range for the transformation of colors. see `color.scale` + +- color.spec: + + The color specification system to use. + +- yrev: + + Whether to reverse the order of the y-axis to display the cells in + "reading" order (left to right and top to bottom) if TRUE, or in the + order of a typical plot (left to right and bottom to top) if FALSE. + +- xat,yat: + + Values at which to place tick marks to override `pretty`. + +- Hinton: + + Whether to display a Hinton diagram in which the magnitude of cell + values is proportional to the size of the squares and the sign is + indicated by the color of the squares. + +- add: + + If TRUE, no plot is created and the rectangles are displayed over + whatever is on the current device (see the "iris" example). + +- ...: + + arguments passed to `plot`. + +## Value + +nil + +## Details + +Displays a plot with the same number of rectangular or hexagonal cells +as there are numeric values in the matrix or data frame. Each rectangle +is colored to represent its corresponding value. The rectangles are +arranged in the conventional display of a 2D matrix with rows beginning +at the top and columns at the left. To get the rows beginning at the +bottom, use `yrev=FALSE`. The color scale defaults to black for the +minimum value and white for the maximum. + +The user will have to adjust the plot device dimensions to get regular +squares or hexagons, especially when the matrix is not square. As the +margins are not equivalent for all display devices, this is currently a +matter of trial and error. Drawing hexagons is quite slow. + +`show.values` and `show.legend` are also used to control the number of +decimal places displayed if the values or legend are shown. `TRUE` will +give one decimal place, `2` two, and so on. + +if `Hinton` is TRUE, a Hinton diagram in which the sizes of the squares +are proportional to the absolute value of `x` and the colors of the +squares indicate the sign of the `x` values will be displayed. This only +works with squares. + +If `add` is true, the color matrix is added to the current plot. This is +probably only useful when displaying plots that are mostly transparent. + +## Note + +The function [image](https://rdrr.io/r/graphics/image.html) performs +almost the same when passed a matrix of values without grid positions, +except that it assigns values to a specified list of colors rather than +calculating a color for each distinct value. + +## Author + +Jim Lemon (thanks to Ashoka Polpitiya for `axes`) + +## See also + +[color.scale](color.scale.md), [fill.corner](fill.corner.md), +[image](https://rdrr.io/r/graphics/image.html) + +## Examples + +``` r + x<-matrix(rnorm(1024),nrow=32) + # simulate a correlation matrix with values -0.5 to 0.5 + x<-rescale(x,c(-0.5,0.5)) + # add a column with the extreme values (-1,1) to calculate + # the colors, then drop the extra column in the result + cellcol<-color.scale(cbind(x,c(-1,rep(1,31))),c(0,1),0,c(1,0))[,1:32] + color2D.matplot(x,cellcolors=cellcol,main="Blue to red correlations") + # do the legend call separately to get the full range + color.legend(0,-4,10,-3,legend=c(-1,-0.5,0,0.5,1), + rect.col=color.scale(c(-1,-0.5,0,0.5,1),c(0,1),0,c(1,0)),align="rb") + + x<-matrix(rnorm(100),nrow=10) + # generate colors that show negative values in red to brown + # and positive in blue-green to green + cellcol<-matrix(rep("#000000",100),nrow=10) + cellcol[x<0]<-color.scale(x[x<0],c(1,0.8),c(0,0.8),0) + cellcol[x>0]<-color.scale(x[x>0],0,c(0.8,1),c(0.8,0)) + # now do hexagons without borders + color2D.matplot(x,cellcolors=cellcol,xlab="Columns",ylab="Rows", + do.hex=TRUE,main="2D matrix plot (hexagons)",border=NA) + # for this one, we have to do the color legend separately + # because of the two part color scaling + legval<-seq(min(x),max(x),length.out=6) + legcol<-rep("#000000",6) + legcol[legval<0]<-color.scale(legval[legval<0],c(1,0.8),c(0,0.8),0) + legcol[legval>0]<-color.scale(legval[legval>0],0,c(0.8,1),c(0.8,0)) + color.legend(0,-1.8,3,-1.4,round(c(min(x),0,max(x)),1),rect.col=legcol) + + # do a color only association plot + xt<-table(sample(1:10,100,TRUE),sample(1:10,100,TRUE)) + observed<-xt[,rev(1:dim(xt)[2])] + expected<-outer(rowSums(observed),colSums(observed),"*")/sum(xt) + deviates<-(observed-expected)/sqrt(expected) + cellcol<-matrix(rep("#000000",100),nrow=10) + cellcol[deviates<0]<- + color.scale(deviates[deviates<0],c(1,0.8),c(0,0.5),0) + cellcol[deviates>0]<- + color.scale(deviates[deviates>0],0,c(0.7,0.8),c(0.5,0)) + color2D.matplot(x=round(deviates,2),cellcolors=cellcol, + show.values=TRUE,main="Association plot") + + # Hinton diagram + border.col<-color.scale(x,extremes=2:3) + color2D.matplot(x,extremes=c(2,3),main="Hinton diagram (green +, red -)", + Hinton=TRUE,border=border.col) + + # waffle plot of percentages with two contributing elements + waffle.col<-fill.corner(c(rep("red",18),rep("blue",45)),10,10) + color2D.matplot(matrix(1:100,nrow=10),cellcolors=waffle.col,yrev=FALSE, + border="lightgray",xlab="",ylab="",main="Waffle plot",axes=FALSE) + + # coarse density plot of the iris petal data + spnames<-unique(iris$Species) + spcols<-c("red","green","blue") + matmax<-list() + cindx<-1 + for(isp in spnames) { + petal_mat<-makeDensityMatrix(iris[iris$Species == isp,"Petal.Length"], + iris[iris$Species == isp,"Petal.Width"], + nx=20,ny=20,xlim=c(1,7),ylim=c(0,2.5),geocoord=FALSE) + # center the maximum markers in the cells + matmax[[cindx]]<-lapply(find_max_cell(petal_mat),"-",0.5) + if(isp == "setosa") + color2D.matplot(petal_mat,main="Iris petal length by petal width", + xlab="Petal length (cm)",ylab="Petal width (cm)",axes=FALSE, + cellcolors=color.scale(petal_mat,extremes=spcols[cindx],alpha=c(0,1)), + border=NA,yrev=FALSE) + else + color2D.matplot(petal_mat,border=NA,yrev=FALSE,add=TRUE, + cellcolors=color.scale(petal_mat,extremes=spcols[cindx],alpha=c(0,1))) + cindx<-cindx+1 + } +#> Range of density (>0) - 1 20 +#> Range of density (>0) - 1 9 +#> Range of density (>0) - 1 6 + axis(1,at=seq(0,20,by=3.33),labels=1:7) + axis(2,at=seq(0,20,length.out=4),labels=seq(1,2.5,by=0.5)) + legend(1,6,paste0(spnames,"(",1:3,")"),fill=c("red","green","blue")) + for(cindx in 1:3) + text(matmax[[cindx]],as.character(cindx),col="white",cex=1.5) +``` diff --git a/reference/corner.label-1.png b/reference/corner.label-1.png new file mode 100644 index 0000000..ddeb69e Binary files /dev/null and b/reference/corner.label-1.png differ diff --git a/reference/corner.label.html b/reference/corner.label.html new file mode 100644 index 0000000..03b4fc0 --- /dev/null +++ b/reference/corner.label.html @@ -0,0 +1,134 @@ + +Find corner locations and optionally display a label — corner.label • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Finds the coordinates in user parameters of a specified corner of the + figure region and optionally displays a label there

    +
    + +
    +

    Usage

    +
    corner.label(label=NULL,x=-1,y=1,xoff=NA,yoff=NA,figcorner=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    label
    +

    Text to display. The default is to display nothing.

    + +
    x
    +

    an integer value: -1 for the left side of the plot, 1 for the + right side

    + +
    y
    +

    an integer value: -1 for the bottom side of the plot, 1 for + the top side

    + +
    xoff,yoff
    +

    Horizontal and vertical text offsets. Defaults to one + half of the width and height of "m" respectively.

    + +
    figcorner
    +

    Whether to find/display at the corner of the plot or figure.

    + +
    ...
    +

    further arguments to the text command for the label

    + +
    +
    +

    Details

    +

    corner.label finds the specified corner of the plot or figure and if + label is not NULL, displays it there. The text justification is specified + so that the label will be justified away from the corner. To get the label + squeezed right into a corner, set xoff and yoff to zero.

    +
    +
    +

    Value

    +

    A list of the x and y positions of the corner adjusted for the offsets.

    +
    +
    +

    Author

    +

    Ben Bolker

    +
    + +
    +

    Examples

    +
     plot(1:10,1:10)
    + corner.label("A")
    +#> $x
    +#> [1] 0.64
    +#> 
    +#> $y
    +#> [1] 10.36
    +#> 
    + corner.label(x=1,y=1)
    +#> $x
    +#> [1] 10.36
    +#> 
    +#> $y
    +#> [1] 10.36
    +#> 
    + corner.label("B",y=-1,x=1,figcorner=TRUE,col="red")
    +
    +#> $x
    +#> [1] 11.11229
    +#> 
    +#> $y
    +#> [1] -1.414088
    +#> 
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/corner.label.md b/reference/corner.label.md new file mode 100644 index 0000000..5d000c6 --- /dev/null +++ b/reference/corner.label.md @@ -0,0 +1,83 @@ +# Find corner locations and optionally display a label + +Finds the coordinates in user parameters of a specified corner of the +figure region and optionally displays a label there + +## Usage + +``` r +corner.label(label=NULL,x=-1,y=1,xoff=NA,yoff=NA,figcorner=FALSE,...) +``` + +## Arguments + +- label: + + Text to display. The default is to display nothing. + +- x: + + an integer value: -1 for the left side of the plot, 1 for the right + side + +- y: + + an integer value: -1 for the bottom side of the plot, 1 for the top + side + +- xoff,yoff: + + Horizontal and vertical text offsets. Defaults to one half of the + width and height of "m" respectively. + +- figcorner: + + Whether to find/display at the corner of the plot or figure. + +- ...: + + further arguments to the `text` command for the label + +## Details + +`corner.label` finds the specified corner of the plot or figure and if +`label` is not NULL, displays it there. The text justification is +specified so that the label will be justified away from the corner. To +get the label squeezed right into a corner, set `xoff` and `yoff` to +zero. + +## Value + +A list of the x and y positions of the corner adjusted for the offsets. + +## Author + +Ben Bolker + +## Examples + +``` r + plot(1:10,1:10) + corner.label("A") +#> $x +#> [1] 0.64 +#> +#> $y +#> [1] 10.36 +#> + corner.label(x=1,y=1) +#> $x +#> [1] 10.36 +#> +#> $y +#> [1] 10.36 +#> + corner.label("B",y=-1,x=1,figcorner=TRUE,col="red") + +#> $x +#> [1] 11.11229 +#> +#> $y +#> [1] -1.414088 +#> +``` diff --git a/reference/count.overplot.html b/reference/count.overplot.html new file mode 100644 index 0000000..bf3d0f6 --- /dev/null +++ b/reference/count.overplot.html @@ -0,0 +1,117 @@ + +Show overlying points as counts — count.overplot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    count.overplot checks for overlying points defined as points + separated by a maximum of tol, a two element numeric vector of + the x and y tolerance. Defaults to 1/2 of the width of a lower case + "o" in the x direction and 1/2 of the height of a lower case "o" in + the y direction.

    +
    + +
    +

    Usage

    +
    count.overplot(x,y,tol=NULL,col=par("fg"),pch="1",...)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    Two numeric data vectors or the first two columns of a matrix + or data frame. Typically the x/y coordinates of points to be plotted.

    + +
    tol
    +

    The largest distance between points that will be considered + to be overlying.

    + +
    col
    +

    Color(s) for the points (not the numbers).

    + +
    pch
    +

    Symbol(s) to display.

    + +
    ...
    +

    additional arguments passed to plot.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     xy.mat<-cbind(sample(1:10,200,TRUE),sample(1:10,200,TRUE))
    + count.overplot(xy.mat,main="count.overplot",
    +  xlab="X values",ylab="Y values")
    +#> Error in strwidth("o"): plot.new has not been called yet
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/count.overplot.md b/reference/count.overplot.md new file mode 100644 index 0000000..707310e --- /dev/null +++ b/reference/count.overplot.md @@ -0,0 +1,57 @@ +# Show overlying points as counts + +`count.overplot` checks for overlying points defined as points separated +by a maximum of `tol`, a two element numeric vector of the x and y +tolerance. Defaults to 1/2 of the width of a lower case "o" in the x +direction and 1/2 of the height of a lower case "o" in the y direction. + +## Usage + +``` r +count.overplot(x,y,tol=NULL,col=par("fg"),pch="1",...) +``` + +## Arguments + +- x,y: + + Two numeric data vectors or the first two columns of a matrix or data + frame. Typically the x/y coordinates of points to be plotted. + +- tol: + + The largest distance between points that will be considered to be + overlying. + +- col: + + Color(s) for the points (not the numbers). + +- pch: + + Symbol(s) to display. + +- ...: + + additional arguments passed to `plot`. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[cluster.overplot](cluster.overplot.md),[sizeplot](sizeplot.md) + +## Examples + +``` r + xy.mat<-cbind(sample(1:10,200,TRUE),sample(1:10,200,TRUE)) + count.overplot(xy.mat,main="count.overplot", + xlab="X values",ylab="Y values") +#> Error in strwidth("o"): plot.new has not been called yet +``` diff --git a/reference/cylindrect-1.png b/reference/cylindrect-1.png new file mode 100644 index 0000000..9d6a4ce Binary files /dev/null and b/reference/cylindrect-1.png differ diff --git a/reference/cylindrect.html b/reference/cylindrect.html new file mode 100644 index 0000000..f727881 --- /dev/null +++ b/reference/cylindrect.html @@ -0,0 +1,125 @@ + +Display an apparent cylinder — cylindrect • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display rectangles shaded to appear like cylinders.

    +
    + +
    +

    Usage

    +
    cylindrect(xleft,ybottom,xright,ytop,col,border=NA,gradient="x",nslices=50)
    +
    + +
    +

    Arguments

    +

    +
    xleft
    +

    The position of the left side of the rectangle(s).

    + +
    ybottom
    +

    The position of the bottom of the rectangle(s).

    + +
    xright
    +

    The position of the right side of the rectangle(s).

    + +
    ytop
    +

    The position of the top side of the rectangle(s).

    + +
    col
    +

    The base color(s) of the rectangles.

    + +
    border
    +

    Whether to draw a border and what color.

    + +
    gradient
    +

    Whether to vary the shading horizontally ("x" - the default) + or vertically (anything but "x").

    + +
    nslices
    +

    The number of "slices" of color for shading.

    + +
    +
    +

    Value

    +

    The base color(s) of the rectangle(s).

    +
    +
    +

    Details

    +

    cylindrect displays a rectangle filled with "slices" of color that + simulate the appearance of a cylinder. The slices are calculated so that the + base color appears at the right or bottom edge of the rectangle, becomes + progressively lighter to a "highlight" at two thirds of the width or height + and then darkens toward the base color again.

    +

    The appearance is of a cylinder lit from above and to the left of the viewer. + The position of the apparent light source is hard coded into the function.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     plot(0,xlim=c(0,5),ylim=c(0,5),main="Examples of pseudocylindrical rectangles",
    +  xlab="",ylab="",axes=FALSE,type="n")
    + cylindrect(0,0,1,5,"red")
    + cylindrect(rep(1,3),c(0,2,4),rep(4,3),c(1,3,5),"green",gradient="y")
    + cylindrect(4,0,5,5,"#8844aa")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/cylindrect.md b/reference/cylindrect.md new file mode 100644 index 0000000..e0904f2 --- /dev/null +++ b/reference/cylindrect.md @@ -0,0 +1,78 @@ +# Display an apparent cylinder + +Display rectangles shaded to appear like cylinders. + +## Usage + +``` r +cylindrect(xleft,ybottom,xright,ytop,col,border=NA,gradient="x",nslices=50) +``` + +## Arguments + +- xleft: + + The position of the left side of the rectangle(s). + +- ybottom: + + The position of the bottom of the rectangle(s). + +- xright: + + The position of the right side of the rectangle(s). + +- ytop: + + The position of the top side of the rectangle(s). + +- col: + + The base color(s) of the rectangles. + +- border: + + Whether to draw a border and what color. + +- gradient: + + Whether to vary the shading horizontally ("x" - the default) or + vertically (anything but "x"). + +- nslices: + + The number of "slices" of color for shading. + +## Value + +The base color(s) of the rectangle(s). + +## Details + +`cylindrect` displays a rectangle filled with "slices" of color that +simulate the appearance of a cylinder. The slices are calculated so that +the base color appears at the right or bottom edge of the rectangle, +becomes progressively lighter to a "highlight" at two thirds of the +width or height and then darkens toward the base color again. + +The appearance is of a cylinder lit from above and to the left of the +viewer. The position of the apparent light source is hard coded into the +function. + +## Author + +Jim Lemon + +## See also + +[gradient.rect](gradient.rect.md) + +## Examples + +``` r + plot(0,xlim=c(0,5),ylim=c(0,5),main="Examples of pseudocylindrical rectangles", + xlab="",ylab="",axes=FALSE,type="n") + cylindrect(0,0,1,5,"red") + cylindrect(rep(1,3),c(0,2,4),rep(4,3),c(1,3,5),"green",gradient="y") + cylindrect(4,0,5,5,"#8844aa") +``` diff --git a/reference/death_reg.html b/reference/death_reg.html new file mode 100644 index 0000000..fc59020 --- /dev/null +++ b/reference/death_reg.html @@ -0,0 +1,66 @@ + +Death registrations from 1996 to 2010 — death_reg • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Death registrations for underlying cause of death as ICD-10 chapters for 1996 + to 2010.

    +
    + +
    +

    Usage

    +
    data(death_reg)
    +
    + + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/death_reg.md b/reference/death_reg.md new file mode 100644 index 0000000..d2dcf51 --- /dev/null +++ b/reference/death_reg.md @@ -0,0 +1,10 @@ +# Death registrations from 1996 to 2010 + +Death registrations for underlying cause of death as ICD-10 chapters for +1996 to 2010. + +## Usage + +``` r +data(death_reg) +``` diff --git a/reference/dendroPlot-1.png b/reference/dendroPlot-1.png new file mode 100644 index 0000000..db99813 Binary files /dev/null and b/reference/dendroPlot-1.png differ diff --git a/reference/dendroPlot-2.png b/reference/dendroPlot-2.png new file mode 100644 index 0000000..e8393bf Binary files /dev/null and b/reference/dendroPlot-2.png differ diff --git a/reference/dendroPlot.html b/reference/dendroPlot.html new file mode 100644 index 0000000..f32cc69 --- /dev/null +++ b/reference/dendroPlot.html @@ -0,0 +1,154 @@ + +Display distributions as dendrites — dendroPlot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display the distributions of one or more sets of points as branching + (dendritic) clusters.

    +
    + +
    +

    Usage

    +
    dendroPlot(x,breaks=list(10,10,10),pch=1,col=par("fg"),cex=1,nudge=NA,
    +  setlabels=NA,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A list or data frame of numeric or factor or character + columns.

    + +
    breaks
    +

    A list of cutpoints to transform numeric values into factors + (see cut). Must be at least one number >= 2.

    + +
    pch
    +

    Symbol(s) to use in plotting the values.

    + +
    col
    +

    Color(s) for the symbols.

    + +
    cex
    +

    Size of the symbol(s) to use in plotting.

    + +
    nudge
    +

    The amount to set each consecutive value in a category away from + the center of the dendrite.

    + +
    setlabels
    +

    Labels to place along the abcissa to identify the sets.

    + +
    ...
    +

    Other arguments passed to plot.

    + +
    +
    +

    Details

    +

    dendroPlot displays the distributions of categorical values as stacks + of "branches". The lengths of the branches show the number of values in each + category, rather like the opposed bars in a pyramid plot, except that there + is no separation of groups. The distribution of numeric values can also be + displayed by passing a set of breakpoints to categorize the values. The + breakpoints will usually be equidistant, but unevenly spaced breakpoints can + be passed. If an element of x is numeric, the values of the + corresponding x element will be used to place the points, but the + branches will be defined as the categories formed by applying the breaks to + those numeric values.

    +

    Note that in the first example, the breakpoints for the first and third elements + are used to define the ten branches for each. The second element of x + is already categorical, so the breakpoints are ignored. When comparing + distributions with very different ranges it may be necessary to adjust the + breakpoints to get a satisfactory result.

    +

    Each successive point in a category is nudged away from the center + of the dendrite. If nudge has more than one value, the points will be + nudged up and down for categorical variables to enable closer packing. The + second value of nudge is ignored for numeric variables. The aspect + ratio of the plot, the character expansion and the nudging will have to be + adjusted to give the best point spacing for most dendroPlots.

    +
    +
    +

    Note

    +

    The ehplot function is a much more versatile instantiation of this + type of plot. dendroPlot has been retained as there are currently a few + differences that some users may find valuable. However, it is not impossible + that dendroPlot will disappear in the future. Another very useful version + of this type of plot is beeswarm in the beeswarm package.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     x<-list(runif(90,1,3),factor(sample(LETTERS[1:10],100,TRUE)),rnorm(80,mean=5))
    + dendroPlot(x,xlab="Groups",ylab="Value of x",main="Test dendroPlot I")
    +
    + # now apply a nudge factor and different breaks
    + dendroPlot(x,breaks=list(8,10,10),nudge=c(0.05,0.1),
    +  xlab="Groups",ylab="Value of x",main="Test dendroPlot II")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/dendroPlot.md b/reference/dendroPlot.md new file mode 100644 index 0000000..71c89d0 --- /dev/null +++ b/reference/dendroPlot.md @@ -0,0 +1,106 @@ +# Display distributions as dendrites + +Display the distributions of one or more sets of points as branching +(dendritic) clusters. + +## Usage + +``` r +dendroPlot(x,breaks=list(10,10,10),pch=1,col=par("fg"),cex=1,nudge=NA, + setlabels=NA,...) +``` + +## Arguments + +- x: + + A list or data frame of numeric or factor or character columns. + +- breaks: + + A list of cutpoints to transform numeric values into factors (see + [cut](https://rdrr.io/r/base/cut.html)). Must be at least one number + \>= 2. + +- pch: + + Symbol(s) to use in plotting the values. + +- col: + + Color(s) for the symbols. + +- cex: + + Size of the symbol(s) to use in plotting. + +- nudge: + + The amount to set each consecutive value in a category away from the + center of the dendrite. + +- setlabels: + + Labels to place along the abcissa to identify the sets. + +- ...: + + Other arguments passed to plot. + +## Details + +`dendroPlot` displays the distributions of categorical values as stacks +of "branches". The lengths of the branches show the number of values in +each category, rather like the opposed bars in a pyramid plot, except +that there is no separation of groups. The distribution of numeric +values can also be displayed by passing a set of breakpoints to +categorize the values. The breakpoints will usually be equidistant, but +unevenly spaced breakpoints can be passed. If an element of `x` is +numeric, the values of the corresponding `x` element will be used to +place the points, but the branches will be defined as the categories +formed by applying the breaks to those numeric values. + +Note that in the first example, the breakpoints for the first and third +elements are used to define the ten branches for each. The second +element of `x` is already categorical, so the breakpoints are ignored. +When comparing distributions with very different ranges it may be +necessary to adjust the breakpoints to get a satisfactory result. + +Each successive point in a category is `nudge`d away from the center of +the dendrite. If `nudge` has more than one value, the points will be +nudged up and down for categorical variables to enable closer packing. +The second value of `nudge` is ignored for numeric variables. The aspect +ratio of the plot, the character expansion and the nudging will have to +be adjusted to give the best point spacing for most dendroPlots. + +## Note + +The `ehplot` function is a much more versatile instantiation of this +type of plot. `dendroPlot` has been retained as there are currently a +few differences that some users may find valuable. However, it is not +impossible that `dendroPlot` will disappear in the future. Another very +useful version of this type of plot is `beeswarm` in the beeswarm +package. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[ehplot](ehplot.md) + +## Examples + +``` r + x<-list(runif(90,1,3),factor(sample(LETTERS[1:10],100,TRUE)),rnorm(80,mean=5)) + dendroPlot(x,xlab="Groups",ylab="Value of x",main="Test dendroPlot I") + + # now apply a nudge factor and different breaks + dendroPlot(x,breaks=list(8,10,10),nudge=c(0.05,0.1), + xlab="Groups",ylab="Value of x",main="Test dendroPlot II") +``` diff --git a/reference/densityGrid.html b/reference/densityGrid.html new file mode 100644 index 0000000..a83c419 --- /dev/null +++ b/reference/densityGrid.html @@ -0,0 +1,185 @@ + +Display a matrix of cell values as symbols. — densityGrid • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a matrix of values as symbols on an existing image.

    +
    + +
    +

    Usage

    +
    densityGrid(x,z=NULL,xrange=NA,zrange=NA,range.cex=c(1,10),
    + xlim=c(-180,180),ylim=c(-90,90),red=c(0,1),green=c(0,1),blue=c(0,1),alpha=1,
    + pch=".",geocoord=TRUE)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    Matrix of values representing counts in cells (usually locations).

    + +
    z
    +

    Optional matrix of values attached to the cells in x.

    + +
    xrange,zrange
    +

    Explicit ranges for the counts in x and z. Used to + define a "pretty" set of values to label legends.

    + +
    range.cex
    +

    The range of expansion for the symbols when this is used to + indicate the number of counts in the cells.

    + +
    xlim
    +

    The extreme coordinates in the horizontal direction (see Details).

    + +
    ylim
    +

    The extreme coordinates in the vertical direction (see Details).

    + +
    red,green,blue
    +

    Values in an RGB colorspace to use in transforming the + cell values into colors.

    + +
    alpha
    +

    Transparency of the colors.

    + +
    pch
    +

    The symbol to use in displaying the observation density. Either + "." or 15 seem to work well depending upon the resolution of the grid.

    + +
    geocoord
    +

    Whether the size of the symbols that indicate density when + there are intensity values should be corrected for a Mercator projection.

    + +
    +
    +

    Details

    +

    densityGrid expects one matrix or a list of two matrices containing + values that will be transformed into colors or sizes of the symbols displayed. + The two matrices may be passed as a list. If only one matrix is present, the + color of the symbols is determined by the values (counts) in the matrix. If + a second matrix is passed, The values in that matrix will be used to determine + the colors, and the size of the symbols will be proportional to the values in + the first matrix. In the case of only one matrix, the user should set the + first value of range.cex to the desired expansion of the symbols.

    +

    Currently densityGrid does not display anything in grid cells that have + zero count values.

    +

    densityGrid was developed to allow very large numbers of coordinate + locations to be accumulated in a matrix for display on a geographic map. Thus + the default limits refer to coordinates as latitude/longitude for the earth. + Because some geographic data are so numerous that memory limits are exceeded, + the underlying makeDensityMatrix function can be run on small sections + of the entire data set and the resulting matrices added as long as the initial + coordinate limits are used throughout. Note that if the values for counts + (with one matrix) or for intensity (with two matrices) cover a very large + range, it may be necessary to trim extreme values (noting this on any legends) + and transform the data (usually log10) to get good color separation.

    +
    +
    +

    Value

    +

    nil. Displays a grid of symbols on an existing plot device.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + + +
    +

    Examples

    +
     if (FALSE) { # \dontrun{
    +  data(l2010)
    +  # log10 transform both density and intensity
    +  l2010[[1]]<-log10(l2010[[1]])
    +  l2010[[2]]<-log10(l2010[[2]])
    +  library(maps)
    +  x11(width=10)
    +  par(mar=c(7,3,2,3))
    +  plot(0,xlim=c(-180,180),ylim=c(-90,90),type="n",axes=FALSE,xlab="",ylab="")
    +  densityGrid(l2010,pch=".",xrange=c(0,6),zrange=c(2,8),range.cex=c(2,8),
    +   red=c(0,0.5,1),green=c(0,1,0),blue=c(1,0,0),alpha=1)
    +  color.legend(-60,-107,60,-97,c("2","3","4","5","6","7","8"),
    +   rect.col=color.scale(1:7,cs1=c(0,0.5,1),cs2=c(0,1,0),cs3=c(1,0,0),alpha=1),
    +   cex=0.5)
    +  par(xpd=TRUE)
    +  text(0,95,"Lightning strikes 2010")
    +  text(0,-114,"Mean intensity kVA (10^n)",cex=0.5)
    +  points(x=seq(-60,60,20),y=rep(-125,7),pch=".",cex=1:7)
    +  text(x=seq(-60,60,20),y=rep(-132,7),c("<=1","2","3","4","5","6",">6"),cex=0.5)
    +  text(0,-142,"Cell frequency (10^n)",cex=0.5)
    +  par(xpd=FALSE)
    +  map("world",mar=c(7,3,2,3),add=TRUE)
    +  dev.off()
    +  # now only Australia
    +  par(mar=c(7,3,2,3))
    +  plot(0,xlim=c(112,154),ylim=c(-43.8,-11.1),type="n",axes=FALSE,xlab="",ylab="")
    +  densityGrid(l2010,pch=".",xrange=c(0,6),zrange=c(2,8),range.cex=c(2,8),
    +   xlim=c(112,154),ylim=c(-43.8,-11.1),red=c(0,0.5,1),green=c(0,1,0),
    +   blue=c(1,0,0),alpha=1)
    +  color.legend(120,-47,146,-45,c("2","3","4","5","6","7","8"),
    +   rect.col=color.scale(1:7,cs1=c(0,0.5,1),cs2=c(0,1,0),cs3=c(1,0,0),alpha=1),
    +   cex=0.5)
    +  par(xpd=TRUE)
    +  text(133,-9,"Lightning strikes 2010 (Australia)")
    +  text(133,-48.2,"Mean intensity kVA (10^n)",cex=0.5)
    +  points(x=seq(121,145,4),y=rep(-50,7),pch=".",cex=1:7)
    +  text(x=seq(121,145,4),y=rep(-51,7),c("<=1","2","3","4","5","6",">6"),cex=0.5)
    +  text(133,-52,"Cell frequency (10^n)",cex=0.5)
    +  par(xpd=FALSE)
    +  map("world",mar=c(7,3,2,3),xlim=c(112,154),ylim=c(-43.8,-11.1),add=TRUE)
    + } # }
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/densityGrid.md b/reference/densityGrid.md new file mode 100644 index 0000000..bcac07e --- /dev/null +++ b/reference/densityGrid.md @@ -0,0 +1,143 @@ +# Display a matrix of cell values as symbols. + +Displays a matrix of values as symbols on an existing image. + +## Usage + +``` r +densityGrid(x,z=NULL,xrange=NA,zrange=NA,range.cex=c(1,10), + xlim=c(-180,180),ylim=c(-90,90),red=c(0,1),green=c(0,1),blue=c(0,1),alpha=1, + pch=".",geocoord=TRUE) +``` + +## Arguments + +- x: + + Matrix of values representing counts in cells (usually locations). + +- z: + + Optional matrix of values attached to the cells in x. + +- xrange,zrange: + + Explicit ranges for the counts in x and z. Used to define a "pretty" + set of values to label legends. + +- range.cex: + + The range of expansion for the symbols when this is used to indicate + the number of counts in the cells. + +- xlim: + + The extreme coordinates in the horizontal direction (see Details). + +- ylim: + + The extreme coordinates in the vertical direction (see Details). + +- red,green,blue: + + Values in an RGB colorspace to use in transforming the cell values + into colors. + +- alpha: + + Transparency of the colors. + +- pch: + + The symbol to use in displaying the observation density. Either "." or + 15 seem to work well depending upon the resolution of the grid. + +- geocoord: + + Whether the size of the symbols that indicate density when there are + intensity values should be corrected for a Mercator projection. + +## Details + +`densityGrid` expects one matrix or a list of two matrices containing +values that will be transformed into colors or sizes of the symbols +displayed. The two matrices may be passed as a list. If only one matrix +is present, the color of the symbols is determined by the values +(counts) in the matrix. If a second matrix is passed, The values in that +matrix will be used to determine the colors, and the size of the symbols +will be proportional to the values in the first matrix. In the case of +only one matrix, the user should set the first value of `range.cex` to +the desired expansion of the symbols. + +Currently `densityGrid` does not display anything in grid cells that +have zero count values. + +`densityGrid` was developed to allow very large numbers of coordinate +locations to be accumulated in a matrix for display on a geographic map. +Thus the default limits refer to coordinates as latitude/longitude for +the earth. Because some geographic data are so numerous that memory +limits are exceeded, the underlying `makeDensityMatrix` function can be +run on small sections of the entire data set and the resulting matrices +added as long as the initial coordinate limits are used throughout. Note +that if the values for counts (with one matrix) or for intensity (with +two matrices) cover a very large range, it may be necessary to trim +extreme values (noting this on any legends) and transform the data +(usually log10) to get good color separation. + +## Value + +nil. Displays a grid of symbols on an existing plot device. + +## Author + +Jim Lemon + +## See also + +[makeDensityMatrix](makeDensityMatrix.md),[color.scale](color.scale.md) + +## Examples + +``` r + if (FALSE) { # \dontrun{ + data(l2010) + # log10 transform both density and intensity + l2010[[1]]<-log10(l2010[[1]]) + l2010[[2]]<-log10(l2010[[2]]) + library(maps) + x11(width=10) + par(mar=c(7,3,2,3)) + plot(0,xlim=c(-180,180),ylim=c(-90,90),type="n",axes=FALSE,xlab="",ylab="") + densityGrid(l2010,pch=".",xrange=c(0,6),zrange=c(2,8),range.cex=c(2,8), + red=c(0,0.5,1),green=c(0,1,0),blue=c(1,0,0),alpha=1) + color.legend(-60,-107,60,-97,c("2","3","4","5","6","7","8"), + rect.col=color.scale(1:7,cs1=c(0,0.5,1),cs2=c(0,1,0),cs3=c(1,0,0),alpha=1), + cex=0.5) + par(xpd=TRUE) + text(0,95,"Lightning strikes 2010") + text(0,-114,"Mean intensity kVA (10^n)",cex=0.5) + points(x=seq(-60,60,20),y=rep(-125,7),pch=".",cex=1:7) + text(x=seq(-60,60,20),y=rep(-132,7),c("<=1","2","3","4","5","6",">6"),cex=0.5) + text(0,-142,"Cell frequency (10^n)",cex=0.5) + par(xpd=FALSE) + map("world",mar=c(7,3,2,3),add=TRUE) + dev.off() + # now only Australia + par(mar=c(7,3,2,3)) + plot(0,xlim=c(112,154),ylim=c(-43.8,-11.1),type="n",axes=FALSE,xlab="",ylab="") + densityGrid(l2010,pch=".",xrange=c(0,6),zrange=c(2,8),range.cex=c(2,8), + xlim=c(112,154),ylim=c(-43.8,-11.1),red=c(0,0.5,1),green=c(0,1,0), + blue=c(1,0,0),alpha=1) + color.legend(120,-47,146,-45,c("2","3","4","5","6","7","8"), + rect.col=color.scale(1:7,cs1=c(0,0.5,1),cs2=c(0,1,0),cs3=c(1,0,0),alpha=1), + cex=0.5) + par(xpd=TRUE) + text(133,-9,"Lightning strikes 2010 (Australia)") + text(133,-48.2,"Mean intensity kVA (10^n)",cex=0.5) + points(x=seq(121,145,4),y=rep(-50,7),pch=".",cex=1:7) + text(x=seq(121,145,4),y=rep(-51,7),c("<=1","2","3","4","5","6",">6"),cex=0.5) + text(133,-52,"Cell frequency (10^n)",cex=0.5) + par(xpd=FALSE) + map("world",mar=c(7,3,2,3),xlim=c(112,154),ylim=c(-43.8,-11.1),add=TRUE) + } # } +``` diff --git a/reference/diamondplot-1.png b/reference/diamondplot-1.png new file mode 100644 index 0000000..445df4f Binary files /dev/null and b/reference/diamondplot-1.png differ diff --git a/reference/diamondplot.html b/reference/diamondplot.html new file mode 100644 index 0000000..114fd3e --- /dev/null +++ b/reference/diamondplot.html @@ -0,0 +1,110 @@ + +Plot multiple variables as polygons on a radial grid — diamondplot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    diamondplot displays a plot of polygons on a radial grid representing + the relationships between one or more attributes of data objects. For a slightly + different style of plot, see the "spiderweb plot" example in radial.plot.

    +
    + +
    +

    Usage

    +
    diamondplot(x, bg=gray(0.6), col=rainbow,name="", ...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A data frame containing numeric values that represent attributes + (possibly repeated observations) of data objects. See the example.

    + +
    bg
    +

    The background color for the plot.

    + +
    col
    +

    The colors for the polygons.

    + +
    name
    +

    The title for the plot (i.e. main).

    + +
    ...
    +

    additional arguments passed to plot.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Elisa Biancotto

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     data(mtcars)
    + mysubset<-mtcars[substr(dimnames(mtcars)[[1]],1,1)=="M",c("mpg","hp","wt","disp")]
    + diamondplot(mysubset)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/diamondplot.md b/reference/diamondplot.md new file mode 100644 index 0000000..9cf0f7e --- /dev/null +++ b/reference/diamondplot.md @@ -0,0 +1,56 @@ +# Plot multiple variables as polygons on a radial grid + +`diamondplot` displays a plot of polygons on a radial grid representing +the relationships between one or more attributes of data objects. For a +slightly different style of plot, see the "spiderweb plot" example in +`radial.plot`. + +## Usage + +``` r +diamondplot(x, bg=gray(0.6), col=rainbow,name="", ...) +``` + +## Arguments + +- x: + + A data frame containing numeric values that represent attributes + (possibly repeated observations) of data objects. See the example. + +- bg: + + The background color for the plot. + +- col: + + The colors for the polygons. + +- name: + + The title for the plot (i.e. `main`). + +- ...: + + additional arguments passed to `plot`. + +## Value + +nil + +## Author + +Elisa Biancotto + +## See also + +[plot](https://rdrr.io/r/graphics/plot.default.html), +[radial.plot](radial.plot.md) + +## Examples + +``` r + data(mtcars) + mysubset<-mtcars[substr(dimnames(mtcars)[[1]],1,1)=="M",c("mpg","hp","wt","disp")] + diamondplot(mysubset) +``` diff --git a/reference/dispersion-1.png b/reference/dispersion-1.png new file mode 100644 index 0000000..ae1189d Binary files /dev/null and b/reference/dispersion-1.png differ diff --git a/reference/dispersion-2.png b/reference/dispersion-2.png new file mode 100644 index 0000000..bad0b43 Binary files /dev/null and b/reference/dispersion-2.png differ diff --git a/reference/dispersion-3.png b/reference/dispersion-3.png new file mode 100644 index 0000000..0fdc154 Binary files /dev/null and b/reference/dispersion-3.png differ diff --git a/reference/dispersion.html b/reference/dispersion.html new file mode 100644 index 0000000..b005d4c --- /dev/null +++ b/reference/dispersion.html @@ -0,0 +1,179 @@ + +Display a measure of dispersion. — dispersion • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display lines or capped bars at specified points on a plot representing + measures of dispersion.

    +
    + +
    +

    Usage

    +
    dispersion(x,y,ulim,llim=ulim,intervals=TRUE,arrow.cap=0.01,arrow.gap=NA,
    +  type="a",fill=NA,lty=NA,pch=NA,border=NA,col=par("fg"),display.na=TRUE,
    +  ...)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    x and y position of the centers of the bars

    + +
    ulim,llim
    +

    The extent of the dispersion measures.

    + +
    arrow.cap
    +

    The width of the cap at the outer end of each bar + as a proportion of the width of the plot.

    + +
    arrow.gap
    +

    The gap to leave at the inner end of each bar. + Defaults to two thirds of the height of a capital "O".

    + +
    intervals
    +

    Whether the limits are intervals (TRUE) or absolute values + (FALSE).

    + +
    type
    +

    What type of display to use.

    + +
    fill
    +

    Color to fill between the lines if type is not NULL and + fill is not NA.

    + +
    lty
    +

    Line type for redrawing the lines if necessary.

    + +
    pch
    +

    Symbol for redrawing the points if necessary.

    + +
    border
    +

    Line type for drawing a border on the confidence band.

    + +
    col
    +

    Color for the lines or capped bars.

    + +
    display.na
    +

    Whether to display NA values as lines going off the plot.

    + +
    ...
    +

    additional arguments passed to arrows or lines + depending upon type.

    + +
    +
    +

    Details

    +

    dispersion displays a measure of dispersion on an existing plot. + Currently it will display either vertical lines with caps (error bars) or lines + that form a "confidence band" around a line of central tendency. If fill + is not NA and type is "l", a polygon will be drawn between the + confidence lines. Remember that any points or lines within the confidence band + will be obscured, so pass point and/or line types as in the second example.

    +

    The default behavior is to display an undefined dispersion (e.g. a variance with + only one observation) as a line going off the plot. If display.na is FALSE, + NA values will not be displayed, allowing the user to show only upper or lower + dispersion limits.

    +

    The intervals argument allows the user to pass the limits as either + intervals (the default) or absolute values.

    +

    If arrow.gap is greater than or equal to the upper or lower + limit for a bar, segments is used to draw the upper and + lower caps with no bars to avoid zero length arrows.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     disptest<-matrix(rnorm(200),nrow=20)
    + disptest.means<-rowMeans(disptest)
    + row.order<-order(disptest.means)
    + se.disptest<-unlist(apply(disptest,1,std.error))
    + plot(disptest.means[row.order],main="Dispersion as error bars",
    +  ylim=c(min(disptest.means-se.disptest),max(disptest.means+se.disptest)),
    +  xlab="Occasion",ylab="Value")
    + dispersion(1:20,disptest.means[row.order],se.disptest[row.order])
    +
    + plot(disptest.means[row.order],main="Dispersion as confidence band",
    +  ylim=c(min(disptest.means-se.disptest),max(disptest.means+se.disptest)),
    +  xlab="Occasion",ylab="Value")
    + dispersion(1:20,disptest.means[row.order],se.disptest[row.order],type="l",
    +  fill="#eeccee",lty=2,pch=1)
    +
    + disptest2<-matrix(sample(c(TRUE,FALSE),200,TRUE),nrow=10)
    + disptest.prop<-rowMeans(disptest2)
    + disptest.ulim<-disptest.llim<-rep(NA,10)
    + for(i in 1:10) {
    +  disptest.ulim[i]<-binciWu(disptest2[i,],20)
    +  disptest.llim[i]<-binciWl(disptest2[i,],20)
    + }
    + plot(disptest.prop,main="Dispersion as binomial confidence intervals",
    +  ylim=c(min(disptest.llim),max(disptest.ulim)),
    +  xlab="Sample",ylab="Proportion")
    + dispersion(1:10,disptest.prop,disptest.ulim,disptest.llim,
    +  interval=FALSE,lty=2,pch=1)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/dispersion.md b/reference/dispersion.md new file mode 100644 index 0000000..c3d8b82 --- /dev/null +++ b/reference/dispersion.md @@ -0,0 +1,137 @@ +# Display a measure of dispersion. + +Display lines or capped bars at specified points on a plot representing +measures of dispersion. + +## Usage + +``` r +dispersion(x,y,ulim,llim=ulim,intervals=TRUE,arrow.cap=0.01,arrow.gap=NA, + type="a",fill=NA,lty=NA,pch=NA,border=NA,col=par("fg"),display.na=TRUE, + ...) +``` + +## Arguments + +- x,y: + + x and y position of the centers of the bars + +- ulim,llim: + + The extent of the dispersion measures. + +- arrow.cap: + + The width of the cap at the outer end of each bar as a proportion of + the width of the plot. + +- arrow.gap: + + The gap to leave at the inner end of each bar. Defaults to two thirds + of the height of a capital "O". + +- intervals: + + Whether the limits are intervals (TRUE) or absolute values (FALSE). + +- type: + + What type of display to use. + +- fill: + + Color to fill between the lines if `type` is not NULL and `fill` is + not NA. + +- lty: + + Line type for redrawing the lines if necessary. + +- pch: + + Symbol for redrawing the points if necessary. + +- border: + + Line type for drawing a border on the confidence band. + +- col: + + Color for the lines or capped bars. + +- display.na: + + Whether to display NA values as lines going off the plot. + +- ...: + + additional arguments passed to `arrows` or `lines` depending upon + `type`. + +## Details + +`dispersion` displays a measure of dispersion on an existing plot. +Currently it will display either vertical lines with caps (error bars) +or lines that form a "confidence band" around a line of central +tendency. If `fill` is not NA and `type` is `"l"`, a polygon will be +drawn between the confidence lines. Remember that any points or lines +within the confidence band will be obscured, so pass point and/or line +types as in the second example. + +The default behavior is to display an undefined dispersion (e.g. a +variance with only one observation) as a line going off the plot. If +`display.na` is FALSE, NA values will not be displayed, allowing the +user to show only upper or lower dispersion limits. + +The `intervals` argument allows the user to pass the limits as either +intervals (the default) or absolute values. + +If `arrow.gap` is greater than or equal to the upper or lower limit for +a bar, `segments` is used to draw the upper and lower caps with no bars +to avoid zero length arrows. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[arrows](https://rdrr.io/r/graphics/arrows.html), +[segments](https://rdrr.io/r/graphics/segments.html),[lines](https://rdrr.io/r/graphics/lines.html) + +## Examples + +``` r + disptest<-matrix(rnorm(200),nrow=20) + disptest.means<-rowMeans(disptest) + row.order<-order(disptest.means) + se.disptest<-unlist(apply(disptest,1,std.error)) + plot(disptest.means[row.order],main="Dispersion as error bars", + ylim=c(min(disptest.means-se.disptest),max(disptest.means+se.disptest)), + xlab="Occasion",ylab="Value") + dispersion(1:20,disptest.means[row.order],se.disptest[row.order]) + + plot(disptest.means[row.order],main="Dispersion as confidence band", + ylim=c(min(disptest.means-se.disptest),max(disptest.means+se.disptest)), + xlab="Occasion",ylab="Value") + dispersion(1:20,disptest.means[row.order],se.disptest[row.order],type="l", + fill="#eeccee",lty=2,pch=1) + + disptest2<-matrix(sample(c(TRUE,FALSE),200,TRUE),nrow=10) + disptest.prop<-rowMeans(disptest2) + disptest.ulim<-disptest.llim<-rep(NA,10) + for(i in 1:10) { + disptest.ulim[i]<-binciWu(disptest2[i,],20) + disptest.llim[i]<-binciWl(disptest2[i,],20) + } + plot(disptest.prop,main="Dispersion as binomial confidence intervals", + ylim=c(min(disptest.llim),max(disptest.ulim)), + xlab="Sample",ylab="Proportion") + dispersion(1:10,disptest.prop,disptest.ulim,disptest.llim, + interval=FALSE,lty=2,pch=1) +``` diff --git a/reference/do.first.html b/reference/do.first.html new file mode 100644 index 0000000..8816146 --- /dev/null +++ b/reference/do.first.html @@ -0,0 +1,72 @@ + +Execute a graphic function on a plot — do.first • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    do.first allows the user to execute one or more commands before + displaying values on a plot.

    +
    + + +
    +

    Details

    +

    do.first is an argument in some plotrix functions that allows the user + to do things like add a background color or a grid to the plot before + displaying the other plot elements.

    +

    The value of do.first should be a character string that can be parsed + to one or more valid R commands. Remember to enclose the string in quotes, + separate commands with semicolons and escape quotes within the string with + backslashes if necessary.

    +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/do.first.md b/reference/do.first.md new file mode 100644 index 0000000..671c613 --- /dev/null +++ b/reference/do.first.md @@ -0,0 +1,15 @@ +# Execute a graphic function on a plot + +do.first allows the user to execute one or more commands before +displaying values on a plot. + +## Details + +`do.first` is an argument in some plotrix functions that allows the user +to do things like add a background color or a grid to the plot before +displaying the other plot elements. + +The value of `do.first` should be a character string that can be parsed +to one or more valid R commands. Remember to enclose the string in +quotes, separate commands with semicolons and escape quotes within the +string with backslashes if necessary. diff --git a/reference/dotplot.mtb.html b/reference/dotplot.mtb.html new file mode 100644 index 0000000..aec7152 --- /dev/null +++ b/reference/dotplot.mtb.html @@ -0,0 +1,142 @@ + +Minitab style dotplots. — dotplot.mtb • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Create a dotplot of a data vector in the sense of "dotplot" as + used in the Minitab\(\mbox{\copyright}\) package.

    +
    + +
    +

    Usage

    +
    dotplot.mtb(x, xlim = NULL, main = NULL, xlab = NULL, ylab = NULL,
    +            pch = 19, hist = FALSE, yaxis = FALSE, mtbstyle=TRUE)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A numeric vector.

    + +
    xlim
    +

    The x limits of the plot.

    + +
    main
    +

    A title for the plot; defaults to blank.

    + +
    xlab
    +

    A label for the x axis; defaults to blank.

    + +
    ylab
    +

    A label for the y axis; defaults to blank.

    + +
    pch
    +

    The plotting symbol for the dots in the plot; + defaults to a solid disc.

    + +
    hist
    +

    Logical scalar; should the plot be done "histogram" + style, i.e. using vertical lines rather than stacks + of dots?

    + +
    yaxis
    +

    Logical scalar; should a y-axis be produced?

    + +
    mtbstyle
    +

    Logical scalar; should the dotplot be done in + the "Minitab" style? I.e. should the zero level + be at the vertical midway point?

    + +
    +
    +

    Details

    +

    The result of hist=TRUE looks less ugly than stacks of + dots for very large data sets.

    +
    +
    +

    Value

    +

    Nothing. A plot is produced as a side effect.

    +
    +
    +

    Author

    +

    Barry Rowlingson + B.Rowlingson@lancaster.ac.uk + and Rolf Turner + r.turner@auckland.ac.nz + http://www.stat.auckland.ac.nz/~rolf

    +
    +
    +

    Warnings

    +

    This function does something toadally different from the dotplot() +(now dotchart()) function in the graphics package.

    +

    The labelling of the y-axis is device dependent.

    +
    + +
    +

    Examples

    +
    if (FALSE) { # \dontrun{
    +set.seed(42)
    +x <- rpois(100,10)
    +dotplot.mtb(x,main="No y-axis.")
    +dotplot.mtb(x,yaxis=TRUE,main="With y-axis displayed.")
    +dotplot.mtb(x,hist=TRUE,main="An \"h\" style plot.")
    +dotplot.mtb(x,xlim=c(4,16),main="With the x-axis limited.")
    +dotplot.mtb(x,yaxis=TRUE,mtbstyle=FALSE,main="Non-Minitab style.")
    +dotplot.mtb(x,yaxis=TRUE,xlab="x",ylab="count",
    +            main="With x and y axis labels.")
    +} # }
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/dotplot.mtb.md b/reference/dotplot.mtb.md new file mode 100644 index 0000000..66b79a0 --- /dev/null +++ b/reference/dotplot.mtb.md @@ -0,0 +1,90 @@ +# Minitab style dotplots. + +Create a dotplot of a data vector in the sense of "dotplot" as used in +the Minitab\\\mbox{\copyright}\\ package. + +## Usage + +``` r +dotplot.mtb(x, xlim = NULL, main = NULL, xlab = NULL, ylab = NULL, + pch = 19, hist = FALSE, yaxis = FALSE, mtbstyle=TRUE) +``` + +## Arguments + +- x: + + A numeric vector. + +- xlim: + + The x limits of the plot. + +- main: + + A title for the plot; defaults to blank. + +- xlab: + + A label for the x axis; defaults to blank. + +- ylab: + + A label for the y axis; defaults to blank. + +- pch: + + The plotting symbol for the dots in the plot; defaults to a solid + disc. + +- hist: + + Logical scalar; should the plot be done "histogram" style, i.e. using + vertical lines rather than stacks of dots? + +- yaxis: + + Logical scalar; should a y-axis be produced? + +- mtbstyle: + + Logical scalar; should the dotplot be done in the "Minitab" style? + I.e. should the zero level be at the vertical midway point? + +## Details + +The result of `hist=TRUE` looks less ugly than stacks of dots for very +large data sets. + +## Value + +Nothing. A plot is produced as a side effect. + +## Author + +Barry Rowlingson and Rolf Turner + + +## Warnings + +This function does something toadally different from the `dotplot()` +(now [`dotchart()`](https://rdrr.io/r/graphics/dotchart.html)) function +in the graphics package. + +The labelling of the `y`-axis is device dependent. + +## Examples + +``` r +if (FALSE) { # \dontrun{ +set.seed(42) +x <- rpois(100,10) +dotplot.mtb(x,main="No y-axis.") +dotplot.mtb(x,yaxis=TRUE,main="With y-axis displayed.") +dotplot.mtb(x,hist=TRUE,main="An \"h\" style plot.") +dotplot.mtb(x,xlim=c(4,16),main="With the x-axis limited.") +dotplot.mtb(x,yaxis=TRUE,mtbstyle=FALSE,main="Non-Minitab style.") +dotplot.mtb(x,yaxis=TRUE,xlab="x",ylab="count", + main="With x and y axis labels.") +} # } +``` diff --git a/reference/draw.arc-1.png b/reference/draw.arc-1.png new file mode 100644 index 0000000..6bb6902 Binary files /dev/null and b/reference/draw.arc-1.png differ diff --git a/reference/draw.arc-2.png b/reference/draw.arc-2.png new file mode 100644 index 0000000..f111b0b Binary files /dev/null and b/reference/draw.arc-2.png differ diff --git a/reference/draw.arc.html b/reference/draw.arc.html new file mode 100644 index 0000000..b9c2c77 --- /dev/null +++ b/reference/draw.arc.html @@ -0,0 +1,141 @@ + +Draw arc — draw.arc • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Draw one or more arcs using classic graphics.

    +
    + +
    +

    Usage

    +
    draw.arc(x=1,y=NULL,radius=1,angle1=deg1*pi/180,angle2=deg2*pi/180, 
    +  deg1=0,deg2=45,n=0.05,col=NA,lwd=NA,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    x coordinate of center. Scalar or vector.

    + +
    y
    +

    y coordinate of center. Scalar or vector.

    + +
    radius
    +

    radius. Scalar or vector.

    + +
    angle1
    +

    Starting angle in radians. Scalar or vector.

    + +
    angle2
    +

    Ending angle in radians. Scalar or vector.

    + +
    deg1
    +

    Starting angle in degrees. Scalar or vector.

    + +
    deg2
    +

    Ending angle in degrees. Scalar or vector.

    + +
    n
    +

    Number of polygons to use to approximate the arc.

    + +
    col
    +

    Arc colors.

    + +
    lwd
    +

    Line width for the arc.

    + +
    ...
    +

    Other arguments passed to segments. Vectorization + is not supported for these.

    + +
    +
    +

    Details

    +

    Draws one or more arcs from angle1 to angle2. + If angle1 is numerically greater than angle2, + then the angles are swapped.

    +

    Be sure to use an aspect ratio of 1 as shown in + the example to avoid distortion. For argument 'n' (which may be + either a scalar or a vector, although most likely you will leave + it at the default value), an integer value means to use that number + of segments to approximate the arc, while a non-integer value means + to use enough segments so that the angle that successive segments + make with one another is no more than n radians.

    +
    +
    +

    Value

    +

    Returns a matrix of expanded arguments invisibly.

    +
    +
    +

    Author

    +

    Gabor Grothendieck. Improvements by Ted Toal.

    +
    + +
    +

    Examples

    +
    
    +   plot(1:10, asp = 1,main="Test draw.arc")
    +   draw.arc(5, 5, 1:10/10, deg2 = 1:10*10, col = "blue")
    +   draw.arc(8, 8, 1:10/10, deg2 = 1:10*10, col = 1:10)
    +   draw.arc(5, 5, 3, deg1=100, deg2=170, col="gold", lwd=50, lend=1)
    +
    +   # example taken from post by Hans Borcher:
    +   # https://stat.ethz.ch/pipermail/r-help/2009-July/205728.html
    +   # Note setting of aspect ratio to 1 first.
    +   curve(sin(x), 0, pi, col="blue", asp=1)
    +   draw.arc(pi/2, 0, 1, deg1=45, deg2=135, col="red")
    +
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/draw.arc.md b/reference/draw.arc.md new file mode 100644 index 0000000..0a420c8 --- /dev/null +++ b/reference/draw.arc.md @@ -0,0 +1,93 @@ +# Draw arc + +Draw one or more arcs using classic graphics. + +## Usage + +``` r +draw.arc(x=1,y=NULL,radius=1,angle1=deg1*pi/180,angle2=deg2*pi/180, + deg1=0,deg2=45,n=0.05,col=NA,lwd=NA,...) +``` + +## Arguments + +- x: + + x coordinate of center. Scalar or vector. + +- y: + + y coordinate of center. Scalar or vector. + +- radius: + + radius. Scalar or vector. + +- angle1: + + Starting angle in radians. Scalar or vector. + +- angle2: + + Ending angle in radians. Scalar or vector. + +- deg1: + + Starting angle in degrees. Scalar or vector. + +- deg2: + + Ending angle in degrees. Scalar or vector. + +- n: + + Number of polygons to use to approximate the arc. + +- col: + + Arc colors. + +- lwd: + + Line width for the arc. + +- ...: + + Other arguments passed to segments. Vectorization is not supported for + these. + +## Details + +Draws one or more arcs from `angle1` to `angle2`. If `angle1` is +numerically greater than `angle2`, then the angles are swapped. + +Be sure to use an aspect ratio of 1 as shown in the example to avoid +distortion. For argument 'n' (which may be either a scalar or a vector, +although most likely you will leave it at the default value), an integer +value means to use that number of segments to approximate the arc, while +a non-integer value means to use enough segments so that the angle that +successive segments make with one another is no more than n radians. + +## Value + +Returns a matrix of expanded arguments invisibly. + +## Author + +Gabor Grothendieck. Improvements by Ted Toal. + +## Examples + +``` r + plot(1:10, asp = 1,main="Test draw.arc") + draw.arc(5, 5, 1:10/10, deg2 = 1:10*10, col = "blue") + draw.arc(8, 8, 1:10/10, deg2 = 1:10*10, col = 1:10) + draw.arc(5, 5, 3, deg1=100, deg2=170, col="gold", lwd=50, lend=1) + + # example taken from post by Hans Borcher: + # https://stat.ethz.ch/pipermail/r-help/2009-July/205728.html + # Note setting of aspect ratio to 1 first. + curve(sin(x), 0, pi, col="blue", asp=1) + draw.arc(pi/2, 0, 1, deg1=45, deg2=135, col="red") + +``` diff --git a/reference/draw.circle-1.png b/reference/draw.circle-1.png new file mode 100644 index 0000000..aeb950d Binary files /dev/null and b/reference/draw.circle-1.png differ diff --git a/reference/draw.circle.html b/reference/draw.circle.html new file mode 100644 index 0000000..c1b98f8 --- /dev/null +++ b/reference/draw.circle.html @@ -0,0 +1,126 @@ + +Draw a circle — draw.circle • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Draws a circle on an existing plot.

    +
    + +
    +

    Usage

    +
    draw.circle(x,y,radius,nv=100,border=NULL,col=NA,lty=1,density=NULL,
    +  angle=45,lwd=1)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    Coordinates of the center of the circle.

    + +
    radius
    +

    Radius (or radii) of the circle(s) in user units.

    + +
    nv
    +

    Number of vertices to draw the circle.

    + +
    border
    +

    Color to use for drawing the circumference.

    + +
    col
    +

    Color to use for filling the circle.

    + +
    lty
    +

    Line type for the circumference.

    + +
    density
    +

    Density for patterned fill. See polygon.

    + +
    angle
    +

    Angle of patterned fill. See polygon.

    + +
    lwd
    +

    Line width for the circumference.

    + +
    +
    +

    Value

    +

    A list with the x and y coordinates of the points on the circumference + of the last circle displayed.

    +
    +
    +

    Details

    +

    draw.circle uses the dimensions of the plot and the x and + y coordinates to draw a circle rather than an ellipse.

    +
    +
    +

    Author

    +

    Jim Lemon, thanks to David Winsemius for the density and angle args

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     plot(1:5,seq(1,10,length=5),type="n",xlab="",ylab="",main="Test draw.circle")
    + draw.circle(2,4,c(1,0.66,0.33),border="purple",
    +  col=c("#ff00ff","#ff77ff","#ffccff"),lty=1,lwd=1)
    + draw.circle(2.5,8,0.6,border="red",lty=3,lwd=3)
    + draw.circle(4,3,0.7,border="green",col="yellow",lty=1,
    +  density=5,angle=30,lwd=10)
    + draw.circle(3.5,8,0.8,border="blue",lty=2,lwd=2)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/draw.circle.md b/reference/draw.circle.md new file mode 100644 index 0000000..2ae1c80 --- /dev/null +++ b/reference/draw.circle.md @@ -0,0 +1,78 @@ +# Draw a circle + +Draws a circle on an existing plot. + +## Usage + +``` r +draw.circle(x,y,radius,nv=100,border=NULL,col=NA,lty=1,density=NULL, + angle=45,lwd=1) +``` + +## Arguments + +- x,y: + + Coordinates of the center of the circle. + +- radius: + + Radius (or radii) of the circle(s) in user units. + +- nv: + + Number of vertices to draw the circle. + +- border: + + Color to use for drawing the circumference. + +- col: + + Color to use for filling the circle. + +- lty: + + Line type for the circumference. + +- density: + + Density for patterned fill. See `polygon`. + +- angle: + + Angle of patterned fill. See `polygon`. + +- lwd: + + Line width for the circumference. + +## Value + +A list with the x and y coordinates of the points on the circumference +of the last circle displayed. + +## Details + +`draw.circle` uses the dimensions of the plot and the `x` and `y` +coordinates to draw a circle rather than an ellipse. + +## Author + +Jim Lemon, thanks to David Winsemius for the density and angle args + +## See also + +[polygon](https://rdrr.io/r/graphics/polygon.html) + +## Examples + +``` r + plot(1:5,seq(1,10,length=5),type="n",xlab="",ylab="",main="Test draw.circle") + draw.circle(2,4,c(1,0.66,0.33),border="purple", + col=c("#ff00ff","#ff77ff","#ffccff"),lty=1,lwd=1) + draw.circle(2.5,8,0.6,border="red",lty=3,lwd=3) + draw.circle(4,3,0.7,border="green",col="yellow",lty=1, + density=5,angle=30,lwd=10) + draw.circle(3.5,8,0.8,border="blue",lty=2,lwd=2) +``` diff --git a/reference/draw.ellipse-1.png b/reference/draw.ellipse-1.png new file mode 100644 index 0000000..5703c78 Binary files /dev/null and b/reference/draw.ellipse-1.png differ diff --git a/reference/draw.ellipse.html b/reference/draw.ellipse.html new file mode 100644 index 0000000..8b04f0a --- /dev/null +++ b/reference/draw.ellipse.html @@ -0,0 +1,140 @@ + +Draw ellipse — draw.ellipse • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Draws ellipses on an existing plot.

    +
    + +
    +

    Usage

    +
    draw.ellipse(x, y, a = 1, b = 1, angle = 0, segment = NULL, 
    +arc.only = TRUE, deg = TRUE, nv = 100, border = NULL, 
    +col = NA, lty = 1, lwd = 1, ...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A vector or a matrix (if y is missing).

    + +
    y
    +

    A vector, can be missing.

    + +
    a,b
    +

    Vectors, radii of the ellypses along the two axes in user units.

    + +
    angle
    +

    Angle of rotation in degrees (if deg=TRUE) or in radians + (if deg=FALSE).

    + +
    segment
    +

    Start and endpoints of arc in degrees (if deg=TRUE) or in radians + (if deg=FALSE).

    + +
    arc.only
    +

    Logical, if segmen the full ellipse is not drawn, radii from the +ends of the arc are drawn to form a sector (see Examples).

    + +
    deg
    +

    Logical, if angles are given in degrees (TRUE) or radians.

    + +
    nv
    +

    Number of vertices to draw the ellipses.

    + +
    border
    +

    Color to use for drawing the circumference.

    + +
    col
    +

    Color to use for filling the circle.

    + +
    lty
    +

    Line type for the circumference.

    + +
    lwd
    +

    Line width for the circumference.

    + +
    ...
    +

    Additional arguments passed to polygon.

    + +
    +
    +

    Value

    +

    Draw ellipses as a side effect.

    +
    +
    +

    Author

    +

    Peter Solymos <solymos@ualberta.ca>

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    plot(c(0,10), c(0,10), type="n", main="test draw.ellipse")
    +draw.ellipse(c(3,7), c(8,8), c(0.5,1), c(1,0.5), col=c(2,4),
    + angle=c(45,0), segment=rbind(c(0,45),c(45,360)))
    +draw.ellipse(c(3,7), c(6,6), c(0.5,1), c(1,0.5), col=c(2,4),
    + angle=c(45,0), segment=rbind(c(0,45),c(45,360)), arc.only=FALSE)
    +draw.ellipse(c(3,7), c(4,4), c(0.5,1), c(1,0.5), border=c(2,4),
    + angle=c(45,0), segment=rbind(c(0,45),c(45,360)), arc.only=FALSE)
    +draw.ellipse(c(3,7), c(2,2), c(0.5,1), c(1,0.5), border=1,
    + angle=c(45,0), lty=3)
    +draw.ellipse(c(3,7), c(2,2), c(0.5,1), c(1,0.5), border=c(5,3),
    + angle=c(45,0), nv=c(3,4), lty=2, lwd=2)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/draw.ellipse.md b/reference/draw.ellipse.md new file mode 100644 index 0000000..e029a19 --- /dev/null +++ b/reference/draw.ellipse.md @@ -0,0 +1,97 @@ +# Draw ellipse + +Draws ellipses on an existing plot. + +## Usage + +``` r +draw.ellipse(x, y, a = 1, b = 1, angle = 0, segment = NULL, +arc.only = TRUE, deg = TRUE, nv = 100, border = NULL, +col = NA, lty = 1, lwd = 1, ...) +``` + +## Arguments + +- x: + + A vector or a matrix (if `y` is missing). + +- y: + + A vector, can be missing. + +- a,b: + + Vectors, radii of the ellypses along the two axes in user units. + +- angle: + + Angle of rotation in degrees (if `deg=TRUE`) or in radians (if + `deg=FALSE`). + +- segment: + + Start and endpoints of arc in degrees (if `deg=TRUE`) or in radians + (if `deg=FALSE`). + +- arc.only: + + Logical, if `segmen` the full ellipse is not drawn, radii from the + ends of the arc are drawn to form a sector (see Examples). + +- deg: + + Logical, if angles are given in degrees (`TRUE`) or radians. + +- nv: + + Number of vertices to draw the ellipses. + +- border: + + Color to use for drawing the circumference. + +- col: + + Color to use for filling the circle. + +- lty: + + Line type for the circumference. + +- lwd: + + Line width for the circumference. + +- ...: + + Additional arguments passed to + [`polygon`](https://rdrr.io/r/graphics/polygon.html). + +## Value + +Draw ellipses as a side effect. + +## Author + +Peter Solymos \ + +## See also + +[polygon](https://rdrr.io/r/graphics/polygon.html) + +## Examples + +``` r +plot(c(0,10), c(0,10), type="n", main="test draw.ellipse") +draw.ellipse(c(3,7), c(8,8), c(0.5,1), c(1,0.5), col=c(2,4), + angle=c(45,0), segment=rbind(c(0,45),c(45,360))) +draw.ellipse(c(3,7), c(6,6), c(0.5,1), c(1,0.5), col=c(2,4), + angle=c(45,0), segment=rbind(c(0,45),c(45,360)), arc.only=FALSE) +draw.ellipse(c(3,7), c(4,4), c(0.5,1), c(1,0.5), border=c(2,4), + angle=c(45,0), segment=rbind(c(0,45),c(45,360)), arc.only=FALSE) +draw.ellipse(c(3,7), c(2,2), c(0.5,1), c(1,0.5), border=1, + angle=c(45,0), lty=3) +draw.ellipse(c(3,7), c(2,2), c(0.5,1), c(1,0.5), border=c(5,3), + angle=c(45,0), nv=c(3,4), lty=2, lwd=2) +``` diff --git a/reference/draw.radial.line-1.png b/reference/draw.radial.line-1.png new file mode 100644 index 0000000..5383f5e Binary files /dev/null and b/reference/draw.radial.line-1.png differ diff --git a/reference/draw.radial.line.html b/reference/draw.radial.line.html new file mode 100644 index 0000000..71ad152 --- /dev/null +++ b/reference/draw.radial.line.html @@ -0,0 +1,144 @@ + +Draw a radial line — draw.radial.line • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Draws a line radiating from a specified center, optionally + expanding the line width as a function of distance from center.

    +
    + +
    +

    Usage

    +
    draw.radial.line(start, end, center=c(0, 0), angle=0, deg=NA,
    +  expand=FALSE, col=NA, lwd=NA, ...)
    +
    + +
    +

    Arguments

    +

    +
    start
    +

    Distance from center of circular area to start of line in + x/y user units.

    + +
    end
    +

    Distance from center of circular area to end of line in x/y + user units.

    + +
    center
    +

    The center of the circular area in x/y user units.

    + +
    angle
    +

    The angular position of the line in radians.

    + +
    deg
    +

    The angular position of the line in degrees + (takes precedence if not NA).

    + +
    expand
    +

    TRUE to expand line width in proportion to distance from + center.

    + +
    col
    +

    The color of the line, NA for par("col").

    + +
    lwd
    +

    The width of the line in device-specific units, + NA for par("lwd").

    + +
    ...
    +

    Arguments passed to 'lines' (expand=FALSE) or 'polygon' + (expand=TRUE).

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    If the user passes a value for 'deg', this overrides any value passed + to 'angle'.

    +

    If 'expand' is FALSE, the line width is constant (as specified by par("lwd").

    +

    If 'expand' is TRUE, the line width is equal to the lwd value at distance + 'end' and contracts as it moves towards 'start'. When expand is 'TRUE', + lty is ignored.

    +
    +
    +

    Author

    +

    Ted Toal

    +
    +
    +

    See also

    +

    \ + lines, + draw.arc.

    +
    + +
    +

    Examples

    +
     plot(0, xlim=c(1,5), ylim=c(1,5), main="Test of radial lines", xlab="", ylab="", type="n")
    + points(3, 3, pch=20)
    + draw.radial.line(1, 2, center=c(3,3))
    + draw.radial.line(1, 2, center=c(3,3), angle=pi/4)
    + draw.radial.line(1, 2, center=c(3,3), angle=pi/4+0.1, col="blue", lwd=4, lty=3)
    + draw.radial.line(0.2, 1.2, center=c(3,3), deg=120, col="red", lwd=10)
    + draw.radial.line(0.2, 1.2, center=c(3,3), deg=145, col="purple", lwd=10, lend=1)
    + draw.radial.line(0.5, 2, center=c(3,3), deg=225, expand=TRUE, col="gold")
    + draw.radial.line(0.7, 1.4, center=c(3,3), deg=180, expand=TRUE, col="orange", lwd=30)
    + draw.radial.line(0.5, 1.5, center=c(3,3), deg=235, expand=TRUE, lwd=5, col="brown")
    + draw.radial.line(0.1, 1.5, center=c(3,3), deg=325, expand=TRUE, lwd=5, col="green")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/draw.radial.line.md b/reference/draw.radial.line.md new file mode 100644 index 0000000..93ea4cf --- /dev/null +++ b/reference/draw.radial.line.md @@ -0,0 +1,93 @@ +# Draw a radial line + +Draws a line radiating from a specified center, optionally expanding the +line width as a function of distance from center. + +## Usage + +``` r +draw.radial.line(start, end, center=c(0, 0), angle=0, deg=NA, + expand=FALSE, col=NA, lwd=NA, ...) +``` + +## Arguments + +- start: + + Distance from center of circular area to start of line in x/y user + units. + +- end: + + Distance from center of circular area to end of line in x/y user + units. + +- center: + + The center of the circular area in x/y user units. + +- angle: + + The angular position of the line in radians. + +- deg: + + The angular position of the line in degrees (takes precedence if not + NA). + +- expand: + + TRUE to expand line width in proportion to distance from center. + +- col: + + The color of the line, NA for par("col"). + +- lwd: + + The width of the line in device-specific units, NA for par("lwd"). + +- ...: + + Arguments passed to 'lines' (expand=FALSE) or 'polygon' (expand=TRUE). + +## Value + +nil + +## Details + +If the user passes a value for 'deg', this overrides any value passed to +'angle'. + +If 'expand' is FALSE, the line width is constant (as specified by +par("lwd"). + +If 'expand' is TRUE, the line width is equal to the lwd value at +distance 'end' and contracts as it moves towards 'start'. When expand is +'TRUE', lty is ignored. + +## Author + +Ted Toal + +## See also + +\\ [`lines`](https://rdrr.io/r/graphics/lines.html), +[`draw.arc`](draw.arc.md). + +## Examples + +``` r + plot(0, xlim=c(1,5), ylim=c(1,5), main="Test of radial lines", xlab="", ylab="", type="n") + points(3, 3, pch=20) + draw.radial.line(1, 2, center=c(3,3)) + draw.radial.line(1, 2, center=c(3,3), angle=pi/4) + draw.radial.line(1, 2, center=c(3,3), angle=pi/4+0.1, col="blue", lwd=4, lty=3) + draw.radial.line(0.2, 1.2, center=c(3,3), deg=120, col="red", lwd=10) + draw.radial.line(0.2, 1.2, center=c(3,3), deg=145, col="purple", lwd=10, lend=1) + draw.radial.line(0.5, 2, center=c(3,3), deg=225, expand=TRUE, col="gold") + draw.radial.line(0.7, 1.4, center=c(3,3), deg=180, expand=TRUE, col="orange", lwd=30) + draw.radial.line(0.5, 1.5, center=c(3,3), deg=235, expand=TRUE, lwd=5, col="brown") + draw.radial.line(0.1, 1.5, center=c(3,3), deg=325, expand=TRUE, lwd=5, col="green") +``` diff --git a/reference/draw.tilted.sector.html b/reference/draw.tilted.sector.html new file mode 100644 index 0000000..6e0b4f3 --- /dev/null +++ b/reference/draw.tilted.sector.html @@ -0,0 +1,125 @@ + +Display a 3D pie sector — draw.tilted.sector • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a 3D pie sector.

    +
    + +
    +

    Usage

    +
    draw.tilted.sector(x=0,y=0,edges=NA,radius=1,height=0.1,theta=pi/6,
    +  start=0,end=pi*2,border=par("fg"),col=par("bg"),explode=0,shade=0.8)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    Position of the center of the pie sector in user units

    + +
    edges
    +

    Number of edges to draw a complete ellipse

    + +
    radius
    +

    the radius of the pie in user units

    + +
    height
    +

    the height of the pie in user units

    + +
    theta
    +

    The angle of viewing in radians

    + +
    start
    +

    Starting angle of the sector

    + +
    end
    +

    Ending angle of the sector

    + +
    border
    +

    The color of the sector border lines

    + +
    col
    +

    Color of the sector

    + +
    explode
    +

    How far to "explode" the sectors in user units

    + +
    shade
    +

    If > 0 and < 1, the proportion to reduce the + brightness of the sector color to get a better 3D effect.

    + +
    +
    +

    Value

    +

    The bisector of the pie sector in radians.

    +
    +
    +

    Details

    +

    draw.tilted.sector displays a single 3D pie sector. It is probably + only useful when called from pie3D. The shade + argument proportionately reduces the brightness of the RGB color of + the sector to produce a top lighted effect.

    +

    If explode is zero, only the top and outer side of each + sector will be displayed. This will sometimes fix the problem of a pie with + one huge sector greater than 3*pi/2 that cannot otherwise be drawn.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/draw.tilted.sector.md b/reference/draw.tilted.sector.md new file mode 100644 index 0000000..c234eb7 --- /dev/null +++ b/reference/draw.tilted.sector.md @@ -0,0 +1,80 @@ +# Display a 3D pie sector + +Displays a 3D pie sector. + +## Usage + +``` r +draw.tilted.sector(x=0,y=0,edges=NA,radius=1,height=0.1,theta=pi/6, + start=0,end=pi*2,border=par("fg"),col=par("bg"),explode=0,shade=0.8) +``` + +## Arguments + +- x,y: + + Position of the center of the pie sector in user units + +- edges: + + Number of edges to draw a complete ellipse + +- radius: + + the radius of the pie in user units + +- height: + + the height of the pie in user units + +- theta: + + The angle of viewing in radians + +- start: + + Starting angle of the sector + +- end: + + Ending angle of the sector + +- border: + + The color of the sector border lines + +- col: + + Color of the sector + +- explode: + + How far to "explode" the sectors in user units + +- shade: + + If \> 0 and \< 1, the proportion to reduce the brightness of the + sector color to get a better 3D effect. + +## Value + +The bisector of the pie sector in radians. + +## Details + +`draw.tilted.sector` displays a single 3D pie sector. It is probably +only useful when called from [pie3D](pie3D.md). The `shade` argument +proportionately reduces the brightness of the RGB color of the sector to +produce a top lighted effect. + +If `explode` is zero, only the top and outer side of each sector will be +displayed. This will sometimes fix the problem of a pie with one huge +sector greater than 3\*pi/2 that cannot otherwise be drawn. + +## Author + +Jim Lemon + +## See also + +[pie3D](pie3D.md) diff --git a/reference/drawNestedBars.html b/reference/drawNestedBars.html new file mode 100644 index 0000000..99fdc34 --- /dev/null +++ b/reference/drawNestedBars.html @@ -0,0 +1,136 @@ + +Display nested bars — drawNestedBars • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays the nested bars for barNest.

    +
    + +
    +

    Usage

    +
    drawNestedBars(x,start,end,shrink=0.1,errbars=FALSE,intervals=TRUE,col=NA,
    + labelcex=1,lineht=NULL,showall=TRUE,Nwidths=FALSE,barlabels=NULL,
    + showlabels=TRUE,arrow.cap=NA)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    One level of the breakdown produced by brkdnNest.

    + +
    start,end
    +

    The left and right x coordinates for the bar or group of bars + to be displayed.

    + +
    shrink
    +

    The proportion to shrink the width of the bars at each level.

    + +
    errbars
    +

    Whether to display error bars on the bars.

    + +
    intervals
    +

    Whether to use offsets or absolute values when displaying + measures of dispersion.

    + +
    col
    +

    The colors to use to fill the bars. See Details.

    + +
    labelcex
    +

    Character size for the group labels.

    + +
    lineht
    +

    The height of a margin line in user units.

    + +
    showall
    +

    Whether to display the bars at any levels above the last.

    + +
    Nwidths
    +

    Whether to scale the widths of the bars to the number of + observations.

    + +
    barlabels
    +

    Optional labels to display below the bars.

    + +
    showlabels
    +

    Whether to display the labels below the bars.

    + +
    arrow.cap
    +

    The width of the "cap" on error bars in user units, + defaulting to 0.01 of the width of the plot.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    drawNestedBars displays the bars for the nested breakdown performed + by brkdnNest. It starts at the top of the list and calls itself for + each level of the breakdown. It is unlikely to be useful for anything else.

    +

    The combination of showlabels=TRUE and showall=FALSE allows + the display of all of the labels below the plot with only the last set of + bars being displayed. To have a set of labels not displayed, pass explicit + barlabels and have zero length labels for the level that is not to + have labels.

    +
    +
    +

    Author

    +

    Jim Lemon and Ofir Levy

    +
    +
    +

    See also

    +

    brkdnNest, drawNestedBars

    +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/drawNestedBars.md b/reference/drawNestedBars.md new file mode 100644 index 0000000..214226e --- /dev/null +++ b/reference/drawNestedBars.md @@ -0,0 +1,92 @@ +# Display nested bars + +Displays the nested bars for barNest. + +## Usage + +``` r +drawNestedBars(x,start,end,shrink=0.1,errbars=FALSE,intervals=TRUE,col=NA, + labelcex=1,lineht=NULL,showall=TRUE,Nwidths=FALSE,barlabels=NULL, + showlabels=TRUE,arrow.cap=NA) +``` + +## Arguments + +- x: + + One level of the breakdown produced by `brkdnNest`. + +- start,end: + + The left and right x coordinates for the bar or group of bars to be + displayed. + +- shrink: + + The proportion to shrink the width of the bars at each level. + +- errbars: + + Whether to display error bars on the bars. + +- intervals: + + Whether to use offsets or absolute values when displaying measures of + dispersion. + +- col: + + The colors to use to fill the bars. See Details. + +- labelcex: + + Character size for the group labels. + +- lineht: + + The height of a margin line in user units. + +- showall: + + Whether to display the bars at any levels above the last. + +- Nwidths: + + Whether to scale the widths of the bars to the number of observations. + +- barlabels: + + Optional labels to display below the bars. + +- showlabels: + + Whether to display the labels below the bars. + +- arrow.cap: + + The width of the "cap" on error bars in user units, defaulting to 0.01 + of the width of the plot. + +## Value + +nil + +## Details + +`drawNestedBars` displays the bars for the nested breakdown performed by +`brkdnNest`. It starts at the top of the list and calls itself for each +level of the breakdown. It is unlikely to be useful for anything else. + +The combination of `showlabels=TRUE` and `showall=FALSE` allows the +display of all of the labels below the plot with only the last set of +bars being displayed. To have a set of labels not displayed, pass +explicit `barlabels` and have zero length labels for the level that is +not to have labels. + +## Author + +Jim Lemon and Ofir Levy + +## See also + +[brkdnNest](brkdnNest.md), drawNestedBars diff --git a/reference/drawSectorAnnulus.html b/reference/drawSectorAnnulus.html new file mode 100644 index 0000000..adfd318 --- /dev/null +++ b/reference/drawSectorAnnulus.html @@ -0,0 +1,97 @@ + +Display a radial pie sector — drawSectorAnnulus • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a radial pie sector with optional annuli.

    +
    + +
    +

    Usage

    +
    drawSectorAnnulus(angle1,angle2,radius1,radius2,col,angleinc=0.03)
    +
    + +
    +

    Arguments

    +

    +
    angle1,angle2
    +

    Start and end angle for the sector.

    + +
    radius1,radius2
    +

    Start and end of the radial extent of the annulus.

    + +
    col
    +

    Color of the sector.

    + +
    angleinc
    +

    The angular increment to use in drawing the arcs.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    drawSectorAnnulus displays a single radial pie sector. It is probably + only useful when called from radial.pie.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/drawSectorAnnulus.md b/reference/drawSectorAnnulus.md new file mode 100644 index 0000000..cbe3152 --- /dev/null +++ b/reference/drawSectorAnnulus.md @@ -0,0 +1,44 @@ +# Display a radial pie sector + +Displays a radial pie sector with optional annuli. + +## Usage + +``` r +drawSectorAnnulus(angle1,angle2,radius1,radius2,col,angleinc=0.03) +``` + +## Arguments + +- angle1,angle2: + + Start and end angle for the sector. + +- radius1,radius2: + + Start and end of the radial extent of the annulus. + +- col: + + Color of the sector. + +- angleinc: + + The angular increment to use in drawing the arcs. + +## Value + +nil + +## Details + +`drawSectorAnnulus` displays a single radial pie sector. It is probably +only useful when called from [radial.pie](radial.pie.md). + +## Author + +Jim Lemon + +## See also + +[radial.pie](radial.pie.md) diff --git a/reference/ehplot-1.png b/reference/ehplot-1.png new file mode 100644 index 0000000..01acc37 Binary files /dev/null and b/reference/ehplot-1.png differ diff --git a/reference/ehplot-2.png b/reference/ehplot-2.png new file mode 100644 index 0000000..3f1688e Binary files /dev/null and b/reference/ehplot-2.png differ diff --git a/reference/ehplot-3.png b/reference/ehplot-3.png new file mode 100644 index 0000000..5e06556 Binary files /dev/null and b/reference/ehplot-3.png differ diff --git a/reference/ehplot-4.png b/reference/ehplot-4.png new file mode 100644 index 0000000..13e1838 Binary files /dev/null and b/reference/ehplot-4.png differ diff --git a/reference/ehplot-5.png b/reference/ehplot-5.png new file mode 100644 index 0000000..d0928e9 Binary files /dev/null and b/reference/ehplot-5.png differ diff --git a/reference/ehplot.html b/reference/ehplot.html new file mode 100644 index 0000000..d73a23c --- /dev/null +++ b/reference/ehplot.html @@ -0,0 +1,149 @@ + +Engelmann-Hecker-Plot - EH-Plot — ehplot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    This R function provides a convenient way to visualize the distribution of + grouped numerical data.

    +
    + +
    +

    Usage

    +
    ehplot(data, groups, intervals=50, offset=0.1, log=FALSE,
    +         median=TRUE, box=FALSE, boxborder="grey50",
    +         xlab="groups", ylab="values", col="black",
    +         add=FALSE, sort=TRUE, ...)
    +
    + +
    +

    Arguments

    +

    +
    data
    +

    Vector of numerical data.

    + +
    groups
    +

    Vector of group names which should have the same length as data.

    + +
    intervals
    +

    The data is splitted into a certain number of intervals. If data + points are in the same interval they are drawn side-by-side.

    + +
    offset
    +

    x-distance between two data points at the same interval.

    + +
    log
    +

    Logarithmic display

    + +
    median
    +

    To show the median of each group. NAs in data are not considered + for calculating the medians.

    + +
    box
    +

    To underlay a boxplot.

    + +
    boxborder
    +

    The color of the boxplot if a boxplot is drawn.

    + +
    xlab
    +

    x-axis label

    + +
    ylab
    +

    y-axis label

    + +
    col
    +

    vector of colors for the datapoints. (recycled as necessary).

    + +
    add
    +

    add this plot to an existing one (i.e. do not call plot.new).

    + +
    sort
    +

    normally, the groups are sorted by name. To keep the order as provided in + the groups-vector, set this to FALSE

    + +
    ...
    +

    additional plot-parameters will be passed to the plot-function

    + + +
    +
    +

    Author

    +

    Robby Engelmann <robby.engelmann@med.uni-rostock.de> and + Michael Hecker <michael.hecker@rocketmail.com>

    +
    + +
    +

    Examples

    +
    data(iris)
    +ehplot(iris$Sepal.Length, iris$Species, intervals=20, cex=1.8, pch=20)
    +
    +ehplot(iris$Sepal.Width, iris$Species, intervals=20, box=TRUE, median=FALSE)
    +#> Warning: Some points are overplotted in group virginica. Please consider using a lower offset-value.
    +
    +ehplot(iris$Petal.Length, iris$Species, pch=17, col="red", log=TRUE)
    +#> Warning: Some points are overplotted in group setosa. Please consider using a lower offset-value.
    +
    +ehplot(iris$Petal.Length, iris$Species, offset=0.06, pch=as.numeric(iris$Species))
    +
    +
    +# Groups don't have to be presorted:
    +rnd <- sample(150)
    +plen <- iris$Petal.Length[rnd]
    +pwid <- abs(rnorm(150, 1.2))
    +spec <- iris$Species[rnd]
    +ehplot(plen, spec, pch=19, cex=pwid, col=rainbow(3, alpha=0.6)[as.numeric(spec)])
    +#> Warning: Some points are overplotted in group setosa. Please consider using a lower offset-value.
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/ehplot.md b/reference/ehplot.md new file mode 100644 index 0000000..b0346f7 --- /dev/null +++ b/reference/ehplot.md @@ -0,0 +1,103 @@ +# Engelmann-Hecker-Plot - EH-Plot + +This R function provides a convenient way to visualize the distribution +of grouped numerical data. + +## Usage + +``` r +ehplot(data, groups, intervals=50, offset=0.1, log=FALSE, + median=TRUE, box=FALSE, boxborder="grey50", + xlab="groups", ylab="values", col="black", + add=FALSE, sort=TRUE, ...) +``` + +## Arguments + +- data: + + Vector of numerical data. + +- groups: + + Vector of group names which should have the same length as data. + +- intervals: + + The data is splitted into a certain number of intervals. If data + points are in the same interval they are drawn side-by-side. + +- offset: + + x-distance between two data points at the same interval. + +- log: + + Logarithmic display + +- median: + + To show the median of each group. NAs in data are not considered for + calculating the medians. + +- box: + + To underlay a boxplot. + +- boxborder: + + The color of the boxplot if a boxplot is drawn. + +- xlab: + + x-axis label + +- ylab: + + y-axis label + +- col: + + vector of colors for the datapoints. (recycled as necessary). + +- add: + + add this plot to an existing one (i.e. do not call plot.new). + +- sort: + + normally, the groups are sorted by name. To keep the order as provided + in the groups-vector, set this to FALSE + +- ...: + + additional plot-parameters will be passed to the plot-function + +## Author + +Robby Engelmann \ and Michael +Hecker \ + +## Examples + +``` r +data(iris) +ehplot(iris$Sepal.Length, iris$Species, intervals=20, cex=1.8, pch=20) + +ehplot(iris$Sepal.Width, iris$Species, intervals=20, box=TRUE, median=FALSE) +#> Warning: Some points are overplotted in group virginica. Please consider using a lower offset-value. + +ehplot(iris$Petal.Length, iris$Species, pch=17, col="red", log=TRUE) +#> Warning: Some points are overplotted in group setosa. Please consider using a lower offset-value. + +ehplot(iris$Petal.Length, iris$Species, offset=0.06, pch=as.numeric(iris$Species)) + + +# Groups don't have to be presorted: +rnd <- sample(150) +plen <- iris$Petal.Length[rnd] +pwid <- abs(rnorm(150, 1.2)) +spec <- iris$Species[rnd] +ehplot(plen, spec, pch=19, cex=pwid, col=rainbow(3, alpha=0.6)[as.numeric(spec)]) +#> Warning: Some points are overplotted in group setosa. Please consider using a lower offset-value. +``` diff --git a/reference/election-1.png b/reference/election-1.png new file mode 100644 index 0000000..d3437ea Binary files /dev/null and b/reference/election-1.png differ diff --git a/reference/election.html b/reference/election.html new file mode 100644 index 0000000..c1dcf0e --- /dev/null +++ b/reference/election.html @@ -0,0 +1,150 @@ + +Assign party members to seats — election • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Create a layout for an election result in an assembly

    +
    + +
    +

    Usage

    +
    election(seats,result,formula,colours = sample(rainbow(length(counts))))
    +
    + +
    +

    Arguments

    +

    +
    seats
    +

    A data frame of x and y positions, row numbers and angles + (usually the output from the seats function).

    + +
    result
    +

    A data frame with party names and seat counts.

    + +
    formula
    +

    A formula with the party name column on the left and the + count column on the right. Think of the twiddle symbol as "got".

    + +
    colours
    +

    A vector of colours. If missing a random rainbow is used. + This may cause Green parties to show as red.

    + +
    +
    +

    Value

    +

    A data frame including:

    +
    x
    +

    The x positions of the seats to be plotted on semi-circular + arcs.

    + +
    y
    +

    The y positions of the seats to be plotted on semi-circular + arcs.

    + +
    r
    +

    The row numbers for each seat.

    + +
    theta
    +

    The angle of each seat, going from pi to zero radians.

    + +
    party
    +

    The labels for the party holding each seat.

    + +
    colour
    +

    The colour that has been assigned to the party.

    + +
    +
    +

    Author

    +

    Barry Rowlingson

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     # The EU parliament has 751 seats, and Wikipedia currently shows this
    + eu = structure(list(colour = c("#3399FF", "#F0001C", "#0054A5", "#FFD700",
    + "#990000", "#909090", "#32CD32", "#40E0D0"), party = c("EPP",
    + "S and D", "ECR", "ALDE", "GUE-NGL", "Non-Inscrits", "Greens-EFA",
    + "EFDD"), members = c(220L, 191L, 70L, 68L, 52L, 52L, 50L, 48L
    + )), .Names = c("colour", "party", "members"), row.names = c(NA,
    + -8L), class = "data.frame")
    + strasbourg = seats(751, 16)
    + eugov = election(strasbourg, eu, party~members, colours=eu$colour)
    + oldmar<-par(mar=c(2,4,4,2))
    + plot(eugov$x, eugov$y, col=eugov$colour, asp=1, pch=19, ylim=c(-2,2.5),
    +  xlab="", ylab="", main="EU Parliament 2014", axes=FALSE)
    + legend(-0.7,-0.3,eu$party,fill=eu$colour)
    +
    + par(oldmar)
    + # or using ggplot2
    + if (FALSE) { # \dontrun{ 
    +  require(ggplot2)
    +  blank = theme(axis.line=element_blank(),
    +        axis.text.x=element_blank(),
    +  axis.text.y=element_blank(),
    +  axis.ticks=element_blank(),
    +  axis.title.x=element_blank(),
    +  axis.title.y=element_blank(),
    +  panel.background=element_blank(),
    +  panel.border=element_blank(),
    +  panel.grid.major=element_blank(),
    +  panel.grid.minor=element_blank(),
    +  plot.background=element_blank())
    +  ggplot(eugov, aes(x=x,y=y,col=party)) + geom_point() + coord_fixed() + blank
    + } # }
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/election.md b/reference/election.md new file mode 100644 index 0000000..53fe0ea --- /dev/null +++ b/reference/election.md @@ -0,0 +1,102 @@ +# Assign party members to seats + +Create a layout for an election result in an assembly + +## Usage + +``` r +election(seats,result,formula,colours = sample(rainbow(length(counts)))) +``` + +## Arguments + +- seats: + + A data frame of x and y positions, row numbers and angles (usually the + output from the seats function). + +- result: + + A data frame with party names and seat counts. + +- formula: + + A formula with the party name column on the left and the count column + on the right. Think of the twiddle symbol as "got". + +- colours: + + A vector of colours. If missing a random rainbow is used. This may + cause Green parties to show as red. + +## Value + +A data frame including: + +- x: + + The x positions of the seats to be plotted on semi-circular arcs. + +- y: + + The y positions of the seats to be plotted on semi-circular arcs. + +- r: + + The row numbers for each seat. + +- theta: + + The angle of each seat, going from pi to zero radians. + +- party: + + The labels for the party holding each seat. + +- colour: + + The colour that has been assigned to the party. + +## Author + +Barry Rowlingson + +## See also + +[seats](seats.md) + +## Examples + +``` r + # The EU parliament has 751 seats, and Wikipedia currently shows this + eu = structure(list(colour = c("#3399FF", "#F0001C", "#0054A5", "#FFD700", + "#990000", "#909090", "#32CD32", "#40E0D0"), party = c("EPP", + "S and D", "ECR", "ALDE", "GUE-NGL", "Non-Inscrits", "Greens-EFA", + "EFDD"), members = c(220L, 191L, 70L, 68L, 52L, 52L, 50L, 48L + )), .Names = c("colour", "party", "members"), row.names = c(NA, + -8L), class = "data.frame") + strasbourg = seats(751, 16) + eugov = election(strasbourg, eu, party~members, colours=eu$colour) + oldmar<-par(mar=c(2,4,4,2)) + plot(eugov$x, eugov$y, col=eugov$colour, asp=1, pch=19, ylim=c(-2,2.5), + xlab="", ylab="", main="EU Parliament 2014", axes=FALSE) + legend(-0.7,-0.3,eu$party,fill=eu$colour) + + par(oldmar) + # or using ggplot2 + if (FALSE) { # \dontrun{ + require(ggplot2) + blank = theme(axis.line=element_blank(), + axis.text.x=element_blank(), + axis.text.y=element_blank(), + axis.ticks=element_blank(), + axis.title.x=element_blank(), + axis.title.y=element_blank(), + panel.background=element_blank(), + panel.border=element_blank(), + panel.grid.major=element_blank(), + panel.grid.minor=element_blank(), + plot.background=element_blank()) + ggplot(eugov, aes(x=x,y=y,col=party)) + geom_point() + coord_fixed() + blank + } # } +``` diff --git a/reference/emptyspace-1.png b/reference/emptyspace-1.png new file mode 100644 index 0000000..83db5be Binary files /dev/null and b/reference/emptyspace-1.png differ diff --git a/reference/emptyspace.html b/reference/emptyspace.html new file mode 100644 index 0000000..d632954 --- /dev/null +++ b/reference/emptyspace.html @@ -0,0 +1,103 @@ + +Find an empty space on a plot — emptyspace • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Try to find the largest empty rectangle on a plot.

    +
    + +
    +

    Usage

    +
    emptyspace(x,y=NULL)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    x and y positions of the points on the plot.

    + +
    +
    +

    Details

    +

    emptyspace searches the pairs of points on the plot to find + the largest rectangular space within which none of the points lie. + It does not guarantee that the space will be large enough to fit a + legend or text.

    +

    Two alternatives are the largest.empty function in the + Hmisc package and the maxEmptyRect function. While + maxEmptyRect will generally outperform emptyspace, + emptyspace will sometimes find a slightly smaller, but + "squarer" rectangle.

    +
    +
    +

    Value

    +

    The x and y coordinates of the center of the rectangle + found.

    +
    +
    +

    Author

    +

    Ray Brownrigg

    +
    + +
    +

    Examples

    +
     x<-rnorm(100)
    + y<-rnorm(100)
    + plot(x,y,main="Find the empty space",xlab="X",ylab="Y")
    + es<-emptyspace(x,y)
    + # use a transparent background so that any overplotted points are shown
    + boxed.labels(es,labels="Here is the\nempty space",bg="transparent")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/emptyspace.md b/reference/emptyspace.md new file mode 100644 index 0000000..7f6043c --- /dev/null +++ b/reference/emptyspace.md @@ -0,0 +1,46 @@ +# Find an empty space on a plot + +Try to find the largest empty rectangle on a plot. + +## Usage + +``` r +emptyspace(x,y=NULL) +``` + +## Arguments + +- x,y: + + x and y positions of the points on the plot. + +## Details + +`emptyspace` searches the pairs of points on the plot to find the +largest rectangular space within which none of the points lie. It does +not guarantee that the space will be large enough to fit a legend or +text. + +Two alternatives are the `largest.empty` function in the Hmisc package +and the `maxEmptyRect` function. While `maxEmptyRect` will generally +outperform `emptyspace`, `emptyspace` will sometimes find a slightly +smaller, but "squarer" rectangle. + +## Value + +The `x` and `y` coordinates of the center of the rectangle found. + +## Author + +Ray Brownrigg + +## Examples + +``` r + x<-rnorm(100) + y<-rnorm(100) + plot(x,y,main="Find the empty space",xlab="X",ylab="Y") + es<-emptyspace(x,y) + # use a transparent background so that any overplotted points are shown + boxed.labels(es,labels="Here is the\nempty space",bg="transparent") +``` diff --git a/reference/fan.plot-1.png b/reference/fan.plot-1.png new file mode 100644 index 0000000..c8b6cba Binary files /dev/null and b/reference/fan.plot-1.png differ diff --git a/reference/fan.plot.html b/reference/fan.plot.html new file mode 100644 index 0000000..daaa42c --- /dev/null +++ b/reference/fan.plot.html @@ -0,0 +1,151 @@ + +Display a fan plot — fan.plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays numerical values as the arcs of overlapping sectors.

    +
    + +
    +

    Usage

    +
    fan.plot(x,edges=200,radius=1,col=NULL,align.at=NULL,max.span=NULL,
    +  labels=NULL,labelpos=NULL,label.radius=1.2,align="left",shrink=0.02,
    +  main="",ticks=NULL,include.sumx=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    Vector of numbers.

    + +
    edges
    +

    The number of edges with which to draw a circle.

    + +
    radius
    +

    The radius of the sectors.

    + +
    col
    +

    The colors with which to fill the sectors.

    + +
    align.at
    +

    Where to align the sectors (see Details).

    + +
    max.span
    +

    The angle of the maximal sector in radians. The default + is to scale x so that it sums to 2*pi.

    + +
    labels
    +

    Labels placed around the sector arcs.

    + +
    labelpos
    +

    Optional circumferential positions for the labels.

    + +
    label.radius
    +

    How far away from the sectors the labels will + be placed. May be a vector with a radius for each label.

    + +
    align
    +

    Position of the alignment of sectors (see Details).

    + +
    shrink
    +

    How much to shrink each successive sector in user units.

    + +
    main
    +

    Optional title for the plot.

    + +
    ticks
    +

    The number of ticks that would appear if the sectors were on + a pie chart. Default is no ticks, TRUE gives the number of ticks equal to + the integer sum of x, which is fairly sensible if + x is a vector of integers.

    + +
    include.sumx
    +

    Whether to include the sum of all x values + as the largest sector.

    + +
    ...
    +

    Additional arguments passed to polygon.

    + +
    +
    +

    Details

    +

    fan.plot displays sectors much like a pie chart except that the + sectors are overlapped. this allows the angular extents of the sectors to + be visually compared much more accurately by the viewer. Sectors are plotted + from the largest to the smallest, shrinking the radius of each successive + sector.

    +

    When sending output to the postscript device, the resulting image can be + trimmed by changing the values in BoundingBox in the header with a text + editor.

    +
    +
    +

    Value

    +

    The circumferential positions of the labels in radians. These are + returned in order of decreasing size of the values plotted.

    +
    +
    +

    Author

    +

    Jim Lemon, Anupam Tyagi

    +
    + +
    +

    Examples

    +
     iucn.df<-data.frame(area=c("Africa","Asia","Europe","N&C America",
    +  "S America","Oceania"),threatened=c(5994,7737,1987,4716,5097,2093))
    + fan.plot(iucn.df$threatened,max.span=pi,
    +  labels=paste(iucn.df$area,iucn.df$threatened,sep="-"),
    +  main="Threatened species by geographical area (fan.plot)",ticks=276)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/fan.plot.md b/reference/fan.plot.md new file mode 100644 index 0000000..cb1541f --- /dev/null +++ b/reference/fan.plot.md @@ -0,0 +1,109 @@ +# Display a fan plot + +Displays numerical values as the arcs of overlapping sectors. + +## Usage + +``` r +fan.plot(x,edges=200,radius=1,col=NULL,align.at=NULL,max.span=NULL, + labels=NULL,labelpos=NULL,label.radius=1.2,align="left",shrink=0.02, + main="",ticks=NULL,include.sumx=FALSE,...) +``` + +## Arguments + +- x: + + Vector of numbers. + +- edges: + + The number of edges with which to draw a circle. + +- radius: + + The radius of the sectors. + +- col: + + The colors with which to fill the sectors. + +- align.at: + + Where to align the sectors (see Details). + +- max.span: + + The angle of the maximal sector in radians. The default is to scale + `x` so that it sums to 2\*pi. + +- labels: + + Labels placed around the sector arcs. + +- labelpos: + + Optional circumferential positions for the labels. + +- label.radius: + + How far away from the sectors the labels will be placed. May be a + vector with a radius for each label. + +- align: + + Position of the alignment of sectors (see Details). + +- shrink: + + How much to shrink each successive sector in user units. + +- main: + + Optional title for the plot. + +- ticks: + + The number of ticks that would appear if the sectors were on a pie + chart. Default is no ticks, TRUE gives the number of ticks equal to + the integer sum of `x`, which is fairly sensible if `x` is a vector of + integers. + +- include.sumx: + + Whether to include the sum of all `x` values as the largest sector. + +- ...: + + Additional arguments passed to `polygon`. + +## Details + +`fan.plot` displays sectors much like a pie chart except that the +sectors are overlapped. this allows the angular extents of the sectors +to be visually compared much more accurately by the viewer. Sectors are +plotted from the largest to the smallest, shrinking the radius of each +successive sector. + +When sending output to the postscript device, the resulting image can be +trimmed by changing the values in BoundingBox in the header with a text +editor. + +## Value + +The circumferential positions of the labels in radians. These are +returned in order of decreasing size of the values plotted. + +## Author + +Jim Lemon, Anupam Tyagi + +## Examples + +``` r + iucn.df<-data.frame(area=c("Africa","Asia","Europe","N&C America", + "S America","Oceania"),threatened=c(5994,7737,1987,4716,5097,2093)) + fan.plot(iucn.df$threatened,max.span=pi, + labels=paste(iucn.df$area,iucn.df$threatened,sep="-"), + main="Threatened species by geographical area (fan.plot)",ticks=276) +``` diff --git a/reference/feather.plot.html b/reference/feather.plot.html new file mode 100644 index 0000000..d5b1466 --- /dev/null +++ b/reference/feather.plot.html @@ -0,0 +1,147 @@ + +Display vectors along a horizontal reference line — feather.plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays vectors along a line usually representing time or position.

    +
    + +
    +

    Usage

    +
    feather.plot(r,theta,xpos,yref=0,use.arrows=TRUE,
    + col.refline="lightgray",fp.type="s",main="",xlab="",ylab="",
    + xlabels=NULL,...)
    +
    + +
    +

    Arguments

    +

    +
    r
    +

    radii of vectors

    + +
    theta
    +

    direction of vectors in radians

    + +
    xpos
    +

    where to start each vector along the reference line

    + +
    yref
    +

    vertical position to place the reference line

    + +
    use.arrows
    +

    whether to put arrow heads on the ends of the vectors

    + +
    col.refline
    +

    the color of the reference line

    + +
    fp.type
    +

    whether to use "standard" coordinates (begin at the + right and move counterclockwise) or "meteorological" coordinates + (begin at the top and move clockwise) when interpreting the values + of theta

    + +
    main
    +

    the title of the plot

    + +
    xlab
    +

    the label for the reference line

    + +
    ylab
    +

    the label for the vertical axis

    + +
    xlabels
    +

    optional labels for the reference line

    + +
    ...
    +

    additional arguments passed to arrows or segments

    + +
    +
    +

    Details

    +

    This function places vectors of length r and angle theta + along a reference line that may represent time or position or some other + value. The user is responsible for spacing the vectors so that they do + not overlap if this is desired.

    +

    Feather plots are typically wider than high. The user will probably want + to specify a graphics device that doesn't leave lots of blank space above + and below the plot.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon, Eduardo Klein

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     dev.new(width=8,height=3)
    + r<-0.6+rnorm(24)/5
    + theta<-c(seq(15*pi/16,pi/16,length.out=12),
    +  seq(17*pi/16,31*pi/16,length.out=12))
    + feather.plot(r,theta,xlabels=1:24,
    +  main="Standard Coordinates",xlab="Time",ylab="Value")
    + # rearrange theta for meteorological coordinates
    + feather.plot(r,c(theta[19:24],rev(theta[7:18]),theta[1:6]),xlabels=1:24,fp.type="m",
    +  main="Meteorological Coordinates",xlab="Time",ylab="Value")
    + dev.off()
    +#> agg_record_1280622654 
    +#>                     2 
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/feather.plot.md b/reference/feather.plot.md new file mode 100644 index 0000000..c9030d5 --- /dev/null +++ b/reference/feather.plot.md @@ -0,0 +1,103 @@ +# Display vectors along a horizontal reference line + +Displays vectors along a line usually representing time or position. + +## Usage + +``` r +feather.plot(r,theta,xpos,yref=0,use.arrows=TRUE, + col.refline="lightgray",fp.type="s",main="",xlab="",ylab="", + xlabels=NULL,...) +``` + +## Arguments + +- r: + + radii of vectors + +- theta: + + direction of vectors in radians + +- xpos: + + where to start each vector along the reference line + +- yref: + + vertical position to place the reference line + +- use.arrows: + + whether to put arrow heads on the ends of the vectors + +- col.refline: + + the color of the reference line + +- fp.type: + + whether to use "standard" coordinates (begin at the right and move + counterclockwise) or "meteorological" coordinates (begin at the top + and move clockwise) when interpreting the values of `theta` + +- main: + + the title of the plot + +- xlab: + + the label for the reference line + +- ylab: + + the label for the vertical axis + +- xlabels: + + optional labels for the reference line + +- ...: + + additional arguments passed to `arrows` or `segments` + +## Details + +This function places vectors of length `r` and angle `theta` along a +reference line that may represent time or position or some other value. +The user is responsible for spacing the vectors so that they do not +overlap if this is desired. + +Feather plots are typically wider than high. The user will probably want +to specify a graphics device that doesn't leave lots of blank space +above and below the plot. + +## Value + +nil + +## Author + +Jim Lemon, Eduardo Klein + +## See also + +[spread.labels](spread.labels.md) + +## Examples + +``` r + dev.new(width=8,height=3) + r<-0.6+rnorm(24)/5 + theta<-c(seq(15*pi/16,pi/16,length.out=12), + seq(17*pi/16,31*pi/16,length.out=12)) + feather.plot(r,theta,xlabels=1:24, + main="Standard Coordinates",xlab="Time",ylab="Value") + # rearrange theta for meteorological coordinates + feather.plot(r,c(theta[19:24],rev(theta[7:18]),theta[1:6]),xlabels=1:24,fp.type="m", + main="Meteorological Coordinates",xlab="Time",ylab="Value") + dev.off() +#> agg_record_1280622654 +#> 2 +``` diff --git a/reference/fill.corner.html b/reference/fill.corner.html new file mode 100644 index 0000000..788f17e --- /dev/null +++ b/reference/fill.corner.html @@ -0,0 +1,95 @@ + +Fill a "corner" of a matrix with values — fill.corner • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Fills one corner of a matrix with the supplied values, leaving the rest + filled with a default value.

    +
    + +
    +

    Usage

    +
    fill.corner(x,nrow,ncol,na.value=NA)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A vector of values.

    + +
    nrow,ncol
    +

    The number of rows and columns in the matrix to be returned.

    + +
    na.value
    +

    The default value for unfilled cells.

    + +
    +
    +

    Details

    +

    fill.corner creates an nrow by ncol matrix and fills the lower left + corner with the values supplied in x. If there are more values in + x than cells in the matrix, only the first nrow*ncol values will be + inserted.

    +
    +
    +

    Value

    +

    An nrow by ncol matrix containing the values in x.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/fill.corner.md b/reference/fill.corner.md new file mode 100644 index 0000000..ea24355 --- /dev/null +++ b/reference/fill.corner.md @@ -0,0 +1,39 @@ +# Fill a "corner" of a matrix with values + +Fills one corner of a matrix with the supplied values, leaving the rest +filled with a default value. + +## Usage + +``` r +fill.corner(x,nrow,ncol,na.value=NA) +``` + +## Arguments + +- x: + + A vector of values. + +- nrow,ncol: + + The number of rows and columns in the matrix to be returned. + +- na.value: + + The default value for unfilled cells. + +## Details + +`fill.corner` creates an nrow by ncol matrix and fills the lower left +corner with the values supplied in `x`. If there are more values in `x` +than cells in the matrix, only the first nrow\*ncol values will be +inserted. + +## Value + +An nrow by ncol matrix containing the values in `x`. + +## Author + +Jim Lemon diff --git a/reference/find_max_cell.html b/reference/find_max_cell.html new file mode 100644 index 0000000..79ac4ed --- /dev/null +++ b/reference/find_max_cell.html @@ -0,0 +1,88 @@ + +Maximum (or minimum) value cell in a matrix. — find_max_cell • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Find the indices of the maximum value in a matrix.

    +
    + +
    +

    Usage

    +
    find_max_cell(x,max=TRUE)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    a numeric matrix

    + +
    max
    +

    The default is to return the indices of the maximum value(s). + max=FALSE returns those of the minimum.

    + +
    +
    +

    Value

    +

    A list containing the column (x) and row (y) indices.

    +
    +
    +

    Note

    +

    Intended to enable the user to mark cells in color2D.matplot. +Remember to subtract 0.5 from both values to center the mark in the cell.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/find_max_cell.md b/reference/find_max_cell.md new file mode 100644 index 0000000..32fc31d --- /dev/null +++ b/reference/find_max_cell.md @@ -0,0 +1,33 @@ +# Maximum (or minimum) value cell in a matrix. + +Find the indices of the maximum value in a matrix. + +## Usage + +``` r +find_max_cell(x,max=TRUE) +``` + +## Arguments + +- x: + + a numeric matrix + +- max: + + The default is to return the indices of the maximum value(s). + `max=FALSE` returns those of the minimum. + +## Value + +A list containing the column (x) and row (y) indices. + +## Note + +Intended to enable the user to mark cells in `color2D.matplot`. Remember +to subtract 0.5 from both values to center the mark in the cell. + +## Author + +Jim Lemon diff --git a/reference/floating.pie-1.png b/reference/floating.pie-1.png new file mode 100644 index 0000000..730423f Binary files /dev/null and b/reference/floating.pie-1.png differ diff --git a/reference/floating.pie-2.png b/reference/floating.pie-2.png new file mode 100644 index 0000000..6b98c9d Binary files /dev/null and b/reference/floating.pie-2.png differ diff --git a/reference/floating.pie.html b/reference/floating.pie.html new file mode 100644 index 0000000..1645642 --- /dev/null +++ b/reference/floating.pie.html @@ -0,0 +1,156 @@ + +Display a floating pie chart — floating.pie • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a pie chart at an arbitrary position on an existing plot

    +
    + +
    +

    Usage

    +
    floating.pie(xpos=0,ypos=0,x,edges=200,radius=1,col=NULL,startpos=0,
    +  shadow=FALSE,shadow.col=c("#ffffff","#cccccc"),explode=0,...)
    +
    + +
    +

    Arguments

    +

    +
    xpos,ypos
    +

    x and y position of the center of the pie chart

    + +
    x
    +

    a numeric vector for which each value will be a sector

    + +
    edges
    +

    the number of lines forming a circle

    + +
    radius
    +

    the radius of the pie in user units

    + +
    col
    +

    the colors of the sectors - defaults to rainbow

    + +
    startpos
    +

    The starting position for drawing sectors in radians.

    + +
    shadow
    +

    Logical - whether to draw a shadow

    + +
    shadow.col
    +

    Colors to use for a shadow.

    + +
    explode
    +

    How much to "explode" one or more of the sectors.

    + +
    ...
    +

    graphical parameters passed to polygon

    + +
    +
    +

    Details

    +

    floating.pie displays a pie chart with an optional shadow on an + existing plot (see polygon.shadow). floating.pie now accepts + NAs or zeros in x, but simply ignores them.

    +

    floating.pie can be useful when multiple pie charts are placed on a + plot overlaying something else, like a map.

    +
    +
    +

    Value

    +

    The bisecting angle of the sectors in radians. Useful for placing + text labels for each sector. If any values in x were zero or NA, + no angle is returned for that value. This means that the user must adjust + the labels accordingly if pie.labels is called.

    +

    If floating.pie is called with no graphics device, it will try to + open one with the appropriate dimensions.

    +

    If pie.labels is called, ensure that the center of the pie chart + and any explode values are the same.

    +
    +
    +

    Note

    +

    As with most pie charts, simplicity is essential. Trying to display a + complicated breakdown of data rarely succeeds.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + + +
    +

    Examples

    +
     plot(1:5,type="n",main="Floating Pie test",xlab="",ylab="",axes=FALSE)
    + box()
    + polygon(c(0,0,5.5,5.5),c(0,3,3,0),border="#44aaff",col="#44aaff")
    + floating.pie(1.7,3,c(2,4,4,2,8),radius=0.5,
    +  col=c("#ff0000","#80ff00","#00ffff","#44bbff","#8000ff"))
    + floating.pie(3.1,3,c(1,4,5,2,8),radius=0.5,
    +  col=c("#ff0000","#80ff00","#00ffff","#44bbff","#8000ff"))
    + floating.pie(4,1.5,c(3,4,6,7),radius=0.5,
    +  col=c("#ff0066","#00cc88","#44bbff","#8000ff"))
    + draw.circle(3.9,2.1,radius=0.04,col="white")
    + draw.circle(3.9,2.1,radius=0.04,col="white")
    + draw.circle(3.9,2.1,radius=0.04,col="white")
    + draw.circle(4,2.3,radius=0.04,col="white")
    + draw.circle(4.07,2.55,radius=0.04,col="white")
    + draw.circle(4.03,2.85,radius=0.04,col="white")
    + text(c(1.7,3.1,4),c(3.7,3.7,3.7),c("Pass","Pass","Fail"))
    +
    + plot(0,xlim=c(-1.5,1.5),ylim=c(-1.5,1.5),type="n",axes=FALSE,
    +  main="Floating pie with minor explosions",xlab="",ylab="")
    + floating.pie(x=1:5,explode=c(0,0.1,0,0.2,0))
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/floating.pie.md b/reference/floating.pie.md new file mode 100644 index 0000000..30f494c --- /dev/null +++ b/reference/floating.pie.md @@ -0,0 +1,113 @@ +# Display a floating pie chart + +Displays a pie chart at an arbitrary position on an existing plot + +## Usage + +``` r +floating.pie(xpos=0,ypos=0,x,edges=200,radius=1,col=NULL,startpos=0, + shadow=FALSE,shadow.col=c("#ffffff","#cccccc"),explode=0,...) +``` + +## Arguments + +- xpos,ypos: + + x and y position of the center of the pie chart + +- x: + + a numeric vector for which each value will be a sector + +- edges: + + the number of lines forming a circle + +- radius: + + the radius of the pie in user units + +- col: + + the colors of the sectors - defaults to `rainbow` + +- startpos: + + The starting position for drawing sectors in radians. + +- shadow: + + Logical - whether to draw a shadow + +- shadow.col: + + Colors to use for a shadow. + +- explode: + + How much to "explode" one or more of the sectors. + +- ...: + + graphical parameters passed to `polygon` + +## Details + +`floating.pie` displays a pie chart with an optional shadow on an +existing plot (see `polygon.shadow`). `floating.pie` now accepts NAs or +zeros in `x`, but simply ignores them. + +`floating.pie` can be useful when multiple pie charts are placed on a +plot overlaying something else, like a map. + +## Value + +The bisecting angle of the sectors in radians. Useful for placing text +labels for each sector. If any values in `x` were zero or NA, no angle +is returned for that value. This means that the user must adjust the +labels accordingly if `pie.labels` is called. + +If `floating.pie` is called with no graphics device, it will try to open +one with the appropriate dimensions. + +If `pie.labels` is called, ensure that the center of the pie chart and +any `explode` values are the same. + +## Note + +As with most pie charts, simplicity is essential. Trying to display a +complicated breakdown of data rarely succeeds. + +## Author + +Jim Lemon + +## See also + +[pie.labels](pie.labels.md), [boxed.labels](boxed.labels.md), +[polygon.shadow](polygon.shadow.md) + +## Examples + +``` r + plot(1:5,type="n",main="Floating Pie test",xlab="",ylab="",axes=FALSE) + box() + polygon(c(0,0,5.5,5.5),c(0,3,3,0),border="#44aaff",col="#44aaff") + floating.pie(1.7,3,c(2,4,4,2,8),radius=0.5, + col=c("#ff0000","#80ff00","#00ffff","#44bbff","#8000ff")) + floating.pie(3.1,3,c(1,4,5,2,8),radius=0.5, + col=c("#ff0000","#80ff00","#00ffff","#44bbff","#8000ff")) + floating.pie(4,1.5,c(3,4,6,7),radius=0.5, + col=c("#ff0066","#00cc88","#44bbff","#8000ff")) + draw.circle(3.9,2.1,radius=0.04,col="white") + draw.circle(3.9,2.1,radius=0.04,col="white") + draw.circle(3.9,2.1,radius=0.04,col="white") + draw.circle(4,2.3,radius=0.04,col="white") + draw.circle(4.07,2.55,radius=0.04,col="white") + draw.circle(4.03,2.85,radius=0.04,col="white") + text(c(1.7,3.1,4),c(3.7,3.7,3.7),c("Pass","Pass","Fail")) + + plot(0,xlim=c(-1.5,1.5),ylim=c(-1.5,1.5),type="n",axes=FALSE, + main="Floating pie with minor explosions",xlab="",ylab="") + floating.pie(x=1:5,explode=c(0,0.1,0,0.2,0)) +``` diff --git a/reference/fullaxis-1.png b/reference/fullaxis-1.png new file mode 100644 index 0000000..c9e936a Binary files /dev/null and b/reference/fullaxis-1.png differ diff --git a/reference/fullaxis.html b/reference/fullaxis.html new file mode 100644 index 0000000..622f12a --- /dev/null +++ b/reference/fullaxis.html @@ -0,0 +1,146 @@ + +Add an axis with a line to the edge of the plot — fullaxis • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    As axis, but draws a "box" line in the same color as the axis.

    +
    + +
    +

    Usage

    +
    fullaxis(side=1,at=NULL,labels=TRUE,line=NA,pos=NA,outer=FALSE,
    + font=NA,lty="solid",lwd=1,lwd.ticks=lwd,col=NULL,col.ticks=NULL,
    + hadj=NA,padj=NA,...)
    +
    + +
    +

    Arguments

    +

    +
    side
    +

    The side of the plot to draw the axis

    + +
    at
    +

    Optional positions in user units for the tick marks.

    + +
    labels
    +

    Optional labels for the tick marks.

    + +
    line
    +

    Optional line into the margin.

    + +
    pos
    +

    Optional position in user units for the axis. Defaults to the edge.

    + +
    outer
    +

    Whether to use the outer margin as for axis.

    + +
    font
    +

    Font for the labels.

    + +
    lty
    +

    Line type.

    + +
    lwd
    +

    Line width for the axis.

    + +
    lwd.ticks
    +

    Line width for the ticks.

    + +
    col
    +

    color for the axis and tick marks. See Details for label color.

    + +
    col.ticks
    +

    Color for the tick marks if different from the axis.

    + +
    hadj,padj
    +

    Justification for the labels. See axis.

    + +
    ...
    +

    Further arguments passed to axis.

    + +
    +
    +

    Details

    +

    fullaxis draws a line to the edges of the plot and then calls + axis to draw an axis. fullaxis is mainly useful for drawing a + colored axis on a boxed plot. In order to get the tick labels the same color as + the axis and ticks, pass the col.axis argument (as part of ...) as well + as col. See the example for some useful tips.

    +
    +
    +

    Value

    +

    The positions of the tick marks in user units.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     plot(runif(20,-1,1),runif(20,-1,1),xlim=c(-1,1.5),main="Demo of fullaxis",
    +  xlab="X",ylab="Y",axes=FALSE)
    + fullaxis(1,col="red",col.axis="red")
    + fullaxis(2,col="blue",col.axis="blue")
    + fullaxis(4,at=c(-0.5,0,0.5),labels=c("Negative","Zero","Positive"),pos=1.2,
    +  col="green",las=1)
    + # add a top line to complete the "box"
    + xylim<-par("usr")
    + segments(xylim[1],xylim[4],xylim[2],xylim[4])
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/fullaxis.md b/reference/fullaxis.md new file mode 100644 index 0000000..d23bbf1 --- /dev/null +++ b/reference/fullaxis.md @@ -0,0 +1,103 @@ +# Add an axis with a line to the edge of the plot + +As `axis`, but draws a "box" line in the same color as the axis. + +## Usage + +``` r +fullaxis(side=1,at=NULL,labels=TRUE,line=NA,pos=NA,outer=FALSE, + font=NA,lty="solid",lwd=1,lwd.ticks=lwd,col=NULL,col.ticks=NULL, + hadj=NA,padj=NA,...) +``` + +## Arguments + +- side: + + The side of the plot to draw the axis + +- at: + + Optional positions in user units for the tick marks. + +- labels: + + Optional labels for the tick marks. + +- line: + + Optional line into the margin. + +- pos: + + Optional position in user units for the axis. Defaults to the edge. + +- outer: + + Whether to use the outer margin as for `axis`. + +- font: + + Font for the labels. + +- lty: + + Line type. + +- lwd: + + Line width for the axis. + +- lwd.ticks: + + Line width for the ticks. + +- col: + + color for the axis and tick marks. See Details for label color. + +- col.ticks: + + Color for the tick marks if different from the axis. + +- hadj,padj: + + Justification for the labels. See `axis`. + +- ...: + + Further arguments passed to `axis`. + +## Details + +`fullaxis` draws a line to the edges of the plot and then calls `axis` +to draw an axis. `fullaxis` is mainly useful for drawing a colored axis +on a boxed plot. In order to get the tick labels the same color as the +axis and ticks, pass the `col.axis` argument (as part of ...) as well as +`col`. See the example for some useful tips. + +## Value + +The positions of the tick marks in user units. + +## Author + +Jim Lemon + +## See also + +[axis](https://rdrr.io/r/graphics/axis.html) + +## Examples + +``` r + plot(runif(20,-1,1),runif(20,-1,1),xlim=c(-1,1.5),main="Demo of fullaxis", + xlab="X",ylab="Y",axes=FALSE) + fullaxis(1,col="red",col.axis="red") + fullaxis(2,col="blue",col.axis="blue") + fullaxis(4,at=c(-0.5,0,0.5),labels=c("Negative","Zero","Positive"),pos=1.2, + col="green",las=1) + # add a top line to complete the "box" + xylim<-par("usr") + segments(xylim[1],xylim[4],xylim[2],xylim[4]) +``` diff --git a/reference/gantt.chart-1.png b/reference/gantt.chart-1.png new file mode 100644 index 0000000..d704a9e Binary files /dev/null and b/reference/gantt.chart-1.png differ diff --git a/reference/gantt.chart-2.png b/reference/gantt.chart-2.png new file mode 100644 index 0000000..35c45a6 Binary files /dev/null and b/reference/gantt.chart-2.png differ diff --git a/reference/gantt.chart-3.png b/reference/gantt.chart-3.png new file mode 100644 index 0000000..f49913e Binary files /dev/null and b/reference/gantt.chart-3.png differ diff --git a/reference/gantt.chart-4.png b/reference/gantt.chart-4.png new file mode 100644 index 0000000..c2fb2a7 Binary files /dev/null and b/reference/gantt.chart-4.png differ diff --git a/reference/gantt.chart-5.png b/reference/gantt.chart-5.png new file mode 100644 index 0000000..2a147a0 Binary files /dev/null and b/reference/gantt.chart-5.png differ diff --git a/reference/gantt.chart.html b/reference/gantt.chart.html new file mode 100644 index 0000000..185a740 --- /dev/null +++ b/reference/gantt.chart.html @@ -0,0 +1,215 @@ + +Display a Gantt chart — gantt.chart • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a Gantt chart with priority coloring

    +
    + +
    +

    Usage

    +
    gantt.chart(x=NULL,format="%Y/%m/%d",xlim=NULL,taskcolors=NULL,
    +  priority.legend=FALSE,vgridpos=NULL,vgridlab=NULL,
    +  vgrid.format="%Y/%m/%d",
    +  half.height=0.25,hgrid=FALSE,main="",xlab="",cylindrical=FALSE,
    +  label.cex=1,border.col=NA,priority.label="Priorities",
    +  priority.extremes=c("High","Low"),time.axis=3)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    a list of task labels, start/end times and task priorities + as returned by get.gantt.info. If this is not present, + get.gantt.info will be called.

    + +
    format
    +

    the format to be used in entering dates/times + (see strptime).

    + +
    xlim
    +

    the horizontal limits of the plot (see Details).

    + +
    taskcolors
    +

    a vector of colors used to illustrate task priority.

    + +
    priority.legend
    +

    Whether to display a priority color legend.

    + +
    vgridpos
    +

    optional positions of the vertical grid lines.

    + +
    vgridlab
    +

    optional labels for the vertical grid lines.

    + +
    vgrid.format
    +

    format for the vertical grid labels.

    + +
    half.height
    +

    the proportion of the spacing between task bars that + will be filled by the bar on each side - 0.5 will leave no space.

    + +
    hgrid
    +

    logical - whether to display grid lines between the bars.

    + +
    main
    +

    the title of the plot - note that this is actually displayed + using mtext.

    + +
    xlab
    +

    horizontal axis label - usually suppressed.

    + +
    cylindrical
    +

    Whether to give the bars a cylindrical appearance.

    + +
    label.cex
    +

    Relative size for the task labels at the left side.

    + +
    border.col
    +

    The color for an optional border for the bars (NA=none).

    + +
    priority.label
    +

    Label for the priority color legend.

    + +
    priority.extremes
    +

    Labels for each end of the priority color legend.

    + +
    time.axis
    +

    Where to place the time axis labels.

    + +
    +
    +

    Value

    +

    The list used to create the chart - see get.gantt.info for + details. This can be saved and reused rather than manually entering the + information each time the chart is displayed.

    +
    +
    +

    Details

    +

    Because the "time" axis is calculated using POSIXct values, the + values passed as xlim must also be POSIXct. See the second plot + in the examples.

    +

    If task priority colors are not wanted, set taskcolors to a single + value to suppress the coloring. If this is not done, rainbow will + be called to generate a different color for each task. If colors other than + rainbow are wanted, remember to pass enough colors for one to the + lowest (highest numerically) priority.

    +

    There can now be more than one time interval for each task. If there is, + more than one bar will be displayed for each interval, which may not be a + task at all, but rather intervals related to the labels. Colors can be + specified for labels or intervals and if there are not as many colors as + intervals, the first "number of unique labels" colors will be assigned to + each unique label. This should make every bar for each label the + same color, but be aware that the colors will be distributed in alphabetical + order of the entity labels. If there are at least as many taskcolors as intervals, + they will be assigned to intervals in the order of the taskcolors vector. + The examples should make this clearer.

    +

    Since gantt.chart can be used to display things other than prioritized + tasks, the labels for the priority legend can now be specified.

    +
    +
    +

    Author

    +

    Jim Lemon (original by Scott Waichler - features by Ulrike Gromping - + added label colors by Nicolas Immelman)

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     Ymd.format<-"%Y/%m/%d"
    + gantt.info<-list(labels=
    +  c("First task","Second task","Third task","Fourth task","Fifth task"),
    +  starts=
    +  as.POSIXct(strptime(
    +  c("2004/01/01","2004/02/02","2004/03/03","2004/05/05","2004/09/09"),
    +  format=Ymd.format)),
    +  ends=
    +  as.POSIXct(strptime(
    +  c("2004/03/03","2004/05/05","2004/05/05","2004/08/08","2004/12/12"),
    +  format=Ymd.format)),
    +  priorities=c(1,2,3,4,5))
    + vgridpos<-as.POSIXct(strptime(c("2004/01/01","2004/02/01","2004/03/01",
    +  "2004/04/01","2004/05/01","2004/06/01","2004/07/01","2004/08/01",
    +  "2004/09/01","2004/10/01","2004/11/01","2004/12/01"),format=Ymd.format))
    + vgridlab<-
    +  c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
    + gantt.chart(gantt.info,main="Calendar date Gantt chart (2004)",
    +  priority.legend=TRUE,vgridpos=vgridpos,vgridlab=vgridlab,hgrid=TRUE)
    +
    + # add a little extra space on the right side
    + gantt.chart(gantt.info,main="Calendar date Gantt chart (2004)",
    + priority.legend=TRUE,vgridpos=vgridpos,vgridlab=vgridlab,hgrid=TRUE,
    + xlim=as.POSIXct(strptime(c("2004/01/01","2004/12/20"),
    + format=Ymd.format)))
    +
    + # if both vgidpos and vgridlab are specified,
    + # starts and ends don't have to be dates
    + info2<-list(labels=c("Jim","Joe","Jim","John","John","Jake","Joe","Jed","Jake"),
    +  starts=c(8.1,8.7,13.0,9.1,11.6,9.0,13.6,9.3,14.2),
    +  ends=c(12.5,12.7,16.5,10.3,15.6,11.7,18.1,18.2,19.0))
    + gantt.chart(info2,vgridlab=8:19,vgridpos=8:19,
    +  main="All bars the same color",taskcolors="lightgray")
    +
    + gantt.chart(info2,vgridlab=8:19,vgridpos=8:19,
    +  main="A color for each label",taskcolors=c(2,3,7,4,8))
    +
    + gantt.chart(info2,vgridlab=8:19,vgridpos=8:19,
    +  main="A color for each interval - with borders",
    +  taskcolors=c(2,3,7,4,8,5,3,6,"purple"),border.col="black")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/gantt.chart.md b/reference/gantt.chart.md new file mode 100644 index 0000000..07135a3 --- /dev/null +++ b/reference/gantt.chart.md @@ -0,0 +1,180 @@ +# Display a Gantt chart + +Displays a Gantt chart with priority coloring + +## Usage + +``` r +gantt.chart(x=NULL,format="%Y/%m/%d",xlim=NULL,taskcolors=NULL, + priority.legend=FALSE,vgridpos=NULL,vgridlab=NULL, + vgrid.format="%Y/%m/%d", + half.height=0.25,hgrid=FALSE,main="",xlab="",cylindrical=FALSE, + label.cex=1,border.col=NA,priority.label="Priorities", + priority.extremes=c("High","Low"),time.axis=3) +``` + +## Arguments + +- x: + + a list of task labels, start/end times and task priorities as returned + by `get.gantt.info`. If this is not present, + [get.gantt.info](get.gantt.info.md) will be called. + +- format: + + the format to be used in entering dates/times (see + [strptime](https://rdrr.io/r/base/strptime.html)). + +- xlim: + + the horizontal limits of the plot (see Details). + +- taskcolors: + + a vector of colors used to illustrate task priority. + +- priority.legend: + + Whether to display a priority color legend. + +- vgridpos: + + optional positions of the vertical grid lines. + +- vgridlab: + + optional labels for the vertical grid lines. + +- vgrid.format: + + format for the vertical grid labels. + +- half.height: + + the proportion of the spacing between task bars that will be filled by + the bar on each side - 0.5 will leave no space. + +- hgrid: + + logical - whether to display grid lines between the bars. + +- main: + + the title of the plot - note that this is actually displayed using + `mtext`. + +- xlab: + + horizontal axis label - usually suppressed. + +- cylindrical: + + Whether to give the bars a cylindrical appearance. + +- label.cex: + + Relative size for the task labels at the left side. + +- border.col: + + The color for an optional border for the bars (NA=none). + +- priority.label: + + Label for the priority color legend. + +- priority.extremes: + + Labels for each end of the priority color legend. + +- time.axis: + + Where to place the time axis labels. + +## Value + +The list used to create the chart - see +[get.gantt.info](get.gantt.info.md) for details. This can be saved and +reused rather than manually entering the information each time the chart +is displayed. + +## Details + +Because the "time" axis is calculated using POSIXct values, the values +passed as `xlim` must also be POSIXct. See the second plot in the +examples. + +If task priority colors are not wanted, set `taskcolors` to a single +value to suppress the coloring. If this is not done, `rainbow` will be +called to generate a different color for each task. If colors other than +`rainbow` are wanted, remember to pass enough colors for one to the +lowest (highest numerically) priority. + +There can now be more than one time interval for each task. If there is, +more than one bar will be displayed for each interval, which may not be +a task at all, but rather intervals related to the labels. Colors can be +specified for labels or intervals and if there are not as many colors as +intervals, the first "number of unique labels" colors will be assigned +to each unique label. This should make every bar for each label the same +color, but be aware that the colors will be distributed in alphabetical +order of the entity labels. If there are at least as many taskcolors as +intervals, they will be assigned to intervals in the order of the +`taskcolors` vector. The examples should make this clearer. + +Since `gantt.chart` can be used to display things other than prioritized +tasks, the labels for the priority legend can now be specified. + +## Author + +Jim Lemon (original by Scott Waichler - features by Ulrike Gromping - +added label colors by Nicolas Immelman) + +## See also + +[get.gantt.info](get.gantt.info.md) + +## Examples + +``` r + Ymd.format<-"%Y/%m/%d" + gantt.info<-list(labels= + c("First task","Second task","Third task","Fourth task","Fifth task"), + starts= + as.POSIXct(strptime( + c("2004/01/01","2004/02/02","2004/03/03","2004/05/05","2004/09/09"), + format=Ymd.format)), + ends= + as.POSIXct(strptime( + c("2004/03/03","2004/05/05","2004/05/05","2004/08/08","2004/12/12"), + format=Ymd.format)), + priorities=c(1,2,3,4,5)) + vgridpos<-as.POSIXct(strptime(c("2004/01/01","2004/02/01","2004/03/01", + "2004/04/01","2004/05/01","2004/06/01","2004/07/01","2004/08/01", + "2004/09/01","2004/10/01","2004/11/01","2004/12/01"),format=Ymd.format)) + vgridlab<- + c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec") + gantt.chart(gantt.info,main="Calendar date Gantt chart (2004)", + priority.legend=TRUE,vgridpos=vgridpos,vgridlab=vgridlab,hgrid=TRUE) + + # add a little extra space on the right side + gantt.chart(gantt.info,main="Calendar date Gantt chart (2004)", + priority.legend=TRUE,vgridpos=vgridpos,vgridlab=vgridlab,hgrid=TRUE, + xlim=as.POSIXct(strptime(c("2004/01/01","2004/12/20"), + format=Ymd.format))) + + # if both vgidpos and vgridlab are specified, + # starts and ends don't have to be dates + info2<-list(labels=c("Jim","Joe","Jim","John","John","Jake","Joe","Jed","Jake"), + starts=c(8.1,8.7,13.0,9.1,11.6,9.0,13.6,9.3,14.2), + ends=c(12.5,12.7,16.5,10.3,15.6,11.7,18.1,18.2,19.0)) + gantt.chart(info2,vgridlab=8:19,vgridpos=8:19, + main="All bars the same color",taskcolors="lightgray") + + gantt.chart(info2,vgridlab=8:19,vgridpos=8:19, + main="A color for each label",taskcolors=c(2,3,7,4,8)) + + gantt.chart(info2,vgridlab=8:19,vgridpos=8:19, + main="A color for each interval - with borders", + taskcolors=c(2,3,7,4,8,5,3,6,"purple"),border.col="black") +``` diff --git a/reference/gap.barplot-1.png b/reference/gap.barplot-1.png new file mode 100644 index 0000000..ed15ae7 Binary files /dev/null and b/reference/gap.barplot-1.png differ diff --git a/reference/gap.barplot-2.png b/reference/gap.barplot-2.png new file mode 100644 index 0000000..b7cf9ae Binary files /dev/null and b/reference/gap.barplot-2.png differ diff --git a/reference/gap.barplot.html b/reference/gap.barplot.html new file mode 100644 index 0000000..406ac6d --- /dev/null +++ b/reference/gap.barplot.html @@ -0,0 +1,143 @@ + +Display a barplot with a gap (missing range) on one axis — gap.barplot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a barplot with a missing range.

    +
    + +
    +

    Usage

    +
    gap.barplot(y,gap,xaxlab,xtics,yaxlab,ytics,xlim=NA,ylim=NA,xlab=NULL,
    +  ylab=NULL,horiz=FALSE,col,...)
    +
    + +
    +

    Arguments

    +

    +
    y
    +

    a vector of data values

    + +
    gap
    +

    the range of values to be left out

    + +
    xaxlab
    +

    labels for the x axis ticks

    + +
    xtics
    +

    position of the x axis ticks

    + +
    yaxlab
    +

    labels for the y axis ticks

    + +
    ytics
    +

    position of the y axis ticks

    + +
    xlim
    +

    Optional x limits for the plot

    + +
    ylim
    +

    optional y limits for the plot

    + +
    xlab
    +

    label for the x axis

    + +
    ylab
    +

    label for the y axis

    + +
    horiz
    +

    whether to have vertical or horizontal bars

    + +
    col
    +

    color(s) in which to plot the values

    + +
    ...
    +

    arguments passed to barplot.

    + +
    +
    +

    Value

    +

    The center positions of the bars.

    +
    +
    +

    Details

    +

    Displays a barplot omitting a range of values on the X or Y axis. Typically + used when there is a relatively large gap in the range of values + represented as bar heights. See axis.break for a brief + discussion of plotting on discontinuous coordinates.

    +

    If the user does not ask for specific y limits, the function will calculate + limits based on the range of the data values. If passing specific limits, + remember to subtract the gap from the upper limit.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    +

    gap.barplot

    +
    + +
    +

    Examples

    +
     twogrp<-c(rnorm(10)+4,rnorm(10)+20)
    + gap.barplot(twogrp,gap=c(8,16),xlab="Index",ytics=c(3,6,17,20),
    +  ylab="Group values",main="Barplot with gap")
    +#> ylim -5.174695 13.64423 
    +
    + gap.barplot(twogrp,gap=c(8,16),xlab="Index",ytics=c(3,6,17,20),
    +  ylab="Group values",horiz=TRUE,main="Horizontal barplot with gap")
    +#> ylim -5.174695 13.64423 
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/gap.barplot.md b/reference/gap.barplot.md new file mode 100644 index 0000000..59ad1ef --- /dev/null +++ b/reference/gap.barplot.md @@ -0,0 +1,100 @@ +# Display a barplot with a gap (missing range) on one axis + +Displays a barplot with a missing range. + +## Usage + +``` r +gap.barplot(y,gap,xaxlab,xtics,yaxlab,ytics,xlim=NA,ylim=NA,xlab=NULL, + ylab=NULL,horiz=FALSE,col,...) +``` + +## Arguments + +- y: + + a vector of data values + +- gap: + + the range of values to be left out + +- xaxlab: + + labels for the x axis ticks + +- xtics: + + position of the x axis ticks + +- yaxlab: + + labels for the y axis ticks + +- ytics: + + position of the y axis ticks + +- xlim: + + Optional x limits for the plot + +- ylim: + + optional y limits for the plot + +- xlab: + + label for the x axis + +- ylab: + + label for the y axis + +- horiz: + + whether to have vertical or horizontal bars + +- col: + + color(s) in which to plot the values + +- ...: + + arguments passed to `barplot`. + +## Value + +The center positions of the bars. + +## Details + +Displays a barplot omitting a range of values on the X or Y axis. +Typically used when there is a relatively large gap in the range of +values represented as bar heights. See [axis.break](axis.break.md) for a +brief discussion of plotting on discontinuous coordinates. + +If the user does not ask for specific y limits, the function will +calculate limits based on the range of the data values. If passing +specific limits, remember to subtract the gap from the upper limit. + +## Author + +Jim Lemon + +## See also + +gap.barplot + +## Examples + +``` r + twogrp<-c(rnorm(10)+4,rnorm(10)+20) + gap.barplot(twogrp,gap=c(8,16),xlab="Index",ytics=c(3,6,17,20), + ylab="Group values",main="Barplot with gap") +#> ylim -5.174695 13.64423 + + gap.barplot(twogrp,gap=c(8,16),xlab="Index",ytics=c(3,6,17,20), + ylab="Group values",horiz=TRUE,main="Horizontal barplot with gap") +#> ylim -5.174695 13.64423 +``` diff --git a/reference/gap.boxplot-1.png b/reference/gap.boxplot-1.png new file mode 100644 index 0000000..e02dd2d Binary files /dev/null and b/reference/gap.boxplot-1.png differ diff --git a/reference/gap.boxplot-2.png b/reference/gap.boxplot-2.png new file mode 100644 index 0000000..527baa8 Binary files /dev/null and b/reference/gap.boxplot-2.png differ diff --git a/reference/gap.boxplot.html b/reference/gap.boxplot.html new file mode 100644 index 0000000..a950f7b --- /dev/null +++ b/reference/gap.boxplot.html @@ -0,0 +1,196 @@ + +Display a boxplot with a gap (missing range) — gap.boxplot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a boxplot with a missing range.

    +
    + +
    +

    Usage

    +
    gap.boxplot(x,...,gap=list(top=c(NA,NA),bottom=c(NA,NA)),
    + range=1.5,width=NULL,varwidth=FALSE,notch=FALSE,outline=TRUE,
    + names,xlim=NA,ylim=NA,plot=TRUE,border=par("fg"),col=NULL,log="",
    + axis.labels=NULL,axes=TRUE,pars=list(boxwex=0.8,staplewex=0.5,outwex=0.5),
    + horizontal=FALSE,add=FALSE,at=NULL,main=NULL,xlab="",ylab="")
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    numeric vector or a list of vectors

    + +
    ...
    +

    arguments passed to boxplot.

    + +
    gap
    +

    the range(s) to be omitted - a list with two components, + top and bottom each specifying a range to omit. The + default range of c(NA,NA) means no omitted range

    + +
    range
    +

    how far to extend the whiskers, (see boxplot)

    + +
    width
    +

    the relative widths of the boxes

    + +
    varwidth
    +

    if TRUE, box widths are proportional to the square roots + of the number of observations

    + +
    notch
    +

    whether to display the confidence intervals for the + median as notches

    + +
    outline
    +

    whether to display outliers

    + +
    names
    +

    optional names to display beneath each boxplot

    + +
    xlim,ylim
    +

    Optional x and y axis limits for the plot.

    + +
    boxwex
    +

    scale factor for box widths

    + +
    staplewex
    +

    staple width proportional to box width

    + +
    outwex
    +

    outlier line width

    + +
    plot
    +

    dummy argument for consistency with boxplot - always + plots

    + +
    border
    +

    optional color(s) for the box lines

    + +
    col
    +

    optional color(s) to fill the boxes

    + +
    log
    +

    whether to use a log scale - currently does nothing

    + +
    axis.labels
    +

    Optional axis labels.

    + +
    axes
    +

    Whether to display axes.

    + +
    pars
    +

    optional parameters for consistency with boxplot

    + +
    horizontal
    +

    whether to plot horizontal boxplots - currently + does nothing

    + +
    add
    +

    whether to add the boxplot(s) to an existing plot - currently + does nothing.

    + +
    at
    +

    optional horizontal locations for the boxplots.

    + +
    main
    +

    a title for the plot.

    + +
    xlab,ylab
    +

    X and Y axis labels.

    + +
    +
    +

    Value

    +

    A list with the same structure as returned by boxplot, except that + the values of elements beyond the gap(s) have their true positions on the + plot rather than the original values. For example, in the second example, + the value returned for the upper staple of the right boxplot is 14 rather + than 20, due to the 6 unit gap.

    +
    +
    +

    Details

    +

    Displays boxplot(s) omitting range(s) of values on the top and/or bottom + of the plot. Typically used when there are outliers far from the boxes. + See boxplot for more detailed descriptions of the + arguments. If the gaps specified include any of the values in the stats + matrix returned from boxplot, the function will exit with an + error message. This prevents generation of NAs in indexing operations, + which would fail anyway. A gap can include part of a box, but it is unlikely + that this would be intended by the user.

    +

    See axis.break for a brief discussion + of plotting on discontinuous coordinates.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     twovec<-list(vec1=c(rnorm(30),-6),vec2=c(sample(1:10,40,TRUE),20))
    + gap.boxplot(twovec,gap=list(top=c(12,18),bottom=c(-5,-3)),
    + main="Show outliers separately")
    +
    + if(dev.interactive()) par(ask=TRUE)
    + gap.boxplot(twovec,gap=list(top=c(12,18),bottom=c(-5,-3)),range=0,
    + main="Include outliers in whiskers")
    +
    + par(ask=FALSE)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/gap.boxplot.md b/reference/gap.boxplot.md new file mode 100644 index 0000000..6cb14b0 --- /dev/null +++ b/reference/gap.boxplot.md @@ -0,0 +1,165 @@ +# Display a boxplot with a gap (missing range) + +Displays a boxplot with a missing range. + +## Usage + +``` r +gap.boxplot(x,...,gap=list(top=c(NA,NA),bottom=c(NA,NA)), + range=1.5,width=NULL,varwidth=FALSE,notch=FALSE,outline=TRUE, + names,xlim=NA,ylim=NA,plot=TRUE,border=par("fg"),col=NULL,log="", + axis.labels=NULL,axes=TRUE,pars=list(boxwex=0.8,staplewex=0.5,outwex=0.5), + horizontal=FALSE,add=FALSE,at=NULL,main=NULL,xlab="",ylab="") +``` + +## Arguments + +- x: + + numeric vector or a list of vectors + +- ...: + + arguments passed to + [boxplot](https://rdrr.io/r/graphics/boxplot.html). + +- gap: + + the range(s) to be omitted - a list with two components, `top` and + `bottom` each specifying a range to omit. The default range of + `c(NA,NA)` means no omitted range + +- range: + + how far to extend the whiskers, (see + [boxplot](https://rdrr.io/r/graphics/boxplot.html)) + +- width: + + the relative widths of the boxes + +- varwidth: + + if TRUE, box widths are proportional to the square roots of the number + of observations + +- notch: + + whether to display the confidence intervals for the median as notches + +- outline: + + whether to display outliers + +- names: + + optional names to display beneath each boxplot + +- xlim,ylim: + + Optional x and y axis limits for the plot. + +- boxwex: + + scale factor for box widths + +- staplewex: + + staple width proportional to box width + +- outwex: + + outlier line width + +- plot: + + dummy argument for consistency with `boxplot` - always plots + +- border: + + optional color(s) for the box lines + +- col: + + optional color(s) to fill the boxes + +- log: + + whether to use a log scale - currently does nothing + +- axis.labels: + + Optional axis labels. + +- axes: + + Whether to display axes. + +- pars: + + optional parameters for consistency with `boxplot` + +- horizontal: + + whether to plot horizontal boxplots - currently does nothing + +- add: + + whether to add the boxplot(s) to an existing plot - currently does + nothing. + +- at: + + optional horizontal locations for the boxplots. + +- main: + + a title for the plot. + +- xlab,ylab: + + X and Y axis labels. + +## Value + +A list with the same structure as returned by `boxplot`, except that the +values of elements beyond the gap(s) have their true positions on the +plot rather than the original values. For example, in the second +example, the value returned for the upper staple of the right boxplot is +14 rather than 20, due to the 6 unit gap. + +## Details + +Displays boxplot(s) omitting range(s) of values on the top and/or bottom +of the plot. Typically used when there are outliers far from the boxes. +See [boxplot](https://rdrr.io/r/graphics/boxplot.html) for more detailed +descriptions of the arguments. If the gaps specified include any of the +values in the `stats` matrix returned from `boxplot`, the function will +exit with an error message. This prevents generation of NAs in indexing +operations, which would fail anyway. A gap can include part of a box, +but it is unlikely that this would be intended by the user. + +See [axis.break](axis.break.md) for a brief discussion of plotting on +discontinuous coordinates. + +## Author + +Jim Lemon + +## See also + +[gap.barplot](gap.barplot.md),[gap.plot](gap.plot.md) + +## Examples + +``` r + twovec<-list(vec1=c(rnorm(30),-6),vec2=c(sample(1:10,40,TRUE),20)) + gap.boxplot(twovec,gap=list(top=c(12,18),bottom=c(-5,-3)), + main="Show outliers separately") + + if(dev.interactive()) par(ask=TRUE) + gap.boxplot(twovec,gap=list(top=c(12,18),bottom=c(-5,-3)),range=0, + main="Include outliers in whiskers") + + par(ask=FALSE) +``` diff --git a/reference/gap.plot-1.png b/reference/gap.plot-1.png new file mode 100644 index 0000000..19d9d73 Binary files /dev/null and b/reference/gap.plot-1.png differ diff --git a/reference/gap.plot-2.png b/reference/gap.plot-2.png new file mode 100644 index 0000000..3b5a135 Binary files /dev/null and b/reference/gap.plot-2.png differ diff --git a/reference/gap.plot-3.png b/reference/gap.plot-3.png new file mode 100644 index 0000000..dd6b91d Binary files /dev/null and b/reference/gap.plot-3.png differ diff --git a/reference/gap.plot-4.png b/reference/gap.plot-4.png new file mode 100644 index 0000000..fd68be2 Binary files /dev/null and b/reference/gap.plot-4.png differ diff --git a/reference/gap.plot.html b/reference/gap.plot.html new file mode 100644 index 0000000..dea7191 --- /dev/null +++ b/reference/gap.plot.html @@ -0,0 +1,202 @@ + +Display a plot with one or two gaps (missing ranges) on one axis — gap.plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a plot with one or two missing ranges on one of the axes.

    +
    + +
    +

    Usage

    +
    gap.plot(x,y,gap,gap.axis="y",
    +         bgcol="white",breakcol="black",brw=0.02,
    +         xlim=range(x),ylim=range(y),xticlab,xtics=NA,yticlab,ytics=NA,
    +         lty=rep(1,length(x)),col=rep(par("col"),length(x)),pch=rep(1,length(x)),
    +         add=FALSE,stax=FALSE,
    +         style="gap",bty=par("bty"),xaxt=par("xaxt"),yaxt=par("yaxt"),...)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    data values

    + +
    gap
    +

    the range(s) of values to be left out

    + +
    gap.axis
    +

    whether the gaps are to be on the x or y axis

    + +
    bgcol
    +

    the color of the plot background

    + +
    breakcol
    +

    the color of the "break" marker

    + +
    brw
    +

    break width relative to plot width

    + +
    xlim,ylim
    +

    the plot limits.

    + +
    xticlab
    +

    labels for the x axis ticks

    + +
    xtics
    +

    position of the x axis ticks

    + +
    yticlab
    +

    labels for the y axis ticks

    + +
    ytics
    +

    position of the y axis ticks

    + +
    lty
    +

    line type(s) to use if there are lines

    + +
    col
    +

    color(s) in which to plot the values

    + +
    pch
    +

    symbols to use in plotting.

    + +
    add
    +

    whether to add values to an existing plot.

    + +
    stax
    +

    whether to call staxlab for staggered axis labels.

    + +
    style
    +

    the style to use for the break; see axis.break

    + +
    bty,xaxt,yaxt
    +

    type of box and axes (see par for details.)

    + +
    ...
    +

    arguments passed to plot and points.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    Displays a plot omitting one or two ranges of values on one axis. + Typically used when there is a relatively large gap or two in the overall + range of one set of values, often because of outliers. The function warns + the user if any values may have been omitted by being in the "gap". See + axis.break for a brief discussion of plotting on + discontinuous coordinates.

    +

    To add more data series to a gap plot, call gap.plot with + add = TRUE. The same gap and gap.axis arguments as + in the initial call must be passed or the data will not be displayed + correctly. Remember to pass an explicit xlim or ylim to + the initial call if the added data exceed the range of the data + initially displayed. Also remember to subtract the width(s) of the gap(s) + if you are passing an explicit xlim or ylim.

    +

    Because the gaps take up some space, it is possible to have a data value + that is just below a gap plotted in the gap. The answer is to make the lower + gap limit a little higher if this is a problem.

    +

    If at least four values are passed in gap, the first four will be + used to calculate two "gaps" in the plot instead of one. The function does + not check whether these values are sensible, so it is quite easy to + ask for a very silly plot.

    +

    The default ticks are usually not ideal, and most users will want to pass + their own tick positions and perhaps labels. Note that lines appears + to use only the first col and lty argument value, so if you + must have lines with different colors and types, use add=TRUE and add + them separately (see the third example for the problem and the solution).

    +
    +
    +

    Author

    +

    Jim Lemon and Ben Bolker (thanks to Zheng Lu for the "add" idea, + and Art Roberts for helping to get the gaps right.)

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     twogrp<-c(rnorm(5)+4,rnorm(5)+20,rnorm(5)+5,rnorm(5)+22)
    + gpcol<-c(2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5)
    + gap.plot(twogrp,gap=c(8,16),xlab="Index",ylab="Group values",
    +  main="Gap on Y axis",col=gpcol)
    +
    + gap.plot(twogrp,rnorm(20),gap=c(8,16),gap.axis="x",xlab="X values",
    +  xtics=c(4,7,17,20),ylab="Y values",main="Gap on X axis with added lines")
    + gap.plot(c(seq(3.5,7.5,by=0.5),seq(16.5,22.5,by=0.5)),
    +  rnorm(22),gap=c(8,16),gap.axis="x",type="l",add=TRUE,col=2,)
    +
    + gap.plot(twogrp,gap=c(8,16,25,35),
    + xlab="X values",ylab="Y values",xlim=c(1,30),ylim=c(0,42),
    + main="Test two gap plot with the lot",xtics=seq(0,30,by=5),
    + ytics=c(4,6,18,20,22,38,40,42),
    + lty=c(rep(1,10),rep(2,10)),
    + pch=c(rep(2,10),rep(3,10)),
    + col=c(rep(2,10),rep(3,10)),
    + type="b")
    + gap.plot(21:30,rnorm(10)+40,gap=c(8,16,25,35),add=TRUE,
    +  lty=rep(3,10),col=rep(4,10),type="l")
    +
    +  
    + # Use non-standard box type and break
    +  gap.plot(twogrp,gap=c(7,17),xlab="Index",ylab="Group values",
    +  main="Gap on Y axis",col=gpcol,bty="L",style="slash",
    +  ytics=pretty(twogrp, 8))
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/gap.plot.md b/reference/gap.plot.md new file mode 100644 index 0000000..c0064c0 --- /dev/null +++ b/reference/gap.plot.md @@ -0,0 +1,171 @@ +# Display a plot with one or two gaps (missing ranges) on one axis + +Displays a plot with one or two missing ranges on one of the axes. + +## Usage + +``` r +gap.plot(x,y,gap,gap.axis="y", + bgcol="white",breakcol="black",brw=0.02, + xlim=range(x),ylim=range(y),xticlab,xtics=NA,yticlab,ytics=NA, + lty=rep(1,length(x)),col=rep(par("col"),length(x)),pch=rep(1,length(x)), + add=FALSE,stax=FALSE, + style="gap",bty=par("bty"),xaxt=par("xaxt"),yaxt=par("yaxt"),...) +``` + +## Arguments + +- x,y: + + data values + +- gap: + + the range(s) of values to be left out + +- gap.axis: + + whether the gaps are to be on the x or y axis + +- bgcol: + + the color of the plot background + +- breakcol: + + the color of the "break" marker + +- brw: + + break width relative to plot width + +- xlim,ylim: + + the plot limits. + +- xticlab: + + labels for the x axis ticks + +- xtics: + + position of the x axis ticks + +- yticlab: + + labels for the y axis ticks + +- ytics: + + position of the y axis ticks + +- lty: + + line type(s) to use if there are lines + +- col: + + color(s) in which to plot the values + +- pch: + + symbols to use in plotting. + +- add: + + whether to add values to an existing plot. + +- stax: + + whether to call staxlab for staggered axis labels. + +- style: + + the style to use for the break; see [`axis.break`](axis.break.md) + +- bty,xaxt,yaxt: + + type of box and axes (see [`par`](https://rdrr.io/r/graphics/par.html) + for details.) + +- ...: + + arguments passed to `plot` and `points`. + +## Value + +nil + +## Details + +Displays a plot omitting one or two ranges of values on one axis. +Typically used when there is a relatively large gap or two in the +overall range of one set of values, often because of outliers. The +function warns the user if any values may have been omitted by being in +the "gap". See [axis.break](axis.break.md) for a brief discussion of +plotting on discontinuous coordinates. + +To add more data series to a gap plot, call `gap.plot` with +`add = TRUE`. The same `gap` and `gap.axis` arguments as in the initial +call must be passed or the data will not be displayed correctly. +Remember to pass an explicit `xlim` or `ylim` to the initial call if the +added data exceed the range of the data initially displayed. Also +remember to subtract the width(s) of the gap(s) if you are passing an +explicit `xlim` or `ylim`. + +Because the gaps take up some space, it is possible to have a data value +that is just below a gap plotted in the gap. The answer is to make the +lower gap limit a little higher if this is a problem. + +If at least four values are passed in `gap`, the first four will be used +to calculate two "gaps" in the plot instead of one. The function does +not check whether these values are sensible, so it is quite easy to ask +for a very silly plot. + +The default ticks are usually not ideal, and most users will want to +pass their own tick positions and perhaps labels. Note that `lines` +appears to use only the first `col` and `lty` argument value, so if you +must have lines with different colors and types, use `add=TRUE` and add +them separately (see the third example for the problem and the +solution). + +## Author + +Jim Lemon and Ben Bolker (thanks to Zheng Lu for the "add" idea, and Art +Roberts for helping to get the gaps right.) + +## See also + +[gap.barplot](gap.barplot.md), [axis.break](axis.break.md), +[do.first](do.first.md) + +## Examples + +``` r + twogrp<-c(rnorm(5)+4,rnorm(5)+20,rnorm(5)+5,rnorm(5)+22) + gpcol<-c(2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5) + gap.plot(twogrp,gap=c(8,16),xlab="Index",ylab="Group values", + main="Gap on Y axis",col=gpcol) + + gap.plot(twogrp,rnorm(20),gap=c(8,16),gap.axis="x",xlab="X values", + xtics=c(4,7,17,20),ylab="Y values",main="Gap on X axis with added lines") + gap.plot(c(seq(3.5,7.5,by=0.5),seq(16.5,22.5,by=0.5)), + rnorm(22),gap=c(8,16),gap.axis="x",type="l",add=TRUE,col=2,) + + gap.plot(twogrp,gap=c(8,16,25,35), + xlab="X values",ylab="Y values",xlim=c(1,30),ylim=c(0,42), + main="Test two gap plot with the lot",xtics=seq(0,30,by=5), + ytics=c(4,6,18,20,22,38,40,42), + lty=c(rep(1,10),rep(2,10)), + pch=c(rep(2,10),rep(3,10)), + col=c(rep(2,10),rep(3,10)), + type="b") + gap.plot(21:30,rnorm(10)+40,gap=c(8,16,25,35),add=TRUE, + lty=rep(3,10),col=rep(4,10),type="l") + + + # Use non-standard box type and break + gap.plot(twogrp,gap=c(7,17),xlab="Index",ylab="Group values", + main="Gap on Y axis",col=gpcol,bty="L",style="slash", + ytics=pretty(twogrp, 8)) +``` diff --git a/reference/gap_barp-1.png b/reference/gap_barp-1.png new file mode 100644 index 0000000..d6a7f5a Binary files /dev/null and b/reference/gap_barp-1.png differ diff --git a/reference/gap_barp-2.png b/reference/gap_barp-2.png new file mode 100644 index 0000000..54d6c28 Binary files /dev/null and b/reference/gap_barp-2.png differ diff --git a/reference/gap_barp.html b/reference/gap_barp.html new file mode 100644 index 0000000..3048ab3 --- /dev/null +++ b/reference/gap_barp.html @@ -0,0 +1,148 @@ + +Display a barplot with a gap (missing range) on one axis — gap_barp • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a barplot with a missing range.

    +
    + +
    +

    Usage

    +
    gap_barp(height,gap,width=0.4,names.arg=names(height),
    + col=NULL,main="",xlab="",ylab="",xlim=NULL,ylim=NULL,x=NULL,
    + height.at=pretty(height),height.lab=NULL,...)
    +
    + +
    +

    Arguments

    +

    +
    height
    +

    a vector of data values

    + +
    gap
    +

    the range of values to be left out

    + +
    width
    +

    the proportion of bar width to bar spacing divided by 2. + width=1 means no spaces between the bars.

    + +
    names.arg
    +

    labels for the bars.

    + +
    col
    +

    color(s) in which to plot the values

    + +
    main
    +

    title for the plot.

    + +
    xlab
    +

    label for the x axis

    + +
    ylab
    +

    label for the y axis

    + +
    xlim
    +

    Optional x limits for the plot

    + +
    ylim
    +

    optional y limits for the plot

    + +
    x
    +

    optional x positions for the bars.

    + +
    height.at
    +

    explicit positions for the y axis ticks

    + +
    height.lab
    +

    explicit labels for the y axis ticks.

    + +
    ...
    +

    arguments passed to barp.

    + +
    +
    +

    Value

    +

    The center positions of the bars.

    +
    +
    +

    Details

    +

    Displays a barplot omitting a range of values on the X or Y axis. Typically + used when there is a relatively large gap in the range of values + represented as bar heights. See axis.break for a brief + discussion of plotting on discontinuous coordinates.

    +

    If the user does not ask for specific y limits, the function will calculate + limits based on the range of the data values. If passing specific limits, + remember to subtract the gap from the upper or lower limit.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     oneout<-c(rnorm(5,sd=5),20,rnorm(5,sd=5))
    + gap_barp(oneout,gap=c(8,16),xlab="Index",height.at=c(-5,0,5,20),
    +  ylab="Group values",main="Barplot with gap above zero")
    +#> Warning: some heights within gap
    +
    + oneout[6]<--20
    + gap_barp(oneout,gap=c(-8,-16),xlab="Index",height.at=c(-20,-5,0,5),
    +  ylab="Group values",main="Barplot with gap below zero")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/gap_barp.md b/reference/gap_barp.md new file mode 100644 index 0000000..d6480e5 --- /dev/null +++ b/reference/gap_barp.md @@ -0,0 +1,107 @@ +# Display a barplot with a gap (missing range) on one axis + +Displays a barplot with a missing range. + +## Usage + +``` r +gap_barp(height,gap,width=0.4,names.arg=names(height), + col=NULL,main="",xlab="",ylab="",xlim=NULL,ylim=NULL,x=NULL, + height.at=pretty(height),height.lab=NULL,...) +``` + +## Arguments + +- height: + + a vector of data values + +- gap: + + the range of values to be left out + +- width: + + the proportion of bar width to bar spacing divided by 2. width=1 means + no spaces between the bars. + +- names.arg: + + labels for the bars. + +- col: + + color(s) in which to plot the values + +- main: + + title for the plot. + +- xlab: + + label for the x axis + +- ylab: + + label for the y axis + +- xlim: + + Optional x limits for the plot + +- ylim: + + optional y limits for the plot + +- x: + + optional x positions for the bars. + +- height.at: + + explicit positions for the y axis ticks + +- height.lab: + + explicit labels for the y axis ticks. + +- ...: + + arguments passed to `barp`. + +## Value + +The center positions of the bars. + +## Details + +Displays a barplot omitting a range of values on the X or Y axis. +Typically used when there is a relatively large gap in the range of +values represented as bar heights. See [axis.break](axis.break.md) for a +brief discussion of plotting on discontinuous coordinates. + +If the user does not ask for specific y limits, the function will +calculate limits based on the range of the data values. If passing +specific limits, remember to subtract the gap from the upper or lower +limit. + +## Author + +Jim Lemon + +## See also + +[barp](barp.md) + +## Examples + +``` r + oneout<-c(rnorm(5,sd=5),20,rnorm(5,sd=5)) + gap_barp(oneout,gap=c(8,16),xlab="Index",height.at=c(-5,0,5,20), + ylab="Group values",main="Barplot with gap above zero") +#> Warning: some heights within gap + + oneout[6]<--20 + gap_barp(oneout,gap=c(-8,-16),xlab="Index",height.at=c(-20,-5,0,5), + ylab="Group values",main="Barplot with gap below zero") +``` diff --git a/reference/get.breaks.html b/reference/get.breaks.html new file mode 100644 index 0000000..16ee5df --- /dev/null +++ b/reference/get.breaks.html @@ -0,0 +1,93 @@ + +Get the breakpoints for a weighted histogram — get.breaks • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Gets the breakpoints for a weighted histogram.

    +
    + +
    +

    Usage

    +
    get.breaks(x,breaks)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A numeric vector.

    + +
    breaks
    +

    Either the name of the function to calculate breakpoints, the + number of categories or a vector of breakpoints.

    + +
    +
    +

    Details

    +

    get.breaks either calls the same functions as hist to get + breakpoints or calculates a given number or just returns breaks + if they are already specified.

    +
    +
    +

    Value

    +

    A vector of breakpoints.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/get.breaks.md b/reference/get.breaks.md new file mode 100644 index 0000000..d530dc1 --- /dev/null +++ b/reference/get.breaks.md @@ -0,0 +1,38 @@ +# Get the breakpoints for a weighted histogram + +Gets the breakpoints for a weighted histogram. + +## Usage + +``` r +get.breaks(x,breaks) +``` + +## Arguments + +- x: + + A numeric vector. + +- breaks: + + Either the name of the function to calculate breakpoints, the number + of categories or a vector of breakpoints. + +## Details + +`get.breaks` either calls the same functions as `hist` to get +breakpoints or calculates a given number or just returns `breaks` if +they are already specified. + +## Value + +A vector of breakpoints. + +## Author + +Jim Lemon + +## See also + +[hist](https://rdrr.io/r/graphics/hist.html) diff --git a/reference/get.gantt.info.html b/reference/get.gantt.info.html new file mode 100644 index 0000000..317a4d4 --- /dev/null +++ b/reference/get.gantt.info.html @@ -0,0 +1,119 @@ + +Gather the information to create a Gantt chart — get.gantt.info • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Allows the user to enter the information for a Gantt chart.

    +
    + +
    +

    Usage

    +
    get.gantt.info(format="%Y/%m/%d")
    +
    + +
    +

    Arguments

    +

    +
    format
    +

    the format to be used in entering dates/times. Defaults to + YYYY/mm/dd. See strptime for various date/time formats.

    + +
    +
    +

    Value

    +

    The list used to create the chart. Elements are:

    +
    labels
    +

    The task labels to be displayed at the left of the chart.

    + +
    starts,ends
    +

    The task starts/ends as POSIXct dates/times.

    + +
    priorities
    +

    Task priorities as integers in the range 1 to 10. + There can be less than 10 levels of priority, but if priorities do + not start at 1 (assumed to be the highest), the default priority colors + will be calculated from 1.

    + +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     cat("Enter task times using HH:MM (hour:minute) format\n")
    +#> Enter task times using HH:MM (hour:minute) format
    + get.gantt.info("%H:%M")
    +#> Enter the label, start and finish time for each task.
    +#> Default format for time is year/month/day e.g. 2005/2/22
    +#> Enter a blank label to end.
    +#> Task label - 
    +#> $labels
    +#> [1] NA
    +#> 
    +#> $starts
    +#> [1] NA
    +#> 
    +#> $ends
    +#> [1] NA
    +#> 
    +#> $priorities
    +#> [1] NA
    +#> 
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/get.gantt.info.md b/reference/get.gantt.info.md new file mode 100644 index 0000000..2d6e657 --- /dev/null +++ b/reference/get.gantt.info.md @@ -0,0 +1,68 @@ +# Gather the information to create a Gantt chart + +Allows the user to enter the information for a Gantt chart. + +## Usage + +``` r +get.gantt.info(format="%Y/%m/%d") +``` + +## Arguments + +- format: + + the format to be used in entering dates/times. Defaults to YYYY/mm/dd. + See [strptime](https://rdrr.io/r/base/strptime.html) for various + date/time formats. + +## Value + +The list used to create the chart. Elements are: + +- labels: + + The task labels to be displayed at the left of the chart. + +- starts,ends: + + The task starts/ends as POSIXct dates/times. + +- priorities: + + Task priorities as integers in the range 1 to 10. There can be less + than 10 levels of priority, but if priorities do not start at 1 + (assumed to be the highest), the default priority colors will be + calculated from 1. + +## Author + +Jim Lemon + +## See also + +[gantt.chart](gantt.chart.md) + +## Examples + +``` r + cat("Enter task times using HH:MM (hour:minute) format\n") +#> Enter task times using HH:MM (hour:minute) format + get.gantt.info("%H:%M") +#> Enter the label, start and finish time for each task. +#> Default format for time is year/month/day e.g. 2005/2/22 +#> Enter a blank label to end. +#> Task label - +#> $labels +#> [1] NA +#> +#> $starts +#> [1] NA +#> +#> $ends +#> [1] NA +#> +#> $priorities +#> [1] NA +#> +``` diff --git a/reference/get.segs.html b/reference/get.segs.html new file mode 100644 index 0000000..bb529b4 --- /dev/null +++ b/reference/get.segs.html @@ -0,0 +1,103 @@ + +Calculate the midpoints and limits for a centipede plot — get.segs • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Calculates midpoints and limits for a list or data frame for use with + centipede.plot.

    +
    + +
    +

    Usage

    +
    get.segs(x,mct="mean",lower.limit="std.error",upper.limit=lower.limit)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    a list or data frame.

    + +
    mct
    +

    The name of the function to calculate midpoints.

    + +
    lower.limit,upper.limit
    +

    The names of the function(s) to calculate + lower and upper limits.

    + +
    +
    +

    Details

    +

    get.segs calls the functions whose names are passed to calculate + midpoints and limits for each list element or data frame column. The + user can define special functions for the central and dispersion measures + if desired.

    +
    +
    +

    Value

    +

    A matrix with four rows and as many columns as were in the object + x. The first row contains the midpoint values, the second and third + the lower and upper limit values respectively and the fourth row the number + of valid observations in the columns.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/get.segs.md b/reference/get.segs.md new file mode 100644 index 0000000..2f1b354 --- /dev/null +++ b/reference/get.segs.md @@ -0,0 +1,46 @@ +# Calculate the midpoints and limits for a centipede plot + +Calculates midpoints and limits for a list or data frame for use with +centipede.plot. + +## Usage + +``` r +get.segs(x,mct="mean",lower.limit="std.error",upper.limit=lower.limit) +``` + +## Arguments + +- x: + + a list or data frame. + +- mct: + + The name of the function to calculate midpoints. + +- lower.limit,upper.limit: + + The names of the function(s) to calculate lower and upper limits. + +## Details + +`get.segs` calls the functions whose names are passed to calculate +midpoints and limits for each list element or data frame column. The +user can define special functions for the central and dispersion +measures if desired. + +## Value + +A matrix with four rows and as many columns as were in the object `x`. +The first row contains the midpoint values, the second and third the +lower and upper limit values respectively and the fourth row the number +of valid observations in the columns. + +## Author + +Jim Lemon + +## See also + +[centipede.plot](centipede.plot.md) diff --git a/reference/get.soil.texture.html b/reference/get.soil.texture.html new file mode 100644 index 0000000..4158fc8 --- /dev/null +++ b/reference/get.soil.texture.html @@ -0,0 +1,104 @@ + +Enter soil texture data — get.soil.texture • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    get.soil.texture calls get.triprop to allow the user to + enter soil textures as the proportions or percentages of three + components, sand, silt and clay.

    +
    + +
    +

    Usage

    +
    get.soil.texture(use.percentages=FALSE,cnames=c("sand","silt","clay"))
    +
    + +
    +

    Arguments

    +

    +
    use.percentages
    +

    Logical - whether to treat the entries as + percentages and scale to proportions.

    + +
    cnames
    +

    column names for the resulting three column matrix.

    + +
    +
    +

    Value

    +

    A matrix of the components of one or more soil samples.

    +
    +
    +

    Author

    +

    Sander Oom and Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     if(dev.interactive()) {
    +  newsp<-get.soil.texture()
    +  # show the soil triangle
    +  soil.texture()
    +  # now plot the observations
    +  show.soil.texture(newsp)
    + }
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/get.soil.texture.md b/reference/get.soil.texture.md new file mode 100644 index 0000000..4bf9726 --- /dev/null +++ b/reference/get.soil.texture.md @@ -0,0 +1,46 @@ +# Enter soil texture data + +`get.soil.texture` calls `get.triprop` to allow the user to enter soil +textures as the proportions or percentages of three components, sand, +silt and clay. + +## Usage + +``` r +get.soil.texture(use.percentages=FALSE,cnames=c("sand","silt","clay")) +``` + +## Arguments + +- use.percentages: + + Logical - whether to treat the entries as percentages and scale to + proportions. + +- cnames: + + column names for the resulting three column matrix. + +## Value + +A matrix of the components of one or more soil samples. + +## Author + +Sander Oom and Jim Lemon + +## See also + +[soil.texture](soil.texture.md),[get.triprop](get.triprop.md) + +## Examples + +``` r + if(dev.interactive()) { + newsp<-get.soil.texture() + # show the soil triangle + soil.texture() + # now plot the observations + show.soil.texture(newsp) + } +``` diff --git a/reference/get.tablepos.html b/reference/get.tablepos.html new file mode 100644 index 0000000..62841be --- /dev/null +++ b/reference/get.tablepos.html @@ -0,0 +1,105 @@ + +Get the position for a legend or table — get.tablepos • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Gets the x and y positions and justification for a legend or table in + user units from the string descriptors like "top".

    +
    + +
    +

    Usage

    +
    get.tablepos(x)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A valid position descriptor like "top".

    + +
    +
    +

    Details

    +

    get.tablepos checks for one of the nine valid position descriptors:

    +

    topleft, top, topright, left, center, right, bottomleft, bottom and bottomright.

    +

    If none of these descriptors are found, it will return the center position + and justification.

    +
    +
    +

    Value

    +

    A list containing:

    +
    x
    +

    x position

    + +
    y
    +

    y position

    + +
    xjust
    +

    x (horizontal) justification

    + +
    yjust
    +

    y (vertical) justification

    + +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/get.tablepos.md b/reference/get.tablepos.md new file mode 100644 index 0000000..dc4176f --- /dev/null +++ b/reference/get.tablepos.md @@ -0,0 +1,54 @@ +# Get the position for a legend or table + +Gets the x and y positions and justification for a legend or table in +user units from the string descriptors like "top". + +## Usage + +``` r +get.tablepos(x) +``` + +## Arguments + +- x: + + A valid position descriptor like "top". + +## Details + +`get.tablepos` checks for one of the nine valid position descriptors: + +topleft, top, topright, left, center, right, bottomleft, bottom and +bottomright. + +If none of these descriptors are found, it will return the center +position and justification. + +## Value + +A list containing: + +- x: + + x position + +- y: + + y position + +- xjust: + + x (horizontal) justification + +- yjust: + + y (vertical) justification + +## Author + +Jim Lemon + +## See also + +[addtable2plot](addtable2plot.md), [legendg](legendg.md) diff --git a/reference/get.triprop.html b/reference/get.triprop.html new file mode 100644 index 0000000..27276bd --- /dev/null +++ b/reference/get.triprop.html @@ -0,0 +1,107 @@ + +Enter three proportion data - usually soil textures — get.triprop • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    get.triprop allows the user to enter triplets of proportions + or percentages of three components such as sand, silt and clay in soils.

    +
    + +
    +

    Usage

    +
    get.triprop(use.percentages=FALSE,cnames=c("1st","2nd","3rd"))
    +
    + +
    +

    Arguments

    +

    +
    use.percentages
    +

    Logical - whether to treat the entries as + percentages and scale to proportions.

    + +
    cnames
    +

    column names for the resulting three column matrix.

    + +
    +
    +

    Details

    +

    The three proportions of each row must sum to 100 or 1 within 1% or + the function will warn the operator.

    +
    +
    +

    Value

    +

    A matrix of the components of one or more observations.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     if(dev.interactive()) {
    +  # get some proportions
    +  newsp<-get.triprop()
    +  # show the triangle
    +  triax.frame(main="Test triax.plot")
    +  # now plot the observations
    +  triax.points(newsp)
    + }
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/get.triprop.md b/reference/get.triprop.md new file mode 100644 index 0000000..a11be98 --- /dev/null +++ b/reference/get.triprop.md @@ -0,0 +1,51 @@ +# Enter three proportion data - usually soil textures + +`get.triprop` allows the user to enter triplets of proportions or +percentages of three components such as sand, silt and clay in soils. + +## Usage + +``` r +get.triprop(use.percentages=FALSE,cnames=c("1st","2nd","3rd")) +``` + +## Arguments + +- use.percentages: + + Logical - whether to treat the entries as percentages and scale to + proportions. + +- cnames: + + column names for the resulting three column matrix. + +## Details + +The three proportions of each row must sum to 100 or 1 within 1% or the +function will warn the operator. + +## Value + +A matrix of the components of one or more observations. + +## Author + +Jim Lemon + +## See also + +[triax.plot](triax.plot.md), [soil.texture](soil.texture.md) + +## Examples + +``` r + if(dev.interactive()) { + # get some proportions + newsp<-get.triprop() + # show the triangle + triax.frame(main="Test triax.plot") + # now plot the observations + triax.points(newsp) + } +``` diff --git a/reference/getFigCtr.html b/reference/getFigCtr.html new file mode 100644 index 0000000..1363e63 --- /dev/null +++ b/reference/getFigCtr.html @@ -0,0 +1,93 @@ + +Get coordinates in the figure region in user units. — getFigCtr • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Calculates the coordinates of a proportional point of the figure + region in user units.

    +
    + +
    +

    Usage

    +
    getFigCtr(pos=c(0.5,0.5))
    +
    + +
    +

    Arguments

    +

    +
    pos
    +

    The proportion of the figure region to find (see Details).

    + +
    +
    +

    Details

    +

    getFigCtr reads parameters about the current plot and calculates the + vertical and horizontal centers of the figure region by default. This is + typically useful for placing a centered title on plots where the left and + right margins are very different.

    +

    By changing pos, any proportional points of the figure region can be + returned. For example, pos=c(0,0) will return the left and bottom + coordinates of the figure region.

    +
    +
    +

    Value

    +

    A two element vector containing the coordinates of the center of the + figure region in user units.

    +
    +
    +

    Author

    +

    Jim Lemon (thanks to Karl Brand for the adjustable coordinates)

    +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/getFigCtr.md b/reference/getFigCtr.md new file mode 100644 index 0000000..bcbc404 --- /dev/null +++ b/reference/getFigCtr.md @@ -0,0 +1,36 @@ +# Get coordinates in the figure region in user units. + +Calculates the coordinates of a proportional point of the figure region +in user units. + +## Usage + +``` r +getFigCtr(pos=c(0.5,0.5)) +``` + +## Arguments + +- pos: + + The proportion of the figure region to find (see Details). + +## Details + +`getFigCtr` reads parameters about the current plot and calculates the +vertical and horizontal centers of the figure region by default. This is +typically useful for placing a centered title on plots where the left +and right margins are very different. + +By changing `pos`, any proportional points of the figure region can be +returned. For example, `pos=c(0,0)` will return the left and bottom +coordinates of the figure region. + +## Value + +A two element vector containing the coordinates of the center of the +figure region in user units. + +## Author + +Jim Lemon (thanks to Karl Brand for the adjustable coordinates) diff --git a/reference/getIntersectList-1.png b/reference/getIntersectList-1.png new file mode 100644 index 0000000..ee63409 Binary files /dev/null and b/reference/getIntersectList-1.png differ diff --git a/reference/getIntersectList.html b/reference/getIntersectList.html new file mode 100644 index 0000000..5f03879 --- /dev/null +++ b/reference/getIntersectList.html @@ -0,0 +1,127 @@ + +Enter a set intersection list — getIntersectList • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Enter the information for a set intersection display.

    +
    + +
    +

    Usage

    +
    getIntersectList(nelem,xnames=NULL,sep="+")
    +
    + +
    +

    Arguments

    +

    +
    nelem
    +

    The number of sets for which the intersections will be displayed.

    + +
    xnames
    +

    The labels for the set intersections. The function creates names + from combinations of the first nelem capital letters if none are + given.

    + +
    sep
    +

    The separator to use when calling paste.

    + +
    +
    +

    Details

    +

    getIntersectList allows the user to manually enter the counts of + set intersections rather than build this information from a matrix of data. + It is probably most useful for producing an intersection diagram when the + counts of the intersections are already known, or when the values are + proportions rather than counts as in the example.

    +

    It is very helpful when there are large numbers of elements, as the + makeIntersectList function runs very slowly.

    +
    +
    +

    Value

    +

    A list of the counts of elements in the set intersections.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + + +
    +

    Examples

    +
     # this example is from a haplotype mapping problem submitted by Mao Jianfeng
    + if (FALSE) { # \dontrun{
    + hapIntList<-
    +  getIntersectList(3,xnames=c("hap.Pd","hap.Pt","hap.Py"))
    + # enter the data as follows:
    + # Number of elements in hap.Pd - 1: 27.586
    + # Number of elements in hap.Pt - 1: 20.689
    + # Number of elements in hap.Py - 1: 31.035
    + # Number of elements in hap.Pd-hap.Pt - 1: 10.345
    + # Number of elements in hap.Pd-hap.Py - 1: 10.345
    + # Number of elements in hap.Pt-hap.Py - 1: 0
    + # Number of elements in hap.Pd-hap.Pt-hap.Py - 1: 0
    + # Total number of elements - 1: 100
    + } # }
    + hapIntList<-structure(list(structure(c(27.586, 20.689, 31.035),
    +  .Names = c("hap.Pd","hap.Pt","hap.Py")),
    +  structure(c(10.345, 10.345, 0),
    +  .Names = c("hap.Pd-hap.Pt","hap.Pd-hap.Py","hap.Pt-hap.Py")),
    +  structure(0, .Names = "hap.Pd-hap.Pt-hap.Py"),100),
    +  class = "intersectList")
    + intersectDiagram(hapIntList)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/getIntersectList.md b/reference/getIntersectList.md new file mode 100644 index 0000000..b5babd4 --- /dev/null +++ b/reference/getIntersectList.md @@ -0,0 +1,74 @@ +# Enter a set intersection list + +Enter the information for a set intersection display. + +## Usage + +``` r +getIntersectList(nelem,xnames=NULL,sep="+") +``` + +## Arguments + +- nelem: + + The number of sets for which the intersections will be displayed. + +- xnames: + + The labels for the set intersections. The function creates names from + combinations of the first `nelem` capital letters if none are given. + +- sep: + + The separator to use when calling `paste`. + +## Details + +`getIntersectList` allows the user to manually enter the counts of set +intersections rather than build this information from a matrix of data. +It is probably most useful for producing an intersection diagram when +the counts of the intersections are already known, or when the values +are proportions rather than counts as in the example. + +It is very helpful when there are large numbers of elements, as the +`makeIntersectList` function runs very slowly. + +## Value + +A list of the counts of elements in the set intersections. + +## Author + +Jim Lemon + +## See also + +[makeIntersectList](makeIntersectList.md), +[intersectDiagram](intersectDiagram.md) + +## Examples + +``` r + # this example is from a haplotype mapping problem submitted by Mao Jianfeng + if (FALSE) { # \dontrun{ + hapIntList<- + getIntersectList(3,xnames=c("hap.Pd","hap.Pt","hap.Py")) + # enter the data as follows: + # Number of elements in hap.Pd - 1: 27.586 + # Number of elements in hap.Pt - 1: 20.689 + # Number of elements in hap.Py - 1: 31.035 + # Number of elements in hap.Pd-hap.Pt - 1: 10.345 + # Number of elements in hap.Pd-hap.Py - 1: 10.345 + # Number of elements in hap.Pt-hap.Py - 1: 0 + # Number of elements in hap.Pd-hap.Pt-hap.Py - 1: 0 + # Total number of elements - 1: 100 + } # } + hapIntList<-structure(list(structure(c(27.586, 20.689, 31.035), + .Names = c("hap.Pd","hap.Pt","hap.Py")), + structure(c(10.345, 10.345, 0), + .Names = c("hap.Pd-hap.Pt","hap.Pd-hap.Py","hap.Pt-hap.Py")), + structure(0, .Names = "hap.Pd-hap.Pt-hap.Py"),100), + class = "intersectList") + intersectDiagram(hapIntList) +``` diff --git a/reference/getMarginWidth-1.png b/reference/getMarginWidth-1.png new file mode 100644 index 0000000..c38f8d7 Binary files /dev/null and b/reference/getMarginWidth-1.png differ diff --git a/reference/getMarginWidth-2.png b/reference/getMarginWidth-2.png new file mode 100644 index 0000000..b33ebfa Binary files /dev/null and b/reference/getMarginWidth-2.png differ diff --git a/reference/getMarginWidth.html b/reference/getMarginWidth.html new file mode 100644 index 0000000..a6a12e2 --- /dev/null +++ b/reference/getMarginWidth.html @@ -0,0 +1,108 @@ + +Find the margin width necessary to fit text or a legend next to a plot — getMarginWidth • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Calculates the margin width necessary to fit text or a legend next to a plot.

    +
    + +
    +

    Usage

    +
    getMarginWidth(side=4,labels,is.legend=FALSE)
    +
    + +
    +

    Arguments

    +

    +
    side
    +

    Which side of the plot (as in axis).

    + +
    labels
    +

    The text to place next to the plot.

    + +
    is.legend
    +

    Whether the text is in a legend or not.

    + +
    +
    +

    Details

    +

    getMarginWidth reads parameters about the current plot and calculates the + left or right (default) margin necessary to fit the strings passed as + labels or a legend containing those strings.

    +
    +
    +

    Value

    +

    A two element list containing the number of margin lines necessary to + fit the text or legend and the horizontal center of the margin in user units.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + +
    +

    Examples

    +
     plot(rnorm(10))
    +
    + newmarinfo<-getMarginWidth(labels=c("Long label","Even longer label"))
    +#> plotprop 0.814 marprop 0.063 plotwidth 9.72 marwidth 2.861766 
    + oldmar<-par("mar")
    + par(mar=c(oldmar[1:3],newmarinfo$newmar))
    + plot(rnorm(10))
    + par(xpd=TRUE)
    + text(rep(newmarinfo$marcenter,2),c(0.5,-0.5),
    +  c("Long label","Even longer label"))
    +
    + par(mar=oldmar,xpd=FALSE)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/getMarginWidth.md b/reference/getMarginWidth.md new file mode 100644 index 0000000..5ffe3d5 --- /dev/null +++ b/reference/getMarginWidth.md @@ -0,0 +1,57 @@ +# Find the margin width necessary to fit text or a legend next to a plot + +Calculates the margin width necessary to fit text or a legend next to a +plot. + +## Usage + +``` r +getMarginWidth(side=4,labels,is.legend=FALSE) +``` + +## Arguments + +- side: + + Which side of the plot (as in axis). + +- labels: + + The text to place next to the plot. + +- is.legend: + + Whether the text is in a legend or not. + +## Details + +`getMarginWidth` reads parameters about the current plot and calculates +the left or right (default) margin necessary to fit the strings passed +as `labels` or a legend containing those strings. + +## Value + +A two element list containing the number of margin lines necessary to +fit the text or legend and the horizontal center of the margin in user +units. + +## Author + +Jim Lemon + +## Examples + +``` r + plot(rnorm(10)) + + newmarinfo<-getMarginWidth(labels=c("Long label","Even longer label")) +#> plotprop 0.814 marprop 0.063 plotwidth 9.72 marwidth 2.861766 + oldmar<-par("mar") + par(mar=c(oldmar[1:3],newmarinfo$newmar)) + plot(rnorm(10)) + par(xpd=TRUE) + text(rep(newmarinfo$marcenter,2),c(0.5,-0.5), + c("Long label","Even longer label")) + + par(mar=oldmar,xpd=FALSE) +``` diff --git a/reference/getYmult.html b/reference/getYmult.html new file mode 100644 index 0000000..74a4c2e --- /dev/null +++ b/reference/getYmult.html @@ -0,0 +1,85 @@ + +Correct for aspect and coordinate ratio — getYmult • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Calculate a multiplication factor for the Y dimension to correct + for unequal plot aspect and coordinate ratios on the current graphics device.

    +
    + +
    +

    Usage

    +
    getYmult()
    +
    + +
    +

    Details

    +

    getYmult retrieves the plot aspect ratio and the coordinate ratio for + the current graphics device, calculates a multiplicative factor to equalize + the X and Y dimensions of a plotted graphic object.

    +
    +
    +

    Value

    +

    The correction factor for the Y dimension.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/getYmult.md b/reference/getYmult.md new file mode 100644 index 0000000..44e43eb --- /dev/null +++ b/reference/getYmult.md @@ -0,0 +1,29 @@ +# Correct for aspect and coordinate ratio + +Calculate a multiplication factor for the Y dimension to correct for +unequal plot aspect and coordinate ratios on the current graphics +device. + +## Usage + +``` r +getYmult() +``` + +## Details + +`getYmult` retrieves the plot aspect ratio and the coordinate ratio for +the current graphics device, calculates a multiplicative factor to +equalize the X and Y dimensions of a plotted graphic object. + +## Value + +The correction factor for the Y dimension. + +## Author + +Jim Lemon + +## See also + +[draw.circle](draw.circle.md) diff --git a/reference/get_axispos3d.html b/reference/get_axispos3d.html new file mode 100644 index 0000000..f695536 --- /dev/null +++ b/reference/get_axispos3d.html @@ -0,0 +1,91 @@ + +Get axis positions on a 3D plot — get_axispos3d • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Calculate the axis positions on a 3D plot.

    +
    + +
    +

    Usage

    +
    get_axispos3d(edge,pmat,at,pos=NULL, dist=0)
    +
    + +
    +

    Arguments

    +

    +
    edge
    +

    which axis to calculate.

    + +
    pmat
    +

    matrix to transform coordinates.

    + +
    at
    +

    position on the axis.

    + +
    pos
    +

    position of the axis relative to the other axes.

    + +
    dist
    +

    Offset of the axis.

    + +
    +
    +

    Value

    +

    A position in 2D coordinates

    +
    +
    +

    Author

    +

    Ben Bolker

    +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/get_axispos3d.md b/reference/get_axispos3d.md new file mode 100644 index 0000000..f4ed83f --- /dev/null +++ b/reference/get_axispos3d.md @@ -0,0 +1,39 @@ +# Get axis positions on a 3D plot + +Calculate the axis positions on a 3D plot. + +## Usage + +``` r +get_axispos3d(edge,pmat,at,pos=NULL, dist=0) +``` + +## Arguments + +- edge: + + which axis to calculate. + +- pmat: + + matrix to transform coordinates. + +- at: + + position on the axis. + +- pos: + + position of the axis relative to the other axes. + +- dist: + + Offset of the axis. + +## Value + +A position in 2D coordinates + +## Author + +Ben Bolker diff --git a/reference/gradient.rect-1.png b/reference/gradient.rect-1.png new file mode 100644 index 0000000..30d6a78 Binary files /dev/null and b/reference/gradient.rect-1.png differ diff --git a/reference/gradient.rect.html b/reference/gradient.rect.html new file mode 100644 index 0000000..c16962e --- /dev/null +++ b/reference/gradient.rect.html @@ -0,0 +1,124 @@ + +Display a rectangle filled with an arbitrary color gradient — gradient.rect • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    gradient.rect draws a rectangle consisting of nslices + subrectangles of the colors in col or those returned by + color.gradient if col is NULL. The rectangle is + 'sliced' in the direction specified by gradient.

    +
    + +
    +

    Usage

    +
    gradient.rect(xleft,ybottom,xright,ytop,reds,greens,blues,col=NULL,
    +  nslices=50,gradient="x",border=par("fg"))
    +
    + +
    +

    Arguments

    +

    +
    xleft,ybottom,xright,ytop
    +

    Positions of the relevant corners + of the desired rectangle, as in rect.

    + +
    reds,greens,blues
    +

    vectors of the values of the color components + either as 0 to 1 or ,if any value is greater than 1, 0 to 255.

    + +
    col
    +

    Vector of colors. If supplied, this takes precedence over + reds, greens, blues and nslices will be set to its length.

    + +
    nslices
    +

    The number of sub-rectangles that will be drawn.

    + +
    gradient
    +

    whether the gradient should be horizontal (x) or vertical.

    + +
    border
    +

    The color of the border around the rectangle (NA for none).

    + +
    +
    +

    Value

    +

    the vector of hexadecimal color values from color.gradient or + col.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + +
    +

    Examples

    +
     # get an empty box
    + plot(0:10,type="n",axes=FALSE)
    + # run across the three primaries
    + gradient.rect(1,0,3,6,reds=c(1,0),
    +  greens=c(seq(0,1,length=10),seq(1,0,length=10)),
    +  blues=c(0,1),gradient="y")
    + # now a "danger gradient"
    + gradient.rect(4,0,6,6,c(seq(0,1,length=10),rep(1,10)),
    +  c(rep(1,10),seq(1,0,length=10)),c(0,0),gradient="y")
    + # now just a smooth gradient across the bar
    + gradient.rect(7,0,9,6,col=smoothColors("red",38,"blue"),border=NA)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/gradient.rect.md b/reference/gradient.rect.md new file mode 100644 index 0000000..c3d0d11 --- /dev/null +++ b/reference/gradient.rect.md @@ -0,0 +1,66 @@ +# Display a rectangle filled with an arbitrary color gradient + +`gradient.rect` draws a rectangle consisting of `nslices` subrectangles +of the colors in `col` or those returned by `color.gradient` if `col` is +NULL. The rectangle is 'sliced' in the direction specified by +`gradient`. + +## Usage + +``` r +gradient.rect(xleft,ybottom,xright,ytop,reds,greens,blues,col=NULL, + nslices=50,gradient="x",border=par("fg")) +``` + +## Arguments + +- xleft,ybottom,xright,ytop: + + Positions of the relevant corners of the desired rectangle, as in + `rect`. + +- reds,greens,blues: + + vectors of the values of the color components either as 0 to 1 or ,if + any value is greater than 1, 0 to 255. + +- col: + + Vector of colors. If supplied, this takes precedence over + `reds, greens, blues` and `nslices` will be set to its length. + +- nslices: + + The number of sub-rectangles that will be drawn. + +- gradient: + + whether the gradient should be horizontal (x) or vertical. + +- border: + + The color of the border around the rectangle (NA for none). + +## Value + +the vector of hexadecimal color values from `color.gradient` or `col`. + +## Author + +Jim Lemon + +## Examples + +``` r + # get an empty box + plot(0:10,type="n",axes=FALSE) + # run across the three primaries + gradient.rect(1,0,3,6,reds=c(1,0), + greens=c(seq(0,1,length=10),seq(1,0,length=10)), + blues=c(0,1),gradient="y") + # now a "danger gradient" + gradient.rect(4,0,6,6,c(seq(0,1,length=10),rep(1,10)), + c(rep(1,10),seq(1,0,length=10)),c(0,0),gradient="y") + # now just a smooth gradient across the bar + gradient.rect(7,0,9,6,col=smoothColors("red",38,"blue"),border=NA) +``` diff --git a/reference/hexagon.html b/reference/hexagon.html new file mode 100644 index 0000000..c919517 --- /dev/null +++ b/reference/hexagon.html @@ -0,0 +1,101 @@ + +Draw a hexagon — hexagon • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Draws a hexagon on the current graphic device

    +
    + +
    +

    Usage

    +
    hexagon(x,y,unitcell=1,col=NA,border="black")
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    x and y position of the bottom left corner of the square that + would pack into the same space as the hexagon.

    + +
    unitcell
    +

    The dimension of the side of the abovementioned square.

    + +
    col
    +

    The color to fill the hexagon - default is no fill.

    + +
    border
    +

    The color of the perimeter of the hexagon.

    + +
    +
    +

    Note

    +

    Draws a hexagon with the same center as a square that would pack into the + same dimensions as the hexagon. That is, given a grid of squares with + alternate rows shifted one half the length of the sides, the hexagons + drawn would be close packed. Its use in the plotrix package is to provide + an alternative unit cell for the color2D.matplot function.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/hexagon.md b/reference/hexagon.md new file mode 100644 index 0000000..a13b983 --- /dev/null +++ b/reference/hexagon.md @@ -0,0 +1,48 @@ +# Draw a hexagon + +Draws a hexagon on the current graphic device + +## Usage + +``` r +hexagon(x,y,unitcell=1,col=NA,border="black") +``` + +## Arguments + +- x,y: + + x and y position of the bottom left corner of the square that would + pack into the same space as the hexagon. + +- unitcell: + + The dimension of the side of the abovementioned square. + +- col: + + The color to fill the hexagon - default is no fill. + +- border: + + The color of the perimeter of the hexagon. + +## Note + +Draws a hexagon with the same center as a square that would pack into +the same dimensions as the hexagon. That is, given a grid of squares +with alternate rows shifted one half the length of the sides, the +hexagons drawn would be close packed. Its use in the plotrix package is +to provide an alternative unit cell for the `color2D.matplot` function. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[color2D.matplot](color2D.matplot.md) diff --git a/reference/histStack-1.png b/reference/histStack-1.png new file mode 100644 index 0000000..3736fe9 Binary files /dev/null and b/reference/histStack-1.png differ diff --git a/reference/histStack-2.png b/reference/histStack-2.png new file mode 100644 index 0000000..b7536f9 Binary files /dev/null and b/reference/histStack-2.png differ diff --git a/reference/histStack-3.png b/reference/histStack-3.png new file mode 100644 index 0000000..0e2d013 Binary files /dev/null and b/reference/histStack-3.png differ diff --git a/reference/histStack.html b/reference/histStack.html new file mode 100644 index 0000000..253ea62 --- /dev/null +++ b/reference/histStack.html @@ -0,0 +1,168 @@ + +Histogram "stacked" by categories — histStack • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Histogram of a quantitative variable with bars that are "stacked" by the + values of a factor variable.

    +
    + +
    +

    Usage

    +
    histStack(x,...)
    +
    + # S3 method for class 'formula'
    +histStack(x,data,breaks="Sturges",col="rainbow",
    +  right=TRUE,main="",xlab=NULL,legend.pos=NULL,cex.legend=0.75,...)
    +
    + # Default S3 method
    +histStack(x,z,breaks="Sturges",col="rainbow",
    +  right=TRUE,main="",xlab=NULL,legend.pos=NULL,cex.legend=0.75,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A vector of quantitative data or a formula of the form x~z + (see z below).

    + +
    z
    +

    A vector of categorical data (a factor) that will define the + “stacks”.

    + +
    data
    +

    A data frame that contains both x and z.

    + +
    breaks
    +

    Breaks to use in categorizing values of x.

    + +
    col
    +

    Either a vector of colors in any legitimate form or a + character string that specifies a function that requires only the length + of the vector as an argument and will return a vector of colors with that + length. (see Details)

    + +
    right
    +

    A logical that indicates whether the bins are right-open + (left-closed; =TRUE) or right-closed (left-open; =FALSE; default).

    + +
    main
    +

    A character string that forms the main title for the plot.

    + +
    xlab
    +

    A character string for labeling the x-axis.

    + +
    legend.pos
    +

    A character string or two numeric values indicating the + position for the stacking legend.

    + +
    cex.legend
    +

    A numeric character expansion value for the legend. + Values less than 1 will make the legend smaller.

    + +
    ...
    +

    Additional arguments sent to the hist function.

    + +
    +
    +

    Details

    +

    histStack displays a “stacked histogram” while using many of + the same arguments as hist(). The argument z will be converted to a + factor with a warning if it is not already a factor.

    +

    The color functions in grDevices (e.g. "gray.colors") should always + be valid when passed as the col argument. Any function that will + return a vector of n colors when called with a single argument + n and that exists in the current environment should work. An error + will occur if length(col)==1 and the value is not a function as described + for col (e.g., col="blue" will result in an error).If fewer + colors than levels of z are passed, they will be recycled.

    +
    +
    +

    Value

    +

    nil. A plot is displayed.

    +
    +
    +

    Note

    +

    This function is currently experimental.

    +
    +
    +

    Author

    +

    Derek Ogle with modifications by Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     set.seed(409)
    + df<-data.frame(len=rnorm(100)+5,
    +  grp=sample(c("A","B","C","D"),100,replace=TRUE))
    + histStack(len~grp,data=df,main="Default (rainbow) colors",
    +  xlab="Length category")
    +#> Warning: z was converted to a factor
    +
    + histStack(len~grp,data=df,col="heat.colors",main="Heat colors",
    +  xlab="Length category",legend.pos="topright")
    +#> Warning: z was converted to a factor
    +
    + histStack(len~grp,data=df,col=2:5,main="Colors by number",
    +  xlab="Length category",legend.pos=c(2.8,18))
    +#> Warning: z was converted to a factor
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/histStack.md b/reference/histStack.md new file mode 100644 index 0000000..7dd26a5 --- /dev/null +++ b/reference/histStack.md @@ -0,0 +1,121 @@ +# Histogram "stacked" by categories + +Histogram of a quantitative variable with bars that are "stacked" by the +values of a factor variable. + +## Usage + +``` r +histStack(x,...) + + # S3 method for class 'formula' +histStack(x,data,breaks="Sturges",col="rainbow", + right=TRUE,main="",xlab=NULL,legend.pos=NULL,cex.legend=0.75,...) + + # Default S3 method +histStack(x,z,breaks="Sturges",col="rainbow", + right=TRUE,main="",xlab=NULL,legend.pos=NULL,cex.legend=0.75,...) +``` + +## Arguments + +- x: + + A vector of quantitative data or a formula of the form x~z (see z + below). + +- z: + + A vector of categorical data (a factor) that will define the “stacks”. + +- data: + + A data frame that contains both x and z. + +- breaks: + + Breaks to use in categorizing values of x. + +- col: + + Either a vector of colors in any legitimate form or a character string + that specifies a function that requires only the length of the vector + as an argument and will return a vector of colors with that length. + (see Details) + +- right: + + A logical that indicates whether the bins are right-open (left-closed; + =TRUE) or right-closed (left-open; =FALSE; default). + +- main: + + A character string that forms the main title for the plot. + +- xlab: + + A character string for labeling the x-axis. + +- legend.pos: + + A character string or two numeric values indicating the position for + the stacking legend. + +- cex.legend: + + A numeric character expansion value for the legend. Values less than 1 + will make the legend smaller. + +- ...: + + Additional arguments sent to the hist function. + +## Details + +`histStack` displays a “stacked histogram” while using many of the same +arguments as hist(). The argument `z` will be converted to a factor with +a warning if it is not already a factor. + +The color functions in grDevices (e.g. "gray.colors") should always be +valid when passed as the `col` argument. Any function that will return a +vector of `n` colors when called with a single argument `n` and that +exists in the current environment should work. An error will occur if +length(col)==1 and the value is not a function as described for `col` +(e.g., `col="blue"` will result in an error).If fewer colors than levels +of `z` are passed, they will be recycled. + +## Value + +nil. A plot is displayed. + +## Note + +This function is currently experimental. + +## Author + +Derek Ogle with modifications by Jim Lemon + +## See also + +[hist](https://rdrr.io/r/graphics/hist.html), +[legend](https://rdrr.io/r/graphics/legend.html) + +## Examples + +``` r + set.seed(409) + df<-data.frame(len=rnorm(100)+5, + grp=sample(c("A","B","C","D"),100,replace=TRUE)) + histStack(len~grp,data=df,main="Default (rainbow) colors", + xlab="Length category") +#> Warning: z was converted to a factor + + histStack(len~grp,data=df,col="heat.colors",main="Heat colors", + xlab="Length category",legend.pos="topright") +#> Warning: z was converted to a factor + + histStack(len~grp,data=df,col=2:5,main="Colors by number", + xlab="Length category",legend.pos=c(2.8,18)) +#> Warning: z was converted to a factor +``` diff --git a/reference/index.html b/reference/index.html new file mode 100644 index 0000000..f5c051d --- /dev/null +++ b/reference/index.html @@ -0,0 +1,1209 @@ + +Package index • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    All functions

    + + + +
    + + + + +
    + + ablineclip() + +
    +
    Add a straight line to a plot
    + +
    + + add.ps() + +
    +
    add p-values from t-tests
    + +
    + + addtable2plot() + +
    +
    Add a table of values to a plot
    + +
    + + arctext() + +
    +
    Display text on a circular arc
    + +
    + + axis.break() + +
    +
    Place a "break" mark on an axis
    + +
    + + axis.mult() + +
    +
    Display an axis with values having a multiplier
    + +
    + + barNest() + +
    +
    Display a nested breakdown of numeric values
    + +
    + + barlabels() + +
    +
    Label the bars on a barplot
    + +
    + + barp() + +
    +
    A bar plotting routine
    + +
    + + battleship.plot() + +
    +
    Display a matrix of values as the widths of stacked rectangles
    + +
    + + bin.wind.records() + +
    +
    Classify wind direction and speed records
    + +
    + + binciW() + +
    +
    Binomial confidence limits
    + +
    + + binciWl() + +
    +
    Lower binomial confidence limit
    + +
    + + binciWu() + +
    +
    Upper binomial confidence limit
    + +
    + + box.heresy() + +
    +
    Display a sort of box plot
    + +
    + + boxed.labels() + +
    +
    Place labels in boxes
    + +
    + + brkdn.plot() + +
    +
    A point/line plotting routine
    + +
    + + brkdnNest() + +
    +
    Perform a nested breakdown of numeric values
    + +
    + + bumpchart() + +
    +
    Display a "bumps" (sequential ranking) chart
    + +
    + + categoryReshape() + +
    +
    Convert object label/attribute label coding.
    + +
    + + centipede.plot() + +
    +
    Display a centipede plot
    + +
    + + clean.args() remove.args() + +
    +
    Remove inappropriate arguments from an argument list
    + +
    + + clock24.plot() + +
    +
    Plot values on a 24 hour "clockface"
    + +
    + + clplot() + +
    +
    Plot lines with colors determined by values.
    + +
    + + cluster.overplot() + +
    +
    Shift overlying points into clusters
    + +
    + + clustered.dotplots() + +
    +
    Display the frequencies of two categories
    + +
    + + color.axis() + +
    +
    Display an axis in a specified color
    + +
    + + color.gradient() + +
    +
    Calculate an arbitrary sequence of colors
    + +
    + + color.id() + +
    +
    Identify closest match to a color
    + +
    + + color.legend() + +
    +
    Legend matching categories or values to colors
    + +
    + + color.scale() + +
    +
    Turn values into colors.
    + +
    + + color.scale.lines() + +
    +
    Line segments with scaled colors
    + +
    + + color2D.matplot() + +
    +
    Display a numeric matrix as color matrix
    + +
    + + corner.label() + +
    +
    Find corner locations and optionally display a label
    + +
    + + count.overplot() + +
    +
    Show overlying points as counts
    + +
    + + cylindrect() + +
    +
    Display an apparent cylinder
    + +
    + + death_reg + +
    +
    Death registrations from 1996 to 2010
    + +
    + + dendroPlot() + +
    +
    Display distributions as dendrites
    + +
    + + densityGrid() + +
    +
    Display a matrix of cell values as symbols.
    + +
    + + diamondplot() + +
    +
    Plot multiple variables as polygons on a radial grid
    + +
    + + dispersion() + +
    +
    Display a measure of dispersion.
    + +
    + + do.first + +
    +
    Execute a graphic function on a plot
    + +
    + + dotplot.mtb() + +
    +
    Minitab style dotplots.
    + +
    + + draw.arc() + +
    +
    Draw arc
    + +
    + + draw.circle() + +
    +
    Draw a circle
    + +
    + + draw.ellipse() + +
    +
    Draw ellipse
    + +
    + + draw.radial.line() + +
    +
    Draw a radial line
    + +
    + + draw.tilted.sector() + +
    +
    Display a 3D pie sector
    + +
    + + drawNestedBars() + +
    +
    Display nested bars
    + +
    + + drawSectorAnnulus() + +
    +
    Display a radial pie sector
    + +
    + + ehplot() + +
    +
    Engelmann-Hecker-Plot - EH-Plot
    + +
    + + election() + +
    +
    Assign party members to seats
    + +
    + + emptyspace() + +
    +
    Find an empty space on a plot
    + +
    + + fan.plot() + +
    +
    Display a fan plot
    + +
    + + feather.plot() + +
    +
    Display vectors along a horizontal reference line
    + +
    + + fill.corner() + +
    +
    Fill a "corner" of a matrix with values
    + +
    + + find_max_cell() + +
    +
    Maximum (or minimum) value cell in a matrix.
    + +
    + + floating.pie() + +
    +
    Display a floating pie chart
    + +
    + + fullaxis() + +
    +
    Add an axis with a line to the edge of the plot
    + +
    + + gantt.chart() + +
    +
    Display a Gantt chart
    + +
    + + gap.barplot() + +
    +
    Display a barplot with a gap (missing range) on one axis
    + +
    + + gap.boxplot() + +
    +
    Display a boxplot with a gap (missing range)
    + +
    + + gap.plot() + +
    +
    Display a plot with one or two gaps (missing ranges) on one axis
    + +
    + + gap_barp() + +
    +
    Display a barplot with a gap (missing range) on one axis
    + +
    + + get.breaks() + +
    +
    Get the breakpoints for a weighted histogram
    + +
    + + get.gantt.info() + +
    +
    Gather the information to create a Gantt chart
    + +
    + + get.segs() + +
    +
    Calculate the midpoints and limits for a centipede plot
    + +
    + + get.soil.texture() + +
    +
    Enter soil texture data
    + +
    + + get.tablepos() + +
    +
    Get the position for a legend or table
    + +
    + + get.triprop() + +
    +
    Enter three proportion data - usually soil textures
    + +
    + + getFigCtr() + +
    +
    Get coordinates in the figure region in user units.
    + +
    + + getIntersectList() + +
    +
    Enter a set intersection list
    + +
    + + getMarginWidth() + +
    +
    Find the margin width necessary to fit text or a legend next to a plot
    + +
    + + getYmult() + +
    +
    Correct for aspect and coordinate ratio
    + +
    + + get_axispos3d() + +
    +
    Get axis positions on a 3D plot
    + +
    + + gradient.rect() + +
    +
    Display a rectangle filled with an arbitrary color gradient
    + +
    + + hexagon() + +
    +
    Draw a hexagon
    + +
    + + histStack() + +
    +
    Histogram "stacked" by categories
    + +
    + + intersectDiagram() + +
    +
    Display set intersections
    + +
    + + jiggle() + +
    +
    Calculate equally spaced values within a range.
    + +
    + + joyPlot() + +
    +
    Display a series of density curves.
    + +
    + + kiteChart() + +
    +
    Magnitude by position chart.
    + +
    + + l2010 + +
    +
    World lightning strike data from 2010
    + +
    + + labbePlot() + +
    +
    Display a L'Abbe plot
    + +
    + + ladderplot() + +
    +
    Ladder Plot
    + +
    + + legendg() + +
    +
    Legend with grouped bars, lines or symbols
    + +
    + + lengthKey() + +
    +
    Key for interpreting lengths in a plot
    + +
    + + makeDensityMatrix() + +
    +
    Compute a matrix of counts from a list of x,y positions
    + +
    + + makeIntersectList() + +
    +
    Count set intersections
    + +
    + + maxEmptyRect() + +
    +
    Find an empty space on a plot
    + +
    + + mtext3d() + +
    +
    Display text in the margins of a 3D plot
    + +
    + + multhist() + +
    +
    Plot a multiple histogram, as a barplot
    + +
    + + multivari() + +
    +
    Function to draw a multivari chart
    + +
    + + multsymbolbox() + +
    +
    Draw boxes filled with symbols
    + +
    + + oz.windrose() + +
    +
    Display an Australian wind rose
    + +
    + + oz.windrose.legend() + +
    +
    Display an Australian wind rose legend
    + +
    + + p2p_arrows() + +
    +
    Draw arrows between points
    + +
    + + panes() + +
    +
    Prepare a "panel" type layout
    + +
    + + pasteCols() + +
    +
    Paste the columns of a matrix together
    + +
    + + paxis3d() + +
    +
    Display text in the margins of a 3D plot
    + +
    + + perspx() + +
    +
    Display perspective plot
    + +
    + + pie.labels() + +
    +
    Place labels on a pie chart
    + +
    + + pie3D() + +
    +
    Display a 3D pie chart
    + +
    + + pie3D.labels() + +
    +
    Display labels on a 3D pie chart
    + +
    + + placeLabels() + +
    +
    Place labels in boxes
    + +
    + + plotCI() + +
    +
    Plot confidence intervals/error bars
    + +
    + + plotH() + +
    +
    Scatterplot with histogram-like bars.
    + +
    + + plot_bg() + +
    +
    Add a background color to a plot
    + +
    + + plotrix-package plotrix + +
    +
    Specialized plots and plotting accessories
    + +
    + + polar.plot() + +
    +
    Plot values on a circular grid of 0 to 360 degrees
    + +
    + + polygon.shadow() + +
    +
    Display a shadow effect for an arbitrary polygon
    + +
    + + print(<brklist>) + +
    +
    Display the output of brkdnNest
    + +
    + + propbrk() + +
    +
    Calculate the proportion of specified values in a vector
    + +
    + + psegments3d() + +
    +
    Draw segments on a 3D plot
    + +
    + + ptext3d() + +
    +
    Display text on a 3D plot
    + +
    + + pyramid.plot() + +
    +
    Pyramid plot
    + +
    + + radial.grid() + +
    +
    Display a radial grid
    + +
    + + radial.pie() + +
    +
    Plot sectors/annuli on a circular grid of 0 to 2*pi radians
    + +
    + + radial.plot() + +
    +
    Plot values on a circular grid of 0 to 2*pi radians
    + +
    + + radial.plot.labels() + +
    +
    Display labels on a circular grid
    + +
    + + radialtext() + +
    +
    Display text in a radial line
    + +
    + + raw.means.plot() raw.means.plot2() + +
    +
    raw.means.plot: Raw-Means Plots for Experimental Designs
    + +
    + + rectFill() + +
    +
    Draw a rectangle filled with symbols
    + +
    + + rescale() + +
    +
    Scale numbers into a new range
    + +
    + + revaxis() + +
    +
    Plot with axis direction(s) reversed
    + +
    + + ruginv() + +
    +
    Add an Inverse Rug to a Plot
    + +
    + + seats() + +
    +
    Arrange N seats in M semicircular rows
    + +
    + + size_n_color() + +
    +
    Display circles with specified size and color
    + +
    + + sizeplot() + +
    +
    Plot with repeated symbols by size
    + +
    + + sizetree() + +
    +
    Display a hierarchical breakdown of disjunct categories
    + +
    + + sliceArray() + +
    +
    Slice an array
    + +
    + + smoothColors() + +
    +
    Build a vector of color values
    + +
    + + soil.texture() + +
    +
    Soil texture triangle plot
    + +
    + + soil.texture.uk() + +
    +
    Soil texture triangle plot using UK conventions
    + +
    + + soils + +
    +
    Soil texture data from 125 soils
    + +
    + + spread.labels() + +
    +
    Spread labels for irregularly spaced values
    + +
    + + spreadout() + +
    +
    Spread out a vector of numbers to a minimum interval
    + +
    + + stackpoly() + +
    +
    Display the columns of a matrix or data frame as stacked polygons
    + +
    + + staircase.plot() + +
    +
    Display a staircase plot
    + +
    + + staircasePlot() + +
    +
    Display a staircase plot
    + +
    + + starPie() + +
    +
    A pie-like graphic object
    + +
    + + staxlab() + +
    +
    Place staggered or angled labels on an axis
    + +
    + + std.error() + +
    +
    Calculate standard error of the mean
    + +
    + + sumbrk() + +
    +
    Count specified values in a vector
    + +
    + + symbolbarplot() + +
    +
    barplot filled with symbols
    + +
    + + symbolbox() + +
    +
    Draw a box filled with symbols
    + +
    + + tab.title() + +
    +
    Display the title of a plot as a colored tab
    + +
    + + taylor.diagram() + +
    +
    Taylor diagram
    + +
    + + textbox() + +
    +
    Add text box
    + +
    + + thigmophobe() + +
    +
    Find the direction away from the closest point
    + +
    + + thigmophobe.labels() + +
    +
    Place labels away from the nearest point
    + +
    + + triax.abline() + +
    +
    Lines for triangle plot
    + +
    + + triax.fill() + +
    +
    Triangle plot fill
    + +
    + + triax.frame() + +
    +
    Triangle plot frame
    + +
    + + triax.plot() + +
    +
    Triangle plot
    + +
    + + triax.points() + +
    +
    Triangle plot points
    + +
    + + tsxpos() + +
    +
    Calculate equispaced x positions.
    + +
    + + twoord.plot() + +
    +
    Plot with two ordinates
    + +
    + + twoord.stackplot() + +
    +
    Multiple (stack) plot with two ordinates
    + +
    + + valid.n() + +
    +
    Find the number of valid (not NA) values
    + +
    + + vectorField() + +
    +
    Display magnitude/direction vectors
    + +
    + + violin_plot() + +
    +
    Display a "violin" plot
    + +
    + + weighted.hist() + +
    +
    Display a weighted histogram
    + +
    + + zoomInPlot() + +
    +
    Display a plot with a rectangular section expanded in an adjacent plot
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/index.md b/reference/index.md new file mode 100644 index 0000000..8ea6c73 --- /dev/null +++ b/reference/index.md @@ -0,0 +1,237 @@ +# Package index + +## All functions + +- [`ablineclip()`](ablineclip.md) : Add a straight line to a plot +- [`add.ps()`](add.ps.md) : add p-values from t-tests +- [`addtable2plot()`](addtable2plot.md) : Add a table of values to a + plot +- [`arctext()`](arctext.md) : Display text on a circular arc +- [`axis.break()`](axis.break.md) : Place a "break" mark on an axis +- [`axis.mult()`](axis.mult.md) : Display an axis with values having a + multiplier +- [`barNest()`](barNest.md) : Display a nested breakdown of numeric + values +- [`barlabels()`](barlabels.md) : Label the bars on a barplot +- [`barp()`](barp.md) : A bar plotting routine +- [`battleship.plot()`](battleship.plot.md) : Display a matrix of values + as the widths of stacked rectangles +- [`bin.wind.records()`](bin.wind.records.md) : Classify wind direction + and speed records +- [`binciW()`](binciW.md) : Binomial confidence limits +- [`binciWl()`](binciWl.md) : Lower binomial confidence limit +- [`binciWu()`](binciWu.md) : Upper binomial confidence limit +- [`box.heresy()`](box.heresy.md) : Display a sort of box plot +- [`boxed.labels()`](boxed.labels.md) : Place labels in boxes +- [`brkdn.plot()`](brkdn.plot.md) : A point/line plotting routine +- [`brkdnNest()`](brkdnNest.md) : Perform a nested breakdown of numeric + values +- [`bumpchart()`](bumpchart.md) : Display a "bumps" (sequential ranking) + chart +- [`categoryReshape()`](categoryReshape.md) : Convert object + label/attribute label coding. +- [`centipede.plot()`](centipede.plot.md) : Display a centipede plot +- [`clean.args()`](clean.args.md) [`remove.args()`](clean.args.md) : + Remove inappropriate arguments from an argument list +- [`clock24.plot()`](clock24.plot.md) : Plot values on a 24 hour + "clockface" +- [`clplot()`](clplot.md) : Plot lines with colors determined by values. +- [`cluster.overplot()`](cluster.overplot.md) : Shift overlying points + into clusters +- [`clustered.dotplots()`](clustered.dotplots.md) : Display the + frequencies of two categories +- [`color.axis()`](color.axis.md) : Display an axis in a specified color +- [`color.gradient()`](color.gradient.md) : Calculate an arbitrary + sequence of colors +- [`color.id()`](color.id.md) : Identify closest match to a color +- [`color.legend()`](color.legend.md) : Legend matching categories or + values to colors +- [`color.scale()`](color.scale.md) : Turn values into colors. +- [`color.scale.lines()`](color.scale.lines.md) : Line segments with + scaled colors +- [`color2D.matplot()`](color2D.matplot.md) : Display a numeric matrix + as color matrix +- [`corner.label()`](corner.label.md) : Find corner locations and + optionally display a label +- [`count.overplot()`](count.overplot.md) : Show overlying points as + counts +- [`cylindrect()`](cylindrect.md) : Display an apparent cylinder +- [`death_reg`](death_reg.md) : Death registrations from 1996 to 2010 +- [`dendroPlot()`](dendroPlot.md) : Display distributions as dendrites +- [`densityGrid()`](densityGrid.md) : Display a matrix of cell values as + symbols. +- [`diamondplot()`](diamondplot.md) : Plot multiple variables as + polygons on a radial grid +- [`dispersion()`](dispersion.md) : Display a measure of dispersion. +- [`do.first`](do.first.md) : Execute a graphic function on a plot +- [`dotplot.mtb()`](dotplot.mtb.md) : Minitab style dotplots. +- [`draw.arc()`](draw.arc.md) : Draw arc +- [`draw.circle()`](draw.circle.md) : Draw a circle +- [`draw.ellipse()`](draw.ellipse.md) : Draw ellipse +- [`draw.radial.line()`](draw.radial.line.md) : Draw a radial line +- [`draw.tilted.sector()`](draw.tilted.sector.md) : Display a 3D pie + sector +- [`drawNestedBars()`](drawNestedBars.md) : Display nested bars +- [`drawSectorAnnulus()`](drawSectorAnnulus.md) : Display a radial pie + sector +- [`ehplot()`](ehplot.md) : Engelmann-Hecker-Plot - EH-Plot +- [`election()`](election.md) : Assign party members to seats +- [`emptyspace()`](emptyspace.md) : Find an empty space on a plot +- [`fan.plot()`](fan.plot.md) : Display a fan plot +- [`feather.plot()`](feather.plot.md) : Display vectors along a + horizontal reference line +- [`fill.corner()`](fill.corner.md) : Fill a "corner" of a matrix with + values +- [`find_max_cell()`](find_max_cell.md) : Maximum (or minimum) value + cell in a matrix. +- [`floating.pie()`](floating.pie.md) : Display a floating pie chart +- [`fullaxis()`](fullaxis.md) : Add an axis with a line to the edge of + the plot +- [`gantt.chart()`](gantt.chart.md) : Display a Gantt chart +- [`gap.barplot()`](gap.barplot.md) : Display a barplot with a gap + (missing range) on one axis +- [`gap.boxplot()`](gap.boxplot.md) : Display a boxplot with a gap + (missing range) +- [`gap.plot()`](gap.plot.md) : Display a plot with one or two gaps + (missing ranges) on one axis +- [`gap_barp()`](gap_barp.md) : Display a barplot with a gap (missing + range) on one axis +- [`get.breaks()`](get.breaks.md) : Get the breakpoints for a weighted + histogram +- [`get.gantt.info()`](get.gantt.info.md) : Gather the information to + create a Gantt chart +- [`get.segs()`](get.segs.md) : Calculate the midpoints and limits for a + centipede plot +- [`get.soil.texture()`](get.soil.texture.md) : Enter soil texture data +- [`get.tablepos()`](get.tablepos.md) : Get the position for a legend or + table +- [`get.triprop()`](get.triprop.md) : Enter three proportion data - + usually soil textures +- [`getFigCtr()`](getFigCtr.md) : Get coordinates in the figure region + in user units. +- [`getIntersectList()`](getIntersectList.md) : Enter a set intersection + list +- [`getMarginWidth()`](getMarginWidth.md) : Find the margin width + necessary to fit text or a legend next to a plot +- [`getYmult()`](getYmult.md) : Correct for aspect and coordinate ratio +- [`get_axispos3d()`](get_axispos3d.md) : Get axis positions on a 3D + plot +- [`gradient.rect()`](gradient.rect.md) : Display a rectangle filled + with an arbitrary color gradient +- [`hexagon()`](hexagon.md) : Draw a hexagon +- [`histStack()`](histStack.md) : Histogram "stacked" by categories +- [`intersectDiagram()`](intersectDiagram.md) : Display set + intersections +- [`jiggle()`](jiggle.md) : Calculate equally spaced values within a + range. +- [`joyPlot()`](joyPlot.md) : Display a series of density curves. +- [`kiteChart()`](kiteChart.md) : Magnitude by position chart. +- [`l2010`](l2010.md) : World lightning strike data from 2010 +- [`labbePlot()`](labbePlot.md) : Display a L'Abbe plot +- [`ladderplot()`](ladderplot.md) : Ladder Plot +- [`legendg()`](legendg.md) : Legend with grouped bars, lines or symbols +- [`lengthKey()`](lengthKey.md) : Key for interpreting lengths in a plot +- [`makeDensityMatrix()`](makeDensityMatrix.md) : Compute a matrix of + counts from a list of x,y positions +- [`makeIntersectList()`](makeIntersectList.md) : Count set + intersections +- [`maxEmptyRect()`](maxEmptyRect.md) : Find an empty space on a plot +- [`mtext3d()`](mtext3d.md) : Display text in the margins of a 3D plot +- [`multhist()`](multhist.md) : Plot a multiple histogram, as a barplot +- [`multivari()`](multivari.md) : Function to draw a multivari chart +- [`multsymbolbox()`](multsymbolbox.md) : Draw boxes filled with symbols +- [`oz.windrose()`](oz.windrose.md) : Display an Australian wind rose +- [`oz.windrose.legend()`](oz.windrose.legend.md) : Display an + Australian wind rose legend +- [`p2p_arrows()`](p2p_arrows.md) : Draw arrows between points +- [`panes()`](panes.md) : Prepare a "panel" type layout +- [`pasteCols()`](pasteCols.md) : Paste the columns of a matrix together +- [`paxis3d()`](paxis3d.md) : Display text in the margins of a 3D plot +- [`perspx()`](perspx.md) : Display perspective plot +- [`pie.labels()`](pie.labels.md) : Place labels on a pie chart +- [`pie3D()`](pie3D.md) : Display a 3D pie chart +- [`pie3D.labels()`](pie3D.labels.md) : Display labels on a 3D pie chart +- [`placeLabels()`](placeLabels.md) : Place labels in boxes +- [`plotCI()`](plotCI.md) : Plot confidence intervals/error bars +- [`plotH()`](plotH.md) : Scatterplot with histogram-like bars. +- [`plot_bg()`](plot_bg.md) : Add a background color to a plot +- [`plotrix-package`](plotrix-package.md) + [`plotrix`](plotrix-package.md) : Specialized plots and plotting + accessories +- [`polar.plot()`](polar.plot.md) : Plot values on a circular grid of 0 + to 360 degrees +- [`polygon.shadow()`](polygon.shadow.md) : Display a shadow effect for + an arbitrary polygon +- [`print(`*``*`)`](print.brklist.md) : Display the output of + brkdnNest +- [`propbrk()`](propbrk.md) : Calculate the proportion of specified + values in a vector +- [`psegments3d()`](psegments3d.md) : Draw segments on a 3D plot +- [`ptext3d()`](ptext3d.md) : Display text on a 3D plot +- [`pyramid.plot()`](pyramid.plot.md) : Pyramid plot +- [`radial.grid()`](radial.grid.md) : Display a radial grid +- [`radial.pie()`](radial.pie.md) : Plot sectors/annuli on a circular + grid of 0 to 2\*pi radians +- [`radial.plot()`](radial.plot.md) : Plot values on a circular grid of + 0 to 2\*pi radians +- [`radial.plot.labels()`](radial.plot.labels.md) : Display labels on a + circular grid +- [`radialtext()`](radialtext.md) : Display text in a radial line +- [`raw.means.plot()`](raw.means.plot.md) + [`raw.means.plot2()`](raw.means.plot.md) : raw.means.plot: Raw-Means + Plots for Experimental Designs +- [`rectFill()`](rectFill.md) : Draw a rectangle filled with symbols +- [`rescale()`](rescale.md) : Scale numbers into a new range +- [`revaxis()`](revaxis.md) : Plot with axis direction(s) reversed +- [`ruginv()`](ruginv.md) : Add an Inverse Rug to a Plot +- [`seats()`](seats.md) : Arrange N seats in M semicircular rows +- [`size_n_color()`](size_n_color.md) : Display circles with specified + size and color +- [`sizeplot()`](sizeplot.md) : Plot with repeated symbols by size +- [`sizetree()`](sizetree.md) : Display a hierarchical breakdown of + disjunct categories +- [`sliceArray()`](sliceArray.md) : Slice an array +- [`smoothColors()`](smoothColors.md) : Build a vector of color values +- [`soil.texture()`](soil.texture.md) : Soil texture triangle plot +- [`soil.texture.uk()`](soil.texture.uk.md) : Soil texture triangle plot + using UK conventions +- [`soils`](soils.md) : Soil texture data from 125 soils +- [`spread.labels()`](spread.labels.md) : Spread labels for irregularly + spaced values +- [`spreadout()`](spreadout.md) : Spread out a vector of numbers to a + minimum interval +- [`stackpoly()`](stackpoly.md) : Display the columns of a matrix or + data frame as stacked polygons +- [`staircase.plot()`](staircase.plot.md) : Display a staircase plot +- [`staircasePlot()`](staircasePlot.md) : Display a staircase plot +- [`starPie()`](starPie.md) : A pie-like graphic object +- [`staxlab()`](staxlab.md) : Place staggered or angled labels on an + axis +- [`std.error()`](std.error.md) : Calculate standard error of the mean +- [`sumbrk()`](sumbrk.md) : Count specified values in a vector +- [`symbolbarplot()`](symbolbarplot.md) : barplot filled with symbols +- [`symbolbox()`](symbolbox.md) : Draw a box filled with symbols +- [`tab.title()`](tab.title.md) : Display the title of a plot as a + colored tab +- [`taylor.diagram()`](taylor.diagram.md) : Taylor diagram +- [`textbox()`](textbox.md) : Add text box +- [`thigmophobe()`](thigmophobe.md) : Find the direction away from the + closest point +- [`thigmophobe.labels()`](thigmophobe.labels.md) : Place labels away + from the nearest point +- [`triax.abline()`](triax.abline.md) : Lines for triangle plot +- [`triax.fill()`](triax.fill.md) : Triangle plot fill +- [`triax.frame()`](triax.frame.md) : Triangle plot frame +- [`triax.plot()`](triax.plot.md) : Triangle plot +- [`triax.points()`](triax.points.md) : Triangle plot points +- [`tsxpos()`](tsxpos.md) : Calculate equispaced x positions. +- [`twoord.plot()`](twoord.plot.md) : Plot with two ordinates +- [`twoord.stackplot()`](twoord.stackplot.md) : Multiple (stack) plot + with two ordinates +- [`valid.n()`](valid.n.md) : Find the number of valid (not NA) values +- [`vectorField()`](vectorField.md) : Display magnitude/direction + vectors +- [`violin_plot()`](violin_plot.md) : Display a "violin" plot +- [`weighted.hist()`](weighted.hist.md) : Display a weighted histogram +- [`zoomInPlot()`](zoomInPlot.md) : Display a plot with a rectangular + section expanded in an adjacent plot diff --git a/reference/intersectDiagram-1.png b/reference/intersectDiagram-1.png new file mode 100644 index 0000000..58cd4cb Binary files /dev/null and b/reference/intersectDiagram-1.png differ diff --git a/reference/intersectDiagram-2.png b/reference/intersectDiagram-2.png new file mode 100644 index 0000000..816bbd4 Binary files /dev/null and b/reference/intersectDiagram-2.png differ diff --git a/reference/intersectDiagram-3.png b/reference/intersectDiagram-3.png new file mode 100644 index 0000000..27d2911 Binary files /dev/null and b/reference/intersectDiagram-3.png differ diff --git a/reference/intersectDiagram-4.png b/reference/intersectDiagram-4.png new file mode 100644 index 0000000..480c870 Binary files /dev/null and b/reference/intersectDiagram-4.png differ diff --git a/reference/intersectDiagram-5.png b/reference/intersectDiagram-5.png new file mode 100644 index 0000000..e54566f Binary files /dev/null and b/reference/intersectDiagram-5.png differ diff --git a/reference/intersectDiagram-6.png b/reference/intersectDiagram-6.png new file mode 100644 index 0000000..9418f3d Binary files /dev/null and b/reference/intersectDiagram-6.png differ diff --git a/reference/intersectDiagram-7.png b/reference/intersectDiagram-7.png new file mode 100644 index 0000000..e76a288 Binary files /dev/null and b/reference/intersectDiagram-7.png differ diff --git a/reference/intersectDiagram-8.png b/reference/intersectDiagram-8.png new file mode 100644 index 0000000..103a054 Binary files /dev/null and b/reference/intersectDiagram-8.png differ diff --git a/reference/intersectDiagram-9.png b/reference/intersectDiagram-9.png new file mode 100644 index 0000000..96784c3 Binary files /dev/null and b/reference/intersectDiagram-9.png differ diff --git a/reference/intersectDiagram.html b/reference/intersectDiagram.html new file mode 100644 index 0000000..545932d --- /dev/null +++ b/reference/intersectDiagram.html @@ -0,0 +1,240 @@ + +Display set intersections — intersectDiagram • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display set intersections as rows of rectangles.

    +
    + +
    +

    Usage

    +
    intersectDiagram(x,pct=FALSE,show.nulls=FALSE,xnames=NULL,sep="+",
    +  mar=c(0,0,3,0),main="Intersection Diagram",cex=1,col=NULL,
    +  minspacing=NA,all.intersections=FALSE,include=NULL,null.label="Non-set")
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A list containing as many numeric vectors as there are sets. The + first vector contains the counts or percentages of the elements that are + only in one set, the next vector contains the counts or percentages of + elements that are in two sets and so on. A matrix of set membership + indicators or a two column matrix of object identifiers and attribute + identifiers can be passed - see Details.

    + +
    pct
    +

    Whether to display counts (FALSE) or percentages (TRUE) of the + number of entities.

    + +
    show.nulls
    +

    Whether to display the number of original objects that + are not members of any set. Any value that is not NA will become the + label for this category.

    + +
    xnames
    +

    Optional user supplied names for the set categories (see + Details).

    + +
    sep
    +

    The separator to use between category names (see Details).

    + +
    mar
    +

    The margins for the diagram. The margins that were in effect when + the function is called are restored.

    + +
    main
    +

    The title for the diagram.

    + +
    col
    +

    Colors for the sets (see Details).

    + +
    cex
    +

    Character expansion for the intersection labels.

    + +
    minspacing
    +

    The minimum spacing between the rectangles (see Details).

    + +
    all.intersections
    +

    Whether to display all intersections, even if empty + (Dangerous - see Detail).

    + +
    include
    +

    Which set identifiers to include in the diagram (see Details).

    + +
    null.label
    +

    The label for the non-set entities if displayed.

    + +
    +
    +

    Details

    +

    intersectDiagram displays rows of optionally colored rectangles that + represent the intersections of set memberships (attributes) of a set of objects. + The topmost row represents the intersections of the fewest sets, and + succeeding rows represent the intersections of more sets. If there were objects + in the original data set that were not members of any set, any percentages + calculated will reflect this. By setting show.nulls to TRUE, the counts + or percentages of such objects will be displayed below the intersections over + an empty rectangle scaled to the count or percentage.

    +

    Important - If the all.intersections argument is TRUE, all intersections + will be displayed, whether empty or not (see the example). This is mostly for + demonstration purposes, and if the number of sets is large, is likely to produce + a very messy diagram. Similarly, sets with large numbers of + intersections that are populated will require very large displays to be readable, + even if there are small numbers in the intersections. If you would like to see + this in action, pass the data frame setdf in the categoryReshape + example to intersectDiagram with all.intersections TRUE.

    +

    intersectDiagram does not attempt to display the set intersections as + a pattern of overlapping geometric figures, but rather the relative numbers of + objects sharing each intersection. More than three intersecting sets generally + produce a complex and difficult to interpret Venn diagram, and this provides an + alternative way to display the size of intersections between larger numbers + of sets.

    +

    intersectDiagram now allows the user to display only part of the + set intersections, which is useful for analyzing very complex intersections. + This is controlled by the include argument. This defaults to all sets or + attributes when include=NULL. If one or more of the labels of the sets or + attributes is passed, only the intersections containing those labels will be + displayed. See examples 2 and 3 below.

    +

    Each set (attribute) is assigned a color if col is not NA. rainbow + is called if col is NULL, otherwise the colors passed are used. For each + intersection, the colors representing the sets intersecting are included in + the rectangle.

    +

    The strings displayed on each rectangle are taken from the argument + xnames unless that is NULL, then the names of the intersectList + object passed as x or returned from the call to makeIntersectList.

    +

    If a matrix or data frame of set membership indicators is passed as x, + it will be passed to makeIntersectList for conversion. Each column must + represent a set, and the values in the columns must be 0 or 1, or FALSE or TRUE. + Similarly, if a matrix or data frame in which the first column is object + identifiers and the second column is attributes, this will be passed to + makeIntersectList.

    +

    The spacing between the largest rectangles is controlled by minspacing. + minspacing is in units of object counts and defaults to 0.1 times the + largest number of objects in an intersection. When the number of objects in + different intersections at a given level varies widely, the labels of + intersections with few objects may overlap if they are wide relative to the + rectangle representing the number of objects. This can be corrected by + passing a minspacing argument that will increase the space between + rectangles and/or decreasing the character size of the labels. If the labels + for each set are relatively long, setting namesep="\n" may help. Note + that if a different separator is passed, that separator must be explicitly + passed in any subsequent calls using the same intersectList object - see + examples 1 to 3 below.

    +
    +
    +

    Value

    +

    Returns the intersectionList object invisibly.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + + +
    +

    Examples

    +
     # create a matrix where each row represents an element and
    + # a 1 (or TRUE) in each column indicates that the element is a member
    + # of that set.
    + druguse<-matrix(c(sample(c(0,1),200,TRUE,prob=c(0.15,0.85)),
    +  sample(c(0,1),200,TRUE,prob=c(0.35,0.65)),
    +  sample(c(0,1),200,TRUE,prob=c(0.5,0.5)),
    +  sample(c(0,1),200,TRUE,prob=c(0.9,0.1))),ncol=4)
    + colnames(druguse)<-c("Alc","Tob","THC","Amp")
    + druglist<-makeIntersectList(druguse,sep="\n")
    + # first display it as counts
    + intersectDiagram(druglist,main="Patterns of drug use",sep="\n")
    +
    + # then display only the intersections containing "Alc"
    + intersectDiagram(druglist,main="Patterns of drug use (Alcohol users only)",
    +  sep="\n",include="alc")
    +
    + # now display only the intersections containing "Amp"
    + intersectDiagram(druglist,main="Patterns of drug use (Speed users only)",
    +  sep="\n",include="amp")
    +
    + # then as percent with non.members, passing the initial matrix
    + intersectDiagram(druguse,pct=TRUE,show.nulls=TRUE)
    +
    + # alter the data to have more multiple intersections
    + druguse[which(as.logical(druguse[,1]))[1:40],2]<-1
    + druguse[which(as.logical(druguse[,1]))[31:70],3]<-1
    + druguse[,4]<-sample(c(0,1),200,TRUE,prob=c(0.9,0.1))
    + intersectDiagram(druguse,main="Smaller font in labels",
    +  col=c("gray20","gray40","gray60","gray80"),cex=0.8)
    +
    + # transform the spacing - usually makes it too close, first try minspacing
    + intersectDiagram(druguse,col="gray",main="Minimum spacing = 30 cases",
    +  minspacing=30)
    +
    + # then try cex - may need both for large differences
    + intersectDiagram(druguse,main="Very boring single color",col="gray",cex=0.8)
    +
    + # create a matrix with empty intersections
    + druguse<-matrix(c(sample(c(0,1),20,TRUE),
    +  sample(c(0,1),20,TRUE),
    +  sample(c(0,1),20,TRUE),
    +  sample(c(0,1),20,TRUE)),ncol=4)
    + # show only the populated intersections
    + intersectDiagram(druguse,main="Display only populated intersections")
    +
    + # show all intersections
    + intersectDiagram(druguse,main="Display empty intersections",all.intersections=TRUE)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/intersectDiagram.md b/reference/intersectDiagram.md new file mode 100644 index 0000000..200fd05 --- /dev/null +++ b/reference/intersectDiagram.md @@ -0,0 +1,206 @@ +# Display set intersections + +Display set intersections as rows of rectangles. + +## Usage + +``` r +intersectDiagram(x,pct=FALSE,show.nulls=FALSE,xnames=NULL,sep="+", + mar=c(0,0,3,0),main="Intersection Diagram",cex=1,col=NULL, + minspacing=NA,all.intersections=FALSE,include=NULL,null.label="Non-set") +``` + +## Arguments + +- x: + + A list containing as many numeric vectors as there are sets. The first + vector contains the counts or percentages of the elements that are + only in one set, the next vector contains the counts or percentages of + elements that are in two sets and so on. A matrix of set membership + indicators or a two column matrix of object identifiers and attribute + identifiers can be passed - see Details. + +- pct: + + Whether to display counts (FALSE) or percentages (TRUE) of the number + of entities. + +- show.nulls: + + Whether to display the number of original objects that are not members + of any set. Any value that is not NA will become the label for this + category. + +- xnames: + + Optional user supplied names for the set categories (see Details). + +- sep: + + The separator to use between category names (see Details). + +- mar: + + The margins for the diagram. The margins that were in effect when the + function is called are restored. + +- main: + + The title for the diagram. + +- col: + + Colors for the sets (see Details). + +- cex: + + Character expansion for the intersection labels. + +- minspacing: + + The minimum spacing between the rectangles (see Details). + +- all.intersections: + + Whether to display all intersections, even if empty (Dangerous - see + Detail). + +- include: + + Which set identifiers to include in the diagram (see Details). + +- null.label: + + The label for the non-set entities if displayed. + +## Details + +`intersectDiagram` displays rows of optionally colored rectangles that +represent the intersections of set memberships (attributes) of a set of +objects. The topmost row represents the intersections of the fewest +sets, and succeeding rows represent the intersections of more sets. If +there were objects in the original data set that were not members of any +set, any percentages calculated will reflect this. By setting +`show.nulls` to TRUE, the counts or percentages of such objects will be +displayed below the intersections over an empty rectangle scaled to the +count or percentage. + +Important - If the `all.intersections` argument is TRUE, all +intersections will be displayed, whether empty or not (see the example). +This is mostly for demonstration purposes, and if the number of sets is +large, is likely to produce a very messy diagram. Similarly, sets with +large numbers of intersections that are populated will require very +large displays to be readable, even if there are small numbers in the +intersections. If you would like to see this in action, pass the data +frame `setdf` in the [categoryReshape](categoryReshape.md) example to +`intersectDiagram` with `all.intersections` TRUE. + +`intersectDiagram` does not attempt to display the set intersections as +a pattern of overlapping geometric figures, but rather the relative +numbers of objects sharing each intersection. More than three +intersecting sets generally produce a complex and difficult to interpret +Venn diagram, and this provides an alternative way to display the size +of intersections between larger numbers of sets. + +`intersectDiagram` now allows the user to display only part of the set +intersections, which is useful for analyzing very complex intersections. +This is controlled by the `include` argument. This defaults to all sets +or attributes when `include=NULL`. If one or more of the labels of the +sets or attributes is passed, only the intersections containing those +labels will be displayed. See examples 2 and 3 below. + +Each set (attribute) is assigned a color if `col` is not NA. `rainbow` +is called if `col` is NULL, otherwise the colors passed are used. For +each intersection, the colors representing the sets intersecting are +included in the rectangle. + +The strings displayed on each rectangle are taken from the argument +`xnames` unless that is NULL, then the `names` of the intersectList +object passed as `x` or returned from the call to `makeIntersectList`. + +If a matrix or data frame of set membership indicators is passed as `x`, +it will be passed to [makeIntersectList](makeIntersectList.md) for +conversion. Each column must represent a set, and the values in the +columns must be 0 or 1, or FALSE or TRUE. Similarly, if a matrix or data +frame in which the first column is object identifiers and the second +column is attributes, this will be passed to `makeIntersectList`. + +The spacing between the largest rectangles is controlled by +`minspacing`. `minspacing` is in units of object counts and defaults to +0.1 times the largest number of objects in an intersection. When the +number of objects in different intersections at a given level varies +widely, the labels of intersections with few objects may overlap if they +are wide relative to the rectangle representing the number of objects. +This can be corrected by passing a `minspacing` argument that will +increase the space between rectangles and/or decreasing the character +size of the labels. If the labels for each set are relatively long, +setting `namesep="\n"` may help. Note that if a different separator is +passed, that separator must be explicitly passed in any subsequent calls +using the same `intersectList` object - see examples 1 to 3 below. + +## Value + +Returns the intersectionList object invisibly. + +## Author + +Jim Lemon + +## See also + +[makeIntersectList](makeIntersectList.md), +[getIntersectList](getIntersectList.md), +[categoryReshape](categoryReshape.md) + +## Examples + +``` r + # create a matrix where each row represents an element and + # a 1 (or TRUE) in each column indicates that the element is a member + # of that set. + druguse<-matrix(c(sample(c(0,1),200,TRUE,prob=c(0.15,0.85)), + sample(c(0,1),200,TRUE,prob=c(0.35,0.65)), + sample(c(0,1),200,TRUE,prob=c(0.5,0.5)), + sample(c(0,1),200,TRUE,prob=c(0.9,0.1))),ncol=4) + colnames(druguse)<-c("Alc","Tob","THC","Amp") + druglist<-makeIntersectList(druguse,sep="\n") + # first display it as counts + intersectDiagram(druglist,main="Patterns of drug use",sep="\n") + + # then display only the intersections containing "Alc" + intersectDiagram(druglist,main="Patterns of drug use (Alcohol users only)", + sep="\n",include="alc") + + # now display only the intersections containing "Amp" + intersectDiagram(druglist,main="Patterns of drug use (Speed users only)", + sep="\n",include="amp") + + # then as percent with non.members, passing the initial matrix + intersectDiagram(druguse,pct=TRUE,show.nulls=TRUE) + + # alter the data to have more multiple intersections + druguse[which(as.logical(druguse[,1]))[1:40],2]<-1 + druguse[which(as.logical(druguse[,1]))[31:70],3]<-1 + druguse[,4]<-sample(c(0,1),200,TRUE,prob=c(0.9,0.1)) + intersectDiagram(druguse,main="Smaller font in labels", + col=c("gray20","gray40","gray60","gray80"),cex=0.8) + + # transform the spacing - usually makes it too close, first try minspacing + intersectDiagram(druguse,col="gray",main="Minimum spacing = 30 cases", + minspacing=30) + + # then try cex - may need both for large differences + intersectDiagram(druguse,main="Very boring single color",col="gray",cex=0.8) + + # create a matrix with empty intersections + druguse<-matrix(c(sample(c(0,1),20,TRUE), + sample(c(0,1),20,TRUE), + sample(c(0,1),20,TRUE), + sample(c(0,1),20,TRUE)),ncol=4) + # show only the populated intersections + intersectDiagram(druguse,main="Display only populated intersections") + + # show all intersections + intersectDiagram(druguse,main="Display empty intersections",all.intersections=TRUE) +``` diff --git a/reference/jiggle-1.png b/reference/jiggle-1.png new file mode 100644 index 0000000..8188913 Binary files /dev/null and b/reference/jiggle-1.png differ diff --git a/reference/jiggle.html b/reference/jiggle.html new file mode 100644 index 0000000..f4734be --- /dev/null +++ b/reference/jiggle.html @@ -0,0 +1,103 @@ + +Calculate equally spaced values within a range. — jiggle • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Calculates a specified number of equally spaced values in a range

    +
    + +
    +

    Usage

    +
    jiggle(n,range=c(-1,1))
    +
    + +
    +

    Arguments

    +

    +
    n
    +

    The number of values to calculate.

    + +
    range
    +

    The range within which to fit the values.

    + +
    +
    +

    Details

    +

    jiggle is an alternative to the jitter function. Instead + of using runif to provide the values, it calls sample + and then scales the resulting values to the range specified. This + guarantees that the values will be evenly spaced.

    +
    +
    +

    Value

    +

    A vector of n values within the range specified.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + +
    +

    Examples

    +
     ahw.df<-data.frame(Age=rnorm(100,35,10),
    +  Height=rnorm(100,160,15),Weight=rnorm(100,75,20))
    + par(mfrow=c(1,3))
    + boxplot(ahw.df$Age,main="Age")
    + points(jiggle(100,c(0.5,1.5)),ahw.df$Age,col="red")
    + boxplot(ahw.df$Height,main="Height")
    + points(jiggle(100,c(0.5,1.5)),ahw.df$Height,col="green")
    + boxplot(ahw.df$Weight,main="Weight")
    + points(jiggle(100,c(0.5,1.5)),ahw.df$Weight,col="blue")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/jiggle.md b/reference/jiggle.md new file mode 100644 index 0000000..53bd919 --- /dev/null +++ b/reference/jiggle.md @@ -0,0 +1,48 @@ +# Calculate equally spaced values within a range. + +Calculates a specified number of equally spaced values in a range + +## Usage + +``` r +jiggle(n,range=c(-1,1)) +``` + +## Arguments + +- n: + + The number of values to calculate. + +- range: + + The range within which to fit the values. + +## Details + +`jiggle` is an alternative to the `jitter` function. Instead of using +`runif` to provide the values, it calls `sample` and then scales the +resulting values to the range specified. This guarantees that the values +will be evenly spaced. + +## Value + +A vector of n values within the range specified. + +## Author + +Jim Lemon + +## Examples + +``` r + ahw.df<-data.frame(Age=rnorm(100,35,10), + Height=rnorm(100,160,15),Weight=rnorm(100,75,20)) + par(mfrow=c(1,3)) + boxplot(ahw.df$Age,main="Age") + points(jiggle(100,c(0.5,1.5)),ahw.df$Age,col="red") + boxplot(ahw.df$Height,main="Height") + points(jiggle(100,c(0.5,1.5)),ahw.df$Height,col="green") + boxplot(ahw.df$Weight,main="Weight") + points(jiggle(100,c(0.5,1.5)),ahw.df$Weight,col="blue") +``` diff --git a/reference/joyPlot-1.png b/reference/joyPlot-1.png new file mode 100644 index 0000000..7ac63c4 Binary files /dev/null and b/reference/joyPlot-1.png differ diff --git a/reference/joyPlot-2.png b/reference/joyPlot-2.png new file mode 100644 index 0000000..6260b2f Binary files /dev/null and b/reference/joyPlot-2.png differ diff --git a/reference/joyPlot-3.png b/reference/joyPlot-3.png new file mode 100644 index 0000000..91e872e Binary files /dev/null and b/reference/joyPlot-3.png differ diff --git a/reference/joyPlot.html b/reference/joyPlot.html new file mode 100644 index 0000000..83b9327 --- /dev/null +++ b/reference/joyPlot.html @@ -0,0 +1,157 @@ + +Display a series of density curves. — joyPlot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    joyPlot displays a matrix of density curves or other two + component lists whose names are x and y. The labels for + each line/polygon are displayed on the left axis of the plot. + The labels default to the names of the components of x if these + are present.

    +
    + +
    +

    Usage

    +
    joyPlot(x,mar=c(5,4,4,2),newrange=c(0,1),border=NA,fill=NULL,
    + main="",xlab="",ylab="",xlim=NA,line_labels=names(x),xat=NULL,
    + xaxlab=NULL)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A list of density curves or other objects with x and y values.

    + +
    mar
    +

    Margins for the plot.

    + +
    newrange
    +

    Passed to rescale to scale the values to fit the + bands on the plot. See Details.

    + +
    border
    +

    The border colors for the polygons.

    + +
    fill
    +

    Optional fill colors for the polygons.

    + +
    main
    +

    Text for the title for the plot.

    + +
    xlab,ylab
    +

    The x and y axis labels.

    + +
    xlim
    +

    Optional limit for the x axis as density returns + values outside the range of the values in x.

    + +
    line_labels
    +

    Labels for the lines/polygons dieplayed.

    + +
    xat
    +

    Optional custom x tick positions.

    + +
    xaxlab
    +

    Optional custom x tick labels.

    + +
    +
    +

    Details

    +

    The density curves or other x/y lists will be scaled so that the largest + will fit into the one user unit band allocated for each curve by default. + If the second value of newrange is changed, the heights of the + curves will change proportionately. See the third exampls.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     x1<-c(sample(20:50,20),sample(40:80,30))
    + x2<-c(sample(10:40,30),sample(50:90,30))
    + x3<-sample(20:90,50)
    + xdens1<-density(x1)
    + xdens2<-density(x2)
    + xdens3<-density(x3)
    + joyPlot(list(xdens1,xdens2,xdens3),main="joyPlot with lines",
    +  xlab="Position",xlim=c(0,100))
    +
    + xlist<-list(first=xdens1,second=xdens2,third=xdens3)
    + joyPlot(xlist,main="joyPlot with polygons",xlab="Position",
    +  fill=c("#ffcccc","#ccffcc","#ccccff"),xlim=c(0,100))
    +
    + joyPlot(xlist,main="joyPlot with overlapping polygons",
    +  fill=c("#ffcccc","#ccffcc","#ccccff"),xlim=c(0,100),
    +  newrange=c(0,1.5),xlab="Position")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/joyPlot.md b/reference/joyPlot.md new file mode 100644 index 0000000..0a6f13f --- /dev/null +++ b/reference/joyPlot.md @@ -0,0 +1,103 @@ +# Display a series of density curves. + +`joyPlot` displays a matrix of density curves or other two component +lists whose names are `x` and `y`. The labels for each line/polygon are +displayed on the left axis of the plot. The labels default to the names +of the components of `x` if these are present. + +## Usage + +``` r +joyPlot(x,mar=c(5,4,4,2),newrange=c(0,1),border=NA,fill=NULL, + main="",xlab="",ylab="",xlim=NA,line_labels=names(x),xat=NULL, + xaxlab=NULL) +``` + +## Arguments + +- x: + + A list of density curves or other objects with x and y values. + +- mar: + + Margins for the plot. + +- newrange: + + Passed to `rescale` to scale the values to fit the bands on the plot. + See Details. + +- border: + + The border colors for the polygons. + +- fill: + + Optional fill colors for the polygons. + +- main: + + Text for the title for the plot. + +- xlab,ylab: + + The x and y axis labels. + +- xlim: + + Optional limit for the x axis as `density` returns values outside the + range of the values in `x`. + +- line_labels: + + Labels for the lines/polygons dieplayed. + +- xat: + + Optional custom x tick positions. + +- xaxlab: + + Optional custom x tick labels. + +## Details + +The density curves or other x/y lists will be scaled so that the largest +will fit into the one user unit band allocated for each curve by +default. If the second value of `newrange` is changed, the heights of +the curves will change proportionately. See the third exampls. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[plot](https://rdrr.io/r/graphics/plot.default.html), +[stackpoly](stackpoly.md) + +## Examples + +``` r + x1<-c(sample(20:50,20),sample(40:80,30)) + x2<-c(sample(10:40,30),sample(50:90,30)) + x3<-sample(20:90,50) + xdens1<-density(x1) + xdens2<-density(x2) + xdens3<-density(x3) + joyPlot(list(xdens1,xdens2,xdens3),main="joyPlot with lines", + xlab="Position",xlim=c(0,100)) + + xlist<-list(first=xdens1,second=xdens2,third=xdens3) + joyPlot(xlist,main="joyPlot with polygons",xlab="Position", + fill=c("#ffcccc","#ccffcc","#ccccff"),xlim=c(0,100)) + + joyPlot(xlist,main="joyPlot with overlapping polygons", + fill=c("#ffcccc","#ccffcc","#ccccff"),xlim=c(0,100), + newrange=c(0,1.5),xlab="Position") +``` diff --git a/reference/kiteChart-1.png b/reference/kiteChart-1.png new file mode 100644 index 0000000..81db71f Binary files /dev/null and b/reference/kiteChart-1.png differ diff --git a/reference/kiteChart-2.png b/reference/kiteChart-2.png new file mode 100644 index 0000000..273e2f3 Binary files /dev/null and b/reference/kiteChart-2.png differ diff --git a/reference/kiteChart-3.png b/reference/kiteChart-3.png new file mode 100644 index 0000000..8894c62 Binary files /dev/null and b/reference/kiteChart-3.png differ diff --git a/reference/kiteChart-4.png b/reference/kiteChart-4.png new file mode 100644 index 0000000..43f2736 Binary files /dev/null and b/reference/kiteChart-4.png differ diff --git a/reference/kiteChart.html b/reference/kiteChart.html new file mode 100644 index 0000000..eeac595 --- /dev/null +++ b/reference/kiteChart.html @@ -0,0 +1,196 @@ + +Magnitude by position chart. — kiteChart • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display numeric values as the widths of a polygon along a dimension such as time.

    +
    + +
    +

    Usage

    +
    kiteChart(x,xlim=NA,ylim=NA,timex=TRUE,main="Kite chart",
    + xlab=ifelse(timex,"Time","Groups"),ylab=ifelse(timex,"Groups","Time"),
    + border=par("fg"),col=NULL,varpos=NA,varlabels=NA,varscale=FALSE,
    + timepos=NA,timelabels=NA,mar=c(5,4,4,4),axlab=c(1,2,3,4),
    + normalize=FALSE,shownorm=TRUE,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    Numeric matrix or data frame

    + +
    xlim
    +

    Horizontal extent of the chart. Defaults to 1:dim(x)[2].

    + +
    ylim
    +

    Vertical extent of the chart. Defaults to 0.5:dim(x)[1]+0.5.

    + +
    timex
    +

    Whether the "time" axis is x (horizontal) or not.

    + +
    main,xlab,ylab
    +

    As in plot.

    + +
    border
    +

    The border color(s) for the polygons.

    + +
    col
    +

    The fill colors for the polygons.

    + +
    varpos
    +

    Optional positions for the "kite lines". Defaults to 1:dimx[1]. + (see Details)

    + +
    varlabels
    +

    Labels for the rows of values - defaults to the rownames, + or if these are missing, varpos[1:dim(x)[1]].

    + +
    varscale
    +

    Whether to show the maximum extent of each "kite line".

    + +
    timepos
    +

    The positions of the values along the x axis, usually times, + defaulting to 1:dim(x)[2].

    + +
    timelabels
    +

    Labels for the positions, defaulting to timepos.

    + +
    mar
    +

    Plot margins. These leave space for the normalization multipliers + on the right or top side (see Details).

    + +
    axlab
    +

    Where to put axis tick labels and multipliers. See Details.

    + +
    normalize
    +

    Whether to scale each row of values to a maximum width of 1.

    + +
    shownorm
    +

    Whether to display the normalization multipliers.

    + +
    ...
    +

    additional arguments passed to plot.

    + +
    +
    +

    Details

    +

    kiteChart displays each row of x as a sequence of widths, allowing + the relationships between those values and the dimension along which they occur + (usually time) to be illustrated.

    +

    The values in x are scaled to a maximum polygon width of 1 if normalize + is TRUE. This is to avoid overlapping of the polygons. There may be some cases + where the values can be displayed directly. If normalized, the multipliers will + be displayed for each row on the right or top side of the chart unless shownorm + is FALSE. Remember to specify the mar argument if more space at the top + is needed.

    +

    The axlab argument allows the user to place the axis tick labels and + normalization multipliers on different axes. The default places the tick labels + on the bottom and left sides of the plot and the multipliers on the right or top. + Using axlab=c(3,4,1,2) places the tick labels on the top and right and the + multipliers on the left or bottom. The mar argument may have to be adjusted.

    +

    The user can display raw values by default, or by setting varpos to TRUE. + Setting varpos to a vector of positions will place the "kite lines" on those + values. If there are no row names and the varlabels argument is NA, the values + of varpos will be used as labels for each "kite line". The maximum extent of + each "kite line" can be displayed by setting varscale to TRUE. If + varscale is TRUE, one extra line will be added to the top margin. If + varpos[1] is not NA, normalize is FALSE by default.

    +
    +
    +

    Value

    +

    The values of mar that were current when kiteChart was called.

    +
    +
    +

    Author

    +

    Jim Lemon (Thanks to Michael Bedward for suggestions on the arguments and + Nikolaus Lampadariou for the suggestions on displaying raw values)

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     testmat<-matrix(c(runif(50),sample(1:50,50),rnorm(50)+5,
    +  sin(1:50)),ncol=50,byrow=TRUE)
    + kiteChart(testmat,varlabels=c("Uniform","Sample","Normal","Sine"),
    +  timepos=seq(1,50,by=5),timex=FALSE)
    + # not enough space for the last label, add it
    + mtext("Sine",at=65,side=1,line=2)
    +
    + # now show it with kite line maxima
    + kiteChart(testmat,varlabels=c("Uniform","Sample","Normal","Sine"),
    +  timepos=seq(1,50,by=5),timex=FALSE,varscale=TRUE)
    + mtext("Sine",at=65,side=1,line=2)
    +
    + musicmat<-matrix(c(c(0.5,0.4,0.3,0.25,0.2,0.15,0.1,rep(0.05,44))+runif(51,0,0.05),
    +  c(0.1,0.2,0.3,0.35,0.4,0.5,0.4,rep(0.5,14),rep(0.4,15),rep(0.3,15))+runif(51,0,0.1),
    +  rep(0.15,51)+runif(51,0,0.1),
    +  c(rep(0,29),c(0.1,0.2,0.4,0.5,0.3,0.2,rep(0.05,16))+runif(22,0,0.05)),
    +  c(rep(0,38),c(rep(0.05,6),0.08,0.15,0.20,0.25,0.2,0.25,0.3)+runif(13,0,0.05))),
    +  ncol=51,byrow=TRUE)
    + kiteChart(musicmat,varlabels=c("Swing","Rock","Jazz","Disco","Rap"),
    +  main="An utterly imaginary chart of music popularity",
    +  timepos=seq(1,51,by=10),timelabels=seq(1950,2000,by=10),mar=c(5,4,4,2))
    +
    + # now flip it to vertical, normalize and show the normalization factors
    + kiteChart(musicmat,varlabels=c("Swing","Rock","Jazz","Disco","Rap"),
    +  main="An utterly imaginary chart of music popularity",xlab="Style",
    +  timepos=seq(1,51,by=10),timelabels=seq(1950,2000,by=10),mar=c(5,4,4,2),
    +  timex=FALSE,normalize=TRUE,shownorm=TRUE)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/kiteChart.md b/reference/kiteChart.md new file mode 100644 index 0000000..58bf58f --- /dev/null +++ b/reference/kiteChart.md @@ -0,0 +1,162 @@ +# Magnitude by position chart. + +Display numeric values as the widths of a polygon along a dimension such +as time. + +## Usage + +``` r +kiteChart(x,xlim=NA,ylim=NA,timex=TRUE,main="Kite chart", + xlab=ifelse(timex,"Time","Groups"),ylab=ifelse(timex,"Groups","Time"), + border=par("fg"),col=NULL,varpos=NA,varlabels=NA,varscale=FALSE, + timepos=NA,timelabels=NA,mar=c(5,4,4,4),axlab=c(1,2,3,4), + normalize=FALSE,shownorm=TRUE,...) +``` + +## Arguments + +- x: + + Numeric matrix or data frame + +- xlim: + + Horizontal extent of the chart. Defaults to 1:dim(x)\[2\]. + +- ylim: + + Vertical extent of the chart. Defaults to 0.5:dim(x)\[1\]+0.5. + +- timex: + + Whether the "time" axis is x (horizontal) or not. + +- main,xlab,ylab: + + As in `plot`. + +- border: + + The border color(s) for the polygons. + +- col: + + The fill colors for the polygons. + +- varpos: + + Optional positions for the "kite lines". Defaults to 1:dimx\[1\]. (see + Details) + +- varlabels: + + Labels for the rows of values - defaults to the rownames, or if these + are missing, varpos\[1:dim(x)\[1\]\]. + +- varscale: + + Whether to show the maximum extent of each "kite line". + +- timepos: + + The positions of the values along the x axis, usually times, + defaulting to 1:dim(x)\[2\]. + +- timelabels: + + Labels for the positions, defaulting to `timepos`. + +- mar: + + Plot margins. These leave space for the normalization multipliers on + the right or top side (see Details). + +- axlab: + + Where to put axis tick labels and multipliers. See Details. + +- normalize: + + Whether to scale each row of values to a maximum width of 1. + +- shownorm: + + Whether to display the normalization multipliers. + +- ...: + + additional arguments passed to `plot`. + +## Details + +`kiteChart` displays each row of `x` as a sequence of widths, allowing +the relationships between those values and the dimension along which +they occur (usually time) to be illustrated. + +The values in x are scaled to a maximum polygon width of 1 if +`normalize` is TRUE. This is to avoid overlapping of the polygons. There +may be some cases where the values can be displayed directly. If +normalized, the multipliers will be displayed for each row on the right +or top side of the chart unless `shownorm` is FALSE. Remember to specify +the `mar` argument if more space at the top is needed. + +The `axlab` argument allows the user to place the axis tick labels and +normalization multipliers on different axes. The default places the tick +labels on the bottom and left sides of the plot and the multipliers on +the right or top. Using `axlab=c(3,4,1,2)` places the tick labels on the +top and right and the multipliers on the left or bottom. The `mar` +argument may have to be adjusted. + +The user can display raw values by default, or by setting `varpos` to +TRUE. Setting `varpos` to a vector of positions will place the "kite +lines" on those values. If there are no row names and the `varlabels` +argument is NA, the values of `varpos` will be used as labels for each +"kite line". The maximum extent of each "kite line" can be displayed by +setting `varscale` to TRUE. If `varscale` is TRUE, one extra line will +be added to the top margin. If `varpos[1]` is not NA, `normalize` is +FALSE by default. + +## Value + +The values of `mar` that were current when `kiteChart` was called. + +## Author + +Jim Lemon (Thanks to Michael Bedward for suggestions on the arguments +and Nikolaus Lampadariou for the suggestions on displaying raw values) + +## See also + +[polygon](https://rdrr.io/r/graphics/polygon.html) + +## Examples + +``` r + testmat<-matrix(c(runif(50),sample(1:50,50),rnorm(50)+5, + sin(1:50)),ncol=50,byrow=TRUE) + kiteChart(testmat,varlabels=c("Uniform","Sample","Normal","Sine"), + timepos=seq(1,50,by=5),timex=FALSE) + # not enough space for the last label, add it + mtext("Sine",at=65,side=1,line=2) + + # now show it with kite line maxima + kiteChart(testmat,varlabels=c("Uniform","Sample","Normal","Sine"), + timepos=seq(1,50,by=5),timex=FALSE,varscale=TRUE) + mtext("Sine",at=65,side=1,line=2) + + musicmat<-matrix(c(c(0.5,0.4,0.3,0.25,0.2,0.15,0.1,rep(0.05,44))+runif(51,0,0.05), + c(0.1,0.2,0.3,0.35,0.4,0.5,0.4,rep(0.5,14),rep(0.4,15),rep(0.3,15))+runif(51,0,0.1), + rep(0.15,51)+runif(51,0,0.1), + c(rep(0,29),c(0.1,0.2,0.4,0.5,0.3,0.2,rep(0.05,16))+runif(22,0,0.05)), + c(rep(0,38),c(rep(0.05,6),0.08,0.15,0.20,0.25,0.2,0.25,0.3)+runif(13,0,0.05))), + ncol=51,byrow=TRUE) + kiteChart(musicmat,varlabels=c("Swing","Rock","Jazz","Disco","Rap"), + main="An utterly imaginary chart of music popularity", + timepos=seq(1,51,by=10),timelabels=seq(1950,2000,by=10),mar=c(5,4,4,2)) + + # now flip it to vertical, normalize and show the normalization factors + kiteChart(musicmat,varlabels=c("Swing","Rock","Jazz","Disco","Rap"), + main="An utterly imaginary chart of music popularity",xlab="Style", + timepos=seq(1,51,by=10),timelabels=seq(1950,2000,by=10),mar=c(5,4,4,2), + timex=FALSE,normalize=TRUE,shownorm=TRUE) +``` diff --git a/reference/l2010.html b/reference/l2010.html new file mode 100644 index 0000000..b82287d --- /dev/null +++ b/reference/l2010.html @@ -0,0 +1,75 @@ + +World lightning strike data from 2010 — l2010 • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    A list of two 50x100 matrices containing most of the world lightning strike + data from 2010. It was produced by makeDensityMatrix from 171 file + (about 3 Gb) of data consisting in two geographic coordinates for the + approximate location of each recorded strike and an estimated intensity of the + strike in kVA.

    +
    + +
    +

    Usage

    +
    data(l2010)
    +
    + + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/l2010.md b/reference/l2010.md new file mode 100644 index 0000000..2838991 --- /dev/null +++ b/reference/l2010.md @@ -0,0 +1,13 @@ +# World lightning strike data from 2010 + +A list of two 50x100 matrices containing most of the world lightning +strike data from 2010. It was produced by `makeDensityMatrix` from 171 +file (about 3 Gb) of data consisting in two geographic coordinates for +the approximate location of each recorded strike and an estimated +intensity of the strike in kVA. + +## Usage + +``` r +data(l2010) +``` diff --git a/reference/labbePlot-1.png b/reference/labbePlot-1.png new file mode 100644 index 0000000..c6cbba2 Binary files /dev/null and b/reference/labbePlot-1.png differ diff --git a/reference/labbePlot.html b/reference/labbePlot.html new file mode 100644 index 0000000..1166e3f --- /dev/null +++ b/reference/labbePlot.html @@ -0,0 +1,150 @@ + +Display a L'Abbe plot — labbePlot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display the percentages of successes for two conditions to be compared as circles, + the area of which is proportional to the number of observations.

    +
    + +
    +

    Usage

    +
    labbePlot(x,main="L'Abbe plot",xlab="Percent positive response with placebo",
    + ylab="Percent positive response with treatment",labels=NULL,col=NA,
    + circle.mag=0.5,add=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A list of either 2x2 tables or three element vectors (see Details).

    + +
    main
    +

    The title of the plot.

    + +
    xlab,ylab
    +

    The x and y axis labels as in plot.

    + +
    labels
    +

    Text strings that will be displayed in the center of the circles.

    + +
    col
    +

    A list of colors for the circles.

    + +
    circle.mag
    +

    A fudge factor for very small or very large numbers of + observations.

    + +
    add
    +

    Whether to add the information in x to an existing L'Abbe + plot.

    + +
    ...
    +

    additional arguments passed to plot.

    + +
    +
    +

    Details

    +

    The elements of x may be tables in which rows represent the conditions + being compared, with the comparison condition first (often "placebo") and the + condition of interest (often "intervention") second. The columns represent the + counts of successes and failures. The elements of x can also be vectors + with three numeric values, first the percentage of successes for the comparison + condition, second the percentage of successes for the condition of interest and + finally the number of observations. Tables and vectors can be mixed.

    +

    The radius of each circle is the square root of the number of observations + multiplied by circle.mag. This allows very small numbers of observations + to be expanded and very large numbers to be reduced in size. As the area of each + circle is proportional to the number of observations, circle.mag must be + the same for all circles. The user may wish to expand or contract all the circles + on a plot so that they will fit within the box.

    +

    The labels, if not NULL, are displayed on the circles. The function tries to work + out whether white or black text will be more easily read based on the background + color and displays the text accordingly.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon - thanks to Whitney Melroy for asking for it.

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     # first fake something like the data from a clinical trial
    + didf<-data.frame(subject=1:50,interv=rep(c("therapist","ex-drinker"),each=25),
    +  outcome=sample(c("more","less"),50,TRUE))
    + # make it into a table
    + didf.tab<-table(didf$interv,didf$outcome)
    + # now mix in some raw percentages just for the example
    + didf2<-c(74,46,200)
    + didf3<-c(33,87,500)
    + x<-list(didf.tab,didf2,didf3)
    + labbecol<-list("red","green","blue")
    + labbePlot(x,main="Ex-drinkers vs therapists",
    +  xlab="Percent reduced drinking (ex-drinkers)",
    +  ylab="Percent reduced drinking (therapists)",
    + labels=list("A","B52","X117"),col=labbecol)
    + labbePlot(list(c(20,40,20)),col=list("purple"),labels=list("Z"),add=TRUE)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/labbePlot.md b/reference/labbePlot.md new file mode 100644 index 0000000..5849d52 --- /dev/null +++ b/reference/labbePlot.md @@ -0,0 +1,102 @@ +# Display a L'Abbe plot + +Display the percentages of successes for two conditions to be compared +as circles, the area of which is proportional to the number of +observations. + +## Usage + +``` r +labbePlot(x,main="L'Abbe plot",xlab="Percent positive response with placebo", + ylab="Percent positive response with treatment",labels=NULL,col=NA, + circle.mag=0.5,add=FALSE,...) +``` + +## Arguments + +- x: + + A list of either 2x2 tables or three element vectors (see Details). + +- main: + + The title of the plot. + +- xlab,ylab: + + The x and y axis labels as in `plot`. + +- labels: + + Text strings that will be displayed in the center of the circles. + +- col: + + A list of colors for the circles. + +- circle.mag: + + A fudge factor for very small or very large numbers of observations. + +- add: + + Whether to add the information in `x` to an existing L'Abbe plot. + +- ...: + + additional arguments passed to `plot`. + +## Details + +The elements of `x` may be tables in which rows represent the conditions +being compared, with the comparison condition first (often "placebo") +and the condition of interest (often "intervention") second. The columns +represent the counts of successes and failures. The elements of `x` can +also be vectors with three numeric values, first the percentage of +successes for the comparison condition, second the percentage of +successes for the condition of interest and finally the number of +observations. Tables and vectors can be mixed. + +The radius of each circle is the square root of the number of +observations multiplied by `circle.mag`. This allows very small numbers +of observations to be expanded and very large numbers to be reduced in +size. As the area of each circle is proportional to the number of +observations, `circle.mag` must be the same for all circles. The user +may wish to expand or contract all the circles on a plot so that they +will fit within the box. + +The labels, if not NULL, are displayed on the circles. The function +tries to work out whether white or black text will be more easily read +based on the background color and displays the text accordingly. + +## Value + +nil + +## Author + +Jim Lemon - thanks to Whitney Melroy for asking for it. + +## See also + +[draw.circle](draw.circle.md) + +## Examples + +``` r + # first fake something like the data from a clinical trial + didf<-data.frame(subject=1:50,interv=rep(c("therapist","ex-drinker"),each=25), + outcome=sample(c("more","less"),50,TRUE)) + # make it into a table + didf.tab<-table(didf$interv,didf$outcome) + # now mix in some raw percentages just for the example + didf2<-c(74,46,200) + didf3<-c(33,87,500) + x<-list(didf.tab,didf2,didf3) + labbecol<-list("red","green","blue") + labbePlot(x,main="Ex-drinkers vs therapists", + xlab="Percent reduced drinking (ex-drinkers)", + ylab="Percent reduced drinking (therapists)", + labels=list("A","B52","X117"),col=labbecol) + labbePlot(list(c(20,40,20)),col=list("purple"),labels=list("Z"),add=TRUE) +``` diff --git a/reference/ladderplot-1.png b/reference/ladderplot-1.png new file mode 100644 index 0000000..d877b8c Binary files /dev/null and b/reference/ladderplot-1.png differ diff --git a/reference/ladderplot.html b/reference/ladderplot.html new file mode 100644 index 0000000..1a00dc4 --- /dev/null +++ b/reference/ladderplot.html @@ -0,0 +1,150 @@ + +Ladder Plot — ladderplot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Makes a ladder plot, similar to parcoord but with more +flexibility and graphical options.

    +
    + +
    +

    Usage

    +
    ladderplot(x, ...)
    +# Default S3 method
    +ladderplot(x, scale=FALSE, col=1, pch=19, lty=1, 
    +xlim=c(0.5, ncol(x) + 0.5), ylim=range(x), vertical = TRUE, ordered=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A matrix or data frame with at least 2 columns.

    + +
    scale
    +

    Logical, if the original data columns should be scaled to the unit (0-1) interval.

    + +
    col
    +

    Color values to use for rows of x. If longer than 1, its value is recycled.

    + +
    pch
    +

    Point type to use. If longer than 1, its value is recycled.

    + +
    lty
    +

    Line type to use. If longer than 1, its value is recycled.

    + +
    xlim, ylim
    +

    Limits for axes.

    + +
    vertical
    +

    Logical, if the orientation of the ladderplot should be vertical or horizontal.

    + +
    ordered
    +

    Logical, if the columns in x should be ordered.

    + +
    ...
    +

    Other arguments passed to the function stripchart.

    + +
    +
    +

    Details

    +

    The function uses stripchart to plot 1-D scatter plots for each column + in x. Then points are joined by lines for each rows of x.

    +
    +
    +

    Value

    +

    Makes a plot as a side effect. +Returns NULL invisibly.

    +
    +
    +

    Author

    +

    Peter Solymos <solymos@ualberta.ca>

    +
    +
    +

    See also

    +

    lines, points, stripchart

    +

    Almost identical function: parcoord

    +
    + +
    +

    Examples

    +
    x<-data.frame(A=c(1:10), B=c(2:11)+rnorm(10))
    +y<-data.frame(x, C=c(1:10)+rnorm(10))
    +opar <- par(mfrow=c(1,3))
    +ladderplot(x)
    +ladderplot(x, col=1:10, vertical=FALSE)
    +ladderplot(y, col=1:10)
    +
    +par(opar)
    +
    +## examples from parcoord
    +if (FALSE) { # \dontrun{
    +if (require(MASS)) {
    +opar <- par(mfrow=c(2,3))
    +z1 <- state.x77[, c(7, 4, 6, 2, 5, 3)]
    +parcoord(z1, main="parcoord state.x77")
    +ladderplot(z1, pch=NA, scale=TRUE, main="ladderplot state.x77 original")
    +ladderplot(z1, main="ladderplot state.x77 original")
    +ir <- rbind(iris3[,,1], iris3[,,2], iris3[,,3])
    +z2 <- log(ir)[, c(3, 4, 2, 1)]
    +parcoord(z2, col = 1 + (0:149))
    +ladderplot(z2, scale=TRUE, col = 1 + (0:149),
    +    main="ladderplot iris original")
    +ladderplot(z2, col = 1 + (0:149))
    +par(opar)
    +}
    +} # }
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/ladderplot.md b/reference/ladderplot.md new file mode 100644 index 0000000..a603f69 --- /dev/null +++ b/reference/ladderplot.md @@ -0,0 +1,111 @@ +# Ladder Plot + +Makes a ladder plot, similar to +[parcoord](https://rdrr.io/pkg/MASS/man/parcoord.html) but with more +flexibility and graphical options. + +## Usage + +``` r +ladderplot(x, ...) +# Default S3 method +ladderplot(x, scale=FALSE, col=1, pch=19, lty=1, +xlim=c(0.5, ncol(x) + 0.5), ylim=range(x), vertical = TRUE, ordered=FALSE,...) +``` + +## Arguments + +- x: + + A matrix or data frame with at least 2 columns. + +- scale: + + Logical, if the original data columns should be scaled to the unit + (0-1) interval. + +- col: + + Color values to use for rows of `x`. If longer than 1, its value is + recycled. + +- pch: + + Point type to use. If longer than 1, its value is recycled. + +- lty: + + Line type to use. If longer than 1, its value is recycled. + +- xlim, ylim: + + Limits for axes. + +- vertical: + + Logical, if the orientation of the ladderplot should be vertical or + horizontal. + +- ordered: + + Logical, if the columns in `x` should be ordered. + +- ...: + + Other arguments passed to the function + [stripchart](https://rdrr.io/r/graphics/stripchart.html). + +## Details + +The function uses +[stripchart](https://rdrr.io/r/graphics/stripchart.html) to plot 1-D +scatter plots for each column in `x`. Then points are joined by lines +for each rows of `x`. + +## Value + +Makes a plot as a side effect. Returns `NULL` invisibly. + +## Author + +Peter Solymos \ + +## See also + +[lines](https://rdrr.io/r/graphics/lines.html), +[points](https://rdrr.io/r/graphics/points.html), +[stripchart](https://rdrr.io/r/graphics/stripchart.html) + +Almost identical function: +[parcoord](https://rdrr.io/pkg/MASS/man/parcoord.html) + +## Examples + +``` r +x<-data.frame(A=c(1:10), B=c(2:11)+rnorm(10)) +y<-data.frame(x, C=c(1:10)+rnorm(10)) +opar <- par(mfrow=c(1,3)) +ladderplot(x) +ladderplot(x, col=1:10, vertical=FALSE) +ladderplot(y, col=1:10) + +par(opar) + +## examples from parcoord +if (FALSE) { # \dontrun{ +if (require(MASS)) { +opar <- par(mfrow=c(2,3)) +z1 <- state.x77[, c(7, 4, 6, 2, 5, 3)] +parcoord(z1, main="parcoord state.x77") +ladderplot(z1, pch=NA, scale=TRUE, main="ladderplot state.x77 original") +ladderplot(z1, main="ladderplot state.x77 original") +ir <- rbind(iris3[,,1], iris3[,,2], iris3[,,3]) +z2 <- log(ir)[, c(3, 4, 2, 1)] +parcoord(z2, col = 1 + (0:149)) +ladderplot(z2, scale=TRUE, col = 1 + (0:149), + main="ladderplot iris original") +ladderplot(z2, col = 1 + (0:149)) +par(opar) +} +} # } +``` diff --git a/reference/legendg-1.png b/reference/legendg-1.png new file mode 100644 index 0000000..62dcbc7 Binary files /dev/null and b/reference/legendg-1.png differ diff --git a/reference/legendg.html b/reference/legendg.html new file mode 100644 index 0000000..521d91f --- /dev/null +++ b/reference/legendg.html @@ -0,0 +1,201 @@ + +Legend with grouped bars, lines or symbols — legendg • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a legend with more than one rectangle, symbol or line.

    +
    + +
    +

    Usage

    +
    legendg(x,y=NULL,legend,fill=NULL,col=par("col"),          
    + border=list("black"),lty,lwd,pch=NULL,angle=45,density=NULL,       
    + bty="o",bg=par("bg"),box.lwd=par("lwd"),box.lty=par("lty"), 
    + box.col=par("fg"),pt.bg=NA,cex=1,pt.cex=cex,pt.lwd=lwd,  
    + pt.space=1,xjust=0,yjust=1,x.intersp=1,y.intersp=1,
    + adj=c(0,0.5),text.width=NULL,text.col=par("col"),merge=FALSE,
    + trace=FALSE,plot=TRUE,ncol=1,horiz=FALSE,title=NULL,
    + inset=0,xpd,title.col=text.col)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    Position of the legend as in legend.

    + +
    legend
    +

    Labels for the legend as in legend.

    + +
    fill
    +

    List of fill colors for the rectangles.

    + +
    col
    +

    Color(s), perhaps as a list, for the symbols.

    + +
    border
    +

    Border color(s) for the rectangles.

    + +
    lty
    +

    Line type, currently ignored and set to 1.

    + +
    lwd
    +

    Line width, currently ignored.

    + +
    pch
    +

    List of symbols for the legend.

    + +
    angle,density
    +

    Currently ignored.

    + +
    bty
    +

    Legend box type to be displayed.

    + +
    bg
    +

    Background color for the legend.

    + +
    box.lwd,box.lty,box.col
    +

    Line width, type and color + for the surrounding box.

    + +
    cex
    +

    Character expansion for text.

    + +
    pt.bg,pt.cex,pt.lwd
    +

    Background color, character + expansion and line width for the symbols.

    + +
    pt.space
    +

    Spacing for the symbols as a multiplier + for strwidth("O").

    + +
    xjust,yjust
    +

    Justification for the legend.

    + +
    x.intersp,y.intersp
    +

    x and y character spacing for + the legend text.

    + +
    adj
    +

    Text adjustment.

    + +
    text.width,text.col
    +

    Width and color of the legend text.

    + +
    merge
    +

    Whether to merge points and lines.

    + +
    trace
    +

    Show how the legend is calculated.

    + +
    plot
    +

    Whether to plot the legend.

    + +
    ncol
    +

    Number of columns in the legend.

    + +
    horiz
    +

    Whether to display a horizontal legend.

    + +
    title
    +

    Title for the legend.

    + +
    inset
    +

    Inset distances for use with keywords.

    + +
    xpd
    +

    An optional value for par(xpd=).

    + +
    title.col
    +

    Color for the legend title.

    + +
    +
    +

    Value

    +

    The value returned by legend returned invisibly.

    +
    +
    +

    Details

    +

    legendg calls legend to display a legend with a + blank space to the left of the labels. It then attempts to display + groups of colored rectangles or symbols in that space depending + upon the contents of either fill or pch. These + should be in the form of a list with the number of elements equal + to the number of labels, and one or more fills or symbols for each + label. legendg will display up to four fills or symbols + next to each label, allowing the user to label a group of these + rather than just one per label.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     plot(0.5,0.5,xlim=c(0,1),ylim=c(0,1),type="n",
    +  main="Test of grouped legend function")
    + legendg(0.5,0.8,c("one","two","three"),pch=list(1,2:3,4:6),
    +  col=list(1,2:3,4:6),pt.space=1.5)
    + legendg(0.5,0.5,c("one","two","three"),fill=list(1,2:3,4:6))
    + # fake a line/point with text points
    + legendg(0.2,0.25,c("letter","number"),
    +  pch=list(c("-","A","-"),c("-","1","-")),
    +  col=list(rep(2,3),rep(3,3)))
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/legendg.md b/reference/legendg.md new file mode 100644 index 0000000..f6fd813 --- /dev/null +++ b/reference/legendg.md @@ -0,0 +1,167 @@ +# Legend with grouped bars, lines or symbols + +Displays a legend with more than one rectangle, symbol or line. + +## Usage + +``` r +legendg(x,y=NULL,legend,fill=NULL,col=par("col"), + border=list("black"),lty,lwd,pch=NULL,angle=45,density=NULL, + bty="o",bg=par("bg"),box.lwd=par("lwd"),box.lty=par("lty"), + box.col=par("fg"),pt.bg=NA,cex=1,pt.cex=cex,pt.lwd=lwd, + pt.space=1,xjust=0,yjust=1,x.intersp=1,y.intersp=1, + adj=c(0,0.5),text.width=NULL,text.col=par("col"),merge=FALSE, + trace=FALSE,plot=TRUE,ncol=1,horiz=FALSE,title=NULL, + inset=0,xpd,title.col=text.col) +``` + +## Arguments + +- x,y: + + Position of the legend as in `legend`. + +- legend: + + Labels for the legend as in `legend`. + +- fill: + + List of fill colors for the rectangles. + +- col: + + Color(s), perhaps as a list, for the symbols. + +- border: + + Border color(s) for the rectangles. + +- lty: + + Line type, currently ignored and set to 1. + +- lwd: + + Line width, currently ignored. + +- pch: + + List of symbols for the legend. + +- angle,density: + + Currently ignored. + +- bty: + + Legend box type to be displayed. + +- bg: + + Background color for the legend. + +- box.lwd,box.lty,box.col: + + Line width, type and color for the surrounding box. + +- cex: + + Character expansion for text. + +- pt.bg,pt.cex,pt.lwd: + + Background color, character expansion and line width for the symbols. + +- pt.space: + + Spacing for the symbols as a multiplier for `strwidth("O")`. + +- xjust,yjust: + + Justification for the legend. + +- x.intersp,y.intersp: + + x and y character spacing for the legend text. + +- adj: + + Text adjustment. + +- text.width,text.col: + + Width and color of the legend text. + +- merge: + + Whether to merge points and lines. + +- trace: + + Show how the legend is calculated. + +- plot: + + Whether to plot the legend. + +- ncol: + + Number of columns in the legend. + +- horiz: + + Whether to display a horizontal legend. + +- title: + + Title for the legend. + +- inset: + + Inset distances for use with keywords. + +- xpd: + + An optional value for `par(xpd=)`. + +- title.col: + + Color for the legend title. + +## Value + +The value returned by `legend` returned invisibly. + +## Details + +`legendg` calls `legend` to display a legend with a blank space to the +left of the labels. It then attempts to display groups of colored +rectangles or symbols in that space depending upon the contents of +either `fill` or `pch`. These should be in the form of a list with the +number of elements equal to the number of labels, and one or more fills +or symbols for each label. `legendg` will display up to four fills or +symbols next to each label, allowing the user to label a group of these +rather than just one per label. + +## Author + +Jim Lemon + +## See also + +[legend](https://rdrr.io/r/graphics/legend.html) + +## Examples + +``` r + plot(0.5,0.5,xlim=c(0,1),ylim=c(0,1),type="n", + main="Test of grouped legend function") + legendg(0.5,0.8,c("one","two","three"),pch=list(1,2:3,4:6), + col=list(1,2:3,4:6),pt.space=1.5) + legendg(0.5,0.5,c("one","two","three"),fill=list(1,2:3,4:6)) + # fake a line/point with text points + legendg(0.2,0.25,c("letter","number"), + pch=list(c("-","A","-"),c("-","1","-")), + col=list(rep(2,3),rep(3,3))) +``` diff --git a/reference/lengthKey-1.png b/reference/lengthKey-1.png new file mode 100644 index 0000000..2a6ed6d Binary files /dev/null and b/reference/lengthKey-1.png differ diff --git a/reference/lengthKey.html b/reference/lengthKey.html new file mode 100644 index 0000000..a6cf9f9 --- /dev/null +++ b/reference/lengthKey.html @@ -0,0 +1,109 @@ + +Key for interpreting lengths in a plot — lengthKey • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Key for interpreting lengths in a plot

    +
    + +
    +

    Usage

    +
    lengthKey(x,y,tickpos,scale)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    The position of the left end of the key in user units.

    + +
    tickpos
    +

    The labels that will appear above the key.

    + +
    scale
    +

    A value that will scale the length of the key.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    lengthKey displays a line with tick marks and the values in + tickpos above those tickmarks. It is useful when line segments + on a plot represent numeric values. Note that if the plot does not have + a 1:1 aspect ratio, a length key is usually misleading.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     # manufacture a matrix of orientations in radians
    + o<-matrix(rep(pi*seq(0.1,0.8,by=0.1),7),ncol=8,byrow=TRUE)
    + m<-matrix(rnorm(56)+4,ncol=8,byrow=TRUE)
    + # get an empty plot of approximately 1:1 aspect ratio
    + plot(0,xlim=c(0.7,8.3),ylim=c(0.7,7.3),type="n")
    + vectorField(o,m,vecspec="rad")
    + # the scaling usually has to be worked out by trial and error
    + lengthKey(0.3,-0.5,c(0,5,10),0.24)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/lengthKey.md b/reference/lengthKey.md new file mode 100644 index 0000000..3460303 --- /dev/null +++ b/reference/lengthKey.md @@ -0,0 +1,56 @@ +# Key for interpreting lengths in a plot + +Key for interpreting lengths in a plot + +## Usage + +``` r +lengthKey(x,y,tickpos,scale) +``` + +## Arguments + +- x,y: + + The position of the left end of the key in user units. + +- tickpos: + + The labels that will appear above the key. + +- scale: + + A value that will scale the length of the key. + +## Value + +nil + +## Details + +`lengthKey` displays a line with tick marks and the values in `tickpos` +above those tickmarks. It is useful when line segments on a plot +represent numeric values. Note that if the plot does not have a 1:1 +aspect ratio, a length key is usually misleading. + +## Author + +Jim Lemon + +## See also + +[segments](https://rdrr.io/r/graphics/segments.html), +[arrows](https://rdrr.io/r/graphics/arrows.html) + +## Examples + +``` r + # manufacture a matrix of orientations in radians + o<-matrix(rep(pi*seq(0.1,0.8,by=0.1),7),ncol=8,byrow=TRUE) + m<-matrix(rnorm(56)+4,ncol=8,byrow=TRUE) + # get an empty plot of approximately 1:1 aspect ratio + plot(0,xlim=c(0.7,8.3),ylim=c(0.7,7.3),type="n") + vectorField(o,m,vecspec="rad") + # the scaling usually has to be worked out by trial and error + lengthKey(0.3,-0.5,c(0,5,10),0.24) +``` diff --git a/reference/makeDensityMatrix-1.png b/reference/makeDensityMatrix-1.png new file mode 100644 index 0000000..295ed4d Binary files /dev/null and b/reference/makeDensityMatrix-1.png differ diff --git a/reference/makeDensityMatrix.html b/reference/makeDensityMatrix.html new file mode 100644 index 0000000..41da384 --- /dev/null +++ b/reference/makeDensityMatrix.html @@ -0,0 +1,160 @@ + +Compute a matrix of counts from a list of x,y positions — makeDensityMatrix • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Compute a matrix in which the counts in each cell represent the number of + occurrences of that cell's coordinates in a list of x,y cooordinate values, + optionally computing a second matrix of the average of the values attached + to the coordinate observations.

    +
    + +
    +

    Usage

    +
    makeDensityMatrix(x,y,z=NULL,nx=100,ny=50,zfun=c("mean","sum"),
    + xlim=c(-180,180),ylim=c(-90,90),geocoord=TRUE)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    Vectors of x and y coordinates. These are usually combined in a + matrix or data frame of two columns.

    + +
    z
    +

    Optional values attached to each coordinate pair. If these are present, + it can be in a matrix or data frame of three columns, x, y and z.

    + +
    nx
    +

    The number of "x" cells in the output matrix.

    + +
    ny
    +

    The number of "y" cells in the output matrix.

    + +
    zfun
    +

    The function to apply to the summed values attached to each + coordinate pair. Currently defaults to mean, otherwise the sum is returned.

    + +
    xlim
    +

    The extreme coordinates in the horizontal direction (see Details).

    + +
    ylim
    +

    The extreme coordinates in the vertical direction (see Details).

    + +
    geocoord
    +

    Whether to correct the matrix values for the areal distortion + of the Mercator projection.

    + +
    +
    +

    Details

    +

    makeDensityMatrix expects two vectors or a matrix or data frame with + at least two columns. The function was written for geographic coordinates, + but will also work for other numeric coordinates. An optional third vector + or column of values for each coordinate will be processed.

    +

    Each coordinate pair adds to the count in that cell of the matrix. If there + is a third element, that value is added to a second matrix in the same + position. By default, the function computes the mean of all values in each + cell. If zfun="sum", the sum of values in each cell will be returned.

    +

    As geograhic data sets may be very large, leading to memory problems, + makeDensityMatrix can be run on small sections of the data set and the + resulting matrices added together as long as the coordinate limits are + consistent throughout.

    +
    +
    +

    Value

    +

    Either a matrix of counts of coordinate pairs within each cell or a list of + two such matrices, the second containing the mean or sum of values associated + with coordinate pairs.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     x<-sample(1:20,400,TRUE)
    + y<-sample(1:20,400,TRUE)
    + z<-runif(400,5,20)
    + xyz<-makeDensityMatrix(x,y,z,nx=20,ny=20,xlim=c(1,10),ylim=c(1,10),
    +  geocoord=FALSE)
    +#> Range of density (>0) - 1 5 
    +#> Range of intensity (>0) - 5.111809 19.95792 
    + par(mar=c(7,3,2,3))
    + plot(0,xlim=c(1,10),ylim=c(1,10),type="n",xlab="",axes=FALSE)
    + box()
    + densityGrid(xyz,range.cex=c(1,4),xlim=c(1,10),ylim=c(1,10),
    +  red=c(0,0.5,0.8,1),green=c(1,0.8,0.5,0),blue=0,pch=15)
    + color.legend(3,-0.7,7,-0.2,c(5,10,15,20),
    +  rect.col=color.scale(1:4,cs1=c(0,0.5,0.8,1),cs2=c(1,0.8,0.5,0),cs3=0,alpha=1))
    + par(xpd=TRUE)
    + text(5,0.3,"Intensity")
    + points(c(3.5,4.5,5.5,6.5),rep(-1.7,4),pch=15,cex=1:4)
    + text(c(3.5,4.5,5.5,6.5),rep(-1.3,4),1:4)
    + text(5,-1,"Density")
    +
    + par(xpd=FALSE)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/makeDensityMatrix.md b/reference/makeDensityMatrix.md new file mode 100644 index 0000000..ed8d1cf --- /dev/null +++ b/reference/makeDensityMatrix.md @@ -0,0 +1,111 @@ +# Compute a matrix of counts from a list of x,y positions + +Compute a matrix in which the counts in each cell represent the number +of occurrences of that cell's coordinates in a list of x,y cooordinate +values, optionally computing a second matrix of the average of the +values attached to the coordinate observations. + +## Usage + +``` r +makeDensityMatrix(x,y,z=NULL,nx=100,ny=50,zfun=c("mean","sum"), + xlim=c(-180,180),ylim=c(-90,90),geocoord=TRUE) +``` + +## Arguments + +- x,y: + + Vectors of x and y coordinates. These are usually combined in a matrix + or data frame of two columns. + +- z: + + Optional values attached to each coordinate pair. If these are + present, it can be in a matrix or data frame of three columns, x, y + and z. + +- nx: + + The number of "x" cells in the output matrix. + +- ny: + + The number of "y" cells in the output matrix. + +- zfun: + + The function to apply to the summed values attached to each coordinate + pair. Currently defaults to mean, otherwise the sum is returned. + +- xlim: + + The extreme coordinates in the horizontal direction (see Details). + +- ylim: + + The extreme coordinates in the vertical direction (see Details). + +- geocoord: + + Whether to correct the matrix values for the areal distortion of the + Mercator projection. + +## Details + +`makeDensityMatrix` expects two vectors or a matrix or data frame with +at least two columns. The function was written for geographic +coordinates, but will also work for other numeric coordinates. An +optional third vector or column of values for each coordinate will be +processed. + +Each coordinate pair adds to the count in that cell of the matrix. If +there is a third element, that value is added to a second matrix in the +same position. By default, the function computes the mean of all values +in each cell. If `zfun="sum"`, the sum of values in each cell will be +returned. + +As geograhic data sets may be very large, leading to memory problems, +`makeDensityMatrix` can be run on small sections of the data set and the +resulting matrices added together as long as the coordinate limits are +consistent throughout. + +## Value + +Either a matrix of counts of coordinate pairs within each cell or a list +of two such matrices, the second containing the mean or sum of values +associated with coordinate pairs. + +## Author + +Jim Lemon + +## See also + +[densityGrid](densityGrid.md) + +## Examples + +``` r + x<-sample(1:20,400,TRUE) + y<-sample(1:20,400,TRUE) + z<-runif(400,5,20) + xyz<-makeDensityMatrix(x,y,z,nx=20,ny=20,xlim=c(1,10),ylim=c(1,10), + geocoord=FALSE) +#> Range of density (>0) - 1 5 +#> Range of intensity (>0) - 5.111809 19.95792 + par(mar=c(7,3,2,3)) + plot(0,xlim=c(1,10),ylim=c(1,10),type="n",xlab="",axes=FALSE) + box() + densityGrid(xyz,range.cex=c(1,4),xlim=c(1,10),ylim=c(1,10), + red=c(0,0.5,0.8,1),green=c(1,0.8,0.5,0),blue=0,pch=15) + color.legend(3,-0.7,7,-0.2,c(5,10,15,20), + rect.col=color.scale(1:4,cs1=c(0,0.5,0.8,1),cs2=c(1,0.8,0.5,0),cs3=0,alpha=1)) + par(xpd=TRUE) + text(5,0.3,"Intensity") + points(c(3.5,4.5,5.5,6.5),rep(-1.7,4),pch=15,cex=1:4) + text(c(3.5,4.5,5.5,6.5),rep(-1.3,4),1:4) + text(5,-1,"Density") + + par(xpd=FALSE) +``` diff --git a/reference/makeIntersectList.html b/reference/makeIntersectList.html new file mode 100644 index 0000000..f52ddaf --- /dev/null +++ b/reference/makeIntersectList.html @@ -0,0 +1,236 @@ + +Count set intersections — makeIntersectList • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Create a list of set intersections from a matrix of indicators

    +
    + +
    +

    Usage

    +
    makeIntersectList(x,xnames=NULL,sep="+")
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A data frame or matrix where rows represent objects and columns + attributes. A 1 or TRUE indicates that the object (row) has + that attribute or is a member of that set (column). x can also be + a matrix or data frame in which the first column contains object identifiers + and the second contains attribute codes.

    + +
    xnames
    +

    Optional user-supplied names for the attributes of x.

    + +
    sep
    +

    A character to use as a separator for attribute labels.

    + +
    +
    +

    Details

    +

    makeIntersectList reads a matrix (or data frame where all values are the + same type) containing dichotomous values (either 0/1 or FALSE/TRUE) or labels + (see next paragraph). In the first type of input, each row represents an object + and each column represents a set. A value of 1 or TRUE indicates that that + object is a member of that set. The function creates a list of vectors that + correspond to all combinations of the sets (set intersections) and inserts the + counts of elements in each combination. If a row of x is all zeros, + it will not be counted, but the second last element of the list returned + contains the count of rows in x and thus non-members can be calculated.

    +

    If a matrix (or data frame where all values are the same type) containing values + other than 0/1 or TRUE/FALSE, it will be passed to categoryReshape for + conversion to a data frame as described above. See categoryReshape for + details of this.

    +

    makeIntersectList combines the set or attribute names to form + intersection names. For the intersection of sets A and B, the name will + be A+B (unless sep is changed) and so on. These are the names that will + be displayed by intersectDiagram. To change these, use the xnames + argument.

    +
    +
    +

    Value

    +

    A list of the intersection counts or percentages, the total number of + objects and the attribute codes.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + + +
    +

    Examples

    +
     # create a matrix where each row represents an element and
    + # a 1 (or TRUE) in each column indicates that the element is a member
    + # of that set.
    + setdf<-data.frame(A=sample(c(0,1),100,TRUE,prob=c(0.7,0.3)),
    +  B=sample(c(0,1),100,TRUE,prob=c(0.7,0.3)),
    +  C=sample(c(0,1),100,TRUE,prob=c(0.7,0.3)),
    +  D=sample(c(0,1),100,TRUE,prob=c(0.7,0.3)))
    + makeIntersectList(setdf)
    +#> [[1]]
    +#> 0+1 
    +#>   2 
    +#> 
    +#> [[2]]
    +#> Total 
    +#>     2 
    +#> 
    +#> [[3]]
    +#> attributes       <NA> 
    +#>        "0"        "1" 
    +#> 
    +#> attr(,"class")
    +#> [1] "intersectList"
    + ns<-sample(1:8,20,TRUE)
    + objects<-0
    + for(i in 1:length(ns)) objects<-c(objects,rep(i,ns[i]))
    + attributes<-"Z"
    + for(i in 1:length(ns)) attributes<-c(attributes,sample(LETTERS[1:8],ns[i]))
    + setdf2<-data.frame(objects[-1],attributes[-1])
    + makeIntersectList(setdf2)
    +#> [[1]]
    +#> A B C D E F G H 
    +#> 0 0 0 0 0 1 0 0 
    +#> 
    +#> [[2]]
    +#> A+B A+C A+D A+E A+F A+G A+H B+C B+D B+E B+F B+G B+H C+D C+E C+F C+G C+H D+E D+F 
    +#>   0   0   0   0   0   0   0   0   0   1   0   1   1   0   0   0   0   0   0   0 
    +#> D+G D+H E+F E+G E+H F+G F+H G+H 
    +#>   0   0   0   0   0   0   0   0 
    +#> 
    +#> [[3]]
    +#> A+B+C A+B+D A+B+E A+B+F A+B+G A+B+H A+C+D A+C+E A+C+F A+C+G A+C+H A+D+E A+D+F 
    +#>     0     0     0     0     0     0     0     0     0     0     0     0     0 
    +#> A+D+G A+D+H A+E+F A+E+G A+E+H A+F+G A+F+H A+G+H B+C+D B+C+E B+C+F B+C+G B+C+H 
    +#>     0     0     0     0     0     1     0     0     0     0     0     0     0 
    +#> B+D+E B+D+F B+D+G B+D+H B+E+F B+E+G B+E+H B+F+G B+F+H B+G+H C+D+E C+D+F C+D+G 
    +#>     0     0     0     0     0     0     0     0     0     0     1     0     0 
    +#> C+D+H C+E+F C+E+G C+E+H C+F+G C+F+H C+G+H D+E+F D+E+G D+E+H D+F+G D+F+H D+G+H 
    +#>     0     0     0     0     0     0     0     0     0     0     0     0     0 
    +#> E+F+G E+F+H E+G+H F+G+H 
    +#>     0     0     0     0 
    +#> 
    +#> [[4]]
    +#> A+B+C+D A+B+C+E A+B+C+F A+B+C+G A+B+C+H A+B+D+E A+B+D+F A+B+D+G A+B+D+H A+B+E+F 
    +#>       0       0       0       0       0       1       0       0       0       0 
    +#> A+B+E+G A+B+E+H A+B+F+G A+B+F+H A+B+G+H A+C+D+E A+C+D+F A+C+D+G A+C+D+H A+C+E+F 
    +#>       0       1       0       1       0       0       0       0       0       0 
    +#> A+C+E+G A+C+E+H A+C+F+G A+C+F+H A+C+G+H A+D+E+F A+D+E+G A+D+E+H A+D+F+G A+D+F+H 
    +#>       0       0       0       0       0       0       0       0       0       0 
    +#> A+D+G+H A+E+F+G A+E+F+H A+E+G+H A+F+G+H B+C+D+E B+C+D+F B+C+D+G B+C+D+H B+C+E+F 
    +#>       0       0       0       0       0       0       0       0       0       0 
    +#> B+C+E+G B+C+E+H B+C+F+G B+C+F+H B+C+G+H B+D+E+F B+D+E+G B+D+E+H B+D+F+G B+D+F+H 
    +#>       0       0       0       0       0       0       0       0       0       0 
    +#> B+D+G+H B+E+F+G B+E+F+H B+E+G+H B+F+G+H C+D+E+F C+D+E+G C+D+E+H C+D+F+G C+D+F+H 
    +#>       0       0       0       0       0       0       0       0       0       0 
    +#> C+D+G+H C+E+F+G C+E+F+H C+E+G+H C+F+G+H D+E+F+G D+E+F+H D+E+G+H D+F+G+H E+F+G+H 
    +#>       0       0       0       0       0       0       0       0       0       0 
    +#> 
    +#> [[5]]
    +#> A+B+C+D+E A+B+C+D+F A+B+C+D+G A+B+C+D+H A+B+C+E+F A+B+C+E+G A+B+C+E+H A+B+C+F+G 
    +#>         0         0         0         0         0         0         0         0 
    +#> A+B+C+F+H A+B+C+G+H A+B+D+E+F A+B+D+E+G A+B+D+E+H A+B+D+F+G A+B+D+F+H A+B+D+G+H 
    +#>         0         0         0         0         0         0         0         0 
    +#> A+B+E+F+G A+B+E+F+H A+B+E+G+H A+B+F+G+H A+C+D+E+F A+C+D+E+G A+C+D+E+H A+C+D+F+G 
    +#>         0         0         0         1         0         0         0         0 
    +#> A+C+D+F+H A+C+D+G+H A+C+E+F+G A+C+E+F+H A+C+E+G+H A+C+F+G+H A+D+E+F+G A+D+E+F+H 
    +#>         0         0         0         0         0         0         0         1 
    +#> A+D+E+G+H A+D+F+G+H A+E+F+G+H B+C+D+E+F B+C+D+E+G B+C+D+E+H B+C+D+F+G B+C+D+F+H 
    +#>         0         0         0         0         0         0         0         0 
    +#> B+C+D+G+H B+C+E+F+G B+C+E+F+H B+C+E+G+H B+C+F+G+H B+D+E+F+G B+D+E+F+H B+D+E+G+H 
    +#>         0         0         0         0         0         0         0         0 
    +#> B+D+F+G+H B+E+F+G+H C+D+E+F+G C+D+E+F+H C+D+E+G+H C+D+F+G+H C+E+F+G+H D+E+F+G+H 
    +#>         0         0         0         0         0         0         0         0 
    +#> 
    +#> [[6]]
    +#> A+B+C+D+E+F A+B+C+D+E+G A+B+C+D+E+H A+B+C+D+F+G A+B+C+D+F+H A+B+C+D+G+H 
    +#>           0           0           0           0           0           0 
    +#> A+B+C+E+F+G A+B+C+E+F+H A+B+C+E+G+H A+B+C+F+G+H A+B+D+E+F+G A+B+D+E+F+H 
    +#>           0           0           1           0           0           0 
    +#> A+B+D+E+G+H A+B+D+F+G+H A+B+E+F+G+H A+C+D+E+F+G A+C+D+E+F+H A+C+D+E+G+H 
    +#>           0           0           0           1           0           0 
    +#> A+C+D+F+G+H A+C+E+F+G+H A+D+E+F+G+H B+C+D+E+F+G B+C+D+E+F+H B+C+D+E+G+H 
    +#>           0           0           0           0           0           0 
    +#> B+C+D+F+G+H B+C+E+F+G+H B+D+E+F+G+H C+D+E+F+G+H 
    +#>           0           0           0           0 
    +#> 
    +#> [[7]]
    +#> A+B+C+D+E+F+G A+B+C+D+E+F+H A+B+C+D+E+G+H A+B+C+D+F+G+H A+B+C+E+F+G+H 
    +#>             0             1             0             0             1 
    +#> A+B+D+E+F+G+H A+C+D+E+F+G+H B+C+D+E+F+G+H 
    +#>             1             0             1 
    +#> 
    +#> [[8]]
    +#> A+B+C+D+E+F+G+H 
    +#>               3 
    +#> 
    +#> [[9]]
    +#> Total 
    +#>    20 
    +#> 
    +#> [[10]]
    +#> attributes       <NA>       <NA>       <NA>       <NA>       <NA>       <NA> 
    +#>        "A"        "B"        "C"        "D"        "E"        "F"        "G" 
    +#>       <NA> 
    +#>        "H" 
    +#> 
    +#> attr(,"class")
    +#> [1] "intersectList"
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/makeIntersectList.md b/reference/makeIntersectList.md new file mode 100644 index 0000000..cd0b404 --- /dev/null +++ b/reference/makeIntersectList.md @@ -0,0 +1,187 @@ +# Count set intersections + +Create a list of set intersections from a matrix of indicators + +## Usage + +``` r +makeIntersectList(x,xnames=NULL,sep="+") +``` + +## Arguments + +- x: + + A data frame or matrix where rows represent objects and columns + attributes. A `1` or `TRUE` indicates that the object (row) has that + attribute or is a member of that set (column). `x` can also be a + matrix or data frame in which the first column contains object + identifiers and the second contains attribute codes. + +- xnames: + + Optional user-supplied names for the attributes of x. + +- sep: + + A character to use as a separator for attribute labels. + +## Details + +`makeIntersectList` reads a matrix (or data frame where all values are +the same type) containing dichotomous values (either 0/1 or FALSE/TRUE) +or labels (see next paragraph). In the first type of input, each row +represents an object and each column represents a set. A value of 1 or +TRUE indicates that that object is a member of that set. The function +creates a list of vectors that correspond to all combinations of the +sets (set intersections) and inserts the counts of elements in each +combination. If a row of `x` is all zeros, it will not be counted, but +the second last element of the list returned contains the count of rows +in `x` and thus non-members can be calculated. + +If a matrix (or data frame where all values are the same type) +containing values other than 0/1 or TRUE/FALSE, it will be passed to +`categoryReshape` for conversion to a data frame as described above. See +`categoryReshape` for details of this. + +makeIntersectList combines the set or attribute names to form +intersection names. For the intersection of sets A and B, the name will +be A+B (unless `sep` is changed) and so on. These are the names that +will be displayed by `intersectDiagram`. To change these, use the +`xnames` argument. + +## Value + +A list of the intersection counts or percentages, the total number of +objects and the attribute codes. + +## Author + +Jim Lemon + +## See also + +[intersectDiagram](intersectDiagram.md), +[pasteCols](pasteCols.md),[categoryReshape](categoryReshape.md) + +## Examples + +``` r + # create a matrix where each row represents an element and + # a 1 (or TRUE) in each column indicates that the element is a member + # of that set. + setdf<-data.frame(A=sample(c(0,1),100,TRUE,prob=c(0.7,0.3)), + B=sample(c(0,1),100,TRUE,prob=c(0.7,0.3)), + C=sample(c(0,1),100,TRUE,prob=c(0.7,0.3)), + D=sample(c(0,1),100,TRUE,prob=c(0.7,0.3))) + makeIntersectList(setdf) +#> [[1]] +#> 0+1 +#> 2 +#> +#> [[2]] +#> Total +#> 2 +#> +#> [[3]] +#> attributes +#> "0" "1" +#> +#> attr(,"class") +#> [1] "intersectList" + ns<-sample(1:8,20,TRUE) + objects<-0 + for(i in 1:length(ns)) objects<-c(objects,rep(i,ns[i])) + attributes<-"Z" + for(i in 1:length(ns)) attributes<-c(attributes,sample(LETTERS[1:8],ns[i])) + setdf2<-data.frame(objects[-1],attributes[-1]) + makeIntersectList(setdf2) +#> [[1]] +#> A B C D E F G H +#> 0 0 0 0 0 1 0 0 +#> +#> [[2]] +#> A+B A+C A+D A+E A+F A+G A+H B+C B+D B+E B+F B+G B+H C+D C+E C+F C+G C+H D+E D+F +#> 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 +#> D+G D+H E+F E+G E+H F+G F+H G+H +#> 0 0 0 0 0 0 0 0 +#> +#> [[3]] +#> A+B+C A+B+D A+B+E A+B+F A+B+G A+B+H A+C+D A+C+E A+C+F A+C+G A+C+H A+D+E A+D+F +#> 0 0 0 0 0 0 0 0 0 0 0 0 0 +#> A+D+G A+D+H A+E+F A+E+G A+E+H A+F+G A+F+H A+G+H B+C+D B+C+E B+C+F B+C+G B+C+H +#> 0 0 0 0 0 1 0 0 0 0 0 0 0 +#> B+D+E B+D+F B+D+G B+D+H B+E+F B+E+G B+E+H B+F+G B+F+H B+G+H C+D+E C+D+F C+D+G +#> 0 0 0 0 0 0 0 0 0 0 1 0 0 +#> C+D+H C+E+F C+E+G C+E+H C+F+G C+F+H C+G+H D+E+F D+E+G D+E+H D+F+G D+F+H D+G+H +#> 0 0 0 0 0 0 0 0 0 0 0 0 0 +#> E+F+G E+F+H E+G+H F+G+H +#> 0 0 0 0 +#> +#> [[4]] +#> A+B+C+D A+B+C+E A+B+C+F A+B+C+G A+B+C+H A+B+D+E A+B+D+F A+B+D+G A+B+D+H A+B+E+F +#> 0 0 0 0 0 1 0 0 0 0 +#> A+B+E+G A+B+E+H A+B+F+G A+B+F+H A+B+G+H A+C+D+E A+C+D+F A+C+D+G A+C+D+H A+C+E+F +#> 0 1 0 1 0 0 0 0 0 0 +#> A+C+E+G A+C+E+H A+C+F+G A+C+F+H A+C+G+H A+D+E+F A+D+E+G A+D+E+H A+D+F+G A+D+F+H +#> 0 0 0 0 0 0 0 0 0 0 +#> A+D+G+H A+E+F+G A+E+F+H A+E+G+H A+F+G+H B+C+D+E B+C+D+F B+C+D+G B+C+D+H B+C+E+F +#> 0 0 0 0 0 0 0 0 0 0 +#> B+C+E+G B+C+E+H B+C+F+G B+C+F+H B+C+G+H B+D+E+F B+D+E+G B+D+E+H B+D+F+G B+D+F+H +#> 0 0 0 0 0 0 0 0 0 0 +#> B+D+G+H B+E+F+G B+E+F+H B+E+G+H B+F+G+H C+D+E+F C+D+E+G C+D+E+H C+D+F+G C+D+F+H +#> 0 0 0 0 0 0 0 0 0 0 +#> C+D+G+H C+E+F+G C+E+F+H C+E+G+H C+F+G+H D+E+F+G D+E+F+H D+E+G+H D+F+G+H E+F+G+H +#> 0 0 0 0 0 0 0 0 0 0 +#> +#> [[5]] +#> A+B+C+D+E A+B+C+D+F A+B+C+D+G A+B+C+D+H A+B+C+E+F A+B+C+E+G A+B+C+E+H A+B+C+F+G +#> 0 0 0 0 0 0 0 0 +#> A+B+C+F+H A+B+C+G+H A+B+D+E+F A+B+D+E+G A+B+D+E+H A+B+D+F+G A+B+D+F+H A+B+D+G+H +#> 0 0 0 0 0 0 0 0 +#> A+B+E+F+G A+B+E+F+H A+B+E+G+H A+B+F+G+H A+C+D+E+F A+C+D+E+G A+C+D+E+H A+C+D+F+G +#> 0 0 0 1 0 0 0 0 +#> A+C+D+F+H A+C+D+G+H A+C+E+F+G A+C+E+F+H A+C+E+G+H A+C+F+G+H A+D+E+F+G A+D+E+F+H +#> 0 0 0 0 0 0 0 1 +#> A+D+E+G+H A+D+F+G+H A+E+F+G+H B+C+D+E+F B+C+D+E+G B+C+D+E+H B+C+D+F+G B+C+D+F+H +#> 0 0 0 0 0 0 0 0 +#> B+C+D+G+H B+C+E+F+G B+C+E+F+H B+C+E+G+H B+C+F+G+H B+D+E+F+G B+D+E+F+H B+D+E+G+H +#> 0 0 0 0 0 0 0 0 +#> B+D+F+G+H B+E+F+G+H C+D+E+F+G C+D+E+F+H C+D+E+G+H C+D+F+G+H C+E+F+G+H D+E+F+G+H +#> 0 0 0 0 0 0 0 0 +#> +#> [[6]] +#> A+B+C+D+E+F A+B+C+D+E+G A+B+C+D+E+H A+B+C+D+F+G A+B+C+D+F+H A+B+C+D+G+H +#> 0 0 0 0 0 0 +#> A+B+C+E+F+G A+B+C+E+F+H A+B+C+E+G+H A+B+C+F+G+H A+B+D+E+F+G A+B+D+E+F+H +#> 0 0 1 0 0 0 +#> A+B+D+E+G+H A+B+D+F+G+H A+B+E+F+G+H A+C+D+E+F+G A+C+D+E+F+H A+C+D+E+G+H +#> 0 0 0 1 0 0 +#> A+C+D+F+G+H A+C+E+F+G+H A+D+E+F+G+H B+C+D+E+F+G B+C+D+E+F+H B+C+D+E+G+H +#> 0 0 0 0 0 0 +#> B+C+D+F+G+H B+C+E+F+G+H B+D+E+F+G+H C+D+E+F+G+H +#> 0 0 0 0 +#> +#> [[7]] +#> A+B+C+D+E+F+G A+B+C+D+E+F+H A+B+C+D+E+G+H A+B+C+D+F+G+H A+B+C+E+F+G+H +#> 0 1 0 0 1 +#> A+B+D+E+F+G+H A+C+D+E+F+G+H B+C+D+E+F+G+H +#> 1 0 1 +#> +#> [[8]] +#> A+B+C+D+E+F+G+H +#> 3 +#> +#> [[9]] +#> Total +#> 20 +#> +#> [[10]] +#> attributes +#> "A" "B" "C" "D" "E" "F" "G" +#> +#> "H" +#> +#> attr(,"class") +#> [1] "intersectList" +``` diff --git a/reference/maxEmptyRect-1.png b/reference/maxEmptyRect-1.png new file mode 100644 index 0000000..dac158d Binary files /dev/null and b/reference/maxEmptyRect-1.png differ diff --git a/reference/maxEmptyRect.html b/reference/maxEmptyRect.html new file mode 100644 index 0000000..3754756 --- /dev/null +++ b/reference/maxEmptyRect.html @@ -0,0 +1,112 @@ + +Find an empty space on a plot — maxEmptyRect • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Try to find the largest empty rectangle on a plot.

    +
    + +
    +

    Usage

    +
    maxEmptyRect(ax,ay,x,y)
    +
    + +
    +

    Arguments

    +

    +
    ax,ay
    +

    The rectangle within which all of the points are contained. + Usually the limits of a plot.

    + +
    x,y
    +

    x and y positions of the points.

    + +
    +
    +

    Details

    +

    maxEmptyRect searches the pairs of points on the plot to find + the largest rectangular space within which none of the points lie. + It does not guarantee that the space will be large enough to fit a + legend or text.

    +

    Two alternatives are the largest.empty function in the + Hmisc package and the emptyspace function. maxEmptyRect + appears to outperform emptyspace, particularly in running time. + However, emptyspace will sometimes find a "squarer" rectangle when + maxEmptyRect finds a slightly larger narrow rectangle.

    +
    +
    +

    Value

    +

    A list containing the area of the rectangle and the coordinates of the + lower left and upper right corners (as used in rect) of the rectangle + found.

    +
    +
    +

    Author

    +

    Hans Borchers

    +
    +
    +

    References

    +

    A. Naamad, D. T. Lee, and W.-L. Hsu (1984). On the Maximum Empty + Rectangle Problem. Discrete Applied Mathematics, 8: 267-277.

    +
    + +
    +

    Examples

    +
     x<-runif(100)
    + y<-runif(100)
    + plot(x,y,main="Find the maximum empty rectangle",xlab="X",ylab="Y")
    + mer<-maxEmptyRect(c(0,1),c(0,1),x,y)
    + rect(mer$rect[1],mer$rect[2],mer$rect[3],mer$rect[4],border="red")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/maxEmptyRect.md b/reference/maxEmptyRect.md new file mode 100644 index 0000000..44b3d12 --- /dev/null +++ b/reference/maxEmptyRect.md @@ -0,0 +1,58 @@ +# Find an empty space on a plot + +Try to find the largest empty rectangle on a plot. + +## Usage + +``` r +maxEmptyRect(ax,ay,x,y) +``` + +## Arguments + +- ax,ay: + + The rectangle within which all of the points are contained. Usually + the limits of a plot. + +- x,y: + + x and y positions of the points. + +## Details + +`maxEmptyRect` searches the pairs of points on the plot to find the +largest rectangular space within which none of the points lie. It does +not guarantee that the space will be large enough to fit a legend or +text. + +Two alternatives are the `largest.empty` function in the Hmisc package +and the `emptyspace` function. `maxEmptyRect` appears to outperform +`emptyspace`, particularly in running time. However, `emptyspace` will +sometimes find a "squarer" rectangle when `maxEmptyRect` finds a +slightly larger narrow rectangle. + +## Value + +A list containing the area of the rectangle and the coordinates of the +lower left and upper right corners (as used in `rect`) of the rectangle +found. + +## Author + +Hans Borchers + +## References + +A. Naamad, D. T. Lee, and W.-L. Hsu (1984). On the Maximum Empty +Rectangle Problem. Discrete Applied Mathematics, 8: 267-277. + +## Examples + +``` r + x<-runif(100) + y<-runif(100) + plot(x,y,main="Find the maximum empty rectangle",xlab="X",ylab="Y") + mer<-maxEmptyRect(c(0,1),c(0,1),x,y) + rect(mer$rect[1],mer$rect[2],mer$rect[3],mer$rect[4],border="red") +``` diff --git a/reference/mtext3d.html b/reference/mtext3d.html new file mode 100644 index 0000000..a34a227 --- /dev/null +++ b/reference/mtext3d.html @@ -0,0 +1,97 @@ + +Display text in the margins of a 3D plot — mtext3d • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display text in the margins of a 3D plot.

    +
    + +
    +

    Usage

    +
    mtext3d(edge,pmat,labels=TRUE,at=NULL,dist=0.3,xpd=NA,...)
    +
    + +
    +

    Arguments

    +

    +
    edge
    +

    which axis to calculate.

    + +
    pmat
    +

    matrix to transform coordinates.

    + +
    labels
    +

    labels to display in the margin.

    + +
    at
    +

    position on the axis.

    + +
    dist
    +

    Offset of the axis.

    + +
    xpd
    +

    set clipping for display.

    + +
    ...
    +

    additional arguments passed to ptext3d.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Ben Bolker

    +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/mtext3d.md b/reference/mtext3d.md new file mode 100644 index 0000000..a126864 --- /dev/null +++ b/reference/mtext3d.md @@ -0,0 +1,47 @@ +# Display text in the margins of a 3D plot + +Display text in the margins of a 3D plot. + +## Usage + +``` r +mtext3d(edge,pmat,labels=TRUE,at=NULL,dist=0.3,xpd=NA,...) +``` + +## Arguments + +- edge: + + which axis to calculate. + +- pmat: + + matrix to transform coordinates. + +- labels: + + labels to display in the margin. + +- at: + + position on the axis. + +- dist: + + Offset of the axis. + +- xpd: + + set clipping for display. + +- ...: + + additional arguments passed to ptext3d. + +## Value + +nil + +## Author + +Ben Bolker diff --git a/reference/multhist-1.png b/reference/multhist-1.png new file mode 100644 index 0000000..499d00c Binary files /dev/null and b/reference/multhist-1.png differ diff --git a/reference/multhist.html b/reference/multhist.html new file mode 100644 index 0000000..ef6de83 --- /dev/null +++ b/reference/multhist.html @@ -0,0 +1,122 @@ + +Plot a multiple histogram, as a barplot — multhist • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Given a list, plots a side-by-side barplot containing the histograms + of the elements

    +
    + +
    +

    Usage

    +
    multhist(x,beside=TRUE,freq=NULL,probability=!freq,plot.it=TRUE,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    a list of numeric vectors

    + +
    beside
    +

    plot histogram bars for groups side-by-side?

    + +
    freq
    +

    logical; if 'TRUE', the histogram graphic is a representation + of frequencies, the 'counts' component of the result; if + 'FALSE', probability densities, component 'density', are + plotted (so that the histogram has a total area of one). + Defaults to 'TRUE' if 'probability' is not specified + (does not consider equidistant breaks as in hist)

    + +
    probability
    +

    an alias for '!freq', for S compatibility

    + +
    plot.it
    +

    Whether or not to display the histogram.

    + +
    ...
    +

    additional arguments to hist or barplot

    + +
    +
    +

    Value

    +

    A list including the return value for the first call to hist (itself a list) + and the values for the bar heights.

    +
    +
    +

    Author

    +

    Ben Bolker

    +
    +
    +

    See also

    + +
    +
    +

    Note

    +

    The 'inside' argument to barplot (which is not currently + implemented in barplot anyway) is deleted from the argument list. The + default value of NULL for freq is for consistency with hist + but is equivalent to TRUE.

    +
    + +
    +

    Examples

    +
     set.seed(1234)
    + l <- list(runif(10)*10,1:10,c(1,1,1,1,4,8))
    + multhist(l)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/multhist.md b/reference/multhist.md new file mode 100644 index 0000000..2cd5c34 --- /dev/null +++ b/reference/multhist.md @@ -0,0 +1,71 @@ +# Plot a multiple histogram, as a barplot + +Given a list, plots a side-by-side barplot containing the histograms of +the elements + +## Usage + +``` r +multhist(x,beside=TRUE,freq=NULL,probability=!freq,plot.it=TRUE,...) +``` + +## Arguments + +- x: + + a list of numeric vectors + +- beside: + + plot histogram bars for groups side-by-side? + +- freq: + + logical; if 'TRUE', the histogram graphic is a representation of + frequencies, the 'counts' component of the result; if 'FALSE', + probability densities, component 'density', are plotted (so that the + histogram has a total area of one). Defaults to 'TRUE' if + 'probability' is not specified (does not consider equidistant breaks + as in [hist](https://rdrr.io/r/graphics/hist.html)) + +- probability: + + an alias for '!freq', for S compatibility + +- plot.it: + + Whether or not to display the histogram. + +- ...: + + additional arguments to [hist](https://rdrr.io/r/graphics/hist.html) + or [barplot](https://rdrr.io/r/graphics/barplot.html) + +## Value + +A list including the return value for the first call to `hist` (itself a +list) and the values for the bar heights. + +## Author + +Ben Bolker + +## See also + +[hist](https://rdrr.io/r/graphics/hist.html),[barplot](https://rdrr.io/r/graphics/barplot.html) + +## Note + +The 'inside' argument to +[barplot](https://rdrr.io/r/graphics/barplot.html) (which is not +currently implemented in barplot anyway) is deleted from the argument +list. The default value of NULL for `freq` is for consistency with +`hist` but is equivalent to TRUE. + +## Examples + +``` r + set.seed(1234) + l <- list(runif(10)*10,1:10,c(1,1,1,1,4,8)) + multhist(l) +``` diff --git a/reference/multivari.html b/reference/multivari.html new file mode 100644 index 0000000..53a573d --- /dev/null +++ b/reference/multivari.html @@ -0,0 +1,217 @@ + +Function to draw a multivari chart — multivari • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    A multivari chart of one quantitative response variable depending on two +to four categorical variables can be drawn.

    +
    + +
    +

    Usage

    +
    multivari(var, fac1, fac2, fac3 = NULL, fac4 = NULL, data, sort = FALSE,
    + fun = mean, pch = list(15, 16, 17), col = list("black", "blue", "red"),
    + col0 = "black", cex = 1, fac.cex = 2, xlab.depth = 3, legend = FALSE,
    + main = paste("multivari chart of", var), add = FALSE, ...)
    +
    + +
    +

    Arguments

    +

    +
    var
    +

    variable name (character string) or column index of response + variable, required

    + +
    fac1
    +

    variable name (character string) or column index of first + level factor, required; precedes fac2 and fac3 (if present) in the hierarchy (see Details)

    + +
    fac2
    +

    variable name (character string) or column index of second + level factor, required; follows fac1 and precedes fac3 (if present) + in the hierarchy (see Details)

    + +
    fac3
    +

    variable name (character string) or column index of third + level factor, optional; if present, fac3 is the last factor in the hierarchy (see Details)

    + +
    fac4
    +

    variable name (character string) or column index of fourth level factor, +optional; can only be specified if there is also a third level factor; +if present, this factor is the first in the hierarchy (see Details), and separate multivari charts for the first three factors are drawn for each level of this factor

    + +
    data
    +

    a data frame, required

    + +
    sort
    +

    logical, specifying whether or not levels are sorted, when converting +character vectors to factors (a single choice for all factors is needed); default: FALSE

    + +
    fun
    +

    a function to be used in aggregation; default: mean

    + +
    pch
    +

    a list of length 2 or 3, depending on whether or not fac3 is + specified; the ith list element can be an individual plotting symbol + (like the usual pch entry) or a vector of plot symbols for each + level of fac_i

    + +
    col
    +

    a list of length 2 or 3, depending on whether or not fac3 is + specified; the ith list element can be an individual color or a vector + of colors for each level of fac_i; this color specification is + used for the plot symbols of fac_i levels and for the lines + connecting the symbols for the next level in the hierarchy

    + +
    col0
    +

    the color for the first line to be drawn

    + +
    cex
    +

    the size of axis annotation text +(annotation of the fourth level header is 1.5 times this size)

    + +
    fac.cex
    +

    a multiplier for cex; plot symbol sizes are fac.cex*cex; +default: 2

    + +
    xlab.depth
    +

    labels for the horizontal axis are printed down to this level of the +hierarchy (default: 3); if the depth is reduced, different plot symbols +should be used, and a legend should be drawn

    + +
    legend
    +

    logical determining whether or not a legend should be drawn (default: +FALSE); the function determines wether top right or bottom right yields +a better position (it is not guaranteed that there is no overlab); if +this does not work well, one can manually draw a legend in the outer +margin

    + +
    main
    +

    title, as usual; a default is provided

    + +
    add
    +

    logical; add to an existing plot (which of course has to have suitable axis limits)?; default: FALSE; +note that horizontal axis labeling will always be printed by function multivari, while vertical axis labeling will be omitted for add=TRUE

    + +
    ...
    +

    further arguments to functions plot, lines, points, + mtext

    + +
    +
    +

    Details

    +

    The function is inspired by Minitabs behavior for multivari charts +(see also Bruno Scibilia's blog which is linked in the references). It +does not attempt to visualize individual observations.

    +

    A multivari chart mainly serves exploratory purposes. +It works particularly well with balanced data, but can also be used for messy data. +multivari can visualize the dependence of a single quantitative variable on up to four factors (i.e., interactions of order up to four can be visualized). The display is hierarchical: for factors later in the hierarchy, conditional means given level combinations of factors earlier in the hierarchy are displayed. Therefore, the order of the +factors can make a big difference in the display. If there is no natural +order, it may be worthwhile to inspect several orders.

    +

    For interactions with two factors only, it is often preferrable to use +function interaction.plot or raw.means.plot.

    +
    +
    +

    Value

    +

    a list of (lists of) data frames with summary statistics to be plotted

    +
    +
    +

    References

    +

    Scibilia, Bruno (2013). Using Multi-Vari Charts to Analyze Families of Variations. https://blog.minitab.com/en/blog/using-variability-charts-to-analyze-call-center-wait-times.

    +
    +
    +

    Author

    +

    Ulrike Groemping

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    ##---- Should be DIRECTLY executable !! ----
    +##-- ==>  Define data, use random,
    +##--  or do  help(data=index)  for the standard data sets.
    +if (FALSE) { # \dontrun{
    +require(car)
    +multivari("cycles", "len", "load", "amp", data=Wool, 
    +    col=list("black","red",c("grey70","grey45","grey20")),
    +    pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2)
    +multivari("cycles", "load", "len", "amp", data=Wool, 
    +    col=list("black",c("red","blue","darkgreen"),
    +    c("grey70","grey45","grey20")),
    +    pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2)
    +    
    +## create a fake fourth factor
    +fakedat <- rbind(cbind(newfac="blabla",Wool),cbind(newfac="albalb",Wool))
    +## make it character for demonstrating the effect of sort option
    +fakedat$newfac <- as.character(fakedat$newfac)
    +
    +## default: sort order in the data is respected (order of unique is used)
    +multivari("cycles", "load", "len", "amp", "newfac", data=fakedat, 
    +    col=list("black",c("red","blue","darkgreen"),
    +    c("grey70","grey45","grey20")),
    +    pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2, cex=0.8)
    +    
    +## sort=TRUE: levels are sorted (order of sort(unique))
    +multivari("cycles", "load", "len", "amp", "newfac", data=fakedat, 
    +    col=list("black",c("red","blue","darkgreen"),
    +    c("grey70","grey45","grey20")),
    +    pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2, cex=0.8,
    +    sort=TRUE)
    +} # }
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/multivari.md b/reference/multivari.md new file mode 100644 index 0000000..4bce5a6 --- /dev/null +++ b/reference/multivari.md @@ -0,0 +1,195 @@ +# Function to draw a multivari chart + +A multivari chart of one quantitative response variable depending on two +to four categorical variables can be drawn. + +## Usage + +``` r +multivari(var, fac1, fac2, fac3 = NULL, fac4 = NULL, data, sort = FALSE, + fun = mean, pch = list(15, 16, 17), col = list("black", "blue", "red"), + col0 = "black", cex = 1, fac.cex = 2, xlab.depth = 3, legend = FALSE, + main = paste("multivari chart of", var), add = FALSE, ...) +``` + +## Arguments + +- var: + + variable name (character string) or column index of response variable, + required + +- fac1: + + variable name (character string) or column index of first level + factor, required; precedes `fac2` and `fac3` (if present) in the + hierarchy (see Details) + +- fac2: + + variable name (character string) or column index of second level + factor, required; follows `fac1` and precedes `fac3` (if present) in + the hierarchy (see Details) + +- fac3: + + variable name (character string) or column index of third level + factor, optional; if present, `fac3` is the last factor in the + hierarchy (see Details) + +- fac4: + + variable name (character string) or column index of fourth level + factor, optional; can only be specified if there is also a third level + factor; if present, this factor is the first in the hierarchy (see + Details), and separate multivari charts for the first three factors + are drawn for each level of this factor + +- data: + + a data frame, required + +- sort: + + logical, specifying whether or not levels are sorted, when converting + character vectors to factors (a single choice for all factors is + needed); default: `FALSE` + +- fun: + + a function to be used in aggregation; default: `mean` + +- pch: + + a list of length 2 or 3, depending on whether or not `fac3` is + specified; the ith list element can be an individual plotting symbol + (like the usual `pch` entry) or a vector of plot symbols for each + level of `fac_i` + +- col: + + a list of length 2 or 3, depending on whether or not `fac3` is + specified; the ith list element can be an individual color or a vector + of colors for each level of `fac_i`; this color specification is used + for the plot symbols of `fac_i` levels and for the lines connecting + the symbols for the next level in the hierarchy + +- col0: + + the color for the first line to be drawn + +- cex: + + the size of axis annotation text (annotation of the fourth level + header is 1.5 times this size) + +- fac.cex: + + a multiplier for `cex`; plot symbol sizes are `fac.cex*cex`; default: + 2 + +- xlab.depth: + + labels for the horizontal axis are printed down to this level of the + hierarchy (default: 3); if the depth is reduced, different plot + symbols should be used, and a legend should be drawn + +- legend: + + logical determining whether or not a legend should be drawn (default: + FALSE); the function determines wether top right or bottom right + yields a better position (it is not guaranteed that there is no + overlab); if this does not work well, one can manually draw a legend + in the outer margin + +- main: + + title, as usual; a default is provided + +- add: + + logical; add to an existing plot (which of course has to have suitable + axis limits)?; default: FALSE; note that horizontal axis labeling will + always be printed by function multivari, while vertical axis labeling + will be omitted for `add=TRUE` + +- ...: + + further arguments to functions `plot`, `lines`, `points`, `mtext` + +## Details + +The function is inspired by Minitabs behavior for multivari charts (see +also Bruno Scibilia's blog which is linked in the references). It does +not attempt to visualize individual observations. + +A multivari chart mainly serves exploratory purposes. It works +particularly well with balanced data, but can also be used for messy +data. `multivari` can visualize the dependence of a single quantitative +variable on up to four factors (i.e., interactions of order up to four +can be visualized). The display is hierarchical: for factors later in +the hierarchy, conditional means given level combinations of factors +earlier in the hierarchy are displayed. Therefore, the order of the +factors can make a big difference in the display. If there is no natural +order, it may be worthwhile to inspect several orders. + +For interactions with two factors only, it is often preferrable to use +function +[`interaction.plot`](https://rdrr.io/r/stats/interaction.plot.html) or +[`raw.means.plot`](raw.means.plot.md). + +## Value + +a list of (lists of) data frames with summary statistics to be plotted + +## References + +Scibilia, Bruno (2013). Using Multi-Vari Charts to Analyze Families of +Variations. +. + +## Author + +Ulrike Groemping + +## See also + +See also +[`interaction.plot`](https://rdrr.io/r/stats/interaction.plot.html), +[`raw.means.plot`](raw.means.plot.md) + +## Examples + +``` r +##---- Should be DIRECTLY executable !! ---- +##-- ==> Define data, use random, +##-- or do help(data=index) for the standard data sets. +if (FALSE) { # \dontrun{ +require(car) +multivari("cycles", "len", "load", "amp", data=Wool, + col=list("black","red",c("grey70","grey45","grey20")), + pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2) +multivari("cycles", "load", "len", "amp", data=Wool, + col=list("black",c("red","blue","darkgreen"), + c("grey70","grey45","grey20")), + pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2) + +## create a fake fourth factor +fakedat <- rbind(cbind(newfac="blabla",Wool),cbind(newfac="albalb",Wool)) +## make it character for demonstrating the effect of sort option +fakedat$newfac <- as.character(fakedat$newfac) + +## default: sort order in the data is respected (order of unique is used) +multivari("cycles", "load", "len", "amp", "newfac", data=fakedat, + col=list("black",c("red","blue","darkgreen"), + c("grey70","grey45","grey20")), + pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2, cex=0.8) + +## sort=TRUE: levels are sorted (order of sort(unique)) +multivari("cycles", "load", "len", "amp", "newfac", data=fakedat, + col=list("black",c("red","blue","darkgreen"), + c("grey70","grey45","grey20")), + pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2, cex=0.8, + sort=TRUE) +} # } +``` diff --git a/reference/multsymbolbox-1.png b/reference/multsymbolbox-1.png new file mode 100644 index 0000000..99ac996 Binary files /dev/null and b/reference/multsymbolbox-1.png differ diff --git a/reference/multsymbolbox.html b/reference/multsymbolbox.html new file mode 100644 index 0000000..9d0864c --- /dev/null +++ b/reference/multsymbolbox.html @@ -0,0 +1,120 @@ + +Draw boxes filled with symbols — multsymbolbox • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Draw boxes on the current figure filled with symbols representing + individual counts.

    +
    + +
    +

    Usage

    +
    multsymbolbox(x1,y1,x2,y2,tot,relw=0.8,fg=par("fg"),bg=par("bg"),
    +  box=TRUE,debug=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    x1
    +

    numeric vector: left sides of boxes

    + +
    y1
    +

    numeric vector: bottom sides of boxes

    + +
    x2
    +

    numeric vector: right sides of boxes

    + +
    y2
    +

    numeric vector: top sides of boxes

    + +
    tot
    +

    numeric vector: total numbers of symbols to put in each box

    + +
    relw
    +

    relative width (relative to height) of symbols

    +

    n

    +
    fg
    +

    foreground color(s)

    + +
    bg
    +

    background color(s)

    + +
    box
    +

    (logical) draw box borders?

    + +
    debug
    +

    debug output?

    + +
    ...
    +

    additional arguments to polygon() for drawing boxes

    + +
    +
    +

    Value

    +

    none

    +
    +
    +

    Author

    +

    Ben Bolker

    +
    + +
    +

    Examples

    +
     plot(1:10,1:10,type="n")
    + multsymbolbox(c(2,4),5,c(4,5),8,tot=c(10,8))
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/multsymbolbox.md b/reference/multsymbolbox.md new file mode 100644 index 0000000..5ea0a82 --- /dev/null +++ b/reference/multsymbolbox.md @@ -0,0 +1,74 @@ +# Draw boxes filled with symbols + +Draw boxes on the current figure filled with symbols representing +individual counts. + +## Usage + +``` r +multsymbolbox(x1,y1,x2,y2,tot,relw=0.8,fg=par("fg"),bg=par("bg"), + box=TRUE,debug=FALSE,...) +``` + +## Arguments + +- x1: + + numeric vector: left sides of boxes + +- y1: + + numeric vector: bottom sides of boxes + +- x2: + + numeric vector: right sides of boxes + +- y2: + + numeric vector: top sides of boxes + +- tot: + + numeric vector: total numbers of symbols to put in each box + +- relw: + + relative width (relative to height) of symbols + +n + +- fg: + + foreground color(s) + +- bg: + + background color(s) + +- box: + + (logical) draw box borders? + +- debug: + + debug output? + +- ...: + + additional arguments to polygon() for drawing boxes + +## Value + +none + +## Author + +Ben Bolker + +## Examples + +``` r + plot(1:10,1:10,type="n") + multsymbolbox(c(2,4),5,c(4,5),8,tot=c(10,8)) +``` diff --git a/reference/oz.windrose-1.png b/reference/oz.windrose-1.png new file mode 100644 index 0000000..c416b00 Binary files /dev/null and b/reference/oz.windrose-1.png differ diff --git a/reference/oz.windrose.html b/reference/oz.windrose.html new file mode 100644 index 0000000..6645c1f --- /dev/null +++ b/reference/oz.windrose.html @@ -0,0 +1,144 @@ + +Display an Australian wind rose — oz.windrose • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a wind rose in the style used by the Australian + Bureau of Meteorology.

    +
    + +
    +

    Usage

    +
    oz.windrose(windagg,maxpct=20,wrmar=c(4,5,6,5),scale.factor=30,
    +  speed.col=c("#dab286","#fe9a66","#ce6733","#986434"),
    +  speed.width=NA,show.legend=TRUE,legend.pos=NA,...)
    +
    + +
    +

    Arguments

    +

    +
    windagg
    +

    A matrix of percentages with the rows representing + speed ranges and the columns indicating wind directions.

    + +
    maxpct
    +

    The maximum percentage displayed on the radial grid.

    + +
    wrmar
    +

    Plot margins for the diagram.

    + +
    scale.factor
    +

    The scale factor for the diagram.

    + +
    speed.col
    +

    Colors representing speed ranges.

    + +
    speed.width
    +

    Half widths of the bars representing speed ranges.

    + +
    show.legend
    +

    Logical indicating whether to display a legend.

    + +
    legend.pos
    +

    The vertical position of the wind rose legend. The + Australian Bureau of Meteorology displays the legend at the top of + the plot

    + +
    ...
    +

    additional arguments passed to plot.

    + +
    +
    +

    Details

    +

    oz.windrose displays a wind rose in the style used by the Australian + Bureau of Meteorology. Each limb represents a bin of wind directions, and + there are conventionally eight bins. If windagg has more than eight + columns, more limbs will be displayed. The rows of windagg represent + the speed ranges used by the Australian Bureau of Meteorology (0, 0-10, + 10-20, 20-30 and over 30 in km/hour). The diameter of the central circle is + calculated as (percent calm observations)/(number of direction bins). The + remaining grid circles are spaced from the circumference of the "Calm" + circle.

    +
    +
    +

    Note

    +

    If a title is desired, remember to move the legend to the bottom + of the plot. If the function is passed values that do not sum to 100, the + resulting plot will at best be misleading.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon (thanks to Anna in the Sydney BoM office and Alejo for + finding the problem with heavily prevailing winds.)

    +
    + + +
    +

    Examples

    +
     windagg<-matrix(c(8,0,0,0,0,0,0,0,4,6,2,1,6,3,0,4,2,8,5,3,5,2,1,1,
    +  5,5,2,4,1,4,1,2,1,2,4,0,3,1,3,1),nrow=5,byrow=TRUE)
    + oz.windrose(windagg)
    +
    +#> Warning: argument 1 does not name a graphical parameter
    +#> NULL
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/oz.windrose.legend-1.png b/reference/oz.windrose.legend-1.png new file mode 100644 index 0000000..ba328f4 Binary files /dev/null and b/reference/oz.windrose.legend-1.png differ diff --git a/reference/oz.windrose.legend.html b/reference/oz.windrose.legend.html new file mode 100644 index 0000000..5cb44fd --- /dev/null +++ b/reference/oz.windrose.legend.html @@ -0,0 +1,111 @@ + +Display an Australian wind rose legend — oz.windrose.legend • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a wind rose legend in the style used by the Australian Bureau + of Meteorology.

    +
    + +
    +

    Usage

    +
    oz.windrose.legend(maxpct=20,scale.factor=30,
    +  speed.col=c("#dab286","#fe9a66","#ce6733","#986434"),
    +  speed.width=NA,legend.pos=NA)
    +
    + +
    +

    Arguments

    +

    +
    maxpct
    +

    The maximum percentage to display on the radial grid.

    + +
    scale.factor
    +

    The scale factor for the plot.

    + +
    speed.col
    +

    Colors representing speed ranges.

    + +
    speed.width
    +

    Half widths of the bars representing speed ranges.

    + +
    legend.pos
    +

    The vertical position of the wind rose legend. The + Australian Bureau of Meteorology displays the legend at the top of + the plot

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon (thanks to Anna in the Sydney BoM office)

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     plot(0,xlim=c(-20,20),ylim=c(-20,20),type="n",axes=FALSE,xlab="",ylab="")
    + par(xpd=TRUE)
    + oz.windrose.legend()
    +
    + par(xpd=FALSE)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/oz.windrose.legend.md b/reference/oz.windrose.legend.md new file mode 100644 index 0000000..129c6da --- /dev/null +++ b/reference/oz.windrose.legend.md @@ -0,0 +1,57 @@ +# Display an Australian wind rose legend + +Displays a wind rose legend in the style used by the Australian Bureau +of Meteorology. + +## Usage + +``` r +oz.windrose.legend(maxpct=20,scale.factor=30, + speed.col=c("#dab286","#fe9a66","#ce6733","#986434"), + speed.width=NA,legend.pos=NA) +``` + +## Arguments + +- maxpct: + + The maximum percentage to display on the radial grid. + +- scale.factor: + + The scale factor for the plot. + +- speed.col: + + Colors representing speed ranges. + +- speed.width: + + Half widths of the bars representing speed ranges. + +- legend.pos: + + The vertical position of the wind rose legend. The Australian Bureau + of Meteorology displays the legend at the top of the plot + +## Value + +nil + +## Author + +Jim Lemon (thanks to Anna in the Sydney BoM office) + +## See also + +[oz.windrose](oz.windrose.md) + +## Examples + +``` r + plot(0,xlim=c(-20,20),ylim=c(-20,20),type="n",axes=FALSE,xlab="",ylab="") + par(xpd=TRUE) + oz.windrose.legend() + + par(xpd=FALSE) +``` diff --git a/reference/oz.windrose.md b/reference/oz.windrose.md new file mode 100644 index 0000000..76eb629 --- /dev/null +++ b/reference/oz.windrose.md @@ -0,0 +1,95 @@ +# Display an Australian wind rose + +Displays a wind rose in the style used by the Australian Bureau of +Meteorology. + +## Usage + +``` r +oz.windrose(windagg,maxpct=20,wrmar=c(4,5,6,5),scale.factor=30, + speed.col=c("#dab286","#fe9a66","#ce6733","#986434"), + speed.width=NA,show.legend=TRUE,legend.pos=NA,...) +``` + +## Arguments + +- windagg: + + A matrix of percentages with the rows representing speed ranges and + the columns indicating wind directions. + +- maxpct: + + The maximum percentage displayed on the radial grid. + +- wrmar: + + Plot margins for the diagram. + +- scale.factor: + + The scale factor for the diagram. + +- speed.col: + + Colors representing speed ranges. + +- speed.width: + + Half widths of the bars representing speed ranges. + +- show.legend: + + Logical indicating whether to display a legend. + +- legend.pos: + + The vertical position of the wind rose legend. The Australian Bureau + of Meteorology displays the legend at the top of the plot + +- ...: + + additional arguments passed to `plot`. + +## Details + +`oz.windrose` displays a wind rose in the style used by the Australian +Bureau of Meteorology. Each limb represents a bin of wind directions, +and there are conventionally eight bins. If `windagg` has more than +eight columns, more limbs will be displayed. The rows of `windagg` +represent the speed ranges used by the Australian Bureau of Meteorology +(0, 0-10, 10-20, 20-30 and over 30 in km/hour). The diameter of the +central circle is calculated as (percent calm observations)/(number of +direction bins). The remaining grid circles are spaced from the +circumference of the "Calm" circle. + +## Note + +If a title is desired, remember to move the legend to the bottom of the +plot. If the function is passed values that do not sum to 100, the +resulting plot will at best be misleading. + +## Value + +nil + +## Author + +Jim Lemon (thanks to Anna in the Sydney BoM office and Alejo for finding +the problem with heavily prevailing winds.) + +## See also + +[oz.windrose.legend](oz.windrose.legend.md), +[draw.circle](draw.circle.md), [bin.wind.records](bin.wind.records.md) + +## Examples + +``` r + windagg<-matrix(c(8,0,0,0,0,0,0,0,4,6,2,1,6,3,0,4,2,8,5,3,5,2,1,1, + 5,5,2,4,1,4,1,2,1,2,4,0,3,1,3,1),nrow=5,byrow=TRUE) + oz.windrose(windagg) + +#> Warning: argument 1 does not name a graphical parameter +#> NULL +``` diff --git a/reference/p2p_arrows.html b/reference/p2p_arrows.html new file mode 100644 index 0000000..0beb2e0 --- /dev/null +++ b/reference/p2p_arrows.html @@ -0,0 +1,110 @@ + +Draw arrows between points — p2p_arrows • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays arrows on an existing plot between specified + points.

    +
    + +
    +

    Usage

    +
    p2p_arrows(x1,y1,x2,y2,space=0.05,col=par("fg"),...)
    +
    + +
    +

    Arguments

    +

    +
    x1
    +

    Starting x positions for the labels.

    + +
    y1
    +

    Starting y positions for the labels.

    + +
    x2
    +

    Ending x positions for the labels.

    + +
    y2
    +

    Ending y positions for the labels.

    + +
    space
    +

    The proportion of the distance between the points to + leave as space before and after the arrow.

    + +
    col
    +

    Color(s) for the arrows.

    + +
    ...
    +

    Extra arguments passed to arrows.

    + +
    +
    +

    Details

    +

    p2p_arrows displays arrows on a plot between one or more pairs + of specified points.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/p2p_arrows.md b/reference/p2p_arrows.md new file mode 100644 index 0000000..709105e --- /dev/null +++ b/reference/p2p_arrows.md @@ -0,0 +1,57 @@ +# Draw arrows between points + +Displays arrows on an existing plot between specified points. + +## Usage + +``` r +p2p_arrows(x1,y1,x2,y2,space=0.05,col=par("fg"),...) +``` + +## Arguments + +- x1: + + Starting x positions for the labels. + +- y1: + + Starting y positions for the labels. + +- x2: + + Ending x positions for the labels. + +- y2: + + Ending y positions for the labels. + +- space: + + The proportion of the distance between the points to leave as space + before and after the arrow. + +- col: + + Color(s) for the arrows. + +- ...: + + Extra arguments passed to `arrows`. + +## Details + +`p2p_arrows` displays arrows on a plot between one or more pairs of +specified points. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[arrows](https://rdrr.io/r/graphics/arrows.html) diff --git a/reference/panes-1.png b/reference/panes-1.png new file mode 100644 index 0000000..0d5d9d3 Binary files /dev/null and b/reference/panes-1.png differ diff --git a/reference/panes-2.png b/reference/panes-2.png new file mode 100644 index 0000000..cb0ff69 Binary files /dev/null and b/reference/panes-2.png differ diff --git a/reference/panes.html b/reference/panes.html new file mode 100644 index 0000000..360dcec --- /dev/null +++ b/reference/panes.html @@ -0,0 +1,176 @@ + +Prepare a "panel" type layout — panes • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Split the graphics device into a "panel" type layout for a group of plots

    +
    + +
    +

    Usage

    +
    panes(mat=NULL,widths=rep(1,ncol(mat)),heights=rep(1,nrow(mat)),
    +  nrow=2,ncol=2,mar=c(0,0,1.6,0),oma=c(2.5,1,1,1))
    +
    + +
    +

    Arguments

    +

    +
    mat
    +

    A matrix representing the number of panes to be created and + their order of plotting.

    + +
    widths,heights
    +

    The widths and heights of the panes. + See layout.

    + +
    nrow,ncol
    +

    The numbers of rows and columns in the layout. + See par(mfrow).

    + +
    mar
    +

    The margins for each plot in the panes.

    + +
    oma
    +

    The outer margins for the entire group of panes.

    + +
    +
    +

    Details

    +

    panes combines the information for displaying a set of plots in + a "panel" layout. The default values will usually produce the desired + result by calling par(mfrow). If mat is not NULL, the + layout function will be called instead of par(mfrow). + The two methods are included for the convenience of the user.

    +

    Note that panes does not produce any plots and that the user + must call tab.title to get the "look" of the panel plot. The + overall title is usually centered at the left edge (as in the example) + or in the center of one of the plots in the bottom row.

    +
    +
    +

    Value

    +

    The values of par options that existed when panes was + called. This list is usually used to restore those values.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     y<-runif(8)
    + oldpar<-panes(matrix(1:4,nrow=2,byrow=TRUE))
    + par(mar=c(0,2,1.6,0))
    + boxplot(y,axes=FALSE)
    + axis(2)
    + box()
    + par(mar=c(0,0,1.6,2))
    + tab.title("Boxplot of y",tab.col="#88dd88")
    + barplot(y,axes=FALSE,col=2:9)
    + axis(4)
    + box()
    + tab.title("Barplot of y",tab.col="#88dd88")
    + par(mar=c(2,2,1.6,0))
    + pie(y,col=2:9)
    + tab.title("Pie chart of y",tab.col="#88dd88")
    + box()
    + par(mar=c(2,0,1.6,2))
    + plot(y,xaxs="i",xlim=c(0,9),axes=FALSE,col=2:9)
    + axis(4)
    + box()
    + tab.title("Scatterplot of y",tab.col="#88dd88")
    + # center the title at the left edge of the last plot
    + mtext("Test of panes function",at=0,side=1,line=0.8,cex=1.5)
    +
    + panes(matrix(1:3,ncol=1),heights=c(0.7,0.8,1))
    +#> $mar
    +#> [1] 2.0 0.0 1.6 2.0
    +#> 
    +#> $mfrow
    +#> [1] 2 2
    +#> 
    +#> $oma
    +#> [1] 0 0 0 0
    +#> 
    + par(mar=c(0,2,2,2))
    + plot(sort(runif(7)),type="l",axes=FALSE)
    + axis(2,at=seq(0.1,0.9,by=0.2))
    + box()
    + tab.title("Rising expectations",tab.col="#ee6666")
    + barplot(rev(sort(runif(7))),col="blue",axes=FALSE)
    + axis(2,at=seq(0.1,0.9,by=0.2))
    + box()
    + tab.title("Diminishing returns",tab.col="#6666ee")
    + par(mar=c(4,2,2,2))
    + tso<-c(0.2,0.3,0.5,0.4,0.6,0.8,0.1)
    + plot(tso,type="n",axes=FALSE,xlab="")
    +if (FALSE) { # \dontrun{
    + # the following needs a Unicode locale to work (and a suitable font)
    + # Few devices can plot these -- and not the default pdf() for checking.
    + points(1:7,tso,pch=c(rep(-0x263a,6),-0x2639),cex=2)
    +} # }
    + axis(1,at=1:7,
    +  labels=c("Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday","Monday"))
    + axis(2,at=seq(0.1,0.9,by=0.2))
    + box()
    + tab.title("The sad outcome",tab.col="#66ee66")
    + mtext("A lot of malarkey",side=1,line=2.5)
    +
    +
    + par(oldpar)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/panes.md b/reference/panes.md new file mode 100644 index 0000000..758f6f0 --- /dev/null +++ b/reference/panes.md @@ -0,0 +1,125 @@ +# Prepare a "panel" type layout + +Split the graphics device into a "panel" type layout for a group of +plots + +## Usage + +``` r +panes(mat=NULL,widths=rep(1,ncol(mat)),heights=rep(1,nrow(mat)), + nrow=2,ncol=2,mar=c(0,0,1.6,0),oma=c(2.5,1,1,1)) +``` + +## Arguments + +- mat: + + A matrix representing the number of panes to be created and their + order of plotting. + +- widths,heights: + + The widths and heights of the panes. See `layout`. + +- nrow,ncol: + + The numbers of rows and columns in the layout. See `par(mfrow)`. + +- mar: + + The margins for each plot in the panes. + +- oma: + + The outer margins for the entire group of panes. + +## Details + +`panes` combines the information for displaying a set of plots in a +"panel" layout. The default values will usually produce the desired +result by calling `par(mfrow)`. If `mat` is not NULL, the `layout` +function will be called instead of `par(mfrow)`. The two methods are +included for the convenience of the user. + +Note that `panes` does not produce any plots and that the user must call +`tab.title` to get the "look" of the panel plot. The overall title is +usually centered at the left edge (as in the example) or in the center +of one of the plots in the bottom row. + +## Value + +The values of `par` options that existed when `panes` was called. This +list is usually used to restore those values. + +## Author + +Jim Lemon + +## See also + +[par](https://rdrr.io/r/graphics/par.html),[layout](https://rdrr.io/r/graphics/layout.html) + +## Examples + +``` r + y<-runif(8) + oldpar<-panes(matrix(1:4,nrow=2,byrow=TRUE)) + par(mar=c(0,2,1.6,0)) + boxplot(y,axes=FALSE) + axis(2) + box() + par(mar=c(0,0,1.6,2)) + tab.title("Boxplot of y",tab.col="#88dd88") + barplot(y,axes=FALSE,col=2:9) + axis(4) + box() + tab.title("Barplot of y",tab.col="#88dd88") + par(mar=c(2,2,1.6,0)) + pie(y,col=2:9) + tab.title("Pie chart of y",tab.col="#88dd88") + box() + par(mar=c(2,0,1.6,2)) + plot(y,xaxs="i",xlim=c(0,9),axes=FALSE,col=2:9) + axis(4) + box() + tab.title("Scatterplot of y",tab.col="#88dd88") + # center the title at the left edge of the last plot + mtext("Test of panes function",at=0,side=1,line=0.8,cex=1.5) + + panes(matrix(1:3,ncol=1),heights=c(0.7,0.8,1)) +#> $mar +#> [1] 2.0 0.0 1.6 2.0 +#> +#> $mfrow +#> [1] 2 2 +#> +#> $oma +#> [1] 0 0 0 0 +#> + par(mar=c(0,2,2,2)) + plot(sort(runif(7)),type="l",axes=FALSE) + axis(2,at=seq(0.1,0.9,by=0.2)) + box() + tab.title("Rising expectations",tab.col="#ee6666") + barplot(rev(sort(runif(7))),col="blue",axes=FALSE) + axis(2,at=seq(0.1,0.9,by=0.2)) + box() + tab.title("Diminishing returns",tab.col="#6666ee") + par(mar=c(4,2,2,2)) + tso<-c(0.2,0.3,0.5,0.4,0.6,0.8,0.1) + plot(tso,type="n",axes=FALSE,xlab="") +if (FALSE) { # \dontrun{ + # the following needs a Unicode locale to work (and a suitable font) + # Few devices can plot these -- and not the default pdf() for checking. + points(1:7,tso,pch=c(rep(-0x263a,6),-0x2639),cex=2) +} # } + axis(1,at=1:7, + labels=c("Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday","Monday")) + axis(2,at=seq(0.1,0.9,by=0.2)) + box() + tab.title("The sad outcome",tab.col="#66ee66") + mtext("A lot of malarkey",side=1,line=2.5) + + + par(oldpar) +``` diff --git a/reference/pasteCols.html b/reference/pasteCols.html new file mode 100644 index 0000000..7f08b97 --- /dev/null +++ b/reference/pasteCols.html @@ -0,0 +1,105 @@ + +Paste the columns of a matrix together — pasteCols • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Paste the columns of a matrix together to form as + many "words" as there are columns.

    +
    + +
    +

    Usage

    +
    pasteCols(x,sep="")
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A matrix.

    + +
    sep
    +

    The separator to use in the paste command.

    + +
    +
    +

    Details

    +

    pasteCols pastes the columns of a matrix together to form a vector in + which each element is the concatenation of the elements in each of the columns + of the matrix. It is intended for producing identifiers from a matrix returned + by the combn function.

    +
    +
    +

    Value

    +

    A vector of character strings.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     # create a matrix of the combinations of the first five letters of the
    + # alphabet taken two at a time.
    + alpha5<-combn(LETTERS[1:5],2,simplify=TRUE)
    + pasteCols(alpha5,sep="+")
    +#>  [1] "A+B" "A+C" "A+D" "A+E" "B+C" "B+D" "B+E" "C+D" "C+E" "D+E"
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/pasteCols.md b/reference/pasteCols.md new file mode 100644 index 0000000..cb1bb8c --- /dev/null +++ b/reference/pasteCols.md @@ -0,0 +1,49 @@ +# Paste the columns of a matrix together + +Paste the columns of a matrix together to form as many "words" as there +are columns. + +## Usage + +``` r +pasteCols(x,sep="") +``` + +## Arguments + +- x: + + A matrix. + +- sep: + + The separator to use in the `paste` command. + +## Details + +`pasteCols` pastes the columns of a matrix together to form a vector in +which each element is the concatenation of the elements in each of the +columns of the matrix. It is intended for producing identifiers from a +matrix returned by the `combn` function. + +## Value + +A vector of character strings. + +## Author + +Jim Lemon + +## See also + +[makeIntersectList](makeIntersectList.md) + +## Examples + +``` r + # create a matrix of the combinations of the first five letters of the + # alphabet taken two at a time. + alpha5<-combn(LETTERS[1:5],2,simplify=TRUE) + pasteCols(alpha5,sep="+") +#> [1] "A+B" "A+C" "A+D" "A+E" "B+C" "B+D" "B+E" "C+D" "C+E" "D+E" +``` diff --git a/reference/paxis3d-1.png b/reference/paxis3d-1.png new file mode 100644 index 0000000..87cede5 Binary files /dev/null and b/reference/paxis3d-1.png differ diff --git a/reference/paxis3d.html b/reference/paxis3d.html new file mode 100644 index 0000000..718715c --- /dev/null +++ b/reference/paxis3d.html @@ -0,0 +1,131 @@ + +Display text in the margins of a 3D plot — paxis3d • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display text in the margins of a 3D plot.

    +
    + +
    +

    Usage

    +
    paxis3d(edge,pmat,at=NULL,labels=TRUE,tick=TRUE,
    +  pos=NULL,nticks=5,ticklen=0.05,labdist=0.15,xpd=NA,...)
    +
    + +
    +

    Arguments

    +

    +
    edge
    +

    which axis to calculate.

    + +
    pmat
    +

    matrix to transform coordinates.

    + +
    at
    +

    position on the axis.

    + +
    labels
    +

    labels to display in the margin.

    + +
    tick
    +

    whether to draw axis tick marks.

    + +
    pos
    +

    axis position relative to other axes.

    + +
    nticks
    +

    number of tick marks.

    + +
    ticklen
    +

    length of tick marks as a proportion of plot dimensions.

    + +
    labdist
    +

    distance of labels from axis.

    + +
    xpd
    +

    parameter to set plot clipping.

    + +
    ...
    +

    additional arguments passed to ptext3d.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Ben Bolker

    +
    + +
    +

    Examples

    +
     x <- 1:10
    + y <- 1:10
    + z <- outer(x,y,function(x,y) { 3*sin(2*pi*x)/(2*pi*x)+exp(y/10)+(x*y)/1000 })
    + par(mar=c(5,10,2,2))
    + pp <- perspx(x,y,z,ticktype="detailed",phi=30,theta=80,nticks=3,r=10,
    +      axes=FALSE)
    + ## axis labels not drawn when axes=FALSE
    + paxis3d("X-",pp,at=c(1,2,9))
    + paxis3d("Y+",pp)
    + paxis3d("Z-",pp)
    + mtext3d("X-",pp,expression(alpha^sqrt(beta)))
    + ## if you want labels parallel to axis, still have to figure out 'srt'
    + ##   by trial and error
    + mtext3d("Y+",pp,expression("velocity ("*gamma*", furlongs/fortnight)"),
    +        xpd=NA,srt=6)
    + mtext3d("Z-",pp,"Range\n(r*)",dist=0.5)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/paxis3d.md b/reference/paxis3d.md new file mode 100644 index 0000000..d56cc41 --- /dev/null +++ b/reference/paxis3d.md @@ -0,0 +1,85 @@ +# Display text in the margins of a 3D plot + +Display text in the margins of a 3D plot. + +## Usage + +``` r +paxis3d(edge,pmat,at=NULL,labels=TRUE,tick=TRUE, + pos=NULL,nticks=5,ticklen=0.05,labdist=0.15,xpd=NA,...) +``` + +## Arguments + +- edge: + + which axis to calculate. + +- pmat: + + matrix to transform coordinates. + +- at: + + position on the axis. + +- labels: + + labels to display in the margin. + +- tick: + + whether to draw axis tick marks. + +- pos: + + axis position relative to other axes. + +- nticks: + + number of tick marks. + +- ticklen: + + length of tick marks as a proportion of plot dimensions. + +- labdist: + + distance of labels from axis. + +- xpd: + + parameter to set plot clipping. + +- ...: + + additional arguments passed to ptext3d. + +## Value + +nil + +## Author + +Ben Bolker + +## Examples + +``` r + x <- 1:10 + y <- 1:10 + z <- outer(x,y,function(x,y) { 3*sin(2*pi*x)/(2*pi*x)+exp(y/10)+(x*y)/1000 }) + par(mar=c(5,10,2,2)) + pp <- perspx(x,y,z,ticktype="detailed",phi=30,theta=80,nticks=3,r=10, + axes=FALSE) + ## axis labels not drawn when axes=FALSE + paxis3d("X-",pp,at=c(1,2,9)) + paxis3d("Y+",pp) + paxis3d("Z-",pp) + mtext3d("X-",pp,expression(alpha^sqrt(beta))) + ## if you want labels parallel to axis, still have to figure out 'srt' + ## by trial and error + mtext3d("Y+",pp,expression("velocity ("*gamma*", furlongs/fortnight)"), + xpd=NA,srt=6) + mtext3d("Z-",pp,"Range\n(r*)",dist=0.5) +``` diff --git a/reference/perspx-1.png b/reference/perspx-1.png new file mode 100644 index 0000000..56530e2 Binary files /dev/null and b/reference/perspx-1.png differ diff --git a/reference/perspx.html b/reference/perspx.html new file mode 100644 index 0000000..a43eb7f --- /dev/null +++ b/reference/perspx.html @@ -0,0 +1,97 @@ + +Display perspective plot — perspx • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display an enhanced perspective plot with additional return values

    +
    + +
    +

    Usage

    +
    perspx(x,y,z,...)
    +
    + +
    +

    Arguments

    +

    +
    x,y,z
    +

    x, y and z coordinates to plot.

    + +
    ...
    +

    Other arguments passed to persp.

    + +
    +
    +

    Details

    +

    Displays z values plotted on an x,y grid.

    +
    +
    +

    Value

    +

    A list with three elements, the ranges of x, y and z.

    +
    +
    +

    Author

    +

    Ben Bolker

    +
    + +
    +

    Examples

    +
     x <- 1:10
    + y <- 1:10
    + z <- outer(x,y,function(x,y) { 3*sin(2*pi*x)/(2*pi*x)+exp(y/10)+(x*y)/1000 })
    + par(mar=c(5,10,2,2))
    + pp <- perspx(x,y,z,ticktype="detailed",phi=30,theta=80,nticks=3,r=10,
    +  axes=FALSE)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/perspx.md b/reference/perspx.md new file mode 100644 index 0000000..5f79f2e --- /dev/null +++ b/reference/perspx.md @@ -0,0 +1,42 @@ +# Display perspective plot + +Display an enhanced perspective plot with additional return values + +## Usage + +``` r +perspx(x,y,z,...) +``` + +## Arguments + +- x,y,z: + + x, y and z coordinates to plot. + +- ...: + + Other arguments passed to `persp`. + +## Details + +Displays `z` values plotted on an x,y grid. + +## Value + +A list with three elements, the ranges of `x`, `y` and `z`. + +## Author + +Ben Bolker + +## Examples + +``` r + x <- 1:10 + y <- 1:10 + z <- outer(x,y,function(x,y) { 3*sin(2*pi*x)/(2*pi*x)+exp(y/10)+(x*y)/1000 }) + par(mar=c(5,10,2,2)) + pp <- perspx(x,y,z,ticktype="detailed",phi=30,theta=80,nticks=3,r=10, + axes=FALSE) +``` diff --git a/reference/pie.labels-1.png b/reference/pie.labels-1.png new file mode 100644 index 0000000..2432283 Binary files /dev/null and b/reference/pie.labels-1.png differ diff --git a/reference/pie.labels.html b/reference/pie.labels.html new file mode 100644 index 0000000..802e7b2 --- /dev/null +++ b/reference/pie.labels.html @@ -0,0 +1,139 @@ + +Place labels on a pie chart — pie.labels • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Places labels on a pie chart

    +
    + +
    +

    Usage

    +
    pie.labels(x=0,y=0,angles,labels,radius=1.05,bg="white",border=TRUE,
    +  minangle=NA,boxed=FALSE,explode=0,...)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    x and y position of the center of the pie chart

    + +
    angles
    +

    A numeric vector representing angles in radians. This is + the return value of floating.pie.

    + +
    labels
    +

    Text strings to label each sector.

    + +
    radius
    +

    The radius at which to place the labels in user units. The + default is 1.05.

    + +
    bg
    +

    The color of the rectangles on which the labels are displayed.

    + +
    border
    +

    Whether to draw borders around the rectangles.

    + +
    minangle
    +

    Minimum angle between labels.

    + +
    boxed
    +

    Whether to use text or boxed.labels to display + the labels.

    + +
    explode
    +

    How much the pie chart has been "exploded".

    + +
    ...
    +

    Arguments passed to text or boxed.labels.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    Labels may be placed within the pie (radius less than the pie radius), + on the edge or outside as in the examples below. If within the pie, it + is probably best to use boxed=TRUE.

    +

    If some labels overlap, passing a value in radians for minangle + may be used to spread them out.

    +
    +
    +

    Note

    +

    Remember that x and y specify the center of the pie chart and + that the label positions are specified by angles and radii from that + center.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + + +
    +

    Examples

    +
     pieval<-c(2,1,3,94)
    + plot(0,xlim=c(1.5,5),ylim=c(1,5),type="n",axes=FALSE,xlab="",ylab="")
    + box()
    + bisect.angles<-floating.pie(3,3,pieval,explode=c(0.1,0.2,0.3,0))
    + pie.labels(3,3,bisect.angles,c("two","one","three","ninety\nfour"),
    +  minangle=0.2,,explode=c(0.1,0.2,0.3,0))
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/pie.labels.md b/reference/pie.labels.md new file mode 100644 index 0000000..26cf203 --- /dev/null +++ b/reference/pie.labels.md @@ -0,0 +1,92 @@ +# Place labels on a pie chart + +Places labels on a pie chart + +## Usage + +``` r +pie.labels(x=0,y=0,angles,labels,radius=1.05,bg="white",border=TRUE, + minangle=NA,boxed=FALSE,explode=0,...) +``` + +## Arguments + +- x,y: + + x and y position of the center of the pie chart + +- angles: + + A numeric vector representing angles in radians. This is the return + value of `floating.pie`. + +- labels: + + Text strings to label each sector. + +- radius: + + The radius at which to place the labels in user units. The default is + 1.05. + +- bg: + + The color of the rectangles on which the labels are displayed. + +- border: + + Whether to draw borders around the rectangles. + +- minangle: + + Minimum angle between labels. + +- boxed: + + Whether to use `text` or `boxed.labels` to display the labels. + +- explode: + + How much the pie chart has been "exploded". + +- ...: + + Arguments passed to `text` or `boxed.labels`. + +## Value + +nil + +## Details + +Labels may be placed within the pie (radius less than the pie radius), +on the edge or outside as in the examples below. If within the pie, it +is probably best to use `boxed=TRUE`. + +If some labels overlap, passing a value in radians for `minangle` may be +used to spread them out. + +## Note + +Remember that `x` and `y` specify the center of the pie chart and that +the label positions are specified by angles and radii from that center. + +## Author + +Jim Lemon + +## See also + +[floating.pie](floating.pie.md), [boxed.labels](boxed.labels.md), +[spreadout](spreadout.md) + +## Examples + +``` r + pieval<-c(2,1,3,94) + plot(0,xlim=c(1.5,5),ylim=c(1,5),type="n",axes=FALSE,xlab="",ylab="") + box() + bisect.angles<-floating.pie(3,3,pieval,explode=c(0.1,0.2,0.3,0)) + pie.labels(3,3,bisect.angles,c("two","one","three","ninety\nfour"), + minangle=0.2,,explode=c(0.1,0.2,0.3,0)) +``` diff --git a/reference/pie3D-1.png b/reference/pie3D-1.png new file mode 100644 index 0000000..fca0c1d Binary files /dev/null and b/reference/pie3D-1.png differ diff --git a/reference/pie3D-2.png b/reference/pie3D-2.png new file mode 100644 index 0000000..dec9247 Binary files /dev/null and b/reference/pie3D-2.png differ diff --git a/reference/pie3D.html b/reference/pie3D.html new file mode 100644 index 0000000..c136192 --- /dev/null +++ b/reference/pie3D.html @@ -0,0 +1,189 @@ + +Display a 3D pie chart — pie3D • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a 3D pie chart with optional labels.

    +
    + +
    +

    Usage

    +
    pie3D(x,edges=NA,radius=1,height=0.1,theta=pi/6,start=0,border=par("fg"),
    +  col=NULL,labels=NULL,labelpos=NULL,labelcol=par("fg"),labelcex=1.5,
    +  sector.order=NULL,explode=0,shade=0.8,mar=c(4,4,4,4),pty="s",...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    a numeric vector for which each value will be a sector

    + +
    edges
    +

    the number of lines forming an ellipse

    + +
    radius
    +

    the radius of the pie in user units

    + +
    height
    +

    the height of the pie in user units

    + +
    theta
    +

    The angle of viewing in radians

    + +
    start
    +

    The angle at which to start drawing sectors.

    + +
    border
    +

    The color of the sector border lines

    + +
    col
    +

    The colors of the sectors

    + +
    labels
    +

    Optional labels for each sector

    + +
    labelpos
    +

    Optional positions for the labels (see examples)

    + +
    labelcol
    +

    The color of the labels

    + +
    labelcex
    +

    The character expansion factor for the labels

    + +
    sector.order
    +

    Allows the operator to specify the order in + which the sectors are drawn.

    + +
    explode
    +

    The amount to "explode" the pie in user units

    + +
    shade
    +

    If > 0 and < 1, the proportion to reduce the + brightness of the sector color to get a better 3D effect.

    + +
    mar
    +

    Margins around the pie.

    + +
    pty
    +

    Whether to force a square plot region or not. (see Details)

    + +
    ...
    +

    graphical parameters passed to plot

    + +
    +
    +

    Value

    +

    The bisecting angle of the sectors in radians.

    +
    +
    +

    Details

    +

    pie3D scales the values in x so that they total 2*pi, + dropping zeros and NAs. It then displays an empty plot, calculates + the sequence for drawing the sectors and calls draw.tilted.sector + to draw each sector. If labels are supplied, it will call pie3D.label + to place these outside each sector. If supplied, the number of labels, label + positions and sector colors must be at least equal to the number of values + in x. If the labels are long, it may help to reduce the radius of + the pie or change the position as in the example below.

    +

    In order to make the dimensions of the pie reasonably accurate, a square plot + region (pty="s") is the default. If pty is set to "m", the user + can change the margins, usually resulting in a non-square plot area. This will + probably distort the pie somewhat.

    +
    +
    +

    Note

    +

    Due to the somewhat primitive method used to draw sectors, a sector that + extends beyond both pi/2 and 3*pi/2 radians in either direction may not + display properly. Setting start to pi/2 will often fix this, but + the user may have to adjust start and the order of sectors in extreme + cases. The argument sector.order allows the user to specify a vector + of integers that will override the calculation of the order in which the + sectors are drawn. This is usually necessary when a very large sector that + extends past 3*pi/2 is overlapped by a smaller sector next to it. As a last + resort, the user can try setting explode to zero. This only draws + the top and outer sides of each sector.

    +

    Also due to the sector drawing method, setting theta to values smaller + than about pi/8 or larger than about pi/4 will produce obviously misaligned + sectors.

    +

    Contributed fixes and improvements: + thanks to Jesse Brown for the "shade" fix and Qinghua Zhao for alerting me to + the problem with labels and margins

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + + +
    +

    Examples

    +
     pieval<-c(2,4,6,8)
    + pielabels<-
    +  c("We hate\n pies","We oppose\n  pies","We don't\n  care","We just love pies")
    + # grab the radial positions of the labels
    + lp<-pie3D(pieval,radius=0.9,labels=pielabels,explode=0.1,main="3D PIE OPINIONS")
    +
    + # lengthen the last label and move it to the left
    + pielabels[4]<-"We cannot survive without our pies"
    + lp[4]<-4.8
    + # specify some new colors
    + pie3D(pieval,radius=0.9,labels=pielabels,explode=0.1,main="3D PIE OPINIONS",
    +  col=c("brown","#ddaa00","pink","#dd00dd"),labelpos=lp)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/pie3D.labels-1.png b/reference/pie3D.labels-1.png new file mode 100644 index 0000000..9350db2 Binary files /dev/null and b/reference/pie3D.labels-1.png differ diff --git a/reference/pie3D.labels.html b/reference/pie3D.labels.html new file mode 100644 index 0000000..0fc2fd1 --- /dev/null +++ b/reference/pie3D.labels.html @@ -0,0 +1,130 @@ + +Display labels on a 3D pie chart — pie3D.labels • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays labels on a 3D pie chart.

    +
    + +
    +

    Usage

    +
    pie3D.labels(radialpos,radius=1,height=0.1,theta=pi/6,
    +  labels,labelcol=par("fg"),labelcex=1.5,labelrad=1.25,minsep=0.3)
    +
    + +
    +

    Arguments

    +

    +
    radialpos
    +

    Position of the label in radians

    + +
    radius
    +

    the radius of the pie in user units

    + +
    height
    +

    the height of the pie in user units

    + +
    theta
    +

    The angle of viewing in radians

    + +
    labels
    +

    The label to display

    + +
    labelcol
    +

    The color of the labels

    + +
    labelcex
    +

    The character expansion factor for the labels

    + +
    labelrad
    +

    The expansion for the labels around the pie.

    + +
    minsep
    +

    The minimum angular separation between label positions.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    pie3D.label displays labels on a 3D pie chart. The positions + of the labels are given as angles in radians (usually the bisector of the + pie sectors). As the labels can be passed directly to pie3D, + this function would probably not be called by the user.

    +

    pie3D.labels tries to separate labels that are placed closer than + minsep radians. This simple system will handle minor crowding of + labels. If labels are very crowded, capturing the return value of + pie3D and editing the label positions may allow the user to avoid + manually placing labels.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     pieval<-c(2,4,6,8)
    + bisectors<-pie3D(pieval,explode=0.1,main="3D PIE OPINIONS")
    + pielabels<-
    +  c("We hate\n pies","We oppose\n  pies","We don't\n  care","We just love pies")
    + pie3D.labels(bisectors,labels=pielabels)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/pie3D.labels.md b/reference/pie3D.labels.md new file mode 100644 index 0000000..d2e2d69 --- /dev/null +++ b/reference/pie3D.labels.md @@ -0,0 +1,83 @@ +# Display labels on a 3D pie chart + +Displays labels on a 3D pie chart. + +## Usage + +``` r +pie3D.labels(radialpos,radius=1,height=0.1,theta=pi/6, + labels,labelcol=par("fg"),labelcex=1.5,labelrad=1.25,minsep=0.3) +``` + +## Arguments + +- radialpos: + + Position of the label in radians + +- radius: + + the radius of the pie in user units + +- height: + + the height of the pie in user units + +- theta: + + The angle of viewing in radians + +- labels: + + The label to display + +- labelcol: + + The color of the labels + +- labelcex: + + The character expansion factor for the labels + +- labelrad: + + The expansion for the labels around the pie. + +- minsep: + + The minimum angular separation between label positions. + +## Value + +nil + +## Details + +`pie3D.label` displays labels on a 3D pie chart. The positions of the +labels are given as angles in radians (usually the bisector of the pie +sectors). As the labels can be passed directly to [pie3D](pie3D.md), +this function would probably not be called by the user. + +`pie3D.labels` tries to separate labels that are placed closer than +`minsep` radians. This simple system will handle minor crowding of +labels. If labels are very crowded, capturing the return value of +`pie3D` and editing the label positions may allow the user to avoid +manually placing labels. + +## Author + +Jim Lemon + +## See also + +[pie3D](pie3D.md), [draw.tilted.sector](draw.tilted.sector.md) + +## Examples + +``` r + pieval<-c(2,4,6,8) + bisectors<-pie3D(pieval,explode=0.1,main="3D PIE OPINIONS") + pielabels<- + c("We hate\n pies","We oppose\n pies","We don't\n care","We just love pies") + pie3D.labels(bisectors,labels=pielabels) +``` diff --git a/reference/pie3D.md b/reference/pie3D.md new file mode 100644 index 0000000..7b76b34 --- /dev/null +++ b/reference/pie3D.md @@ -0,0 +1,154 @@ +# Display a 3D pie chart + +Displays a 3D pie chart with optional labels. + +## Usage + +``` r +pie3D(x,edges=NA,radius=1,height=0.1,theta=pi/6,start=0,border=par("fg"), + col=NULL,labels=NULL,labelpos=NULL,labelcol=par("fg"),labelcex=1.5, + sector.order=NULL,explode=0,shade=0.8,mar=c(4,4,4,4),pty="s",...) +``` + +## Arguments + +- x: + + a numeric vector for which each value will be a sector + +- edges: + + the number of lines forming an ellipse + +- radius: + + the radius of the pie in user units + +- height: + + the height of the pie in user units + +- theta: + + The angle of viewing in radians + +- start: + + The angle at which to start drawing sectors. + +- border: + + The color of the sector border lines + +- col: + + The colors of the sectors + +- labels: + + Optional labels for each sector + +- labelpos: + + Optional positions for the labels (see examples) + +- labelcol: + + The color of the labels + +- labelcex: + + The character expansion factor for the labels + +- sector.order: + + Allows the operator to specify the order in which the sectors are + drawn. + +- explode: + + The amount to "explode" the pie in user units + +- shade: + + If \> 0 and \< 1, the proportion to reduce the brightness of the + sector color to get a better 3D effect. + +- mar: + + Margins around the pie. + +- pty: + + Whether to force a square plot region or not. (see Details) + +- ...: + + graphical parameters passed to `plot` + +## Value + +The bisecting angle of the sectors in radians. + +## Details + +`pie3D` scales the values in `x` so that they total 2\*pi, dropping +zeros and NAs. It then displays an empty plot, calculates the sequence +for drawing the sectors and calls `draw.tilted.sector` to draw each +sector. If labels are supplied, it will call `pie3D.label` to place +these outside each sector. If supplied, the number of labels, label +positions and sector colors must be at least equal to the number of +values in `x`. If the labels are long, it may help to reduce the radius +of the pie or change the position as in the example below. + +In order to make the dimensions of the pie reasonably accurate, a square +plot region (`pty="s"`) is the default. If `pty` is set to "m", the user +can change the margins, usually resulting in a non-square plot area. +This will probably distort the pie somewhat. + +## Note + +Due to the somewhat primitive method used to draw sectors, a sector that +extends beyond both pi/2 and 3\*pi/2 radians in either direction may not +display properly. Setting `start` to pi/2 will often fix this, but the +user may have to adjust `start` and the order of sectors in extreme +cases. The argument `sector.order` allows the user to specify a vector +of integers that will override the calculation of the order in which the +sectors are drawn. This is usually necessary when a very large sector +that extends past 3\*pi/2 is overlapped by a smaller sector next to it. +As a last resort, the user can try setting `explode` to zero. This only +draws the top and outer sides of each sector. + +Also due to the sector drawing method, setting `theta` to values smaller +than about pi/8 or larger than about pi/4 will produce obviously +misaligned sectors. + +Contributed fixes and improvements: thanks to Jesse Brown for the +"shade" fix and Qinghua Zhao for alerting me to the problem with labels +and margins + +## Author + +Jim Lemon + +## See also + +[pie3D.labels](pie3D.labels.md), +[draw.tilted.sector](draw.tilted.sector.md) + +## Examples + +``` r + pieval<-c(2,4,6,8) + pielabels<- + c("We hate\n pies","We oppose\n pies","We don't\n care","We just love pies") + # grab the radial positions of the labels + lp<-pie3D(pieval,radius=0.9,labels=pielabels,explode=0.1,main="3D PIE OPINIONS") + + # lengthen the last label and move it to the left + pielabels[4]<-"We cannot survive without our pies" + lp[4]<-4.8 + # specify some new colors + pie3D(pieval,radius=0.9,labels=pielabels,explode=0.1,main="3D PIE OPINIONS", + col=c("brown","#ddaa00","pink","#dd00dd"),labelpos=lp) +``` diff --git a/reference/placeLabels.html b/reference/placeLabels.html new file mode 100644 index 0000000..f8ee4c7 --- /dev/null +++ b/reference/placeLabels.html @@ -0,0 +1,146 @@ + +Place labels in boxes — placeLabels • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Places labels in boxes on an existing plot

    +
    + +
    +

    Usage

    +
    placeLabels(x,y=NA,labels,pointer=TRUE,cex=1,labelcol=par("fg"),
    + labelbg="white",border=par("fg"),pointercol=par("fg"),
    + pch=1,col=1,bg="white",flagcol="red")
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    x and y position of the centers of the labels. x can be an + xy.coords list.

    + +
    labels
    +

    Text strings

    + +
    pointer
    +

    Whether to draw a line segment from the label to the + points labeled.

    + +
    cex
    +

    Character expansion. See text.

    + +
    labelcol
    +

    The color(s) of the text in the labels.

    + +
    labelbg
    +

    The background color(s) for the labels.

    + +
    border
    +

    The color(s) for the borders around the rectangles.

    + +
    pointercol
    +

    The color(s) of the pointer lines.

    + +
    pch
    +

    The symbol(s) to use when redisplaying the original points + (see Details).

    + +
    col
    +

    The color(s) of the original points.

    + +
    bg
    +

    The background color(s) of the original points.

    + +
    flagcol
    +

    The color to use for "flagging" each point.

    + +
    +
    +

    Details

    +

    placeLabels steps through the points indexed by x and + y, allowing the operator to manually place the labels for each + point. Each point is "flagged" by displaying a small colored circle (red + by default). When the label for that point has been placed, the original + symbol is displayed and the next point is flagged.

    +

    Each point and label can have different colors and backgrounds.

    +
    +
    +

    Note

    +

    This function is handy for one-off plots with a moderate number of + points. It can be very useful for plots with clumps of points.

    +
    +
    +

    Value

    +

    nil - adds labels to an existing plot.

    +
    +
    +

    Author

    +

    Jim Lemon - thanks to Marna Wagley for the idea.

    +
    + + +
    +

    Examples

    +
     # won't check because of the call to locator
    + if (FALSE) { # \dontrun{
    +  x<-rnorm(10)
    +  y<-rnorm(10)
    +  plot(x,y)
    +  placeLabels(x,y,LETTERS[1:10],flagcol="purple")
    + } # }
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/placeLabels.md b/reference/placeLabels.md new file mode 100644 index 0000000..181d226 --- /dev/null +++ b/reference/placeLabels.md @@ -0,0 +1,103 @@ +# Place labels in boxes + +Places labels in boxes on an existing plot + +## Usage + +``` r +placeLabels(x,y=NA,labels,pointer=TRUE,cex=1,labelcol=par("fg"), + labelbg="white",border=par("fg"),pointercol=par("fg"), + pch=1,col=1,bg="white",flagcol="red") +``` + +## Arguments + +- x,y: + + x and y position of the centers of the labels. `x` can be an + [xy.coords](https://rdrr.io/r/grDevices/xy.coords.html) list. + +- labels: + + Text strings + +- pointer: + + Whether to draw a line segment from the label to the points labeled. + +- cex: + + Character expansion. See `text`. + +- labelcol: + + The color(s) of the text in the labels. + +- labelbg: + + The background color(s) for the labels. + +- border: + + The color(s) for the borders around the rectangles. + +- pointercol: + + The color(s) of the pointer lines. + +- pch: + + The symbol(s) to use when redisplaying the original points (see + Details). + +- col: + + The color(s) of the original points. + +- bg: + + The background color(s) of the original points. + +- flagcol: + + The color to use for "flagging" each point. + +## Details + +`placeLabels` steps through the points indexed by `x` and `y`, allowing +the operator to manually place the labels for each point. Each point is +"flagged" by displaying a small colored circle (red by default). When +the label for that point has been placed, the original symbol is +displayed and the next point is flagged. + +Each point and label can have different colors and backgrounds. + +## Note + +This function is handy for one-off plots with a moderate number of +points. It can be very useful for plots with clumps of points. + +## Value + +nil - adds labels to an existing plot. + +## Author + +Jim Lemon - thanks to Marna Wagley for the idea. + +## See also + +[spread.labels](spread.labels.md), +[thigmophobe.labels](thigmophobe.labels.md) + +## Examples + +``` r + # won't check because of the call to locator + if (FALSE) { # \dontrun{ + x<-rnorm(10) + y<-rnorm(10) + plot(x,y) + placeLabels(x,y,LETTERS[1:10],flagcol="purple") + } # } +``` diff --git a/reference/plotCI-1.png b/reference/plotCI-1.png new file mode 100644 index 0000000..345a993 Binary files /dev/null and b/reference/plotCI-1.png differ diff --git a/reference/plotCI-2.png b/reference/plotCI-2.png new file mode 100644 index 0000000..bd52050 Binary files /dev/null and b/reference/plotCI-2.png differ diff --git a/reference/plotCI-3.png b/reference/plotCI-3.png new file mode 100644 index 0000000..69ae89d Binary files /dev/null and b/reference/plotCI-3.png differ diff --git a/reference/plotCI-4.png b/reference/plotCI-4.png new file mode 100644 index 0000000..e236b07 Binary files /dev/null and b/reference/plotCI-4.png differ diff --git a/reference/plotCI-5.png b/reference/plotCI-5.png new file mode 100644 index 0000000..64dc453 Binary files /dev/null and b/reference/plotCI-5.png differ diff --git a/reference/plotCI.html b/reference/plotCI.html new file mode 100644 index 0000000..f5cfa6d --- /dev/null +++ b/reference/plotCI.html @@ -0,0 +1,177 @@ + +Plot confidence intervals/error bars — plotCI • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Given a set of x and y values and upper and lower bounds, + this function plots the points with error bars.

    +
    + +
    +

    Usage

    +
    plotCI(x,y=NULL,uiw,liw=uiw,ui=NULL,li=NULL,err="y",
    +  sfrac=0.01,gap=0,slty=par("lty"),add=FALSE,scol=NULL,pt.bg=par("bg"),...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    The x coordinates of points in the plot

    + +
    y
    +

    The y coordinates of points in the plot

    + +
    uiw
    +

    The width of the upper portion of the confidence region, + or (if liw is missing) the width of both halves of + the confidence region

    + +
    liw
    +

    The width of the lower portion of the confidence region (if + missing, the function assumes symmetric confidence bounds)

    + +
    ui
    +

    The absolute upper limit of the confidence region

    + +
    li
    +

    The absolute lower limit of the confidence region

    + +
    err
    +

    The direction of error bars: "x" for horizontal, "y" + for vertical ("xy" would be nice but is not implemented yet; don't + know quite how everything would be specified. See examples for + composing a plot with simultaneous horizontal and vertical error bars)

    + +
    gap
    +

    Size of gap in error bars around points + (default 0;gap=TRUE gives gap size of 0.01)

    + +
    sfrac
    +

    Scaling factor for the size of the "serifs" (end bars) on + the confidence bars, in x-axis units

    + +
    add
    +

    If FALSE (default), create a new plot; if TRUE, add error + bars to an existing plot.

    + +
    slty
    +

    Line type of error bars

    + +
    scol
    +

    Color of error bars: if col is specified in the + optional arguments, scol is set the same; otherwise it's set + to par(col)

    + +
    pt.bg
    +

    Background color of points (use pch=21, pt.bg=par("bg") + to get open points superimposed on error bars)

    + +
    ...
    +

    Any other parameters to be passed through to + plot.default, points, + arrows, etc. (e.g. lwd, col, pch, + axes, xlim, ylim). xlim and + ylim are set by default to include all of the data points and + error bars. xlab and ylab are set to the names of + x and y. If pch==NA, no points are drawn + (e.g. leaving room for text labels instead)

    + +
    +
    +

    Value

    +

    invisible(x,y); creates a plot on the current device.

    +
    +
    +

    Author

    +

    Ben Bolker (documentation and tweaking of a function provided by + Bill Venables, additional feature ideas from Gregory Warnes)

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     y<-runif(10)
    + err<-runif(10)
    + plotCI(1:10,y,err,main="Basic plotCI")
    +
    + plotCI(1:10,y,err,2*err,lwd=2,col="red",scol="blue",
    +  main="Add colors to the points and error bars")
    +
    + err.x<-runif(10)
    + err.y<-runif(10)
    + plotCI(1:10,y,err.y,pt.bg=par("bg"),pch=21,xlim=c(0,11),
    +  main="plotCI with extra space on the x axis")
    + plotCI(1:10,y,err.x,pt.bg=par("bg"),pch=21,err="x",add=TRUE)
    + mtext("for adding horizontal error bars",3,0.5)
    +
    + data(warpbreaks)
    + attach(warpbreaks)
    + wmeans<-by(breaks,tension,mean)
    + wsd<-by(breaks,tension,sd)
    + ## note that barplot() returns the midpoints of the bars, which plotCI
    + ##  uses as x-coordinates
    + plotCI(barplot(wmeans,col="gray",ylim=c(0,max(wmeans+wsd))),wmeans,wsd,add=TRUE)
    +
    + ## using labels instead of points
    + labs<-sample(LETTERS,replace=TRUE,size=10)
    + plotCI(1:10,y,err,pch=NA,gap=0.02,main="plotCI with labels at points")
    + text(1:10,y,labs)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/plotCI.md b/reference/plotCI.md new file mode 100644 index 0000000..3f4f681 --- /dev/null +++ b/reference/plotCI.md @@ -0,0 +1,130 @@ +# Plot confidence intervals/error bars + +Given a set of x and y values and upper and lower bounds, this function +plots the points with error bars. + +## Usage + +``` r +plotCI(x,y=NULL,uiw,liw=uiw,ui=NULL,li=NULL,err="y", + sfrac=0.01,gap=0,slty=par("lty"),add=FALSE,scol=NULL,pt.bg=par("bg"),...) +``` + +## Arguments + +- x: + + The x coordinates of points in the plot + +- y: + + The y coordinates of points in the plot + +- uiw: + + The width of the upper portion of the confidence region, or (if `liw` + is missing) the width of both halves of the confidence region + +- liw: + + The width of the lower portion of the confidence region (if missing, + the function assumes symmetric confidence bounds) + +- ui: + + The absolute upper limit of the confidence region + +- li: + + The absolute lower limit of the confidence region + +- err: + + The direction of error bars: "x" for horizontal, "y" for vertical + ("xy" would be nice but is not implemented yet; don't know quite how + everything would be specified. See examples for composing a plot with + simultaneous horizontal and vertical error bars) + +- gap: + + Size of gap in error bars around points (default 0;gap=TRUE gives gap + size of 0.01) + +- sfrac: + + Scaling factor for the size of the "serifs" (end bars) on the + confidence bars, in x-axis units + +- add: + + If FALSE (default), create a new plot; if TRUE, add error bars to an + existing plot. + +- slty: + + Line type of error bars + +- scol: + + Color of error bars: if `col` is specified in the optional arguments, + `scol` is set the same; otherwise it's set to `par(col)` + +- pt.bg: + + Background color of points (use pch=21, pt.bg=par("bg") to get open + points superimposed on error bars) + +- ...: + + Any other parameters to be passed through to + [plot.default](https://rdrr.io/r/graphics/plot.default.html), + [points](https://rdrr.io/r/graphics/points.html), + [arrows](https://rdrr.io/r/graphics/arrows.html), etc. (e.g. `lwd`, + `col`, `pch`, `axes`, `xlim`, `ylim`). `xlim` and `ylim` are set by + default to include all of the data points and error bars. `xlab` and + `ylab` are set to the names of `x` and `y`. If `pch==NA`, no points + are drawn (e.g. leaving room for text labels instead) + +## Value + +invisible(x,y); creates a plot on the current device. + +## Author + +Ben Bolker (documentation and tweaking of a function provided by Bill +Venables, additional feature ideas from Gregory Warnes) + +## See also + +[boxplot](https://rdrr.io/r/graphics/boxplot.html) + +## Examples + +``` r + y<-runif(10) + err<-runif(10) + plotCI(1:10,y,err,main="Basic plotCI") + + plotCI(1:10,y,err,2*err,lwd=2,col="red",scol="blue", + main="Add colors to the points and error bars") + + err.x<-runif(10) + err.y<-runif(10) + plotCI(1:10,y,err.y,pt.bg=par("bg"),pch=21,xlim=c(0,11), + main="plotCI with extra space on the x axis") + plotCI(1:10,y,err.x,pt.bg=par("bg"),pch=21,err="x",add=TRUE) + mtext("for adding horizontal error bars",3,0.5) + + data(warpbreaks) + attach(warpbreaks) + wmeans<-by(breaks,tension,mean) + wsd<-by(breaks,tension,sd) + ## note that barplot() returns the midpoints of the bars, which plotCI + ## uses as x-coordinates + plotCI(barplot(wmeans,col="gray",ylim=c(0,max(wmeans+wsd))),wmeans,wsd,add=TRUE) + + ## using labels instead of points + labs<-sample(LETTERS,replace=TRUE,size=10) + plotCI(1:10,y,err,pch=NA,gap=0.02,main="plotCI with labels at points") + text(1:10,y,labs) +``` diff --git a/reference/plotH-1.png b/reference/plotH-1.png new file mode 100644 index 0000000..f4095a5 Binary files /dev/null and b/reference/plotH-1.png differ diff --git a/reference/plotH-2.png b/reference/plotH-2.png new file mode 100644 index 0000000..462033b Binary files /dev/null and b/reference/plotH-2.png differ diff --git a/reference/plotH-3.png b/reference/plotH-3.png new file mode 100644 index 0000000..8474f6d Binary files /dev/null and b/reference/plotH-3.png differ diff --git a/reference/plotH-4.png b/reference/plotH-4.png new file mode 100644 index 0000000..ec5bfee Binary files /dev/null and b/reference/plotH-4.png differ diff --git a/reference/plotH-5.png b/reference/plotH-5.png new file mode 100644 index 0000000..29d5f84 Binary files /dev/null and b/reference/plotH-5.png differ diff --git a/reference/plotH-6.png b/reference/plotH-6.png new file mode 100644 index 0000000..c425105 Binary files /dev/null and b/reference/plotH-6.png differ diff --git a/reference/plotH-7.png b/reference/plotH-7.png new file mode 100644 index 0000000..c1aa7ca Binary files /dev/null and b/reference/plotH-7.png differ diff --git a/reference/plotH-8.png b/reference/plotH-8.png new file mode 100644 index 0000000..61295c7 Binary files /dev/null and b/reference/plotH-8.png differ diff --git a/reference/plotH-9.png b/reference/plotH-9.png new file mode 100644 index 0000000..e67ad77 Binary files /dev/null and b/reference/plotH-9.png differ diff --git a/reference/plotH.html b/reference/plotH.html new file mode 100644 index 0000000..edfd3da --- /dev/null +++ b/reference/plotH.html @@ -0,0 +1,170 @@ + +Scatterplot with histogram-like bars. — plotH • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Scatterplot with histogram-like bars; a modification of + plot(...,type="h").

    +
    + +
    +

    Usage

    +
    plotH(x,...)
    +
    + # S3 method for class 'formula'
    +plotH(x,data=NULL,xlab=names(mf)[2],ylab=names(mf)[1],...)
    +
    + # Default S3 method
    +plotH(x,y,xlab=paste(deparse(substitute(x))),
    +  ylab=paste(deparse(substitute(y))),width=0.6,ylim=NULL,col="gray",...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    Vector of x-coordinates or a formula of the form y~x + (see below for y).

    + +
    y
    +

    Vector of y-coordinates.

    + +
    xlab
    +

    A string for labeling the x-axis.

    + +
    ylab
    +

    A string for labeling the y-axis.

    + +
    data
    +

    The data frame from which the formula should be evaluated.

    + +
    width
    +

    A numeric that indicates the width of the bars.

    + +
    ylim
    +

    A vector of length two that indicates the limits over which to + plot the y-axis. See details.

    + +
    col
    +

    A string that indicates the fill color for the bars.

    + +
    ...
    +

    Additional arguments sent to the plot or barplot + functions.

    + +
    +
    +

    Details

    +

    plotH is meant to be a modification of the type="h" version of + plot such that the "bars" appears as actual rectangles rather than + vertical lines. It defaults so that the lower bound of the y-axis is 0; + change to ylim=NULL to over-ride this default (and return to the + default used in plot.

    +

    A pass-through to barplot is used if the x (or "RHS") variable + is categorical.

    +
    +
    +

    Value

    +

    None, but a plot is produced.

    +
    +
    +

    Note

    +

    This function is currently experimental.

    +
    +
    +

    Author

    +

    Derek Ogle

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
      d<-data.frame(x=c(1,5,10:20),y=runif(13)+1,
    +                yn1=runif(13)-0.5,yn2=runif(13)-2,
    +                g=factor(sample(c("A","B","C"),13,replace=TRUE)))
    +  # new plotH function with formula notation
    +  plotH(y~x,data=d)
    +
    +  # old plot() function with formula notation -- for comparison's purpose
    +  plot(y~x,data=d,type="h")
    +
    +  # new function over-riding default ylim, increasing bar width,
    +  # and changing bar color
    +  plotH(y~x,data=d,ylim=range(d$y),width=0.9,col="red")
    +
    +  # handling some negative values
    +  plotH(yn1~x,data=d) # not so good, because of default ylim
    +
    +  plotH(yn1~x,data=d,ylim=c(0,max(d$yn1)))  # old look
    +
    +  # handling all negative values
    +  plotH(yn2~x,data=d)
    +
    +  plotH(yn2~x,data=d,ylim=range(d$yn2))  # old look
    +
    +  # example of pass-through to barplot
    +  smry<-by(d$y,d$g,mean)
    +  plotH(levels(d$g),smry,ylab="Mean of Random Variable",xlab="Group")
    +
    +  # example of non-formula usage
    +  x1 <- d$x
    +  y1 <- d$y
    +  plotH(x1,y1,col="blue")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/plotH.md b/reference/plotH.md new file mode 100644 index 0000000..b3c6af6 --- /dev/null +++ b/reference/plotH.md @@ -0,0 +1,121 @@ +# Scatterplot with histogram-like bars. + +Scatterplot with histogram-like bars; a modification of +`plot(...,type="h")`. + +## Usage + +``` r +plotH(x,...) + + # S3 method for class 'formula' +plotH(x,data=NULL,xlab=names(mf)[2],ylab=names(mf)[1],...) + + # Default S3 method +plotH(x,y,xlab=paste(deparse(substitute(x))), + ylab=paste(deparse(substitute(y))),width=0.6,ylim=NULL,col="gray",...) +``` + +## Arguments + +- x: + + Vector of x-coordinates or a formula of the form y~x (see below for + y). + +- y: + + Vector of y-coordinates. + +- xlab: + + A string for labeling the x-axis. + +- ylab: + + A string for labeling the y-axis. + +- data: + + The data frame from which the formula should be evaluated. + +- width: + + A numeric that indicates the width of the bars. + +- ylim: + + A vector of length two that indicates the limits over which to plot + the y-axis. See details. + +- col: + + A string that indicates the fill color for the bars. + +- ...: + + Additional arguments sent to the `plot` or `barplot` functions. + +## Details + +`plotH` is meant to be a modification of the type="h" version of `plot` +such that the "bars" appears as actual rectangles rather than vertical +lines. It defaults so that the lower bound of the y-axis is 0; change to +`ylim=NULL` to over-ride this default (and return to the default used in +`plot`. + +A pass-through to `barplot` is used if the `x` (or "RHS") variable is +categorical. + +## Value + +None, but a plot is produced. + +## Note + +This function is currently experimental. + +## Author + +Derek Ogle + +## See also + +[plot](https://rdrr.io/r/graphics/plot.default.html), +[barplot](https://rdrr.io/r/graphics/barplot.html) + +## Examples + +``` r + d<-data.frame(x=c(1,5,10:20),y=runif(13)+1, + yn1=runif(13)-0.5,yn2=runif(13)-2, + g=factor(sample(c("A","B","C"),13,replace=TRUE))) + # new plotH function with formula notation + plotH(y~x,data=d) + + # old plot() function with formula notation -- for comparison's purpose + plot(y~x,data=d,type="h") + + # new function over-riding default ylim, increasing bar width, + # and changing bar color + plotH(y~x,data=d,ylim=range(d$y),width=0.9,col="red") + + # handling some negative values + plotH(yn1~x,data=d) # not so good, because of default ylim + + plotH(yn1~x,data=d,ylim=c(0,max(d$yn1))) # old look + + # handling all negative values + plotH(yn2~x,data=d) + + plotH(yn2~x,data=d,ylim=range(d$yn2)) # old look + + # example of pass-through to barplot + smry<-by(d$y,d$g,mean) + plotH(levels(d$g),smry,ylab="Mean of Random Variable",xlab="Group") + + # example of non-formula usage + x1 <- d$x + y1 <- d$y + plotH(x1,y1,col="blue") +``` diff --git a/reference/plot_bg-1.png b/reference/plot_bg-1.png new file mode 100644 index 0000000..c35bf89 Binary files /dev/null and b/reference/plot_bg-1.png differ diff --git a/reference/plot_bg.html b/reference/plot_bg.html new file mode 100644 index 0000000..14ef599 --- /dev/null +++ b/reference/plot_bg.html @@ -0,0 +1,90 @@ + +Add a background color to a plot — plot_bg • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a colored rectangle over the entire area of a plot

    +
    + +
    +

    Usage

    +
    plot_bg(col="lightgray")
    +
    + +
    +

    Arguments

    +

    +
    col
    +

    The color of the background

    + +
    +
    +

    Details

    +

    plot_bg is probably only useful when part of the do.first + argument in another plot function to add a background color to the plot.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + +
    +

    Examples

    +
     barp(1:5,do.first="plot_bg()",col=1:5)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/plot_bg.md b/reference/plot_bg.md new file mode 100644 index 0000000..3ba8b0c --- /dev/null +++ b/reference/plot_bg.md @@ -0,0 +1,34 @@ +# Add a background color to a plot + +Displays a colored rectangle over the entire area of a plot + +## Usage + +``` r +plot_bg(col="lightgray") +``` + +## Arguments + +- col: + + The color of the background + +## Details + +`plot_bg` is probably only useful when part of the `do.first` argument +in another plot function to add a background color to the plot. + +## Value + +nil + +## Author + +Jim Lemon + +## Examples + +``` r + barp(1:5,do.first="plot_bg()",col=1:5) +``` diff --git a/reference/plotrix-package.html b/reference/plotrix-package.html new file mode 100644 index 0000000..d4921ac --- /dev/null +++ b/reference/plotrix-package.html @@ -0,0 +1,109 @@ + +Specialized plots and plotting accessories — plotrix-package • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    A large number of specialized plots and accessory functions like color +scaling, text placement and legends.

    +
    + + +
    +

    Details

    +

    + + + + + + + + The plotrix package is intended to provide a method for getting many sorts of + specialized plots quickly, yet allow easy customization of those plots + without learning a great deal of specialized syntax. There are three major + aims that can be represented as follows:

    +

    Fast foods

    +

    Think of plotrix as a graphics vending machine or fast graphics cafe. You walk + in, make your choice and get your lunch. It may not be exactly the lunch you + want, but you do get a pretty good lunch, fast. You can get junk food or + health food, you make the choice.

    +

    Hot rods

    +

    You can customize plotrix as much as you want. Like the ageing machinery that + is usually bolted into hot rods, the base graphics package is fairly easy to + understand. plotrix is modular. You can create a frame for your plot, then + you can add whatever bits you like to it instead of just taking the default + plot that is available. You can have wide wheels and chromed exhaust pipes if + you want.

    +

    No black boxes

    +

    If you want to go from pushing the fast food button to hot rodding, it's not + hard. The source code in the functions is written to be understood. If + something goes wrong, you can usually find where it happened right away and + work on it. This means that you can learn about how the functions do what + they do rather than just what they do. So that's how to write recursive + functions in R!

    +

    Because plotrix encourages users to learn how it works, you usually begin to + do so pretty quickly. Users often decide to write their own versions of + plotrix functions and sometimes they contribute the results back into plotrix. + You may find that you like other graphics systems like grid or lattice better. + That's great, because one idea behind plotrix is that if you get into R and + can get things done quickly and easily, you'll stick with it and soon want to + get things done your way.

    +
    +
    +

    Author

    +

    Jim Lemon <drjimlemon@gmail.com>, and many others

    +

    Maintainer: Jim Lemon <drjimlemon@gmail.com>

    +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/plotrix-package.md b/reference/plotrix-package.md new file mode 100644 index 0000000..1df8111 --- /dev/null +++ b/reference/plotrix-package.md @@ -0,0 +1,50 @@ +# Specialized plots and plotting accessories + +A large number of specialized plots and accessory functions like color +scaling, text placement and legends. + +## Details + +The plotrix package is intended to provide a method for getting many +sorts of specialized plots quickly, yet allow easy customization of +those plots without learning a great deal of specialized syntax. There +are three major aims that can be represented as follows: + +Fast foods + +Think of plotrix as a graphics vending machine or fast graphics cafe. +You walk in, make your choice and get your lunch. It may not be exactly +the lunch you want, but you do get a pretty good lunch, fast. You can +get junk food or health food, you make the choice. + +Hot rods + +You can customize plotrix as much as you want. Like the ageing machinery +that is usually bolted into hot rods, the base graphics package is +fairly easy to understand. plotrix is modular. You can create a frame +for your plot, then you can add whatever bits you like to it instead of +just taking the default plot that is available. You can have wide wheels +and chromed exhaust pipes if you want. + +No black boxes + +If you want to go from pushing the fast food button to hot rodding, it's +not hard. The source code in the functions is written to be understood. +If something goes wrong, you can usually find where it happened right +away and work on it. This means that you can learn about how the +functions do what they do rather than just what they do. So that's how +to write recursive functions in R! + +Because plotrix encourages users to learn how it works, you usually +begin to do so pretty quickly. Users often decide to write their own +versions of plotrix functions and sometimes they contribute the results +back into plotrix. You may find that you like other graphics systems +like grid or lattice better. That's great, because one idea behind +plotrix is that if you get into R and can get things done quickly and +easily, you'll stick with it and soon want to get things done your way. + +## Author + +Jim Lemon \, and many others + +Maintainer: Jim Lemon \ diff --git a/reference/polar.plot-1.png b/reference/polar.plot-1.png new file mode 100644 index 0000000..1ffb8df Binary files /dev/null and b/reference/polar.plot-1.png differ diff --git a/reference/polar.plot-2.png b/reference/polar.plot-2.png new file mode 100644 index 0000000..89fdc55 Binary files /dev/null and b/reference/polar.plot-2.png differ diff --git a/reference/polar.plot.html b/reference/polar.plot.html new file mode 100644 index 0000000..47cf6bb --- /dev/null +++ b/reference/polar.plot.html @@ -0,0 +1,155 @@ + +Plot values on a circular grid of 0 to 360 degrees — polar.plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    polar.plot displays a plot of radial lines, symbols or a polygon + centered at the midpoint of the plot frame on a 0:360 circle. + Positions are interpreted as beginning at the right and moving + counterclockwise unless start specifies another starting point or + clockwise is TRUE.

    +

    If add=TRUE is passed as one of the additional arguments, the values + will be added to the current plot. If a radial.lim argument was + passed on the initial plot, it must be passed again to add values or the + values will be displayed incorrectly.

    +
    + +
    +

    Usage

    +
    polar.plot(lengths,polar.pos=NULL,labels,label.pos=NULL,
    +  start=0,clockwise=FALSE,rp.type="r",loglen=FALSE,explab=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    lengths
    +

    numeric data vector. Magnitudes will be represented as + the radial positions of symbols, line ends or polygon vertices.

    + +
    polar.pos
    +

    numeric vector of positions on a 0:360 degree circle. + These will be converted to radians when passed to radial.plot.

    + +
    labels
    +

    text labels to place on the periphery of the circle. This + defaults to labels every 20 degrees. For no labels, pass an empty string.

    + +
    label.pos
    +

    positions of the peripheral labels in degrees

    + +
    start
    +

    The position for zero degrees on the plot in degrees.

    + +
    clockwise
    +

    Whether to increase angles clockwise rather than the + default counterclockwise.

    + +
    rp.type
    +

    Whether to plot radial lines, symbols or a polygon.

    + +
    loglen
    +

    Whether to log transform the length values. Only base + 10 logs are available.

    + +
    explab
    +

    Whether to use the default fixed (FALSE) or exponential (TRUE) + notation for the radial labels.

    + +
    ...
    +

    additional arguments passed to radial.plot and + then to plot.

    + +
    +
    +

    Value

    +

    A list of the parameters altered by radial.plot.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     testlen<-c(rnorm(36)*2+5)
    + testpos<-seq(0,350,by=10)
    + polar.plot(testlen,testpos,main="Test Polar Plot",lwd=3,line.col=4)
    +
    + oldpar<-polar.plot(testlen,testpos,main="Test Clockwise Polar Plot",
    +  radial.lim=c(0,15),start=90,clockwise=TRUE,lwd=3,line.col=4)
    +
    + # reset everything
    + par(oldpar)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/polar.plot.md b/reference/polar.plot.md new file mode 100644 index 0000000..4a74999 --- /dev/null +++ b/reference/polar.plot.md @@ -0,0 +1,92 @@ +# Plot values on a circular grid of 0 to 360 degrees + +`polar.plot` displays a plot of radial lines, symbols or a polygon +centered at the midpoint of the plot frame on a 0:360 circle. Positions +are interpreted as beginning at the right and moving counterclockwise +unless `start` specifies another starting point or `clockwise` is TRUE. + +If `add=TRUE` is passed as one of the additional arguments, the values +will be added to the current plot. If a `radial.lim` argument was passed +on the initial plot, it must be passed again to add values or the values +will be displayed incorrectly. + +## Usage + +``` r +polar.plot(lengths,polar.pos=NULL,labels,label.pos=NULL, + start=0,clockwise=FALSE,rp.type="r",loglen=FALSE,explab=FALSE,...) +``` + +## Arguments + +- lengths: + + numeric data vector. Magnitudes will be represented as the radial + positions of symbols, line ends or polygon vertices. + +- polar.pos: + + numeric vector of positions on a 0:360 degree circle. These will be + converted to radians when passed to `radial.plot`. + +- labels: + + text labels to place on the periphery of the circle. This defaults to + labels every 20 degrees. For no labels, pass an empty string. + +- label.pos: + + positions of the peripheral labels in degrees + +- start: + + The position for zero degrees on the plot in degrees. + +- clockwise: + + Whether to increase angles clockwise rather than the default + counterclockwise. + +- rp.type: + + Whether to plot radial lines, symbols or a polygon. + +- loglen: + + Whether to log transform the `length` values. Only base 10 logs are + available. + +- explab: + + Whether to use the default fixed (FALSE) or exponential (TRUE) + notation for the radial labels. + +- ...: + + additional arguments passed to `radial.plot` and then to `plot`. + +## Value + +A list of the parameters altered by [radial.plot](radial.plot.md). + +## Author + +Jim Lemon + +## See also + +[radial.plot](radial.plot.md) + +## Examples + +``` r + testlen<-c(rnorm(36)*2+5) + testpos<-seq(0,350,by=10) + polar.plot(testlen,testpos,main="Test Polar Plot",lwd=3,line.col=4) + + oldpar<-polar.plot(testlen,testpos,main="Test Clockwise Polar Plot", + radial.lim=c(0,15),start=90,clockwise=TRUE,lwd=3,line.col=4) + + # reset everything + par(oldpar) +``` diff --git a/reference/polygon.shadow-1.png b/reference/polygon.shadow-1.png new file mode 100644 index 0000000..61f3f94 Binary files /dev/null and b/reference/polygon.shadow-1.png differ diff --git a/reference/polygon.shadow.html b/reference/polygon.shadow.html new file mode 100644 index 0000000..3bf58ac --- /dev/null +++ b/reference/polygon.shadow.html @@ -0,0 +1,133 @@ + +Display a shadow effect for an arbitrary polygon — polygon.shadow • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a shadow effect on an existing plot

    +
    + +
    +

    Usage

    +
    polygon.shadow(x,y=NULL,offset=NA,inflate=NA,col=c("#ffffff","#cccccc"))
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    x and y coordinate of the vertices of the polygon. y + can be missing if x is a list with x and y components.

    + +
    offset
    +

    a vector containing the values of the x and y offsets for the + shadow. Defaults to 1/20 of the maximum x and y dimensions of the polygon.

    + +
    col
    +

    the colors of the shadow from the outer edge to the central part.

    + +
    inflate
    +

    the amount to "inflate" the shadow relative to the polygon + (i.e. the penumbra). Defaults to the values in offset.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    polygon.shadow is typically called just before drawing a polygon. + It displays a shadow effect by drawing the polygon ten times, beginning + with the first color in col and stepping through to the second + color to create a "shadow" (or a "halo" if you prefer). Each successive + polygon is shrunk by 10% of inflate. The default shadow effect has + the light at the upper left. This effect may also be used as a text + background.

    +
    +
    +

    Note

    +

    The background must be a constant color or the shadow effect will not + look right. A good starting point for the two colors is the color of the + background and the RGB components of that color multiplied by 0.8. Use a + smaller multiplier for a darker shadow.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     par(pty="s")
    + plot(1:5,type="n",main="Polygon Shadow test",xlab="",ylab="",axes=FALSE)
    + box()
    + # do a shadow on a yellow square
    + polygon(c(1,2.2,2.2,1),c(5,5,3.8,3.8),col="#ffff00")
    + polygon.shadow(c(1.2,2,2,1.2),c(4.8,4.8,4,4),col=c("#ffff00","#cccc00"))
    + polygon(c(1.2,2,2,1.2),c(4.8,4.8,4,4),col=c("#ff0000"))
    + # a green triangle on a light blue square with a big offset
    + polygon(c(4,5,5,4),c(2,2,1,1),col="#aaaaff")
    + polygon.shadow(c(4.5,4.8,4.2),c(1.7,1.2,1.2),col=c("#aaaaff","#8888cc"),
    +  offset=c(0.1,-0.1),inflate=c(0.2,0.2))
    + polygon(c(4.5,4.8,4.2),c(1.7,1.2,1.2),col=c("#00ff00"))
    + # now a circle as a background
    + polygon.shadow(cos(seq(0,2*pi,by=pi/20))+3,sin(seq(0,2*pi,by=pi/20))+3,
    +  offset=c(0,0),inflate=c(0.1,0.1))
    + text(3,3,"Polygon shadow\nas a circular\ntext background",cex=1.5)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/polygon.shadow.md b/reference/polygon.shadow.md new file mode 100644 index 0000000..2dd42b1 --- /dev/null +++ b/reference/polygon.shadow.md @@ -0,0 +1,80 @@ +# Display a shadow effect for an arbitrary polygon + +Displays a shadow effect on an existing plot + +## Usage + +``` r +polygon.shadow(x,y=NULL,offset=NA,inflate=NA,col=c("#ffffff","#cccccc")) +``` + +## Arguments + +- x,y: + + x and y coordinate of the vertices of the polygon. `y` can be missing + if `x` is a list with `x` and `y` components. + +- offset: + + a vector containing the values of the x and y offsets for the shadow. + Defaults to 1/20 of the maximum x and y dimensions of the polygon. + +- col: + + the colors of the shadow from the outer edge to the central part. + +- inflate: + + the amount to "inflate" the shadow relative to the polygon (i.e. the + penumbra). Defaults to the values in `offset`. + +## Value + +nil + +## Details + +`polygon.shadow` is typically called just before drawing a polygon. It +displays a shadow effect by drawing the polygon ten times, beginning +with the first color in `col` and stepping through to the second color +to create a "shadow" (or a "halo" if you prefer). Each successive +polygon is shrunk by 10% of `inflate`. The default shadow effect has the +light at the upper left. This effect may also be used as a text +background. + +## Note + +The background must be a constant color or the shadow effect will not +look right. A good starting point for the two colors is the color of the +background and the RGB components of that color multiplied by 0.8. Use a +smaller multiplier for a darker shadow. + +## Author + +Jim Lemon + +## See also + +[polygon](https://rdrr.io/r/graphics/polygon.html) + +## Examples + +``` r + par(pty="s") + plot(1:5,type="n",main="Polygon Shadow test",xlab="",ylab="",axes=FALSE) + box() + # do a shadow on a yellow square + polygon(c(1,2.2,2.2,1),c(5,5,3.8,3.8),col="#ffff00") + polygon.shadow(c(1.2,2,2,1.2),c(4.8,4.8,4,4),col=c("#ffff00","#cccc00")) + polygon(c(1.2,2,2,1.2),c(4.8,4.8,4,4),col=c("#ff0000")) + # a green triangle on a light blue square with a big offset + polygon(c(4,5,5,4),c(2,2,1,1),col="#aaaaff") + polygon.shadow(c(4.5,4.8,4.2),c(1.7,1.2,1.2),col=c("#aaaaff","#8888cc"), + offset=c(0.1,-0.1),inflate=c(0.2,0.2)) + polygon(c(4.5,4.8,4.2),c(1.7,1.2,1.2),col=c("#00ff00")) + # now a circle as a background + polygon.shadow(cos(seq(0,2*pi,by=pi/20))+3,sin(seq(0,2*pi,by=pi/20))+3, + offset=c(0,0),inflate=c(0.1,0.1)) + text(3,3,"Polygon shadow\nas a circular\ntext background",cex=1.5) +``` diff --git a/reference/print.brklist.html b/reference/print.brklist.html new file mode 100644 index 0000000..39cb153 --- /dev/null +++ b/reference/print.brklist.html @@ -0,0 +1,142 @@ + +Display the output of brkdnNest — print.brklist • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays the list of values produced by brkdnNest.

    +
    + +
    +

    Usage

    +
    # S3 method for class 'brklist'
    +print(x,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    a list of summary values produced by \link{brkdnNest}

    + +
    ...
    +

    additional arguments passed to print.

    + +
    +
    +

    Details

    +

    print.brklist displays frequency tables produced by brkdnNest. + It is mainly for convenience, but does make a nicer display than when passed + directly to print

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     printbrktest<-data.frame(A=c(sample(1:10,99,TRUE),NA),
    +  B=sample(c("Yes","No"),100,TRUE),
    +  C=sample(LETTERS[1:3],100,TRUE))
    + pbt<-brkdnNest(A~B+C,printbrktest)
    + print(pbt)
    +#> mean 
    +#> Overall 5.424242 
    +#> 	 No 5.3125 
    +#> 	 	 A 5.5 
    +#> 	 	 B 5 
    +#> 	 	 C 5.4 
    +#> 	 Yes 5.529412 
    +#> 	 	 A 5.125 
    +#> 	 	 B 5.666667 
    +#> 	 	 C 5.75 
    +#> sd 
    +#> Overall 2.846734 
    +#> 	 No 2.88913 
    +#> 	 	 A 2.82162 
    +#> 	 	 B 2.908872 
    +#> 	 	 C 3.050453 
    +#> 	 Yes 2.830922 
    +#> 	 	 A 2.895399 
    +#> 	 	 B 2.716791 
    +#> 	 	 C 2.971354 
    +#> sd 
    +#> Overall 2.846734 
    +#> 	 No 2.88913 
    +#> 	 	 A 2.82162 
    +#> 	 	 B 2.908872 
    +#> 	 	 C 3.050453 
    +#> 	 Yes 2.830922 
    +#> 	 	 A 2.895399 
    +#> 	 	 B 2.716791 
    +#> 	 	 C 2.971354 
    +#> valid.n 
    +#> Overall 99 
    +#> 	 No 48 
    +#> 	 	 A 14 
    +#> 	 	 B 14 
    +#> 	 	 C 20 
    +#> 	 Yes 51 
    +#> 	 	 A 16 
    +#> 	 	 B 15 
    +#> 	 	 C 20 
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/print.brklist.md b/reference/print.brklist.md new file mode 100644 index 0000000..6bfcf76 --- /dev/null +++ b/reference/print.brklist.md @@ -0,0 +1,88 @@ +# Display the output of brkdnNest + +Displays the list of values produced by `brkdnNest`. + +## Usage + +``` r +# S3 method for class 'brklist' +print(x,...) +``` + +## Arguments + +- x: + + a list of summary values produced by `\link{brkdnNest}` + +- ...: + + additional arguments passed to `print`. + +## Details + +`print.brklist` displays frequency tables produced by `brkdnNest`. It is +mainly for convenience, but does make a nicer display than when passed +directly to `print` + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[brkdnNest](brkdnNest.md) + +## Examples + +``` r + printbrktest<-data.frame(A=c(sample(1:10,99,TRUE),NA), + B=sample(c("Yes","No"),100,TRUE), + C=sample(LETTERS[1:3],100,TRUE)) + pbt<-brkdnNest(A~B+C,printbrktest) + print(pbt) +#> mean +#> Overall 5.424242 +#> No 5.3125 +#> A 5.5 +#> B 5 +#> C 5.4 +#> Yes 5.529412 +#> A 5.125 +#> B 5.666667 +#> C 5.75 +#> sd +#> Overall 2.846734 +#> No 2.88913 +#> A 2.82162 +#> B 2.908872 +#> C 3.050453 +#> Yes 2.830922 +#> A 2.895399 +#> B 2.716791 +#> C 2.971354 +#> sd +#> Overall 2.846734 +#> No 2.88913 +#> A 2.82162 +#> B 2.908872 +#> C 3.050453 +#> Yes 2.830922 +#> A 2.895399 +#> B 2.716791 +#> C 2.971354 +#> valid.n +#> Overall 99 +#> No 48 +#> A 14 +#> B 14 +#> C 20 +#> Yes 51 +#> A 16 +#> B 15 +#> C 20 +``` diff --git a/reference/propbrk.html b/reference/propbrk.html new file mode 100644 index 0000000..1310d95 --- /dev/null +++ b/reference/propbrk.html @@ -0,0 +1,106 @@ + +Calculate the proportion of specified values in a vector — propbrk • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Calculates the proportion of values in a vector that are equal to a specified + value.

    +
    + +
    +

    Usage

    +
    propbrk(x,trueval=TRUE,na.rm=TRUE)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    a character, factor or numeric vector.

    + +
    trueval
    +

    the value to be matched in x.

    + +
    na.rm
    +

    whether to remove NA values.

    + +
    +
    +

    Details

    +

    propbrk calculates the proportion of values matching a specified value. + It is mainly to allow proportions to be calculated in the brkdnNest + function. It always discards NAs in x when summing the number equal to + trueval, but respects the na.rm argument when calculating the + total number of values in x.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     propbrk(sample(LETTERS,100,TRUE),trueval="M")
    +#> [1] 0.05
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/propbrk.md b/reference/propbrk.md new file mode 100644 index 0000000..706e70e --- /dev/null +++ b/reference/propbrk.md @@ -0,0 +1,51 @@ +# Calculate the proportion of specified values in a vector + +Calculates the proportion of values in a vector that are equal to a +specified value. + +## Usage + +``` r +propbrk(x,trueval=TRUE,na.rm=TRUE) +``` + +## Arguments + +- x: + + a character, factor or numeric vector. + +- trueval: + + the value to be matched in `x`. + +- na.rm: + + whether to remove NA values. + +## Details + +`propbrk` calculates the proportion of values matching a specified +value. It is mainly to allow proportions to be calculated in the +`brkdnNest` function. It always discards NAs in `x` when summing the +number equal to `trueval`, but respects the `na.rm` argument when +calculating the total number of values in `x`. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[brkdnNest](brkdnNest.md) + +## Examples + +``` r + propbrk(sample(LETTERS,100,TRUE),trueval="M") +#> [1] 0.05 +``` diff --git a/reference/psegments3d.html b/reference/psegments3d.html new file mode 100644 index 0000000..3330ceb --- /dev/null +++ b/reference/psegments3d.html @@ -0,0 +1,90 @@ + +Draw segments on a 3D plot — psegments3d • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Draw segments on a 3D plot defined by a list of coordinates

    +
    + +
    +

    Usage

    +
    psegments3d(x,y=NULL,z=NULL,pmat,...)
    +
    + +
    +

    Arguments

    +

    +
    x,y,z
    +

    x, y and z coordinates to plot. x may be a list with + three components.

    + +
    pmat
    +

    matrix to transform coordinates.

    + +
    ...
    +

    Other arguments passed to segments.

    + +
    +
    +

    Details

    +

    Draws segments on a perspective plot.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Ben Bolker

    +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/psegments3d.md b/reference/psegments3d.md new file mode 100644 index 0000000..b85abb7 --- /dev/null +++ b/reference/psegments3d.md @@ -0,0 +1,36 @@ +# Draw segments on a 3D plot + +Draw segments on a 3D plot defined by a list of coordinates + +## Usage + +``` r +psegments3d(x,y=NULL,z=NULL,pmat,...) +``` + +## Arguments + +- x,y,z: + + x, y and z coordinates to plot. `x` may be a list with three + components. + +- pmat: + + matrix to transform coordinates. + +- ...: + + Other arguments passed to `segments`. + +## Details + +Draws segments on a perspective plot. + +## Value + +nil + +## Author + +Ben Bolker diff --git a/reference/ptext3d.html b/reference/ptext3d.html new file mode 100644 index 0000000..00f4fb1 --- /dev/null +++ b/reference/ptext3d.html @@ -0,0 +1,93 @@ + +Display text on a 3D plot — ptext3d • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display text on a 3D plot defined by a list of coordinates

    +
    + +
    +

    Usage

    +
    ptext3d(x,y=NULL,z=NULL,texts,pmat,...)
    +
    + +
    +

    Arguments

    +

    +
    x,y,z
    +

    x, y and z coordinates to plot. x may be a list with + three components.

    + +
    pmat
    +

    matrix to transform coordinates.

    + +
    texts
    +

    text to display.

    + +
    ...
    +

    Other arguments passed to segments.

    + +
    +
    +

    Details

    +

    Draws text on a perspective plot.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Ben Bolker

    +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/ptext3d.md b/reference/ptext3d.md new file mode 100644 index 0000000..2c549a4 --- /dev/null +++ b/reference/ptext3d.md @@ -0,0 +1,40 @@ +# Display text on a 3D plot + +Display text on a 3D plot defined by a list of coordinates + +## Usage + +``` r +ptext3d(x,y=NULL,z=NULL,texts,pmat,...) +``` + +## Arguments + +- x,y,z: + + x, y and z coordinates to plot. `x` may be a list with three + components. + +- pmat: + + matrix to transform coordinates. + +- texts: + + text to display. + +- ...: + + Other arguments passed to `segments`. + +## Details + +Draws text on a perspective plot. + +## Value + +nil + +## Author + +Ben Bolker diff --git a/reference/pyramid.plot-1.png b/reference/pyramid.plot-1.png new file mode 100644 index 0000000..941f91d Binary files /dev/null and b/reference/pyramid.plot-1.png differ diff --git a/reference/pyramid.plot-2.png b/reference/pyramid.plot-2.png new file mode 100644 index 0000000..b9ec6d7 Binary files /dev/null and b/reference/pyramid.plot-2.png differ diff --git a/reference/pyramid.plot.html b/reference/pyramid.plot.html new file mode 100644 index 0000000..e9729c5 --- /dev/null +++ b/reference/pyramid.plot.html @@ -0,0 +1,226 @@ + +Pyramid plot — pyramid.plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a pyramid (opposed horizontal bar) plot on the current + graphics device.

    +
    + +
    +

    Usage

    +
    pyramid.plot(lx,rx,labels=NULL,top.labels=c("Male","Age","Female"),
    +  main="",laxlab=NULL,raxlab=NULL,unit="%",lxcol,rxcol,gap=1,space=0.2,
    +  ppmar=c(4,2,4,2),labelcex=1,add=FALSE,xlim,show.values=FALSE,ndig=1,
    +  do.first=NULL)
    +
    + +
    +

    Arguments

    +

    +
    lx,rx
    +

    Vectors or a matrix or data frame (see Details) which + should be of equal length.

    + +
    labels
    +

    Labels for the categories represented by each pair of + bars. There should be a label for each lx or rx value, even if empty. + If labels is a matrix or data frame, the first two columns will + be used for the left and right category labels respectively.

    + +
    top.labels
    +

    The two categories represented on the left and right + sides of the plot and a heading for the labels in the center.

    + +
    main
    +

    Optional title for the plot.

    + +
    laxlab
    +

    Optional labels for the left x axis ticks.

    + +
    raxlab
    +

    Optional labels for the right x axis ticks.

    + +
    unit
    +

    The label for the units of the plot.

    + +
    lxcol,rxcol
    +

    Color(s) for the left and right sets of bars. Both of + these default to rainbow(length(labels)).

    + +
    gap
    +

    One half of the space between the two sets of bars for the + labels in user units.

    + +
    space
    +

    Space between the bars. Should be 0 <= space < 1.

    + +
    ppmar
    +

    Margins for the plot (see Details).

    + +
    labelcex
    +

    Expansion for the category labels.

    + +
    add
    +

    Whether to add bars to an existing plot. Usually this + involves overplotting a second set of bars, perhaps transparent.

    + +
    xlim
    +

    Optional x limit for the plot (see Details).

    + +
    show.values
    +

    Whether to display lx and rx at the + ends of the bars.

    + +
    ndig
    +

    The number of digits to round the values if displayed.

    + +
    do.first
    +

    Optional expression to evaluate before displaying anything.

    + +
    +
    +

    Details

    +

    pyramid.plot is principally intended for population pyramids, + although it can display other types of opposed bar charts with suitable + modification of the arguments. If the user wants a different unit for + the display, just change unit accordingly. The default gap of + two units is usually satisfactory for the four to six percent range + of most bars on population pyramids. If labels is a matrix or + data frame of at least two columns, the first column will be displayed + on the on the left side of the gap in the center, and the second on the + right. This will almost always require increasing the gap width and + perhaps also specifying a wider plotting device. Displaying the values + will usually require increasing the left and/or right margins of the + plot, or setting xlim larger than the largest value.

    +

    If a gap width of zero is passed, the category labels will be displayed + at the left and right extents of the plot. This usually requires setting + xlim to values larger than the maximum extent of lx and + rx. The user can pass two different values to xlim, but + this is almost always a bad idea, as the lengths of the bars will not + be in the same proportion to the values on the left and right sides. + Both the bars and category labels are vertically centered on integer + values, allowing the user to easily add components to the plot.

    +

    lx and rx are the values specifying the left and right + extents of the left and right bars respectively. If both are matrices + or data frames, pyramid.plot will produce opposed stacked bars + with the first columns innermost. In this mode, colors are limited to + one per column. The stacked bar mode will in general not work with the + add method or with a gap of zero. Note that the stacked bar + mode can get very messy very quickly.

    +

    The add argument allows one or more sets of bars to be plotted + on an existing plot. If these are not transparent, any bar that is + shorter than the bar that overplots it will disappear. Only some graphic + devices (e.g. pdf) will handle transparency.

    +

    In order to add bars, the function cannot restore the initial margin values + or the new bars will not plot properly. To automatically restore the plot + margins, call the function as in the example.

    +
    +
    +

    Value

    +

    The return value of par("mar") when the function was called.

    +
    +
    +

    Author

    +

    Jim Lemon (thanks to Susumu Tanimura for the patch that omits + ticks for NA values in vector input and Igor Rebeiro for the space + argument)

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     xy.pop<-c(3.2,3.5,3.6,3.6,3.5,3.5,3.9,3.7,3.9,3.5,3.2,2.8,2.2,1.8,
    +  1.5,1.3,0.7,0.4)
    + xx.pop<-c(3.2,3.4,3.5,3.5,3.5,3.7,4,3.8,3.9,3.6,3.2,2.5,2,1.7,1.5,
    +  1.3,1,0.8)
    + agelabels<-c("0-4","5-9","10-14","15-19","20-24","25-29","30-34",
    +  "35-39","40-44","45-49","50-54","55-59","60-64","65-69","70-74",
    +  "75-79","80-44","85+")
    + mcol<-color.gradient(c(0,0,0.5,1),c(0,0,0.5,1),c(1,1,0.5,1),18)
    + fcol<-color.gradient(c(1,1,0.5,1),c(0.5,0.5,0.5,1),c(0.5,0.5,0.5,1),18)
    + par(mar=pyramid.plot(xy.pop,xx.pop,labels=agelabels,
    +  main="Australian population pyramid 2002",lxcol=mcol,rxcol=fcol,
    +  gap=0.5,show.values=TRUE))
    +
    +#> 4 4 
    + # three column matrices
    + avtemp<-c(seq(11,2,by=-1),rep(2:6,each=2),seq(11,2,by=-1))
    + malecook<-matrix(avtemp+sample(-2:2,30,TRUE),ncol=3)
    + femalecook<-matrix(avtemp+sample(-2:2,30,TRUE),ncol=3)
    + # group by age
    + agegrps<-c("0-10","11-20","21-30","31-40","41-50","51-60",
    +  "61-70","71-80","81-90","91+")
    + oldmar<-pyramid.plot(malecook,femalecook,labels=agegrps,
    +  unit="Bowls per month",lxcol=c("#ff0000","#eeee88","#0000ff"),
    +  rxcol=c("#ff0000","#eeee88","#0000ff"),laxlab=c(0,10,20,30),
    +  raxlab=c(0,10,20,30),top.labels=c("Males","Age","Females"),gap=4,
    +  do.first="plot_bg(\"#eedd55\")")
    +#> 30 30 
    + # put a box around it
    + box()
    + # give it a title
    + mtext("Porridge temperature by age and sex of bear",3,2,cex=1.5)
    + # stick in a legend
    + legend(par("usr")[1],11,c("Too hot","Just right","Too cold"),
    +  fill=c("#ff0000","#eeee88","#0000ff"))
    +
    + # don't forget to restore the margins and background
    + par(mar=oldmar,bg="transparent")
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/pyramid.plot.md b/reference/pyramid.plot.md new file mode 100644 index 0000000..ce834ec --- /dev/null +++ b/reference/pyramid.plot.md @@ -0,0 +1,187 @@ +# Pyramid plot + +Displays a pyramid (opposed horizontal bar) plot on the current graphics +device. + +## Usage + +``` r +pyramid.plot(lx,rx,labels=NULL,top.labels=c("Male","Age","Female"), + main="",laxlab=NULL,raxlab=NULL,unit="%",lxcol,rxcol,gap=1,space=0.2, + ppmar=c(4,2,4,2),labelcex=1,add=FALSE,xlim,show.values=FALSE,ndig=1, + do.first=NULL) +``` + +## Arguments + +- lx,rx: + + Vectors or a matrix or data frame (see Details) which should be of + equal length. + +- labels: + + Labels for the categories represented by each pair of bars. There + should be a label for each lx or rx value, even if empty. If `labels` + is a matrix or data frame, the first two columns will be used for the + left and right category labels respectively. + +- top.labels: + + The two categories represented on the left and right sides of the plot + and a heading for the labels in the center. + +- main: + + Optional title for the plot. + +- laxlab: + + Optional labels for the left x axis ticks. + +- raxlab: + + Optional labels for the right x axis ticks. + +- unit: + + The label for the units of the plot. + +- lxcol,rxcol: + + Color(s) for the left and right sets of bars. Both of these default to + `rainbow(length(labels))`. + +- gap: + + One half of the space between the two sets of bars for the `labels` in + user units. + +- space: + + Space between the bars. Should be 0 \<= space \< 1. + +- ppmar: + + Margins for the plot (see Details). + +- labelcex: + + Expansion for the category labels. + +- add: + + Whether to add bars to an existing plot. Usually this involves + overplotting a second set of bars, perhaps transparent. + +- xlim: + + Optional x limit for the plot (see Details). + +- show.values: + + Whether to display `lx` and `rx` at the ends of the bars. + +- ndig: + + The number of digits to round the values if displayed. + +- do.first: + + Optional expression to evaluate before displaying anything. + +## Details + +`pyramid.plot` is principally intended for population pyramids, although +it can display other types of opposed bar charts with suitable +modification of the arguments. If the user wants a different unit for +the display, just change `unit` accordingly. The default gap of two +units is usually satisfactory for the four to six percent range of most +bars on population pyramids. If `labels` is a matrix or data frame of at +least two columns, the first column will be displayed on the on the left +side of the gap in the center, and the second on the right. This will +almost always require increasing the gap width and perhaps also +specifying a wider plotting device. Displaying the values will usually +require increasing the left and/or right margins of the plot, or setting +`xlim` larger than the largest value. + +If a gap width of zero is passed, the category labels will be displayed +at the left and right extents of the plot. This usually requires setting +`xlim` to values larger than the maximum extent of `lx` and `rx`. The +user can pass two different values to `xlim`, but this is almost always +a bad idea, as the lengths of the bars will not be in the same +proportion to the values on the left and right sides. Both the bars and +category labels are vertically centered on integer values, allowing the +user to easily add components to the plot. + +`lx` and `rx` are the values specifying the left and right extents of +the left and right bars respectively. If both are matrices or data +frames, `pyramid.plot` will produce opposed stacked bars with the first +columns innermost. In this mode, colors are limited to one per column. +The stacked bar mode will in general not work with the `add` method or +with a gap of zero. Note that the stacked bar mode can get very messy +very quickly. + +The `add` argument allows one or more sets of bars to be plotted on an +existing plot. If these are not transparent, any bar that is shorter +than the bar that overplots it will disappear. Only some graphic devices +(e.g. `pdf`) will handle transparency. + +In order to add bars, the function cannot restore the initial margin +values or the new bars will not plot properly. To automatically restore +the plot margins, call the function as in the example. + +## Value + +The return value of `par("mar")` when the function was called. + +## Author + +Jim Lemon (thanks to Susumu Tanimura for the patch that omits ticks for +NA values in vector input and Igor Rebeiro for the space argument) + +## See also + +[rect](https://rdrr.io/r/graphics/rect.html) + +## Examples + +``` r + xy.pop<-c(3.2,3.5,3.6,3.6,3.5,3.5,3.9,3.7,3.9,3.5,3.2,2.8,2.2,1.8, + 1.5,1.3,0.7,0.4) + xx.pop<-c(3.2,3.4,3.5,3.5,3.5,3.7,4,3.8,3.9,3.6,3.2,2.5,2,1.7,1.5, + 1.3,1,0.8) + agelabels<-c("0-4","5-9","10-14","15-19","20-24","25-29","30-34", + "35-39","40-44","45-49","50-54","55-59","60-64","65-69","70-74", + "75-79","80-44","85+") + mcol<-color.gradient(c(0,0,0.5,1),c(0,0,0.5,1),c(1,1,0.5,1),18) + fcol<-color.gradient(c(1,1,0.5,1),c(0.5,0.5,0.5,1),c(0.5,0.5,0.5,1),18) + par(mar=pyramid.plot(xy.pop,xx.pop,labels=agelabels, + main="Australian population pyramid 2002",lxcol=mcol,rxcol=fcol, + gap=0.5,show.values=TRUE)) + +#> 4 4 + # three column matrices + avtemp<-c(seq(11,2,by=-1),rep(2:6,each=2),seq(11,2,by=-1)) + malecook<-matrix(avtemp+sample(-2:2,30,TRUE),ncol=3) + femalecook<-matrix(avtemp+sample(-2:2,30,TRUE),ncol=3) + # group by age + agegrps<-c("0-10","11-20","21-30","31-40","41-50","51-60", + "61-70","71-80","81-90","91+") + oldmar<-pyramid.plot(malecook,femalecook,labels=agegrps, + unit="Bowls per month",lxcol=c("#ff0000","#eeee88","#0000ff"), + rxcol=c("#ff0000","#eeee88","#0000ff"),laxlab=c(0,10,20,30), + raxlab=c(0,10,20,30),top.labels=c("Males","Age","Females"),gap=4, + do.first="plot_bg(\"#eedd55\")") +#> 30 30 + # put a box around it + box() + # give it a title + mtext("Porridge temperature by age and sex of bear",3,2,cex=1.5) + # stick in a legend + legend(par("usr")[1],11,c("Too hot","Just right","Too cold"), + fill=c("#ff0000","#eeee88","#0000ff")) + + # don't forget to restore the margins and background + par(mar=oldmar,bg="transparent") +``` diff --git a/reference/radial.grid.html b/reference/radial.grid.html new file mode 100644 index 0000000..ec59d80 --- /dev/null +++ b/reference/radial.grid.html @@ -0,0 +1,123 @@ + +Display a radial grid — radial.grid • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    radial.grid displays a radial grid for the radial.plot and + radial.pie functions.

    +
    + +
    +

    Usage

    +
    radial.grid(labels=NA,label.pos=NULL,radlab=FALSE,radial.lim=NULL,
    +  start=0,clockwise=FALSE,label.prop=1.1,grid.pos=seq(0.25,1,0.25),
    +  rad.col="gray",grid.col="gray",grid.bg="transparent",show.radial.grid=TRUE,
    +  start.plot=FALSE)
    +
    + +
    +

    Arguments

    +

    +
    labels
    +

    The labels to display around the circumference of the grid.

    + +
    label.pos
    +

    Radial positions for the labels.

    + +
    radlab
    +

    Whether to rotate the labels to a radial orientation.

    + +
    radial.lim
    +

    Optional radial limits for the circular plot. If specified, + these must be the same as the radial limits of the original plot.

    + +
    start
    +

    The zero position on the plot in the units of label.pos.

    + +
    clockwise
    +

    Whether to increase angles clockwise rather than the + default counterclockwise.

    + +
    label.prop
    +

    Proportion of radial.lim to place the labels.

    + +
    grid.pos
    +

    Radial positions for the circular grid lines.

    + +
    rad.col
    +

    Color for the radial grid lines.

    + +
    grid.col
    +

    Color for the circumferential grid lines.

    + +
    grid.bg
    +

    Background color for the radial grid.

    + +
    show.radial.grid
    +

    Whether to display the radial lines on the grid.

    + +
    start.plot
    +

    If TRUE, sets up a blank radial grid.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/radial.grid.md b/reference/radial.grid.md new file mode 100644 index 0000000..b636b62 --- /dev/null +++ b/reference/radial.grid.md @@ -0,0 +1,77 @@ +# Display a radial grid + +`radial.grid` displays a radial grid for the `radial.plot` and +`radial.pie` functions. + +## Usage + +``` r +radial.grid(labels=NA,label.pos=NULL,radlab=FALSE,radial.lim=NULL, + start=0,clockwise=FALSE,label.prop=1.1,grid.pos=seq(0.25,1,0.25), + rad.col="gray",grid.col="gray",grid.bg="transparent",show.radial.grid=TRUE, + start.plot=FALSE) +``` + +## Arguments + +- labels: + + The labels to display around the circumference of the grid. + +- label.pos: + + Radial positions for the labels. + +- radlab: + + Whether to rotate the labels to a radial orientation. + +- radial.lim: + + Optional radial limits for the circular plot. If specified, these must + be the same as the radial limits of the original plot. + +- start: + + The zero position on the plot in the units of `label.pos`. + +- clockwise: + + Whether to increase angles clockwise rather than the default + counterclockwise. + +- label.prop: + + Proportion of `radial.lim` to place the labels. + +- grid.pos: + + Radial positions for the circular grid lines. + +- rad.col: + + Color for the radial grid lines. + +- grid.col: + + Color for the circumferential grid lines. + +- grid.bg: + + Background color for the radial grid. + +- show.radial.grid: + + Whether to display the radial lines on the grid. + +- start.plot: + + If TRUE, sets up a blank radial grid. + +## Value + +nil + +## Author + +Jim Lemon diff --git a/reference/radial.pie-1.png b/reference/radial.pie-1.png new file mode 100644 index 0000000..87a71ef Binary files /dev/null and b/reference/radial.pie-1.png differ diff --git a/reference/radial.pie-2.png b/reference/radial.pie-2.png new file mode 100644 index 0000000..b3515b7 Binary files /dev/null and b/reference/radial.pie-2.png differ diff --git a/reference/radial.pie-3.png b/reference/radial.pie-3.png new file mode 100644 index 0000000..3dadcd9 Binary files /dev/null and b/reference/radial.pie-3.png differ diff --git a/reference/radial.pie-4.png b/reference/radial.pie-4.png new file mode 100644 index 0000000..8c3e3cd Binary files /dev/null and b/reference/radial.pie-4.png differ diff --git a/reference/radial.pie.html b/reference/radial.pie.html new file mode 100644 index 0000000..e3fab0b --- /dev/null +++ b/reference/radial.pie.html @@ -0,0 +1,218 @@ + +Plot sectors/annuli on a circular grid of 0 to 2*pi radians — radial.pie • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Plot numeric values as sectors with optional annuli on a circular field in the + directions defined by angles in radians.

    +
    + +
    +

    Usage

    +
    radial.pie(radial.extents,sector.edges=NULL,
    + sector.colors=NULL,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1),
    + alpha=1,labels=NA,label.pos=NULL,radlab=FALSE,start=0,
    + clockwise=FALSE,label.prop=1.1,radial.lim=NULL,main="",xlab="",ylab="",
    + mar=c(2,2,3,2),show.grid=TRUE,show.grid.labels=4,show.radial.grid=TRUE,
    + grid.col="gray",grid.bg="transparent",grid.unit=NULL,
    + radial.labels=NULL,boxed.radial=TRUE,add=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    radial.extents
    +

    A numeric data vector or list. If radial.extents + is a list, the elements of the list will be considered separate data vectors.

    + +
    sector.edges
    +

    A numeric vector of positions in radians. + These are interpreted as beginning at the right (0 radians) and moving + counterclockwise unless clockwise is TRUE.

    + +
    sector.colors
    +

    Optional colors for the sectors and annuli. Defaults to + rainbow(nsectors) with fading outward if annuli are specified.

    + +
    cs1, cs2, cs3, alpha
    +

    Color scaling arguments - see color.scale.

    + +
    labels
    +

    Character strings to be placed at the outer ends of + the lines. If set to NA, will suppress printing of labels, + but if missing, the radial positions will be used.

    + +
    label.pos
    +

    The positions of the labels around the plot in radians.

    + +
    radlab
    +

    Whether to rotate the outer labels to a radial orientation.

    + +
    start
    +

    Where to place the starting (zero) point. Defaults to the + 3 o'clock position.

    + +
    clockwise
    +

    Whether to interpret positive positions as clockwise from + the starting point. The default is counterclockwise.

    + +
    label.prop
    +

    The label position radius as a proportion of the + maximum line length.

    + +
    radial.lim
    +

    The inner and outer radial limits for the plot. Defaults + to the range of radial.extents, although zero to max(radial.extents) + is often what is wanted.

    + +
    main
    +

    The title for the plot.

    + +
    xlab,ylab
    +

    Normally x and y axis labels are suppressed.

    + +
    mar
    +

    Margins for the plot. Allows the user to leave space for + legends, long labels, etc.

    + +
    show.grid
    +

    Logical - whether to draw a circular grid.

    + +
    show.grid.labels
    +

    Whether and where to display labels for the grid + - see Details.

    + +
    show.radial.grid
    +

    Whether to draw radial lines to the plot labels.

    + +
    grid.col
    +

    Color of the circular grid.

    + +
    grid.bg
    +

    Fill color of above.

    + +
    grid.unit
    +

    Optional unit description for the grid.

    + +
    radial.labels
    +

    Optional labels for the radial grid. The default is + the values of radial.lim.

    + +
    boxed.radial
    +

    Whether to use boxed.labels or text for radial labels.

    + +
    add
    +

    Whether to add one or more series to an existing plot.

    + +
    ...
    +

    Additional arguments are passed to plot.

    + +
    +
    +

    Value

    +

    The par values that are changed in the function + as they were at the time radial.pie was called.

    +
    +
    +

    Details

    +

    radial.pie displays a plot of radial sectors with optional annular + sections centered at the midpoint of the plot frame, the lengths corresponding + to the numeric magnitudes of radial.extents.

    +

    If more series are added to an existing plot, + radial.pie will try to maintain the current plot parameters. However, + it seems unlikely that adding series would be sensible in radial.pie. + This argument may be dropped if it proves useless.

    +

    The size of the labels on the outside of the plot can be adjusted by + setting par(cex.axis=) and that of the labels inside by setting + par(cex.lab=). If radlab is TRUE, the labels will be rotated + to a radial alignment. This may help when there are many values and labels. + If some labels are still crowded, try running label.pos through the + spreadout function. If the show.grid.labels argument is a number + from 1 to 4, the labels will be placed along a horizontal or vertical radius. + The numbers represent the same positions as in axis, with the default + (4) on the right. To suppress these labels, pass zero or FALSE.

    +

    radial.pie works somewhat differently from the radial.plot + family and is still under development. I have released it in order to get + feedback to improve both the design and the programming. If successful, I + hope to merge the code with the radial.plot function.

    +
    +
    +

    Author

    +

    Jim Lemon - thanks to Patrick Jemison for asking for it.

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     pie1<-c(3,6,5,4,7,8,9,1,4)
    + pie2<-list(0:3,1:6,2:5,1:4,0:7,4:8,2:9,0:1,0:4)
    + pie3<-sample(10:60,36)
    + pie4<-list(sort(sample(1:60,8)))
    + for(sector in 2:36) pie4[[sector]]<-sort(sample(1:60,8))
    + oldpar<-radial.pie(pie1,labels=LETTERS[1:9])
    +
    + radial.pie(pie2,labels=letters[2:10])
    +
    + radial.pie(pie3,labels=1:36)
    +
    + radial.pie(pie4,labels=1:36)
    +
    + # restore the par values
    + par(oldpar)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/radial.pie.md b/reference/radial.pie.md new file mode 100644 index 0000000..216d415 --- /dev/null +++ b/reference/radial.pie.md @@ -0,0 +1,185 @@ +# Plot sectors/annuli on a circular grid of 0 to 2\*pi radians + +Plot numeric values as sectors with optional annuli on a circular field +in the directions defined by angles in radians. + +## Usage + +``` r +radial.pie(radial.extents,sector.edges=NULL, + sector.colors=NULL,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1), + alpha=1,labels=NA,label.pos=NULL,radlab=FALSE,start=0, + clockwise=FALSE,label.prop=1.1,radial.lim=NULL,main="",xlab="",ylab="", + mar=c(2,2,3,2),show.grid=TRUE,show.grid.labels=4,show.radial.grid=TRUE, + grid.col="gray",grid.bg="transparent",grid.unit=NULL, + radial.labels=NULL,boxed.radial=TRUE,add=FALSE,...) +``` + +## Arguments + +- radial.extents: + + A numeric data vector or list. If `radial.extents` is a list, the + elements of the list will be considered separate data vectors. + +- sector.edges: + + A numeric vector of positions in radians. These are interpreted as + beginning at the right (0 radians) and moving counterclockwise unless + `clockwise` is TRUE. + +- sector.colors: + + Optional colors for the sectors and annuli. Defaults to + `rainbow(nsectors)` with fading outward if annuli are specified. + +- cs1, cs2, cs3, alpha: + + Color scaling arguments - see [color.scale](color.scale.md). + +- labels: + + Character strings to be placed at the outer ends of the lines. If set + to NA, will suppress printing of labels, but if missing, the radial + positions will be used. + +- label.pos: + + The positions of the labels around the plot in radians. + +- radlab: + + Whether to rotate the outer labels to a radial orientation. + +- start: + + Where to place the starting (zero) point. Defaults to the 3 o'clock + position. + +- clockwise: + + Whether to interpret positive positions as clockwise from the starting + point. The default is counterclockwise. + +- label.prop: + + The label position radius as a proportion of the maximum line length. + +- radial.lim: + + The inner and outer radial limits for the plot. Defaults to the range + of radial.extents, although zero to `max(radial.extents)` is often + what is wanted. + +- main: + + The title for the plot. + +- xlab,ylab: + + Normally x and y axis labels are suppressed. + +- mar: + + Margins for the plot. Allows the user to leave space for legends, long + labels, etc. + +- show.grid: + + Logical - whether to draw a circular grid. + +- show.grid.labels: + + Whether and where to display labels for the grid - see Details. + +- show.radial.grid: + + Whether to draw radial lines to the plot labels. + +- grid.col: + + Color of the circular grid. + +- grid.bg: + + Fill color of above. + +- grid.unit: + + Optional unit description for the grid. + +- radial.labels: + + Optional labels for the radial grid. The default is the values of + radial.lim. + +- boxed.radial: + + Whether to use boxed.labels or text for radial labels. + +- add: + + Whether to add one or more series to an existing plot. + +- ...: + + Additional arguments are passed to `plot`. + +## Value + +The `par` values that are changed in the function as they were at the +time `radial.pie` was called. + +## Details + +`radial.pie` displays a plot of radial sectors with optional annular +sections centered at the midpoint of the plot frame, the lengths +corresponding to the numeric magnitudes of `radial.extents`. + +If more series are added to an existing plot, `radial.pie` will try to +maintain the current plot parameters. However, it seems unlikely that +adding series would be sensible in `radial.pie`. This argument may be +dropped if it proves useless. + +The size of the labels on the outside of the plot can be adjusted by +setting `par(cex.axis=)` and that of the labels inside by setting +`par(cex.lab=)`. If `radlab` is TRUE, the labels will be rotated to a +radial alignment. This may help when there are many values and labels. +If some labels are still crowded, try running `label.pos` through the +`spreadout` function. If the `show.grid.labels` argument is a number +from 1 to 4, the labels will be placed along a horizontal or vertical +radius. The numbers represent the same positions as in `axis`, with the +default (4) on the right. To suppress these labels, pass zero or FALSE. + +`radial.pie` works somewhat differently from the `radial.plot` family +and is still under development. I have released it in order to get +feedback to improve both the design and the programming. If successful, +I hope to merge the code with the `radial.plot` function. + +## Author + +Jim Lemon - thanks to Patrick Jemison for asking for it. + +## See also + +[radial.plot](radial.plot.md) + +## Examples + +``` r + pie1<-c(3,6,5,4,7,8,9,1,4) + pie2<-list(0:3,1:6,2:5,1:4,0:7,4:8,2:9,0:1,0:4) + pie3<-sample(10:60,36) + pie4<-list(sort(sample(1:60,8))) + for(sector in 2:36) pie4[[sector]]<-sort(sample(1:60,8)) + oldpar<-radial.pie(pie1,labels=LETTERS[1:9]) + + radial.pie(pie2,labels=letters[2:10]) + + radial.pie(pie3,labels=1:36) + + radial.pie(pie4,labels=1:36) + + # restore the par values + par(oldpar) +``` diff --git a/reference/radial.plot-1.png b/reference/radial.plot-1.png new file mode 100644 index 0000000..0a1f731 Binary files /dev/null and b/reference/radial.plot-1.png differ diff --git a/reference/radial.plot-2.png b/reference/radial.plot-2.png new file mode 100644 index 0000000..f42fccd Binary files /dev/null and b/reference/radial.plot-2.png differ diff --git a/reference/radial.plot-3.png b/reference/radial.plot-3.png new file mode 100644 index 0000000..af8dc08 Binary files /dev/null and b/reference/radial.plot-3.png differ diff --git a/reference/radial.plot-4.png b/reference/radial.plot-4.png new file mode 100644 index 0000000..41c27b1 Binary files /dev/null and b/reference/radial.plot-4.png differ diff --git a/reference/radial.plot-5.png b/reference/radial.plot-5.png new file mode 100644 index 0000000..1b74dd5 Binary files /dev/null and b/reference/radial.plot-5.png differ diff --git a/reference/radial.plot-6.png b/reference/radial.plot-6.png new file mode 100644 index 0000000..696a24b Binary files /dev/null and b/reference/radial.plot-6.png differ diff --git a/reference/radial.plot.html b/reference/radial.plot.html new file mode 100644 index 0000000..b986e60 --- /dev/null +++ b/reference/radial.plot.html @@ -0,0 +1,325 @@ + +Plot values on a circular grid of 0 to 2*pi radians — radial.plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Plot numeric values as distances from the center of a circular field in the + directions defined by angles in radians.

    +
    + +
    +

    Usage

    +
    radial.plot(lengths,radial.pos=NULL,labels=NA,label.pos=NULL,radlab=FALSE,
    + start=0,clockwise=FALSE,rp.type="r",label.prop=1.1,main="",xlab="",ylab="",
    + line.col=par("fg"),lty=par("lty"),lwd=par("lwd"),mar=c(2,2,3,2),
    + show.grid=TRUE,show.grid.labels=4,show.radial.grid=TRUE,rad.col="gray",
    + grid.col="gray",grid.bg="transparent",grid.left=FALSE,grid.unit=NULL,
    + point.symbols=1,point.col=par("fg"),show.centroid=FALSE,radial.lim=NULL,
    + radial.labels=NULL,boxed.radial=TRUE,poly.col=NA,add=FALSE,
    + loglen=FALSE,explab=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    lengths
    +

    A numeric data vector or matrix. If lengths + is a matrix, the rows will be considered separate data vectors.

    + +
    radial.pos
    +

    A numeric vector or matrix of positions in radians. + These are interpreted as beginning at the right (0 radians) and moving + counterclockwise. If radial.pos is a matrix, the rows must + correspond to rows of lengths.

    + +
    labels
    +

    Character strings to be placed at the outer ends of + the lines. If set to NULL, will suppress printing of labels, + but if missing, the radial positions will be used.

    + +
    label.pos
    +

    The positions of the labels around the plot in radians.

    + +
    radlab
    +

    Whether to rotate the outer labels to a radial orientation.

    + +
    start
    +

    Where to place the starting (zero) point. Defaults to the + 3 o'clock position.

    + +
    clockwise
    +

    Whether to interpret positive positions as clockwise from + the starting point. The default is counterclockwise.

    + +
    rp.type
    +

    Whether to draw (r)adial lines, a (p)olygon, (s)ymbols, (t)ext, + or some combination of these. If lengths is a matrix and rp.type is + a vector, each row of lengths can be displayed differently.

    + +
    label.prop
    +

    The label position radius as a proportion of the + maximum line length.

    + +
    main
    +

    The title for the plot.

    + +
    xlab,ylab
    +

    Normally x and y axis labels are suppressed.

    + +
    line.col
    +

    The color of the radial lines or polygons drawn.

    + +
    lty
    +

    The line type(s) to be used for polygons or radial lines.

    + +
    lwd
    +

    The line width(s) to be used for polygons or radial lines.

    + +
    mar
    +

    Margins for the plot. Allows the user to leave space for + legends, long labels, etc.

    + +
    show.grid
    +

    Logical - whether to draw a circular grid.

    + +
    show.grid.labels
    +

    Whether and where to display labels for the grid + - see Details.

    + +
    show.radial.grid
    +

    Whether to draw radial lines to the plot labels.

    + +
    rad.col
    +

    Color of the radial lines on the grid.

    + +
    grid.col
    +

    Color of the circumferential lines on the grid.

    + +
    grid.bg
    +

    Fill color of above.

    + +
    grid.left
    +

    Whether to place the radial grid labels on the left side.

    + +
    grid.unit
    +

    Optional unit description for the grid.

    + +
    point.symbols
    +

    The symbols for plotting (as in pch) or if + rp.type is "t", the text that will be displayed.

    + +
    point.col
    +

    Colors for the symbols.

    + +
    show.centroid
    +

    Whether to display a centroid.

    + +
    radial.lim
    +

    The range of the grid circle. Defaults to + pretty(range(lengths)), but if more than two values are passed, the + exact values will be displayed.

    + +
    radial.labels
    +

    Optional labels for the radial grid. The default is + the values of radial.lim, or if loglen is TRUE, the corresponding log + values.

    + +
    boxed.radial
    +

    Whether to use boxed.labels or text for radial labels.

    + +
    poly.col
    +

    Fill color if polygons are drawn. Use NA for no fill.

    + +
    add
    +

    Whether to add one or more series to an existing plot.

    + +
    loglen
    +

    Whether to log transform the length values. Only base + 10 logs are available. Keep in mind that the values actually plotted will be + the logarithms, although the exponentiated logs are displayed.

    + +
    explab
    +

    Whether to use the default fixed (FALSE) or exponential (TRUE) + notation for the radial labels.

    + +
    ...
    +

    Additional arguments are passed to plot.

    + +
    +
    +

    Value

    +

    The par values that are changed in the function + as they were at the time radial.plot was called.

    +
    +
    +

    Details

    +

    radial.plot displays a plot of radial lines, polygon(s), + symbols, text or a combination of these centered at the midpoint of + the plot frame, the lengths, vertices or positions corresponding + to the numeric magnitudes of the data values. Note that if log transformation is requested with loglen, the values plotted will be the logs, not the values displayed on the plot. + If show.centroid + is TRUE, an enlarged point at the centroid of values is displayed. The + centroid is calculated as the average of x and y values unless + rp.type="p". In this case, the barycenter of the polygon is + calculated. Make sure that these suit your purpose, otherwise calculate + the centroid that you really want and add it with the points function. + Note that if the observations are not taken at equal intervals around the + circle, the centroid may not mean much.

    +

    The text option for rp.type allows the user to place text at + each point. It is useful for adding labels at arbitrary points on an existing + plot or perhaps labelling points with letters or digits rather than different symbols. See the last example.

    +

    If the user wants to plot several sets of lines, points or symbols by + passing matrices or data frames of lengths and radial.pos, + remember that these will be grouped by row, so transpose if the data are + grouped by columns.

    +

    If more series are added to an existing plot, + radial.plot will try to maintain the current plot parameters. + Resetting the parameters after doing the initial plot will almost certainly + mess up any series that are added. Series that are added will be plotted + "on top" of the existing plot, possibly overplotting other things. If the + added series have a larger range than the initial series, set radial.lim + to account for this in the initial plot, and if radial.lim is specified + in the initial plot, remember to repeat it for added series as in the example.

    +

    The size of the labels on the outside of the plot can be adjusted by + setting par(cex.axis=) and that of the labels inside by setting + par(cex.lab=). If radlab is TRUE, the labels will be rotated + to a radial alignment. This may help when there are many values and labels. + If some labels are still crowded, try running label.pos through the + spreadout function. If the show.grid.labels argument is a number + from 1 to 4, the labels will be placed along a horizontal or vertical radius. + The numbers represent the same positions as in axis, with the default + (4) on the right.

    +

    The radial.plot family of plots is useful for illustrating + cyclic data such as wind direction or speed (but see oz.windrose + for both), activity at different times of the day, and so on. While + radial.plot actually does the plotting, another function is usually + called for specific types of cyclic data.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    Note

    +

    Thanks to + Jeremy Claisse and Antonio Hernandez Matias for the + lty and rp.type suggestions respectively

    +

    Patrick Baker for the request that led to radlab

    +

    Thomas Steiner for the request for the radial.lim and radial.labels modifications

    +

    Evan Daugharty for requesting the add argument

    +

    James MacCarthy for requesting better radial labels

    +

    Steve Ellison for noticing that the return values of the functions had changed

    +

    Don Dennerline for requesting the rank clock

    +

    Mehdi Nellen for the different colors for the radial and circumferential lines for the grid

    +

    Mayeul Kauffmann for noticing the radial label bug when a separate radial.grid was included

    +

    Ogbos Okike for requesting a text option for rp.type

    +

    Keziah Conroy for requesting the log option

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     testlen<-runif(10,0,10)
    + testpos<-seq(0,18*pi/10,length=10)
    + testlab<-letters[1:10]
    + oldpar<-radial.plot(testlen,testpos,main="Test Radial Lines",line.col="red",
    +  lwd=3,rad.col="lightblue")
    +
    + testlen<-c(sin(seq(0,1.98*pi,length=100))+2+rnorm(100)/10)
    + testpos<-seq(0,1.98*pi,length=100)
    + radial.plot(testlen,testpos,rp.type="p",main="Test Polygon",line.col="blue",
    +  labels=LETTERS[1:8],label.pos=seq(0,14*pi/8,length.out=8))
    +
    + # now do a 12 o'clock start with clockwise positive
    + radial.plot(testlen,testpos,start=pi/2,clockwise=TRUE,show.grid.labels=2,
    +  rp.type="s",main="Test Symbols (clockwise)",radial.lim=c(0,3.5),
    +  point.symbols=16,point.col="green",show.centroid=TRUE,
    +  labels=LETTERS[1:6],label.pos=seq(0,10*pi/6,length.out=6))
    +
    + # one without the circular grid and multiple polygons
    + # see the "diamondplot" function for variation on this
    + posmat<-matrix(sample(2:9,30,TRUE),nrow=3)
    + radial.plot(posmat,labels=paste("X",1:10,sep=""),rp.type="p",
    +  main="Spiderweb plot",line.col=2:4,show.grid=FALSE,lwd=1:3,
    +  radial.lim=c(0,10))
    +
    + # dissolved ions in water
    + ions<-c(3.2,5,1,3.1,2.1,4.5)
    + ion.names<-c("Na","Ca","Mg","Cl","HCO3","SO4")
    + radial.plot(ions,labels=ion.names,rp.type="p",main="Dissolved ions in water",
    +  grid.unit="meq/l",radial.lim=c(0,5),poly.col="yellow",show.grid.labels=3)
    + # add the names of the ions to the plot
    + radial.plot(ions,rp.type="t",point.symbols=ion.names,radial.lim=c(0,5),
    +  add=TRUE)
    + # add points inside the polygon - radial.lim is supplied by plotrix_env
    + radial.plot(ions-0.4,rp.type="s",point.symbols=4,point.col="red",add=TRUE)
    +
    + radmat<-matrix(c(sample(1:4,4),sample(1:4,4),sample(1:4,4),sample(1:4,4),
    +  sample(1:4,4),sample(1:4,4),sample(1:4,4),sample(1:4,4),
    +  sample(1:4,4),sample(1:4,4)),nrow=4)
    + # finally a rank clock
    + radial.plot(radmat,rp.type="l",radial.pos=seq(0,20*pi/11.1,length.out=10),
    +  label.pos=seq(0,20*pi/11.1,length.out=10),start=pi/2,clockwise=TRUE,
    +  labels=2001:2010,radial.lim=c(0.2,4),main="Rank clock")
    + legend(-1.7,4,c("Black","Red","Green","Blue"),col=1:4,lty=1)
    +
    + par(xpd=oldpar$xpd,mar=oldpar$mar,pty=oldpar$pty)
    + # reset the margins
    + par(mar=c(5,4,4,2))
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/radial.plot.labels-1.png b/reference/radial.plot.labels-1.png new file mode 100644 index 0000000..35e7d44 Binary files /dev/null and b/reference/radial.plot.labels-1.png differ diff --git a/reference/radial.plot.labels-2.png b/reference/radial.plot.labels-2.png new file mode 100644 index 0000000..6ef066c Binary files /dev/null and b/reference/radial.plot.labels-2.png differ diff --git a/reference/radial.plot.labels.html b/reference/radial.plot.labels.html new file mode 100644 index 0000000..488dfd8 --- /dev/null +++ b/reference/radial.plot.labels.html @@ -0,0 +1,149 @@ + +Display labels on a circular grid — radial.plot.labels • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    radial.plot.labels displays a labels on a circular plot produced by + one of the radial.plot family of functions.

    +
    + +
    +

    Usage

    +
    radial.plot.labels(lengths,radial.pos=NULL,units="radians",radial.lim=NULL,
    +  start=0,clockwise=FALSE,labels,adj=NULL,pos=NULL,boxed.labels=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    lengths
    +

    numeric data vector. Magnitudes will be represented as + the radial positions of symbols, line ends or polygon vertices.

    + +
    radial.pos
    +

    numeric vector of radial positions. These will be + converted to radians if the units argument is not "radians".

    + +
    units
    +

    The units of radial.pos may be degrees or 24 hour clock + positions. If units is "polar" or "clock24" respectively, the + values of radial.pos will be converted into radians.

    + +
    radial.lim
    +

    Optional radial limits for the circular plot. These + must be the same as the radial limits of the original plot.

    + +
    start
    +

    The zero position on the plot in the units of radial.pos.

    + +
    clockwise
    +

    Whether to increase angles clockwise rather than the + default counterclockwise.

    + +
    labels
    +

    text labels to display on the plot.

    + +
    adj
    +

    Text justification as in the text function.

    + +
    pos
    +

    Text position as in the text function.

    + +
    boxed.labels
    +

    Whether to use boxed.labels or text.

    + +
    ...
    +

    additional arguments passed to boxed.labels or + text.

    + +
    +
    +

    Details

    +

    Don't confuse this function with the radial.labels argument in + the radial.plot function. This labels the values rather than the grid.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     testlen<-c(rnorm(10)*2+5)
    + # do the labels in clock24 units
    + testpos<-c(6.74,8.3,10.55,12.33,13.75,15.9,17.15,19.36,21.02,23.27)
    + oldpar<-clock24.plot(testlen,testpos,main="Test radial.plot.labels",
    +  rp.type="s",point.symbols=3,point.col="green")
    + radial.plot.labels(testlen,testpos,units="clock24",labels=LETTERS[1:10],
    +  pos=3,col="red")
    +
    + testangle<-c(25,42,67,94,128,173,191,234,268,307)
    + # now a polar plot
    + polar.plot(testlen,testangle,main="Test radial.plot.labels",rp.type="p",
    +  poly.col="green")
    + radial.plot.labels(testlen,testangle,units="polar",labels=LETTERS[1:10])
    +
    + # reset par
    + par(oldpar)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/radial.plot.labels.md b/reference/radial.plot.labels.md new file mode 100644 index 0000000..f4c17c5 --- /dev/null +++ b/reference/radial.plot.labels.md @@ -0,0 +1,101 @@ +# Display labels on a circular grid + +`radial.plot.labels` displays a labels on a circular plot produced by +one of the radial.plot family of functions. + +## Usage + +``` r +radial.plot.labels(lengths,radial.pos=NULL,units="radians",radial.lim=NULL, + start=0,clockwise=FALSE,labels,adj=NULL,pos=NULL,boxed.labels=FALSE,...) +``` + +## Arguments + +- lengths: + + numeric data vector. Magnitudes will be represented as the radial + positions of symbols, line ends or polygon vertices. + +- radial.pos: + + numeric vector of radial positions. These will be converted to radians + if the `units` argument is not "radians". + +- units: + + The units of `radial.pos` may be degrees or 24 hour clock positions. + If `units` is "polar" or "clock24" respectively, the values of + radial.pos will be converted into radians. + +- radial.lim: + + Optional radial limits for the circular plot. These must be the same + as the radial limits of the original plot. + +- start: + + The zero position on the plot in the units of `radial.pos`. + +- clockwise: + + Whether to increase angles clockwise rather than the default + counterclockwise. + +- labels: + + text labels to display on the plot. + +- adj: + + Text justification as in the `text` function. + +- pos: + + Text position as in the `text` function. + +- boxed.labels: + + Whether to use `boxed.labels` or `text`. + +- ...: + + additional arguments passed to `boxed.labels` or `text`. + +## Details + +Don't confuse this function with the `radial.labels` argument in the +radial.plot function. This labels the values rather than the grid. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[text](https://rdrr.io/r/graphics/text.html) + +## Examples + +``` r + testlen<-c(rnorm(10)*2+5) + # do the labels in clock24 units + testpos<-c(6.74,8.3,10.55,12.33,13.75,15.9,17.15,19.36,21.02,23.27) + oldpar<-clock24.plot(testlen,testpos,main="Test radial.plot.labels", + rp.type="s",point.symbols=3,point.col="green") + radial.plot.labels(testlen,testpos,units="clock24",labels=LETTERS[1:10], + pos=3,col="red") + + testangle<-c(25,42,67,94,128,173,191,234,268,307) + # now a polar plot + polar.plot(testlen,testangle,main="Test radial.plot.labels",rp.type="p", + poly.col="green") + radial.plot.labels(testlen,testangle,units="polar",labels=LETTERS[1:10]) + + # reset par + par(oldpar) +``` diff --git a/reference/radial.plot.md b/reference/radial.plot.md new file mode 100644 index 0000000..427a0ec --- /dev/null +++ b/reference/radial.plot.md @@ -0,0 +1,318 @@ +# Plot values on a circular grid of 0 to 2\*pi radians + +Plot numeric values as distances from the center of a circular field in +the directions defined by angles in radians. + +## Usage + +``` r +radial.plot(lengths,radial.pos=NULL,labels=NA,label.pos=NULL,radlab=FALSE, + start=0,clockwise=FALSE,rp.type="r",label.prop=1.1,main="",xlab="",ylab="", + line.col=par("fg"),lty=par("lty"),lwd=par("lwd"),mar=c(2,2,3,2), + show.grid=TRUE,show.grid.labels=4,show.radial.grid=TRUE,rad.col="gray", + grid.col="gray",grid.bg="transparent",grid.left=FALSE,grid.unit=NULL, + point.symbols=1,point.col=par("fg"),show.centroid=FALSE,radial.lim=NULL, + radial.labels=NULL,boxed.radial=TRUE,poly.col=NA,add=FALSE, + loglen=FALSE,explab=FALSE,...) +``` + +## Arguments + +- lengths: + + A numeric data vector or matrix. If `lengths` is a matrix, the rows + will be considered separate data vectors. + +- radial.pos: + + A numeric vector or matrix of positions in radians. These are + interpreted as beginning at the right (0 radians) and moving + counterclockwise. If `radial.pos` is a matrix, the rows must + correspond to rows of `lengths`. + +- labels: + + Character strings to be placed at the outer ends of the lines. If set + to NULL, will suppress printing of labels, but if missing, the radial + positions will be used. + +- label.pos: + + The positions of the labels around the plot in radians. + +- radlab: + + Whether to rotate the outer labels to a radial orientation. + +- start: + + Where to place the starting (zero) point. Defaults to the 3 o'clock + position. + +- clockwise: + + Whether to interpret positive positions as clockwise from the starting + point. The default is counterclockwise. + +- rp.type: + + Whether to draw (r)adial lines, a (p)olygon, (s)ymbols, (t)ext, or + some combination of these. If `lengths` is a matrix and rp.type is a + vector, each row of `lengths` can be displayed differently. + +- label.prop: + + The label position radius as a proportion of the maximum line length. + +- main: + + The title for the plot. + +- xlab,ylab: + + Normally x and y axis labels are suppressed. + +- line.col: + + The color of the radial lines or polygons drawn. + +- lty: + + The line type(s) to be used for polygons or radial lines. + +- lwd: + + The line width(s) to be used for polygons or radial lines. + +- mar: + + Margins for the plot. Allows the user to leave space for legends, long + labels, etc. + +- show.grid: + + Logical - whether to draw a circular grid. + +- show.grid.labels: + + Whether and where to display labels for the grid - see Details. + +- show.radial.grid: + + Whether to draw radial lines to the plot labels. + +- rad.col: + + Color of the radial lines on the grid. + +- grid.col: + + Color of the circumferential lines on the grid. + +- grid.bg: + + Fill color of above. + +- grid.left: + + Whether to place the radial grid labels on the left side. + +- grid.unit: + + Optional unit description for the grid. + +- point.symbols: + + The symbols for plotting (as in pch) or if `rp.type` is "t", the text + that will be displayed. + +- point.col: + + Colors for the symbols. + +- show.centroid: + + Whether to display a centroid. + +- radial.lim: + + The range of the grid circle. Defaults to `pretty(range(lengths))`, + but if more than two values are passed, the exact values will be + displayed. + +- radial.labels: + + Optional labels for the radial grid. The default is the values of + radial.lim, or if loglen is TRUE, the corresponding log values. + +- boxed.radial: + + Whether to use boxed.labels or text for radial labels. + +- poly.col: + + Fill color if polygons are drawn. Use NA for no fill. + +- add: + + Whether to add one or more series to an existing plot. + +- loglen: + + Whether to log transform the `length` values. Only base 10 logs are + available. Keep in mind that the values actually plotted will be the + logarithms, although the exponentiated logs are displayed. + +- explab: + + Whether to use the default fixed (FALSE) or exponential (TRUE) + notation for the radial labels. + +- ...: + + Additional arguments are passed to `plot`. + +## Value + +The `par` values that are changed in the function as they were at the +time `radial.plot` was called. + +## Details + +`radial.plot` displays a plot of radial lines, polygon(s), symbols, text +or a combination of these centered at the midpoint of the plot frame, +the lengths, vertices or positions corresponding to the numeric +magnitudes of the data values. Note that if log transformation is +requested with `loglen`, the values plotted will be the logs, not the +values displayed on the plot. If `show.centroid` is TRUE, an enlarged +point at the centroid of values is displayed. The centroid is calculated +as the average of x and y values unless `rp.type="p"`. In this case, the +barycenter of the polygon is calculated. Make sure that these suit your +purpose, otherwise calculate the centroid that you really want and add +it with the `points` function. Note that if the observations are not +taken at equal intervals around the circle, the centroid may not mean +much. + +The `text` option for `rp.type` allows the user to place text at each +point. It is useful for adding labels at arbitrary points on an existing +plot or perhaps labelling points with letters or digits rather than +different symbols. See the last example. + +If the user wants to plot several sets of lines, points or symbols by +passing matrices or data frames of `lengths` and `radial.pos`, remember +that these will be grouped by row, so transpose if the data are grouped +by columns. + +If more series are added to an existing plot, `radial.plot` will try to +maintain the current plot parameters. Resetting the parameters after +doing the initial plot will almost certainly mess up any series that are +added. Series that are added will be plotted "on top" of the existing +plot, possibly overplotting other things. If the added series have a +larger range than the initial series, set `radial.lim` to account for +this in the initial plot, and if `radial.lim` is specified in the +initial plot, remember to repeat it for added series as in the example. + +The size of the labels on the outside of the plot can be adjusted by +setting `par(cex.axis=)` and that of the labels inside by setting +`par(cex.lab=)`. If `radlab` is TRUE, the labels will be rotated to a +radial alignment. This may help when there are many values and labels. +If some labels are still crowded, try running `label.pos` through the +`spreadout` function. If the `show.grid.labels` argument is a number +from 1 to 4, the labels will be placed along a horizontal or vertical +radius. The numbers represent the same positions as in `axis`, with the +default (4) on the right. + +The radial.plot family of plots is useful for illustrating cyclic data +such as wind direction or speed (but see `oz.windrose` for both), +activity at different times of the day, and so on. While `radial.plot` +actually does the plotting, another function is usually called for +specific types of cyclic data. + +## Author + +Jim Lemon + +## Note + +Thanks to Jeremy Claisse and Antonio Hernandez Matias for the `lty` and +`rp.type` suggestions respectively + +Patrick Baker for the request that led to `radlab` + +Thomas Steiner for the request for the `radial.lim` and `radial.labels` +modifications + +Evan Daugharty for requesting the `add` argument + +James MacCarthy for requesting better radial labels + +Steve Ellison for noticing that the return values of the functions had +changed + +Don Dennerline for requesting the rank clock + +Mehdi Nellen for the different colors for the radial and circumferential +lines for the grid + +Mayeul Kauffmann for noticing the radial label bug when a separate +radial.grid was included + +Ogbos Okike for requesting a text option for rp.type + +Keziah Conroy for requesting the log option + +## See also + +[polar.plot](polar.plot.md),[clock24.plot](clock24.plot.md) + +## Examples + +``` r + testlen<-runif(10,0,10) + testpos<-seq(0,18*pi/10,length=10) + testlab<-letters[1:10] + oldpar<-radial.plot(testlen,testpos,main="Test Radial Lines",line.col="red", + lwd=3,rad.col="lightblue") + + testlen<-c(sin(seq(0,1.98*pi,length=100))+2+rnorm(100)/10) + testpos<-seq(0,1.98*pi,length=100) + radial.plot(testlen,testpos,rp.type="p",main="Test Polygon",line.col="blue", + labels=LETTERS[1:8],label.pos=seq(0,14*pi/8,length.out=8)) + + # now do a 12 o'clock start with clockwise positive + radial.plot(testlen,testpos,start=pi/2,clockwise=TRUE,show.grid.labels=2, + rp.type="s",main="Test Symbols (clockwise)",radial.lim=c(0,3.5), + point.symbols=16,point.col="green",show.centroid=TRUE, + labels=LETTERS[1:6],label.pos=seq(0,10*pi/6,length.out=6)) + + # one without the circular grid and multiple polygons + # see the "diamondplot" function for variation on this + posmat<-matrix(sample(2:9,30,TRUE),nrow=3) + radial.plot(posmat,labels=paste("X",1:10,sep=""),rp.type="p", + main="Spiderweb plot",line.col=2:4,show.grid=FALSE,lwd=1:3, + radial.lim=c(0,10)) + + # dissolved ions in water + ions<-c(3.2,5,1,3.1,2.1,4.5) + ion.names<-c("Na","Ca","Mg","Cl","HCO3","SO4") + radial.plot(ions,labels=ion.names,rp.type="p",main="Dissolved ions in water", + grid.unit="meq/l",radial.lim=c(0,5),poly.col="yellow",show.grid.labels=3) + # add the names of the ions to the plot + radial.plot(ions,rp.type="t",point.symbols=ion.names,radial.lim=c(0,5), + add=TRUE) + # add points inside the polygon - radial.lim is supplied by plotrix_env + radial.plot(ions-0.4,rp.type="s",point.symbols=4,point.col="red",add=TRUE) + + radmat<-matrix(c(sample(1:4,4),sample(1:4,4),sample(1:4,4),sample(1:4,4), + sample(1:4,4),sample(1:4,4),sample(1:4,4),sample(1:4,4), + sample(1:4,4),sample(1:4,4)),nrow=4) + # finally a rank clock + radial.plot(radmat,rp.type="l",radial.pos=seq(0,20*pi/11.1,length.out=10), + label.pos=seq(0,20*pi/11.1,length.out=10),start=pi/2,clockwise=TRUE, + labels=2001:2010,radial.lim=c(0.2,4),main="Rank clock") + legend(-1.7,4,c("Black","Red","Green","Blue"),col=1:4,lty=1) + + par(xpd=oldpar$xpd,mar=oldpar$mar,pty=oldpar$pty) + # reset the margins + par(mar=c(5,4,4,2)) +``` diff --git a/reference/radialtext-1.png b/reference/radialtext-1.png new file mode 100644 index 0000000..8e2dbd2 Binary files /dev/null and b/reference/radialtext-1.png differ diff --git a/reference/radialtext.html b/reference/radialtext.html new file mode 100644 index 0000000..eee153a --- /dev/null +++ b/reference/radialtext.html @@ -0,0 +1,170 @@ + +Display text in a radial line — radialtext • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a string in a radial line, rotating it to flow in the radial + direction and optionally scaling each letter's size according to its + distance from the center.

    +
    + +
    +

    Usage

    +
    radialtext(x, center=c(0,0), start=NA, middle=1, end=NA, angle=0,
    +  deg=NA, expand=0, stretch=1, nice=TRUE, cex=NA, ...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A character string.

    + +
    center
    +

    The center of the circular area in x/y user units.

    + +
    start
    +

    The starting distance of the string from the center in + x/y user units.

    + +
    middle
    +

    The middle distance of the string from the center in + x/y user units.

    + +
    end
    +

    The ending distance of the string from the center in + x/y user units.

    + +
    angle
    +

    The angular position of the string in radians.

    + +
    deg
    +

    The angular position of the string in degrees + (takes precedence if not NA).

    + +
    expand
    +

    Size expansion factor for characters, used only if + start specified.

    + +
    stretch
    +

    How much to stretch the string for appearance, 1 for none.

    + +
    nice
    +

    TRUE to auto-flip text to keep it upright, FALSE to let + it be upside down.

    + +
    cex
    +

    The overall character expansion factor, NA for par("cex").

    + +
    ...
    +

    Additional arguments passed to text.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    This may not work on all devices, as not all graphic devices can rotate text to + arbitrary angles. The output looks best on a Postscript or similar device that can + rotate text without distortion. Rotated text often looks very ragged on small bitmaps. + If the user passes a value for start, this will override a value for + middle or end. Likewise, a value for end will override a + value for middle. Also, a value for deg overrides any value passed + to angle. If expand is 0, all characters will be the same size, + while a value of 1 will scale characters so that one that is twice + as far from the center will be twice as large. Negative values are permitted too, + but expand is only used if start was specified.

    +
    +
    +

    Author

    +

    Ted Toal

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     plot(0, xlim=c(1,5), ylim=c(1,5), main="Test of radialtext",
    +  xlab="", ylab="", type="n")
    + points(3, 3, pch=20)
    + radialtext("uncooked spaghetti", center=c(3,3),
    +  col="blue")
    + radialtext("uncooked spaghetti", center=c(3,3),
    +  start=1.2, angle=pi/4, cex=0.8)
    + radialtext("uncooked spaghetti", center=c(3,3),
    +  middle=1.2, angle=pi/4+0.1, cex=0.8)
    + radialtext("uncooked spaghetti", center=c(3,3),
    +  end=1.2, angle=pi/4+0.2, cex=0.8)
    + radialtext("uncooked spaghetti", center=c(3,3),
    +  start=0.5, deg=135, cex=0.8, col="green")
    + radialtext("uncooked spaghetti", center=c(3,3),
    +  start=0.5, deg=145, cex=0.8, stretch=2)
    + radialtext("uncooked spaghetti", center=c(3,3),
    +  start=0.5, deg=20, expand=0, col="red")
    + radialtext("uncooked spaghetti", center=c(3,3),
    +  start=0.5, deg=250, expand=0.35)
    + radialtext("uncooked spaghetti", center=c(3,3),
    +  start=0.75, deg=225, expand=1, col="gold")
    + radialtext("uncooked spaghetti", center=c(3,3),
    +  start=0.5, deg=325, expand=-0.25, cex=2)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/radialtext.md b/reference/radialtext.md new file mode 100644 index 0000000..dcc6f15 --- /dev/null +++ b/reference/radialtext.md @@ -0,0 +1,118 @@ +# Display text in a radial line + +Displays a string in a radial line, rotating it to flow in the radial +direction and optionally scaling each letter's size according to its +distance from the center. + +## Usage + +``` r +radialtext(x, center=c(0,0), start=NA, middle=1, end=NA, angle=0, + deg=NA, expand=0, stretch=1, nice=TRUE, cex=NA, ...) +``` + +## Arguments + +- x: + + A character string. + +- center: + + The center of the circular area in x/y user units. + +- start: + + The starting distance of the string from the center in x/y user units. + +- middle: + + The middle distance of the string from the center in x/y user units. + +- end: + + The ending distance of the string from the center in x/y user units. + +- angle: + + The angular position of the string in radians. + +- deg: + + The angular position of the string in degrees (takes precedence if not + NA). + +- expand: + + Size expansion factor for characters, used only if `start` specified. + +- stretch: + + How much to stretch the string for appearance, 1 for none. + +- nice: + + TRUE to auto-flip text to keep it upright, FALSE to let it be upside + down. + +- cex: + + The overall character expansion factor, NA for par("cex"). + +- ...: + + Additional arguments passed to `text`. + +## Value + +nil + +## Details + +This may not work on all devices, as not all graphic devices can rotate +text to arbitrary angles. The output looks best on a Postscript or +similar device that can rotate text without distortion. Rotated text +often looks very ragged on small bitmaps. If the user passes a value for +`start`, this will override a value for `middle` or `end`. Likewise, a +value for `end` will override a value for `middle`. Also, a value for +`deg` overrides any value passed to `angle`. If `expand` is 0, all +characters will be the same size, while a value of 1 will scale +characters so that one that is twice as far from the center will be +twice as large. Negative values are permitted too, but `expand` is only +used if `start` was specified. + +## Author + +Ted Toal + +## See also + +[text](https://rdrr.io/r/graphics/text.html), [arctext](arctext.md) + +## Examples + +``` r + plot(0, xlim=c(1,5), ylim=c(1,5), main="Test of radialtext", + xlab="", ylab="", type="n") + points(3, 3, pch=20) + radialtext("uncooked spaghetti", center=c(3,3), + col="blue") + radialtext("uncooked spaghetti", center=c(3,3), + start=1.2, angle=pi/4, cex=0.8) + radialtext("uncooked spaghetti", center=c(3,3), + middle=1.2, angle=pi/4+0.1, cex=0.8) + radialtext("uncooked spaghetti", center=c(3,3), + end=1.2, angle=pi/4+0.2, cex=0.8) + radialtext("uncooked spaghetti", center=c(3,3), + start=0.5, deg=135, cex=0.8, col="green") + radialtext("uncooked spaghetti", center=c(3,3), + start=0.5, deg=145, cex=0.8, stretch=2) + radialtext("uncooked spaghetti", center=c(3,3), + start=0.5, deg=20, expand=0, col="red") + radialtext("uncooked spaghetti", center=c(3,3), + start=0.5, deg=250, expand=0.35) + radialtext("uncooked spaghetti", center=c(3,3), + start=0.75, deg=225, expand=1, col="gold") + radialtext("uncooked spaghetti", center=c(3,3), + start=0.5, deg=325, expand=-0.25, cex=2) +``` diff --git a/reference/raw.means.plot-1.png b/reference/raw.means.plot-1.png new file mode 100644 index 0000000..fa8ef4e Binary files /dev/null and b/reference/raw.means.plot-1.png differ diff --git a/reference/raw.means.plot-10.png b/reference/raw.means.plot-10.png new file mode 100644 index 0000000..23f5a15 Binary files /dev/null and b/reference/raw.means.plot-10.png differ diff --git a/reference/raw.means.plot-2.png b/reference/raw.means.plot-2.png new file mode 100644 index 0000000..7a48591 Binary files /dev/null and b/reference/raw.means.plot-2.png differ diff --git a/reference/raw.means.plot-3.png b/reference/raw.means.plot-3.png new file mode 100644 index 0000000..fa8ef4e Binary files /dev/null and b/reference/raw.means.plot-3.png differ diff --git a/reference/raw.means.plot-4.png b/reference/raw.means.plot-4.png new file mode 100644 index 0000000..5c5e001 Binary files /dev/null and b/reference/raw.means.plot-4.png differ diff --git a/reference/raw.means.plot-5.png b/reference/raw.means.plot-5.png new file mode 100644 index 0000000..6402775 Binary files /dev/null and b/reference/raw.means.plot-5.png differ diff --git a/reference/raw.means.plot-6.png b/reference/raw.means.plot-6.png new file mode 100644 index 0000000..3d6d070 Binary files /dev/null and b/reference/raw.means.plot-6.png differ diff --git a/reference/raw.means.plot-7.png b/reference/raw.means.plot-7.png new file mode 100644 index 0000000..359570d Binary files /dev/null and b/reference/raw.means.plot-7.png differ diff --git a/reference/raw.means.plot-8.png b/reference/raw.means.plot-8.png new file mode 100644 index 0000000..e86c9ec Binary files /dev/null and b/reference/raw.means.plot-8.png differ diff --git a/reference/raw.means.plot-9.png b/reference/raw.means.plot-9.png new file mode 100644 index 0000000..b4c69c9 Binary files /dev/null and b/reference/raw.means.plot-9.png differ diff --git a/reference/raw.means.plot.html b/reference/raw.means.plot.html new file mode 100644 index 0000000..9e7787f --- /dev/null +++ b/reference/raw.means.plot.html @@ -0,0 +1,509 @@ + +raw.means.plot: Raw-Means Plots for Experimental Designs — raw.means.plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    raw.means.plot is a function for visualizing results of experimental designs + with up to two factors. It plots both raw data (background) and factor/cell + means (foreground) to provide a more accurate visualization of the underlying + distribution.

    +
    + +
    +

    Usage

    +
    raw.means.plot(data, col.offset = 2, col.x = 3, col.value = 4, na.rm = FALSE,
    + avoid.overlap = c("y", "x", "both"), y.factor = 1, y.amount = NULL,
    + x.amount = 0.05, pch = 21:25, lty = 1:5, bg.b.col = "darkgrey",
    + bg.f.col = NULL, fg.b.col = "black",fg.f.col = "black", type = "o",
    + pt.cex = 1, lwd = 1, xlab = "", ylab = "", ylim, max.offset = 0.2,
    + xaxis = TRUE, x.labels, xaxt = "n", plot = TRUE, legend = TRUE, mar = NULL,
    + reset.mar = TRUE, l.pos, yjust = 0.5, l.bty = "n", l.adj = c(0, 0.5), ...)
    +
    +raw.means.plot2(data, col.id, col.offset, col.x, col.value,
    + fun.aggregate = "mean", ...)
    +
    + +
    +

    Arguments

    +

    +
    data
    +

    a data.frame in long format (i.e., each datapoint one row, + see \link{reshape} or the reshape package) that contains at least + three columns: one column coding the first factor (col.offset), one + column coding the second factor (col.x), and one column containing + the values (col.value).

    + +
    col.id
    +

    a character scalar, specifiying the name of the column specifying the + id column. (only for raw.means.plot2)

    + +
    col.offset
    +

    a character or numeric (only raw.means.plot) scalar, + specifiying either name or number of the column coding the different lines + (the offset or first factor).

    + +
    col.x
    +

    a character or numeric (only raw.means.plot) scalar, + specifiying either name or number of the column coding the x-axis factor. + Default is 3.

    + +
    col.value
    +

    a character or numeric (only raw.means.plot) scalar, + specifiying either name or number of the data column. Default is 4.

    + +
    na.rm
    +

    logical indicating whether NA values should be stripped before + the computation proceeds. Default is FALSE. Throws an error message + if FALSE and NAs are encountered.

    + +
    avoid.overlap
    +

    character. What should happen to datapoints within one cell of the two + factors that have the same value.

    • "y" (the default) jitter is added so that + overlapping points are distinguishable on the y-axis

    • +
    • "x" jitter is added so that overlapping points + are distinguishable on the x-axis

    • +
    • "both" jitter is added so that overlapping points + are distinguishable on both the y- and the x-axis.

    • +
    • anything else. No jitter is added.

    • +
    + +
    y.factor
    +

    factor for controlling the amount of jitter on the y-axis + (will be passed to jitter).

    + +
    y.amount
    +

    amount for controlling the amount of jitter on the y-axis + (will be passed to jitter).

    + +
    x.amount
    +

    amount for controlling the amount of jitter on the x-axis + (will be passed to jitter).

    + +
    pch
    +

    pch values (plot symbols) taken for plotting the data. Note that + the same values are taken for raw data and means. see points + for more details. Recycled if too short (with warning). Default is 21:25, + because those are the only values that can be displayed filled and non-filled. + All other values should not be used.

    + +
    lty
    +

    lty values (line types) for connecting the means. See par + for more details. Recycled if too short (with warning). Default is 1:5.

    + +
    bg.b.col
    +

    background border color: border color of raw data points. Silently recycled. Default: + "darkgrey"

    + +
    bg.f.col
    +

    background filling color: fill color of raw data points. Silently recycled. Default: + NULL

    + +
    fg.b.col
    +

    foreground border color: border color of mean data points. Silently recycled. Default: + black

    + +
    fg.f.col
    +

    foreground fill color: fill color for mean data points. Silently recycled. Default: + black

    + +
    type
    +

    same as type in plot. Default: o ("overplotted")

    + +
    pt.cex
    +

    numeric specifying the cex value used for plotting the points. + Default is 1.

    + +
    lwd
    +

    numeric specifying the lwd value used for plotting the lines. + Default is 1.

    + +
    xlab
    +

    x-axis label. Default: ""

    + +
    ylab
    +

    y-axis label. Default: ""

    + +
    ylim
    +

    the y-axis limits of the plot. If not specified (the default) will be taken + from data so that all raw data points are visible and a warning message is + displayed specifying the ylim.

    + +
    max.offset
    +

    numeric. maximal offset of factor levels from the offset factor + (col.offset) specifying the different lines. The centre of each factor + on the x-axis is at full numbers (starting from 1 to ...). The maximum will + only be reached if the number of factor levels (from col.offset) is + even. Default: 0.2.

    + +
    xaxis
    +

    logical value indicating whether or not the x-axis should be generated + by raw.means.plot. If TRUE, labels for the x-axis will be taken + either from the unique values of col.x or can be specified with + x.labels.

    + +
    x.labels
    +

    character vector specifiying col.x levels. Only relevant if + xaxis=TRUE. Then, the values given here will be displayed at the + x-axis for each factor level of col.x.

    + +
    xaxt
    +

    A character which specifies whether ot not the x-axis should be plotted by + the call to plot function. Interfers with the aforementioned xaxis + argument and the automatic xaxis function by raw.means.plot. + Just there for completeness. Default "n" (and should not be changed).

    + +
    plot
    +

    logical. Should the raw.means.plot be drawn or not. If + TRUE (the default) plot will be drawn. If FALSE only the legend + will be drawn (if legend = TRUE) See details.

    + +
    legend
    +

    logical indicating whether or not raw.means.plot should + automatically add a legend on the right outside the plot area indicating + which line and points refer to which col.offset factor levels. Default + is TRUE.

    + +
    mar
    +

    NULL or numerical vector of length 4 indicating the margins of + the plot (see par). If NULL (the default) the right + margin (i.e., par("mar")[4]) will be (imperfectly) guessed from the + col.offset factors for placing the legend right to the plot. If length + is four this value will be taken. Ignored for plot = FALSE.

    + +
    reset.mar
    +

    logical indicating if the margins (mar) shall be resetted after + setting internally. Will be ignored if legend = FALSE. Default is + TRUE and should not be changed (especially with plot = FLASE).

    + +
    l.pos
    +

    numeric vector of length 2 indicating the position of the legend. If + not specified automatically determined. See details.

    + +
    yjust
    +

    how the legend is to be justified relative to the legend y location. A value + of 0 means top, 0.5 means centered and 1 means bottom justified. Default is + 0.5.

    + +
    l.bty
    +

    the type of box to be drawn around the legend. The allowed values are + "o" and "n" (the default).

    + +
    l.adj
    +

    numeric of length 1 or 2; the string adjustment for legend text. Useful + for y-adjustment when labels are plotmath expression. see legend + and plotmath for more info.

    + +
    ...
    +

    further arguments which are either passed to plot or legend (or + raw.means.plot for raw.means.plot2). The following arguments + are passed to legend, all others are passed to plot: + "fill", "border", "angle", "density", "box.lwd", "box.lty", "box.col", + "pt.cex", "pt.lwd", "xjust", "x.intersp", "y.intersp", "text.width", + "text.col", "merge", "trace", "plot", "ncol", "horiz", "title", "inset", + "title.col", "title.adj"

    + +
    fun.aggregate
    +

    Function or function name used for aggregating the data across the two + factors. Default is "mean". (only for raw.means.plot2)

    + +
    +
    +

    Details

    + + +

    raw.means.plot2 is probably the more useful function, as it allows for + using a data.frame with more than two-factors and aggregates across the other + factors, but needs a column specifying the experimental unit (e.g., + participant).

    +

    raw.means.plot is basically an advanced wrapper for two other + functions: plot and (if legend=TRUE) + legend. Furthermore, raw data is plotted with a call to + points and the means with a call to lines.

    +

    You can use raw.means.plot to plot only a legend by setting + plot = FALSE and legend = TRUE. Then, raw.means.plot + will draw an invisible plot with xlim = c(0,10) and + ylim = c(0, 10) and place the legend on this invisible plot. You + can specify l.pos to position the legend, otherwise it will be plotted + at c(5,5) (i.e., in the middle of the plot). Note that + xpd = TRUE in the call to legend (see par).

    +
    +
    +

    Value

    +

    Nothing. This function is invoked for its side effects.

    +
    +
    +

    Author

    +

    Henrik Singmann (henrik.singmann@psychologie.uni-freiburg.de) with + ideas from Jim Lemon

    +
    +
    +

    See also

    +

    add.ps can be used in addition toraw.means.plot to + compare the factors at each x-axis position, by adding p-values from t-tests + to the x-axis.

    +
    + +
    +

    Examples

    +
    
    +x <- data.frame(id = 1:150, offset = rep(c("Group A", "Group B", "Group C"),
    + each = 50), xaxis = sample(c("A", "B", "C", "D"),150, replace = TRUE),
    + data = c(rnorm(50, 10, 5), rnorm(50, 15,6), rnorm(50, 20, 5)))
    +
    +raw.means.plot(x)
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749
    +
    +
    +raw.means.plot(x, main = "Example", ylab = "Values", xlab = "Factor",
    + title = "Groups")
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749
    +
    +
    +raw.means.plot(x, "offset", "xaxis", "data")
    +#> Warning: Converting offset variable (column offset) to factor.
    +#> Warning: Converting x-axis variable (column offset) to factor.
    +#> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749
    +
    +
    +raw.means.plot(x, "xaxis", "offset", "data")
    +#> Warning: Converting offset variable (column xaxis) to factor.
    +#> Warning: Converting x-axis variable (column xaxis) to factor.
    +#> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749
    +
    +
    +raw.means.plot(x, 3, 2, 4)
    +#> Warning: Converting offset variable (column 3) to factor.
    +#> Warning: Converting x-axis variable (column 3) to factor.
    +#> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749
    +
    +# different colors:
    +raw.means.plot(x, main = "Example", ylab = "Values", xlab = "Factor",
    + title = "Groups", fg.f.col = c("red","blue", "green"))
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749
    +
    +
    +x2 <- data.frame(id = 1:150, offset = rep(c("Group A", "Group B", "Group C"),
    + each = 50), xaxis = sample(c("A", "B", "C", "D"),150, replace = TRUE),
    + data = c(rnorm(50, 10, 5), rnorm(50, 15,6), rnorm(50, 20, 5)))
    +
    +layout(matrix(c(1,2,3,3), 2,2,byrow = TRUE), heights = c(7,1))
    +raw.means.plot(x, main = "Data x1", ylab = "Values", xlab = "Factor",
    + legend = FALSE, mar = c(4,4,4,1)+0.1)
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749
    +raw.means.plot(x2, main = "Data x2", ylab = "Values", xlab = "Factor",
    + legend = FALSE, mar = c(4,4,4,1)+0.1)
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: -4.6524102769029 - 31.9198591156234
    +raw.means.plot(x2, plot = FALSE, title = "Groups")
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: -4.6524102769029 - 31.9198591156234
    +
    +
    +
    +y <- data.frame(id = 1:300, offset = rep(1, 300),
    + axis = sample(LETTERS[1:6],300, replace = TRUE), data = c(rnorm(100, 1),
    + rnorm(100), rnorm(100,1)))
    +
    +par(mfrow = c(2,2))
    +
    +raw.means.plot(y, legend = FALSE)
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: -2.19848686444599 - 3.99587856614991
    +
    +raw.means.plot(y, type = "p", legend = FALSE)
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: -2.19848686444599 - 3.99587856614991
    +
    +raw.means.plot(y, type = "l", legend = FALSE)
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: -2.19848686444599 - 3.99587856614991
    +
    +raw.means.plot(y, 3, 2, x.labels = "one group only")
    +#> Warning: Converting offset variable (column 3) to factor.
    +#> Warning: Converting x-axis variable (column 3) to factor.
    +#> Warning: ylim not specified, taken from data: -2.19848686444599 - 3.99587856614991
    +#> Warning: pch vector too short. recycling pch vector.
    +#> Warning: lty vector too short. recycling lty vector.
    +
    +
    +
    +# Example with overlapping points
    +z <- data.frame (id = 1:200, offset = rep(c("C 1", "C 2"), 200),
    + axis = sample(LETTERS[1:4], 200, replace = TRUE),
    + data = sample(1:20, 200, replace = TRUE))
    +
    +# x versus y jitter
    +par(mfrow = c(2,2))
    +raw.means.plot(z, avoid.overlap = "none", main = "no-jitter")
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: 1 - 20
    +raw.means.plot(z, main = "y-axis jitter (default)")
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: 1 - 20
    +raw.means.plot(z, avoid.overlap = "x", main = "x-axis jitter")
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: 1 - 20
    +raw.means.plot(z, avoid.overlap = "both", main = "both-axis jitter")
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: 1 - 20
    +
    +
    +
    +# y-axis jitter (default)
    +par(mfrow = c(2,2))
    +raw.means.plot(z, avoid.overlap = "none", main = "no jitter")
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: 1 - 20
    +raw.means.plot(z, y.factor = 0.5, main = "smaller y-jitter")
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: 1 - 20
    +raw.means.plot(z, main = "standard y-jitter")
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: 1 - 20
    +raw.means.plot(z, y.factor = 2, main = "bigger y-jitter")
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: 1 - 20
    +
    +
    +
    +# x-axis jitter (default)
    +par(mfrow = c(2,2))
    +raw.means.plot(z, avoid.overlap = "none", main = "no jitter")
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: 1 - 20
    +raw.means.plot(z, avoid.overlap = "x", x.amount = 0.025,
    + main = "smaller x -jitter")
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: 1 - 20
    +raw.means.plot(z, avoid.overlap = "x", main = "standard x-jitter")
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: 1 - 20
    +raw.means.plot(z, avoid.overlap = "x", x.amount= 0.1,
    + main = "bigger x-jitter")
    +#> Warning: Converting offset variable (column 2) to factor.
    +#> Warning: Converting x-axis variable (column 2) to factor.
    +#> Warning: ylim not specified, taken from data: 1 - 20
    +
    +
    +
    +
    +if (FALSE) { # \dontrun{
    +
    +#The examples uses the OBrienKaiser dataset from car and needs reshape.
    +require(reshape)
    +require(car)
    +data(OBrienKaiser)
    +OBKnew <- cbind(factor(1:nrow(OBrienKaiser)), OBrienKaiser)
    +colnames(OBKnew)[1] <- "id"
    +OBK.long <- melt(OBKnew)
    +OBK.long[, c("measurement", "time")] <-
    + t(vapply(strsplit(as.character(OBK.long$variable), "\\."),  "[", c("", "")))
    +
    +raw.means.plot2(OBK.long, "id", "measurement", "gender", "value")
    +
    +raw.means.plot2(OBK.long, "id", "treatment", "gender", "value")
    +
    +# also use add.ps:
    +# For this example the position at each x-axis are within-subject comparisons!
    +raw.means.plot2(OBK.long, "id", "measurement", "gender", "value")
    +add.ps(OBK.long, "id", "measurement", "gender", "value", paired = TRUE)
    + #reference is "fup"
    +
    +raw.means.plot2(OBK.long, "id", "measurement", "gender", "value")
    +add.ps(OBK.long, "id", "measurement", "gender", "value", ref.offset = 2,
    + paired = TRUE) #reference is "post"
    +
    +# Use R's standard (i.e., Welch test)
    +raw.means.plot2(OBK.long, "id", "treatment", "gender", "value")
    +add.ps(OBK.long, "id", "treatment", "gender", "value",
    + prefixes = c("p(control vs. A)", "p(control vs. B)"))
    +
    +# Use standard t-test
    +raw.means.plot2(OBK.long, "id", "treatment", "gender", "value")
    +add.ps(OBK.long, "id", "treatment", "gender", "value", var.equal = TRUE,
    + prefixes = c("p(control vs. A)", "p(control vs. B)"))
    +
    +} # }
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/raw.means.plot.md b/reference/raw.means.plot.md new file mode 100644 index 0000000..f566867 --- /dev/null +++ b/reference/raw.means.plot.md @@ -0,0 +1,492 @@ +# raw.means.plot: Raw-Means Plots for Experimental Designs + +raw.means.plot is a function for visualizing results of experimental +designs with up to two factors. It plots both raw data (background) and +factor/cell means (foreground) to provide a more accurate visualization +of the underlying distribution. + +## Usage + +``` r +raw.means.plot(data, col.offset = 2, col.x = 3, col.value = 4, na.rm = FALSE, + avoid.overlap = c("y", "x", "both"), y.factor = 1, y.amount = NULL, + x.amount = 0.05, pch = 21:25, lty = 1:5, bg.b.col = "darkgrey", + bg.f.col = NULL, fg.b.col = "black",fg.f.col = "black", type = "o", + pt.cex = 1, lwd = 1, xlab = "", ylab = "", ylim, max.offset = 0.2, + xaxis = TRUE, x.labels, xaxt = "n", plot = TRUE, legend = TRUE, mar = NULL, + reset.mar = TRUE, l.pos, yjust = 0.5, l.bty = "n", l.adj = c(0, 0.5), ...) + +raw.means.plot2(data, col.id, col.offset, col.x, col.value, + fun.aggregate = "mean", ...) +``` + +## Arguments + +- data: + + a `data.frame` in long format (i.e., each datapoint one row, see + `\link{reshape}` or the reshape package) that contains at least three + columns: one column coding the first factor (`col.offset`), one column + coding the second factor (`col.x`), and one column containing the + values (`col.value`). + +- col.id: + + a `character` scalar, specifiying the name of the column specifying + the id column. (only for `raw.means.plot2`) + +- col.offset: + + a `character` or `numeric` (only `raw.means.plot`) scalar, specifiying + either name or number of the column coding the different lines (the + offset or first factor). + +- col.x: + + a `character` or `numeric` (only `raw.means.plot`) scalar, specifiying + either name or number of the column coding the x-axis factor. Default + is 3. + +- col.value: + + a `character` or `numeric` (only `raw.means.plot`) scalar, specifiying + either name or number of the data column. Default is 4. + +- na.rm: + + `logical` indicating whether `NA` values should be stripped before the + computation proceeds. Default is `FALSE`. Throws an error message if + FALSE and NAs are encountered. + +- avoid.overlap: + + character. What should happen to datapoints within one cell of the two + factors that have the same value. + + - `"y"` (the default) [jitter](https://rdrr.io/r/base/jitter.html) is + added so that overlapping points are distinguishable on the + **y**-axis + + - `"x"` [jitter](https://rdrr.io/r/base/jitter.html) is added so that + overlapping points are distinguishable on the **x**-axis + + - `"both"` [jitter](https://rdrr.io/r/base/jitter.html) is added so + that overlapping points are distinguishable on both the **y**- and + the **x**-axis. + + - anything else. No jitter is added. + +- y.factor: + + `factor` for controlling the amount of jitter on the y-axis (will be + passed to [jitter](https://rdrr.io/r/base/jitter.html)). + +- y.amount: + + `amount` for controlling the amount of jitter on the y-axis (will be + passed to [jitter](https://rdrr.io/r/base/jitter.html)). + +- x.amount: + + `amount` for controlling the amount of jitter on the x-axis (will be + passed to [jitter](https://rdrr.io/r/base/jitter.html)). + +- pch: + + `pch` values (plot symbols) taken for plotting the data. Note that the + same values are taken for raw data and means. see + [points](https://rdrr.io/r/graphics/points.html) for more details. + Recycled if too short (with warning). Default is 21:25, because those + are the only values that can be displayed filled and non-filled. All + other values should not be used. + +- lty: + + `lty` values (line types) for connecting the means. See + [par](https://rdrr.io/r/graphics/par.html) for more details. Recycled + if too short (with warning). Default is 1:5. + +- bg.b.col: + + background border color: border color of raw data points. Silently + recycled. Default: `"darkgrey"` + +- bg.f.col: + + background filling color: fill color of raw data points. Silently + recycled. Default: `NULL` + +- fg.b.col: + + foreground border color: border color of mean data points. Silently + recycled. Default: `black` + +- fg.f.col: + + foreground fill color: fill color for mean data points. Silently + recycled. Default: `black` + +- type: + + same as type in [plot](https://rdrr.io/r/graphics/plot.default.html). + Default: `o` ("overplotted") + +- pt.cex: + + `numeric` specifying the `cex` value used for plotting the points. + Default is 1. + +- lwd: + + `numeric` specifying the `lwd` value used for plotting the lines. + Default is 1. + +- xlab: + + x-axis label. Default: `""` + +- ylab: + + y-axis label. Default: `""` + +- ylim: + + the y-axis limits of the plot. If not specified (the default) will be + taken from data so that all raw data points are visible and a warning + message is displayed specifying the ylim. + +- max.offset: + + `numeric`. maximal offset of factor levels from the offset factor + (`col.offset`) specifying the different lines. The centre of each + factor on the x-axis is at full numbers (starting from 1 to ...). The + maximum will only be reached if the number of factor levels (from + `col.offset`) is even. Default: 0.2. + +- xaxis: + + `logical` value indicating whether or not the x-axis should be + generated by `raw.means.plot`. If `TRUE`, labels for the x-axis will + be taken either from the unique values of `col.x` or can be specified + with `x.labels`. + +- x.labels: + + `character` vector specifiying `col.x` levels. Only relevant if + `xaxis=TRUE`. Then, the values given here will be displayed at the + x-axis for each factor level of `col.x`. + +- xaxt: + + A character which specifies whether ot not the x-axis should be + plotted by the call to plot function. Interfers with the + aforementioned `xaxis` argument and the automatic `xaxis` function by + `raw.means.plot`. Just there for completeness. Default `"n"` (and + should not be changed). + +- plot: + + `logical`. Should the `raw.means.plot` be drawn or not. If `TRUE` (the + default) plot will be drawn. If `FALSE` only the legend will be drawn + (if `legend = TRUE`) See details. + +- legend: + + `logical` indicating whether or not `raw.means.plot` should + automatically add a legend on the right outside the plot area + indicating which line and points refer to which `col.offset` factor + levels. Default is `TRUE`. + +- mar: + + `NULL` or `numerical` vector of length 4 indicating the margins of the + plot (see [par](https://rdrr.io/r/graphics/par.html)). If `NULL` (the + default) the right margin (i.e., `par("mar")[4]`) will be + (imperfectly) guessed from the `col.offset` factors for placing the + legend right to the plot. If length is four this value will be taken. + Ignored for `plot = FALSE`. + +- reset.mar: + + `logical` indicating if the margins (`mar`) shall be resetted after + setting internally. Will be ignored if `legend = FALSE`. Default is + `TRUE` and should not be changed (especially with `plot = FLASE`). + +- l.pos: + + `numeric` vector of length 2 indicating the position of the legend. If + not specified automatically determined. See details. + +- yjust: + + how the legend is to be justified relative to the legend y location. A + value of 0 means top, 0.5 means centered and 1 means bottom justified. + Default is 0.5. + +- l.bty: + + the type of box to be drawn around the legend. The allowed values are + `"o"` and `"n"` (the default). + +- l.adj: + + `numeric` of length 1 or 2; the string adjustment for legend text. + Useful for y-adjustment when labels are plotmath expression. see + [legend](https://rdrr.io/r/graphics/legend.html) and + [plotmath](https://rdrr.io/r/grDevices/plotmath.html) for more info. + +- ...: + + further arguments which are either passed to plot or legend (or + `raw.means.plot` for `raw.means.plot2`). The following arguments are + passed to legend, all others are passed to plot: + `"fill", "border", "angle", "density", "box.lwd", "box.lty", "box.col", "pt.cex", "pt.lwd", "xjust", "x.intersp", "y.intersp", "text.width", "text.col", "merge", "trace", "plot", "ncol", "horiz", "title", "inset", "title.col", "title.adj"` + +- fun.aggregate: + + Function or function name used for aggregating the data across the two + factors. Default is `"mean"`. (only for `raw.means.plot2`) + +## Details + +`raw.means.plot2` is probably the more useful function, as it allows for +using a data.frame with more than two-factors and aggregates across the +other factors, but needs a column specifying the experimental unit +(e.g., participant). + +`raw.means.plot` is basically an advanced wrapper for two other +functions: [plot](https://rdrr.io/r/graphics/plot.default.html) and (if +`legend=TRUE`) [legend](https://rdrr.io/r/graphics/legend.html). +Furthermore, raw data is plotted with a call to +[points](https://rdrr.io/r/graphics/points.html) and the means with a +call to [lines](https://rdrr.io/r/graphics/lines.html). + +You can use `raw.means.plot` to plot only a legend by setting +`plot = FALSE` and `legend = TRUE`. Then, `raw.means.plot` will draw an +invisible plot with `xlim = c(0,10)` and `ylim = c(0, 10)` and place the +legend on this invisible plot. You can specify `l.pos` to position the +legend, otherwise it will be plotted at `c(5,5)` (i.e., in the middle of +the plot). Note that `xpd = TRUE` in the call to `legend` (see +[par](https://rdrr.io/r/graphics/par.html)). + +## Value + +Nothing. This function is invoked for its side effects. + +## Author + +Henrik Singmann () with +ideas from Jim Lemon + +## See also + +[add.ps](add.ps.md) can be used in addition to`raw.means.plot` to +compare the factors at each x-axis position, by adding p-values from +t-tests to the x-axis. + +## Examples + +``` r +x <- data.frame(id = 1:150, offset = rep(c("Group A", "Group B", "Group C"), + each = 50), xaxis = sample(c("A", "B", "C", "D"),150, replace = TRUE), + data = c(rnorm(50, 10, 5), rnorm(50, 15,6), rnorm(50, 20, 5))) + +raw.means.plot(x) +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749 + + +raw.means.plot(x, main = "Example", ylab = "Values", xlab = "Factor", + title = "Groups") +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749 + + +raw.means.plot(x, "offset", "xaxis", "data") +#> Warning: Converting offset variable (column offset) to factor. +#> Warning: Converting x-axis variable (column offset) to factor. +#> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749 + + +raw.means.plot(x, "xaxis", "offset", "data") +#> Warning: Converting offset variable (column xaxis) to factor. +#> Warning: Converting x-axis variable (column xaxis) to factor. +#> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749 + + +raw.means.plot(x, 3, 2, 4) +#> Warning: Converting offset variable (column 3) to factor. +#> Warning: Converting x-axis variable (column 3) to factor. +#> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749 + +# different colors: +raw.means.plot(x, main = "Example", ylab = "Values", xlab = "Factor", + title = "Groups", fg.f.col = c("red","blue", "green")) +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749 + + +x2 <- data.frame(id = 1:150, offset = rep(c("Group A", "Group B", "Group C"), + each = 50), xaxis = sample(c("A", "B", "C", "D"),150, replace = TRUE), + data = c(rnorm(50, 10, 5), rnorm(50, 15,6), rnorm(50, 20, 5))) + +layout(matrix(c(1,2,3,3), 2,2,byrow = TRUE), heights = c(7,1)) +raw.means.plot(x, main = "Data x1", ylab = "Values", xlab = "Factor", + legend = FALSE, mar = c(4,4,4,1)+0.1) +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749 +raw.means.plot(x2, main = "Data x2", ylab = "Values", xlab = "Factor", + legend = FALSE, mar = c(4,4,4,1)+0.1) +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: -4.6524102769029 - 31.9198591156234 +raw.means.plot(x2, plot = FALSE, title = "Groups") +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: -4.6524102769029 - 31.9198591156234 + + + +y <- data.frame(id = 1:300, offset = rep(1, 300), + axis = sample(LETTERS[1:6],300, replace = TRUE), data = c(rnorm(100, 1), + rnorm(100), rnorm(100,1))) + +par(mfrow = c(2,2)) + +raw.means.plot(y, legend = FALSE) +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: -2.19848686444599 - 3.99587856614991 + +raw.means.plot(y, type = "p", legend = FALSE) +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: -2.19848686444599 - 3.99587856614991 + +raw.means.plot(y, type = "l", legend = FALSE) +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: -2.19848686444599 - 3.99587856614991 + +raw.means.plot(y, 3, 2, x.labels = "one group only") +#> Warning: Converting offset variable (column 3) to factor. +#> Warning: Converting x-axis variable (column 3) to factor. +#> Warning: ylim not specified, taken from data: -2.19848686444599 - 3.99587856614991 +#> Warning: pch vector too short. recycling pch vector. +#> Warning: lty vector too short. recycling lty vector. + + + +# Example with overlapping points +z <- data.frame (id = 1:200, offset = rep(c("C 1", "C 2"), 200), + axis = sample(LETTERS[1:4], 200, replace = TRUE), + data = sample(1:20, 200, replace = TRUE)) + +# x versus y jitter +par(mfrow = c(2,2)) +raw.means.plot(z, avoid.overlap = "none", main = "no-jitter") +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: 1 - 20 +raw.means.plot(z, main = "y-axis jitter (default)") +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: 1 - 20 +raw.means.plot(z, avoid.overlap = "x", main = "x-axis jitter") +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: 1 - 20 +raw.means.plot(z, avoid.overlap = "both", main = "both-axis jitter") +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: 1 - 20 + + + +# y-axis jitter (default) +par(mfrow = c(2,2)) +raw.means.plot(z, avoid.overlap = "none", main = "no jitter") +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: 1 - 20 +raw.means.plot(z, y.factor = 0.5, main = "smaller y-jitter") +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: 1 - 20 +raw.means.plot(z, main = "standard y-jitter") +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: 1 - 20 +raw.means.plot(z, y.factor = 2, main = "bigger y-jitter") +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: 1 - 20 + + + +# x-axis jitter (default) +par(mfrow = c(2,2)) +raw.means.plot(z, avoid.overlap = "none", main = "no jitter") +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: 1 - 20 +raw.means.plot(z, avoid.overlap = "x", x.amount = 0.025, + main = "smaller x -jitter") +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: 1 - 20 +raw.means.plot(z, avoid.overlap = "x", main = "standard x-jitter") +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: 1 - 20 +raw.means.plot(z, avoid.overlap = "x", x.amount= 0.1, + main = "bigger x-jitter") +#> Warning: Converting offset variable (column 2) to factor. +#> Warning: Converting x-axis variable (column 2) to factor. +#> Warning: ylim not specified, taken from data: 1 - 20 + + + + +if (FALSE) { # \dontrun{ + +#The examples uses the OBrienKaiser dataset from car and needs reshape. +require(reshape) +require(car) +data(OBrienKaiser) +OBKnew <- cbind(factor(1:nrow(OBrienKaiser)), OBrienKaiser) +colnames(OBKnew)[1] <- "id" +OBK.long <- melt(OBKnew) +OBK.long[, c("measurement", "time")] <- + t(vapply(strsplit(as.character(OBK.long$variable), "\\."), "[", c("", ""))) + +raw.means.plot2(OBK.long, "id", "measurement", "gender", "value") + +raw.means.plot2(OBK.long, "id", "treatment", "gender", "value") + +# also use add.ps: +# For this example the position at each x-axis are within-subject comparisons! +raw.means.plot2(OBK.long, "id", "measurement", "gender", "value") +add.ps(OBK.long, "id", "measurement", "gender", "value", paired = TRUE) + #reference is "fup" + +raw.means.plot2(OBK.long, "id", "measurement", "gender", "value") +add.ps(OBK.long, "id", "measurement", "gender", "value", ref.offset = 2, + paired = TRUE) #reference is "post" + +# Use R's standard (i.e., Welch test) +raw.means.plot2(OBK.long, "id", "treatment", "gender", "value") +add.ps(OBK.long, "id", "treatment", "gender", "value", + prefixes = c("p(control vs. A)", "p(control vs. B)")) + +# Use standard t-test +raw.means.plot2(OBK.long, "id", "treatment", "gender", "value") +add.ps(OBK.long, "id", "treatment", "gender", "value", var.equal = TRUE, + prefixes = c("p(control vs. A)", "p(control vs. B)")) + +} # } +``` diff --git a/reference/rectFill-1.png b/reference/rectFill-1.png new file mode 100644 index 0000000..b787b67 Binary files /dev/null and b/reference/rectFill-1.png differ diff --git a/reference/rectFill-2.png b/reference/rectFill-2.png new file mode 100644 index 0000000..6e194f0 Binary files /dev/null and b/reference/rectFill-2.png differ diff --git a/reference/rectFill.html b/reference/rectFill.html new file mode 100644 index 0000000..f0e711f --- /dev/null +++ b/reference/rectFill.html @@ -0,0 +1,122 @@ + +Draw a rectangle filled with symbols — rectFill • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Draws a rectangle on the current figure filled with arbitrary symbols.

    +
    + +
    +

    Usage

    +
    rectFill(x1,y1,x2,y2,fg=par("fg"),bg=par("bg"),xinc=NA,yinc=NA,
    +  pch=1,pch.cex=1,pch.col=par("fg"),...)
    +
    + +
    +

    Arguments

    +

    +
    x1,y1,x2,y2
    +

    Rectangle limits as in rect.

    + +
    fg
    +

    Foreground color

    + +
    bg
    +

    Background color

    + +
    xinc,yinc
    +

    The x and y increments of spacing for the symbols.

    + +
    pch
    +

    Which symbol to use

    + +
    pch.cex
    +

    Character expansion for the symbols.

    + +
    pch.col
    +

    Color(s) for the symbols.

    + +
    ...
    +

    Additional arguments to points for the symbols.

    + +
    +
    +

    Details

    +

    rectFill draws a rectangle and fills the rectangle with the + symbols requested. It is probably most useful as a substitute for + fill colors in a black and white environment.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     plot(1:7,type="n",xlab="",ylab="",main="Test of rectFill")
    + rectFill(1:6,1:6,2:7,2:7,bg=2:7,pch=c("+","*","o",".","#","^"),
    +  xinc=c(0.2,0.1,0.2,0.1,0.2,0.2),yinc=c(0.2,0.1,0.2,0.1,0.2,0.2),
    +  pch.col=1:6)
    +
    + barp(matrix(runif(9),nrow=3),main="Black and white bar plot",pch=1:3)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/rectFill.md b/reference/rectFill.md new file mode 100644 index 0000000..d76bd0b --- /dev/null +++ b/reference/rectFill.md @@ -0,0 +1,74 @@ +# Draw a rectangle filled with symbols + +Draws a rectangle on the current figure filled with arbitrary symbols. + +## Usage + +``` r +rectFill(x1,y1,x2,y2,fg=par("fg"),bg=par("bg"),xinc=NA,yinc=NA, + pch=1,pch.cex=1,pch.col=par("fg"),...) +``` + +## Arguments + +- x1,y1,x2,y2: + + Rectangle limits as in `rect`. + +- fg: + + Foreground color + +- bg: + + Background color + +- xinc,yinc: + + The x and y increments of spacing for the symbols. + +- pch: + + Which symbol to use + +- pch.cex: + + Character expansion for the symbols. + +- pch.col: + + Color(s) for the symbols. + +- ...: + + Additional arguments to `points` for the symbols. + +## Details + +`rectFill` draws a rectangle and fills the rectangle with the symbols +requested. It is probably most useful as a substitute for fill colors in +a black and white environment. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[rect](https://rdrr.io/r/graphics/rect.html), +[points](https://rdrr.io/r/graphics/points.html) + +## Examples + +``` r + plot(1:7,type="n",xlab="",ylab="",main="Test of rectFill") + rectFill(1:6,1:6,2:7,2:7,bg=2:7,pch=c("+","*","o",".","#","^"), + xinc=c(0.2,0.1,0.2,0.1,0.2,0.2),yinc=c(0.2,0.1,0.2,0.1,0.2,0.2), + pch.col=1:6) + + barp(matrix(runif(9),nrow=3),main="Black and white bar plot",pch=1:3) +``` diff --git a/reference/rescale-1.png b/reference/rescale-1.png new file mode 100644 index 0000000..895334f Binary files /dev/null and b/reference/rescale-1.png differ diff --git a/reference/rescale.html b/reference/rescale.html new file mode 100644 index 0000000..fc49375 --- /dev/null +++ b/reference/rescale.html @@ -0,0 +1,103 @@ + +Scale numbers into a new range — rescale • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Scale a vector or matrix of numbers into a new range.

    +
    + +
    +

    Usage

    +
    rescale(x,newrange)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A numeric vector, matrix or data frame.

    + +
    newrange
    +

    The minimum and maximum value of the range into which + x will be scaled.

    + +
    +
    +

    Details

    +

    rescale performs a simple linear conversion of x into the + range specified by newrange. Only numeric vectors, matrices or data + frames with some variation will be accepted. NAs are now preserved - + formerly the function would fail.

    +
    +
    +

    Value

    +

    On success, the rescaled object, otherwise the original object.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + +
    +

    Examples

    +
     # scale one vector into the range of another
    + normal.counts<-rnorm(100)
    + normal.tab<-tabulate(cut(normal.counts,breaks=seq(-3,3,by=1)))
    + normal.density<-rescale(dnorm(seq(-3,3,length=100)),range(normal.tab))
    + # now plot them
    + plot(c(-2.5,-1.5,-0.5,0.5,1.5,2.5),normal.tab,xlab="X values",
    +  type="h",col="green")
    + lines(seq(-3,3,length=100),normal.density,col="blue")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/rescale.md b/reference/rescale.md new file mode 100644 index 0000000..0d1782e --- /dev/null +++ b/reference/rescale.md @@ -0,0 +1,48 @@ +# Scale numbers into a new range + +Scale a vector or matrix of numbers into a new range. + +## Usage + +``` r +rescale(x,newrange) +``` + +## Arguments + +- x: + + A numeric vector, matrix or data frame. + +- newrange: + + The minimum and maximum value of the range into which `x` will be + scaled. + +## Details + +`rescale` performs a simple linear conversion of `x` into the range +specified by `newrange`. Only numeric vectors, matrices or data frames +with some variation will be accepted. NAs are now preserved - formerly +the function would fail. + +## Value + +On success, the rescaled object, otherwise the original object. + +## Author + +Jim Lemon + +## Examples + +``` r + # scale one vector into the range of another + normal.counts<-rnorm(100) + normal.tab<-tabulate(cut(normal.counts,breaks=seq(-3,3,by=1))) + normal.density<-rescale(dnorm(seq(-3,3,length=100)),range(normal.tab)) + # now plot them + plot(c(-2.5,-1.5,-0.5,0.5,1.5,2.5),normal.tab,xlab="X values", + type="h",col="green") + lines(seq(-3,3,length=100),normal.density,col="blue") +``` diff --git a/reference/revaxis-1.png b/reference/revaxis-1.png new file mode 100644 index 0000000..736a628 Binary files /dev/null and b/reference/revaxis-1.png differ diff --git a/reference/revaxis.html b/reference/revaxis.html new file mode 100644 index 0000000..41510de --- /dev/null +++ b/reference/revaxis.html @@ -0,0 +1,125 @@ + +Plot with axis direction(s) reversed — revaxis • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Reverses the sense of either or both the x and y axes.

    +
    + +
    +

    Usage

    +
    revaxis(x, y, xrev=FALSE, yrev=TRUE, xside=if (yrev) 3 else 1,
    +       yside=if (xrev) 4 else 2, xlab=NULL, ylab=NULL, bty=NULL, ...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    Vector of x-coordinates of the data to be plotted.

    + +
    y
    +

    Vector of y-coordinates of the data to be plotted.

    + +
    xrev
    +

    Logical scalar; should the sense of the x-axis + be reversed?

    + +
    yrev
    +

    Logical scalar; should the sense of the y-axis + be reversed?

    + +
    xside
    +

    The side of the plot on which the x-axis labels + should go.

    + +
    yside
    +

    The side of the plot on which the y-axis labels + should go.

    + +
    xlab
    +

    Character string for labelling the x-axis.

    + +
    ylab
    +

    Character string for labelling the y-axis.

    + +
    bty
    +

    Single letter indicating the type of box to be drawn + around the plot. See par for the possible letters + and their meaning.

    + +
    ...
    +

    Other arguments to be passed to plot.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Rolf Turner

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    x <- runif(20)
    +y <- runif(20)
    +revaxis(x,y,yside=4)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/revaxis.md b/reference/revaxis.md new file mode 100644 index 0000000..12a2a9d --- /dev/null +++ b/reference/revaxis.md @@ -0,0 +1,76 @@ +# Plot with axis direction(s) reversed + +Reverses the sense of either or both the `x` and `y` axes. + +## Usage + +``` r +revaxis(x, y, xrev=FALSE, yrev=TRUE, xside=if (yrev) 3 else 1, + yside=if (xrev) 4 else 2, xlab=NULL, ylab=NULL, bty=NULL, ...) +``` + +## Arguments + +- x: + + Vector of `x`-coordinates of the data to be plotted. + +- y: + + Vector of `y`-coordinates of the data to be plotted. + +- xrev: + + Logical scalar; should the sense of the `x`-axis be reversed? + +- yrev: + + Logical scalar; should the sense of the `y`-axis be reversed? + +- xside: + + The side of the plot on which the `x`-axis labels should go. + +- yside: + + The side of the plot on which the `y`-axis labels should go. + +- xlab: + + Character string for labelling the `x`-axis. + +- ylab: + + Character string for labelling the `y`-axis. + +- bty: + + Single letter indicating the type of box to be drawn around the plot. + See [par](https://rdrr.io/r/graphics/par.html) for the possible + letters and their meaning. + +- ...: + + Other arguments to be passed to plot. + +## Value + +nil + +## Author + +Rolf Turner + +## See also + +[plot](https://rdrr.io/r/graphics/plot.default.html), +[box](https://rdrr.io/r/graphics/box.html), +[par](https://rdrr.io/r/graphics/par.html) + +## Examples + +``` r +x <- runif(20) +y <- runif(20) +revaxis(x,y,yside=4) +``` diff --git a/reference/ruginv-1.png b/reference/ruginv-1.png new file mode 100644 index 0000000..4d081c3 Binary files /dev/null and b/reference/ruginv-1.png differ diff --git a/reference/ruginv.html b/reference/ruginv.html new file mode 100644 index 0000000..f464c92 --- /dev/null +++ b/reference/ruginv.html @@ -0,0 +1,117 @@ + +Add an Inverse Rug to a Plot — ruginv • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Adds a rug representation (1D plot) of the data to the plot, + but with the coloring inverted.

    +
    + +
    +

    Usage

    +
    ruginv(x,ticksize=0.03,side=1,lwd=0.5,col=par("fg"),col.ticks="white",
    + quiet=getOption("warn") < 0,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A numeric vector.

    + +
    ticksize
    +

    The length of the ticks making up the 'rug'. Positive lengths + produce inward ticks.

    + +
    side
    +

    On which side of the plot box the rug will appear. Usually 1 + (bottom) or 3 (top).

    + +
    lwd
    +

    The line width of the ticks.

    + +
    col
    +

    Color of the background of the ticks.

    + +
    col.ticks
    +

    The color of the ticks.

    + +
    quiet
    +

    Logical indicating if there should be a warning about clipped + values.

    + +
    ...
    +

    Further arguments passed to polygon when plotting the + background for the ticks.

    + +
    +
    +

    Author

    +

    Peter Solymos

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     require(stats)
    + plot(density(faithful$eruptions,bw=0.15))
    + ruginv(faithful$eruptions,ticksize=-0.05)
    + ruginv(jitter(faithful$eruptions,amount=0.01),side=3,col="lightblue")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/ruginv.md b/reference/ruginv.md new file mode 100644 index 0000000..af87993 --- /dev/null +++ b/reference/ruginv.md @@ -0,0 +1,66 @@ +# Add an Inverse Rug to a Plot + +Adds a *rug* representation (1D plot) of the data to the plot, but with +the coloring inverted. + +## Usage + +``` r +ruginv(x,ticksize=0.03,side=1,lwd=0.5,col=par("fg"),col.ticks="white", + quiet=getOption("warn") < 0,...) +``` + +## Arguments + +- x: + + A numeric vector. + +- ticksize: + + The length of the ticks making up the 'rug'. Positive lengths produce + inward ticks. + +- side: + + On which side of the plot box the rug will appear. Usually 1 (bottom) + or 3 (top). + +- lwd: + + The line width of the ticks. + +- col: + + Color of the background of the ticks. + +- col.ticks: + + The color of the ticks. + +- quiet: + + Logical indicating if there should be a warning about clipped values. + +- ...: + + Further arguments passed to + [polygon](https://rdrr.io/r/graphics/polygon.html) when plotting the + background for the ticks. + +## Author + +Peter Solymos + +## See also + +[rug](https://rdrr.io/r/graphics/rug.html) + +## Examples + +``` r + require(stats) + plot(density(faithful$eruptions,bw=0.15)) + ruginv(faithful$eruptions,ticksize=-0.05) + ruginv(jitter(faithful$eruptions,amount=0.01),side=3,col="lightblue") +``` diff --git a/reference/seats.html b/reference/seats.html new file mode 100644 index 0000000..b2f3937 --- /dev/null +++ b/reference/seats.html @@ -0,0 +1,103 @@ + +Arrange N seats in M semicircular rows — seats • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Compute seat positions in a semicircular parliament

    +
    + +
    +

    Usage

    +
    seats(N, M, r0 = 2.5)
    +
    + +
    +

    Arguments

    +

    +
    N
    +

    Total number of seats.

    + +
    M
    +

    Number of semicircular arcs on which to distribute the seats.

    + +
    r0
    +

    Radius of the inner arc in user units.

    + +
    +
    +

    Value

    +

    A data frame including:

    +
    x
    +

    The x positions of the seats to be plotted on semi-circular + arcs.

    + +
    y
    +

    The y positions of the seats to be plotted on semi-circular + arcs.

    + +
    r
    +

    The row numbers for each seat.

    + +
    theta
    +

    The angle of each seat, going from pi to zero radians.

    + +
    +
    +

    Author

    +

    Duncan Murdoch and Barry Rowlingson

    +
    +
    +

    See also

    + +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/seats.md b/reference/seats.md new file mode 100644 index 0000000..3d21ac5 --- /dev/null +++ b/reference/seats.md @@ -0,0 +1,51 @@ +# Arrange N seats in M semicircular rows + +Compute seat positions in a semicircular parliament + +## Usage + +``` r +seats(N, M, r0 = 2.5) +``` + +## Arguments + +- N: + + Total number of seats. + +- M: + + Number of semicircular arcs on which to distribute the seats. + +- r0: + + Radius of the inner arc in user units. + +## Value + +A data frame including: + +- x: + + The x positions of the seats to be plotted on semi-circular arcs. + +- y: + + The y positions of the seats to be plotted on semi-circular arcs. + +- r: + + The row numbers for each seat. + +- theta: + + The angle of each seat, going from pi to zero radians. + +## Author + +Duncan Murdoch and Barry Rowlingson + +## See also + +[election](election.md) diff --git a/reference/size_n_color-1.png b/reference/size_n_color-1.png new file mode 100644 index 0000000..5a8ae55 Binary files /dev/null and b/reference/size_n_color-1.png differ diff --git a/reference/size_n_color-2.png b/reference/size_n_color-2.png new file mode 100644 index 0000000..e2aafcf Binary files /dev/null and b/reference/size_n_color-2.png differ diff --git a/reference/size_n_color.html b/reference/size_n_color.html new file mode 100644 index 0000000..3e72518 --- /dev/null +++ b/reference/size_n_color.html @@ -0,0 +1,188 @@ + +Display circles with specified size and color — size_n_color • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display a plot of circles at specified locations, each with a + specified size and color.

    +
    + +
    +

    Usage

    +
    size_n_color(x=NULL,y,size,sizefun="sqrt",col,main="",
    +  xlim=NA,xlab="",xat=NULL,xaxlab=NULL,xcex=1,xlas=0,xgrid=FALSE,
    +  ylim=NA,ylab="",yat=NULL,yaxlab=NULL,ycex=1,ylas=1,ygrid=TRUE,
    +  mar=c(5,4,4,2),boxit=TRUE,add=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    Vectors or matrices of x and y positions for the symbols.

    + +
    size
    +

    Sizes for the symbols expressed as numbers.

    + +
    sizefun
    +

    The function to use for transforming the values to radii + of circles. Square root gives areas proportional to the values.

    + +
    col
    +

    Colors for the symbols (see Details).

    + +
    main
    +

    Title for the plot.

    + +
    xlim,ylim
    +

    Explicit x and y limits for the plot

    +

    .

    +
    xlab,ylab
    +

    Labels for the x and y axes.

    + +
    xat,yat
    +

    Where to place the ticks and tick labels on the axes.

    + +
    xaxlab,yaxlab
    +

    Tick labels for the x and y axes.

    + +
    xcex,ycex
    +

    Character expansions for the axis tick labels.

    + +
    xlas,ylas
    +

    Orientation for the axis tick labels (see par).

    + +
    xgrid,ygrid
    +

    Whether to display a grid along the x or y direction.

    + +
    mar
    +

    Margins for the plot (see Details).

    + +
    boxit
    +

    Whether to draw a box around the plot.

    + +
    add
    +

    Whether to draw a new plot (FALSE) or add symbols to an existing + plot (TRUE).

    + +
    ...
    +

    Additional arguments passed to plot.

    + +
    +
    +

    Details

    +

    size_n_color plots circles centered on the x and y + coordinates. The size and color of the circles may also be specified + individually, allowing four dimensions of variation to be displayed on the + plot.

    +

    size_n_color may also be used to display a "visual table" as in the second + example. Here the x and y coordinates are used to associate the symbols with + two categorical variables, underlying cause of death and year of observation. + If the x values are not passed to the function, it will try to space out the + circles evenly in a representation of the matrix. If the matrix is not square, + use a plotting device that has about the same proportion of height and width as + the matrix.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     meantemp<-c(19,22,25,29,21,20,16,27,23,26)
    + totalrain<-c(174,152,196,120,177,183,92,153,161,85)
    + numpumpkin<-c(53,47,61,63,38,42,48,71,66,29)
    + meanwt<-c(1.5,2.3,2.8,1.9,2.4,1.8,2.6,2.2,1.7)
    + size_n_color(meantemp,totalrain,meanwt/5,NA,xlim=c(15,30),
    +  color.scale(numpumpkin,c(0.8,0),c(0.8,1),0),
    +  xlab="Temperature (degrees C)",ylab="Rainfall (mm)",
    +  main="Number and weight of pumpkins by temperature and rainfall",
    +  xat=seq(15,30,by=5),yat=seq(80,200,by=20))  
    + color.legend(15,55,18.5,60,seq(40,70,by=10),
    +  rect.col=color.scale(seq(40,70,by=10),c(0.8,0),c(0.8,1),0))
    + points(15:18,rep(126,4),cex=seq(1.5,3.0,by=0.5))
    + text(15:19,rep(134,5),c("1.5","2.0","2.5","3.0","kg"))
    + par(xpd=TRUE)
    + text(13.5,60,"Number of\npumpkins")
    +
    + par(xpd=FALSE)
    + # now display a "visual table" of delayed registrations by underlying cause of
    + # death and year of observation. The sizes of the circles represent the log of
    + # the number of deaths and the colors represent the percentage of deaths that
    + # occurred in the year prior to registration or earlier
    + data(death_reg)
    + size_n_color(x=matrix(rep(1996:2010,each=22),nrow=22),
    +  y=matrix(rep(1:22,15),nrow=22),size=t(death_reg[[1]])/200,
    +  col=color.scale(t(death_reg[[2]]),c(0,0.8,1),c(1,0.2,0),0),
    +  ylim=c(1,22),main="Delayed registrations by ICD chapter",
    +  xlab="Year",xaxlab=1996:2010,xat=1996:2010,xcex=0.8,
    +  yaxlab=colnames(death_reg[[1]]),ycex=0.8,ygrid=TRUE,mar=c(5,6,4,2))
    + color.legend(1994,-3.5,2000,-2.5,seq(0,50,by=10),cex=0.8,
    +  rect.col=color.scale(seq(0,50,by=10),c(0,0.8,1),c(1,0.2,0),0))
    + par(xpd=TRUE)
    + text(1993.4,-2.5,"Pct.\nslow",cex=0.8)
    +
    + par(xpd=FALSE)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/size_n_color.md b/reference/size_n_color.md new file mode 100644 index 0000000..323175f --- /dev/null +++ b/reference/size_n_color.md @@ -0,0 +1,150 @@ +# Display circles with specified size and color + +Display a plot of circles at specified locations, each with a specified +size and color. + +## Usage + +``` r +size_n_color(x=NULL,y,size,sizefun="sqrt",col,main="", + xlim=NA,xlab="",xat=NULL,xaxlab=NULL,xcex=1,xlas=0,xgrid=FALSE, + ylim=NA,ylab="",yat=NULL,yaxlab=NULL,ycex=1,ylas=1,ygrid=TRUE, + mar=c(5,4,4,2),boxit=TRUE,add=FALSE,...) +``` + +## Arguments + +- x,y: + + Vectors or matrices of x and y positions for the symbols. + +- size: + + Sizes for the symbols expressed as numbers. + +- sizefun: + + The function to use for transforming the values to radii of circles. + Square root gives areas proportional to the values. + +- col: + + Colors for the symbols (see Details). + +- main: + + Title for the plot. + +- xlim,ylim: + + Explicit x and y limits for the plot + +. + +- xlab,ylab: + + Labels for the x and y axes. + +- xat,yat: + + Where to place the ticks and tick labels on the axes. + +- xaxlab,yaxlab: + + Tick labels for the x and y axes. + +- xcex,ycex: + + Character expansions for the axis tick labels. + +- xlas,ylas: + + Orientation for the axis tick labels (see `par`). + +- xgrid,ygrid: + + Whether to display a grid along the x or y direction. + +- mar: + + Margins for the plot (see Details). + +- boxit: + + Whether to draw a box around the plot. + +- add: + + Whether to draw a new plot (FALSE) or add symbols to an existing plot + (TRUE). + +- ...: + + Additional arguments passed to `plot`. + +## Details + +`size_n_color` plots circles centered on the `x` and `y` coordinates. +The size and color of the circles may also be specified individually, +allowing four dimensions of variation to be displayed on the plot. + +`size_n_color` may also be used to display a "visual table" as in the +second example. Here the x and y coordinates are used to associate the +symbols with two categorical variables, underlying cause of death and +year of observation. If the x values are not passed to the function, it +will try to space out the circles evenly in a representation of the +matrix. If the matrix is not square, use a plotting device that has +about the same proportion of height and width as the matrix. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[plot](https://rdrr.io/r/graphics/plot.default.html), +[points](https://rdrr.io/r/graphics/points.html), +[par](https://rdrr.io/r/graphics/par.html) + +## Examples + +``` r + meantemp<-c(19,22,25,29,21,20,16,27,23,26) + totalrain<-c(174,152,196,120,177,183,92,153,161,85) + numpumpkin<-c(53,47,61,63,38,42,48,71,66,29) + meanwt<-c(1.5,2.3,2.8,1.9,2.4,1.8,2.6,2.2,1.7) + size_n_color(meantemp,totalrain,meanwt/5,NA,xlim=c(15,30), + color.scale(numpumpkin,c(0.8,0),c(0.8,1),0), + xlab="Temperature (degrees C)",ylab="Rainfall (mm)", + main="Number and weight of pumpkins by temperature and rainfall", + xat=seq(15,30,by=5),yat=seq(80,200,by=20)) + color.legend(15,55,18.5,60,seq(40,70,by=10), + rect.col=color.scale(seq(40,70,by=10),c(0.8,0),c(0.8,1),0)) + points(15:18,rep(126,4),cex=seq(1.5,3.0,by=0.5)) + text(15:19,rep(134,5),c("1.5","2.0","2.5","3.0","kg")) + par(xpd=TRUE) + text(13.5,60,"Number of\npumpkins") + + par(xpd=FALSE) + # now display a "visual table" of delayed registrations by underlying cause of + # death and year of observation. The sizes of the circles represent the log of + # the number of deaths and the colors represent the percentage of deaths that + # occurred in the year prior to registration or earlier + data(death_reg) + size_n_color(x=matrix(rep(1996:2010,each=22),nrow=22), + y=matrix(rep(1:22,15),nrow=22),size=t(death_reg[[1]])/200, + col=color.scale(t(death_reg[[2]]),c(0,0.8,1),c(1,0.2,0),0), + ylim=c(1,22),main="Delayed registrations by ICD chapter", + xlab="Year",xaxlab=1996:2010,xat=1996:2010,xcex=0.8, + yaxlab=colnames(death_reg[[1]]),ycex=0.8,ygrid=TRUE,mar=c(5,6,4,2)) + color.legend(1994,-3.5,2000,-2.5,seq(0,50,by=10),cex=0.8, + rect.col=color.scale(seq(0,50,by=10),c(0,0.8,1),c(1,0.2,0),0)) + par(xpd=TRUE) + text(1993.4,-2.5,"Pct.\nslow",cex=0.8) + + par(xpd=FALSE) +``` diff --git a/reference/sizeplot-1.png b/reference/sizeplot-1.png new file mode 100644 index 0000000..c1cf6d9 Binary files /dev/null and b/reference/sizeplot-1.png differ diff --git a/reference/sizeplot-2.png b/reference/sizeplot-2.png new file mode 100644 index 0000000..ccc6626 Binary files /dev/null and b/reference/sizeplot-2.png differ diff --git a/reference/sizeplot-3.png b/reference/sizeplot-3.png new file mode 100644 index 0000000..f95dbda Binary files /dev/null and b/reference/sizeplot-3.png differ diff --git a/reference/sizeplot.html b/reference/sizeplot.html new file mode 100644 index 0000000..0035afe --- /dev/null +++ b/reference/sizeplot.html @@ -0,0 +1,128 @@ + +Plot with repeated symbols by size — sizeplot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Plots a set of (x,y) data with repeated points denoted by larger + symbol sizes

    +
    + +
    +

    Usage

    +
    sizeplot(x, y, scale=1, pow=0.5, powscale=TRUE, size=c(1,4), add=FALSE, ...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    x coordinates of data

    + +
    y
    +

    y coordinates of data

    + +
    scale
    +

    scaling factor for size of symbols

    + +
    pow
    +

    power exponent for size of symbols

    + +
    powscale
    +

    (logical) use power scaling for symbol size?

    + +
    size
    +

    (numeric vector) min and max size for scaling, if powscale=FALSE

    + +
    add
    +

    (logical) add to an existing plot?

    + +
    ...
    +

    other arguments to plot() or points()

    + +
    +
    +

    Details

    +

    Most useful for plotting (e.g.) discrete data, where repeats are + likely. If all points are repeated equally, gives a warning. The + size of a point is given by \(scale*n^pow\), where n is the number of + repeats, if powscale is TRUE, or it is scaled between size[1] and size[2], + if powscale is FALSE.

    +
    +
    +

    Value

    +

    A plot is produced on the current device, or points are added to the + current plot if add=TRUE.

    +
    +
    +

    Author

    +

    Ben Bolker

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     x <- c(0.1,0.1,0.1,0.1,0.1,0.2,0.2,0.2,0.2,0.3,0.3)
    + y <- c( 1,  1,  1,  1,  2,  2,  2,  3,  3,  4,  5 )
    + plot(x,y)
    +
    + sizeplot(x,y)
    +
    + sizeplot(x,y,pch=2)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/sizeplot.md b/reference/sizeplot.md new file mode 100644 index 0000000..9531b99 --- /dev/null +++ b/reference/sizeplot.md @@ -0,0 +1,77 @@ +# Plot with repeated symbols by size + +Plots a set of (x,y) data with repeated points denoted by larger symbol +sizes + +## Usage + +``` r +sizeplot(x, y, scale=1, pow=0.5, powscale=TRUE, size=c(1,4), add=FALSE, ...) +``` + +## Arguments + +- x: + + x coordinates of data + +- y: + + y coordinates of data + +- scale: + + scaling factor for size of symbols + +- pow: + + power exponent for size of symbols + +- powscale: + + (logical) use power scaling for symbol size? + +- size: + + (numeric vector) min and max size for scaling, if powscale=FALSE + +- add: + + (logical) add to an existing plot? + +- ...: + + other arguments to `plot()` or `points()` + +## Details + +Most useful for plotting (e.g.) discrete data, where repeats are likely. +If all points are repeated equally, gives a warning. The size of a point +is given by \\scale\*n^pow\\, where n is the number of repeats, if +powscale is TRUE, or it is scaled between size\[1\] and size\[2\], if +powscale is FALSE. + +## Value + +A plot is produced on the current device, or points are added to the +current plot if `add=TRUE`. + +## Author + +Ben Bolker + +## See also + +[symbols](https://rdrr.io/r/graphics/symbols.html) + +## Examples + +``` r + x <- c(0.1,0.1,0.1,0.1,0.1,0.2,0.2,0.2,0.2,0.3,0.3) + y <- c( 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5 ) + plot(x,y) + + sizeplot(x,y) + + sizeplot(x,y,pch=2) +``` diff --git a/reference/sizetree-1.png b/reference/sizetree-1.png new file mode 100644 index 0000000..0b91adc Binary files /dev/null and b/reference/sizetree-1.png differ diff --git a/reference/sizetree-2.png b/reference/sizetree-2.png new file mode 100644 index 0000000..a3f00af Binary files /dev/null and b/reference/sizetree-2.png differ diff --git a/reference/sizetree-3.png b/reference/sizetree-3.png new file mode 100644 index 0000000..987360e Binary files /dev/null and b/reference/sizetree-3.png differ diff --git a/reference/sizetree-4.png b/reference/sizetree-4.png new file mode 100644 index 0000000..3343fa8 Binary files /dev/null and b/reference/sizetree-4.png differ diff --git a/reference/sizetree.html b/reference/sizetree.html new file mode 100644 index 0000000..0701190 --- /dev/null +++ b/reference/sizetree.html @@ -0,0 +1,210 @@ + +Display a hierarchical breakdown of disjunct categories — sizetree • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display a data frame in which the values in each successive + column represent subcategories of the previous column as stacked + rectangles.

    +
    + +
    +

    Usage

    +
    sizetree(x,left=0,top,right=1,lastcenter=NA,showval=TRUE,showcount=TRUE,
    +  stacklabels=TRUE,firstcall=TRUE,col=NULL,border=NA,toplab=NULL,base.cex=1,
    +  ...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A data frame in which each successive column represents + subcategories of the previous column.

    + +
    left
    +

    The left edge of the current stack of rectangles in user units.

    + +
    top
    +

    The top of the current stack of rectangles in user units.

    + +
    right
    +

    The right edge of the current stack of rectangles in user units.

    + +
    lastcenter
    +

    The center of the previous rectangle from which the next + breakdown of categories arises. There is almost no reason to change it.

    + +
    showval
    +

    Whether to display the values representing the categories.

    + +
    showcount
    +

    Whether to display the count for the categories.

    + +
    stacklabels
    +

    Whether to display the names of the dataframe beneath + the stacked rectangles.

    + +
    firstcall
    +

    A flag for the function - do not alter this.

    + +
    col
    +

    Optional fill colors for the rectangles. See Details

    + +
    border
    +

    Color for border around the rectangles. See details

    + +
    toplab
    +

    Optional labels to display a the top of each stack.

    + +
    base.cex
    +

    The base character expansion for the labels.

    + +
    ...
    +

    additional arguments passed to plot.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    sizetree displays disjunct hierarchical categories as stacked rectangles. + It accepts a data frame in which the values in the first column represent + categories, the values in the second column represent subcategories of the + first column, and so on. The first column will be displayed as a stack of + rectangles, the height of each proportional to the count for each category. + Each substack of rectangles in the second stack will represent the breakdown + of counts for its superordinate category and so on through the columns. + Empty categories are ignored and NAs will produce gaps, which will propagate + across subsequent stacks.

    +

    The user can simply pass the data frame, which should only contain columns that + are hierarchical categories (example 1). The colors will probably not be ideal. + The user can pass the same colors for the all levels (example 2). If this is + done, sizetree will try to match colors to categories when + the number of categories is diminishing (e.g. some levels are missing in the + sub-categories) and the columns of x are factors with the same levels in + the same order. This will work if the category labels are the same in each level, + but remember to add the names to the colors before passing them to the function. + This will not work if there are more categories in the lower levels. If col + is a list, this is not done, and the user will have to work out the correct colors + for each level. This is particularly important when the category labels and the + number of categories is different in different levels (example 3).

    +

    In some sizetrees, the subcategory counts are very low compared to the overall + number of data objects. This results in rectangles that are very thin vertically. + One way to get better legibility of the labels is to use dark colors for the + rectangles, so that the labels are white, and no borders (set border to NA). + The user can also select only part of the data frame x to expand sections + of the sizetree as in the last example.

    +

    The labels are sized to fit the vertical extent of the bars. However, it is + possible that the labels may extend horizontally beyond the bar(s). The + base.cex argument can be used to shrink the labels if this happens. + Remember that base.cex will shrink all the labels, not just the ones + that are too wide.

    +

    The firstcall argument is necessary for the function to initialize the + plot, as each breakdown involves a recursive call. If it is changed, the best + that can be expected is an uninformative plot.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     cat1<-factor(sample(c("None","Low","Medium","High","Extreme"),40,TRUE),
    +  levels=c("None","Low","Medium","High","Extreme"))
    + cat2<-factor(sample(c("None","Low","Medium","High"),40,TRUE),
    +  levels=c("None","Low","Medium","High"))
    + cat3<-factor(sample(c("None","Low","High"),40,TRUE),
    +  levels=c("None","Low","High"))
    + hcats<-data.frame(cat1,cat2,cat3)
    + # throw in a few NAs
    + hcats$cat1[10]<-NA
    + hcats$cat2[c(15,20)]<-NA
    + hcats$cat3[c(11,14,25)]<-NA
    + # first let sizetree work out the colors
    + sizetree(hcats,main="Sizetree with automatic colors")
    +#> 1 NA values dropped from first stack.
    +
    + # now see what happens with a list of the same colors for each level
    + bhcol<-c("#ff8080","#dddd80","#80ff80","#0000ff","#80dddd")
    + sizetree(hcats,col=list(bhcol,bhcol,bhcol),
    +  main="Sizetree with the same colors each level")
    +#> 1 NA values dropped from first stack.
    +
    + # finally, specify different colors for categories with different labels
    + sexhaireye<-data.frame(sex=factor(sample(c("Male","Female"),50,TRUE)),
    +  hair=factor(sample(c("Blond","Red","Brown","Black"),50,TRUE)),
    +  eye=factor(sample(c("Gold","Green","Blue"),50,TRUE)))
    + shecol<-list(c("pink","lightblue"),c("#000000","#dddd00","#886600","#ee8800"),
    +  c("blue","gold","green"))
    + sizetree(sexhaireye,main="Sex, hair and eye color",
    +  col=shecol,toplab=c("Sex","Hair color","Eye color"))
    +
    + # now expand the female part of the sizetree
    + sizetree(sexhaireye[sexhaireye[,1]=="Female",],
    +  main="Sex, hair and eye color (Females only)",
    +  col=shecol,toplab=c("Sex","Hair color","Eye color"))
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/sizetree.md b/reference/sizetree.md new file mode 100644 index 0000000..84be0b0 --- /dev/null +++ b/reference/sizetree.md @@ -0,0 +1,169 @@ +# Display a hierarchical breakdown of disjunct categories + +Display a data frame in which the values in each successive column +represent subcategories of the previous column as stacked rectangles. + +## Usage + +``` r +sizetree(x,left=0,top,right=1,lastcenter=NA,showval=TRUE,showcount=TRUE, + stacklabels=TRUE,firstcall=TRUE,col=NULL,border=NA,toplab=NULL,base.cex=1, + ...) +``` + +## Arguments + +- x: + + A data frame in which each successive column represents subcategories + of the previous column. + +- left: + + The left edge of the current stack of rectangles in user units. + +- top: + + The top of the current stack of rectangles in user units. + +- right: + + The right edge of the current stack of rectangles in user units. + +- lastcenter: + + The center of the previous rectangle from which the next breakdown of + categories arises. There is almost no reason to change it. + +- showval: + + Whether to display the values representing the categories. + +- showcount: + + Whether to display the count for the categories. + +- stacklabels: + + Whether to display the names of the dataframe beneath the stacked + rectangles. + +- firstcall: + + A flag for the function - do not alter this. + +- col: + + Optional fill colors for the rectangles. See Details + +- border: + + Color for border around the rectangles. See details + +- toplab: + + Optional labels to display a the top of each stack. + +- base.cex: + + The base character expansion for the labels. + +- ...: + + additional arguments passed to `plot`. + +## Value + +nil + +## Details + +`sizetree` displays disjunct hierarchical categories as stacked +rectangles. It accepts a data frame in which the values in the first +column represent categories, the values in the second column represent +subcategories of the first column, and so on. The first column will be +displayed as a stack of rectangles, the height of each proportional to +the count for each category. Each substack of rectangles in the second +stack will represent the breakdown of counts for its superordinate +category and so on through the columns. Empty categories are ignored and +NAs will produce gaps, which will propagate across subsequent stacks. + +The user can simply pass the data frame, which should only contain +columns that are hierarchical categories (example 1). The colors will +probably not be ideal. The user can pass the same colors for the all +levels (example 2). If this is done, `sizetree` will try to match colors +to categories when the number of categories is diminishing (e.g. some +levels are missing in the sub-categories) and the columns of `x` are +factors with the same levels in the same order. This will work if the +category labels are the same in each level, but remember to add the +names to the colors before passing them to the function. This will not +work if there are more categories in the lower levels. If `col` is a +list, this is not done, and the user will have to work out the correct +colors for each level. This is particularly important when the category +labels and the number of categories is different in different levels +(example 3). + +In some sizetrees, the subcategory counts are very low compared to the +overall number of data objects. This results in rectangles that are very +thin vertically. One way to get better legibility of the labels is to +use dark colors for the rectangles, so that the labels are white, and no +borders (set `border` to NA). The user can also select only part of the +data frame `x` to expand sections of the sizetree as in the last +example. + +The labels are sized to fit the vertical extent of the bars. However, it +is possible that the labels may extend horizontally beyond the bar(s). +The `base.cex` argument can be used to shrink the labels if this +happens. Remember that `base.cex` will shrink all the labels, not just +the ones that are too wide. + +The `firstcall` argument is necessary for the function to initialize the +plot, as each breakdown involves a recursive call. If it is changed, the +best that can be expected is an uninformative plot. + +## Author + +Jim Lemon + +## See also + +[plot](https://rdrr.io/r/graphics/plot.default.html) + +## Examples + +``` r + cat1<-factor(sample(c("None","Low","Medium","High","Extreme"),40,TRUE), + levels=c("None","Low","Medium","High","Extreme")) + cat2<-factor(sample(c("None","Low","Medium","High"),40,TRUE), + levels=c("None","Low","Medium","High")) + cat3<-factor(sample(c("None","Low","High"),40,TRUE), + levels=c("None","Low","High")) + hcats<-data.frame(cat1,cat2,cat3) + # throw in a few NAs + hcats$cat1[10]<-NA + hcats$cat2[c(15,20)]<-NA + hcats$cat3[c(11,14,25)]<-NA + # first let sizetree work out the colors + sizetree(hcats,main="Sizetree with automatic colors") +#> 1 NA values dropped from first stack. + + # now see what happens with a list of the same colors for each level + bhcol<-c("#ff8080","#dddd80","#80ff80","#0000ff","#80dddd") + sizetree(hcats,col=list(bhcol,bhcol,bhcol), + main="Sizetree with the same colors each level") +#> 1 NA values dropped from first stack. + + # finally, specify different colors for categories with different labels + sexhaireye<-data.frame(sex=factor(sample(c("Male","Female"),50,TRUE)), + hair=factor(sample(c("Blond","Red","Brown","Black"),50,TRUE)), + eye=factor(sample(c("Gold","Green","Blue"),50,TRUE))) + shecol<-list(c("pink","lightblue"),c("#000000","#dddd00","#886600","#ee8800"), + c("blue","gold","green")) + sizetree(sexhaireye,main="Sex, hair and eye color", + col=shecol,toplab=c("Sex","Hair color","Eye color")) + + # now expand the female part of the sizetree + sizetree(sexhaireye[sexhaireye[,1]=="Female",], + main="Sex, hair and eye color (Females only)", + col=shecol,toplab=c("Sex","Hair color","Eye color")) +``` diff --git a/reference/sliceArray.html b/reference/sliceArray.html new file mode 100644 index 0000000..aecd68a --- /dev/null +++ b/reference/sliceArray.html @@ -0,0 +1,125 @@ + +Slice an array — sliceArray • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Slices one dimension from an array by taking one element from the first dimension.

    +
    + +
    +

    Usage

    +
    sliceArray(x,slice)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    An array

    + +
    slice
    +

    The index of the slice to take from the first dimension of the array.

    + +
    +
    +

    Details

    +

    sliceArray builds an extractor string containing the value of slice + as the first element and as many commas as needed to match the dimensions of the + array. It then applies the extractor function to x and returns the result. + Note how the array "slice" swaps dimensions in the example.

    +
    +
    +

    Value

    +

    The desired slice of the array.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     a1<-array(1:27,dim=c(3,3,3))
    + a1
    +#> , , 1
    +#> 
    +#>      [,1] [,2] [,3]
    +#> [1,]    1    4    7
    +#> [2,]    2    5    8
    +#> [3,]    3    6    9
    +#> 
    +#> , , 2
    +#> 
    +#>      [,1] [,2] [,3]
    +#> [1,]   10   13   16
    +#> [2,]   11   14   17
    +#> [3,]   12   15   18
    +#> 
    +#> , , 3
    +#> 
    +#>      [,1] [,2] [,3]
    +#> [1,]   19   22   25
    +#> [2,]   20   23   26
    +#> [3,]   21   24   27
    +#> 
    + sliceArray(a1,2)
    +#>      [,1] [,2] [,3]
    +#> [1,]    2   11   20
    +#> [2,]    5   14   23
    +#> [3,]    8   17   26
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/sliceArray.md b/reference/sliceArray.md new file mode 100644 index 0000000..92f0549 --- /dev/null +++ b/reference/sliceArray.md @@ -0,0 +1,73 @@ +# Slice an array + +Slices one dimension from an array by taking one element from the first +dimension. + +## Usage + +``` r +sliceArray(x,slice) +``` + +## Arguments + +- x: + + An array + +- slice: + + The index of the slice to take from the first dimension of the array. + +## Details + +`sliceArray` builds an extractor string containing the value of `slice` +as the first element and as many commas as needed to match the +dimensions of the array. It then applies the extractor function to `x` +and returns the result. Note how the array "slice" swaps dimensions in +the example. + +## Value + +The desired slice of the array. + +## Author + +Jim Lemon + +## See also + +[array](https://rdrr.io/r/base/array.html) + +## Examples + +``` r + a1<-array(1:27,dim=c(3,3,3)) + a1 +#> , , 1 +#> +#> [,1] [,2] [,3] +#> [1,] 1 4 7 +#> [2,] 2 5 8 +#> [3,] 3 6 9 +#> +#> , , 2 +#> +#> [,1] [,2] [,3] +#> [1,] 10 13 16 +#> [2,] 11 14 17 +#> [3,] 12 15 18 +#> +#> , , 3 +#> +#> [,1] [,2] [,3] +#> [1,] 19 22 25 +#> [2,] 20 23 26 +#> [3,] 21 24 27 +#> + sliceArray(a1,2) +#> [,1] [,2] [,3] +#> [1,] 2 11 20 +#> [2,] 5 14 23 +#> [3,] 8 17 26 +``` diff --git a/reference/smoothColors-1.png b/reference/smoothColors-1.png new file mode 100644 index 0000000..f2b8e6a Binary files /dev/null and b/reference/smoothColors-1.png differ diff --git a/reference/smoothColors.html b/reference/smoothColors.html new file mode 100644 index 0000000..e1ec0f4 --- /dev/null +++ b/reference/smoothColors.html @@ -0,0 +1,119 @@ + +Build a vector of color values — smoothColors • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    smoothColors calculates a sequence of colors. If two color names + in the arguments are separated by a number, that number of interpolated + colors will be inserted between the two color endpoints. Any number of + color names and integers may be passed, but the last argument must be + a color name. If more than one integer appears between two color names, + only the first will be used in the interpolation and the others will be + ignored.

    +
    + +
    +

    Usage

    +
    smoothColors(...,alpha=NA)
    +
    + +
    +

    Arguments

    +

    +
    ...
    +

    an arbitrary sequence of color names and integers beginning + and ending with a color name.

    + +
    alpha
    +

    optional alpha (transparency) value.

    + +
    +
    +

    Value

    +

    A vector of hexadecimal color values as used by col.

    +
    +
    +

    Note

    +

    For more R functions that transform numeric values into + colors or produce colors that can be used to represent values, see the + colourschemes package.

    +
    +
    +

    Author

    +

    Barry Rowlingson

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     plot(1:10,main="Test opaque colors",type="n",axes=FALSE)
    + box()
    + rect(1:7,1:7,3:9,3:9,col=smoothColors("red",2,"green",2,"blue"))
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/smoothColors.md b/reference/smoothColors.md new file mode 100644 index 0000000..28b6a63 --- /dev/null +++ b/reference/smoothColors.md @@ -0,0 +1,52 @@ +# Build a vector of color values + +`smoothColors` calculates a sequence of colors. If two color names in +the arguments are separated by a number, that number of interpolated +colors will be inserted between the two color endpoints. Any number of +color names and integers may be passed, but the last argument must be a +color name. If more than one integer appears between two color names, +only the first will be used in the interpolation and the others will be +ignored. + +## Usage + +``` r +smoothColors(...,alpha=NA) +``` + +## Arguments + +- ...: + + an arbitrary sequence of color names and integers beginning and ending + with a color name. + +- alpha: + + optional `alpha` (transparency) value. + +## Value + +A vector of hexadecimal color values as used by `col`. + +## Note + +For more R functions that transform numeric values into colors or +produce colors that can be used to represent values, see the +colourschemes package. + +## Author + +Barry Rowlingson + +## See also + +[color.gradient](color.gradient.md),[rgb](https://rdrr.io/r/grDevices/rgb.html) + +## Examples + +``` r + plot(1:10,main="Test opaque colors",type="n",axes=FALSE) + box() + rect(1:7,1:7,3:9,3:9,col=smoothColors("red",2,"green",2,"blue")) +``` diff --git a/reference/soil.texture-1.png b/reference/soil.texture-1.png new file mode 100644 index 0000000..b0e6d12 Binary files /dev/null and b/reference/soil.texture-1.png differ diff --git a/reference/soil.texture-2.png b/reference/soil.texture-2.png new file mode 100644 index 0000000..4aea015 Binary files /dev/null and b/reference/soil.texture-2.png differ diff --git a/reference/soil.texture-3.png b/reference/soil.texture-3.png new file mode 100644 index 0000000..ca7a719 Binary files /dev/null and b/reference/soil.texture-3.png differ diff --git a/reference/soil.texture-4.png b/reference/soil.texture-4.png new file mode 100644 index 0000000..a3575fd Binary files /dev/null and b/reference/soil.texture-4.png differ diff --git a/reference/soil.texture.html b/reference/soil.texture.html new file mode 100644 index 0000000..0026678 --- /dev/null +++ b/reference/soil.texture.html @@ -0,0 +1,203 @@ + +Soil texture triangle plot — soil.texture • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display a USDA soil texture triangle with optional grid, labels and + soil texture points.

    +
    + +
    +

    Usage

    +
    soil.texture(soiltexture=NULL, main="", at=seq(0.1, 0.9, by=0.1),
    +             axis.labels=c("percent sand", "percent silt",
    +                           "percent clay"),
    +             tick.labels=list(l=seq(10, 90, by=10), r=seq(10, 90, by=10),
    +                              b=seq(10, 90, by=10)),
    +             show.names=TRUE, show.lines=TRUE, col.names="gray",
    +             bg.names=par("bg"), show.grid=FALSE, col.axis="black",
    +             col.lines="gray", col.grid="gray", lty.grid=3,
    +             show.legend=FALSE, label.points=FALSE, point.labels=NULL,
    +             col.symbols="black", pch=par("pch"), ...)
    +
    + +
    +

    Arguments

    +

    +
    soiltexture
    +

    Matrix of soil textures where each row is a + soil sample and three columns contain the proportions of the + components sand, silt and clay in the range 0 to 1 or + percentages in the range 0 to 100.

    + +
    main
    +

    The title of the soil texture plot. Defaults to nothing.

    + +
    at
    +

    Positions on the three axes where ticks will be drawn.

    + +
    axis.labels
    +

    Labels for the axes.

    + +
    tick.labels
    +

    The tick labels for the three axes.

    + +
    show.names
    +

    Logical - whether to show the names of different + soil types within the soil triangle.

    + +
    show.lines
    +

    Logical - whether to show the boundaries of the + different soil types within the soil triangle.

    + +
    col.names
    +

    Color of the soil names. Defaults to gray.

    + +
    bg.names
    +

    Color to use when drawing a blank patch for the names + of soil types.

    + +
    show.grid
    +

    Logical - whether to show grid lines at each 10 + level of each soil component.

    + +
    col.axis
    +

    Color of the triangular axes, ticks and labels.

    + +
    col.lines
    +

    Color of the boundary lines. Defaults to gray.

    + +
    col.grid
    +

    Color of the grid lines. Defaults to gray.

    + +
    lty.grid
    +

    Type of line for the grid. Defaults to dashed.

    + +
    show.legend
    +

    Logical - whether to display a legend.

    + +
    label.points
    +

    Logical - whether to call + thigmophobe.labels to label the points.

    + +
    point.labels
    +

    Optional labels for the points or legend.

    + +
    col.symbols
    +

    Color of the symbols representing each value.

    + +
    pch
    +

    Symbols to use in plotting values.

    + +
    ...
    +

    Additional arguments passed to triax.points + and then points.

    + +
    +
    +

    Details

    +

    soil.texture displays a triangular plot area on which soil + textures defined as proportions of sand, silt and clay can be plotted. + Optional grid, vertex labels, soil type divisions and names may also + be displayed. If a matrix of soil textures is present, these will be + plotted.

    +
    +
    +

    Value

    +

    If soiltexture was included, a list of the x,y + positions of the soil types plotted. If not, nil.

    +
    +
    +

    Note

    +

    This is now a special case of triax.plot.

    +
    +
    +

    Author

    +

    Sander Oom, Jim Lemon, and Michael Toews

    +
    +
    +

    References

    +

    U.S. Department of Agriculture, Natural Resources Conservation Service, + 2007. National Soil Survey Handbook, title 430-VI.// + formerly + https://www.nrcs.usda.gov/wps/portal/nrcs/detail/soils/survey/class/taxonomy/?cid=nrcs142p2_053577

    +

    U.S. Department of Agriculture, Natural Resources Conservation Service, + 2007. Soil Texture Calculator// + formerly + https://www.nrcs.usda.gov/wps/portal/nrcs/detail/soils/survey/class/taxonomy/?cid=nrcs142p2_053577

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     data(soils)
    + soil.texture(main="NO DATA")
    +
    +#> NULL
    + soil.texture(soils, main="DEFAULT", pch=2)
    +
    + soil.texture(soils, main="LINES AND NAMES", show.lines=TRUE,
    +  show.names=TRUE, pch=3)
    +
    + soiltex.return<-soil.texture(soils[1:6,], main="GRID AND LEGEND",
    +  show.grid=TRUE, pch=4, col.symbols=1:6, show.legend=TRUE)
    +
    + par(soiltex.return$oldpar)
    +#> named list()
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/soil.texture.md b/reference/soil.texture.md new file mode 100644 index 0000000..149f628 --- /dev/null +++ b/reference/soil.texture.md @@ -0,0 +1,162 @@ +# Soil texture triangle plot + +Display a USDA soil texture triangle with optional grid, labels and soil +texture points. + +## Usage + +``` r +soil.texture(soiltexture=NULL, main="", at=seq(0.1, 0.9, by=0.1), + axis.labels=c("percent sand", "percent silt", + "percent clay"), + tick.labels=list(l=seq(10, 90, by=10), r=seq(10, 90, by=10), + b=seq(10, 90, by=10)), + show.names=TRUE, show.lines=TRUE, col.names="gray", + bg.names=par("bg"), show.grid=FALSE, col.axis="black", + col.lines="gray", col.grid="gray", lty.grid=3, + show.legend=FALSE, label.points=FALSE, point.labels=NULL, + col.symbols="black", pch=par("pch"), ...) +``` + +## Arguments + +- soiltexture: + + Matrix of soil textures where each row is a soil sample and three + columns contain the proportions of the components sand, silt and clay + in the range 0 to 1 or percentages in the range 0 to 100. + +- main: + + The title of the soil texture plot. Defaults to nothing. + +- at: + + Positions on the three axes where ticks will be drawn. + +- axis.labels: + + Labels for the axes. + +- tick.labels: + + The tick labels for the three axes. + +- show.names: + + Logical - whether to show the names of different soil types within the + soil triangle. + +- show.lines: + + Logical - whether to show the boundaries of the different soil types + within the soil triangle. + +- col.names: + + Color of the soil names. Defaults to gray. + +- bg.names: + + Color to use when drawing a blank patch for the names of soil types. + +- show.grid: + + Logical - whether to show grid lines at each 10 level of each soil + component. + +- col.axis: + + Color of the triangular axes, ticks and labels. + +- col.lines: + + Color of the boundary lines. Defaults to gray. + +- col.grid: + + Color of the grid lines. Defaults to gray. + +- lty.grid: + + Type of line for the grid. Defaults to dashed. + +- show.legend: + + Logical - whether to display a legend. + +- label.points: + + Logical - whether to call [thigmophobe.labels](thigmophobe.labels.md) + to label the points. + +- point.labels: + + Optional labels for the points or legend. + +- col.symbols: + + Color of the symbols representing each value. + +- pch: + + Symbols to use in plotting values. + +- ...: + + Additional arguments passed to [triax.points](triax.points.md) and + then `points`. + +## Details + +`soil.texture` displays a triangular plot area on which soil textures +defined as proportions of sand, silt and clay can be plotted. Optional +grid, vertex labels, soil type divisions and names may also be +displayed. If a matrix of soil textures is present, these will be +plotted. + +## Value + +If `soiltexture` was included, a list of the `x,y` positions of the soil +types plotted. If not, nil. + +## Note + +This is now a special case of `triax.plot`. + +## Author + +Sander Oom, Jim Lemon, and Michael Toews + +## References + +U.S. Department of Agriculture, Natural Resources Conservation Service, +2007. *National Soil Survey Handbook*, title 430-VI.// formerly +`https://www.nrcs.usda.gov/wps/portal/nrcs/detail/soils/survey/class/taxonomy/?cid=nrcs142p2_053577` + +U.S. Department of Agriculture, Natural Resources Conservation Service, +2007. *Soil Texture Calculator*// formerly +`https://www.nrcs.usda.gov/wps/portal/nrcs/detail/soils/survey/class/taxonomy/?cid=nrcs142p2_053577` + +## See also + +[get.soil.texture](get.soil.texture.md), [triax.plot](triax.plot.md) + +## Examples + +``` r + data(soils) + soil.texture(main="NO DATA") + +#> NULL + soil.texture(soils, main="DEFAULT", pch=2) + + soil.texture(soils, main="LINES AND NAMES", show.lines=TRUE, + show.names=TRUE, pch=3) + + soiltex.return<-soil.texture(soils[1:6,], main="GRID AND LEGEND", + show.grid=TRUE, pch=4, col.symbols=1:6, show.legend=TRUE) + + par(soiltex.return$oldpar) +#> named list() +``` diff --git a/reference/soil.texture.uk-1.png b/reference/soil.texture.uk-1.png new file mode 100644 index 0000000..9893120 Binary files /dev/null and b/reference/soil.texture.uk-1.png differ diff --git a/reference/soil.texture.uk.html b/reference/soil.texture.uk.html new file mode 100644 index 0000000..7c386a6 --- /dev/null +++ b/reference/soil.texture.uk.html @@ -0,0 +1,208 @@ + +Soil texture triangle plot using UK conventions — soil.texture.uk • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display a UK style soil texture triangle with optional grid, labels and + soil texture points.

    +
    + +
    +

    Usage

    +
    soil.texture.uk(soiltexture = NULL, main = "",at = seq(0.1, 0.9, by = 0.1),
    +  axis.labels = c("percent sand", "percent silt", "percent clay"),
    +  tick.labels = list(l = seq(10, 90, by = 10), r = seq(10, 90, by = 10),
    +  b = seq(10, 90, by = 10)), show.names = TRUE,
    +  show.lines = TRUE, col.names = "gray", bg.names = par("bg"),
    +  show.grid = FALSE, col.axis = "black", col.lines = "gray",
    +  col.grid = "gray", lty.grid = 3, show.legend = FALSE, label.points = FALSE,
    +  point.labels = NULL, col.symbols = "black", pch = par("pch"),
    +  h1 = NA, h3 = NA, t1 = NA, t3 = NA, lwduk = 2, xpos = NA, ypos = NA,
    +  snames = NA, cexuk = 1.1, ...)
    +
    + +
    +

    Arguments

    +

    +
    soiltexture
    +

    Matrix of soil textures where each row is a + soil sample and three columns containing the percentages of the + components sand, silt and clay in the range 0 to 100.

    + +
    main
    +

    The title of the soil texture plot. Defaults to nothing.

    + +
    at
    +

    Positions on the three axes where ticks will be drawn.

    + +
    axis.labels
    +

    Labels for the axes.

    + +
    tick.labels
    +

    The tick labels for the three axes.

    + +
    show.names
    +

    Logical - whether to show the names of different + soil types within the soil triangle.

    + +
    show.lines
    +

    Logical - whether to show the boundaries of the + different soil types within the soil triangle.

    + +
    col.names
    +

    Color of the soil names. Defaults to gray.

    + +
    bg.names
    +

    Color to use when drawing a blank patch for the names + of soil types.

    + +
    show.grid
    +

    Logical - whether to show grid lines at each 10 + level of each soil component.

    + +
    col.axis
    +

    Color of the triangular axes, ticks and labels.

    + +
    col.lines
    +

    Color of the boundary lines. Defaults to gray.

    + +
    col.grid
    +

    Color of the grid lines. Defaults to gray.

    + +
    lty.grid
    +

    Type of line for the grid. Defaults to dashed.

    + +
    show.legend
    +

    Logical - whether to display a legend.

    + +
    label.points
    +

    Logical - whether to call + thigmophobe.labels to label the points.

    + +
    point.labels
    +

    Optional labels for the points or legend.

    + +
    col.symbols
    +

    Color of the symbols representing each value.

    + +
    pch
    +

    Symbols to use in plotting values.

    + +
    h1,h3,t1,t3
    +

    Points used in drawing boundaries for soil types.

    + +
    lwduk
    +

    Line width for the boundaries

    + +
    xpos,ypos
    +

    Positions for the soil type labels.

    + +
    snames
    +

    Soil type labels.

    + +
    cexuk
    +

    Character expansion for the soil type labels.

    + +
    ...
    +

    Additional arguments passed to triax.points + and then points.

    + +
    +
    +

    Details

    +

    soil.texture.uk displays a triangular plot area on which soil + textures defined as proportions of sand, silt and clay can be plotted. + It is similar to the soil.texture function but uses the UK + display conventions.

    +
    +
    +

    Value

    +

    If soiltexture was included, a list of the x,y + positions of the soil types plotted. If not, nil.

    +
    +
    +

    Author

    +

    Julian Stander

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     soils.sw.percent<-data.frame(
    +  Sand=c(67,67,66,67,36,25,24,59,27,9,8,8,20,
    +  45,50,56,34,29,39,41,94,98,97,93,96,99),
    +  Silt=c(17,16,9,8,39,48,54,27,46,70,68,68,66,
    +  34,30,24,48,53,46,48,2,2,2,4,1,1),
    +  Clay=c(16,17,25,25,25,27,22,14,27,21,24,24,
    +  14,21,20,20,18,18,15,11,4,0,1,3,3,0))
    + soils.sw.cols <- c(1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3,
    +  3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6)
    + soils.sw.names <- c("Ardington","Astrop","Atrim",
    +  "Banbury","Beacon","Beckfoot")
    + soil.texture.uk(soils.sw.percent,
    +  main = "Ternary Diagram for Some Soils from South West England",
    +  col.lines = "black", col.names = "black", show.grid = TRUE,
    +  col.grid = "blue", lty.grid = 2,  pch = 16, cex = 1.0,
    +  col.symbols = soils.sw.cols, h1 = NA, h3 = NA, t1 = NA,
    +  t3 = NA , lwduk = 2, xpos = NA, ypos = NA,
    +  snames = NA, cexuk = 1.1)
    + legend("topleft", legend = soils.sw.names, col = 1:max(soils.sw.cols),
    +  pch = 16, cex = 1.1, title = "Location", bty = "n")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/soil.texture.uk.md b/reference/soil.texture.uk.md new file mode 100644 index 0000000..46e439d --- /dev/null +++ b/reference/soil.texture.uk.md @@ -0,0 +1,173 @@ +# Soil texture triangle plot using UK conventions + +Display a UK style soil texture triangle with optional grid, labels and +soil texture points. + +## Usage + +``` r +soil.texture.uk(soiltexture = NULL, main = "",at = seq(0.1, 0.9, by = 0.1), + axis.labels = c("percent sand", "percent silt", "percent clay"), + tick.labels = list(l = seq(10, 90, by = 10), r = seq(10, 90, by = 10), + b = seq(10, 90, by = 10)), show.names = TRUE, + show.lines = TRUE, col.names = "gray", bg.names = par("bg"), + show.grid = FALSE, col.axis = "black", col.lines = "gray", + col.grid = "gray", lty.grid = 3, show.legend = FALSE, label.points = FALSE, + point.labels = NULL, col.symbols = "black", pch = par("pch"), + h1 = NA, h3 = NA, t1 = NA, t3 = NA, lwduk = 2, xpos = NA, ypos = NA, + snames = NA, cexuk = 1.1, ...) +``` + +## Arguments + +- soiltexture: + + Matrix of soil textures where each row is a soil sample and three + columns containing the percentages of the components sand, silt and + clay in the range 0 to 100. + +- main: + + The title of the soil texture plot. Defaults to nothing. + +- at: + + Positions on the three axes where ticks will be drawn. + +- axis.labels: + + Labels for the axes. + +- tick.labels: + + The tick labels for the three axes. + +- show.names: + + Logical - whether to show the names of different soil types within the + soil triangle. + +- show.lines: + + Logical - whether to show the boundaries of the different soil types + within the soil triangle. + +- col.names: + + Color of the soil names. Defaults to gray. + +- bg.names: + + Color to use when drawing a blank patch for the names of soil types. + +- show.grid: + + Logical - whether to show grid lines at each 10 level of each soil + component. + +- col.axis: + + Color of the triangular axes, ticks and labels. + +- col.lines: + + Color of the boundary lines. Defaults to gray. + +- col.grid: + + Color of the grid lines. Defaults to gray. + +- lty.grid: + + Type of line for the grid. Defaults to dashed. + +- show.legend: + + Logical - whether to display a legend. + +- label.points: + + Logical - whether to call [thigmophobe.labels](thigmophobe.labels.md) + to label the points. + +- point.labels: + + Optional labels for the points or legend. + +- col.symbols: + + Color of the symbols representing each value. + +- pch: + + Symbols to use in plotting values. + +- h1,h3,t1,t3: + + Points used in drawing boundaries for soil types. + +- lwduk: + + Line width for the boundaries + +- xpos,ypos: + + Positions for the soil type labels. + +- snames: + + Soil type labels. + +- cexuk: + + Character expansion for the soil type labels. + +- ...: + + Additional arguments passed to [triax.points](triax.points.md) and + then `points`. + +## Details + +`soil.texture.uk` displays a triangular plot area on which soil textures +defined as proportions of sand, silt and clay can be plotted. It is +similar to the `soil.texture` function but uses the UK display +conventions. + +## Value + +If `soiltexture` was included, a list of the `x,y` positions of the soil +types plotted. If not, nil. + +## Author + +Julian Stander + +## See also + +[triax.plot](triax.plot.md) + +## Examples + +``` r + soils.sw.percent<-data.frame( + Sand=c(67,67,66,67,36,25,24,59,27,9,8,8,20, + 45,50,56,34,29,39,41,94,98,97,93,96,99), + Silt=c(17,16,9,8,39,48,54,27,46,70,68,68,66, + 34,30,24,48,53,46,48,2,2,2,4,1,1), + Clay=c(16,17,25,25,25,27,22,14,27,21,24,24, + 14,21,20,20,18,18,15,11,4,0,1,3,3,0)) + soils.sw.cols <- c(1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, + 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6) + soils.sw.names <- c("Ardington","Astrop","Atrim", + "Banbury","Beacon","Beckfoot") + soil.texture.uk(soils.sw.percent, + main = "Ternary Diagram for Some Soils from South West England", + col.lines = "black", col.names = "black", show.grid = TRUE, + col.grid = "blue", lty.grid = 2, pch = 16, cex = 1.0, + col.symbols = soils.sw.cols, h1 = NA, h3 = NA, t1 = NA, + t3 = NA , lwduk = 2, xpos = NA, ypos = NA, + snames = NA, cexuk = 1.1) + legend("topleft", legend = soils.sw.names, col = 1:max(soils.sw.cols), + pch = 16, cex = 1.1, title = "Location", bty = "n") +``` diff --git a/reference/soils.html b/reference/soils.html new file mode 100644 index 0000000..dda351d --- /dev/null +++ b/reference/soils.html @@ -0,0 +1,73 @@ + +Soil texture data from 125 soils — soils • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    A set of 125 soil texture measurements from soils from various parts of the + world.

    +
    + +
    +

    Usage

    +
    data(soils)
    +
    + +
    +

    Source

    +

    T.H. Skaggs, L.M. Arya, P.J. Shouse and B.P. Mohanty (2001) + Estimating Particle-Size Distribution from Limited Soil Texture Data. + Soil Science Society of America Journal 65:1038-1044.

    +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/soils.md b/reference/soils.md new file mode 100644 index 0000000..b43b6c2 --- /dev/null +++ b/reference/soils.md @@ -0,0 +1,16 @@ +# Soil texture data from 125 soils + +A set of 125 soil texture measurements from soils from various parts of +the world. + +## Usage + +``` r +data(soils) +``` + +## Source + +T.H. Skaggs, L.M. Arya, P.J. Shouse and B.P. Mohanty (2001) Estimating +Particle-Size Distribution from Limited Soil Texture Data. Soil Science +Society of America Journal 65:1038-1044. diff --git a/reference/spread.labels-1.png b/reference/spread.labels-1.png new file mode 100644 index 0000000..4b6c9b7 Binary files /dev/null and b/reference/spread.labels-1.png differ diff --git a/reference/spread.labels-2.png b/reference/spread.labels-2.png new file mode 100644 index 0000000..bef0f03 Binary files /dev/null and b/reference/spread.labels-2.png differ diff --git a/reference/spread.labels.html b/reference/spread.labels.html new file mode 100644 index 0000000..9f81d9a --- /dev/null +++ b/reference/spread.labels.html @@ -0,0 +1,152 @@ + +Spread labels for irregularly spaced values — spread.labels • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Places labels for irregularly spaced values in a regular staggered order

    +
    + +
    +

    Usage

    +
    spread.labels(x,y,labels=NULL,ony=NA,offsets=NA,between=FALSE,
    +  linecol=par("fg"),srt=0,...)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    x and y data values

    + +
    labels
    +

    text strings

    + +
    ony
    +

    Whether to force the labels to be spread horizontally + (FALSE) or vertically (TRUE). Defaults to whichever way the points are + most spread out.

    + +
    offsets
    +

    How far away from the data points to place the labels. + Defaults to one quarter of the plot span for all, staggered on each side.

    + +
    between
    +

    Whether to place the labels between two sets of points.

    + +
    linecol
    +

    Optional colors for the lines drawn to the points.

    + +
    srt
    +

    Rotation of the labels in degrees.

    + +
    ...
    +

    additional arguments passed to text.

    + +
    +
    +

    Details

    +

    This function is mainly useful when labeling irregularly spaced data points + that are "spread out" along one dimension. It places the labels regularly + spaced and staggered on the long dimension of the data, drawing lines from + each label to the point it describes.

    +

    If between is TRUE, the function expects two points for each label + and will attempt to place the labels between two vertical lines of points. + Lines will be drawn from the ends of each label to the two corresponding + points.

    +

    If spreading labels horizontally, the user may wish to rotate the labels by + 90 degrees (srt=90). If long labels run off the edge of the plot, + increase the xlim for extra room.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    References

    +

    Cooke, L.J. & Wardle, J. (2005) Age and gender differences in + children's food preferences. British Journal of Nutrition, 93: 741-746.

    +
    +
    +

    See also

    +

    text, spread.lab (TeachingDemos)

    +
    + +
    +

    Examples

    +
     # spread labels out in the x dimension using defaults
    + x<-sort(rnorm(10))
    + y<-rnorm(10)/10
    + plot(x,y,ylim=c(-1,1),type="p")
    + nums<-c("one","two","three","four","five","six","seven","eight","nine","ten")
    + spread.labels(x,y,nums)
    +
    + # food preferences of children by sex (Cooke & Wardle, 2005)
    + fpkids<-data.frame(Food=c("Fatty/sugary","Fruit","Starchy","Meat",
    +  "Proc.meat","Eggs","Fish","Dairy","Vegetables"),
    +  Female=c(4.21,4.22,3.98,3.57,3.55,3.46,3.34,3.26,3.13),
    +  Male=c(4.35,4.13,4.02,3.9,3.81,3.64,3.45,3.27,2.96))
    + plot(rep(1,9),fpkids$Female,xlim=c(0.8,2.2),
    +  ylim=range(c(fpkids$Female,fpkids$Male)),xlab="Sex",xaxt="n",
    +  ylab="Preference rating",main="Children's food preferences by sex",
    +  col="red")
    + axis(1,at=1:2,labels=c("Female","Male"))
    + points(rep(2,9),fpkids$Male,col="blue",pch=2)
    + spread.labels(rep(1:2,each=9),c(fpkids$Female,fpkids$Male),
    +  fpkids$Food,between=TRUE,linecol=c("red","blue"))
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/spread.labels.md b/reference/spread.labels.md new file mode 100644 index 0000000..df745c2 --- /dev/null +++ b/reference/spread.labels.md @@ -0,0 +1,105 @@ +# Spread labels for irregularly spaced values + +Places labels for irregularly spaced values in a regular staggered order + +## Usage + +``` r +spread.labels(x,y,labels=NULL,ony=NA,offsets=NA,between=FALSE, + linecol=par("fg"),srt=0,...) +``` + +## Arguments + +- x,y: + + x and y data values + +- labels: + + text strings + +- ony: + + Whether to force the labels to be spread horizontally (FALSE) or + vertically (TRUE). Defaults to whichever way the points are most + spread out. + +- offsets: + + How far away from the data points to place the labels. Defaults to one + quarter of the plot span for all, staggered on each side. + +- between: + + Whether to place the labels between two sets of points. + +- linecol: + + Optional colors for the lines drawn to the points. + +- srt: + + Rotation of the labels in degrees. + +- ...: + + additional arguments passed to `text`. + +## Details + +This function is mainly useful when labeling irregularly spaced data +points that are "spread out" along one dimension. It places the labels +regularly spaced and staggered on the long dimension of the data, +drawing lines from each label to the point it describes. + +If `between` is TRUE, the function expects two points for each label and +will attempt to place the labels between two vertical lines of points. +Lines will be drawn from the ends of each label to the two corresponding +points. + +If spreading labels horizontally, the user may wish to rotate the labels +by 90 degrees (`srt=90`). If long labels run off the edge of the plot, +increase the `xlim` for extra room. + +## Value + +nil + +## Author + +Jim Lemon + +## References + +Cooke, L.J. & Wardle, J. (2005) Age and gender differences in children's +food preferences. British Journal of Nutrition, 93: 741-746. + +## See also + +`text`, `spread.lab (TeachingDemos)` + +## Examples + +``` r + # spread labels out in the x dimension using defaults + x<-sort(rnorm(10)) + y<-rnorm(10)/10 + plot(x,y,ylim=c(-1,1),type="p") + nums<-c("one","two","three","four","five","six","seven","eight","nine","ten") + spread.labels(x,y,nums) + + # food preferences of children by sex (Cooke & Wardle, 2005) + fpkids<-data.frame(Food=c("Fatty/sugary","Fruit","Starchy","Meat", + "Proc.meat","Eggs","Fish","Dairy","Vegetables"), + Female=c(4.21,4.22,3.98,3.57,3.55,3.46,3.34,3.26,3.13), + Male=c(4.35,4.13,4.02,3.9,3.81,3.64,3.45,3.27,2.96)) + plot(rep(1,9),fpkids$Female,xlim=c(0.8,2.2), + ylim=range(c(fpkids$Female,fpkids$Male)),xlab="Sex",xaxt="n", + ylab="Preference rating",main="Children's food preferences by sex", + col="red") + axis(1,at=1:2,labels=c("Female","Male")) + points(rep(2,9),fpkids$Male,col="blue",pch=2) + spread.labels(rep(1:2,each=9),c(fpkids$Female,fpkids$Male), + fpkids$Food,between=TRUE,linecol=c("red","blue")) +``` diff --git a/reference/spreadout.html b/reference/spreadout.html new file mode 100644 index 0000000..5295f24 --- /dev/null +++ b/reference/spreadout.html @@ -0,0 +1,111 @@ + +Spread out a vector of numbers to a minimum interval — spreadout • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Spread out a vector of numbers so that there is a minimum interval + between any two numbers when in ascending or descending order.

    +
    + +
    +

    Usage

    +
    spreadout(x,mindist)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A numeric vector which may contain NAs.

    + +
    mindist
    +

    The minimum interval between any two values when in ascending + or descending order.

    + +
    +
    +

    Details

    +

    spreadout starts at or near the middle of the vector and increases the + intervals between the ordered values. NAs are preserved. spreadout + first tries to spread groups of values with intervals less than mindist + out neatly away from the mean of the group. If this doesn't entirely succeed, + a second pass that forces values away from the middle is performed.

    +

    spreadout is currently used to avoid overplotting of axis tick labels + where they may be close together.

    +
    +
    +

    Value

    +

    On success, the spread out values. If there are less than two valid + values, the original vector is returned.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + +
    +

    Examples

    +
     spreadout(c(1,3,3,3,3,5),0.2)
    +#> [1] 1.0 2.7 2.9 3.1 3.3 5.0
    + spreadout(c(1,2.5,2.5,3.5,3.5,5),0.2)
    +#> [1] 1.0 2.4 2.6 3.4 3.6 5.0
    + spreadout(c(5,2.5,2.5,NA,3.5,1,3.5,NA),0.2)
    +#> [1] 5.0 2.4 2.6  NA 3.4 1.0 3.6  NA
    + # this will almost always invoke the brute force second pass
    + spreadout(rnorm(10),0.5)
    +#>  [1]  1.2278347 -1.2721653 -2.2721653  1.7278347  0.2278347 -0.2721653
    +#>  [7] -0.7721653 -1.7721653  0.7278347  2.2278347
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/spreadout.md b/reference/spreadout.md new file mode 100644 index 0000000..b17ef34 --- /dev/null +++ b/reference/spreadout.md @@ -0,0 +1,57 @@ +# Spread out a vector of numbers to a minimum interval + +Spread out a vector of numbers so that there is a minimum interval +between any two numbers when in ascending or descending order. + +## Usage + +``` r +spreadout(x,mindist) +``` + +## Arguments + +- x: + + A numeric vector which may contain NAs. + +- mindist: + + The minimum interval between any two values when in ascending or + descending order. + +## Details + +`spreadout` starts at or near the middle of the vector and increases the +intervals between the ordered values. NAs are preserved. `spreadout` +first tries to spread groups of values with intervals less than +`mindist` out neatly away from the mean of the group. If this doesn't +entirely succeed, a second pass that forces values away from the middle +is performed. + +`spreadout` is currently used to avoid overplotting of axis tick labels +where they may be close together. + +## Value + +On success, the spread out values. If there are less than two valid +values, the original vector is returned. + +## Author + +Jim Lemon + +## Examples + +``` r + spreadout(c(1,3,3,3,3,5),0.2) +#> [1] 1.0 2.7 2.9 3.1 3.3 5.0 + spreadout(c(1,2.5,2.5,3.5,3.5,5),0.2) +#> [1] 1.0 2.4 2.6 3.4 3.6 5.0 + spreadout(c(5,2.5,2.5,NA,3.5,1,3.5,NA),0.2) +#> [1] 5.0 2.4 2.6 NA 3.4 1.0 3.6 NA + # this will almost always invoke the brute force second pass + spreadout(rnorm(10),0.5) +#> [1] 1.2278347 -1.2721653 -2.2721653 1.7278347 0.2278347 -0.2721653 +#> [7] -0.7721653 -1.7721653 0.7278347 2.2278347 +``` diff --git a/reference/stackpoly-1.png b/reference/stackpoly-1.png new file mode 100644 index 0000000..25647b0 Binary files /dev/null and b/reference/stackpoly-1.png differ diff --git a/reference/stackpoly-2.png b/reference/stackpoly-2.png new file mode 100644 index 0000000..a763b8b Binary files /dev/null and b/reference/stackpoly-2.png differ diff --git a/reference/stackpoly-3.png b/reference/stackpoly-3.png new file mode 100644 index 0000000..2b0101e Binary files /dev/null and b/reference/stackpoly-3.png differ diff --git a/reference/stackpoly.html b/reference/stackpoly.html new file mode 100644 index 0000000..e6399c7 --- /dev/null +++ b/reference/stackpoly.html @@ -0,0 +1,183 @@ + +Display the columns of a matrix or data frame as stacked polygons — stackpoly • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Plot one or more columns of numeric values as the top edges of polygons + instead of lines.

    +
    + +
    +

    Usage

    +
    stackpoly(x,y=NULL,main="",xlab="",ylab="",xat=NA,xaxlab=NA,
    +  xlim=NA,ylim=NA,lty=1,lwd=1,border=NA,col=NULL,staxx=FALSE,stack=FALSE,
    +  axis2=TRUE,axis4=TRUE,padj=0,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A numeric data frame or matrix with the x values. If + y is NULL, these will become the y values and the x + positions will be the integers from 1 to dim(x)[1].

    + +
    y
    +

    The y values.

    + +
    main
    +

    The title for the plot.

    + +
    xlab,ylab
    +

    x and y axis labels for the plot.

    + +
    xat
    +

    Where to put the optional xaxlabs.

    + +
    xaxlab
    +

    Optional labels for the x positions.

    + +
    xlim
    +

    Optional x limits.

    + +
    ylim
    +

    Optional y limits.

    + +
    lty
    +

    Line type for the polygon borders.

    + +
    lwd
    +

    Line width for the polygon borders.

    + +
    border
    +

    Color for the polygon borders.

    + +
    col
    +

    Color to fill the polygons. If NULL, rainbow will be + called to generate the colors. If NA, the polygons will not be filled.

    + +
    staxx
    +

    Whether to call staxlab to stagger the x axis labels.

    + +
    stack
    +

    Whether to stack the successive values on top of each other.

    + +
    axis2
    +

    Whether to display the left ordinate on the plot.

    + +
    axis4
    +

    Whether to display the right ordinate on the plot.

    + +
    padj
    +

    Vertical justfication of the x axis labels, defaulting to "top". + Can be a vector with an element for each label.

    + +
    ...
    +

    Additional arguments passed to plot.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    stackpoly is similar to a line plot with the area under the + lines filled with color(s). Ideally, each successive set of y values + is greater than the values in the previous set so that the polygons + form a rising series of crests. If stack is TRUE, this is not a + problem unless some values of x are negative.

    +

    If x or y is a vector, not a matrix or list, the values will + be displayed as a "waterfall plot".

    +

    The options for axis2 and axis4 can be used to produce + panel plots. See the last example.

    +
    +
    +

    Author

    +

    Jim Lemon and Thomas Petzoldt (waterfall plot option) - thanks to + Phil Novack-Gottshall for the mismatched x and y fix

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     testx<-matrix(abs(rnorm(100)),nrow=10)
    + stackpoly(matrix(cumsum(testx),nrow=10),main="Test Stackpoly I",
    +  xaxlab=c("One","Two","Three","Four","Five",
    +  "Six","Seven","Eight","Nine","Ten"),border="black",staxx=TRUE)
    +
    + stackpoly(testx,main="Test Stackpoly II",
    +  xaxlab=c("One","Two","Three","Four","Five",
    +  "Six","Seven","Eight","Nine","Ten"),border="black",
    +  staxx=TRUE,stack=TRUE)
    +
    + layout(matrix(1:2,nrow=1))
    + oldmar<-par(mar=c(5,4,4,0))
    + stackpoly(rev(sort(testx-mean(testx))),
    +  main="Waterfall Plot (x-mean)",xat=seq(10,90,by=10),
    +  xlab="Index",ylab="Value",lwd=3,col="green",border="black",
    +  axis4=FALSE)
    + ylim<-par("usr")[3:4]
    + par(mar=c(5,0,4,4))
    + stackpoly(rev(sort((testx-mean(testx))/sd(as.vector(testx)))),
    +  ylim=ylim,main="Waterfall Plot ((x-mean)/sd)",xat=seq(10,90,by=10),
    +  xlab="Index",lwd=3,col="lightblue",border="black",axis2=FALSE)
    +
    + par(oldmar)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/stackpoly.md b/reference/stackpoly.md new file mode 100644 index 0000000..bee756b --- /dev/null +++ b/reference/stackpoly.md @@ -0,0 +1,145 @@ +# Display the columns of a matrix or data frame as stacked polygons + +Plot one or more columns of numeric values as the top edges of polygons +instead of lines. + +## Usage + +``` r +stackpoly(x,y=NULL,main="",xlab="",ylab="",xat=NA,xaxlab=NA, + xlim=NA,ylim=NA,lty=1,lwd=1,border=NA,col=NULL,staxx=FALSE,stack=FALSE, + axis2=TRUE,axis4=TRUE,padj=0,...) +``` + +## Arguments + +- x: + + A numeric data frame or matrix with the `x` values. If `y` is NULL, + these will become the `y` values and the `x` positions will be the + integers from 1 to dim(x)\[1\]. + +- y: + + The `y` values. + +- main: + + The title for the plot. + +- xlab,ylab: + + x and y axis labels for the plot. + +- xat: + + Where to put the optional xaxlabs. + +- xaxlab: + + Optional labels for the x positions. + +- xlim: + + Optional x limits. + +- ylim: + + Optional y limits. + +- lty: + + Line type for the polygon borders. + +- lwd: + + Line width for the polygon borders. + +- border: + + Color for the polygon borders. + +- col: + + Color to fill the polygons. If NULL, `rainbow` will be called to + generate the colors. If NA, the polygons will not be filled. + +- staxx: + + Whether to call `staxlab` to stagger the x axis labels. + +- stack: + + Whether to stack the successive values on top of each other. + +- axis2: + + Whether to display the left ordinate on the plot. + +- axis4: + + Whether to display the right ordinate on the plot. + +- padj: + + Vertical justfication of the x axis labels, defaulting to "top". Can + be a vector with an element for each label. + +- ...: + + Additional arguments passed to `plot`. + +## Value + +nil + +## Details + +`stackpoly` is similar to a line plot with the area under the lines +filled with color(s). Ideally, each successive set of y values is +greater than the values in the previous set so that the polygons form a +rising series of crests. If `stack` is TRUE, this is not a problem +unless some values of `x` are negative. + +If `x` or `y` is a vector, not a matrix or list, the values will be +displayed as a "waterfall plot". + +The options for `axis2` and `axis4` can be used to produce panel plots. +See the last example. + +## Author + +Jim Lemon and Thomas Petzoldt (waterfall plot option) - thanks to Phil +Novack-Gottshall for the mismatched x and y fix + +## See also + +[polygon](https://rdrr.io/r/graphics/polygon.html) + +## Examples + +``` r + testx<-matrix(abs(rnorm(100)),nrow=10) + stackpoly(matrix(cumsum(testx),nrow=10),main="Test Stackpoly I", + xaxlab=c("One","Two","Three","Four","Five", + "Six","Seven","Eight","Nine","Ten"),border="black",staxx=TRUE) + + stackpoly(testx,main="Test Stackpoly II", + xaxlab=c("One","Two","Three","Four","Five", + "Six","Seven","Eight","Nine","Ten"),border="black", + staxx=TRUE,stack=TRUE) + + layout(matrix(1:2,nrow=1)) + oldmar<-par(mar=c(5,4,4,0)) + stackpoly(rev(sort(testx-mean(testx))), + main="Waterfall Plot (x-mean)",xat=seq(10,90,by=10), + xlab="Index",ylab="Value",lwd=3,col="green",border="black", + axis4=FALSE) + ylim<-par("usr")[3:4] + par(mar=c(5,0,4,4)) + stackpoly(rev(sort((testx-mean(testx))/sd(as.vector(testx)))), + ylim=ylim,main="Waterfall Plot ((x-mean)/sd)",xat=seq(10,90,by=10), + xlab="Index",lwd=3,col="lightblue",border="black",axis2=FALSE) + + par(oldmar) +``` diff --git a/reference/staircase.plot-1.png b/reference/staircase.plot-1.png new file mode 100644 index 0000000..ba91316 Binary files /dev/null and b/reference/staircase.plot-1.png differ diff --git a/reference/staircase.plot.html b/reference/staircase.plot.html new file mode 100644 index 0000000..3fffde3 --- /dev/null +++ b/reference/staircase.plot.html @@ -0,0 +1,177 @@ + +Display a staircase plot — staircase.plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a plot showing a sequence of changing totals and increments as + successive linked bars.

    +
    + +
    +

    Usage

    +
    staircase.plot(heights,totals=NA,labels=NULL,halfwidth=0.3,main="",
    + mar=NA,total.col="blue",inc.col=NA,bg.col=NA,direction="e",las=1,
    + display.height=TRUE,stagger=FALSE,cex=par("cex"),prefix="",suffix="",...)
    +
    + +
    +

    Arguments

    +

    +
    heights
    +

    vector of numeric values or a matrix or data frame with at least + two columns. The first column must be numeric and the second may be numeric or + logical.

    + +
    totals
    +

    A vector of logicals or zero/non-zero values indicating whether + the corresponding height is a total (TRUE) or an increment (FALSE).

    + +
    labels
    +

    An optional vector of labels for the bars.

    + +
    halfwidth
    +

    Half of the width of a bar as a proportion. See Details.

    + +
    main
    +

    A title for the plot.

    + +
    mar
    +

    Margins for the plot. Defaults to 10 on the baseline axis, 3 on the + top and 1 on the other two sides.

    + +
    total.col
    +

    Color(s) for the bars representing successive totals.

    + +
    inc.col
    +

    Color(s) for the bars representing increments.

    + +
    bg.col
    +

    The background color for the plot.

    + +
    direction
    +

    Direction in which the bars should be presented. See Details.

    + +
    las
    +

    Orientation for the bar labels. See par.

    + +
    display.height
    +

    Whether to display the totals and increments at the upper + ends of the bars. Defaults to TRUE.

    + +
    stagger
    +

    Whether to stagger the labels to avoid overlap.

    + +
    cex
    +

    The usual character expansion value.

    + +
    prefix
    +

    A prefix to the numbers displayed next to the bars (e.g. $).

    + +
    suffix
    +

    A suffix as for prefix (e.g. %).

    + +
    ...
    +

    arguments passed to plot.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    Displays a plot representing successive changes in counts or values. For example, + if a research study attempts to contact a certain number of people and some + cannot be contacted, some decline to participate, some are ineligible, the final + sample will be smaller than the initial contact list. The first value will be the + total of attempts, there will be a number of decrements, and the last value will + be the actual sample. There may be intermediate totals specified. This produces + a visual display of the sampling procedure. See the example.

    +

    The bars are placed at integer values on the axis representing the succession of + counts or values. The width of the bars is determined by the argument + halfwidth. This defaults to 0.3, meaning that the bar extends 0.3 to each + side, so that the proportion of bar to space is 0.6 to 0.4. The succession of + bars is determined by the direction argument. The default is "e" (east), + meaning that the first bar is at the left of the plot and subsequent bars are + placed to the right. The other three possibilities follow the conventional + compass layout.

    +

    The prefix and suffix arguments allow the user to specify units + for the numbers displayed next to the bars. If a single value is passed, all + numbers will get the same prefix or suffix. Different prefixes or suffixes for + each number can be passed as vectors.

    +

    The getFigCtr function is called to center the plot title in the figure + region as the plot area is typically off center.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     sample_size<-c(500,-72,428,-94,334,-45,289)
    + totals<-c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE)
    + labels<-c("Contact list","Uncontactable","","Declined","","Ineligible",
    +  "Final sample")
    + staircase.plot(sample_size,totals,labels,
    +  main="Acquisition of the sample (staircase.plot)",
    +  total.col="gray",inc.col=2:4,bg.col="#eeeebb",direction="s")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/staircase.plot.md b/reference/staircase.plot.md new file mode 100644 index 0000000..f131662 --- /dev/null +++ b/reference/staircase.plot.md @@ -0,0 +1,140 @@ +# Display a staircase plot + +Displays a plot showing a sequence of changing totals and increments as +successive linked bars. + +## Usage + +``` r +staircase.plot(heights,totals=NA,labels=NULL,halfwidth=0.3,main="", + mar=NA,total.col="blue",inc.col=NA,bg.col=NA,direction="e",las=1, + display.height=TRUE,stagger=FALSE,cex=par("cex"),prefix="",suffix="",...) +``` + +## Arguments + +- heights: + + vector of numeric values or a matrix or data frame with at least two + columns. The first column must be numeric and the second may be + numeric or logical. + +- totals: + + A vector of logicals or zero/non-zero values indicating whether the + corresponding height is a total (TRUE) or an increment (FALSE). + +- labels: + + An optional vector of labels for the bars. + +- halfwidth: + + Half of the width of a bar as a proportion. See Details. + +- main: + + A title for the plot. + +- mar: + + Margins for the plot. Defaults to 10 on the baseline axis, 3 on the + top and 1 on the other two sides. + +- total.col: + + Color(s) for the bars representing successive totals. + +- inc.col: + + Color(s) for the bars representing increments. + +- bg.col: + + The background color for the plot. + +- direction: + + Direction in which the bars should be presented. See Details. + +- las: + + Orientation for the bar labels. See `par`. + +- display.height: + + Whether to display the totals and increments at the upper ends of the + bars. Defaults to TRUE. + +- stagger: + + Whether to stagger the labels to avoid overlap. + +- cex: + + The usual character expansion value. + +- prefix: + + A prefix to the numbers displayed next to the bars (e.g. \$). + +- suffix: + + A suffix as for prefix (e.g. %). + +- ...: + + arguments passed to `plot`. + +## Value + +nil + +## Details + +Displays a plot representing successive changes in counts or values. For +example, if a research study attempts to contact a certain number of +people and some cannot be contacted, some decline to participate, some +are ineligible, the final sample will be smaller than the initial +contact list. The first value will be the total of attempts, there will +be a number of decrements, and the last value will be the actual sample. +There may be intermediate totals specified. This produces a visual +display of the sampling procedure. See the example. + +The bars are placed at integer values on the axis representing the +succession of counts or values. The width of the bars is determined by +the argument `halfwidth`. This defaults to 0.3, meaning that the bar +extends 0.3 to each side, so that the proportion of bar to space is 0.6 +to 0.4. The succession of bars is determined by the `direction` +argument. The default is "e" (east), meaning that the first bar is at +the left of the plot and subsequent bars are placed to the right. The +other three possibilities follow the conventional compass layout. + +The `prefix` and `suffix` arguments allow the user to specify units for +the numbers displayed next to the bars. If a single value is passed, all +numbers will get the same prefix or suffix. Different prefixes or +suffixes for each number can be passed as vectors. + +The `getFigCtr` function is called to center the plot title in the +figure region as the plot area is typically off center. + +## Author + +Jim Lemon + +## See also + +[plot](https://rdrr.io/r/graphics/plot.default.html), +[getFigCtr](getFigCtr.md) + +## Examples + +``` r + sample_size<-c(500,-72,428,-94,334,-45,289) + totals<-c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE) + labels<-c("Contact list","Uncontactable","","Declined","","Ineligible", + "Final sample") + staircase.plot(sample_size,totals,labels, + main="Acquisition of the sample (staircase.plot)", + total.col="gray",inc.col=2:4,bg.col="#eeeebb",direction="s") +``` diff --git a/reference/staircasePlot-1.png b/reference/staircasePlot-1.png new file mode 100644 index 0000000..ddaa1fa Binary files /dev/null and b/reference/staircasePlot-1.png differ diff --git a/reference/staircasePlot.html b/reference/staircasePlot.html new file mode 100644 index 0000000..4978167 --- /dev/null +++ b/reference/staircasePlot.html @@ -0,0 +1,183 @@ + +Display a staircase plot — staircasePlot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays a plot showing a sequence of changing totals and increments as + successive linked bars.

    +
    + +
    +

    Usage

    +
    staircasePlot(heights,totals=NA,labels=NULL,halfwidth=0.3,main="",mar=NA,
    + stair.info=list(total.col="blue",inc.col=NA,border=par("fg")),bg.col=NA,
    + direction="e",las=1,display.height=TRUE,stagger=FALSE,cex=par("cex"),
    + prefix="",suffix="",...)
    +
    + +
    +

    Arguments

    +

    +
    heights
    +

    vector of numeric values or a matrix or data frame with at least + two columns. The first column must be numeric and the second may be numeric or + logical.

    + +
    totals
    +

    A vector of logicals or zero/non-zero values indicating whether + the corresponding height is a total (TRUE) or an increment (FALSE).

    + +
    labels
    +

    An optional vector of labels for the bars.

    + +
    halfwidth
    +

    Half of the width of a bar as a proportion. See Details.

    + +
    main
    +

    A title for the plot.

    + +
    mar
    +

    Margins for the plot. Defaults to 10 on the baseline axis, 3 on the + top and 1 on the other two sides.

    + +
    stair.info
    +

    A list of arguments for the bars including color(s) + for the bars representing successive totals, and increments and the + border color.

    + +
    bg.col
    +

    The background color for the plot.

    + +
    direction
    +

    Direction in which the bars should be presented. See Details.

    + +
    las
    +

    Orientation for the bar labels. See par.

    + +
    display.height
    +

    Whether to display the totals and increments at the upper + ends of the bars. Defaults to TRUE.

    + +
    stagger
    +

    Whether to stagger the labels to avoid overlap.

    + +
    cex
    +

    The usual character expansion value.

    + +
    prefix
    +

    A prefix to the numbers displayed next to the bars (e.g. $).

    + +
    suffix
    +

    A suffix as for prefix (e.g. %).

    + +
    ...
    +

    arguments passed to plot.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    Displays a plot representing successive changes in counts or values. For example, + if a research study attempts to contact a certain number of people and some + cannot be contacted, some decline to participate, some are ineligible, the final + sample will be smaller than the initial contact list. The first value will be the + total of attempts, there will be a number of decrements, and the last value will + be the actual sample. There may be intermediate totals specified. This produces + a visual display of the sampling procedure. See the example.

    +

    The bars are placed at integer values on the axis representing the succession of + counts or values. The width of the bars is determined by the argument + halfwidth. This defaults to 0.3, meaning that the bar extends 0.3 to each + side, so that the proportion of bar to space is 0.6 to 0.4. The succession of + bars is determined by the direction argument. The default is "e" (east), + meaning that the first bar is at the left of the plot and subsequent bars are + placed to the right. The other three possibilities follow the conventional + compass layout.

    +

    The prefix and suffix arguments allow the user to specify units + for the numbers displayed next to the bars. If a single value is passed, all + numbers will get the same prefix or suffix. Different prefixes or suffixes for + each number can be passed as vectors.

    +

    The getFigCtr function is called to center the plot title in the figure + region as the plot area is typically off center.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     sample_size<-c(500,-72,428,-94,334,-45,289)
    + totals<-c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE)
    + labels<-c("Contact list","Uncontactable","","Declined","","Ineligible",
    +  "Final sample")
    + staircasePlot(sample_size,totals,labels,
    +  main="Acquisition of the sample (staircasePlot)",
    +  total.col="gray",inc.col=2:4,bg.col="#eeeebb",direction="s")
    +#> Warning: "total.col" is not a graphical parameter
    +#> Warning: "inc.col" is not a graphical parameter
    +#> Warning: "total.col" is not a graphical parameter
    +#> Warning: "inc.col" is not a graphical parameter
    +#> Warning: "total.col" is not a graphical parameter
    +#> Warning: "inc.col" is not a graphical parameter
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/staircasePlot.md b/reference/staircasePlot.md new file mode 100644 index 0000000..46fb5f2 --- /dev/null +++ b/reference/staircasePlot.md @@ -0,0 +1,144 @@ +# Display a staircase plot + +Displays a plot showing a sequence of changing totals and increments as +successive linked bars. + +## Usage + +``` r +staircasePlot(heights,totals=NA,labels=NULL,halfwidth=0.3,main="",mar=NA, + stair.info=list(total.col="blue",inc.col=NA,border=par("fg")),bg.col=NA, + direction="e",las=1,display.height=TRUE,stagger=FALSE,cex=par("cex"), + prefix="",suffix="",...) +``` + +## Arguments + +- heights: + + vector of numeric values or a matrix or data frame with at least two + columns. The first column must be numeric and the second may be + numeric or logical. + +- totals: + + A vector of logicals or zero/non-zero values indicating whether the + corresponding height is a total (TRUE) or an increment (FALSE). + +- labels: + + An optional vector of labels for the bars. + +- halfwidth: + + Half of the width of a bar as a proportion. See Details. + +- main: + + A title for the plot. + +- mar: + + Margins for the plot. Defaults to 10 on the baseline axis, 3 on the + top and 1 on the other two sides. + +- stair.info: + + A list of arguments for the bars including color(s) for the bars + representing successive totals, and increments and the border color. + +- bg.col: + + The background color for the plot. + +- direction: + + Direction in which the bars should be presented. See Details. + +- las: + + Orientation for the bar labels. See `par`. + +- display.height: + + Whether to display the totals and increments at the upper ends of the + bars. Defaults to TRUE. + +- stagger: + + Whether to stagger the labels to avoid overlap. + +- cex: + + The usual character expansion value. + +- prefix: + + A prefix to the numbers displayed next to the bars (e.g. \$). + +- suffix: + + A suffix as for prefix (e.g. %). + +- ...: + + arguments passed to `plot`. + +## Value + +nil + +## Details + +Displays a plot representing successive changes in counts or values. For +example, if a research study attempts to contact a certain number of +people and some cannot be contacted, some decline to participate, some +are ineligible, the final sample will be smaller than the initial +contact list. The first value will be the total of attempts, there will +be a number of decrements, and the last value will be the actual sample. +There may be intermediate totals specified. This produces a visual +display of the sampling procedure. See the example. + +The bars are placed at integer values on the axis representing the +succession of counts or values. The width of the bars is determined by +the argument `halfwidth`. This defaults to 0.3, meaning that the bar +extends 0.3 to each side, so that the proportion of bar to space is 0.6 +to 0.4. The succession of bars is determined by the `direction` +argument. The default is "e" (east), meaning that the first bar is at +the left of the plot and subsequent bars are placed to the right. The +other three possibilities follow the conventional compass layout. + +The `prefix` and `suffix` arguments allow the user to specify units for +the numbers displayed next to the bars. If a single value is passed, all +numbers will get the same prefix or suffix. Different prefixes or +suffixes for each number can be passed as vectors. + +The `getFigCtr` function is called to center the plot title in the +figure region as the plot area is typically off center. + +## Author + +Jim Lemon + +## See also + +[plot](https://rdrr.io/r/graphics/plot.default.html), +[getFigCtr](getFigCtr.md) + +## Examples + +``` r + sample_size<-c(500,-72,428,-94,334,-45,289) + totals<-c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE) + labels<-c("Contact list","Uncontactable","","Declined","","Ineligible", + "Final sample") + staircasePlot(sample_size,totals,labels, + main="Acquisition of the sample (staircasePlot)", + total.col="gray",inc.col=2:4,bg.col="#eeeebb",direction="s") +#> Warning: "total.col" is not a graphical parameter +#> Warning: "inc.col" is not a graphical parameter +#> Warning: "total.col" is not a graphical parameter +#> Warning: "inc.col" is not a graphical parameter +#> Warning: "total.col" is not a graphical parameter +#> Warning: "inc.col" is not a graphical parameter +``` diff --git a/reference/starPie-1.png b/reference/starPie-1.png new file mode 100644 index 0000000..fea6f28 Binary files /dev/null and b/reference/starPie-1.png differ diff --git a/reference/starPie.html b/reference/starPie.html new file mode 100644 index 0000000..49e54ff --- /dev/null +++ b/reference/starPie.html @@ -0,0 +1,150 @@ + +A pie-like graphic object — starPie • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display a polygon with each sector proportional to a vector of numeric values.

    +
    + +
    +

    Usage

    +
    starPie(x,y,radext,values,maxval=NA,border=par("fg"),col=NA,prop.area=FALSE,
    +  label="",labelpos=1)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    The coordinate position for the center of the starPie.

    + +
    radext
    +

    The maximum distance from the center of the starPie to one vertex of + the polygon.

    + +
    values
    +

    A vector of numeric values.

    + +
    maxval
    +

    A maximum value for scaling the values to the radius. If NA, the + maximum value in values will be used.

    + +
    border
    +

    The color to use for the borders of the polygon sectors.

    + +
    col
    +

    The color(s) to use for the fills of the polygon.

    + +
    prop.area
    +

    Whether to scale the values to the area (TRUE) or the + radial extent (FALSE) of the polygon sectors.

    + +
    label
    +

    Optional text labels for the starPies.

    + +
    labelpos
    +

    Positions of the labels relative to the starPies.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    starPie displays a polygon centered on the x,y position having + sectors of equal angular extent. The radial extent of each sector + is proportional to the values in the numeric vector lengths. If the + prop.area argument is TRUE, the proportion is based on the area of the + sector, and if prop.area is FALSE, the proportion is on the radial extent. + As the function is intended to exaggerate the differences between different + starPies, the default produces sectors proportional to the squares of the + lengths.

    +

    starPie is intended to display a visual analog of the relative value of + matched attributes of a number of similar objects or groups. Thus objects having + similar attributes will produce similar looking starPies. When constructing such + a matrix, it is necessary for maxval to be specified, usually as the + overall maximum value in any of the attribute value vectors. If maxval is + not specified in such a situation, only the relative values within each vector + will determine the radial extents of each starPie. There appears to be no reason + to have different sector colors for different objects, but the user can display + more than one set of starPies on a plot with different sector colors if + necessary.

    +

    starPie calls getYmult to automatically adjust for both the aspect + and coordinate ratio of the plot.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + +
    +

    Examples

    +
     date_mat<-data.frame(sex=rep(c("M","F"),each=10),
    +  names=c("Abe","Bob","Col","Dave","Eddie","Frank","Geoff","Harry","Igor","Jack",
    +  "Alice","Betty","Clare","Dora","Eva","Fran","Grace","Hilda","Iris","Joan"),
    +  eating=sample(0:100,20),dancing=sample(0:100,20),movies=sample(0:100,20),
    +  reading=sample(0:100,20),travel=sample(0:100,20))
    + plot(0,xlim=c(0.5,10.5),ylim=c(0,3),type="n",axes=FALSE,xlab="",ylab="Sex",
    +  main="Date matching matrix")
    + par(xpd=TRUE)
    + legend(0.7,-0.3,c("Eat out","Dance","Movies","Read","Travel"),fill=rainbow(5),
    +  ncol=5)
    + par(xpd=FALSE)
    + box()
    + axis(2,at=c(0.9,2.4),labels=c("Male","Female"))
    + starPie(x=rep(1:10,2),y=rep(c(0.9,2.4),each=10),radext=0.5,
    +  values=as.matrix(date_mat[,3:7]),label=as.character(date_mat[["names"]]))
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/starPie.md b/reference/starPie.md new file mode 100644 index 0000000..03598a2 --- /dev/null +++ b/reference/starPie.md @@ -0,0 +1,105 @@ +# A pie-like graphic object + +Display a polygon with each sector proportional to a vector of numeric +values. + +## Usage + +``` r +starPie(x,y,radext,values,maxval=NA,border=par("fg"),col=NA,prop.area=FALSE, + label="",labelpos=1) +``` + +## Arguments + +- x,y: + + The coordinate position for the center of the starPie. + +- radext: + + The maximum distance from the center of the starPie to one vertex of + the polygon. + +- values: + + A vector of numeric values. + +- maxval: + + A maximum value for scaling the values to the radius. If NA, the + maximum value in `values` will be used. + +- border: + + The color to use for the borders of the polygon sectors. + +- col: + + The color(s) to use for the fills of the polygon. + +- prop.area: + + Whether to scale the values to the area (TRUE) or the radial extent + (FALSE) of the polygon sectors. + +- label: + + Optional text labels for the starPies. + +- labelpos: + + Positions of the labels relative to the starPies. + +## Value + +nil + +## Details + +`starPie` displays a polygon centered on the `x,y` position having +sectors of equal angular extent. The radial extent of each sector is +proportional to the values in the numeric vector `lengths`. If the +`prop.area` argument is TRUE, the proportion is based on the area of the +sector, and if `prop.area` is FALSE, the proportion is on the radial +extent. As the function is intended to exaggerate the differences +between different starPies, the default produces sectors proportional to +the squares of the `lengths`. + +`starPie` is intended to display a visual analog of the relative value +of matched attributes of a number of similar objects or groups. Thus +objects having similar attributes will produce similar looking starPies. +When constructing such a matrix, it is necessary for `maxval` to be +specified, usually as the overall maximum value in any of the attribute +value vectors. If `maxval` is not specified in such a situation, only +the relative values within each vector will determine the radial extents +of each starPie. There appears to be no reason to have different sector +colors for different objects, but the user can display more than one set +of starPies on a plot with different sector colors if necessary. + +`starPie` calls `getYmult` to automatically adjust for both the aspect +and coordinate ratio of the plot. + +## Author + +Jim Lemon + +## Examples + +``` r + date_mat<-data.frame(sex=rep(c("M","F"),each=10), + names=c("Abe","Bob","Col","Dave","Eddie","Frank","Geoff","Harry","Igor","Jack", + "Alice","Betty","Clare","Dora","Eva","Fran","Grace","Hilda","Iris","Joan"), + eating=sample(0:100,20),dancing=sample(0:100,20),movies=sample(0:100,20), + reading=sample(0:100,20),travel=sample(0:100,20)) + plot(0,xlim=c(0.5,10.5),ylim=c(0,3),type="n",axes=FALSE,xlab="",ylab="Sex", + main="Date matching matrix") + par(xpd=TRUE) + legend(0.7,-0.3,c("Eat out","Dance","Movies","Read","Travel"),fill=rainbow(5), + ncol=5) + par(xpd=FALSE) + box() + axis(2,at=c(0.9,2.4),labels=c("Male","Female")) + starPie(x=rep(1:10,2),y=rep(c(0.9,2.4),each=10),radext=0.5, + values=as.matrix(date_mat[,3:7]),label=as.character(date_mat[["names"]])) +``` diff --git a/reference/staxlab-1.png b/reference/staxlab-1.png new file mode 100644 index 0000000..0c1f0a8 Binary files /dev/null and b/reference/staxlab-1.png differ diff --git a/reference/staxlab-2.png b/reference/staxlab-2.png new file mode 100644 index 0000000..eacec47 Binary files /dev/null and b/reference/staxlab-2.png differ diff --git a/reference/staxlab.html b/reference/staxlab.html new file mode 100644 index 0000000..c5d37f3 --- /dev/null +++ b/reference/staxlab.html @@ -0,0 +1,140 @@ + +Place staggered or angled labels on an axis — staxlab • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Places labels on an axis in a regular staggered order or at an angle

    +
    + +
    +

    Usage

    +
    staxlab(side=1,at,labels,nlines=2,top.line=0.5,line.spacing=0.8,
    +  srt=NULL,ticklen=0.03,adj=1,...)
    +
    + +
    +

    Arguments

    +

    +
    side
    +

    axis on which to place the labels, as in axis

    + +
    at
    +

    where to place the labels in user units, as in axis

    + +
    labels
    +

    text strings

    + +
    nlines
    +

    How many lines to use to stagger the labels.

    + +
    top.line
    +

    Distance from the axis to place the first line of text.

    + +
    line.spacing
    +

    Spacing between lines of text labels.

    + +
    srt
    +

    Text rotation.

    + +
    ticklen
    +

    Proportion of plot height in user units to place text + below the plot.

    + +
    adj
    +

    horizontal adjustment of the labels.

    + +
    ...
    +

    Additional arguments to be passed to mtext or text.

    + +
    +
    +

    Note

    +

    This function is mainly useful when either long axis labels or a large + number of labels are to be placed without overlapping. It staggers the + labels along the axis specified. The user may wish to increase the space + beneath the plot using mar before calling staxlab. It is + probably only useful on the bottom or left side of the plot.

    +

    If srt is not NULL, the labels will be rotated srt degrees + and placed below the plot. This method will only place labels at the + bottom. Note that this option only works on the lower and left axes.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon (thanks to Tim Elwell-Sutton for the log axis fix)

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     x<-rnorm(12)
    + plot(x,axes=FALSE)
    + box()
    + months<-c("January","February","March","April","May","June",
    +  "July","August","September","October","November","December")
    + staxlab(1,1:12,months)
    +
    + plot(x,axes=FALSE)
    + box()
    + staxlab(1,1:12,months,srt=45)
    + ylabels<-round(seq(min(x),max(x),length.out=10),3)
    + staxlab(2,ylabels,ylabels,srt=45)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/staxlab.md b/reference/staxlab.md new file mode 100644 index 0000000..a253298 --- /dev/null +++ b/reference/staxlab.md @@ -0,0 +1,93 @@ +# Place staggered or angled labels on an axis + +Places labels on an axis in a regular staggered order or at an angle + +## Usage + +``` r +staxlab(side=1,at,labels,nlines=2,top.line=0.5,line.spacing=0.8, + srt=NULL,ticklen=0.03,adj=1,...) +``` + +## Arguments + +- side: + + axis on which to place the labels, as in `axis` + +- at: + + where to place the labels in user units, as in `axis` + +- labels: + + text strings + +- nlines: + + How many lines to use to stagger the labels. + +- top.line: + + Distance from the axis to place the first line of text. + +- line.spacing: + + Spacing between lines of text labels. + +- srt: + + Text rotation. + +- ticklen: + + Proportion of plot height in user units to place text below the plot. + +- adj: + + horizontal adjustment of the labels. + +- ...: + + Additional arguments to be passed to `mtext` or `text`. + +## Note + +This function is mainly useful when either long axis labels or a large +number of labels are to be placed without overlapping. It staggers the +labels along the axis specified. The user may wish to increase the space +beneath the plot using `mar` before calling `staxlab`. It is probably +only useful on the bottom or left side of the plot. + +If `srt` is not NULL, the labels will be rotated `srt` degrees and +placed below the plot. This method will only place labels at the bottom. +Note that this option only works on the lower and left axes. + +## Value + +nil + +## Author + +Jim Lemon (thanks to Tim Elwell-Sutton for the log axis fix) + +## See also + +[mtext](https://rdrr.io/r/graphics/mtext.html) + +## Examples + +``` r + x<-rnorm(12) + plot(x,axes=FALSE) + box() + months<-c("January","February","March","April","May","June", + "July","August","September","October","November","December") + staxlab(1,1:12,months) + + plot(x,axes=FALSE) + box() + staxlab(1,1:12,months,srt=45) + ylabels<-round(seq(min(x),max(x),length.out=10),3) + staxlab(2,ylabels,ylabels,srt=45) +``` diff --git a/reference/std.error.html b/reference/std.error.html new file mode 100644 index 0000000..b5ccd11 --- /dev/null +++ b/reference/std.error.html @@ -0,0 +1,90 @@ + +Calculate standard error of the mean — std.error • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Calculates the standard error of the mean.

    +
    + +
    +

    Usage

    +
    std.error(x,na.rm)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A vector of numerical observations.

    + +
    na.rm
    +

    Dummy argument to match other functions.

    + +
    +
    +

    Details

    +

    std.error will accept a numeric vector.

    +
    +
    +

    Value

    +

    The conventional standard error of the mean = sd(x)/sqrt(sum(!is.na(x)))

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/std.error.md b/reference/std.error.md new file mode 100644 index 0000000..f91b0f9 --- /dev/null +++ b/reference/std.error.md @@ -0,0 +1,35 @@ +# Calculate standard error of the mean + +Calculates the standard error of the mean. + +## Usage + +``` r +std.error(x,na.rm) +``` + +## Arguments + +- x: + + A vector of numerical observations. + +- na.rm: + + Dummy argument to match other functions. + +## Details + +`std.error` will accept a numeric vector. + +## Value + +The conventional standard error of the mean = sd(x)/sqrt(sum(!is.na(x))) + +## Author + +Jim Lemon + +## See also + +[sd](https://rdrr.io/r/stats/sd.html) diff --git a/reference/sumbrk.html b/reference/sumbrk.html new file mode 100644 index 0000000..658a2e5 --- /dev/null +++ b/reference/sumbrk.html @@ -0,0 +1,101 @@ + +Count specified values in a vector — sumbrk • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Counts the number of values in a vector that are equal to a specified value.

    +
    + +
    +

    Usage

    +
    sumbrk(x,trueval=TRUE,na.rm=TRUE)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    a character, factor or numeric vector.

    + +
    trueval
    +

    the value to be matched in x.

    + +
    na.rm
    +

    whether to remove NA values.

    + +
    +
    +

    Details

    +

    sumbrk counts the values in x matching a specified value. + It is mainly to allow these sums to be calculated in the brkdnNest + function.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     sumbrk(sample(LETTERS,100,TRUE),trueval="M")
    +#> [1] 5
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/sumbrk.md b/reference/sumbrk.md new file mode 100644 index 0000000..c6f506e --- /dev/null +++ b/reference/sumbrk.md @@ -0,0 +1,48 @@ +# Count specified values in a vector + +Counts the number of values in a vector that are equal to a specified +value. + +## Usage + +``` r +sumbrk(x,trueval=TRUE,na.rm=TRUE) +``` + +## Arguments + +- x: + + a character, factor or numeric vector. + +- trueval: + + the value to be matched in `x`. + +- na.rm: + + whether to remove NA values. + +## Details + +`sumbrk` counts the values in `x` matching a specified value. It is +mainly to allow these sums to be calculated in the `brkdnNest` function. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[brkdnNest](brkdnNest.md) + +## Examples + +``` r + sumbrk(sample(LETTERS,100,TRUE),trueval="M") +#> [1] 5 +``` diff --git a/reference/symbolbarplot-1.png b/reference/symbolbarplot-1.png new file mode 100644 index 0000000..0433374 Binary files /dev/null and b/reference/symbolbarplot-1.png differ diff --git a/reference/symbolbarplot.html b/reference/symbolbarplot.html new file mode 100644 index 0000000..759f2a2 --- /dev/null +++ b/reference/symbolbarplot.html @@ -0,0 +1,167 @@ + +barplot filled with symbols — symbolbarplot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Produces a barplot where each piece of the barplot is filled with the + number of symbols equal to the size of the bar

    +
    + +
    +

    Usage

    +
    symbolbarplot(height,width=1,space=NULL,names.arg=NULL,
    +  legend.text=NULL,beside=FALSE,horiz=FALSE,col=heat.colors(NR),
    +  border=par("fg"),main=NULL,sub=NULL,xlab=NULL,ylab=NULL,xlim=NULL,
    +  ylim=NULL,axes=TRUE,axisnames=TRUE,inside=TRUE,plot=TRUE,rel.width=0.8,
    +  symbol="circles",symbbox=TRUE,debug=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    height
    +

    numeric vector or matrix of barplot heights

    + +
    width
    +

    width of bars

    + +
    space
    +

    space between bars

    + +
    names.arg
    +

    vector of names

    + +
    legend.text
    +

    vector of legend text

    + +
    beside
    +

    (logical) plot bars beside each other?

    + +
    horiz
    +

    (logical) horizontal barplot?

    + +
    col
    +

    vector of colors

    + +
    border
    +

    plot border?

    + +
    main
    +

    main title

    + +
    sub
    +

    subtitle

    + +
    xlab
    +

    x axis label

    + +
    ylab
    +

    y axis label

    + +
    xlim
    +

    x limits

    + +
    ylim
    +

    y limits

    + +
    axes
    +

    draw axes?

    + +
    axisnames
    +

    label horizontal axis?

    + +
    inside
    +

    draw lines dividing adjacent bars?

    + +
    plot
    +

    produce plot?

    + +
    rel.width
    +

    relative width of symbols

    + +
    symbol
    +

    which symbol to use

    + +
    symbbox
    +

    draw boxes for symbol boxes?

    + +
    debug
    +

    debug output?

    + +
    ...
    +

    further arguments to multsymbolbox

    + +
    +
    +

    Value

    +

    Nil

    +
    +
    +

    Note

    +

    This is a mostly a hack of barplot()

    +
    +
    +

    Author

    +

    Ben Bolker

    +
    + +
    +

    Examples

    +
     set.seed(1001)
    + bvals <- matrix(rpois(12,20),nrow=3)
    + b <- symbolbarplot(bvals)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/symbolbarplot.md b/reference/symbolbarplot.md new file mode 100644 index 0000000..dbb83cb --- /dev/null +++ b/reference/symbolbarplot.md @@ -0,0 +1,132 @@ +# barplot filled with symbols + +Produces a barplot where each piece of the barplot is filled with the +number of symbols equal to the size of the bar + +## Usage + +``` r +symbolbarplot(height,width=1,space=NULL,names.arg=NULL, + legend.text=NULL,beside=FALSE,horiz=FALSE,col=heat.colors(NR), + border=par("fg"),main=NULL,sub=NULL,xlab=NULL,ylab=NULL,xlim=NULL, + ylim=NULL,axes=TRUE,axisnames=TRUE,inside=TRUE,plot=TRUE,rel.width=0.8, + symbol="circles",symbbox=TRUE,debug=FALSE,...) +``` + +## Arguments + +- height: + + numeric vector or matrix of barplot heights + +- width: + + width of bars + +- space: + + space between bars + +- names.arg: + + vector of names + +- legend.text: + + vector of legend text + +- beside: + + (logical) plot bars beside each other? + +- horiz: + + (logical) horizontal barplot? + +- col: + + vector of colors + +- border: + + plot border? + +- main: + + main title + +- sub: + + subtitle + +- xlab: + + x axis label + +- ylab: + + y axis label + +- xlim: + + x limits + +- ylim: + + y limits + +- axes: + + draw axes? + +- axisnames: + + label horizontal axis? + +- inside: + + draw lines dividing adjacent bars? + +- plot: + + produce plot? + +- rel.width: + + relative width of symbols + +- symbol: + + which symbol to use + +- symbbox: + + draw boxes for symbol boxes? + +- debug: + + debug output? + +- ...: + + further arguments to multsymbolbox + +## Value + +Nil + +## Note + +This is a mostly a hack of barplot() + +## Author + +Ben Bolker + +## Examples + +``` r + set.seed(1001) + bvals <- matrix(rpois(12,20),nrow=3) + b <- symbolbarplot(bvals) +``` diff --git a/reference/symbolbox-1.png b/reference/symbolbox-1.png new file mode 100644 index 0000000..5c70550 Binary files /dev/null and b/reference/symbolbox-1.png differ diff --git a/reference/symbolbox.html b/reference/symbolbox.html new file mode 100644 index 0000000..faca126 --- /dev/null +++ b/reference/symbolbox.html @@ -0,0 +1,134 @@ + +Draw a box filled with symbols — symbolbox • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Draws a box on the current figure that is filled with symbols + representing individual counts

    +
    + +
    +

    Usage

    +
    symbolbox(x1,y1,x2,y2,tot,relw=0.5,fg=par("fg"),bg=par("bg"),box=TRUE,
    +  debug = TRUE,...)
    +
    + +
    +

    Arguments

    +

    +
    x1
    +

    left side of box

    + +
    y1
    +

    bottom side of box

    + +
    x2
    +

    right side of box

    + +
    y2
    +

    top side of box

    + +
    tot
    +

    total number of symbols to put in the box

    + +
    relw
    +

    relative width (relative to height) of symbols

    + +
    fg
    +

    foreground color

    + +
    bg
    +

    background color

    + +
    box
    +

    (logical) draw box border?

    + +
    debug
    +

    debug output?

    + +
    ...
    +

    additional arguments to polygon() for drawing box

    + +
    +
    +

    Details

    +

    tries to automatically figure out appropriate scaling to fit symbols + into the box

    +
    +
    +

    Value

    +

    none; draws on the current figure

    +
    +
    +

    Author

    +

    Ben Bolker

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     plot(1:10,1:10,type="n")
    + symbolbox(2,5,3,7,tot=20)
    +#> symbolbox: 2 5 3 7 20 
    +#> symbolbox: 0.558299 0.9931413 3 7 3 7 20 
    + symbolbox(6,2,10,6,tot=50,fg="blue",bg="magenta")
    +
    +#> symbolbox: 6 2 10 6 50 
    +#> symbolbox: 2.233196 1.986283 7 8 7 8 50 
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/symbolbox.md b/reference/symbolbox.md new file mode 100644 index 0000000..dd05389 --- /dev/null +++ b/reference/symbolbox.md @@ -0,0 +1,87 @@ +# Draw a box filled with symbols + +Draws a box on the current figure that is filled with symbols +representing individual counts + +## Usage + +``` r +symbolbox(x1,y1,x2,y2,tot,relw=0.5,fg=par("fg"),bg=par("bg"),box=TRUE, + debug = TRUE,...) +``` + +## Arguments + +- x1: + + left side of box + +- y1: + + bottom side of box + +- x2: + + right side of box + +- y2: + + top side of box + +- tot: + + total number of symbols to put in the box + +- relw: + + relative width (relative to height) of symbols + +- fg: + + foreground color + +- bg: + + background color + +- box: + + (logical) draw box border? + +- debug: + + debug output? + +- ...: + + additional arguments to polygon() for drawing box + +## Details + +tries to automatically figure out appropriate scaling to fit symbols +into the box + +## Value + +none; draws on the current figure + +## Author + +Ben Bolker + +## See also + +[multsymbolbox](multsymbolbox.md) + +## Examples + +``` r + plot(1:10,1:10,type="n") + symbolbox(2,5,3,7,tot=20) +#> symbolbox: 2 5 3 7 20 +#> symbolbox: 0.558299 0.9931413 3 7 3 7 20 + symbolbox(6,2,10,6,tot=50,fg="blue",bg="magenta") + +#> symbolbox: 6 2 10 6 50 +#> symbolbox: 2.233196 1.986283 7 8 7 8 50 +``` diff --git a/reference/tab.title-1.png b/reference/tab.title-1.png new file mode 100644 index 0000000..8703d0e Binary files /dev/null and b/reference/tab.title-1.png differ diff --git a/reference/tab.title.html b/reference/tab.title.html new file mode 100644 index 0000000..0d30814 --- /dev/null +++ b/reference/tab.title.html @@ -0,0 +1,123 @@ + +Display the title of a plot as a colored tab — tab.title • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display the title of a plot as a colored tab.

    +
    + +
    +

    Usage

    +
    tab.title(label,text.col=par("fg"),tab.col=par("bg"),border=par("fg"),
    +  lwd=par("lwd"),cex=1.5,pad.mult=1.6,radius=0)
    +
    + +
    +

    Arguments

    +

    +
    label
    +

    The title for the plot.

    + +
    text.col
    +

    The color for the title text.

    + +
    tab.col
    +

    The color for the tab fill.

    + +
    border
    +

    The color for the tab border.

    + +
    lwd
    +

    The line width for the border.

    + +
    cex
    +

    Character expansion for the title.

    + +
    pad.mult
    +

    How much higher to make the tab relative to the label.

    + +
    radius
    +

    What proportion of the tab corners to round off.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    tab.title displays the plot title in a colored tab. The tab can be + rounded at the upper corners by specifying the proportion of the tab + height to be rounded as a number between 0 and 1. If the tab is too high + to fit on the figure region, a warning will be displayed and the tab will + still be shown.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     testx<-matrix(cumsum(rnorm(30)^2)+1,nrow=10)
    + stackpoly(testx,main="",
    +  xaxlab=c("One","Two","Three","Four","Five",
    +  "Six","Seven","Eight","Nine","Ten"),staxx=TRUE)
    + tab.title("Three Squiggly Lines",tab.col="yellow",radius=0.5)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/tab.title.md b/reference/tab.title.md new file mode 100644 index 0000000..06a3a22 --- /dev/null +++ b/reference/tab.title.md @@ -0,0 +1,74 @@ +# Display the title of a plot as a colored tab + +Display the title of a plot as a colored tab. + +## Usage + +``` r +tab.title(label,text.col=par("fg"),tab.col=par("bg"),border=par("fg"), + lwd=par("lwd"),cex=1.5,pad.mult=1.6,radius=0) +``` + +## Arguments + +- label: + + The title for the plot. + +- text.col: + + The color for the title text. + +- tab.col: + + The color for the tab fill. + +- border: + + The color for the tab border. + +- lwd: + + The line width for the border. + +- cex: + + Character expansion for the title. + +- pad.mult: + + How much higher to make the tab relative to the label. + +- radius: + + What proportion of the tab corners to round off. + +## Value + +nil + +## Details + +`tab.title` displays the plot title in a colored tab. The tab can be +rounded at the upper corners by specifying the proportion of the tab +height to be rounded as a number between 0 and 1. If the tab is too high +to fit on the figure region, a warning will be displayed and the tab +will still be shown. + +## Author + +Jim Lemon + +## See also + +[polygon](https://rdrr.io/r/graphics/polygon.html) + +## Examples + +``` r + testx<-matrix(cumsum(rnorm(30)^2)+1,nrow=10) + stackpoly(testx,main="", + xaxlab=c("One","Two","Three","Four","Five", + "Six","Seven","Eight","Nine","Ten"),staxx=TRUE) + tab.title("Three Squiggly Lines",tab.col="yellow",radius=0.5) +``` diff --git a/reference/taylor.diagram-1.png b/reference/taylor.diagram-1.png new file mode 100644 index 0000000..4faeac2 Binary files /dev/null and b/reference/taylor.diagram-1.png differ diff --git a/reference/taylor.diagram-2.png b/reference/taylor.diagram-2.png new file mode 100644 index 0000000..f6a9666 Binary files /dev/null and b/reference/taylor.diagram-2.png differ diff --git a/reference/taylor.diagram.html b/reference/taylor.diagram.html new file mode 100644 index 0000000..0c21024 --- /dev/null +++ b/reference/taylor.diagram.html @@ -0,0 +1,198 @@ + +Taylor diagram — taylor.diagram • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display a Taylor diagram

    +
    + +
    +

    Usage

    +
    taylor.diagram(ref,model,add=FALSE,col="red",pch=19,pos.cor=TRUE,
    +  xlab="Standard deviation",ylab="",main="Taylor Diagram",
    +  show.gamma=TRUE,ngamma=3,gamma.col=8,sd.arcs=0,
    +  ref.sd=FALSE,sd.method="sample",grad.corr.lines=c(0.2,0.4,0.6,0.8,0.9),
    +  pcex=1,cex.axis=1,normalize=FALSE,mar=c(4,3,4,3),...)
    +
    + +
    +

    Arguments

    +

    +
    ref
    +

    numeric vector - the reference values.

    + +
    model
    +

    numeric vector - the predicted model values.

    + +
    add
    +

    whether to draw the diagram or just add a point.

    + +
    col
    +

    the color for the points displayed.

    + +
    pch
    +

    the type of point to display.

    + +
    pos.cor
    +

    whether to display only positive (TRUE) or all + values of correlation (FALSE).

    + +
    xlab,ylab
    +

    plot axis labels.

    + +
    main
    +

    title for the plot.

    + +
    show.gamma
    +

    whether to display standard deviation arcs around + the reference point (only for pos.cor=TRUE).

    + +
    ngamma
    +

    the number of gammas to display (default=3).

    + +
    gamma.col
    +

    color to use for the gamma arcs (only with pos.cor=TRUE).

    + +
    sd.arcs
    +

    whether to display arcs along the standard deviation axes + (see Details).

    + +
    ref.sd
    +

    whether to display the arc representing the reference + standard deviation.

    + +
    sd.method
    +

    Whether to use the sample or estimated population SD.

    + +
    grad.corr.lines
    +

    the values for the radial lines for correlation + values (see Details).

    + +
    pcex
    +

    character expansion for the plotted points.

    + +
    cex.axis
    +

    character expansion for the axis text.

    + +
    normalize
    +

    whether to normalize the models so that the reference + has a standard deviation of 1.

    + +
    mar
    +

    margins - only applies to the pos.cor=TRUE plot.

    + +
    ...
    +

    Additional arguments passed to plot.

    + +
    +
    +

    Details

    +

    The Taylor diagram is used to display the quality of model predictions + against the reference values, typically direct observations.

    +

    A diagram is built by plotting one model against the reference, + then adding alternative model points. If normalize=TRUE + when plotting the first model, remember to set it to TRUE + when plotting additional models.

    +

    Two displays are available. One displays the entire range of correlations + from -1 to 1. Setting pos.cor to FALSE will produce this + display. The -1 to 1 display includes a radial grid for the correlation + values. When pos.cor is set to TRUE, only the + range from 0 to 1 will be displayed. The gamma lines and the arc at + the reference standard deviation are optional in this display.

    +

    Both the standard deviation arcs and the gamma lines are optional in the + pos.cor=TRUE version. Setting sd.arcs or grad.corr.lines + to zero or FALSE will cause them not to be displayed. If more than one value is + passed for sd.arcs, the function will try to use the values passed, + otherwise it will call pretty to calculate the values.

    +
    +
    +

    Value

    +

    The values of par that preceded the function. This allows the + user to add points to the diagram, then restore the original values. This + is only necessary when using the 0 to 1 correlation range.

    +
    +
    +

    References

    +

    Taylor, K.E. (2001) Summarizing multiple aspects of model performance in a + single diagram. Journal of Geophysical Research, 106: 7183-7192.

    +
    +
    +

    Author

    +

    Olivier Eterradossi with modifications by Jim Lemon

    +
    + +
    +

    Examples

    +
     # fake some reference data
    + ref<-rnorm(30,sd=2)
    + # add a little noise
    + model1<-ref+rnorm(30)/2
    + # add more noise
    + model2<-ref+rnorm(30)
    + # display the diagram with the better model
    + oldpar<-taylor.diagram(ref,model1)
    + # now add the worse model
    + taylor.diagram(ref,model2,add=TRUE,col="blue")
    + # get approximate legend position
    + lpos<-1.5*sd(ref)
    + # add a legend
    + legend(lpos,lpos,legend=c("Better","Worse"),pch=19,col=c("red","blue"))
    +
    + # now restore par values
    + par(oldpar)
    + # show the "all correlation" display
    + taylor.diagram(ref,model1,pos.cor=FALSE)
    + taylor.diagram(ref,model2,add=TRUE,col="blue")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/taylor.diagram.md b/reference/taylor.diagram.md new file mode 100644 index 0000000..edc8446 --- /dev/null +++ b/reference/taylor.diagram.md @@ -0,0 +1,163 @@ +# Taylor diagram + +Display a Taylor diagram + +## Usage + +``` r +taylor.diagram(ref,model,add=FALSE,col="red",pch=19,pos.cor=TRUE, + xlab="Standard deviation",ylab="",main="Taylor Diagram", + show.gamma=TRUE,ngamma=3,gamma.col=8,sd.arcs=0, + ref.sd=FALSE,sd.method="sample",grad.corr.lines=c(0.2,0.4,0.6,0.8,0.9), + pcex=1,cex.axis=1,normalize=FALSE,mar=c(4,3,4,3),...) +``` + +## Arguments + +- ref: + + numeric vector - the reference values. + +- model: + + numeric vector - the predicted model values. + +- add: + + whether to draw the diagram or just add a point. + +- col: + + the color for the points displayed. + +- pch: + + the type of point to display. + +- pos.cor: + + whether to display only positive (`TRUE`) or all values of correlation + (`FALSE`). + +- xlab,ylab: + + plot axis labels. + +- main: + + title for the plot. + +- show.gamma: + + whether to display standard deviation arcs around the reference point + (only for `pos.cor=TRUE`). + +- ngamma: + + the number of gammas to display (default=3). + +- gamma.col: + + color to use for the gamma arcs (only with pos.cor=TRUE). + +- sd.arcs: + + whether to display arcs along the standard deviation axes (see + Details). + +- ref.sd: + + whether to display the arc representing the reference standard + deviation. + +- sd.method: + + Whether to use the sample or estimated population SD. + +- grad.corr.lines: + + the values for the radial lines for correlation values (see Details). + +- pcex: + + character expansion for the plotted points. + +- cex.axis: + + character expansion for the axis text. + +- normalize: + + whether to normalize the models so that the reference has a standard + deviation of 1. + +- mar: + + margins - only applies to the `pos.cor=TRUE` plot. + +- ...: + + Additional arguments passed to `plot`. + +## Details + +The Taylor diagram is used to display the quality of model predictions +against the reference values, typically direct observations. + +A diagram is built by plotting one model against the reference, then +adding alternative model points. If `normalize=TRUE` when plotting the +first model, remember to set it to `TRUE` when plotting additional +models. + +Two displays are available. One displays the entire range of +correlations from -1 to 1. Setting `pos.cor` to `FALSE` will produce +this display. The -1 to 1 display includes a radial grid for the +correlation values. When `pos.cor` is set to `TRUE`, only the range from +0 to 1 will be displayed. The `gamma` lines and the arc at the reference +standard deviation are optional in this display. + +Both the standard deviation arcs and the gamma lines are optional in the +`pos.cor=TRUE` version. Setting `sd.arcs` or `grad.corr.lines` to zero +or FALSE will cause them not to be displayed. If more than one value is +passed for `sd.arcs`, the function will try to use the values passed, +otherwise it will call `pretty` to calculate the values. + +## Value + +The values of `par` that preceded the function. This allows the user to +add points to the diagram, then restore the original values. This is +only necessary when using the 0 to 1 correlation range. + +## References + +Taylor, K.E. (2001) Summarizing multiple aspects of model performance in +a single diagram. Journal of Geophysical Research, 106: 7183-7192. + +## Author + +Olivier Eterradossi with modifications by Jim Lemon + +## Examples + +``` r + # fake some reference data + ref<-rnorm(30,sd=2) + # add a little noise + model1<-ref+rnorm(30)/2 + # add more noise + model2<-ref+rnorm(30) + # display the diagram with the better model + oldpar<-taylor.diagram(ref,model1) + # now add the worse model + taylor.diagram(ref,model2,add=TRUE,col="blue") + # get approximate legend position + lpos<-1.5*sd(ref) + # add a legend + legend(lpos,lpos,legend=c("Better","Worse"),pch=19,col=c("red","blue")) + + # now restore par values + par(oldpar) + # show the "all correlation" display + taylor.diagram(ref,model1,pos.cor=FALSE) + taylor.diagram(ref,model2,add=TRUE,col="blue") +``` diff --git a/reference/textbox-1.png b/reference/textbox-1.png new file mode 100644 index 0000000..4b05fa2 Binary files /dev/null and b/reference/textbox-1.png differ diff --git a/reference/textbox.html b/reference/textbox.html new file mode 100644 index 0000000..1fa03fc --- /dev/null +++ b/reference/textbox.html @@ -0,0 +1,173 @@ + +Add text box — textbox • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Add text to plot, justified, in a box

    +
    + +
    +

    Usage

    +
    textbox(x, y, textlist, justify=c('l','c','r'), cex=1, leading=0.5, box=TRUE,
    + adj=c(0,0), font=NULL, vfont=NULL, col=NULL, border=NULL, fill=NA, density=NULL,
    + angle=45, lty=par("lty"), lwd=par("lwd"), margin=0)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    x position: a vector with min. and max. x-position

    + +
    y
    +

    y position: location of the top of the box

    + +
    textlist
    +

    a vector of text strings

    + +
    justify
    +

    x alignment: 'l'=left, 'c'=center, 'r'=right.

    + +
    cex
    +

    character expansion

    + +
    leading
    +

    inter-line spacing

    + +
    box
    +

    whether to draw a box around the text

    + +
    adj
    +

    adjustment for x and y position, default is no adjustment, + see Details

    + +
    font
    +

    text font, see Details

    + +
    vfont
    +

    text font, see Details

    + +
    col
    +

    text color

    + +
    border
    +

    box border color

    + +
    fill
    +

    box fill color

    + +
    density
    +

    box shading line density, see Details

    + +
    angle
    +

    box shading line angle, see Details

    + +
    lty
    +

    box border and shading line types, see Details

    + +
    lwd
    +

    box border and shading line width, see Details

    + +
    margin
    +

    amount to adjust box border in or out. See Details

    + +
    +
    +

    Details

    +

    Draws text in the box by pasting the textlist vector together, splitting it + into words, and then adding words to the current line until the line is wide + enough before moving on to the next line.

    +

    margin may be a vector of 1, 2, or 4 values, corresponding to + adjustment of all borders (1 value), top/bottom and left/right borders + (2 values), or bottom/left/top/right borders (4 values). A positive value + moves text inwards from specified (x,y) position with border remaining at (x,y), + and a negative value moves the border outwards from (x,y) with the text + remaining at (x,y).

    +

    The density and angle arguments have the same behavior as in the + rect function. The adj, font and vfont arguments have the same + behavior as in the text function. The lty and lwd + arguments have the same behavior as in the lines function.

    +
    +
    +

    Value

    +

    y-position of bottom line of box, or y-position of next line if there is no box.

    +
    +
    +

    Author

    +

    Ben Bolker. Improvements by Ted Toal.

    +
    + +
    +

    Examples

    +
     plot.new()
    + textbox(c(0,0.2), 1, c("many words","more words","why not?",
    +  "keep going",rep("and going",10)))
    +#>  [1] 1.0000000 0.9580456 0.9160912 0.8741367 0.8321823 0.7902279 0.7482735
    +#>  [8] 0.7063191 0.6643646 0.6224102 0.5804558 0.5385014 0.4965470 0.4545925
    +#> [15] 0.4126381 0.3706837 0.3287293
    + textbox(c(0.3,0.5), 1, c("keep going",rep("and going",10)), cex=0.45,
    +  col="blue", border="red", fill="#00FFEE80", density=25, angle=60)
    +#> [1] 1.0000000 0.9813212 0.9626423 0.9439635 0.9252847 0.9066058 0.8879270
    + textbox(c(0.6,0.8), 1, c("keep going",rep("and going",10)), justify='c', cex=0.6,
    +  leading=1, font=4, border="gold", lty=2, lwd=4, margin=0.025)
    +#>  [1] 0.9750000 0.9438686 0.9127372 0.8816058 0.8504744 0.8193430 0.7882116
    +#>  [8] 0.7570802 0.7259488 0.6948174 0.6636860 0.6325546
    + textbox(c(0.6,0.8), 0.5, c("keep going",rep("and going",10)), justify='r', cex=0.7,
    +  col="purple", font=3, border="green", margin=-0.025)
    +#> [1] 0.5000000 0.4719991 0.4439983 0.4159974 0.3879965 0.3599957 0.3319948
    +#> [8] 0.3039940 0.2759931
    + lines(c(0,1), c(1,1), col="red", lty=2)
    + lines(c(0,1), c(0.5,0.5), col="red", lty=2)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/textbox.md b/reference/textbox.md new file mode 100644 index 0000000..8e0b388 --- /dev/null +++ b/reference/textbox.md @@ -0,0 +1,136 @@ +# Add text box + +Add text to plot, justified, in a box + +## Usage + +``` r +textbox(x, y, textlist, justify=c('l','c','r'), cex=1, leading=0.5, box=TRUE, + adj=c(0,0), font=NULL, vfont=NULL, col=NULL, border=NULL, fill=NA, density=NULL, + angle=45, lty=par("lty"), lwd=par("lwd"), margin=0) +``` + +## Arguments + +- x: + + x position: a vector with min. and max. x-position + +- y: + + y position: location of the top of the box + +- textlist: + + a vector of text strings + +- justify: + + x alignment: 'l'=left, 'c'=center, 'r'=right. + +- cex: + + character expansion + +- leading: + + inter-line spacing + +- box: + + whether to draw a box around the text + +- adj: + + adjustment for x and y position, default is no adjustment, see Details + +- font: + + text font, see Details + +- vfont: + + text font, see Details + +- col: + + text color + +- border: + + box border color + +- fill: + + box fill color + +- density: + + box shading line density, see Details + +- angle: + + box shading line angle, see Details + +- lty: + + box border and shading line types, see Details + +- lwd: + + box border and shading line width, see Details + +- margin: + + amount to adjust box border in or out. See Details + +## Details + +Draws text in the box by pasting the textlist vector together, splitting +it into words, and then adding words to the current line until the line +is wide enough before moving on to the next line. + +`margin` may be a vector of 1, 2, or 4 values, corresponding to +adjustment of all borders (1 value), top/bottom and left/right borders +(2 values), or bottom/left/top/right borders (4 values). A positive +value moves text inwards from specified (x,y) position with border +remaining at (x,y), and a negative value moves the border outwards from +(x,y) with the text remaining at (x,y). + +The `density` and `angle` arguments have the same behavior as in the +`rect` function. The `adj, font` and `vfont` arguments have the same +behavior as in the `text` function. The `lty` and `lwd` arguments have +the same behavior as in the `lines` function. + +## Value + +y-position of bottom line of box, or y-position of next line if there is +no box. + +## Author + +Ben Bolker. Improvements by Ted Toal. + +## Examples + +``` r + plot.new() + textbox(c(0,0.2), 1, c("many words","more words","why not?", + "keep going",rep("and going",10))) +#> [1] 1.0000000 0.9580456 0.9160912 0.8741367 0.8321823 0.7902279 0.7482735 +#> [8] 0.7063191 0.6643646 0.6224102 0.5804558 0.5385014 0.4965470 0.4545925 +#> [15] 0.4126381 0.3706837 0.3287293 + textbox(c(0.3,0.5), 1, c("keep going",rep("and going",10)), cex=0.45, + col="blue", border="red", fill="#00FFEE80", density=25, angle=60) +#> [1] 1.0000000 0.9813212 0.9626423 0.9439635 0.9252847 0.9066058 0.8879270 + textbox(c(0.6,0.8), 1, c("keep going",rep("and going",10)), justify='c', cex=0.6, + leading=1, font=4, border="gold", lty=2, lwd=4, margin=0.025) +#> [1] 0.9750000 0.9438686 0.9127372 0.8816058 0.8504744 0.8193430 0.7882116 +#> [8] 0.7570802 0.7259488 0.6948174 0.6636860 0.6325546 + textbox(c(0.6,0.8), 0.5, c("keep going",rep("and going",10)), justify='r', cex=0.7, + col="purple", font=3, border="green", margin=-0.025) +#> [1] 0.5000000 0.4719991 0.4439983 0.4159974 0.3879965 0.3599957 0.3319948 +#> [8] 0.3039940 0.2759931 + lines(c(0,1), c(1,1), col="red", lty=2) + lines(c(0,1), c(0.5,0.5), col="red", lty=2) +``` diff --git a/reference/thigmophobe.html b/reference/thigmophobe.html new file mode 100644 index 0000000..ef70305 --- /dev/null +++ b/reference/thigmophobe.html @@ -0,0 +1,127 @@ + +Find the direction away from the closest point — thigmophobe • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Find the direction away from the closest point

    +
    + +
    +

    Usage

    +
    thigmophobe(x,y=NULL,names=seq_along(z),xlog=par("xlog"),ylog=par("ylog"),
    +  usr=par("usr"),pin=par("pin"),eps=.Machine$double.eps,pi=base::pi)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    Numeric data vectors. Typically the x/y coordinates of + plotted points. If arrays are passed, they will be silently coerced to + numeric vectors.

    + +
    names
    +

    Names for the vector of directions.

    + +
    xlog,ylog
    +

    Flags for logarithmic axes. See Note.

    + +
    usr
    +

    The extent of the plot in user units.

    + +
    pin
    +

    Extent of the plot in inches.

    + +
    eps
    +

    smallest number that can be represented on the system.

    + +
    pi
    +

    value of pi.

    + +
    +
    +

    Details

    +

    thigmophobe returns the direction (as 1|2|3|4 - see pos= in + text) away from the nearest point to each of the points + described by x and y.

    +
    +
    +

    Note

    +

    thigmophobe is typically used to get the offsets to automatically + place labels on a scatterplot or similar using thigmophobe.labels + to avoid overlapping labels. The name means "one who fears being touched".

    +

    The plot.span, xlog and ylog arguments were added to + allow thigmophobe to be used outside of base graphics.

    +
    +
    +

    Value

    +

    A vector of directions away from the point nearest to each point.

    +
    +
    +

    Author

    +

    Bill Venables

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     x<-rnorm(10)
    + y<-rnorm(10)
    + thigmophobe(x,y)
    +#>  1  2  3  4  5  6  7  8  9 10 
    +#>  1  4  2  4  2  4  3  2  2  4 
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/thigmophobe.labels-1.png b/reference/thigmophobe.labels-1.png new file mode 100644 index 0000000..5ec0356 Binary files /dev/null and b/reference/thigmophobe.labels-1.png differ diff --git a/reference/thigmophobe.labels.html b/reference/thigmophobe.labels.html new file mode 100644 index 0000000..216d1f9 --- /dev/null +++ b/reference/thigmophobe.labels.html @@ -0,0 +1,143 @@ + +Place labels away from the nearest point — thigmophobe.labels • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    thigmophobe.labels places labels adjacent to each point, + offsetting each label in the direction returned by + thigmophobe.

    +
    + +
    +

    Usage

    +
    thigmophobe.labels(x,y,labels=NULL,text.pos=NULL,...)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    Numeric data vectors or a list with two components. + Typically the x/y coordinates of plotted points.

    + +
    labels
    +

    A vector of strings that will be placed adjacent to + each point. Defaults to the indices of the coordinates.

    + +
    text.pos
    +

    An optional vector of text positions (see + text).

    + +
    ...
    +

    additional arguments are passed to text

    +

    .

    +
    +
    +

    Details

    +

    Typically used to automatically place labels on a scatterplot or + similar to avoid overlapping labels. thigmophobe.labels + will sometimes place a label off the plot or fail to separate + labels in clusters of points. The user can manually adjust the + errant labels by running thigmophobe first and saving + the returned vector. Then modify the position values to place + the labels properly and pass the edited vector to + thigmophobe.labels as the text.pos argument. This + takes precedence over the positions calculated by thigmophobe.

    +

    thigmophobe will fail with only two labels, as it can't figure out + the nearest neighbors. If you really want to use this with two labels, just + eyeball the plot and work out in which direction the labels will go. Then + pass the directions to thigmophobe.labels as the text.pos + argument. When all else fails, look to placeLabels.

    +

    Both pointLabel in the maptools package and spread.labs + in the TeachingDemos package use more sophisticated algorithms to + place the labels and are worth a try if thigmophobe just won't get it + right.

    +
    +
    +

    Value

    +

    A vector of directions away from the point nearest to each point.

    +
    +
    +

    Author

    +

    Jim Lemon (thanks to Stephen Milborrow for finding the single point bug + and Erik Aronesty for finding the two point problem.)

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     x<-rnorm(20)
    + y<-rnorm(20)
    + xlim<-range(x)
    + xspace<-(xlim[2]-xlim[1])/20
    + xlim<-c(xlim[1]-xspace,xlim[2]+xspace)
    + ylim<-range(y)
    + yspace<-(ylim[2]-ylim[1])/20
    + ylim<-c(ylim[1]-yspace,ylim[2]+yspace)
    + plotlabels<-
    +  c("one","two","three","four","five","six","seven","eight","nine","ten",
    +  "eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen",
    +  "eighteen","nineteen","twenty")
    + plot(x=x,y=y,xlim=xlim,ylim=ylim,main="Test thigmophobe.labels")
    + # skip the almost invisible yellow label, make them bold
    + thigmophobe.labels(x,y,plotlabels,col=c(2:6,8:12),font=2)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/thigmophobe.labels.md b/reference/thigmophobe.labels.md new file mode 100644 index 0000000..902e4f0 --- /dev/null +++ b/reference/thigmophobe.labels.md @@ -0,0 +1,88 @@ +# Place labels away from the nearest point + +`thigmophobe.labels` places labels adjacent to each point, offsetting +each label in the direction returned by `thigmophobe`. + +## Usage + +``` r +thigmophobe.labels(x,y,labels=NULL,text.pos=NULL,...) +``` + +## Arguments + +- x,y: + + Numeric data vectors or a list with two components. Typically the x/y + coordinates of plotted points. + +- labels: + + A vector of strings that will be placed adjacent to each point. + Defaults to the indices of the coordinates. + +- text.pos: + + An optional vector of text positions (see + [text](https://rdrr.io/r/graphics/text.html)). + +- ...: + + additional arguments are passed to `text` + +. + +## Details + +Typically used to automatically place labels on a scatterplot or similar +to avoid overlapping labels. `thigmophobe.labels` will sometimes place a +label off the plot or fail to separate labels in clusters of points. The +user can manually adjust the errant labels by running `thigmophobe` +first and saving the returned vector. Then modify the position values to +place the labels properly and pass the edited vector to +`thigmophobe.labels` as the `text.pos` argument. This takes precedence +over the positions calculated by `thigmophobe`. + +`thigmophobe` will fail with only two labels, as it can't figure out the +nearest neighbors. If you really want to use this with two labels, just +eyeball the plot and work out in which direction the labels will go. +Then pass the directions to `thigmophobe.labels` as the `text.pos` +argument. When all else fails, look to `placeLabels`. + +Both `pointLabel` in the maptools package and `spread.labs` in the +TeachingDemos package use more sophisticated algorithms to place the +labels and are worth a try if `thigmophobe` just won't get it right. + +## Value + +A vector of directions away from the point nearest to each point. + +## Author + +Jim Lemon (thanks to Stephen Milborrow for finding the single point bug +and Erik Aronesty for finding the two point problem.) + +## See also + +[thigmophobe](thigmophobe.md), +[text](https://rdrr.io/r/graphics/text.html) + +## Examples + +``` r + x<-rnorm(20) + y<-rnorm(20) + xlim<-range(x) + xspace<-(xlim[2]-xlim[1])/20 + xlim<-c(xlim[1]-xspace,xlim[2]+xspace) + ylim<-range(y) + yspace<-(ylim[2]-ylim[1])/20 + ylim<-c(ylim[1]-yspace,ylim[2]+yspace) + plotlabels<- + c("one","two","three","four","five","six","seven","eight","nine","ten", + "eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen", + "eighteen","nineteen","twenty") + plot(x=x,y=y,xlim=xlim,ylim=ylim,main="Test thigmophobe.labels") + # skip the almost invisible yellow label, make them bold + thigmophobe.labels(x,y,plotlabels,col=c(2:6,8:12),font=2) +``` diff --git a/reference/thigmophobe.md b/reference/thigmophobe.md new file mode 100644 index 0000000..b03329f --- /dev/null +++ b/reference/thigmophobe.md @@ -0,0 +1,79 @@ +# Find the direction away from the closest point + +Find the direction away from the closest point + +## Usage + +``` r +thigmophobe(x,y=NULL,names=seq_along(z),xlog=par("xlog"),ylog=par("ylog"), + usr=par("usr"),pin=par("pin"),eps=.Machine$double.eps,pi=base::pi) +``` + +## Arguments + +- x,y: + + Numeric data vectors. Typically the x/y coordinates of plotted points. + If arrays are passed, they will be silently coerced to numeric + vectors. + +- names: + + Names for the vector of directions. + +- xlog,ylog: + + Flags for logarithmic axes. See Note. + +- usr: + + The extent of the plot in user units. + +- pin: + + Extent of the plot in inches. + +- eps: + + smallest number that can be represented on the system. + +- pi: + + value of pi. + +## Details + +`thigmophobe` returns the direction (as 1\|2\|3\|4 - see pos= in `text`) +away from the nearest point to each of the points described by `x` and +`y`. + +## Note + +`thigmophobe` is typically used to get the offsets to automatically +place labels on a scatterplot or similar using `thigmophobe.labels` to +avoid overlapping labels. The name means "one who fears being touched". + +The `plot.span`, `xlog` and `ylog` arguments were added to allow +`thigmophobe` to be used outside of base graphics. + +## Value + +A vector of directions away from the point nearest to each point. + +## Author + +Bill Venables + +## See also + +[thigmophobe.labels](thigmophobe.labels.md) + +## Examples + +``` r + x<-rnorm(10) + y<-rnorm(10) + thigmophobe(x,y) +#> 1 2 3 4 5 6 7 8 9 10 +#> 1 4 2 4 2 4 3 2 2 4 +``` diff --git a/reference/triax.abline-1.png b/reference/triax.abline-1.png new file mode 100644 index 0000000..cab2e01 Binary files /dev/null and b/reference/triax.abline-1.png differ diff --git a/reference/triax.abline.html b/reference/triax.abline.html new file mode 100644 index 0000000..3dd6030 --- /dev/null +++ b/reference/triax.abline.html @@ -0,0 +1,122 @@ + +Lines for triangle plot — triax.abline • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display lines on a triangle plot.

    +
    + +
    +

    Usage

    +
    triax.abline(b=NULL,r=NULL,l=NULL,col=par("col"),lty=par("lty"),
    +  cc.axes=FALSE)
    +
    + +
    +

    Arguments

    +

    +
    b
    +

    Lines relating to the bottom axis.

    + +
    r
    +

    Lines relating to the right axis.

    + +
    l
    +

    Lines relating to the left axis.

    + +
    col
    +

    Color(s) of the lines.

    + +
    lty
    +

    Type(s) of the lines.

    + +
    cc.axes
    +

    Clockwise/counterclockwise axes and ticks.

    + +
    +
    +

    Details

    +

    triax.abline displays one or more lines on a triangle plot. Lines + are oriented in the conventional way, horizontal for the left axis, + slanting up to the right for the right axis and up to the left for the + bottom axis. If cc.axes is TRUE, the orientation is up-left for + the left axis, horizontal for the right axis and up-right for the bottom + axis.

    +

    Remember to call triax.plot with no.add=FALSE and restore + the graphics parameters as in the example or the lines will not be + placed properly.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     triax.return<-triax.plot(data.frame(bottom=0.4,right=0.3,left=0.3),
    +  main="Triax ablines",no.add=FALSE)
    + triax.abline(l=0.3,col="red")
    + triax.abline(r=0.3,col="green")
    + triax.abline(b=0.4,col="blue")
    +
    + par(triax.return$oldpar)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/triax.abline.md b/reference/triax.abline.md new file mode 100644 index 0000000..df69c4a --- /dev/null +++ b/reference/triax.abline.md @@ -0,0 +1,72 @@ +# Lines for triangle plot + +Display lines on a triangle plot. + +## Usage + +``` r +triax.abline(b=NULL,r=NULL,l=NULL,col=par("col"),lty=par("lty"), + cc.axes=FALSE) +``` + +## Arguments + +- b: + + Lines relating to the bottom axis. + +- r: + + Lines relating to the right axis. + +- l: + + Lines relating to the left axis. + +- col: + + Color(s) of the lines. + +- lty: + + Type(s) of the lines. + +- cc.axes: + + Clockwise/counterclockwise axes and ticks. + +## Details + +`triax.abline` displays one or more lines on a triangle plot. Lines are +oriented in the conventional way, horizontal for the left axis, slanting +up to the right for the right axis and up to the left for the bottom +axis. If `cc.axes` is TRUE, the orientation is up-left for the left +axis, horizontal for the right axis and up-right for the bottom axis. + +Remember to call `triax.plot` with `no.add=FALSE` and restore the +graphics parameters as in the example or the lines will not be placed +properly. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[triax.plot](triax.plot.md) + +## Examples + +``` r + triax.return<-triax.plot(data.frame(bottom=0.4,right=0.3,left=0.3), + main="Triax ablines",no.add=FALSE) + triax.abline(l=0.3,col="red") + triax.abline(r=0.3,col="green") + triax.abline(b=0.4,col="blue") + + par(triax.return$oldpar) +``` diff --git a/reference/triax.fill-1.png b/reference/triax.fill-1.png new file mode 100644 index 0000000..2e82354 Binary files /dev/null and b/reference/triax.fill-1.png differ diff --git a/reference/triax.fill.html b/reference/triax.fill.html new file mode 100644 index 0000000..a558040 --- /dev/null +++ b/reference/triax.fill.html @@ -0,0 +1,113 @@ + +Triangle plot fill — triax.fill • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Fill a triangle plot with smaller triangles.

    +
    + +
    +

    Usage

    +
    triax.fill(col)
    +
    + +
    +

    Arguments

    +

    +
    col
    +

    List of colors (see Details).

    + +
    +
    +

    Details

    +

    In order for triax.fill to fill an existing plot that has + been created by a call to triax.plot, the user must supply + a list of fill colors. The first element of the list must begin with + at least one value that can be interpreted as a color. The second + element must begin with at least three such values, and so on, adding + two values for each element of the list. Each list element will be + displayed as a row of colored triangles starting at the top of the + plot. The number of elements in the list determines the number of + rows that will be displayed.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     # the data will be something like response at different proportions
    + fillval<-list(0,c(0,0.1,0),c(0,0.1,0.2,0.1,0),
    +  c(0,0.1,0.2,0.3,0.2,0.1,0),c(0,0.1,0.2,0.3,0.4,0.3,0.2,0.1,0),
    +  c(0,0.1,0.2,0.3,0.4,0.5,0.4,0.3,0.2,0.1,0),
    +  c(0,0,0.1,0.2,0.3,0.4,0.5,0.4,0.3,0.2,0.1,0,0),
    +  c(0,0,0,0.1,0.1,0.2,0.3,0.4,0.3,0.2,0.1,0.1,0,0,0))
    + # use some method of converting values to colors
    + fillcol<-sapply(fillval,function(x) {x*10+1} )
    + oldpar<-triax.plot(main="Test of triax.fill function")
    + triax.fill(fillcol)
    +
    + par(oldpar)
    +#> Warning: "xypos" is not a graphical parameter
    +#> Warning: "oldpar" is not a graphical parameter
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/triax.fill.md b/reference/triax.fill.md new file mode 100644 index 0000000..64452fa --- /dev/null +++ b/reference/triax.fill.md @@ -0,0 +1,57 @@ +# Triangle plot fill + +Fill a triangle plot with smaller triangles. + +## Usage + +``` r +triax.fill(col) +``` + +## Arguments + +- col: + + List of colors (see Details). + +## Details + +In order for `triax.fill` to fill an existing plot that has been created +by a call to `triax.plot`, the user must supply a list of fill colors. +The first element of the list must begin with at least one value that +can be interpreted as a color. The second element must begin with at +least three such values, and so on, adding two values for each element +of the list. Each list element will be displayed as a row of colored +triangles starting at the top of the plot. The number of elements in the +list determines the number of rows that will be displayed. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[triax.plot](triax.plot.md),[color.scale](color.scale.md) + +## Examples + +``` r + # the data will be something like response at different proportions + fillval<-list(0,c(0,0.1,0),c(0,0.1,0.2,0.1,0), + c(0,0.1,0.2,0.3,0.2,0.1,0),c(0,0.1,0.2,0.3,0.4,0.3,0.2,0.1,0), + c(0,0.1,0.2,0.3,0.4,0.5,0.4,0.3,0.2,0.1,0), + c(0,0,0.1,0.2,0.3,0.4,0.5,0.4,0.3,0.2,0.1,0,0), + c(0,0,0,0.1,0.1,0.2,0.3,0.4,0.3,0.2,0.1,0.1,0,0,0)) + # use some method of converting values to colors + fillcol<-sapply(fillval,function(x) {x*10+1} ) + oldpar<-triax.plot(main="Test of triax.fill function") + triax.fill(fillcol) + + par(oldpar) +#> Warning: "xypos" is not a graphical parameter +#> Warning: "oldpar" is not a graphical parameter +``` diff --git a/reference/triax.frame-1.png b/reference/triax.frame-1.png new file mode 100644 index 0000000..1653fea Binary files /dev/null and b/reference/triax.frame-1.png differ diff --git a/reference/triax.frame-2.png b/reference/triax.frame-2.png new file mode 100644 index 0000000..452393e Binary files /dev/null and b/reference/triax.frame-2.png differ diff --git a/reference/triax.frame.html b/reference/triax.frame.html new file mode 100644 index 0000000..f85cf8f --- /dev/null +++ b/reference/triax.frame.html @@ -0,0 +1,134 @@ + +Triangle plot frame — triax.frame • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display a three axis frame with optional grid.

    +
    + +
    +

    Usage

    +
    triax.frame(at=seq(0.1,0.9,by=0.1),axis.labels=NULL,
    + tick.labels=NULL,col.axis="black",cex.axis=1,cex.ticks=1,
    + align.labels=TRUE,show.grid=FALSE,col.grid="gray",lty.grid=par("lty"),
    + cc.axes=FALSE)
    +
    + +
    +

    Arguments

    +

    +
    at
    +

    The tick positions on the three axes.

    + +
    axis.labels
    +

    Labels for the three axes in the order bottom, right + left. Defaults to the column names.

    + +
    tick.labels
    +

    The tick labels for the axes. + Defaults to argument at (proportions).

    + +
    col.axis
    +

    Color of the triangular axes, ticks and labels.

    + +
    cex.axis
    +

    Character expansion for axis labels.

    + +
    cex.ticks
    +

    Character expansion for the tick labels.

    + +
    align.labels
    +

    Logical - whether to align axis and tick labels with + the axes.

    + +
    show.grid
    +

    Whether to display grid lines at the ticks.

    + +
    col.grid
    +

    Color of the grid lines. Defaults to gray.

    + +
    lty.grid
    +

    Type of line for the grid.

    + +
    cc.axes
    +

    Whether to align the axes clockwise or counterclockwise.

    + +
    +
    +

    Details

    +

    triax.frame displays a triangular plot area on which proportions + or percentages may be displayed. An optional grid may also be displayed. + If cc.axes is TRUE, both the axes and axis ticks will be in + reverse order.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + + +
    +

    Examples

    +
     triax.plot(main="DEFAULT")
    +
    + triax.plot(main="Clockwise axes",cc.axes=TRUE)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/triax.frame.md b/reference/triax.frame.md new file mode 100644 index 0000000..9012ca6 --- /dev/null +++ b/reference/triax.frame.md @@ -0,0 +1,86 @@ +# Triangle plot frame + +Display a three axis frame with optional grid. + +## Usage + +``` r +triax.frame(at=seq(0.1,0.9,by=0.1),axis.labels=NULL, + tick.labels=NULL,col.axis="black",cex.axis=1,cex.ticks=1, + align.labels=TRUE,show.grid=FALSE,col.grid="gray",lty.grid=par("lty"), + cc.axes=FALSE) +``` + +## Arguments + +- at: + + The tick positions on the three axes. + +- axis.labels: + + Labels for the three axes in the order bottom, right left. Defaults to + the column names. + +- tick.labels: + + The tick labels for the axes. Defaults to argument `at` (proportions). + +- col.axis: + + Color of the triangular axes, ticks and labels. + +- cex.axis: + + Character expansion for axis labels. + +- cex.ticks: + + Character expansion for the tick labels. + +- align.labels: + + Logical - whether to align axis and tick labels with the axes. + +- show.grid: + + Whether to display grid lines at the ticks. + +- col.grid: + + Color of the grid lines. Defaults to gray. + +- lty.grid: + + Type of line for the grid. + +- cc.axes: + + Whether to align the axes clockwise or counterclockwise. + +## Details + +`triax.frame` displays a triangular plot area on which proportions or +percentages may be displayed. An optional grid may also be displayed. If +`cc.axes` is TRUE, both the axes and axis ticks will be in reverse +order. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[triax.points](triax.points.md),[triax.abline](triax.abline.md),[triax.fill](triax.fill.md) + +## Examples + +``` r + triax.plot(main="DEFAULT") + + triax.plot(main="Clockwise axes",cc.axes=TRUE) +``` diff --git a/reference/triax.plot-1.png b/reference/triax.plot-1.png new file mode 100644 index 0000000..9aa4a17 Binary files /dev/null and b/reference/triax.plot-1.png differ diff --git a/reference/triax.plot-2.png b/reference/triax.plot-2.png new file mode 100644 index 0000000..02bc707 Binary files /dev/null and b/reference/triax.plot-2.png differ diff --git a/reference/triax.plot-3.png b/reference/triax.plot-3.png new file mode 100644 index 0000000..78e3a32 Binary files /dev/null and b/reference/triax.plot-3.png differ diff --git a/reference/triax.plot.html b/reference/triax.plot.html new file mode 100644 index 0000000..8e9c306 --- /dev/null +++ b/reference/triax.plot.html @@ -0,0 +1,195 @@ + +Triangle plot — triax.plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display a triangle plot with optional grid.

    +
    + +
    +

    Usage

    +
    triax.plot(x=NULL,main="",at=seq(0.1,0.9,by=0.1),
    + axis.labels=NULL,tick.labels=NULL,col.axis="black",cex.axis=1,
    + cex.ticks=1,
    + align.labels=TRUE,show.grid=FALSE,col.grid="gray",lty.grid=par("lty"),
    + cc.axes=FALSE,show.legend=FALSE,label.points=FALSE,point.labels=NULL,
    + col.symbols="black",pch=par("pch"),mar=c(5,2,4,2),no.add=TRUE,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    Matrix where each row is three proportions or percentages + that must sum to 1 or 100 respectively.

    + +
    main
    +

    The title of the triangle plot. Defaults to nothing.

    + +
    at
    +

    The tick positions on the three axes.

    + +
    axis.labels
    +

    Labels for the three axes in the order left, right, + bottom. Defaults to the column names.

    + +
    tick.labels
    +

    The tick labels for the three axes as a list with + three components l, r and b (left, right and bottom). + Defaults to argument at (proportions).

    + +
    col.axis
    +

    Color of the triangular axes, ticks and labels.

    + +
    cex.axis
    +

    Character expansion for axis labels.

    + +
    cex.ticks
    +

    Character expansion for the tick labels.

    + +
    align.labels
    +

    Logical - whether to align axis and tick labels with + the axes.

    + +
    show.grid
    +

    Whether to display grid lines at the ticks.

    + +
    col.grid
    +

    Color of the grid lines. Defaults to gray.

    + +
    lty.grid
    +

    Type of line for the grid.

    + +
    cc.axes
    +

    Whether axes and axis ticks should be clockwise or + counterclockwise.

    + +
    show.legend
    +

    Logical - whether to display a legend.

    + +
    label.points
    +

    Logical - whether to call thigmophobe.labels to + label the points.

    + +
    point.labels
    +

    Optional labels for the points and/or legend.

    + +
    col.symbols
    +

    Color of the symbols representing each value.

    + +
    pch
    +

    Symbols to use in plotting values.

    + +
    mar
    +

    Margins for the triangle plot.

    + +
    no.add
    +

    Whether to restore the previous plotting parameters + (TRUE) or leave them, allowing more points to be added.

    + +
    ...
    +

    Additional arguments passed to points.

    + +
    +
    +

    Details

    +

    triax.plot displays a triangular plot area on which proportions + or percentages are displayed. A grid or legend may also be displayed.

    +
    +
    +

    Note

    +

    A three axis plot can only properly display one or more + sets of three proportions that each sum to 1 (or percentages that sum + to 100). Other values may be scaled to proportions (or percentages), + but unless each set of three sums to 1 (or 100), they will not plot + properly and triax.points will complain appropriately. Note also + that triax.plot will only display properly in a square plot, + which is forced by par(pty="s").

    +

    In case the user does want to plot values with different sums, the + axis tick labels can be set to different ranges to accomodate this. + triax.points will still complain, but it will plot the values.

    +

    If planning to add points with triax.points call triax.plot + with no.add=FALSE and restore plotting parameters after the + points are added.

    +
    +
    +

    Value

    +

    A list containing xypos (the x,y positions plotted) + and oldpar (the plotting parameters at the time triax.plot + was called).

    +
    +
    +

    Author

    +

    Jim Lemon - thanks to Ben Daughtry for the info on counterclockwise axes.

    +
    + + +
    +

    Examples

    +
     data(soils)
    + triax.plot(soils[1:10,],main="DEFAULT")
    +
    + triax.plot(soils[1:10,],main="PERCENTAGES (Counterclockwise axes)",
    +  tick.labels=list(l=seq(10,90,by=10),r=seq(10,90,by=10),b=seq(10,90,by=10)),
    +  pch=3,cc.axes=TRUE)
    +
    + triax.return<-triax.plot(soils[1:6,],main="GRID AND LEGEND",
    +  show.grid=TRUE,show.legend=TRUE,col.symbols=1:6,pch=4)
    +
    + # triax.plot changes a few parameters
    + par(triax.return$oldpar)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/triax.plot.md b/reference/triax.plot.md new file mode 100644 index 0000000..8157703 --- /dev/null +++ b/reference/triax.plot.md @@ -0,0 +1,160 @@ +# Triangle plot + +Display a triangle plot with optional grid. + +## Usage + +``` r +triax.plot(x=NULL,main="",at=seq(0.1,0.9,by=0.1), + axis.labels=NULL,tick.labels=NULL,col.axis="black",cex.axis=1, + cex.ticks=1, + align.labels=TRUE,show.grid=FALSE,col.grid="gray",lty.grid=par("lty"), + cc.axes=FALSE,show.legend=FALSE,label.points=FALSE,point.labels=NULL, + col.symbols="black",pch=par("pch"),mar=c(5,2,4,2),no.add=TRUE,...) +``` + +## Arguments + +- x: + + Matrix where each row is three proportions or percentages that must + sum to 1 or 100 respectively. + +- main: + + The title of the triangle plot. Defaults to nothing. + +- at: + + The tick positions on the three axes. + +- axis.labels: + + Labels for the three axes in the order left, right, bottom. Defaults + to the column names. + +- tick.labels: + + The tick labels for the three axes as a list with three components l, + r and b (left, right and bottom). Defaults to argument `at` + (proportions). + +- col.axis: + + Color of the triangular axes, ticks and labels. + +- cex.axis: + + Character expansion for axis labels. + +- cex.ticks: + + Character expansion for the tick labels. + +- align.labels: + + Logical - whether to align axis and tick labels with the axes. + +- show.grid: + + Whether to display grid lines at the ticks. + +- col.grid: + + Color of the grid lines. Defaults to gray. + +- lty.grid: + + Type of line for the grid. + +- cc.axes: + + Whether axes and axis ticks should be clockwise or counterclockwise. + +- show.legend: + + Logical - whether to display a legend. + +- label.points: + + Logical - whether to call `thigmophobe.labels` to label the points. + +- point.labels: + + Optional labels for the points and/or legend. + +- col.symbols: + + Color of the symbols representing each value. + +- pch: + + Symbols to use in plotting values. + +- mar: + + Margins for the triangle plot. + +- no.add: + + Whether to restore the previous plotting parameters (`TRUE`) or leave + them, allowing more points to be added. + +- ...: + + Additional arguments passed to `points`. + +## Details + +`triax.plot` displays a triangular plot area on which proportions or +percentages are displayed. A grid or legend may also be displayed. + +## Note + +A three axis plot can only properly display one or more sets of three +proportions that each sum to 1 (or percentages that sum to 100). Other +values may be scaled to proportions (or percentages), but unless each +set of three sums to 1 (or 100), they will not plot properly and +`triax.points` will complain appropriately. Note also that `triax.plot` +will only display properly in a square plot, which is forced by +`par(pty="s")`. + +In case the user does want to plot values with different sums, the axis +tick labels can be set to different ranges to accomodate this. +`triax.points` will still complain, but it will plot the values. + +If planning to add points with `triax.points` call `triax.plot` with +`no.add=FALSE` and restore plotting parameters after the points are +added. + +## Value + +A list containing `xypos` (the `x,y` positions plotted) and `oldpar` +(the plotting parameters at the time `triax.plot` was called). + +## Author + +Jim Lemon - thanks to Ben Daughtry for the info on counterclockwise +axes. + +## See also + +[triax.points](triax.points.md), [triax.abline](triax.abline.md), +[thigmophobe.labels](thigmophobe.labels.md) + +## Examples + +``` r + data(soils) + triax.plot(soils[1:10,],main="DEFAULT") + + triax.plot(soils[1:10,],main="PERCENTAGES (Counterclockwise axes)", + tick.labels=list(l=seq(10,90,by=10),r=seq(10,90,by=10),b=seq(10,90,by=10)), + pch=3,cc.axes=TRUE) + + triax.return<-triax.plot(soils[1:6,],main="GRID AND LEGEND", + show.grid=TRUE,show.legend=TRUE,col.symbols=1:6,pch=4) + + # triax.plot changes a few parameters + par(triax.return$oldpar) +``` diff --git a/reference/triax.points-1.png b/reference/triax.points-1.png new file mode 100644 index 0000000..d96534d Binary files /dev/null and b/reference/triax.points-1.png differ diff --git a/reference/triax.points.html b/reference/triax.points.html new file mode 100644 index 0000000..ce780fe --- /dev/null +++ b/reference/triax.points.html @@ -0,0 +1,134 @@ + +Triangle plot points — triax.points • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display points on a triangle plot.

    +
    + +
    +

    Usage

    +
    triax.points(x,show.legend=FALSE,label.points=FALSE,
    + point.labels=NULL,col.symbols=par("fg"),pch=par("pch"),
    + bg.symbols=par("bg"),cc.axes=FALSE,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    Matrix or data frame where each row is three proportions or + percentages that must sum to 1 or 100 respectively.

    + +
    show.legend
    +

    Logical - whether to display a legend.

    + +
    label.points
    +

    Logical - whether to call thigmophobe.labels + to label the points.

    + +
    point.labels
    +

    Optional labels for the points and/or legend.

    + +
    col.symbols
    +

    Color of the symbols representing each value.

    + +
    pch
    +

    Symbols to use in plotting values.

    + +
    bg.symbols
    +

    Background color for plotting symbols.

    + +
    cc.axes
    +

    Clockwise or counterclockwise axes and ticks.

    + +
    ...
    +

    Additional arguments passed to points.

    + +
    +
    +

    Details

    +

    In order for triax.points to add points to an existing plot, + the argument no.add in the initial call to triax.plot + must be set to FALSE. Failing to do this will result in the + points being plotted in the wrong places. It is then up to the user + to call par as in the example below to restore plotting + parameters altered during the triangle plot.

    +

    triax.points displays each triplet of proportions or percentages + as a symbol on the triangle plot. Unless each triplet sums to 1 + (or 100), they will not plot properly and triax.points will + complain appropriately.

    +
    +
    +

    Value

    +

    A list of the x,y positions plotted.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + + +
    +

    Examples

    +
     data(soils)
    + triax.return<-triax.plot(soils[1:10,],
    +  main="Adding points to a triangle plot",no.add=FALSE)
    + triax.points(soils[11:20,],col.symbols="green",pch=3)
    +
    + par(triax.return$oldpar)
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/triax.points.md b/reference/triax.points.md new file mode 100644 index 0000000..322d595 --- /dev/null +++ b/reference/triax.points.md @@ -0,0 +1,87 @@ +# Triangle plot points + +Display points on a triangle plot. + +## Usage + +``` r +triax.points(x,show.legend=FALSE,label.points=FALSE, + point.labels=NULL,col.symbols=par("fg"),pch=par("pch"), + bg.symbols=par("bg"),cc.axes=FALSE,...) +``` + +## Arguments + +- x: + + Matrix or data frame where each row is three proportions or + percentages that must sum to 1 or 100 respectively. + +- show.legend: + + Logical - whether to display a legend. + +- label.points: + + Logical - whether to call `thigmophobe.labels` to label the points. + +- point.labels: + + Optional labels for the points and/or legend. + +- col.symbols: + + Color of the symbols representing each value. + +- pch: + + Symbols to use in plotting values. + +- bg.symbols: + + Background color for plotting symbols. + +- cc.axes: + + Clockwise or counterclockwise axes and ticks. + +- ...: + + Additional arguments passed to `points`. + +## Details + +In order for `triax.points` to add points to an existing plot, the +argument `no.add` in the initial call to `triax.plot` must be set to +`FALSE`. Failing to do this will result in the points being plotted in +the wrong places. It is then up to the user to call `par` as in the +example below to restore plotting parameters altered during the triangle +plot. + +`triax.points` displays each triplet of proportions or percentages as a +symbol on the triangle plot. Unless each triplet sums to 1 (or 100), +they will not plot properly and `triax.points` will complain +appropriately. + +## Value + +A list of the `x,y` positions plotted. + +## Author + +Jim Lemon + +## See also + +[triax.plot](triax.plot.md),[thigmophobe.labels](thigmophobe.labels.md) + +## Examples + +``` r + data(soils) + triax.return<-triax.plot(soils[1:10,], + main="Adding points to a triangle plot",no.add=FALSE) + triax.points(soils[11:20,],col.symbols="green",pch=3) + + par(triax.return$oldpar) +``` diff --git a/reference/tsxpos-1.png b/reference/tsxpos-1.png new file mode 100644 index 0000000..e5e00e4 Binary files /dev/null and b/reference/tsxpos-1.png differ diff --git a/reference/tsxpos.html b/reference/tsxpos.html new file mode 100644 index 0000000..584d4a1 --- /dev/null +++ b/reference/tsxpos.html @@ -0,0 +1,117 @@ + +Calculate equispaced x positions. — tsxpos • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Calculate equispaced x positions of values that have been + plotted with the plot command.

    +
    + +
    +

    Usage

    +
    tsxpos(x,xlim,nint)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A vector of numeric values or a time series object created with + the ts function.

    + +
    xlim
    +

    Explicit x limits for the x positions.

    + +
    nint
    +

    The number of intervals between x positions.

    + +
    +
    +

    Details

    +

    tsxpos calculates equispaced x positions for a vector of values or + a time series created with the ts command from the stats package. + It assumes that the default x limits have been used in the existing plot. It + adds the appropriate padding if par("xaxs") is "r". It is mainly useful + when x axis labels or some other markers are to be added to a time series plot.

    +

    A plot device must be open. If the user wishes to specify explicit x limits + or the number of intervals (not values), these will override the calculations + from the x values.

    +
    +
    +

    Value

    +

    The calculated x positions in user units.

    +
    +
    +

    Author

    +

    Jim Lemon (thanks to Prof J.C. Nash for the idea)

    +
    + +
    +

    Examples

    +
     # create a vector of numbers
    + y<-rnorm(28)
    + par(mfrow=c(2,1),mar=c(6,4,4,2))
    + plot(y,main="Plot of the values")
    + # convert it into a time series object
    + yt<-ts(y,start=2011,frequency=12)
    + # don't use the default axis
    + plot(yt,main="Plot of the time series",xaxt="n",xlab="Month")
    + labelpos<-tsxpos(yt)
    + # display an axis showing the months only
    + staxlab(1,labelpos,rep(month.abb,length.out=28))
    +
    + par(mfrow=c(1,1),mar=c(5,4,4,2))
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/tsxpos.md b/reference/tsxpos.md new file mode 100644 index 0000000..177b2b0 --- /dev/null +++ b/reference/tsxpos.md @@ -0,0 +1,64 @@ +# Calculate equispaced x positions. + +Calculate equispaced x positions of values that have been plotted with +the plot command. + +## Usage + +``` r +tsxpos(x,xlim,nint) +``` + +## Arguments + +- x: + + A vector of numeric values or a time series object created with the ts + function. + +- xlim: + + Explicit x limits for the x positions. + +- nint: + + The number of *intervals* between x positions. + +## Details + +`tsxpos` calculates equispaced x positions for a vector of values or a +time series created with the `ts` command from the stats package. It +assumes that the default x limits have been used in the existing plot. +It adds the appropriate padding if `par("xaxs")` is "r". It is mainly +useful when x axis labels or some other markers are to be added to a +time series plot. + +A plot device must be open. If the user wishes to specify explicit x +limits or the number of intervals (not values), these will override the +calculations from the x values. + +## Value + +The calculated x positions in user units. + +## Author + +Jim Lemon (thanks to Prof J.C. Nash for the idea) + +## Examples + +``` r + # create a vector of numbers + y<-rnorm(28) + par(mfrow=c(2,1),mar=c(6,4,4,2)) + plot(y,main="Plot of the values") + # convert it into a time series object + yt<-ts(y,start=2011,frequency=12) + # don't use the default axis + plot(yt,main="Plot of the time series",xaxt="n",xlab="Month") + labelpos<-tsxpos(yt) + # display an axis showing the months only + staxlab(1,labelpos,rep(month.abb,length.out=28)) + + par(mfrow=c(1,1),mar=c(5,4,4,2)) +``` diff --git a/reference/twoord.plot-1.png b/reference/twoord.plot-1.png new file mode 100644 index 0000000..6464874 Binary files /dev/null and b/reference/twoord.plot-1.png differ diff --git a/reference/twoord.plot-2.png b/reference/twoord.plot-2.png new file mode 100644 index 0000000..4fe39a3 Binary files /dev/null and b/reference/twoord.plot-2.png differ diff --git a/reference/twoord.plot-3.png b/reference/twoord.plot-3.png new file mode 100644 index 0000000..fec526d Binary files /dev/null and b/reference/twoord.plot-3.png differ diff --git a/reference/twoord.plot-4.png b/reference/twoord.plot-4.png new file mode 100644 index 0000000..376bbfd Binary files /dev/null and b/reference/twoord.plot-4.png differ diff --git a/reference/twoord.plot-5.png b/reference/twoord.plot-5.png new file mode 100644 index 0000000..ec2b055 Binary files /dev/null and b/reference/twoord.plot-5.png differ diff --git a/reference/twoord.plot.html b/reference/twoord.plot.html new file mode 100644 index 0000000..d989f83 --- /dev/null +++ b/reference/twoord.plot.html @@ -0,0 +1,259 @@ + +Plot with two ordinates — twoord.plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Two sets of values are displayed on the same plot with different ordinate + scales on the left and right.

    +
    + +
    +

    Usage

    +
    twoord.plot(lx,ly,rx,ry,data=NULL,main="",xlim=NULL,lylim=NULL,rylim=NULL,
    + mar=c(5,4,4,4),lcol=1,rcol=2,xlab="",lytickpos=NA,ylab="",ylab.at=NA,
    + rytickpos=NA,rylab="",rylab.at=NA,lpch=1,rpch=2,
    + type="b",xtickpos=NULL,xticklab=NULL,halfwidth=0.4,axislab.cex=1,
    + do.first=NULL,xaxt="s",...)
    +
    + +
    +

    Arguments

    +

    +
    lx,ly,rx,ry
    +

    y and optional x values for the plot

    + +
    data
    +

    an optional data frame from which to obtain the above values

    + +
    main
    +

    Title for the plot

    + +
    xlim
    +

    optional x limits as in plot

    + +
    lylim,rylim
    +

    optional y limits for the left and right axes + respectively

    + +
    mar
    +

    optional margin adjustment, defaults to c(5,4,4,4)

    + +
    lcol,rcol
    +

    colors to distinguish the two sets of values

    + +
    xlab
    +

    X axis label as in plot

    + +
    lytickpos
    +

    Optional positions for the left axis tick labels.

    + +
    ylab
    +

    Left Y axis label as in plot

    + +
    ylab.at
    +

    Optional position for the left Y axis label

    + +
    rytickpos
    +

    Optional positions for the right axis tick labels.

    + +
    rylab
    +

    Right Y axis label

    + +
    rylab.at
    +

    Optional position for the right Y axis label

    + +
    lpch,rpch
    +

    plot symbols to distinguish the two sets of values

    + +
    type
    +

    as in plot

    + +
    xtickpos
    +

    Optional positions for x-axis tick labels.

    + +
    xticklab
    +

    Optional labels for x-axis. Useful for things like dates.

    + +
    halfwidth
    +

    Half the width of the bars in user units. The bars are + centered on successive integers if no x values are supplied.

    + +
    axislab.cex
    +

    Character expansion for the axis labels and tick labels.

    + +
    do.first
    +

    Optional command(s) that will be executed immediately after + the blank plot is displayed.

    + +
    xaxt
    +

    Whether to display the x-axis - "n" = no.

    + +
    ...
    +

    additional arguments passed to plot and points.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    twoord.plot automates the process of displaying two sets of + values that have different ranges on the same plot. It is principally + useful in illustrating some relationship between the values across the + observations. It is assumed that the lx and rx values + are at least adjacent, and probably overlapping.

    +

    It is best to pass all the arguments lx, ly, rx, ry, but the + function will attempt to substitute sensible x values if one or two + are missing.

    +

    If at least one of the type arguments is "bar", bars will be plotted + instead of points or lines. It is best to plot the bars first (i.e. relative + to the left axis) if the other type is points or lines, as the bars will + usually obscure at least some of the points or lines. Using NA for the color + of the bars will partially correct this. If both types are to be bars, + remember to pass somewhat different x values or the bars will be overplotted.

    +

    Note that more values can be added to the plot using points or + lines, but remember that these will be plotted relative to the left + ordinate.

    +

    The do.first argument is useful for adding a background color or grid + to the plot as shown in the first two examples.

    +
    +
    +

    Note

    +

    There are many objections to the use of plots with two different + ordinate scales, and some of them are even sensible and supported by + controlled observation. Many of the objections rest on assertions that the + spatial arrangement of the values plotted will override all other + evidence. Here are two:

    +

    The viewer will assume that the vertical position of the data points + indicates a quantitative relationship.

    +

    To some extent. It is probably not a good idea to have the spatial + relationship of the points opposed to their numerical relationship. That + is to say, if one set of values is in the range of 0-10 and the other + 20-100, it is best to arrange the plot so that the latter values are + not plotted below the former. See the second example, which illustrates + a method for separating the two series and offsetting the axes.

    +

    The viewer will assume that an intersection of lines indicates an + intersection of values.

    +

    If the visual elements representing values can be arranged to avoid + intersections, so much the better. Many people have no trouble + distinguishing which visual elements are linked to which axis as long as + they are both coded similarly, usually with colors and/or symbols. In the + special case where there is an underlying relationship between the two + such as the probability of that value occurring under some conditions, it + may help to mark the point(s) where this occurs.

    +

    It may be useful to consider gap.plot or separate plots as an + alternative.

    +
    +
    +

    Author

    +

    Jim Lemon (thanks to Christophe Dutang for the idea of using bars + and lines in the same plot, Clair Crossupton for pointing out that + dates on the x-axis weren't very good, Jacob Kasper for the axis + character expansion and Ye Lin for finally motivating me to add the + do.first argument.)

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     xval1 <- seq.Date(as.Date("2017-01-02"),
    +  as.Date("2017-01-10"), by="day")
    + xval2 <- seq.Date(as.Date("2017-01-01"),
    +  as.Date("2017-01-15"), by="day")
    + going_up<-seq(3,7,by=0.5)+rnorm(9)
    + going_down<-rev(60:74)+rnorm(15)
    + twoord.plot(2:10,going_up,1:15,going_down,xlab="Sequence",
    +  ylab="Ascending values",rylab="Descending values",lcol=4,
    +  main="Plot with two ordinates - points and lines",
    +  do.first="plot_bg();grid(col=\"white\",lty=1)")
    + axis.Date(1,xval2)
    +
    + # now separate the lines
    + twoord.plot(2:10,going_up,1:15,going_down,xlab="Sequence",
    +  lylim=range(going_up)+c(-1,10),rylim=range(going_down)+c(-10,2),
    +  ylab="Ascending values",ylab.at=5,rylab="Descending values",
    +  rylab.at=65,lcol=4,main="Plot with two ordinates - separated lines",
    +  lytickpos=3:7,rytickpos=seq(55,75,by=5),
    +  do.first="plot_bg();grid(col=\"white\",lty=1)")
    +
    + twoord.plot(2:10,going_up,1:15,going_down,xlab="Sequence",
    +  lylim=range(going_up)+c(-1,10),rylim=range(going_down)+c(-10,2),
    +  type=c("bar","l"),ylab="Ascending values",ylab.at=5,
    +  rylab="Descending values",rylab.at=65,
    +  main="Bars on left axis, lines on right axis",
    +  lytickpos=3:7,rytickpos=seq(55,75,by=5),
    +  lcol=3,rcol=4,do.first="plot_bg()")
    +
    + twoord.plot(2:10,going_up,1:15,going_down,xlab="Sequence",
    +  lylim=c(-3,8),rylim=c(50,100),type=c("l","bar"),
    +  ylab="Ascending values",rylab="Descending values",
    +  lytickpos=3:7,rytickpos=seq(55,75,by=5),ylab.at=5,rylab.at=65,
    +  main="Lines on left axis, bars on right axis",
    +  lcol=3,rcol=4,do.first="plot_bg(\"yellow\")")
    +
    + # histogram with density curve superimposed
    + xhist<-hist(rnorm(100),plot=FALSE)
    + xdens<-dnorm(seq(-3,3,by=0.05))
    + twoord.plot(xhist$mids,xhist$counts,seq(-3,3,by=0.05),
    + xdens,type=c("bar","l"),lcol=4,rcol=2,ylab="Counts",
    + rylab="Density",main="Histogram and density curve",
    + halfwidth=0.2,lylim=c(0,max(xhist$counts)+1),rylim=c(0,0.45),lwd=2)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/twoord.plot.md b/reference/twoord.plot.md new file mode 100644 index 0000000..987f50b --- /dev/null +++ b/reference/twoord.plot.md @@ -0,0 +1,231 @@ +# Plot with two ordinates + +Two sets of values are displayed on the same plot with different +ordinate scales on the left and right. + +## Usage + +``` r +twoord.plot(lx,ly,rx,ry,data=NULL,main="",xlim=NULL,lylim=NULL,rylim=NULL, + mar=c(5,4,4,4),lcol=1,rcol=2,xlab="",lytickpos=NA,ylab="",ylab.at=NA, + rytickpos=NA,rylab="",rylab.at=NA,lpch=1,rpch=2, + type="b",xtickpos=NULL,xticklab=NULL,halfwidth=0.4,axislab.cex=1, + do.first=NULL,xaxt="s",...) +``` + +## Arguments + +- lx,ly,rx,ry: + + y and optional x values for the plot + +- data: + + an optional data frame from which to obtain the above values + +- main: + + Title for the plot + +- xlim: + + optional x limits as in `plot` + +- lylim,rylim: + + optional y limits for the left and right axes respectively + +- mar: + + optional margin adjustment, defaults to `c(5,4,4,4)` + +- lcol,rcol: + + colors to distinguish the two sets of values + +- xlab: + + X axis label as in `plot` + +- lytickpos: + + Optional positions for the left axis tick labels. + +- ylab: + + Left Y axis label as in `plot` + +- ylab.at: + + Optional position for the left Y axis label + +- rytickpos: + + Optional positions for the right axis tick labels. + +- rylab: + + Right Y axis label + +- rylab.at: + + Optional position for the right Y axis label + +- lpch,rpch: + + plot symbols to distinguish the two sets of values + +- type: + + as in `plot` + +- xtickpos: + + Optional positions for x-axis tick labels. + +- xticklab: + + Optional labels for x-axis. Useful for things like dates. + +- halfwidth: + + Half the width of the bars in user units. The bars are centered on + successive integers if no `x` values are supplied. + +- axislab.cex: + + Character expansion for the axis labels and tick labels. + +- do.first: + + Optional command(s) that will be executed immediately after the blank + plot is displayed. + +- xaxt: + + Whether to display the x-axis - "n" = no. + +- ...: + + additional arguments passed to `plot` and `points`. + +## Value + +nil + +## Details + +`twoord.plot` automates the process of displaying two sets of values +that have different ranges on the same plot. It is principally useful in +illustrating some relationship between the values across the +observations. It is assumed that the `lx` and `rx` values are at least +adjacent, and probably overlapping. + +It is best to pass all the arguments `lx, ly, rx, ry`, but the function +will attempt to substitute sensible x values if one or two are missing. + +If at least one of the `type` arguments is "bar", bars will be plotted +instead of points or lines. It is best to plot the bars first (i.e. +relative to the left axis) if the other type is points or lines, as the +bars will usually obscure at least some of the points or lines. Using NA +for the color of the bars will partially correct this. If both types are +to be bars, remember to pass somewhat different x values or the bars +will be overplotted. + +Note that more values can be added to the plot using `points` or +`lines`, but remember that these will be plotted relative to the left +ordinate. + +The `do.first` argument is useful for adding a background color or grid +to the plot as shown in the first two examples. + +## Note + +There are many objections to the use of plots with two different +ordinate scales, and some of them are even sensible and supported by +controlled observation. Many of the objections rest on assertions that +the spatial arrangement of the values plotted will override all other +evidence. Here are two: + +The viewer will assume that the vertical position of the data points +indicates a quantitative relationship. + +To some extent. It is probably not a good idea to have the spatial +relationship of the points opposed to their numerical relationship. That +is to say, if one set of values is in the range of 0-10 and the other +20-100, it is best to arrange the plot so that the latter values are not +plotted below the former. See the second example, which illustrates a +method for separating the two series and offsetting the axes. + +The viewer will assume that an intersection of lines indicates an +intersection of values. + +If the visual elements representing values can be arranged to avoid +intersections, so much the better. Many people have no trouble +distinguishing which visual elements are linked to which axis as long as +they are both coded similarly, usually with colors and/or symbols. In +the special case where there is an underlying relationship between the +two such as the probability of that value occurring under some +conditions, it may help to mark the point(s) where this occurs. + +It may be useful to consider `gap.plot` or separate plots as an +alternative. + +## Author + +Jim Lemon (thanks to Christophe Dutang for the idea of using bars and +lines in the same plot, Clair Crossupton for pointing out that dates on +the x-axis weren't very good, Jacob Kasper for the axis character +expansion and Ye Lin for finally motivating me to add the do.first +argument.) + +## See also + +[plot](https://rdrr.io/r/graphics/plot.default.html) + +## Examples + +``` r + xval1 <- seq.Date(as.Date("2017-01-02"), + as.Date("2017-01-10"), by="day") + xval2 <- seq.Date(as.Date("2017-01-01"), + as.Date("2017-01-15"), by="day") + going_up<-seq(3,7,by=0.5)+rnorm(9) + going_down<-rev(60:74)+rnorm(15) + twoord.plot(2:10,going_up,1:15,going_down,xlab="Sequence", + ylab="Ascending values",rylab="Descending values",lcol=4, + main="Plot with two ordinates - points and lines", + do.first="plot_bg();grid(col=\"white\",lty=1)") + axis.Date(1,xval2) + + # now separate the lines + twoord.plot(2:10,going_up,1:15,going_down,xlab="Sequence", + lylim=range(going_up)+c(-1,10),rylim=range(going_down)+c(-10,2), + ylab="Ascending values",ylab.at=5,rylab="Descending values", + rylab.at=65,lcol=4,main="Plot with two ordinates - separated lines", + lytickpos=3:7,rytickpos=seq(55,75,by=5), + do.first="plot_bg();grid(col=\"white\",lty=1)") + + twoord.plot(2:10,going_up,1:15,going_down,xlab="Sequence", + lylim=range(going_up)+c(-1,10),rylim=range(going_down)+c(-10,2), + type=c("bar","l"),ylab="Ascending values",ylab.at=5, + rylab="Descending values",rylab.at=65, + main="Bars on left axis, lines on right axis", + lytickpos=3:7,rytickpos=seq(55,75,by=5), + lcol=3,rcol=4,do.first="plot_bg()") + + twoord.plot(2:10,going_up,1:15,going_down,xlab="Sequence", + lylim=c(-3,8),rylim=c(50,100),type=c("l","bar"), + ylab="Ascending values",rylab="Descending values", + lytickpos=3:7,rytickpos=seq(55,75,by=5),ylab.at=5,rylab.at=65, + main="Lines on left axis, bars on right axis", + lcol=3,rcol=4,do.first="plot_bg(\"yellow\")") + + # histogram with density curve superimposed + xhist<-hist(rnorm(100),plot=FALSE) + xdens<-dnorm(seq(-3,3,by=0.05)) + twoord.plot(xhist$mids,xhist$counts,seq(-3,3,by=0.05), + xdens,type=c("bar","l"),lcol=4,rcol=2,ylab="Counts", + rylab="Density",main="Histogram and density curve", + halfwidth=0.2,lylim=c(0,max(xhist$counts)+1),rylim=c(0,0.45),lwd=2) +``` diff --git a/reference/twoord.stackplot-1.png b/reference/twoord.stackplot-1.png new file mode 100644 index 0000000..7abaef2 Binary files /dev/null and b/reference/twoord.stackplot-1.png differ diff --git a/reference/twoord.stackplot-2.png b/reference/twoord.stackplot-2.png new file mode 100644 index 0000000..329587e Binary files /dev/null and b/reference/twoord.stackplot-2.png differ diff --git a/reference/twoord.stackplot.html b/reference/twoord.stackplot.html new file mode 100644 index 0000000..8f05584 --- /dev/null +++ b/reference/twoord.stackplot.html @@ -0,0 +1,182 @@ + +Multiple (stack) plot with two ordinates — twoord.stackplot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Two set of data are plotted on two different ordinate scales.

    +
    + +
    +

    Usage

    +
    twoord.stackplot(lx, rx, ldata, rdata, lcol, rcol, ltype, rtype, 
    +  border, rylab, lylab, xlab, ..., incrylim=NULL,
    +  halfwidth=0.4, leftfront=FALSE, mar = c(5, 4, 4, 4))
    +
    + +
    +

    Arguments

    +

    +
    lx,rx
    +

    x-values for left/right data.

    + +
    ldata,rdata
    +

    data on the left/right y-axes.

    + +
    lcol, rcol
    +

    colors to be used for left/right data.

    + +
    ltype, rtype
    +

    line types to be used for left/right data, see details.

    + +
    border
    +

    color for the border of barplot

    + +
    rylab,lylab
    +

    labels for the left/right y-axes.

    + +
    xlab
    +

    labels for the x-axis.

    + +
    ...
    +

    further arguments to be passed to plot.

    + +
    incrylim
    +

    a number to increase the limits of y-axes.

    + +
    halfwidth
    +

    half the width of the bars in user units. + The bars are centered on successive integers if no x values are supplied

    + +
    leftfront
    +

    if TRUE, plot the left data on the front layer.

    + +
    mar
    +

    optional margin adjustment, defaults to c(5,4,4,4).

    + +
    +
    +

    Details

    +

    twoord.stackplot works in the same way as twoord.plot + on which it is heavily inspired. The functions let the user plot + multiple curve/point or bar plots on the same graph with two different axes. + The line type can be one of the following "l" for lines, + "p" for points, "b" for both points and line, + "o" for overplotted, "bar" for barplot.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    See also

    + +
    +
    +

    Author

    +

    Christophe Dutang

    +
    + +
    +

    Examples

    +
    # plot data
    +#
    +
    +time <- 0:25
    +
    +A <- 1+1/2*sin(time/2)
    +B <- A + rnorm(length(A), sd=1/10)
    +B <- B + rnorm(length(A), sd=1/10)
    +
    +sizeA <- floor(450*(1 + 1/4*sin(time/2+2))*(1+.1))
    +sizeB <- 1000-sizeA
    +
    +C <- (A*sizeA + B*sizeB)/(sizeA+sizeB)
    +
    +
    +#typical usage 
    +#
    +
    +twoord.stackplot(lx=time, rx=time, ldata=cbind(sizeA, sizeB), 
    +  rdata=cbind(A, B, C),  lcol=c("grey80", "white"), 
    +  rcol=c("blue", "red","black"), ltype="bar", rtype=c("l","p","o"), 
    +  border="grey80", lylab="Size", rylab="A,B,C", xlab="Time", 
    +  main="a plot", incrylim=2/100)
    +
    +#add a legend
    +#
    +
    +par(xpd=TRUE) #extend the area of plotting
    +par(new=TRUE) #to add new graph "layers"
    +plot(0:1, 0:1, type="n", xlab="",ylab="", axes=FALSE) #redo the x/y limits
    +
    +#first legend
    +legend(-0.18, 1.2, leg=c("Size A", "Size B"), fill=c("grey80", "white")) 
    +#second legend
    +legend(.97, -0.08, leg=c("A", "B", "C"), col=c("blue", "red","black"), 
    +  pch=c(NA, 19, 19), lty=c(1,NA,1)) 
    +
    +
    +par(xpd=FALSE, new=FALSE) #default setting
    +
    +
    +
    +#reverse the order of plotting
    +twoord.stackplot(lx=time, rx=time, ldata=cbind(sizeA, sizeB), 
    +  rdata=cbind(A, B, C),  lcol=c("grey80", "white"), 
    +  rcol=c("blue", "red","black"), ltype="bar", rtype=c("l","p","o"), 
    +  border="grey80", lylab="Size", rylab="A,B,C", xlab="Time", 
    +  main="a plot", incrylim=2/100, leftfront=TRUE)
    +
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/twoord.stackplot.md b/reference/twoord.stackplot.md new file mode 100644 index 0000000..7aa5b53 --- /dev/null +++ b/reference/twoord.stackplot.md @@ -0,0 +1,136 @@ +# Multiple (stack) plot with two ordinates + +Two set of data are plotted on two different ordinate scales. + +## Usage + +``` r +twoord.stackplot(lx, rx, ldata, rdata, lcol, rcol, ltype, rtype, + border, rylab, lylab, xlab, ..., incrylim=NULL, + halfwidth=0.4, leftfront=FALSE, mar = c(5, 4, 4, 4)) +``` + +## Arguments + +- lx,rx: + + x-values for left/right data. + +- ldata,rdata: + + data on the left/right y-axes. + +- lcol, rcol: + + colors to be used for left/right data. + +- ltype, rtype: + + line types to be used for left/right data, see details. + +- border: + + color for the border of barplot + +- rylab,lylab: + + labels for the left/right y-axes. + +- xlab: + + labels for the x-axis. + +- ...: + + further arguments to be passed to `plot`. + +- incrylim: + + a number to increase the limits of y-axes. + +- halfwidth: + + half the width of the bars in user units. The bars are centered on + successive integers if no x values are supplied + +- leftfront: + + if `TRUE`, plot the left data on the front layer. + +- mar: + + optional margin adjustment, defaults to c(5,4,4,4). + +## Details + +`twoord.stackplot` works in the same way as `twoord.plot` on which it is +heavily inspired. The functions let the user plot multiple curve/point +or bar plots on the same graph with two different axes. The line type +can be one of the following `"l"` for lines, `"p"` for points, `"b"` for +both points and line, `"o"` for overplotted, `"bar"` for barplot. + +## Value + +nil + +## See also + +[twoord.plot](twoord.plot.md) + +## Author + +Christophe Dutang + +## Examples + +``` r +# plot data +# + +time <- 0:25 + +A <- 1+1/2*sin(time/2) +B <- A + rnorm(length(A), sd=1/10) +B <- B + rnorm(length(A), sd=1/10) + +sizeA <- floor(450*(1 + 1/4*sin(time/2+2))*(1+.1)) +sizeB <- 1000-sizeA + +C <- (A*sizeA + B*sizeB)/(sizeA+sizeB) + + +#typical usage +# + +twoord.stackplot(lx=time, rx=time, ldata=cbind(sizeA, sizeB), + rdata=cbind(A, B, C), lcol=c("grey80", "white"), + rcol=c("blue", "red","black"), ltype="bar", rtype=c("l","p","o"), + border="grey80", lylab="Size", rylab="A,B,C", xlab="Time", + main="a plot", incrylim=2/100) + +#add a legend +# + +par(xpd=TRUE) #extend the area of plotting +par(new=TRUE) #to add new graph "layers" +plot(0:1, 0:1, type="n", xlab="",ylab="", axes=FALSE) #redo the x/y limits + +#first legend +legend(-0.18, 1.2, leg=c("Size A", "Size B"), fill=c("grey80", "white")) +#second legend +legend(.97, -0.08, leg=c("A", "B", "C"), col=c("blue", "red","black"), + pch=c(NA, 19, 19), lty=c(1,NA,1)) + + +par(xpd=FALSE, new=FALSE) #default setting + + + +#reverse the order of plotting +twoord.stackplot(lx=time, rx=time, ldata=cbind(sizeA, sizeB), + rdata=cbind(A, B, C), lcol=c("grey80", "white"), + rcol=c("blue", "red","black"), ltype="bar", rtype=c("l","p","o"), + border="grey80", lylab="Size", rylab="A,B,C", xlab="Time", + main="a plot", incrylim=2/100, leftfront=TRUE) + +``` diff --git a/reference/valid.n.html b/reference/valid.n.html new file mode 100644 index 0000000..0c4228c --- /dev/null +++ b/reference/valid.n.html @@ -0,0 +1,86 @@ + +Find the number of valid (not NA) values — valid.n • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Finds the number of valid (not NA) or total values in an object.

    +
    + +
    +

    Usage

    +
    valid.n(x,na.rm=TRUE)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    An object.

    + +
    na.rm
    +

    Whether to count all values (FALSE) or only those not NA.

    + +
    +
    +

    Details

    +

    valid.n finds the number of valid values of the object if na.rm=TRUE.

    +
    +
    +

    Value

    +

    The number of valid values or the length of the object.

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    + +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/valid.n.md b/reference/valid.n.md new file mode 100644 index 0000000..4390a1b --- /dev/null +++ b/reference/valid.n.md @@ -0,0 +1,32 @@ +# Find the number of valid (not NA) values + +Finds the number of valid (not NA) or total values in an object. + +## Usage + +``` r +valid.n(x,na.rm=TRUE) +``` + +## Arguments + +- x: + + An object. + +- na.rm: + + Whether to count all values (FALSE) or only those not NA. + +## Details + +`valid.n` finds the number of valid values of the object if +`na.rm=TRUE`. + +## Value + +The number of valid values or the length of the object. + +## Author + +Jim Lemon diff --git a/reference/vectorField-1.png b/reference/vectorField-1.png new file mode 100644 index 0000000..0c6d210 Binary files /dev/null and b/reference/vectorField-1.png differ diff --git a/reference/vectorField.html b/reference/vectorField.html new file mode 100644 index 0000000..4b479e3 --- /dev/null +++ b/reference/vectorField.html @@ -0,0 +1,145 @@ + +Display magnitude/direction vectors — vectorField • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display magnitude/direction vectors as arrows on an existing plot.

    +
    + +
    +

    Usage

    +
    vectorField(u,v,xpos=NA,ypos=NA,scale=1,headspan=0.1,
    + vecspec=c("lonlat","rad","deg"),col=par("fg"))
    +
    + +
    +

    Arguments

    +

    +
    u,v
    +

    x (longitude) and y (latitude) offsets OR + orientation and magnitude in either radians or degrees. See details.

    + +
    xpos,ypos
    +

    The centers of the vectors in user units.

    + +
    scale
    +

    The proportion of each cell that the maximal vector will fill. + See details.

    + +
    headspan
    +

    The extent of the heads of the arrows as a proportion of + cell size.

    + +
    vecspec
    +

    How the vectors are described. See details

    + +
    col
    +

    Color(s) for the arrows.

    + +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Details

    +

    vectorField displays arrows on an existing plot. Each arrow is specified + by a position on the plot xpos,ypos and either x/y offsets or + orientation and magnitude. The default is x/y offsets, and the user must + specify whether radians or degrees are used if the orientation/magnitude option + is used.

    +

    If the first four arguments are matrices, there must be no missing values. If + these arguments are vectors, the calculation of the scaling of the magnitudes + and length of the arrowheads may be slightly different.

    +
    +
    +

    Author

    +

    Jim Lemon (original code by Robin Hankin and Brian Ripley)

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     if (FALSE) { # \dontrun{
    +  # this requires the maps package, and just wouldn't pass check
    +  require(maps)
    +  map("world",xlim=c(110,155),ylim=c(-40,-10))
    +  par(xpd=TRUE)
    +  text(132,-5,"Approximate magnetic deviation - Australia",cex=1.5)
    +  par(xpd=FALSE)
    +  long<-rep(seq(117.5,152.5,by=5),6)
    +  lat<-rep(c(-12.5,-17.5,-22.5,-27.5,-32.5,-37.5),each=8)
    +  # just show the direction, don't have a magnitude difference
    +  mag<-rep(1,48)
    +  devdeg<-c(110,98,85,65,65,65,65,65,
    +   115,100,90,80,72,66,63,55,
    +   130,100,90,82,72,67,62,54,
    +   122,111,95,86,70,67,56,48,
    +   118,116,110,87,74,68,62,45,
    +   128,115,107,90,78,66,53,45)
    +  vectorField(devdeg,mag,long,lat,scale=0.7,vecspec="deg")
    + } # }
    + # do a magnitude/direction plot with radians
    + plot(1:10,type="n",main="Random vectors")
    + mag<-runif(100)+1
    + dir<-runif(100)*2*pi
    + xpos<-rep(1:10,10)
    + ypos<-rep(1:10,each=10)
    + vectorcol<-sample(colors(),100)
    + vectorField(dir,mag,xpos,ypos,scale=0.8,vecspec="rad",col=vectorcol)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/vectorField.md b/reference/vectorField.md new file mode 100644 index 0000000..07daae0 --- /dev/null +++ b/reference/vectorField.md @@ -0,0 +1,95 @@ +# Display magnitude/direction vectors + +Display magnitude/direction vectors as arrows on an existing plot. + +## Usage + +``` r +vectorField(u,v,xpos=NA,ypos=NA,scale=1,headspan=0.1, + vecspec=c("lonlat","rad","deg"),col=par("fg")) +``` + +## Arguments + +- u,v: + + x (longitude) and y (latitude) offsets OR orientation and magnitude in + either radians or degrees. See details. + +- xpos,ypos: + + The centers of the vectors in user units. + +- scale: + + The proportion of each cell that the maximal vector will fill. See + details. + +- headspan: + + The extent of the heads of the arrows as a proportion of cell size. + +- vecspec: + + How the vectors are described. See details + +- col: + + Color(s) for the arrows. + +## Value + +nil + +## Details + +`vectorField` displays arrows on an existing plot. Each arrow is +specified by a position on the plot `xpos,ypos` and either x/y offsets +or orientation and magnitude. The default is x/y offsets, and the user +must specify whether radians or degrees are used if the +orientation/magnitude option is used. + +If the first four arguments are matrices, there must be no missing +values. If these arguments are vectors, the calculation of the scaling +of the magnitudes and length of the arrowheads may be slightly +different. + +## Author + +Jim Lemon (original code by Robin Hankin and Brian Ripley) + +## See also + +[arrows](https://rdrr.io/r/graphics/arrows.html) + +## Examples + +``` r + if (FALSE) { # \dontrun{ + # this requires the maps package, and just wouldn't pass check + require(maps) + map("world",xlim=c(110,155),ylim=c(-40,-10)) + par(xpd=TRUE) + text(132,-5,"Approximate magnetic deviation - Australia",cex=1.5) + par(xpd=FALSE) + long<-rep(seq(117.5,152.5,by=5),6) + lat<-rep(c(-12.5,-17.5,-22.5,-27.5,-32.5,-37.5),each=8) + # just show the direction, don't have a magnitude difference + mag<-rep(1,48) + devdeg<-c(110,98,85,65,65,65,65,65, + 115,100,90,80,72,66,63,55, + 130,100,90,82,72,67,62,54, + 122,111,95,86,70,67,56,48, + 118,116,110,87,74,68,62,45, + 128,115,107,90,78,66,53,45) + vectorField(devdeg,mag,long,lat,scale=0.7,vecspec="deg") + } # } + # do a magnitude/direction plot with radians + plot(1:10,type="n",main="Random vectors") + mag<-runif(100)+1 + dir<-runif(100)*2*pi + xpos<-rep(1:10,10) + ypos<-rep(1:10,each=10) + vectorcol<-sample(colors(),100) + vectorField(dir,mag,xpos,ypos,scale=0.8,vecspec="rad",col=vectorcol) +``` diff --git a/reference/violin_plot-1.png b/reference/violin_plot-1.png new file mode 100644 index 0000000..43016ce Binary files /dev/null and b/reference/violin_plot-1.png differ diff --git a/reference/violin_plot-2.png b/reference/violin_plot-2.png new file mode 100644 index 0000000..cc06133 Binary files /dev/null and b/reference/violin_plot-2.png differ diff --git a/reference/violin_plot-3.png b/reference/violin_plot-3.png new file mode 100644 index 0000000..5953b10 Binary files /dev/null and b/reference/violin_plot-3.png differ diff --git a/reference/violin_plot.html b/reference/violin_plot.html new file mode 100644 index 0000000..002e070 --- /dev/null +++ b/reference/violin_plot.html @@ -0,0 +1,200 @@ + +Display a "violin" plot — violin_plot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Displays violin plots (rotated kernel density plots on each + side of boxplots).

    +
    + +
    +

    Usage

    +
    violin_plot(X=rnorm(50),at,add=FALSE,na.rm=TRUE,bw,violin_width,
    + violin_end_width=0.005,equal_width=TRUE,show_box=TRUE,box_width=0.01,
    + box_col="black",show_outliers=TRUE,outlier_pch=NA,range=1.5,xlim,ylim,
    + axes=TRUE,ann=TRUE,xlab="",ylab="",x_axis_labels,main="Violin Plot",
    + col="red",median_col="white",show_mean=FALSE,mean_pch=19,
    + mean_pch_col="yellow",...)
    +
    + +
    +

    Arguments

    +

    +
    X
    +

    A vector or matrix or data frame of numeric values.

    + +
    at
    +

    Horizontal position(s) for the violin plot(s).

    + +
    add
    +

    Whether this violin should be added to an existing plot.

    + +
    na.rm
    +

    Remove NA values. Passed to functions such as + boxplot or density.

    + +
    bw
    +

    Vector or bandwidth values for density. Will be + recycled. If not provided then will be calculated using bw.nrd0.

    + +
    violin_width
    +

    Multiplier to scale the width of the violin.

    + +
    violin_end_width
    +

    Multiplier to scale the width of the ends of the + violin.

    + +
    equal_width
    +

    Should all violin widths be equal?

    + +
    show_box
    +

    Whether to display the box.

    + +
    box_width
    +

    Multiplier for the width of internal boxes.

    + +
    box_col
    +

    Fill color for the internal rectangle.

    + +
    show_outliers
    +

    Whther to display outliers as points.

    + +
    outlier_pch
    +

    Symbol for displaying outliers.

    + +
    range
    +

    Passed to boxplot.

    + +
    xlim,ylim
    +

    Explicitly set the plot limits.

    + +
    axes
    +

    Logical value indicating whether both axes should be + drawn on the plot.

    + +
    ann
    +

    Annotate the plots with axis titles and overall titles.

    + +
    xlab,ylab
    +

    Labels for the X and Y axes.

    + +
    x_axis_labels
    +

    Labels for the violins.

    + +
    main
    +

    Title for the violin plot.

    + +
    col
    +

    Fill color for the violin(s). Will be recycled.

    + +
    median_col
    +

    Fill color for the median mark.

    + +
    show_mean
    +

    Whether to plot the mean as well as the median.

    + +
    mean_pch
    +

    Symbol to use for the mean.

    + +
    mean_pch_col
    +

    Fill color for the mean symbol.

    + +
    ...
    +

    Extra arguments passed to polygon used for + representing violin(s).

    + +
    +
    +

    Details

    +

    violin_plot displays one or more violin plots by drawing + rotated kernel density curves on each side of box plots.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Darshan Baral

    +
    + +
    +

    Examples

    +
     # plotting a data frame
    + violin_plot(mtcars)
    +
    +
    + set.seed(42)
    + normvar<-c(rnorm(49),-3)
    + unifvar<-runif(50,-2,2)
    + normvar2<-rnorm(45)
    +
    + # plotting a matrix
    + violin_plot(matrix(c(normvar,unifvar),ncol=2),
    +  main="Default Plot",x_axis_labels=c("Normal","Uniform"))
    +
    +
    + # plotting with different colors and with at specified
    + violin_plot(matrix(c(normvar,unifvar),ncol=2),at=1:3,
    +  main="Different colors and extra space",
    +  x_axis_labels=c("Normal","Uniform","Normal"),
    +  show_outliers=TRUE,col=c("blue","red"),median_col="lightgray",
    +  pch=6)
    +
    + # adding a violin to existing plot
    + violin_plot(normvar2,at=3,add=TRUE,col="green",violin_width=1)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/violin_plot.md b/reference/violin_plot.md new file mode 100644 index 0000000..7678d0f --- /dev/null +++ b/reference/violin_plot.md @@ -0,0 +1,164 @@ +# Display a "violin" plot + +Displays violin plots (rotated kernel density plots on each side of +boxplots). + +## Usage + +``` r +violin_plot(X=rnorm(50),at,add=FALSE,na.rm=TRUE,bw,violin_width, + violin_end_width=0.005,equal_width=TRUE,show_box=TRUE,box_width=0.01, + box_col="black",show_outliers=TRUE,outlier_pch=NA,range=1.5,xlim,ylim, + axes=TRUE,ann=TRUE,xlab="",ylab="",x_axis_labels,main="Violin Plot", + col="red",median_col="white",show_mean=FALSE,mean_pch=19, + mean_pch_col="yellow",...) +``` + +## Arguments + +- X: + + A vector or matrix or data frame of numeric values. + +- at: + + Horizontal position(s) for the violin plot(s). + +- add: + + Whether this violin should be added to an existing plot. + +- na.rm: + + Remove NA values. Passed to functions such as `boxplot` or `density`. + +- bw: + + Vector or bandwidth values for `density`. Will be recycled. If not + provided then will be calculated using `bw.nrd0`. + +- violin_width: + + Multiplier to scale the width of the `violin`. + +- violin_end_width: + + Multiplier to scale the width of the ends of the violin. + +- equal_width: + + Should all violin widths be equal? + +- show_box: + + Whether to display the box. + +- box_width: + + Multiplier for the width of internal boxes. + +- box_col: + + Fill color for the internal rectangle. + +- show_outliers: + + Whther to display outliers as points. + +- outlier_pch: + + Symbol for displaying outliers. + +- range: + + Passed to `boxplot`. + +- xlim,ylim: + + Explicitly set the plot limits. + +- axes: + + Logical value indicating whether both axes should be drawn on the + plot. + +- ann: + + Annotate the plots with axis titles and overall titles. + +- xlab,ylab: + + Labels for the X and Y axes. + +- x_axis_labels: + + Labels for the violins. + +- main: + + Title for the violin plot. + +- col: + + Fill color for the violin(s). Will be recycled. + +- median_col: + + Fill color for the median mark. + +- show_mean: + + Whether to plot the mean as well as the median. + +- mean_pch: + + Symbol to use for the mean. + +- mean_pch_col: + + Fill color for the mean symbol. + +- ...: + + Extra arguments passed to `polygon` used for representing violin(s). + +## Details + +`violin_plot` displays one or more violin plots by drawing rotated +kernel density curves on each side of box plots. + +## Value + +nil + +## Author + +Darshan Baral + +## Examples + +``` r + # plotting a data frame + violin_plot(mtcars) + + + set.seed(42) + normvar<-c(rnorm(49),-3) + unifvar<-runif(50,-2,2) + normvar2<-rnorm(45) + + # plotting a matrix + violin_plot(matrix(c(normvar,unifvar),ncol=2), + main="Default Plot",x_axis_labels=c("Normal","Uniform")) + + + # plotting with different colors and with at specified + violin_plot(matrix(c(normvar,unifvar),ncol=2),at=1:3, + main="Different colors and extra space", + x_axis_labels=c("Normal","Uniform","Normal"), + show_outliers=TRUE,col=c("blue","red"),median_col="lightgray", + pch=6) + + # adding a violin to existing plot + violin_plot(normvar2,at=3,add=TRUE,col="green",violin_width=1) +``` diff --git a/reference/weighted.hist-1.png b/reference/weighted.hist-1.png new file mode 100644 index 0000000..8ef2ce5 Binary files /dev/null and b/reference/weighted.hist-1.png differ diff --git a/reference/weighted.hist.html b/reference/weighted.hist.html new file mode 100644 index 0000000..fc5f033 --- /dev/null +++ b/reference/weighted.hist.html @@ -0,0 +1,141 @@ + +Display a weighted histogram — weighted.hist • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Calculate the counts of the weighted values in specified bins and + optionally display either a frequency or density histogram.

    +
    + +
    +

    Usage

    +
    weighted.hist(x,w,breaks="Sturges",col=NULL,plot=TRUE,
    + freq=TRUE,ylim=NA,ylab=NULL,xaxis=TRUE,...)
    +
    + +
    +

    Arguments

    +

    +
    x
    +

    A vector of numeric values

    + +
    w
    +

    A vector of weights at least as long as x.

    + +
    breaks
    +

    The endpoints of the ranges into which to count the weighted + values.

    + +
    col
    +

    An optional vector of colors for the bars of the histogram.

    + +
    plot
    +

    Whether to plot a histogram.

    + +
    freq
    +

    Whether to plot counts or densities.

    + +
    ylim
    +

    The limits of the plot ordinate.

    + +
    ylab
    +

    Label for the ordinate.

    + +
    xaxis
    +

    Whether to display an X axis.

    + +
    ...
    +

    additional arguments passed to barplot.

    + +
    +
    +

    Details

    +

    weighted.hist calculates the weighted counts of values falling + into the ranges specified by breaks. Instead of counting each + value as 1, it counts the corresponding value in w (the weight).

    +

    breaks may be specified by a monotonically increasing vector + of numbers that are interpreted as the endpoints of the ranges, a + single number representing the number of ranges desired or the name + of the function to calculate the ranges (see hist). + If a vector of numbers is passed that does not include all values in + x, the user is warned.

    +
    +
    +

    Value

    +

    A list containing:

    +

    breaks - The endpoints of the intervals

    +

    counts - The weighted counts

    +

    density - The weighted counts divided by their sum.

    +

    mids - The midpoints of the intervals and the bars displayed.

    +

    xname - the name of x.

    +
    +
    +

    Author

    +

    Jim Lemon and Hadley Wickham - thanks to Ben Graf for asking for a + custom x axis option and Martin Maechler for fixing the barplot problem

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     testx<-sample(1:10,300,TRUE)
    + testw<-seq(1,4,by=0.01)
    + weighted.hist(testx,testw,breaks=1:10,main="Test weighted histogram")
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/weighted.hist.md b/reference/weighted.hist.md new file mode 100644 index 0000000..bd9076b --- /dev/null +++ b/reference/weighted.hist.md @@ -0,0 +1,97 @@ +# Display a weighted histogram + +Calculate the counts of the weighted values in specified bins and +optionally display either a frequency or density histogram. + +## Usage + +``` r +weighted.hist(x,w,breaks="Sturges",col=NULL,plot=TRUE, + freq=TRUE,ylim=NA,ylab=NULL,xaxis=TRUE,...) +``` + +## Arguments + +- x: + + A vector of numeric values + +- w: + + A vector of weights at least as long as x. + +- breaks: + + The endpoints of the ranges into which to count the weighted values. + +- col: + + An optional vector of colors for the bars of the histogram. + +- plot: + + Whether to plot a histogram. + +- freq: + + Whether to plot counts or densities. + +- ylim: + + The limits of the plot ordinate. + +- ylab: + + Label for the ordinate. + +- xaxis: + + Whether to display an X axis. + +- ...: + + additional arguments passed to `barplot`. + +## Details + +`weighted.hist` calculates the weighted counts of values falling into +the ranges specified by `breaks`. Instead of counting each value as 1, +it counts the corresponding value in `w` (the weight). + +`breaks` may be specified by a monotonically increasing vector of +numbers that are interpreted as the endpoints of the ranges, a single +number representing the number of ranges desired or the name of the +function to calculate the ranges (see +[hist](https://rdrr.io/r/graphics/hist.html)). If a vector of numbers is +passed that does not include all values in `x`, the user is warned. + +## Value + +A list containing: + +breaks - The endpoints of the intervals + +counts - The weighted counts + +density - The weighted counts divided by their sum. + +mids - The midpoints of the intervals and the bars displayed. + +xname - the name of `x`. + +## Author + +Jim Lemon and Hadley Wickham - thanks to Ben Graf for asking for a +custom x axis option and Martin Maechler for fixing the barplot problem + +## See also + +[hist](https://rdrr.io/r/graphics/hist.html) + +## Examples + +``` r + testx<-sample(1:10,300,TRUE) + testw<-seq(1,4,by=0.01) + weighted.hist(testx,testw,breaks=1:10,main="Test weighted histogram") +``` diff --git a/reference/zoomInPlot-1.png b/reference/zoomInPlot-1.png new file mode 100644 index 0000000..3ec9199 Binary files /dev/null and b/reference/zoomInPlot-1.png differ diff --git a/reference/zoomInPlot.html b/reference/zoomInPlot.html new file mode 100644 index 0000000..2e41555 --- /dev/null +++ b/reference/zoomInPlot.html @@ -0,0 +1,126 @@ + +Display a plot with a rectangular section expanded in an adjacent plot — zoomInPlot • plotrix + Skip to contents + + +
    +
    +
    + +
    +

    Display one plot on the left half of a device and an expanded section of that + plot on the right half of the device with connecting lines showing the expansion.

    +
    + +
    +

    Usage

    +
    zoomInPlot(x,y=NULL,xlim=NULL,ylim=NULL,rxlim=xlim,rylim=ylim,xend=NA,
    +  zoomtitle=NULL,titlepos=NA,...)
    +
    + +
    +

    Arguments

    +

    +
    x,y
    +

    numeric data vectors. If y is not specified, it is set equal + to x and x is set to 1:length(y).

    + +
    xlim,ylim
    +

    Limits for the initial plot.

    + +
    rxlim,rylim
    +

    Limits for the expanded plot. These must be within the above.

    + +
    xend
    +

    Where to end the segments that indicate the expansion. Defaults to + just left of the tick labels on the left ordinate.

    + +
    zoomtitle
    +

    The title of the plot, display in the top center.

    + +
    titlepos
    +

    The horizontal position of the title in user units of the + zoomed plot.

    + +
    ...
    +

    additional arguments passed to plot.

    + +
    +
    +

    Details

    +

    zoomInPlot sets up a two column layout in the current device and calls + plot to display a plot in the left column. It then draws a rectangle + corresponding to the rxlim and rylim arguments and displays a + second plot of that rectangle in the right column. It is currently very simple + and will probably become more flexible in future versions.

    +

    It just has. If rxlim is set to NA, locator will be called and + the user can define the zoomed rectangle by clicking on each corner. This is a + shameless ripoff of a suggestion by Greg Snow on the help list. Thanks, Greg.

    +
    +
    +

    Value

    +

    nil

    +
    +
    +

    Author

    +

    Jim Lemon

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
     zoomInPlot(rnorm(100),rnorm(100),rxlim=c(-1,1),rylim=c(-1,1),
    +  zoomtitle="Zoom In Plot",titlepos=-1.5)
    +
    +
    +
    +
    + + +
    + + + +
    + + + + + + + diff --git a/reference/zoomInPlot.md b/reference/zoomInPlot.md new file mode 100644 index 0000000..c589b24 --- /dev/null +++ b/reference/zoomInPlot.md @@ -0,0 +1,76 @@ +# Display a plot with a rectangular section expanded in an adjacent plot + +Display one plot on the left half of a device and an expanded section of +that plot on the right half of the device with connecting lines showing +the expansion. + +## Usage + +``` r +zoomInPlot(x,y=NULL,xlim=NULL,ylim=NULL,rxlim=xlim,rylim=ylim,xend=NA, + zoomtitle=NULL,titlepos=NA,...) +``` + +## Arguments + +- x,y: + + numeric data vectors. If `y` is not specified, it is set equal to `x` + and `x` is set to `1:length(y)`. + +- xlim,ylim: + + Limits for the initial plot. + +- rxlim,rylim: + + Limits for the expanded plot. These must be within the above. + +- xend: + + Where to end the segments that indicate the expansion. Defaults to + just left of the tick labels on the left ordinate. + +- zoomtitle: + + The title of the plot, display in the top center. + +- titlepos: + + The horizontal position of the title in user units of the zoomed plot. + +- ...: + + additional arguments passed to `plot`. + +## Details + +`zoomInPlot` sets up a two column layout in the current device and calls +`plot` to display a plot in the left column. It then draws a rectangle +corresponding to the `rxlim` and `rylim` arguments and displays a second +plot of that rectangle in the right column. It is currently very simple +and will probably become more flexible in future versions. + +It just has. If `rxlim` is set to NA, `locator` will be called and the +user can define the zoomed rectangle by clicking on each corner. This is +a shameless ripoff of a suggestion by Greg Snow on the help list. +Thanks, Greg. + +## Value + +nil + +## Author + +Jim Lemon + +## See also + +[plot](https://rdrr.io/r/graphics/plot.default.html) + +## Examples + +``` r + zoomInPlot(rnorm(100),rnorm(100),rxlim=c(-1,1),rylim=c(-1,1), + zoomtitle="Zoom In Plot",titlepos=-1.5) +``` diff --git a/search.json b/search.json new file mode 100644 index 0000000..31e12aa --- /dev/null +++ b/search.json @@ -0,0 +1 @@ +[{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Jim Lemon. Author. Ben Bolker. Contributor. Sander Oom. Contributor. Eduardo Klein. Contributor. Barry Rowlingson. Contributor. Hadley Wickham. Contributor. Anupam Tyagi. Contributor. Olivier Eterradossi. Contributor. Gabor Grothendieck. Contributor. Michael Toews. Contributor. John Kane. Contributor. Rolf Turner. Contributor. Carl Witthoft. Contributor. Julian Stander. Contributor. Thomas Petzoldt. Contributor. Remko Duursma. Contributor. Elisa Biancotto. Contributor. Ofir Levy. Contributor. Christophe Dutang. Contributor. Peter Solymos. Contributor. Robby Engelmann. Contributor. Michael Hecker. Contributor. Felix Steinbeck. Contributor. Hans Borchers. Contributor. Henrik Singmann. Contributor. Ted Toal. Contributor. Derek Ogle. Contributor. Darshan Baral. Contributor. Ulrike Groemping. Contributor. Bill Venables. Contributor. CRAN Team. Contributor. Duncan Murdoch. Contributor, maintainer.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Lemon, J. (2006) Plotrix: package red light district R. R-News, 6(4): 8-12.","code":"@Article{, year = {2006}, title = {Plotrix: a package in the red light district of R}, journal = {R-News}, volume = {6}, number = {4}, pages = {8-12}, author = {Lemon J}, }"},{"path":"/index.html","id":"plotrix","dir":"","previous_headings":"","what":"Various Plotting Functions","title":"Various Plotting Functions","text":"plotrix R package provides many plotting, labeling, axis & color scaling functions.","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Various Plotting Functions","text":"can install current release plotrix CRAN : can install development version plotrix GitHub :","code":"install.packages(\"plotrix\") # install.packages(\"devtools\") devtools::install_github(\"plotrix/plotrix\")"},{"path":"/index.html","id":"authors","dir":"","previous_headings":"","what":"Authors","title":"Various Plotting Functions","text":"original author maintainer plotrix, Jim Lemon, passed away September 2023. Currently maintained Duncan Murdoch. Please submit bug reports https://github.com/plotrix/plotrix/issues. contributors include: Ben Bolker [ctb], Sander Oom [ctb], Eduardo Klein [ctb], Barry Rowlingson [ctb], Hadley Wickham [ctb], Anupam Tyagi [ctb], Olivier Eterradossi [ctb], Gabor Grothendieck [ctb], Michael Toews [ctb], John Kane [ctb], Rolf Turner [ctb], Carl Witthoft [ctb], Julian Stander [ctb], Thomas Petzoldt [ctb], Remko Duursma [ctb], Elisa Biancotto [ctb], Ofir Levy [ctb], Christophe Dutang [ctb], Peter Solymos [ctb], Robby Engelmann [ctb], Michael Hecker [ctb], Felix Steinbeck [ctb], Hans Borchers [ctb], Henrik Singmann [ctb], Ted Toal [ctb], Derek Ogle [ctb], Darshan Baral [ctb], Ulrike Groemping [ctb], Bill Venables [ctb], CRAN Team [ctb].","code":""},{"path":"/reference/ablineclip.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a straight line to a plot — ablineclip","title":"Add a straight line to a plot — ablineclip","text":"abline, arguments x1,x2,y1,y2 clip.","code":""},{"path":"/reference/ablineclip.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a straight line to a plot — ablineclip","text":"","code":"ablineclip(a=NULL,b=NULL,h=NULL,v=NULL,reg=NULL,coef=NULL,untf=FALSE, x1=NULL,x2=NULL,y1=NULL,y2=NULL,...)"},{"path":"/reference/ablineclip.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a straight line to a plot — ablineclip","text":"Intercept. b Slope. h y-value(s) horizontal line(s). v x-value(s) vertical line(s). reg Fitted lm object. coef Coefficients, typically intercept slope. untf plot log coordinates, see abline. x1,x2,y1,y2 Clipping limits, see clip. ... arguments passed abline.","code":""},{"path":"/reference/ablineclip.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a straight line to a plot — ablineclip","text":"ablineclip sets new clipping region calls abline. four clipping limits NULL, values par(\"usr\") substituted. call abline, old clipping region restored. order make clip work, call abline draws line plot. Multiple lines type can drawn single call, clipping region must group lines. Thanks Berry Boessenkool pointing .","code":""},{"path":"/reference/ablineclip.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a straight line to a plot — ablineclip","text":"None. Adds current plot.","code":""},{"path":"/reference/ablineclip.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add a straight line to a plot — ablineclip","text":"Remko Duursma","code":""},{"path":[]},{"path":"/reference/ablineclip.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a straight line to a plot — ablineclip","text":"","code":"x <- rnorm(100) y <- x + rnorm(100) lmfit <- lm(y~x) plot(x, y, xlim=c(-3.5, 3.5)) ablineclip(lmfit, x1 = -2, x2 = 2, lty = 2) ablineclip(h = 0, x1 = -2,x2 = 2,lty = 3, col = \"red\") ablineclip(v = 0, y1 = -2.5, y2 = 1.5, lty=4, col = \"green\")"},{"path":"/reference/add.ps.html","id":null,"dir":"Reference","previous_headings":"","what":"add p-values from t-tests — add.ps","title":"add p-values from t-tests — add.ps","text":"Adds p-values comparing different cells x-axis position reference cell. Uses syntax similar raw.means.plot2.","code":""},{"path":"/reference/add.ps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"add p-values from t-tests — add.ps","text":"","code":"add.ps(data, col.id, col.offset, col.x, col.value, fun.aggregate = \"mean\", ref.offset = 1, prefixes,alternative = c(\"two.sided\", \"less\", \"greater\"), mu = 0, paired = FALSE, var.equal = FALSE, lty = 0, ...)"},{"path":"/reference/add.ps.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"add p-values from t-tests — add.ps","text":"data data.frame col.id character vector specifying id column. col.offset character vector specifying offset column. col.x character vector specifying x-axis column. col.value character vector specifying data column. fun.aggregate Function function name used aggregating results. Default \"mean\". ref.offset Scalar numeric indicating reference level tested . default 1 corresponding levels(factor(d[,col.offset]))[1]. prefixes character vector indices p-values. missing corresponds levels(factor(d.new[,col.offset]))[-ref.offset]. alternative t.test mu t.test paired t.test var.equal t.test lty line type axis, Default 0 (.e., line). ... arguments passed axis.","code":""},{"path":"/reference/add.ps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"add p-values from t-tests — add.ps","text":"function computes t-tests comparing values x-axis position condition reference condition adds p-values axis. functions uses syntax raw.means.plot2 used addition . Note values ordered according col.id paired = TRUE fine.","code":""},{"path":"/reference/add.ps.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"add p-values from t-tests — add.ps","text":"axis plotted.","code":""},{"path":"/reference/add.ps.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"add p-values from t-tests — add.ps","text":"Henrik Singmann","code":""},{"path":[]},{"path":"/reference/add.ps.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"add p-values from t-tests — add.ps","text":"","code":"if (FALSE) { # \\dontrun{ #The examples uses the OBrienKaiser dataset from car and needs reshape. # This extends the examples from raw.means.plot require(reshape) require(car) data(OBrienKaiser) OBKnew <- cbind(factor(1:nrow(OBrienKaiser)), OBrienKaiser) colnames(OBKnew)[1] <- \"id\" OBK.long <- melt(OBKnew) OBK.long[, c(\"measurement\", \"time\")] <- t(vapply(strsplit(as.character(OBK.long$variable), \"\\\\.\"), \"[\", c(\"\", \"\"))) # For this example the position at each x-axis are within-subject comparisons! raw.means.plot2(OBK.long, \"id\", \"measurement\", \"gender\", \"value\") add.ps(OBK.long, \"id\", \"measurement\", \"gender\", \"value\", paired = TRUE) #reference is \"fup\" raw.means.plot2(OBK.long, \"id\", \"measurement\", \"gender\", \"value\") add.ps(OBK.long, \"id\", \"measurement\", \"gender\", \"value\", ref.offset = 2, paired = TRUE) #reference is \"post\" # Use R's standard (i.e., Welch test) raw.means.plot2(OBK.long, \"id\", \"treatment\", \"gender\", \"value\") add.ps(OBK.long, \"id\", \"treatment\", \"gender\", \"value\", prefixes = c(\"p(control vs. A)\", \"p(control vs. B)\")) # Use standard t-test raw.means.plot2(OBK.long, \"id\", \"treatment\", \"gender\", \"value\") add.ps(OBK.long, \"id\", \"treatment\", \"gender\", \"value\", var.equal = TRUE, prefixes = c(\"p(control vs. A)\", \"p(control vs. B)\")) } # }"},{"path":"/reference/addtable2plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a table of values to a plot — addtable2plot","title":"Add a table of values to a plot — addtable2plot","text":"Displays table values user-specified position existing plot","code":""},{"path":"/reference/addtable2plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a table of values to a plot — addtable2plot","text":"","code":"addtable2plot(x,y=NULL,table,lwd=par(\"lwd\"),bty=\"n\",bg=par(\"bg\"), cex=1,xjust=0,yjust=1,xpad=0.1,ypad=0.5,box.col=par(\"fg\"),text.col=par(\"fg\"), display.colnames=TRUE,display.rownames=FALSE,hlines=FALSE,vlines=FALSE, title=NULL)"},{"path":"/reference/addtable2plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a table of values to a plot — addtable2plot","text":"x,y Either x y coordinates locate table xy.coords object. table data frame, matrix similar object displayed. lwd line width box horizontal dividers. bty Whether draw box around table (\"o\") (\"n\"). bg background color table. cex Character expansion table. xjust,yjust Positioning table relative x,y. xpad,ypad amount padding around text cells proportion maximum width height strings column. box.col color box lines. text.col color text. display.colnames Whether display column names table. display.rownames Whether display row names table. hlines Whether draw horizontal lines row table. vlines Whether draw vertical lines column table. title Optional title placed table.","code":""},{"path":"/reference/addtable2plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a table of values to a plot — addtable2plot","text":"nil","code":""},{"path":"/reference/addtable2plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a table of values to a plot — addtable2plot","text":"addtable2plot displays values table position user coordinates specified x,y. two justification arguments, xjust yjust legend function, addtable2plot programmed similar legend possible. function now accepts positional arguments \"topright\" passed x. defaults popular scientific journals time programming. bg matrix colors dimensions x, colors backgrounds cells. default background color.","code":""},{"path":"/reference/addtable2plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add a table of values to a plot — addtable2plot","text":"Original John Kane, mods Jim Lemon Brian Diggs. Thanks Andrija Djurovic asking individual cell colors Gabor Grothendieck alerting problem widely varying column widths.","code":""},{"path":[]},{"path":"/reference/addtable2plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a table of values to a plot — addtable2plot","text":"","code":"testdf <- data.frame(Before = c(10, 7, 5, 9), During = c(8, 6, 2, 5), After = c(5, 3, 4, 3)) rownames(testdf) <- c(\"Red\", \"Green\", \"Blue\", \"Lightblue\") barp(testdf, main = \"Test addtable2plot\", ylab = \"Value\", names.arg = colnames(testdf), col = 2:5) # show most of the options including the christmas tree colors abg <- matrix(c(2, 3, 5, 6, 7, 8), nrow=4, ncol=3) addtable2plot(2, 8, testdf, bty = \"o\", display.rownames = TRUE, hlines = TRUE, vlines = TRUE, title = \"The table\", bg = abg)"},{"path":"/reference/arctext.html","id":null,"dir":"Reference","previous_headings":"","what":"Display text on a circular arc — arctext","title":"Display text on a circular arc — arctext","text":"Displays character string circumference imaginary circle existing plot.","code":""},{"path":"/reference/arctext.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display text on a circular arc — arctext","text":"","code":"arctext(x,center=c(0,0),radius=1,start=NULL,middle=pi/2,end=NULL,stretch=1, clockwise=TRUE,cex=NULL,...)"},{"path":"/reference/arctext.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display text on a circular arc — arctext","text":"x character string. center center circular arc x/y user units. radius radius arc user units. start starting position string radians. middle middle position string radians. end end position string radians. stretch much stretch string appearance. clockwise Whether print string clockwise direction. cex character expansion factor. ... additional arguments passed text.","code":""},{"path":"/reference/arctext.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display text on a circular arc — arctext","text":"arctext displays string along circular arc, rotating letter. may work devices, graphic devices can rotate text arbitrary angles. output looks best Postscript similar device can rotate text without distortion. Rotated text often looks ragged small bitmaps. user passes value start, override value passed middle. plot area square, see par(pty=\"s\"), arc somewhat elliptical. clockwise argument TRUE, string displayed clockwise direction orientation characters rotated pi radians (180 degrees). useful string displayed bottom circumference.","code":""},{"path":"/reference/arctext.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display text on a circular arc — arctext","text":"nil","code":""},{"path":"/reference/arctext.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display text on a circular arc — arctext","text":"Jim Lemon - Thanks Suhas Parandekar idea, Ted Toal greatly improving placement text Andy South providing initial code clockwise argument.","code":""},{"path":[]},{"path":"/reference/arctext.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display text on a circular arc — arctext","text":"","code":"plot(0, xlim = c(1, 5),ylim = c(1, 5),main = \"Test of arctext\", xlab = \"\", ylab = \"\", type = \"n\") arctext(\"bendy like spaghetti\", center = c(3,3), col = \"blue\") arctext(\"bendy like spaghetti\", center = c(3,3), radius = 1.5, start = pi, cex = 2) arctext(\"bendy like spaghetti\", center = c(3, 3),radius = 0.5, start = pi/2, stretch = 1.2) arctext(\"bendy like spaghetti\", center = c(3, 3), radius = 1.7, start = 4 * pi / 3, cex = 1.3, clockwise = FALSE)"},{"path":"/reference/axis.break.html","id":null,"dir":"Reference","previous_headings":"","what":"Place a ","title":"Place a ","text":"Places \"break\" mark axis existing plot.","code":""},{"path":"/reference/axis.break.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Place a ","text":"","code":"axis.break(axis=1,breakpos=NULL,pos=NULL,bgcol=\"white\",breakcol=\"black\", style=\"slash\",brw=0.02)"},{"path":"/reference/axis.break.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Place a ","text":"axis axis break breakpos place break user units pos position axis (see axis). bgcol color plot background breakcol color \"break\" marker style Either gap, slash zigzag brw break width relative plot width","code":""},{"path":"/reference/axis.break.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Place a ","text":"nil","code":""},{"path":"/reference/axis.break.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Place a ","text":"pos argument needed unless user specified different position default axis broken.","code":""},{"path":"/reference/axis.break.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Place a ","text":"controversy propriety using discontinuous coordinates plotting, thus axis breaks. Discontinuous coordinates allow widely separated groups values outliers appear without devoting much plot empty space. major objection seems reader misled assuming continuous coordinates. gap style clearly separates two sections plot probably best avoiding .","code":""},{"path":"/reference/axis.break.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Place a ","text":"Jim Lemon Ben Bolker","code":""},{"path":[]},{"path":"/reference/axis.break.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Place a ","text":"","code":"plot(3:10, main = \"Axis break test\") # put a break at the default axis and position axis.break() axis.break(2, 2.9, style = \"zigzag\") twogrp <- c(rnorm(10) + 4, rnorm(10) + 20) gap.plot(twogrp,gap = c(8,16), xlab = \"Index\", ylab = \"Group values\", main = \"Two separated groups with gap axis break\", col = c(rep(2, 10), rep(3, 10)), ytics = c(3, 5, 18, 20)) legend(12, 6, c(\"Low group\", \"High group\"), pch = 1, col = 2:3)"},{"path":"/reference/axis.mult.html","id":null,"dir":"Reference","previous_headings":"","what":"Display an axis with values having a multiplier — axis.mult","title":"Display an axis with values having a multiplier — axis.mult","text":"axis displayed existing plot tick values divided multiplier multiplier displayed next axis.","code":""},{"path":"/reference/axis.mult.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display an axis with values having a multiplier — axis.mult","text":"","code":"axis.mult(side=1,at=NULL,labels,mult=1,mult.label,mult.line, mult.labelpos=NULL,...)"},{"path":"/reference/axis.mult.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display an axis with values having a multiplier — axis.mult","text":"side side display place tick marks - defaults axTicks() labels tick labels - defaults /mult mult multiplier factor mult.label label show multiplier - defaults \"x mult\" mult.line margin line upon show multiplier mult.labelpos place mult.label - defaults centered outside axis tick labels ... additional arguments passed axis.","code":""},{"path":"/reference/axis.mult.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display an axis with values having a multiplier — axis.mult","text":"nil","code":""},{"path":"/reference/axis.mult.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display an axis with values having a multiplier — axis.mult","text":"axis.mult automates process displaying axis multiplier applied tick values. default divide default axis tick labels mult place mult.label xlab ylab normally appear. Thus plot call set relevant label empty string cases. simplest call plot axes=FALSE display box standard axes calling axis.mult.","code":""},{"path":"/reference/axis.mult.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Display an axis with values having a multiplier — axis.mult","text":"axis.mult try display axis side, top right margins require adjustment using par axis.mult display properly.","code":""},{"path":"/reference/axis.mult.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display an axis with values having a multiplier — axis.mult","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/axis.mult.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display an axis with values having a multiplier — axis.mult","text":"","code":"plot(1:10 * 0.001, 1:10 * 100,axes = FALSE, xlab = \"\", ylab = \"\", main = \"Axis multipliers\") box() axis.mult(1, mult = 0.001) axis.mult(2, mult = 100)"},{"path":"/reference/barNest.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a nested breakdown of numeric values — barNest","title":"Display a nested breakdown of numeric values — barNest","text":"Breaks elements data frame one categorical elements displays breakdown bar plot.","code":""},{"path":"/reference/barNest.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a nested breakdown of numeric values — barNest","text":"","code":"barNest(formula=NULL,data=NULL,FUN=c(\"mean\",\"sd\",\"sd\",\"valid.n\"),ylim=NULL, main=\"\",xlab=\"\",ylab=\"\",shrink=0.1,errbars=FALSE,col=NA, labelcex=1,lineht=NULL,showall=TRUE,Nwidths=FALSE,barlabels=NULL, showlabels=TRUE,mar=NULL,arrow.cap=NULL,trueval=TRUE)"},{"path":"/reference/barNest.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a nested breakdown of numeric values — barNest","text":"formula formula numeric element data frame left one categorical elements right. data data frame containing elements formula. FUN functions apply x. ylim Optional y limits plot, usually necessary counts. main Title plot. xlab,ylab Axis labels plot. x axis label typically blank shrink proportion shrink width bars level. errbars Whether display error bars lowest level breakdown. col colors use fill bars. See Details. labelcex Character size group labels. lineht height line text lower margin plot user units. calculated function value passed. showall Whether display bars entire breakdown. Nwidths Whether scale widths bars number observations. barlabels Optional group labels may useful factors used break numeric variable fairly long strings. showlabels Whether display labels bars. mar NULL, four element vector set plot margins. new margins set, user must reset margins function exits. arrow.cap width \"cap\" error bars user units, calculated basis number bars final breakdown NA. trueval NA, call brkdnNest return proportions response variable equal trueval. See Details.","code":""},{"path":"/reference/barNest.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a nested breakdown of numeric values — barNest","text":"summary list produced brkdnNest.","code":""},{"path":"/reference/barNest.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a nested breakdown of numeric values — barNest","text":"barNest displays bar plot illustrating hierarchic breakdown elements data frame. breakdown performed brkdnNest actual display performed drawNestedBars. heights bars proportional values returned first function FUN. showall TRUE, entire nested breakdown displayed. can useful visualizing relationship groups subgroups compact format. barNest assumes four breakdowns list returned brkdnNest order summary measure, upper dispersion value, lower dispersion value number valid observations. Nwidths=FALSE, may work three errbars=FALSE well, may work one. Nwidths=TRUE, bar widths scaled relative number observations per group. numbers observations different, labels bars small numbers observations probably overlap. number functions can passed FUN argument. Three functions, propbrk, sumbrk valid.n work summary measures, giving proportions sums particular values discrete variable counts group subgroup respectively. Binomial confidence limits can added proportions returned propbrk binciWl binciWu second last example. valid.n first element FUN, \"overall\" bar label suppressed, informative. user decide whether \"error bars\" displayed meaningful. colors bars determined col. showall FALSE, user need pass vector colors, usually length number categories final (last right side) element formula. showall TRUE user wants color bars, list many elements levels breakdown passed. element vector colors, usually length number categories. categorical variables likely factors, important remember colors must correct order levels factors. levels default alphanumeric order, quite easy get wrong. barNest plot factors levels factor quite dense, easily distinguished colors level breakdown may preferable. plots, trying cram much information single illustration may work well.","code":""},{"path":"/reference/barNest.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a nested breakdown of numeric values — barNest","text":"Jim Lemon Ofir Levy","code":""},{"path":"/reference/barNest.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Display a nested breakdown of numeric values — barNest","text":"Lemon, J. & Levy, O. (2011) barNest: Illustrating nested summary measures. Statistical Computing Graphics Newsletter American Statistical Association, 21(2): 5-10.","code":""},{"path":[]},{"path":"/reference/barNest.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a nested breakdown of numeric values — barNest","text":"","code":"# recreate the Titanic data frame and show the three way breakdown titanic<-data.frame( class=c(rep(\"1st\",325),rep(\"2nd\",285),rep(\"3rd\",706),rep(\"Crew\",885)), age=c(rep(\"Adult\",319),rep(\"Child\",6),rep(\"Adult\",261),rep(\"Child\",24), rep(\"Adult\",627),rep(\"Child\",79),rep(\"Adult\",885)), sex=c(rep(\"M\",175),rep(\"F\",144),rep(\"M\",5),rep(\"F\",1), rep(\"M\",168),rep(\"F\",93),rep(\"M\",11),rep(\"F\",13), rep(\"M\",462),rep(\"F\",165),rep(\"M\",48),rep(\"F\",31), rep(\"M\",862),rep(\"F\",23)), survived=c(rep(\"Yes\",57),rep(\"No\",118),rep(\"Yes\",140),rep(\"No\",4),rep(\"Yes\",6), rep(\"Yes\",14),rep(\"No\",154),rep(\"Yes\",80),rep(\"No\",13),rep(\"Yes\",24), rep(\"Yes\",75),rep(\"No\",387),rep(\"Yes\",76),rep(\"No\",89), rep(\"Yes\",13),rep(\"No\",35),rep(\"Yes\",14),rep(\"No\",17), rep(\"Yes\",192),rep(\"No\",670),rep(\"Yes\",20),rep(\"No\",3))) require(plotrix) titanic.colors<-list(\"gray90\",c(\"#0000ff\",\"#7700ee\",\"#aa00cc\",\"#dd00aa\"), c(\"#ddcc00\",\"#ee9900\"),c(\"pink\",\"lightblue\")) barNest(survived~class+age+sex,titanic,col=titanic.colors,showall=TRUE, main=\"Titanic survival by class, age and sex\",ylab=\"Proportion surviving\", FUN=c(\"propbrk\",\"binciWu\",\"binciWl\",\"valid.n\"),shrink=0.15,trueval=\"Yes\") barNest(survived~class+age+sex,titanic,col=titanic.colors,showall=TRUE, main=\"Titanic survival by class, age and sex (scaled bar widths)\", ylab=\"Proportion surviving\",FUN=c(\"propbrk\",\"binciWu\",\"binciWl\",\"valid.n\"), shrink=0.15,trueval=\"Yes\",Nwidths=TRUE) # now show the actual numbers of passengers barNest(survived~class+age+sex,titanic,col=titanic.colors,showall=TRUE, main=\"Titanic passengers and crew by class, age and sex\", ylab=\"Number\",FUN=\"valid.n\",shrink=0.15) # to see this properly displayed, start a wide plot window # x11(width=10) test.df<-data.frame(Age=rnorm(100,35,10), Sex=sample(c(\"Male\",\"Female\"),100,TRUE), Marital=sample(c(\"Div\",\"Mar\",\"Sing\",\"Wid\"),100,TRUE), Employ=sample(c(\"FT\",\"PT\",\"Un\"),100,TRUE)) test.col<-list(Overall=\"gray\",Sex=c(\"pink\",\"lightblue\"), Marital=c(\"mediumpurple\",\"orange\",\"tan\",\"lightgreen\"), Employ=c(\"#1affd8\",\"#caeecc\",\"#ff90d0\")) barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab=\"Mean age (years)\", main=\"Mean age by subgroups\",errbars=TRUE,col=test.col) barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab=\"Mean age (years)\", main=\"Mean age by subgroups (widths scaled to Ns)\",errbars=TRUE,col=test.col, Nwidths=TRUE) # set up functions for 20th and 80th percentiles q20<-function(x,na.rm=TRUE) return(quantile(x,probs=0.2,na.rm=TRUE)) q80<-function(x,na.rm=TRUE) return(quantile(x,probs=0.8,na.rm=TRUE)) # show the asymmetric dispersion measures barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab=\"Mean age (years)\", main=\"Use median and quantiles for dispersion\", FUN=c(\"median\",\"q80\",\"q20\",\"valid.n\"), errbars=TRUE,col=test.col) #> Error in q80(c(30.2729751788185, 42.0875306053113, 19.7104128534038, 37.374253451732, 21.871857535292, 42.4702858708636, 19.3748156535415, 35.7105335956778, 28.6046522979303, 26.5480426144814, 41.7524469808172, 46.5337579392521, 18.134952575578, 25.9718505077993, 48.1763369782387, 46.0018974454478, 47.0376783938691, 20.6872922311001, 48.8291086057034, 35.0312594041218, 34.2211317561242, 39.4142822592846, 36.2892289622369, 26.6978573963638, 29.9640709028839, 23.0635881799008, 27.4827667710908, 49.5584140300823, 26.713964672107, 37.8977446037578, 30.1994651572887, 28.9517064578479, 49.6011018039623, 36.496793540957, 20.666788997018, 34.8969668137141, 32.8776396516206, 25.9365982143577, 13.9784752110473, 53.93360463671, 25.3187416297593, 33.9739696362312, 37.3995957212182, 35.6089889324996, 13.2242397172451, 33.821398567506, 36.1229478740626, 35.0788619766754, 53.7774387154249, 56.5875655364964, 42.0971452224005, 42.6698337875431, 31.9178857917449, 45.1200184856141, 25.8094840306469, 40.6338007724989, 38.224827493153, 38.666743632573, 46.2983515341746, 25.5850192406856, 37.1783764294473, 49.154122930517, 31.1626695207393, 33.2591362641221, 32.7825548286618, 24.9047127751742, 39.8072526626885, 51.0440732826108, 19.8497547117929, 20.8397608550649, 43.7677732655608, 41.2413241262139, 56.1227728781614, 31.4387558427738, 24.3553579134843, 45.7711653845397, 46.8157556654405, 36.9839209464341, 30.9959475059186, 41.1615428073265, 54.7415674798341, 53.8466232423526, 19.1137945340634, 29.6007683588956, 23.3053853634955, 40.5910598857455, 16.8065275338205, 38.9334397239581, 35.4213410586766, 46.7966417694769, 32.4307882381581, 24.4366390219833, 36.9877720512642, 41.5053355166639, 38.4391333708039, 49.7753231212208, 35.7202569848562, 56.2644453405315, 20.2380309433499, 39.0788849977307), na.rm = TRUE): could not find function \"q80\" barNest(formula=Employ~Sex+Marital,data=test.df,ylab=\"Proportion unemployed\", main=\"Proportion unemployed by sex and marital status\", FUN=c(\"propbrk\",\"binciWu\",\"binciWl\",\"valid.n\"), errbars=TRUE,col=test.col,trueval=\"Un\") barNest(formula=Employ~Sex+Marital,data=test.df,ylab=\"Proportion unemployed\", main=\"Proportion unemployed by sex and marital status (scaled bar widths)\", FUN=c(\"propbrk\",\"binciWu\",\"binciWl\",\"valid.n\"), errbars=TRUE,col=test.col,trueval=\"Un\",Nwidths=TRUE) barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab=\"Counts\", main=\"Show the counts in subgroups (final level only)\",FUN=\"valid.n\", col=test.col,showall=FALSE,ylim=c(0,10)) barNest(formula=Age~Sex+Marital+Employ,data=test.df,ylab=\"Counts\", main=\"Show all the counts in subgroups\",FUN=\"valid.n\",mar=c(5,5,4,2), col=test.col)"},{"path":"/reference/barlabels.html","id":null,"dir":"Reference","previous_headings":"","what":"Label the bars on a barplot — barlabels","title":"Label the bars on a barplot — barlabels","text":"Displays labels plot, usually bar plot.","code":""},{"path":"/reference/barlabels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label the bars on a barplot — barlabels","text":"","code":"barlabels(xpos,ypos,labels=NULL,cex=1,prop=0.5,miny=0,offset=0,nobox=FALSE,...)"},{"path":"/reference/barlabels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label the bars on a barplot — barlabels","text":"xpos vector, matrix data frame x positions labels. ypos vector, matrix data frame y values labels. labels labels display. Defaults values ypos. cex Relative size labels. See text. prop proportion ypos place labels. Defaults 0.5 (middle). miny minimum value display labels. offset Amount horizontally offset successive labels case vertical overlaps. nobox Whether call boxed.labels text. ... Extra arguments passed boxed.labels text.","code":""},{"path":"/reference/barlabels.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Label the bars on a barplot — barlabels","text":"barlabels places labels plot horizontal positions xpos vertical positions ypos * prop. typical use function place labels bars, default middle bars. put labels just tops bars, set prop 1 add constant amount ypos.","code":""},{"path":"/reference/barlabels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label the bars on a barplot — barlabels","text":"nil","code":""},{"path":"/reference/barlabels.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Label the bars on a barplot — barlabels","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/barlabels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label the bars on a barplot — barlabels","text":"","code":"heights<-c(14,20,9,31,17) barpos<-barplot(heights,main=\"A redundant bar plot\") # show the usual value labels on the bars barlabels(barpos,heights) # now with stacked bars and offsets heights<-matrix(sample(c(1,2,10,15),20,TRUE),ncol=4) barpos<-barplot(heights,main=\"A redundant stacked bar plot\") barlabels(barpos,heights,offset=0.1) # do it again without stacking barpos<-barplot(heights,main=\"An unstacked redundant bar plot\", beside=TRUE) barlabels(barpos,heights) # finally use barp for the plot barpos<-barp(heights,main=\"A fourth and final bar plot\",col=2:6, names.arg=paste(\"Day\",1:4)) barlabels(barpos$x,barpos$y,matrix(LETTERS[1:5],nrow=5,ncol=4))"},{"path":"/reference/barp.html","id":null,"dir":"Reference","previous_headings":"","what":"A bar plotting routine — barp","title":"A bar plotting routine — barp","text":"Display bar plot","code":""},{"path":"/reference/barp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A bar plotting routine — barp","text":"","code":"barp(height,width=0.4,names.arg=NULL,legend.lab=NULL,legend.pos=NULL, col=NULL,border=par(\"fg\"),main=NULL,xlab=\"\",ylab=\"\",xlim=NULL,ylim=NULL, x=NULL,staxx=FALSE,staxy=FALSE, height.at=NULL,height.lab=NULL, cex.axis=par(\"cex.axis\"),pch=NULL,cylindrical=FALSE,shadow=FALSE, do.first=NULL,ylog=FALSE,srt=NULL,...)"},{"path":"/reference/barp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A bar plotting routine — barp","text":"height numeric vector, matrix data frame represented heights bars. width Half width single bar group bars X axis units. names.arg labels bars groups bars. legend.lab Labels optional legend. NULL, legend displayed. legend.pos Optional position legend list x y components. NULL, locator called. col fill colors bars. default fill. border border bars. main title top plot. xlab,ylab labels X Y axes respectively. xlim,ylim Optional horizontal vertical limits plot. x Optional horizontal positions bars. Defaults 1:length(height). staxx,staxy Whether use staxlab stagger X Y axis tick labels. Can also omit X Y axes. height.Optional positions tick marks Y axis. height.lab Optional tick labels Y axis. cex.axis Character expansion axis labels. pch Symbol(s) fill bars. See Details. cylindrical Whether give bars cylindrical appearance shading . shadow Whether place shadow behind bars. .first optional string evaluated anything else displayed plot. Useful background colors lines. ylog Logical whether log scale used. see details. srt Rotation axis labels staxx staxy TRUE (see staxlab). ... arguments passed plot .","code":""},{"path":"/reference/barp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A bar plotting routine — barp","text":"list containing two components form height: x centers bars displayed. y heights bars.","code":""},{"path":"/reference/barp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A bar plotting routine — barp","text":"barp displays bar plot similar barplot axes horizontal bar positions like plot. Bars groups bars centered integral X values default, width spacing bars controlled single number. user passes explicit x values, values determine spacing. height vector, single bars representing value displayed centered 1:length(height) unless user specified x values. height matrix, 2D array, data frame, group bars drawn column, values group taken rows column. Explicit x values used matrix, however, adjusting values x, grouped bars can displayed. values freq brkdn prettyR package can used height argument. value table can also passed height, can 2D array returned function. Bars empty default fill colors can defined several ways. single color passed, bars color. height vector, colors recycled ignored length col equal height. height matrix data frame, user may pass vector colors equal number rows height matrix colors dimensions height. sequences color probably result easy interpret plot. barp intended simplify illustrating categorical data variable designations categories names, many multiple choice questions. height.height.lab allow user place labels vertical axis, usually representing options. staxx staxy TRUE, labels horizontal vertical axes respectively staggered, allowing user use many lengthy variable value labels. srt NULL, labels rotated counterclockwise value angles degrees instead staggered. staxx staxy set NA, respective axis displayed. barp allows two enhancements may useful areas fancy plots appreciated. One give bars cylindrical look shading color. place apparent shadow behind bar. effects appear though light coming upper left, hard coded. can add error bars calling dispersion, many advise . legend.lab NULL, legend displayed. legend.pos NULL, locator called place legend. Windows, alert may appear console, function appear hang unless user clicks console window plot. ylog argument produces log scale y axis. Currently, neither pretty axTicks seems produce nice set axis ticks, best pass positions height.. pch argument NULL, barp display white bars filled symbols specified pch. grouped bars, must matrix form col argument. option allows black white bar plot produced.","code":""},{"path":"/reference/barp.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"A bar plotting routine — barp","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/barp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"A bar plotting routine — barp","text":"","code":"# get some extra room on the left par(mar=c(5,5,4,2)) # make up some happiness data, as so many seem to do happyday<-data.frame(Monday=c(2.3,3.4),Tuesday=c(2.8,3.3),Wednesday=c(3.2,3.1), Thursday=c(3.6,2.8),Friday=c(4.2,2.6),Saturday=c(4.5,2.9),Sunday=c(4.1,2.8)) happylabels<-c(\"Utterly dashed\",\"Rather mopey\",\"Indifferent\",\"Somewhat elated\", \"Euphoric\") barp(happyday,names.arg=names(happyday),legend.lab=c(\"Slaves\",\"Unemployed\"), legend.pos=list(x=2,y=4.5),col=c(\"#ee7700\",\"#3333ff\"),main=\"9AM happiness by weekday\", xlab=\"Day of week\",ylab=\"Happiness rating\",ylim=c(1,5),staxx=TRUE,staxy=TRUE, height.at=1:5,height.lab=happylabels,cex.axis=0.9,cylindrical=TRUE, shadow=TRUE) # now do a plot with colors scaled to the sex ratio (real data!) sexratio<-c(0.24,0.35,0.09,0.59,0.63,0.34,0.7,0.6) # the fun ratings are once again a pack of lies funrating<-c(3.2,3.5,1.5,5.4,4.5,2.7,6.8,4.9) funstudy<-c(\"Astronomy\",\"Chemistry\",\"Economics\",\"Anthropology\",\"Linguistics\", \"Math/Stats\",\"Psychology\",\"Sociology\") funlabels<-c(\"Torture\",\"Agony\",\"Boredom\",\"Neutral\",\"Entertaining\",\"Exhilarating\", \"Maniacal\") # xrange is used to get the colors to match the 0-100% scale barp(funrating,names.arg=funstudy,main=\"Fun ratings for various areas of study\", col=color.scale(sexratio,c(0.2,1),c(0.2,0.4),c(1,0.4),xrange=c(0,1)), xlab=\"Study\",ylab=\"Rating\",height.at=1:7,height.lab=funlabels,ylim=c(1,7), staxx=TRUE,staxy=TRUE,cex.axis=0.9) # here we want the full scale from zero to one color.legend(2,6,4,6.4,legend=c(\"100% guys\",\"100% girls\"), rect.col=color.scale(seq(0,1,by=0.25),c(0.2,1),c(0.2,0.4),c(1,0.4))) par(mar=c(5,4,4,2)) # use barp to display a multiple histogram with a shaded background # notice how the expression uses local variables inside the barp function gradbg<-\"gradient.rect(xlim[1],ylim[1],xlim[2],ylim[2], c(1,0.5,1),c(1,0.5,1),c(1,0.5,1),gradient=\\\"y\\\",nslices=100)\" h1<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2))) h2<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2))) h3<-table(cut(rnorm(100,4),breaks=seq(0,8,by=2))) hmat<-matrix(c(h1,h2,h3),nrow=3,byrow=TRUE) barp(hmat,names.arg=names(h1),width=0.45,col=2:4,do.first=gradbg, main=\"Multiple histogram using barp\",xlab=\"Bins\",ylab=\"Frequency\") legend(3.8,50,c(\"h1\",\"h2\",\"h3\"),fill=2:4) # now display a positive/negative plot barp(c(2,-3,4,-5,6,-7,8),main=\"Positive/negative plot\", xlab=\"Alternating colors\",ylab=\"For alternating values\", col=2+(c(2,-3,4,-5,6,-7,8)>0))"},{"path":"/reference/battleship.plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a matrix of values as the widths of stacked rectangles — battleship.plot","title":"Display a matrix of values as the widths of stacked rectangles — battleship.plot","text":"battleship.plot displays matrix rectangles, widths proportional values x. values scaled half width largest rectangle equal maxxspan user units. prevents rectangles overlapping. user can adjust spacing stacks rectangles changing maxxspan. Similarly, maxyspan controls spacing rectangles vertical direction. labels stack plots (columns x) displayed top plot, angled 45 degrees. labels row rectangles stacks (rows x) displayed left. Long labels either may require adjusting mar argument. function try extract labels xaxlab yaxlab matrix column row names respectively none passed.","code":""},{"path":"/reference/battleship.plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a matrix of values as the widths of stacked rectangles — battleship.plot","text":"","code":"battleship.plot(x,mar=c(2,5,5,1),col=\"white\",border=\"black\", main=\"\",xlab=\"\",ylab=\"\",xaxlab=NULL,yaxlab=NULL,cex.labels=1, maxxspan=0.45,maxyspan=0.45)"},{"path":"/reference/battleship.plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a matrix of values as the widths of stacked rectangles — battleship.plot","text":"x matrix data frame containing numeric values. See example. mar Margins plot. col fill colors rectangles. border border colors rectangles. main title plot (.e. main). xlab,ylab x y axis labels. xaxlab,yaxlab Optional labels rows columns. cex.labels Character expansion row column labels. maxxspan,maxyspan Scaling factor widths heights rectangles overlap.","code":""},{"path":"/reference/battleship.plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a matrix of values as the widths of stacked rectangles — battleship.plot","text":"nil","code":""},{"path":"/reference/battleship.plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a matrix of values as the widths of stacked rectangles — battleship.plot","text":"Jim Lemon - thanks Adam Maltese suggestion","code":""},{"path":[]},{"path":"/reference/battleship.plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a matrix of values as the widths of stacked rectangles — battleship.plot","text":"","code":"x<-matrix(sample(10:50,100,TRUE),10) xaxlab=c(\"One\",\"Two\",\"Three\",\"Four\",\"Five\",\"Six\",\"Seven\",\"Eight\",\"Nine\",\"Ten\") yaxlab=c(\"First\",\"Second\",\"Third\",\"Fourth\",\"Fifth\",\"Sixth\",\"Seventh\", \"Eighth\",\"Ninth\",\"Tenth\") battleship.plot(x,xlab=\"The battle has just begun\",main=\"Battleship1\", xaxlab=xaxlab,yaxlab=yaxlab)"},{"path":"/reference/bin.wind.records.html","id":null,"dir":"Reference","previous_headings":"","what":"Classify wind direction and speed records — bin.wind.records","title":"Classify wind direction and speed records — bin.wind.records","text":"Classifies wind direction speed records matrix percentages observations speed direction bins.","code":""},{"path":"/reference/bin.wind.records.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Classify wind direction and speed records — bin.wind.records","text":"","code":"bin.wind.records(winddir,windspeed,ndir=8,radians=FALSE, speed.breaks=c(0,10,20,30))"},{"path":"/reference/bin.wind.records.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Classify wind direction and speed records — bin.wind.records","text":"winddir vector wind directions. windspeed vector wind speeds corresponding directions. ndir Number direction bins compass circle. radians Whether wind directions radians. speed.breaks Minimum wind speed speed bin.","code":""},{"path":"/reference/bin.wind.records.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Classify wind direction and speed records — bin.wind.records","text":"bin.wind.records bins number wind direction speed records matrix percentages observations can used display cumulative wind rose oz.windrose defaults used Australian Bureau Meteorology.","code":""},{"path":"/reference/bin.wind.records.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Classify wind direction and speed records — bin.wind.records","text":"matrix percentages rows represent wind speed categories columns represent wind direction categories.","code":""},{"path":"/reference/bin.wind.records.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Classify wind direction and speed records — bin.wind.records","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/bin.wind.records.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Classify wind direction and speed records — bin.wind.records","text":"","code":"winddir<-sample(0:360,100,TRUE) windspeed<-sample(0:40,100,TRUE) bin.wind.records(winddir,windspeed) #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] #> [1,] 0 1 3 1 1 1 0 3 #> [2,] 3 4 2 1 3 0 5 2 #> [3,] 4 0 4 4 2 4 2 3 #> [4,] 1 3 0 1 2 2 3 7 #> [5,] 3 4 3 2 6 3 3 4"},{"path":"/reference/binciW.html","id":null,"dir":"Reference","previous_headings":"","what":"Binomial confidence limits — binciW","title":"Binomial confidence limits — binciW","text":"Calculates binomial confidence limits using Wilson approximation.","code":""},{"path":"/reference/binciW.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Binomial confidence limits — binciW","text":"","code":"binciW(x,n,alpha=0.05,cc=FALSE)"},{"path":"/reference/binciW.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Binomial confidence limits — binciW","text":"x number successes failures CI calculated. n number trials . alpha desired coverage - 0.05 produces 95 percent coverage cc Whether apply continuity correction","code":""},{"path":"/reference/binciW.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Binomial confidence limits — binciW","text":"binciW calculates binomial confidence limits given number successes trials. mainly allow binomial confidence limits calculated brkdnNest function, upper lower CIs called separately.","code":""},{"path":"/reference/binciW.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Binomial confidence limits — binciW","text":"lower upper binomial confidence limits","code":""},{"path":"/reference/binciW.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Binomial confidence limits — binciW","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/binciW.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Binomial confidence limits — binciW","text":"","code":"binciW(5,42) #> [1] 0.05193803 0.25000390"},{"path":"/reference/binciWl.html","id":null,"dir":"Reference","previous_headings":"","what":"Lower binomial confidence limit — binciWl","title":"Lower binomial confidence limit — binciWl","text":"Returns lower binomial confidence limit using Wilson approximation.","code":""},{"path":"/reference/binciWl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Lower binomial confidence limit — binciWl","text":"","code":"binciWl(x,n,alpha=0.05,trueval=TRUE,na.rm=TRUE)"},{"path":"/reference/binciWl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lower binomial confidence limit — binciWl","text":"x number successes failures CI calculated. n number trials . alpha desired coverage - 0.05 produces 95 percent coverage trueval value representing outcome interest CI. na.rm Argument needed make work","code":""},{"path":"/reference/binciWl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Lower binomial confidence limit — binciWl","text":"binciWl now calls binciW returns lower limit.","code":""},{"path":"/reference/binciWl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Lower binomial confidence limit — binciWl","text":"lower binomial confidence limit","code":""},{"path":"/reference/binciWl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Lower binomial confidence limit — binciWl","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/binciWl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Lower binomial confidence limit — binciWl","text":"","code":"binciWl(c(rep(5,TRUE),rep(37,FALSE))) #> [1] 0"},{"path":"/reference/binciWu.html","id":null,"dir":"Reference","previous_headings":"","what":"Upper binomial confidence limit — binciWu","title":"Upper binomial confidence limit — binciWu","text":"Returns upper binomial confidence limit using Wilson approximation.","code":""},{"path":"/reference/binciWu.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Upper binomial confidence limit — binciWu","text":"","code":"binciWu(x,n,alpha=0.05,trueval=TRUE,na.rm=TRUE)"},{"path":"/reference/binciWu.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Upper binomial confidence limit — binciWu","text":"x number successes failures CI calculated. n number trials . alpha desired coverage - 0.05 produces 95 percent coverage trueval value representing outcome interest CI. na.rm Argument needed make work","code":""},{"path":"/reference/binciWu.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Upper binomial confidence limit — binciWu","text":"binciWu now calls binciW returns upper limit.","code":""},{"path":"/reference/binciWu.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Upper binomial confidence limit — binciWu","text":"upper binomial confidence interval","code":""},{"path":"/reference/binciWu.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Upper binomial confidence limit — binciWu","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/binciWu.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Upper binomial confidence limit — binciWu","text":"","code":"binciWl(c(rep(5,TRUE),rep(37,FALSE))) #> [1] 0"},{"path":"/reference/box.heresy.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a sort of box plot — box.heresy","title":"Display a sort of box plot — box.heresy","text":"box.heresy displays box plot symbol represents measure central tendency, surrounding box represents \"inner\" measure dispersion (e.g. standard error) whiskers represent \"outer\" measure dispersion (e.g. standard deviation). function pretty basic time probably change bit. argument \"intervals\" particularly important, can wreak havoc resulting plot. default FALSE means values passed inner outer measures dispersion absolute, intervals away measure central tendency. Mixing absolute relative values always lead errors typically strange looking plot. probably easiest calculate absolute values calling box.heresy. first second examples show intervals=FALSE intervals=TRUE can used. One first changes allow varying box widths. user can specify box widths vector numeric values least long number boxes displayed. usual reason display widths proportional number observations. useful start pass boxwidth number observations let function work .","code":""},{"path":"/reference/box.heresy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a sort of box plot — box.heresy","text":"","code":"box.heresy(x,y,uinner,linner,ulim,llim,boxwidth=NULL, intervals=FALSE,arrow.cap=NULL,pch=22,main=\"\",xlab=\"\",ylab=\"\", xaxlab=NULL,col=\"white\",do.first=NULL,...)"},{"path":"/reference/box.heresy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a sort of box plot — box.heresy","text":"x,y Vectors numeric values representing measures central tendency. uinner,linner Vectors numeric values representing \"inner\" measures dispersion. ulim,llim Vectors numeric values representing \"outer\" measures dispersion. boxwidth Optional widths boxes. intervals Whether values dispersion intervals (TRUE) absolute limits (FALSE). arrow.cap width cap \"whiskers\" relative width plot. Defaults width outer box. pch symbol used represent measure(s) central tendency box. main title plot (.e. main). xlab,ylab x y axis labels. xaxlab Optional labels boxes. col fill colors \"inner\" rectangles. .first expression evaluated anything displayed. ... additional arguments passed dispersion function.","code":""},{"path":"/reference/box.heresy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a sort of box plot — box.heresy","text":"nil","code":""},{"path":"/reference/box.heresy.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a sort of box plot — box.heresy","text":"Jim Lemon - thanks Gianni Lavaredo suggestion","code":""},{"path":[]},{"path":"/reference/box.heresy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a sort of box plot — box.heresy","text":"","code":"y1<-runif(20,2,10) y2<-rnorm(30,6,2) y3<-sample(0:20,40,TRUE) Ns<-c(20,30,40) ymean<-c(mean(y1),mean(y2),mean(y3)) y1inner<-quantile(y1,probs=c(.16,.84)) y2inner<-c(ymean[2]+sd(y2),ymean[2]-sd(y2)) y3inner<-quantile(y3,probs=c(.16,.84)) uinner<-c(y1inner[1],y2inner[1],y3inner[1]) linner<-c(y1inner[2],y2inner[2],y3inner[2]) ulim<-c(max(y1),max(y2),max(y3)) llim<-c(min(y1),min(y2),min(y3)) box.heresy(ymean,uinner=uinner,linner=linner,ulim=ulim,llim=llim,boxwidth=Ns, main=\"Boxplot of means, central spread and range\",xlab=\"Distribution\", xaxlab=c(\"Uniform\",\"Normal\",\"Sample\")) #> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored #> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored #> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored #> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored #> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored #> Warning: 'length', 'angle', or 'code' greater than length 1; values after the first are ignored y1outer<- y<-runif(5) ulim<-runif(5) llim<-runif(5) uinner<-ulim/2 linner<-llim/2 box.heresy(y,uinner=uinner,linner=linner,ulim=ulim,llim=llim, intervals=TRUE,main=\"The heretical boxplot\", xlab=\"Number of observations\",ylab=\"Value\")"},{"path":"/reference/boxed.labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Place labels in boxes — boxed.labels","title":"Place labels in boxes — boxed.labels","text":"Places labels boxes existing plot","code":""},{"path":"/reference/boxed.labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Place labels in boxes — boxed.labels","text":"","code":"boxed.labels(x,y=NULL,labels, bg=ifelse(match(par(\"bg\"),\"transparent\",0),\"white\",par(\"bg\")), border=TRUE,xpad=1.2,ypad=1.2,srt=0,cex=1,adj=0.5,xlog=FALSE,ylog=FALSE,...)"},{"path":"/reference/boxed.labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Place labels in boxes — boxed.labels","text":"x,y x y position centers labels. x can xy.coords list. bg fill color rectangles labels displayed (see Details). labels Text strings border Whether draw borders around rectangles. xpad,ypad proportion rectangles extent text within. srt Rotation labels. 90 270 degrees, box rotated 90 degrees. cex Character expansion. See text. adj left/right adjustment. set outside function, box aligned properly. xlog Whether X axis log axis ylog Whether Y axis log axis ... additional arguments passed text.","code":""},{"path":"/reference/boxed.labels.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Place labels in boxes — boxed.labels","text":"label(s) displayed rectangular background. may useful visibility reason \"transparent\" background available. default textcol=NA, function tries work whether white black text easily read based background color displays text accordingly. user specifies text colors additional arguments, colors override automatic white/black - see last example. right angle rotations allowed boxed.labels. Important change: xpad ypad now full proportion box text, half. user can now call cylindrect gradient.rect background rectangle.","code":""},{"path":"/reference/boxed.labels.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Place labels in boxes — boxed.labels","text":"function best regularly spaced labels overlapping problem. See thigmophobe.labels placing labels overlap likely.","code":""},{"path":"/reference/boxed.labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Place labels in boxes — boxed.labels","text":"nil","code":""},{"path":"/reference/boxed.labels.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Place labels in boxes — boxed.labels","text":"Jim Lemon - thanks Thorn Thaler code allowing user-specified text colors Flemming Skjoth log axis correction","code":""},{"path":[]},{"path":"/reference/boxed.labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Place labels in boxes — boxed.labels","text":"","code":"x<-rnorm(10) y<-rnorm(10) plot(x,y,type=\"p\") nums<-c(\"one\",\"two\",\"three\",\"four\",\"five\",\"six\",\"seven\",\"eight\",\"nine\",\"ten\") boxed.labels(x,y-0.1,nums) # now label a barplot xpos<-barp(c(1,3,2,4)) boxed.labels(xpos$x,0.5,nums[1:4]) # and add labels below the x axis ticks boxed.labels(xpos$x,-0.4,c(\"First\",\"Second\",\"Third\",\"Fourth\")) # perform a PCA on the \"swiss\" dataset and plot the first two components data(swiss) swiss.pca<-prcomp(swiss) plot(swiss.pca$rotation[,1:2],xlim=c(-1,0.2),main=\"PCA of swiss dataset\", type=\"n\") boxed.labels(swiss.pca$rotation[1:6],swiss.pca$rotation[7:12],ypad=1.5, colnames(swiss),bg=c(\"red\",\"purple\",\"blue\",\"blue\",\"darkgreen\",\"red\"), col=\"yellow\")"},{"path":"/reference/brkdn.plot.html","id":null,"dir":"Reference","previous_headings":"","what":"A point/line plotting routine — brkdn.plot","title":"A point/line plotting routine — brkdn.plot","text":"Display point/line plot breakdowns one variables.","code":""},{"path":"/reference/brkdn.plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A point/line plotting routine — brkdn.plot","text":"","code":"brkdn.plot(vars,groups=NULL,obs=NULL,data,mct=\"mean\",md=\"std.error\", stagger=NULL,dispbar=TRUE,main=\"Breakdown plot\",xlab=NULL,ylab=NULL,xaxlab=NA, ylim=NA,type=\"b\",pch=1,lty=1,col=par(\"fg\"),staxx=FALSE,yat=NULL,...)"},{"path":"/reference/brkdn.plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A point/line plotting routine — brkdn.plot","text":"vars names indices one columns data frame. columns must contain numeric data. one variable broken , vars can formula. groups name index column data frame classifies values vars different, usually fixed effect, levels. obs name index column data frame classifies values vars different, usually random effect, levels. data data frame. mct measure central tendency calculate group. md measure dispersion calculate, NA none. stagger amount offset successive values horizontal position proportion width plot. calculated default usually adequate. Pass zero none. dispbar Whether display measures dispersion bars. main title top plot. xlab,ylab labels X Y axes respectively. defaults, basic. xaxlab Optional labels horizontal axis ticks. ylim Optional vertical limits plot. type Whether plot symbols, lines (plot). pch Symbol(s) plot. lty Line type(s) plot. col Color(s) symbols lines. staxx Whether call staxlab display X axis labels. yat Optional y axis tick positions. ... additional arguments passed plot.","code":""},{"path":"/reference/brkdn.plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A point/line plotting routine — brkdn.plot","text":"list two matrices dimension length(levels(groups)) length(levels(obs)). first contains measures central tendency calculated name name function passed mct. second contains measures dispersion name name function passed md. groups obs NULL, rows matrix groups columns obs. obs NULL, rows groups columns vars. groups NULL, rows vars columns obs. , vars one element, obs NULL, elements vars considered represent observations, groups NULL, considered represent groups. least one groups obs must NULL point using brkdn.plot.","code":""},{"path":"/reference/brkdn.plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A point/line plotting routine — brkdn.plot","text":"brkdn.plot displays plot useful visualizing breakdown response measure two factors, one response measure either factor representing something like levels treatment (groups) something like repeated observations (obs). example, observations made different times data objects receive different treatments, groups factor display measures central tendency points/lines color, symbol line type, obs factor represented horizontal positions plot. obs numeric, unique values used positions, , 1 number unique values. common way representing changes time intervals experimental groups. one numeric variable broken , vars may formula like var~groups+obs. position two factors break variable fixed - second term interpreted \"groups\" third, present, interpreted \"obs\".","code":""},{"path":"/reference/brkdn.plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"A point/line plotting routine — brkdn.plot","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/brkdn.plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"A point/line plotting routine — brkdn.plot","text":"","code":"test.df<-data.frame(a=rnorm(80)+4,b=rnorm(80)+4,c=rep(LETTERS[1:4],each=20), d=rep(rep(letters[1:4],each=4),5)) # first use the default values brkdn.plot(\"a\",\"c\",\"d\",test.df,pch=1:4,col=1:4) #> $mean #> [,1] [,2] [,3] [,4] #> [1,] 3.699047 2.979673 3.835690 3.831803 #> [2,] 4.468245 3.811462 3.441621 4.518820 #> [3,] 4.448392 3.251773 4.184449 3.919098 #> [4,] 3.994852 3.641499 4.660812 4.836524 #> #> $std.error #> [,1] [,2] [,3] [,4] #> [1,] 0.1923569 0.6483281 0.2327485 0.3658918 #> [2,] 0.5357199 0.3643665 0.4458449 0.2081409 #> [3,] 0.4055370 0.2588084 0.3498931 0.3801542 #> [4,] 0.6290630 0.7705355 0.4545133 0.3695867 #> # now jazz it up a bit using medians and median absolute deviations # and some enhancements bp<-brkdn.plot(a~c+d,data=test.df,main=\"Test of the breakdown plot\", mct=\"median\",md=\"mad\",xlab=\"Temperature range\", ylab=\"Cognition\", xaxlab=c(\"10-15\",\"16-20\",\"21-25\",\"25-30\"),pch=1:4,lty=1:4,col=1:4) es<-emptyspace(bp) legend(es,legend=c(\"Sydney\",\"Gosford\",\"Karuah\",\"Brisbane\"),pch=1:4, col=1:4,lty=1:4,xjust=0.5,yjust=0.5)"},{"path":"/reference/brkdnNest.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform a nested breakdown of numeric values — brkdnNest","title":"Perform a nested breakdown of numeric values — brkdnNest","text":"Breaks numeric categorical element data frame one categorical elements.","code":""},{"path":"/reference/brkdnNest.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform a nested breakdown of numeric values — brkdnNest","text":"","code":"brkdnNest(formula,data,FUN=c(\"mean\",\"sd\",\"sd\",\"valid.n\"),label1=\"Overall\", trueval=TRUE)"},{"path":"/reference/brkdnNest.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform a nested breakdown of numeric values — brkdnNest","text":"formula formula numeric element data frame left one categorical elements right. data data frame containing elements formula. FUN functions applied successive breakdowns. label1 label use overall value first function. trueval value use calculating proportions sums categorical response variable. See Details.","code":""},{"path":"/reference/brkdnNest.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform a nested breakdown of numeric values — brkdnNest","text":"list many elements functions FUN. probably best always specify four functions (summary measure, upper dispersion measure, lower dispersion measure number valid observations) even redundant default. function similar brkdn prettyR package, structured used barNest function. produces one measures overall data, subsets data defined first variable right tilde, subsets defined first second variable, .","code":""},{"path":"/reference/brkdnNest.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Perform a nested breakdown of numeric values — brkdnNest","text":"brkdnNest performs nested breakdown element data frame one categorical elements. category optional subcategories, variable left formula summarized specified functions named FUN. trueval NA, brkdnNest calculate proportion trueval values response variable total valid responses. function valid.n first function FUN, counts groups subgroups returned. Two specialized summary functions defined within brkdnNest. sumbrk returns count values factor equal trueval, propbrk returns proportion values equal trueval. aware categorical variable specified left formula, functions expect numeric data mean included FUN. user take care specifying different summary functions. barNest expects summary measure first component list measures dispersion second third. two different measures dispersion passed, first must calculate upper second lower measure.","code":""},{"path":"/reference/brkdnNest.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Perform a nested breakdown of numeric values — brkdnNest","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/brkdnNest.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform a nested breakdown of numeric values — brkdnNest","text":"","code":"brkdntest<-data.frame(Age=rnorm(100,25,10), Sex=factor(sample(c(\"M\",\"F\"),100,TRUE)), Marital=sample(c(\"M\",\"X\",\"S\",\"W\"),100,TRUE), Employ=sample(c(\"FT\",\"PT\",\"NO\"),100,TRUE)) brkdnNest(formula=Age~Sex+Marital+Employ,data=brkdntest) #> mean #> Overall 24.35412 #> \t F 24.13515 #> \t \t M 25.31509 #> \t \t \t FT 31.67157 #> \t \t \t NO 22.29443 #> \t \t \t PT 25.10499 #> \t \t S 24.41918 #> \t \t \t FT 25.42455 #> \t \t \t NO 23.3728 #> \t \t \t PT 23.43842 #> \t \t W 22.42168 #> \t \t \t FT 21.64662 #> \t \t \t NO 22.58689 #> \t \t \t PT 22.72152 #> \t \t X 24.78159 #> \t \t \t FT 30.33997 #> \t \t \t NO 25.23715 #> \t \t \t PT 22.70102 #> \t M 24.5645 #> \t \t M 23.63738 #> \t \t \t FT 28.11792 #> \t \t \t NO 17.77709 #> \t \t \t PT 24.74118 #> \t \t S 23.93357 #> \t \t \t FT NA #> \t \t \t NO 23.76369 #> \t \t \t PT 24.14591 #> \t \t W 25.56561 #> \t \t \t FT 23.34187 #> \t \t \t NO 26.68862 #> \t \t \t PT 29.63132 #> \t \t X 24.85928 #> \t \t \t FT 16.16233 #> \t \t \t NO 27.6349 #> \t \t \t PT 25.96954 #> sd #> Overall 7.992469 #> \t F 8.211191 #> \t \t M 11.9396 #> \t \t \t FT 5.639837 #> \t \t \t NO 15.28303 #> \t \t \t PT 12.05139 #> \t \t S 7.808277 #> \t \t \t FT 7.408498 #> \t \t \t NO 6.406452 #> \t \t \t PT 10.39316 #> \t \t W 4.692401 #> \t \t \t FT 2.389779 #> \t \t \t NO 6.364952 #> \t \t \t PT 4.700077 #> \t \t X 9.276618 #> \t \t \t FT 15.87114 #> \t \t \t NO 7.312338 #> \t \t \t PT 9.092153 #> \t M 7.85256 #> \t \t M 10.41646 #> \t \t \t FT 8.794668 #> \t \t \t NO 8.27566 #> \t \t \t PT 12.65671 #> \t \t S 6.783078 #> \t \t \t FT NA #> \t \t \t NO 6.817546 #> \t \t \t PT 7.785475 #> \t \t W 5.269618 #> \t \t \t FT 4.452918 #> \t \t \t NO 6.058298 #> \t \t \t PT 5.141074 #> \t \t X 8.369062 #> \t \t \t FT 7.185825 #> \t \t \t NO 8.561454 #> \t \t \t PT 6.62298 #> sd #> Overall 7.992469 #> \t F 8.211191 #> \t \t M 11.9396 #> \t \t \t FT 5.639837 #> \t \t \t NO 15.28303 #> \t \t \t PT 12.05139 #> \t \t S 7.808277 #> \t \t \t FT 7.408498 #> \t \t \t NO 6.406452 #> \t \t \t PT 10.39316 #> \t \t W 4.692401 #> \t \t \t FT 2.389779 #> \t \t \t NO 6.364952 #> \t \t \t PT 4.700077 #> \t \t X 9.276618 #> \t \t \t FT 15.87114 #> \t \t \t NO 7.312338 #> \t \t \t PT 9.092153 #> \t M 7.85256 #> \t \t M 10.41646 #> \t \t \t FT 8.794668 #> \t \t \t NO 8.27566 #> \t \t \t PT 12.65671 #> \t \t S 6.783078 #> \t \t \t FT NA #> \t \t \t NO 6.817546 #> \t \t \t PT 7.785475 #> \t \t W 5.269618 #> \t \t \t FT 4.452918 #> \t \t \t NO 6.058298 #> \t \t \t PT 5.141074 #> \t \t X 8.369062 #> \t \t \t FT 7.185825 #> \t \t \t NO 8.561454 #> \t \t \t PT 6.62298 #> valid.n #> Overall 100 #> \t F 49 #> \t \t M 9 #> \t \t \t FT 2 #> \t \t \t NO 4 #> \t \t \t PT 3 #> \t \t S 16 #> \t \t \t FT 8 #> \t \t \t NO 3 #> \t \t \t PT 5 #> \t \t W 13 #> \t \t \t FT 3 #> \t \t \t NO 5 #> \t \t \t PT 5 #> \t \t X 11 #> \t \t \t FT 2 #> \t \t \t NO 3 #> \t \t \t PT 6 #> \t M 51 #> \t \t M 13 #> \t \t \t FT 4 #> \t \t \t NO 4 #> \t \t \t PT 5 #> \t \t S 9 #> \t \t \t FT 0 #> \t \t \t NO 5 #> \t \t \t PT 4 #> \t \t W 13 #> \t \t \t FT 7 #> \t \t \t NO 3 #> \t \t \t PT 3 #> \t \t X 16 #> \t \t \t FT 3 #> \t \t \t NO 7 #> \t \t \t PT 6 # show the proportion of unemployed with binomial confidence intervals brkdnNest(formula=Employ~Sex+Marital,data=brkdntest, FUN=c(\"propbrk\",\"binciWu\",\"binciWl\"),trueval=\"NO\") #> propbrk #> Overall 0.34 #> \t F 0.3061224 #> \t \t M 0.4444444 #> \t \t S 0.1875 #> \t \t W 0.3846154 #> \t \t X 0.2727273 #> \t M 0.372549 #> \t \t M 0.3076923 #> \t \t S 0.5555556 #> \t \t W 0.2307692 #> \t \t X 0.4375 #> binciWu #> Overall 0.4372227 #> \t F 0.4452789 #> \t \t M 0.7333487 #> \t \t S 0.4300888 #> \t \t W 0.6447711 #> \t \t X 0.5656453 #> \t M 0.5097479 #> \t \t M 0.5763066 #> \t \t S 0.8112215 #> \t \t W 0.5025638 #> \t \t X 0.6682144 #> binciWl #> Overall 0.2546152 #> \t F 0.1951549 #> \t \t M 0.1887785 #> \t \t S 0.06591599 #> \t \t W 0.1770971 #> \t \t X 0.09746059 #> \t M 0.2532052 #> \t \t M 0.126807 #> \t \t S 0.2666513 #> \t \t W 0.08179529 #> \t \t X 0.2309865"},{"path":"/reference/bumpchart.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a ","title":"Display a ","text":"Display chart two columns points order ascending values lines connecting points row.","code":""},{"path":"/reference/bumpchart.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a ","text":"","code":"bumpchart(y,top.labels=colnames(y),labels=rep(rownames(y),2),rank=TRUE, mar=c(2,8,5,8),pch=19,col=par(\"fg\"),lty=1,lwd=1,arrows=FALSE,...)"},{"path":"/reference/bumpchart.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a ","text":"y numeric matrix data frame may contain NAs. top.labels strings appear top column points plot. labels strings appear next outer columns points. rank Whether rank values y plotting. mar margins use bumps chart. Alter taste. pch symbols use plotting points. col colors use. lty line types use. lwd line widths use. arrows Whether join points lines (FALSE) arrows (TRUE). ... Additional arguments passed matplot arrows.","code":""},{"path":"/reference/bumpchart.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a ","text":"bumpchart calls matplot plot values transposed y matrix data frame, joining points lines. left right edges plot, labels identifying row points displayed. labels may now different side plot, example values y included. Remember due transposition values plotting, labels right precede left - see second example. type plot often used show changing positions entities time, like ranking surveys different years. similar, flexible plot, see ladderplot. way matplot plots values, order everything reversed. typical display ranks rank 1 top, actual rank positions used plot values. places lowest scores bottom plot highest top. arguments included ... passed matplot arrows argument FALSE, arrows function arrows argument TRUE first example.","code":""},{"path":"/reference/bumpchart.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a ","text":"nil","code":""},{"path":"/reference/bumpchart.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a ","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/bumpchart.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a ","text":"","code":"# percentage of those over 25 years having completed high school # in 10 cities in the USA in 1990 and 2000 educattn<-matrix(c(90.4,90.3,75.7,78.9,66,71.8,70.5,70.4,68.4,67.9, 67.2,76.1,68.1,74.7,68.5,72.4,64.3,71.2,73.1,77.8),ncol=2,byrow=TRUE) rownames(educattn)<-c(\"Anchorage AK\",\"Boston MA\",\"Chicago IL\", \"Houston TX\",\"Los Angeles CA\",\"Louisville KY\",\"New Orleans LA\", \"New York NY\",\"Philadelphia PA\",\"Washington DC\") colnames(educattn)<-c(1990,2000) bumpchart(educattn,main=\"Rank for high school completion by over 25s\", arrows=TRUE,length=0.2) vallab<-c(paste(educattn[,2],rownames(educattn),sep=\"-\"), paste(rownames(educattn),educattn[,1],sep=\"-\")) # now show the raw percentages and add central ticks bumpchart(educattn,rank=FALSE,labels=vallab, main=\"Percentage high school completion by over 25s\", lty=1:10,lwd=1,col=rainbow(10)) # margins have been reset, so use par(xpd=TRUE) boxed.labels(1.5,seq(65,90,by=5),seq(65,90,by=5)) par(xpd=FALSE)"},{"path":"/reference/categoryReshape.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert object label/attribute label coding. — categoryReshape","title":"Convert object label/attribute label coding. — categoryReshape","text":"Convert object label/attribute label coding object attribute data frame.","code":""},{"path":"/reference/categoryReshape.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert object label/attribute label coding. — categoryReshape","text":"","code":"categoryReshape(x)"},{"path":"/reference/categoryReshape.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert object label/attribute label coding. — categoryReshape","text":"x matrix data frame least two columns.","code":""},{"path":"/reference/categoryReshape.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Convert object label/attribute label coding. — categoryReshape","text":"categoryReshape attempts convert first two columns input data frame rows represent objects columns attributes. object, value 1 indicates object attribute, value 0 . set membership terms, 1 indicates object member set 0 .","code":""},{"path":"/reference/categoryReshape.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert object label/attribute label coding. — categoryReshape","text":"data frame (see Details).","code":""},{"path":"/reference/categoryReshape.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Convert object label/attribute label coding. — categoryReshape","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/categoryReshape.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert object label/attribute label coding. — categoryReshape","text":"","code":"ns<-sample(1:8,20,TRUE) objects<-0 for(i in 1:length(ns)) objects<-c(objects,rep(i,ns[i])) attributes<-\"Z\" for(i in 1:length(ns)) attributes<-c(attributes,sample(LETTERS[1:8],ns[i])) setdf<-data.frame(objects[-1],attributes[-1]) categoryReshape(setdf) #> A B C D E F G H #> 1 1 0 1 0 1 1 0 0 #> 2 0 1 0 0 0 0 1 1 #> 3 0 0 1 1 1 1 1 1 #> 4 0 1 0 0 0 0 0 0 #> 5 1 1 1 1 1 1 0 1 #> 6 0 0 0 0 0 1 0 0 #> 7 1 1 1 1 1 0 0 0 #> 8 1 1 1 1 1 1 1 0 #> 9 0 1 1 1 1 1 1 1 #> 10 1 1 1 1 1 1 1 1 #> 11 0 1 1 1 1 1 0 1 #> 12 1 1 1 1 1 1 0 1 #> 13 0 1 0 0 0 0 0 0 #> 14 1 0 1 1 1 1 0 0 #> 15 1 0 1 1 0 1 0 0 #> 16 0 1 1 1 1 1 1 1 #> 17 0 1 1 1 0 0 1 1 #> 18 0 0 0 0 1 0 1 0 #> 19 1 0 0 0 1 0 0 0 #> 20 1 1 0 1 0 1 1 0"},{"path":"/reference/centipede.plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a centipede plot — centipede.plot","title":"Display a centipede plot — centipede.plot","text":"Displays centipede plot current graphics device.","code":""},{"path":"/reference/centipede.plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a centipede plot — centipede.plot","text":"","code":"centipede.plot(segs,mct=\"mean\",lower.limit=\"std.error\", upper.limit=lower.limit,left.labels=NULL,right.labels=NULL,sort.segs=TRUE, main=\"\",xlab=NA,pch=21,vgrid=NA,hgrid=NA,gridcol=\"lightgray\",mar=NA,col=par(\"fg\"), bg=\"green\",...)"},{"path":"/reference/centipede.plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a centipede plot — centipede.plot","text":"segs matrix midpoints limits calculated get.segs dstat object returned brkdn. mct function use calculating midpoint segment. lower.limit functions use calculating lower limits subset data. upper.limit functions use calculating upper limits. left.labels variable subset labels place left margin plot. Default values provided. right.labels variable subset labels place right margin plot. sort.segs Whether sort segments ascending order. main Optional title plot. xlab Optional x axis label plot. default NA displays text label showing midpoint limit functions. pch symbols use plotting midpoints. vgrid Optional vertical line(s) display plot. Defaults NA (none). hgrid Optional horizontal grid lines display plot. Defaults NA (none). gridcol color vgrid hgrid lines. mar Margin widths plot. Defaults c(4,5,1,4) c(4,5,3,4) title. col color(s) limit lines borders midpoint markers. bg color(s) fill midpoint markers. ... additional arguments passed plot.","code":""},{"path":"/reference/centipede.plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a centipede plot — centipede.plot","text":"centipede.plot displays one midpoints limits filled circles horizontal error bars. places labels left right sides plot. labels long, may necessary pass explicit values mar argument leave enough room. vgrid argument usually used display average value midpoints. one values passed argument, displayed vertical lines spanning plot. hgrid argument acts like grid function, drawing dashed horizontal lines across plot. hgrid=NULL, lines drawn values displayed, 1 number values vertical axis. user can pass explicit values desired. horizontal optionally vertical grid lines, centipede plot practically equivalent dotplot error bars. Similarly, centipede plots typically large number subsets, may necessary start graphics device aspect ratio prevent crowding labels 30 segments displayed. matrix segs may entered manually read file. first row specifies midpoints, second third rows lower upper limits respectively fourth row number valid observations. values number valid observations, just pass vector blank strings right.labels argument. dstat object passed segs, function calculate lower upper values according relevant arguments. type plot also known caterpillar plot league table.","code":""},{"path":"/reference/centipede.plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a centipede plot — centipede.plot","text":"nil.","code":""},{"path":"/reference/centipede.plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a centipede plot — centipede.plot","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/centipede.plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a centipede plot — centipede.plot","text":"","code":"testcp<-list(\"\",40) for(i in 1:40) testcp[[i]]<-rnorm(sample(1:8,1)*50) segs<-get.segs(testcp) centipede.plot(segs,main=\"Test centipede plot\",vgrid=0) #> Warning: argument 1 does not name a graphical parameter # now leave out the number of valid observations, pass x labels and no right labels centipede.plot(segs[1:3,],main=\"Test centipede plot\",vgrid=0,mar=c(4,5,3,2), left.labels=paste(\"X\",1:40,sep=\"\"),right.labels=rep(\"\",40)) #> Warning: argument 1 does not name a graphical parameter"},{"path":"/reference/clean.args.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove inappropriate arguments from an argument list — clean.args","title":"Remove inappropriate arguments from an argument list — clean.args","text":"Takes list arguments eliminates appropriate passing particular function (hence produce error passed).","code":""},{"path":"/reference/clean.args.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove inappropriate arguments from an argument list — clean.args","text":"","code":"clean.args(argstr,fn,exclude.repeats=FALSE,exclude.other=NULL,dots.ok=TRUE) remove.args(argstr,fn)"},{"path":"/reference/clean.args.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove inappropriate arguments from an argument list — clean.args","text":"argstr named list arguments, e.g. \\dots fn function exclude.repeats (logical) remove repeated arguments? exclude.character vector names additional arguments remove dots.ok \"...\" allowed argument list?","code":""},{"path":"/reference/clean.args.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove inappropriate arguments from an argument list — clean.args","text":"clean.args returns list copy argstr arguments inappropriate fn removed; remove.args removes arguments fn list.","code":""},{"path":"/reference/clean.args.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Remove inappropriate arguments from an argument list — clean.args","text":"Ben Bolker","code":""},{"path":"/reference/clean.args.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove inappropriate arguments from an argument list — clean.args","text":"","code":"tststr <- list(n=2,mean=0,sd=1,foo=4,bar=6) clean.args(tststr,rnorm) #> $n #> [1] 2 #> #> $mean #> [1] 0 #> #> $sd #> [1] 1 #> try(do.call(\"rnorm\",tststr)) #> Error in rnorm(n = 2, mean = 0, sd = 1, foo = 4, bar = 6) : #> unused arguments (foo = 4, bar = 6) do.call(\"rnorm\",clean.args(tststr,rnorm)) #> [1] 1.061975 -2.725278 remove.args(tststr,rnorm) #> $foo #> [1] 4 #> #> $bar #> [1] 6 #> ## add example of combining arg. lists?"},{"path":"/reference/clock24.plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot values on a 24 hour ","title":"Plot values on a 24 hour ","text":"clock24.plot displays plot radial lines, symbols polygon centered midpoint plot frame 24 hour 'clockface'. contrast default behavior radial.plot, positions interpreted beginning vertical (000) moving clockwise. add=TRUE passed one additional arguments, values added current plot. radial.lim argument passed initial plot, must passed add values values displayed incorrectly.","code":""},{"path":"/reference/clock24.plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot values on a 24 hour ","text":"","code":"clock24.plot(lengths,clock.pos,labels=0:23,minutes=FALSE, hm2dec=FALSE,label.pos=NULL,rp.type=\"r\",loglen=FALSE,explab=FALSE,...)"},{"path":"/reference/clock24.plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot values on a 24 hour ","text":"lengths numeric data vector. Magnitudes represented line lengths, symbol polygon vertex positions. clock.pos numeric vector positions 'clockface'. must decimal hours rescaled radians. labels Labels place circumference. minutes Whether add minutes (\".00\") labels. hm2dec Whether convert HH:MM clock positions decimal hours. label.pos Radial positions labels. rp.type Whether plot radial lines, symbols polygon. loglen Whether log transform length values. base 10 logs available. explab Whether use default fixed (FALSE) exponential (TRUE) notation radial labels. ... additional arguments passed radial.plot plot.","code":""},{"path":"/reference/clock24.plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot values on a 24 hour ","text":"list parameters altered radial.plot.","code":""},{"path":"/reference/clock24.plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot values on a 24 hour ","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/clock24.plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot values on a 24 hour ","text":"","code":"testlen<-rnorm(24)*2+5 testpos<-0:23+rnorm(24)/4 clock24.plot(testlen,testpos,main=\"Test Clock24 (lines)\",show.grid=FALSE, line.col=\"green\",lwd=3) if(dev.interactive()) par(ask=TRUE) # now do a 'daylight' plot oldpar<-clock24.plot(testlen[7:19],testpos[7:19], main=\"Test Clock24 daytime (symbols)\", point.col=\"blue\",rp.type=\"s\",lwd=3) # reset everything par(oldpar)"},{"path":"/reference/clplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot lines with colors determined by values. — clplot","title":"Plot lines with colors determined by values. — clplot","text":"clplot displays plot lines colors dependent upon x y values. clplot similar color.scale.lines except latter calculates color unique value, clplot assigns colors groups values within cutpoints defined levels.","code":""},{"path":"/reference/clplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot lines with colors determined by values. — clplot","text":"","code":"clplot(x,y,ylab=deparse(substitute(y)),xlab=deparse(substitute(x)), levels=seq(min(y)+(max(y)-min(y))/5,max(y)-(max(y)-min(y))/5,length.out=4), cols=c(\"black\",\"blue\",\"green\",\"orange\",\"red\"),lty=1,showcuts=FALSE,...)"},{"path":"/reference/clplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot lines with colors determined by values. — clplot","text":"x,y numeric data vectors. ylab,xlab Labels X Y axes. levels Cut points assign colors values x y. cols colors assigned. lty line type. showcuts Whether show positions cut points. ... additional arguments passed plot lines.","code":""},{"path":"/reference/clplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot lines with colors determined by values. — clplot","text":"nil","code":""},{"path":"/reference/clplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot lines with colors determined by values. — clplot","text":"Carl Witthoft","code":""},{"path":[]},{"path":"/reference/clplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot lines with colors determined by values. — clplot","text":"","code":"x<-seq(1,100) y<-sin(x/5)+x/20 clplot(x,y,main=\"Test of clplot\")"},{"path":"/reference/cluster.overplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Shift overlying points into clusters — cluster.overplot","title":"Shift overlying points into clusters — cluster.overplot","text":"cluster.overplot checks overlying points x y coordinates passed. points overlying moved form small cluster nine points. large numbers overlying points, see count.overplot sizeplot. unsure number overplots data, run count.overplot first see potential clusters larger nine.","code":""},{"path":"/reference/cluster.overplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Shift overlying points into clusters — cluster.overplot","text":"","code":"cluster.overplot(x,y,away=NULL,tol=NULL,...)"},{"path":"/reference/cluster.overplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shift overlying points into clusters — cluster.overplot","text":"x,y Numeric data vectors first two columns matrix data frame. Typically x/y coordinates points plotted. away far move overlying points user units. Defaults width lower case \"o\" x direction 5/8 height lower case \"o\" y direction. Must values. tol largest distance points considered overlying. Defaults 1/2 width lower case \"o\" x direction 1/2 height lower case \"o\" y direction. ... additional arguments returned passed.","code":""},{"path":"/reference/cluster.overplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Shift overlying points into clusters — cluster.overplot","text":"list two components. unique x-y pairs elements original. overlying points eight additional points generated create cluster points instead one.","code":""},{"path":"/reference/cluster.overplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Shift overlying points into clusters — cluster.overplot","text":"Jim Lemon - thanks Markus Elze test current graphics device","code":""},{"path":[]},{"path":"/reference/cluster.overplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Shift overlying points into clusters — cluster.overplot","text":"","code":"xy.mat<-cbind(sample(1:10,200,TRUE),sample(1:10,200,TRUE)) clusteredpoints<- cluster.overplot(xy.mat,col=rep(c(\"red\",\"green\"),each=100), away=rep(0.2,2)) #> Error in strwidth(\"o\"): plot.new has not been called yet plot(clusteredpoints,col=clusteredpoints$col, main=\"Cluster overplot test\") #> Error: object 'clusteredpoints' not found"},{"path":"/reference/clustered.dotplots.html","id":null,"dir":"Reference","previous_headings":"","what":"Display the frequencies of two categories — clustered.dotplots","title":"Display the frequencies of two categories — clustered.dotplots","text":"clustered.dotplots displays contingency table clusters symbols plot. expects xgroup ygroup contain combinations unique values. also expects freq contain number instances combination.","code":""},{"path":"/reference/clustered.dotplots.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display the frequencies of two categories — clustered.dotplots","text":"","code":"clustered.dotplots(xgroup, ygroup, freq, type = \"circles\", main=\"\",xlab=\"\",ylab=\"\",x_las=1,y_las=1,axes=TRUE,size=1,...)"},{"path":"/reference/clustered.dotplots.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display the frequencies of two categories — clustered.dotplots","text":"xgroup,ygroup Vectors specify two groupings displayed (see Details). freq frequencies two groupings. type type symbols use \"dots\". main,xlab,ylab plot. x_las,y_las Orientation axis tick labels. axes Whether display axes. size Spacing clusters. ... additional arguments passed \"points\".","code":""},{"path":"/reference/clustered.dotplots.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display the frequencies of two categories — clustered.dotplots","text":"nil","code":""},{"path":"/reference/clustered.dotplots.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display the frequencies of two categories — clustered.dotplots","text":"Darshan Baral","code":""},{"path":[]},{"path":"/reference/clustered.dotplots.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display the frequencies of two categories — clustered.dotplots","text":"","code":"df <- structure(list(set = c(\"09t0101 TJ\", \"09t0102 MW\", \"09t0201 EH\", \"09t0202 NH\", \"09t0101 TJ\", \"09t0102 MW\", \"09t0201 EH\", \"09t0202 NH\", \"09t0101 TJ\", \"09t0102 MW\", \"09t0201 EH\", \"09t0202 NH\", \"09t0101 TJ\", \"09t0102 MW\", \"09t0201 EH\", \"09t0202 NH\", \"09t0202 NH\"), grade = c(\"1\", \"1\", \"1\", \"1\", \"2\", \"2\", \"2\", \"2\", \"3\", \"3\", \"3\", \"3\", \"4\", \"4\", \"4\", \"4\", \"5\"), freq = c(7, 8, 2, 3, 11, 4, 11, 3, 3, 8, 3, 8, 3, 9, 3, 2, 5)), .Names = c(\"set\", \"grade\", \"freq\"), row.names = c(NA, 17L), class = \"data.frame\") clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq) clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq, col = \"gray\") clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq, type = \"points\") clustered.dotplots(xgroup = df$set, ygroup = df$grade, freq = df$freq, type = \"points\", pch = 19, col = \"red\") # this will cause an error # clustered.dotplots(xgroup = mtcars$cyl, ygroup = mtcars$gear, # freq = mtcars$carb) # how to fix it cumcars<-by(mtcars$carb,list(mtcars$cyl,mtcars$gear),valid.n) mtcars2<-data.frame(cyl=NA,gear=NA,carb=NA) rownum<-1 for(cyl in dimnames(cumcars)[[1]]) { for(gear in dimnames(cumcars)[[2]]) { if(!is.na(cumcars[cyl,gear])) { mtcars2[rownum,]<-c(as.numeric(cyl),as.numeric(gear),cumcars[cyl,gear]) rownum<-rownum+1 } } } clustered.dotplots(xgroup = mtcars2$cyl, ygroup = mtcars2$gear, freq = mtcars2$carb,main=\"Cars by number of cylinders and gears\", xlab=\"Number of cylinders\",ylab=\"Number of gears\",type=\"points\",pch=5)"},{"path":"/reference/color.axis.html","id":null,"dir":"Reference","previous_headings":"","what":"Display an axis in a specified color — color.axis","title":"Display an axis in a specified color — color.axis","text":"color.axis displays axis specified color.","code":""},{"path":"/reference/color.axis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display an axis in a specified color — color.axis","text":"","code":"color.axis(side=1,at=NULL,labels=TRUE,axlab=NA,axlab.at=NA, col=par(\"fg\"),cex.axis=par(\"cex.axis\"),cex=par(\"cex\"))"},{"path":"/reference/color.axis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display an axis in a specified color — color.axis","text":"side axis - see axis. Positions tick labels. labels Tick labels. axlab Optional axis label. axlab.position axis label - defaults centered. col Color axis. cex.axis Character expansion tick labels. cex Character expansion axis label.","code":""},{"path":"/reference/color.axis.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display an axis in a specified color — color.axis","text":"nil","code":""},{"path":"/reference/color.axis.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display an axis in a specified color — color.axis","text":"Jim Lemon","code":""},{"path":"/reference/color.gradient.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate an arbitrary sequence of colors — color.gradient","title":"Calculate an arbitrary sequence of colors — color.gradient","text":"color.gradient now just call color.scale vector equally spaced integers (1:nslices). function kept backward compatibility.","code":""},{"path":"/reference/color.gradient.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate an arbitrary sequence of colors — color.gradient","text":"","code":"color.gradient(reds,greens,blues,nslices=50)"},{"path":"/reference/color.gradient.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate an arbitrary sequence of colors — color.gradient","text":"reds,greens,blues vectors values color components 0 1. nslices number color \"slices\".","code":""},{"path":"/reference/color.gradient.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Calculate an arbitrary sequence of colors — color.gradient","text":"function mainly useful defining set colors represent known number gradations. set can used assign grade small number values (e.g. points scatterplot - see color.scale large numbers) display color bar using gradient.rect legend.","code":""},{"path":"/reference/color.gradient.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate an arbitrary sequence of colors — color.gradient","text":"vector hexadecimal color values used col.","code":""},{"path":"/reference/color.gradient.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate an arbitrary sequence of colors — color.gradient","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/color.gradient.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate an arbitrary sequence of colors — color.gradient","text":"","code":"# try it with red and blue endpoints and green midpoints. color.gradient(c(0,1),c(1,0.6,0.4,0.3,0),c(0.1,0.6)) #> [1] \"#00FF1AFF\" \"#05F71CFF\" \"#0AEE1FFF\" \"#10E621FF\" \"#15DD24FF\" \"#1AD527FF\" #> [7] \"#1FCC29FF\" \"#24C32CFF\" \"#2ABB2EFF\" \"#2FB331FF\" \"#34AA34FF\" \"#39A236FF\" #> [13] \"#3E9939FF\" \"#44993BFF\" \"#49943EFF\" \"#4E9041FF\" \"#538B43FF\" \"#588646FF\" #> [19] \"#5E8248FF\" \"#637D4BFF\" \"#68794EFF\" \"#6D7450FF\" \"#726F53FF\" \"#786B55FF\" #> [25] \"#7D6658FF\" \"#82665BFF\" \"#87645DFF\" \"#8D6160FF\" \"#925F62FF\" \"#975D65FF\" #> [31] \"#9C5A68FF\" \"#A1586AFF\" \"#A7566DFF\" \"#AC536FFF\" \"#B15172FF\" \"#B64F75FF\" #> [37] \"#BB4D77FF\" \"#C14D7AFF\" \"#C6467CFF\" \"#CB407FFF\" \"#D03982FF\" \"#D53384FF\" #> [43] \"#DB2D87FF\" \"#E02689FF\" \"#E5208CFF\" \"#EA1A8FFF\" \"#EF1391FF\" \"#F50D94FF\" #> [49] \"#FA0696FF\" \"#FF0099FF\""},{"path":"/reference/color.id.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify closest match to a color — color.id","title":"Identify closest match to a color — color.id","text":"Given color specified hex string, find closest match table known (named) colors","code":""},{"path":"/reference/color.id.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify closest match to a color — color.id","text":"","code":"color.id(col)"},{"path":"/reference/color.id.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify closest match to a color — color.id","text":"col color specified hex string","code":""},{"path":"/reference/color.id.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Identify closest match to a color — color.id","text":"finds color minimum squared distance RGB space","code":""},{"path":"/reference/color.id.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify closest match to a color — color.id","text":"name closest match","code":""},{"path":"/reference/color.id.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Identify closest match to a color — color.id","text":"Ben Bolker","code":""},{"path":[]},{"path":"/reference/color.id.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify closest match to a color — color.id","text":"","code":"color.id(\"#cc00cc\") #> [1] \"magenta3\""},{"path":"/reference/color.legend.html","id":null,"dir":"Reference","previous_headings":"","what":"Legend matching categories or values to colors — color.legend","title":"Legend matching categories or values to colors — color.legend","text":"Display color legend plot","code":""},{"path":"/reference/color.legend.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Legend matching categories or values to colors — color.legend","text":"","code":"color.legend(xl,yb,xr,yt,legend,rect.col,cex=1,align=\"lt\",gradient=\"x\",...)"},{"path":"/reference/color.legend.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Legend matching categories or values to colors — color.legend","text":"xl,yb,xr,yt lower left upper right coordinates rectange colors user coordinates. legend labels appear next colors. rect.col colors fill rectangle. cex Character expansion factor labels. align align labels relative color rectangle. gradient Whether horizontal (x) vertical (y) color gradient. ... Additional arguments passed text.","code":""},{"path":"/reference/color.legend.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Legend matching categories or values to colors — color.legend","text":"nil","code":""},{"path":"/reference/color.legend.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Legend matching categories or values to colors — color.legend","text":"color.legend displays rectangle defined first four arguments filled smaller rectangles color defined rect.col argument. Labels, defined legend argument, placed next color rectangle. position labels determined whether color rectangle horizontal vertical align argument. default value lt places labels left vertical rectangle top horizontal one. rb puts side. labels color rectangles, include col argument passed text example. can fewer labels colors. labels evenly spaced along rectangle case. possible use empty labels get uneven spacing. user can pass labels colors, labels almost certainly crowded found one use . user wants labels intersection boxes rather center, see alternative specification labels example (thanks Claudia Tebaldi). complete control labels, see gradient.rect text mtext. colorlegend shape package offers different approach, creating large number colors color generating function (bit like color.gradient) allowing user specify tick marks arbitrary points along color bar.","code":""},{"path":"/reference/color.legend.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Legend matching categories or values to colors — color.legend","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/color.legend.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Legend matching categories or values to colors — color.legend","text":"","code":"# get some extra room par(mar=c(7,4,4,6)) testcol<-color.gradient(c(0,1),0,c(1,0),nslices=5) col.labels<-c(\"Cold\",\"Warm\",\"Hot\") # this will put the labels at the intersections # col.labels<-c(\"\",\"Cold\",\"\",\"Warm\",\"\",\"Warmer\",\"\",\"Hot\",\"\") color2D.matplot(matrix(rnorm(100),nrow=10),c(1,0),0,c(0,1), main=\"Test color legends\") color.legend(11,6,11.8,9,col.labels,testcol,gradient=\"y\") color.legend(10.2,2,11,5,col.labels,testcol,align=\"rb\",gradient=\"y\") color.legend(0.5,-2,3.5,-1.2,col.labels,testcol) color.legend(7,-1.8,10,-1,col.labels,testcol,align=\"rb\",col=testcol[c(1,3,5)]) par(mar=c(5,4,4,2))"},{"path":"/reference/color.scale.html","id":null,"dir":"Reference","previous_headings":"","what":"Turn values into colors. — color.scale","title":"Turn values into colors. — color.scale","text":"Transform numeric values colors using RGB, HSV HCL","code":""},{"path":"/reference/color.scale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Turn values into colors. — color.scale","text":"","code":"color.scale(x,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1),alpha=1, extremes=NA,na.color=NA,xrange=NULL,color.spec=\"rgb\")"},{"path":"/reference/color.scale.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Turn values into colors. — color.scale","text":"x numeric vector, matrix data frame cs1,cs2,cs3 color parameters scaling x alpha Value transparency colors. one value passed, alpha values transformed like colors. extremes colors extreme values x (RGB ). na.color color use NA values x. xrange explicit range use transformation. color.spec color specification use transformation. Anything \"rgb\", \"hsv\" \"hcl\" almost certainly fail.","code":""},{"path":"/reference/color.scale.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Turn values into colors. — color.scale","text":"color.scale calculates sequence colors linear transformation numeric values supplied ranges three color parameters. one number supplied color range, color remains constant values x. two values supplied, x values split equal ranges (one less number colors) transformation carried range. Values color range must 0 1 RGB HSV specifications, 0 360 (cs1) 0 100 (cs2 cs3) HCL specifications. IMPORTANT: x fewer values number values color parameters, usually return incorrect colors. usually problem using color.legend small number rectangles legend color.legend calls color.scale calculate color rectangles. extremes NA, ranges calculated values using col2rgb, even ranges also supplied. extremes allows user just pass extreme color values format col2rgb accept. Note forces color specification RGB. user wants specify range values xrange, must least include range x values. can useful notional range like 0-100% values cover, several series values different ranges assigned color scale. user may want color scheme continuous across critical point, often zero. case, color.scale can called separately values zero. may get around adding argument one shot. , see second example color2D.matplot also diverge.hcl diverge.hsv functions colorspace package. passing one alpha value, transformed like colors. allows matrices concentrations high values overplotted illustrate group locations separations. See iris example color2D.matplot.","code":""},{"path":"/reference/color.scale.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Turn values into colors. — color.scale","text":"function useful highlighting numeric dimension adding extra \"dimension\" plot. quite R functions transform numeric values colors produce colors can used represent values. Two packages might interest RColorBrewer colourschemes. See last example approximating color scales color.scale.","code":""},{"path":"/reference/color.scale.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Turn values into colors. — color.scale","text":"vector matrix hexadecimal color values.","code":""},{"path":"/reference/color.scale.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Turn values into colors. — color.scale","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/color.scale.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Turn values into colors. — color.scale","text":"","code":"# go from green through yellow to red with no blue x<-rnorm(20) y<-rnorm(20) # use y for the color scale plot(x,y,col=color.scale(y,c(0,1,1),c(1,1,0),0),main=\"Color scale plot\", pch=16,cex=2) plot(1:10,rep(1:3,length.out=10),axes=FALSE,type=\"n\",xlim=c(0,11),ylim=c(0,4), main=\"Test of RGB, HSV and HCL\",xlab=\"\",ylab=\"Color specification\") axis(2,at=1:3,labels=c(\"HCL\",\"HSV\",\"RGB\")) points(1:10,rep(1,10),pch=19,cex=8,col=color.scale(1:10,c(0,300),35,85, color.spec=\"hcl\")) points(1:10,rep(2,10),pch=19,cex=8,col=color.scale(1:10,c(0,1), 0.8,1,color.spec=\"hsv\")) points(1:10,rep(3,10),pch=19,cex=8,col=color.scale(1:10,c(1,0.5,0), c(0,0.5,0),c(0,0,1),color.spec=\"rgb\")) if (FALSE) { # \\dontrun{ # requires viridisLite library(viridisLite) plot(0,xlim=c(-1,1),ylim=c(-1,1),type=\"n\",axes=FALSE, main=\"Approximating other color scales\",xlab=\"\",ylab=\"\") gradient.rect(-1,0.8,1,0.95,nslices=50, col=color.scale(1:50,1, c(0,0.3,0.6,0.8,1,1), c(0,0,0,0,0,0,1))) text(0,1,\"color.scale\") gradient.rect(-1,0.65,1,0.8,col=heat.colors(50)) text(0,0.6,\"heat.colors\") gradient.rect(-1,0.3,1,0.45,nslices=50, col=color.scale(1:50,c(0,0.2,0.9,0.95,0.95), c(0.7,0.8,0.9,0.7,0.95), c(0.1,0,0,0.35,0.95))) text(0,0.5,\"color.scale\") gradient.rect(-1,0.15,1,0.3,col=terrain.colors(50)) text(0,0.1,\"terrain.colors\") gradient.rect(-1,-0.2,1,-0.05,nslices=50, col=color.scale(1:50,c(0.3,0,0.3,0.1,1,0.95,1), c(0,0.3,0.9,1,1,0.85,0.85), c(1,1,0.9,0.1,0,0.5,0.5))) text(0,0,\"color.scale\") gradient.rect(-1,-0.35,1,-0.2,col=topo.colors(50)) text(0,-0.4,\"topo.colors\") gradient.rect(-1,-0.7,1,-0.55,nslices=50, col=color.scale(1:50,c(0.3,0.2,0,0.4,0.95), c(0.1,0.3,0.6,0.75,0.95), c(0.3,0.6,0.5,0.4,0))) text(0,-0.5,\"color.scale\") gradient.rect(-1,-0.85,1,-0.7,col=viridis(50)) text(0,-0.9,\"viridis\") } # }"},{"path":"/reference/color.scale.lines.html","id":null,"dir":"Reference","previous_headings":"","what":"Line segments with scaled colors — color.scale.lines","title":"Line segments with scaled colors — color.scale.lines","text":"Display line segments colors scaled numeric values.","code":""},{"path":"/reference/color.scale.lines.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Line segments with scaled colors — color.scale.lines","text":"","code":"color.scale.lines(x,y,reds,greens,blues,col=NA,colvar=NA,...)"},{"path":"/reference/color.scale.lines.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Line segments with scaled colors — color.scale.lines","text":"x,y Numeric vectors list least two components, first two must named x y. reds,greens,blues Color ranges scale numeric values. col One colors use resultant lines. recycled necessary. colvar numeric vector scale colors. ... Additional arguments passed segments.","code":""},{"path":"/reference/color.scale.lines.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Line segments with scaled colors — color.scale.lines","text":"color.scale.lines displays line segments can individually colored according variety methods. order precedence, col NA, color values passed used. colvar NA, function call color.scale three color range arguments determine line colors. colvar length length(x)-1, exactly enough colors number lines displayed calculated. shorter, colors recycled longer, colors used. Finally, values y color-scaled arguments NA. Thus user can pass predetermined colors, use colors scaled arbitrary vector numerical values use y values. See color.scale explanation specifying color ranges.","code":""},{"path":"/reference/color.scale.lines.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Line segments with scaled colors — color.scale.lines","text":"function useful highlighting numeric dimension adding extra \"dimension\" plot.","code":""},{"path":"/reference/color.scale.lines.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Line segments with scaled colors — color.scale.lines","text":"nil","code":""},{"path":"/reference/color.scale.lines.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Line segments with scaled colors — color.scale.lines","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/color.scale.lines.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Line segments with scaled colors — color.scale.lines","text":"","code":"# color a random walk \"hot\" (red) to \"cold\" (blue) on its distance # from the starting point x<-c(0,cumsum(rnorm(99))) y<-c(0,cumsum(rnorm(99))) xydist<-sqrt(x*x+y*y) plot(x,y,main=\"Random walk plot\",xlab=\"X\",ylab=\"Y\",type=\"n\") color.scale.lines(x,y,c(1,1,0),0,c(0,1,1),colvar=xydist,lwd=2) boxed.labels(x,y,labels=1:100,border=FALSE,cex=0.5) # now color the lines to show whether each step went away from # or toward the starting position color.scale.lines(x,y,col=2+(diff(xydist)>0)) boxed.labels(x,y,labels=1:100,border=FALSE,cex=0.5)"},{"path":"/reference/color2D.matplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a numeric matrix as color matrix — color2D.matplot","title":"Display a numeric matrix as color matrix — color2D.matplot","text":"Display values numeric 2D matrix data frame colored rectangles hexagons.","code":""},{"path":"/reference/color2D.matplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a numeric matrix as color matrix — color2D.matplot","text":"","code":"color2D.matplot(x,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1), extremes=NA,cellcolors=NA,show.legend=FALSE,nslices=10,xlab=\"Column\", ylab=\"Row\",do.hex=FALSE,axes=TRUE,show.values=FALSE,vcol=NA,vcex=1, border=\"black\",na.color=NA,xrange=NULL,color.spec=\"rgb\",yrev=TRUE, xat=NULL,yat=NULL,Hinton=FALSE,add=FALSE,...)"},{"path":"/reference/color2D.matplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a numeric matrix as color matrix — color2D.matplot","text":"x data values cs1,cs2,cs3 color parameters scaled represent range numeric values. (see color.scale) extremes colors extreme values x. Takes precedence color ranges. cellcolors precalculated matrix cell colors. must number rows columns matrix uninformative. can vector, careTakes precedence extremes color ranges. show.legend whether display color legend extreme numeric values lower left corner plot. force color specification \"rgb\", different color specification requested, call color.legend separately. nslices number color \"slices\" legend. xlab,ylab axis labels plot. .hex plot packed hexagons instead rectangles. axes Whether suppress default axis labelling. show.values Whether display numeric values x. also controls number decimal places displayed. vcol color value display. NA, values displayed black white depending upon darkness cell color. vcex character expansion value display. border color(s) borders cells. Pass NA border wanted. na.color color use NA values x. xrange explicit range transformation colors. see color.scale color.spec color specification system use. yrev Whether reverse order y-axis display cells \"reading\" order (left right top bottom) TRUE, order typical plot (left right bottom top) FALSE. xat,yat Values place tick marks override pretty. Hinton Whether display Hinton diagram magnitude cell values proportional size squares sign indicated color squares. add TRUE, plot created rectangles displayed whatever current device (see \"iris\" example). ... arguments passed plot.","code":""},{"path":"/reference/color2D.matplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a numeric matrix as color matrix — color2D.matplot","text":"nil","code":""},{"path":"/reference/color2D.matplot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a numeric matrix as color matrix — color2D.matplot","text":"Displays plot number rectangular hexagonal cells numeric values matrix data frame. rectangle colored represent corresponding value. rectangles arranged conventional display 2D matrix rows beginning top columns left. get rows beginning bottom, use yrev=FALSE. color scale defaults black minimum value white maximum. user adjust plot device dimensions get regular squares hexagons, especially matrix square. margins equivalent display devices, currently matter trial error. Drawing hexagons quite slow. show.values show.legend also used control number decimal places displayed values legend shown. TRUE give one decimal place, 2 two, . Hinton TRUE, Hinton diagram sizes squares proportional absolute value x colors squares indicate sign x values displayed. works squares. add true, color matrix added current plot. probably useful displaying plots mostly transparent.","code":""},{"path":"/reference/color2D.matplot.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Display a numeric matrix as color matrix — color2D.matplot","text":"function image performs almost passed matrix values without grid positions, except assigns values specified list colors rather calculating color distinct value.","code":""},{"path":"/reference/color2D.matplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a numeric matrix as color matrix — color2D.matplot","text":"Jim Lemon (thanks Ashoka Polpitiya axes)","code":""},{"path":[]},{"path":"/reference/color2D.matplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a numeric matrix as color matrix — color2D.matplot","text":"","code":"x<-matrix(rnorm(1024),nrow=32) # simulate a correlation matrix with values -0.5 to 0.5 x<-rescale(x,c(-0.5,0.5)) # add a column with the extreme values (-1,1) to calculate # the colors, then drop the extra column in the result cellcol<-color.scale(cbind(x,c(-1,rep(1,31))),c(0,1),0,c(1,0))[,1:32] color2D.matplot(x,cellcolors=cellcol,main=\"Blue to red correlations\") # do the legend call separately to get the full range color.legend(0,-4,10,-3,legend=c(-1,-0.5,0,0.5,1), rect.col=color.scale(c(-1,-0.5,0,0.5,1),c(0,1),0,c(1,0)),align=\"rb\") x<-matrix(rnorm(100),nrow=10) # generate colors that show negative values in red to brown # and positive in blue-green to green cellcol<-matrix(rep(\"#000000\",100),nrow=10) cellcol[x<0]<-color.scale(x[x<0],c(1,0.8),c(0,0.8),0) cellcol[x>0]<-color.scale(x[x>0],0,c(0.8,1),c(0.8,0)) # now do hexagons without borders color2D.matplot(x,cellcolors=cellcol,xlab=\"Columns\",ylab=\"Rows\", do.hex=TRUE,main=\"2D matrix plot (hexagons)\",border=NA) # for this one, we have to do the color legend separately # because of the two part color scaling legval<-seq(min(x),max(x),length.out=6) legcol<-rep(\"#000000\",6) legcol[legval<0]<-color.scale(legval[legval<0],c(1,0.8),c(0,0.8),0) legcol[legval>0]<-color.scale(legval[legval>0],0,c(0.8,1),c(0.8,0)) color.legend(0,-1.8,3,-1.4,round(c(min(x),0,max(x)),1),rect.col=legcol) # do a color only association plot xt<-table(sample(1:10,100,TRUE),sample(1:10,100,TRUE)) observed<-xt[,rev(1:dim(xt)[2])] expected<-outer(rowSums(observed),colSums(observed),\"*\")/sum(xt) deviates<-(observed-expected)/sqrt(expected) cellcol<-matrix(rep(\"#000000\",100),nrow=10) cellcol[deviates<0]<- color.scale(deviates[deviates<0],c(1,0.8),c(0,0.5),0) cellcol[deviates>0]<- color.scale(deviates[deviates>0],0,c(0.7,0.8),c(0.5,0)) color2D.matplot(x=round(deviates,2),cellcolors=cellcol, show.values=TRUE,main=\"Association plot\") # Hinton diagram border.col<-color.scale(x,extremes=2:3) color2D.matplot(x,extremes=c(2,3),main=\"Hinton diagram (green +, red -)\", Hinton=TRUE,border=border.col) # waffle plot of percentages with two contributing elements waffle.col<-fill.corner(c(rep(\"red\",18),rep(\"blue\",45)),10,10) color2D.matplot(matrix(1:100,nrow=10),cellcolors=waffle.col,yrev=FALSE, border=\"lightgray\",xlab=\"\",ylab=\"\",main=\"Waffle plot\",axes=FALSE) # coarse density plot of the iris petal data spnames<-unique(iris$Species) spcols<-c(\"red\",\"green\",\"blue\") matmax<-list() cindx<-1 for(isp in spnames) { petal_mat<-makeDensityMatrix(iris[iris$Species == isp,\"Petal.Length\"], iris[iris$Species == isp,\"Petal.Width\"], nx=20,ny=20,xlim=c(1,7),ylim=c(0,2.5),geocoord=FALSE) # center the maximum markers in the cells matmax[[cindx]]<-lapply(find_max_cell(petal_mat),\"-\",0.5) if(isp == \"setosa\") color2D.matplot(petal_mat,main=\"Iris petal length by petal width\", xlab=\"Petal length (cm)\",ylab=\"Petal width (cm)\",axes=FALSE, cellcolors=color.scale(petal_mat,extremes=spcols[cindx],alpha=c(0,1)), border=NA,yrev=FALSE) else color2D.matplot(petal_mat,border=NA,yrev=FALSE,add=TRUE, cellcolors=color.scale(petal_mat,extremes=spcols[cindx],alpha=c(0,1))) cindx<-cindx+1 } #> Range of density (>0) - 1 20 #> Range of density (>0) - 1 9 #> Range of density (>0) - 1 6 axis(1,at=seq(0,20,by=3.33),labels=1:7) axis(2,at=seq(0,20,length.out=4),labels=seq(1,2.5,by=0.5)) legend(1,6,paste0(spnames,\"(\",1:3,\")\"),fill=c(\"red\",\"green\",\"blue\")) for(cindx in 1:3) text(matmax[[cindx]],as.character(cindx),col=\"white\",cex=1.5)"},{"path":"/reference/corner.label.html","id":null,"dir":"Reference","previous_headings":"","what":"Find corner locations and optionally display a label — corner.label","title":"Find corner locations and optionally display a label — corner.label","text":"Finds coordinates user parameters specified corner figure region optionally displays label ","code":""},{"path":"/reference/corner.label.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find corner locations and optionally display a label — corner.label","text":"","code":"corner.label(label=NULL,x=-1,y=1,xoff=NA,yoff=NA,figcorner=FALSE,...)"},{"path":"/reference/corner.label.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find corner locations and optionally display a label — corner.label","text":"label Text display. default display nothing. x integer value: -1 left side plot, 1 right side y integer value: -1 bottom side plot, 1 top side xoff,yoff Horizontal vertical text offsets. Defaults one half width height \"m\" respectively. figcorner Whether find/display corner plot figure. ... arguments text command label","code":""},{"path":"/reference/corner.label.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find corner locations and optionally display a label — corner.label","text":"corner.label finds specified corner plot figure label NULL, displays . text justification specified label justified away corner. get label squeezed right corner, set xoff yoff zero.","code":""},{"path":"/reference/corner.label.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find corner locations and optionally display a label — corner.label","text":"list x y positions corner adjusted offsets.","code":""},{"path":"/reference/corner.label.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find corner locations and optionally display a label — corner.label","text":"Ben Bolker","code":""},{"path":"/reference/corner.label.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find corner locations and optionally display a label — corner.label","text":"","code":"plot(1:10,1:10) corner.label(\"A\") #> $x #> [1] 0.64 #> #> $y #> [1] 10.36 #> corner.label(x=1,y=1) #> $x #> [1] 10.36 #> #> $y #> [1] 10.36 #> corner.label(\"B\",y=-1,x=1,figcorner=TRUE,col=\"red\") #> $x #> [1] 11.11229 #> #> $y #> [1] -1.414088 #>"},{"path":"/reference/count.overplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Show overlying points as counts — count.overplot","title":"Show overlying points as counts — count.overplot","text":"count.overplot checks overlying points defined points separated maximum tol, two element numeric vector x y tolerance. Defaults 1/2 width lower case \"o\" x direction 1/2 height lower case \"o\" y direction.","code":""},{"path":"/reference/count.overplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show overlying points as counts — count.overplot","text":"","code":"count.overplot(x,y,tol=NULL,col=par(\"fg\"),pch=\"1\",...)"},{"path":"/reference/count.overplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show overlying points as counts — count.overplot","text":"x,y Two numeric data vectors first two columns matrix data frame. Typically x/y coordinates points plotted. tol largest distance points considered overlying. col Color(s) points (numbers). pch Symbol(s) display. ... additional arguments passed plot.","code":""},{"path":"/reference/count.overplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Show overlying points as counts — count.overplot","text":"nil","code":""},{"path":"/reference/count.overplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Show overlying points as counts — count.overplot","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/count.overplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Show overlying points as counts — count.overplot","text":"","code":"xy.mat<-cbind(sample(1:10,200,TRUE),sample(1:10,200,TRUE)) count.overplot(xy.mat,main=\"count.overplot\", xlab=\"X values\",ylab=\"Y values\") #> Error in strwidth(\"o\"): plot.new has not been called yet"},{"path":"/reference/cylindrect.html","id":null,"dir":"Reference","previous_headings":"","what":"Display an apparent cylinder — cylindrect","title":"Display an apparent cylinder — cylindrect","text":"Display rectangles shaded appear like cylinders.","code":""},{"path":"/reference/cylindrect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display an apparent cylinder — cylindrect","text":"","code":"cylindrect(xleft,ybottom,xright,ytop,col,border=NA,gradient=\"x\",nslices=50)"},{"path":"/reference/cylindrect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display an apparent cylinder — cylindrect","text":"xleft position left side rectangle(s). ybottom position bottom rectangle(s). xright position right side rectangle(s). ytop position top side rectangle(s). col base color(s) rectangles. border Whether draw border color. gradient Whether vary shading horizontally (\"x\" - default) vertically (anything \"x\"). nslices number \"slices\" color shading.","code":""},{"path":"/reference/cylindrect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display an apparent cylinder — cylindrect","text":"base color(s) rectangle(s).","code":""},{"path":"/reference/cylindrect.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display an apparent cylinder — cylindrect","text":"cylindrect displays rectangle filled \"slices\" color simulate appearance cylinder. slices calculated base color appears right bottom edge rectangle, becomes progressively lighter \"highlight\" two thirds width height darkens toward base color . appearance cylinder lit left viewer. position apparent light source hard coded function.","code":""},{"path":"/reference/cylindrect.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display an apparent cylinder — cylindrect","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/cylindrect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display an apparent cylinder — cylindrect","text":"","code":"plot(0,xlim=c(0,5),ylim=c(0,5),main=\"Examples of pseudocylindrical rectangles\", xlab=\"\",ylab=\"\",axes=FALSE,type=\"n\") cylindrect(0,0,1,5,\"red\") cylindrect(rep(1,3),c(0,2,4),rep(4,3),c(1,3,5),\"green\",gradient=\"y\") cylindrect(4,0,5,5,\"#8844aa\")"},{"path":"/reference/death_reg.html","id":null,"dir":"Reference","previous_headings":"","what":"Death registrations from 1996 to 2010 — death_reg","title":"Death registrations from 1996 to 2010 — death_reg","text":"Death registrations underlying cause death ICD-10 chapters 1996 2010.","code":""},{"path":"/reference/death_reg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Death registrations from 1996 to 2010 — death_reg","text":"","code":"data(death_reg)"},{"path":"/reference/dendroPlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display distributions as dendrites — dendroPlot","title":"Display distributions as dendrites — dendroPlot","text":"Display distributions one sets points branching (dendritic) clusters.","code":""},{"path":"/reference/dendroPlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display distributions as dendrites — dendroPlot","text":"","code":"dendroPlot(x,breaks=list(10,10,10),pch=1,col=par(\"fg\"),cex=1,nudge=NA, setlabels=NA,...)"},{"path":"/reference/dendroPlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display distributions as dendrites — dendroPlot","text":"x list data frame numeric factor character columns. breaks list cutpoints transform numeric values factors (see cut). Must least one number >= 2. pch Symbol(s) use plotting values. col Color(s) symbols. cex Size symbol(s) use plotting. nudge amount set consecutive value category away center dendrite. setlabels Labels place along abcissa identify sets. ... arguments passed plot.","code":""},{"path":"/reference/dendroPlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display distributions as dendrites — dendroPlot","text":"dendroPlot displays distributions categorical values stacks \"branches\". lengths branches show number values category, rather like opposed bars pyramid plot, except separation groups. distribution numeric values can also displayed passing set breakpoints categorize values. breakpoints usually equidistant, unevenly spaced breakpoints can passed. element x numeric, values corresponding x element used place points, branches defined categories formed applying breaks numeric values. Note first example, breakpoints first third elements used define ten branches . second element x already categorical, breakpoints ignored. comparing distributions different ranges may necessary adjust breakpoints get satisfactory result. successive point category nudged away center dendrite. nudge one value, points nudged categorical variables enable closer packing. second value nudge ignored numeric variables. aspect ratio plot, character expansion nudging adjusted give best point spacing dendroPlots.","code":""},{"path":"/reference/dendroPlot.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Display distributions as dendrites — dendroPlot","text":"ehplot function much versatile instantiation type plot. dendroPlot retained currently differences users may find valuable. However, impossible dendroPlot disappear future. Another useful version type plot beeswarm beeswarm package.","code":""},{"path":"/reference/dendroPlot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display distributions as dendrites — dendroPlot","text":"nil","code":""},{"path":"/reference/dendroPlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display distributions as dendrites — dendroPlot","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/dendroPlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display distributions as dendrites — dendroPlot","text":"","code":"x<-list(runif(90,1,3),factor(sample(LETTERS[1:10],100,TRUE)),rnorm(80,mean=5)) dendroPlot(x,xlab=\"Groups\",ylab=\"Value of x\",main=\"Test dendroPlot I\") # now apply a nudge factor and different breaks dendroPlot(x,breaks=list(8,10,10),nudge=c(0.05,0.1), xlab=\"Groups\",ylab=\"Value of x\",main=\"Test dendroPlot II\")"},{"path":"/reference/densityGrid.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a matrix of cell values as symbols. — densityGrid","title":"Display a matrix of cell values as symbols. — densityGrid","text":"Displays matrix values symbols existing image.","code":""},{"path":"/reference/densityGrid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a matrix of cell values as symbols. — densityGrid","text":"","code":"densityGrid(x,z=NULL,xrange=NA,zrange=NA,range.cex=c(1,10), xlim=c(-180,180),ylim=c(-90,90),red=c(0,1),green=c(0,1),blue=c(0,1),alpha=1, pch=\".\",geocoord=TRUE)"},{"path":"/reference/densityGrid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a matrix of cell values as symbols. — densityGrid","text":"x Matrix values representing counts cells (usually locations). z Optional matrix values attached cells x. xrange,zrange Explicit ranges counts x z. Used define \"pretty\" set values label legends. range.cex range expansion symbols used indicate number counts cells. xlim extreme coordinates horizontal direction (see Details). ylim extreme coordinates vertical direction (see Details). red,green,blue Values RGB colorspace use transforming cell values colors. alpha Transparency colors. pch symbol use displaying observation density. Either \".\" 15 seem work well depending upon resolution grid. geocoord Whether size symbols indicate density intensity values corrected Mercator projection.","code":""},{"path":"/reference/densityGrid.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a matrix of cell values as symbols. — densityGrid","text":"densityGrid expects one matrix list two matrices containing values transformed colors sizes symbols displayed. two matrices may passed list. one matrix present, color symbols determined values (counts) matrix. second matrix passed, values matrix used determine colors, size symbols proportional values first matrix. case one matrix, user set first value range.cex desired expansion symbols. Currently densityGrid display anything grid cells zero count values. densityGrid developed allow large numbers coordinate locations accumulated matrix display geographic map. Thus default limits refer coordinates latitude/longitude earth. geographic data numerous memory limits exceeded, underlying makeDensityMatrix function can run small sections entire data set resulting matrices added long initial coordinate limits used throughout. Note values counts (one matrix) intensity (two matrices) cover large range, may necessary trim extreme values (noting legends) transform data (usually log10) get good color separation.","code":""},{"path":"/reference/densityGrid.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a matrix of cell values as symbols. — densityGrid","text":"nil. Displays grid symbols existing plot device.","code":""},{"path":"/reference/densityGrid.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a matrix of cell values as symbols. — densityGrid","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/densityGrid.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a matrix of cell values as symbols. — densityGrid","text":"","code":"if (FALSE) { # \\dontrun{ data(l2010) # log10 transform both density and intensity l2010[[1]]<-log10(l2010[[1]]) l2010[[2]]<-log10(l2010[[2]]) library(maps) x11(width=10) par(mar=c(7,3,2,3)) plot(0,xlim=c(-180,180),ylim=c(-90,90),type=\"n\",axes=FALSE,xlab=\"\",ylab=\"\") densityGrid(l2010,pch=\".\",xrange=c(0,6),zrange=c(2,8),range.cex=c(2,8), red=c(0,0.5,1),green=c(0,1,0),blue=c(1,0,0),alpha=1) color.legend(-60,-107,60,-97,c(\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\"), rect.col=color.scale(1:7,cs1=c(0,0.5,1),cs2=c(0,1,0),cs3=c(1,0,0),alpha=1), cex=0.5) par(xpd=TRUE) text(0,95,\"Lightning strikes 2010\") text(0,-114,\"Mean intensity kVA (10^n)\",cex=0.5) points(x=seq(-60,60,20),y=rep(-125,7),pch=\".\",cex=1:7) text(x=seq(-60,60,20),y=rep(-132,7),c(\"<=1\",\"2\",\"3\",\"4\",\"5\",\"6\",\">6\"),cex=0.5) text(0,-142,\"Cell frequency (10^n)\",cex=0.5) par(xpd=FALSE) map(\"world\",mar=c(7,3,2,3),add=TRUE) dev.off() # now only Australia par(mar=c(7,3,2,3)) plot(0,xlim=c(112,154),ylim=c(-43.8,-11.1),type=\"n\",axes=FALSE,xlab=\"\",ylab=\"\") densityGrid(l2010,pch=\".\",xrange=c(0,6),zrange=c(2,8),range.cex=c(2,8), xlim=c(112,154),ylim=c(-43.8,-11.1),red=c(0,0.5,1),green=c(0,1,0), blue=c(1,0,0),alpha=1) color.legend(120,-47,146,-45,c(\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\"), rect.col=color.scale(1:7,cs1=c(0,0.5,1),cs2=c(0,1,0),cs3=c(1,0,0),alpha=1), cex=0.5) par(xpd=TRUE) text(133,-9,\"Lightning strikes 2010 (Australia)\") text(133,-48.2,\"Mean intensity kVA (10^n)\",cex=0.5) points(x=seq(121,145,4),y=rep(-50,7),pch=\".\",cex=1:7) text(x=seq(121,145,4),y=rep(-51,7),c(\"<=1\",\"2\",\"3\",\"4\",\"5\",\"6\",\">6\"),cex=0.5) text(133,-52,\"Cell frequency (10^n)\",cex=0.5) par(xpd=FALSE) map(\"world\",mar=c(7,3,2,3),xlim=c(112,154),ylim=c(-43.8,-11.1),add=TRUE) } # }"},{"path":"/reference/diamondplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot multiple variables as polygons on a radial grid — diamondplot","title":"Plot multiple variables as polygons on a radial grid — diamondplot","text":"diamondplot displays plot polygons radial grid representing relationships one attributes data objects. slightly different style plot, see \"spiderweb plot\" example radial.plot.","code":""},{"path":"/reference/diamondplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot multiple variables as polygons on a radial grid — diamondplot","text":"","code":"diamondplot(x, bg=gray(0.6), col=rainbow,name=\"\", ...)"},{"path":"/reference/diamondplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot multiple variables as polygons on a radial grid — diamondplot","text":"x data frame containing numeric values represent attributes (possibly repeated observations) data objects. See example. bg background color plot. col colors polygons. name title plot (.e. main). ... additional arguments passed plot.","code":""},{"path":"/reference/diamondplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot multiple variables as polygons on a radial grid — diamondplot","text":"nil","code":""},{"path":"/reference/diamondplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot multiple variables as polygons on a radial grid — diamondplot","text":"Elisa Biancotto","code":""},{"path":[]},{"path":"/reference/diamondplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot multiple variables as polygons on a radial grid — diamondplot","text":"","code":"data(mtcars) mysubset<-mtcars[substr(dimnames(mtcars)[[1]],1,1)==\"M\",c(\"mpg\",\"hp\",\"wt\",\"disp\")] diamondplot(mysubset)"},{"path":"/reference/dispersion.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a measure of dispersion. — dispersion","title":"Display a measure of dispersion. — dispersion","text":"Display lines capped bars specified points plot representing measures dispersion.","code":""},{"path":"/reference/dispersion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a measure of dispersion. — dispersion","text":"","code":"dispersion(x,y,ulim,llim=ulim,intervals=TRUE,arrow.cap=0.01,arrow.gap=NA, type=\"a\",fill=NA,lty=NA,pch=NA,border=NA,col=par(\"fg\"),display.na=TRUE, ...)"},{"path":"/reference/dispersion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a measure of dispersion. — dispersion","text":"x,y x y position centers bars ulim,llim extent dispersion measures. arrow.cap width cap outer end bar proportion width plot. arrow.gap gap leave inner end bar. Defaults two thirds height capital \"O\". intervals Whether limits intervals (TRUE) absolute values (FALSE). type type display use. fill Color fill lines type NULL fill NA. lty Line type redrawing lines necessary. pch Symbol redrawing points necessary. border Line type drawing border confidence band. col Color lines capped bars. display.na Whether display NA values lines going plot. ... additional arguments passed arrows lines depending upon type.","code":""},{"path":"/reference/dispersion.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a measure of dispersion. — dispersion","text":"dispersion displays measure dispersion existing plot. Currently display either vertical lines caps (error bars) lines form \"confidence band\" around line central tendency. fill NA type \"l\", polygon drawn confidence lines. Remember points lines within confidence band obscured, pass point /line types second example. default behavior display undefined dispersion (e.g. variance one observation) line going plot. display.na FALSE, NA values displayed, allowing user show upper lower dispersion limits. intervals argument allows user pass limits either intervals (default) absolute values. arrow.gap greater equal upper lower limit bar, segments used draw upper lower caps bars avoid zero length arrows.","code":""},{"path":"/reference/dispersion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a measure of dispersion. — dispersion","text":"nil","code":""},{"path":"/reference/dispersion.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a measure of dispersion. — dispersion","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/dispersion.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a measure of dispersion. — dispersion","text":"","code":"disptest<-matrix(rnorm(200),nrow=20) disptest.means<-rowMeans(disptest) row.order<-order(disptest.means) se.disptest<-unlist(apply(disptest,1,std.error)) plot(disptest.means[row.order],main=\"Dispersion as error bars\", ylim=c(min(disptest.means-se.disptest),max(disptest.means+se.disptest)), xlab=\"Occasion\",ylab=\"Value\") dispersion(1:20,disptest.means[row.order],se.disptest[row.order]) plot(disptest.means[row.order],main=\"Dispersion as confidence band\", ylim=c(min(disptest.means-se.disptest),max(disptest.means+se.disptest)), xlab=\"Occasion\",ylab=\"Value\") dispersion(1:20,disptest.means[row.order],se.disptest[row.order],type=\"l\", fill=\"#eeccee\",lty=2,pch=1) disptest2<-matrix(sample(c(TRUE,FALSE),200,TRUE),nrow=10) disptest.prop<-rowMeans(disptest2) disptest.ulim<-disptest.llim<-rep(NA,10) for(i in 1:10) { disptest.ulim[i]<-binciWu(disptest2[i,],20) disptest.llim[i]<-binciWl(disptest2[i,],20) } plot(disptest.prop,main=\"Dispersion as binomial confidence intervals\", ylim=c(min(disptest.llim),max(disptest.ulim)), xlab=\"Sample\",ylab=\"Proportion\") dispersion(1:10,disptest.prop,disptest.ulim,disptest.llim, interval=FALSE,lty=2,pch=1)"},{"path":"/reference/do.first.html","id":null,"dir":"Reference","previous_headings":"","what":"Execute a graphic function on a plot — do.first","title":"Execute a graphic function on a plot — do.first","text":".first allows user execute one commands displaying values plot.","code":""},{"path":"/reference/do.first.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Execute a graphic function on a plot — do.first","text":".first argument plotrix functions allows user things like add background color grid plot displaying plot elements. value .first character string can parsed one valid R commands. Remember enclose string quotes, separate commands semicolons escape quotes within string backslashes necessary.","code":""},{"path":"/reference/dotplot.mtb.html","id":null,"dir":"Reference","previous_headings":"","what":"Minitab style dotplots. — dotplot.mtb","title":"Minitab style dotplots. — dotplot.mtb","text":"Create dotplot data vector sense \"dotplot\" used Minitab\\(\\mbox{\\copyright}\\) package.","code":""},{"path":"/reference/dotplot.mtb.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Minitab style dotplots. — dotplot.mtb","text":"","code":"dotplot.mtb(x, xlim = NULL, main = NULL, xlab = NULL, ylab = NULL, pch = 19, hist = FALSE, yaxis = FALSE, mtbstyle=TRUE)"},{"path":"/reference/dotplot.mtb.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Minitab style dotplots. — dotplot.mtb","text":"x numeric vector. xlim x limits plot. main title plot; defaults blank. xlab label x axis; defaults blank. ylab label y axis; defaults blank. pch plotting symbol dots plot; defaults solid disc. hist Logical scalar; plot done \"histogram\" style, .e. using vertical lines rather stacks dots? yaxis Logical scalar; y-axis produced? mtbstyle Logical scalar; dotplot done \"Minitab\" style? .e. zero level vertical midway point?","code":""},{"path":"/reference/dotplot.mtb.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Minitab style dotplots. — dotplot.mtb","text":"result hist=TRUE looks less ugly stacks dots large data sets.","code":""},{"path":"/reference/dotplot.mtb.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Minitab style dotplots. — dotplot.mtb","text":"Nothing. plot produced side effect.","code":""},{"path":"/reference/dotplot.mtb.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Minitab style dotplots. — dotplot.mtb","text":"Barry Rowlingson B.Rowlingson@lancaster.ac.uk Rolf Turner r.turner@auckland.ac.nz http://www.stat.auckland.ac.nz/~rolf","code":""},{"path":"/reference/dotplot.mtb.html","id":"warnings","dir":"Reference","previous_headings":"","what":"Warnings","title":"Minitab style dotplots. — dotplot.mtb","text":"function something toadally different dotplot() (now dotchart()) function graphics package. labelling y-axis device dependent.","code":""},{"path":"/reference/dotplot.mtb.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Minitab style dotplots. — dotplot.mtb","text":"","code":"if (FALSE) { # \\dontrun{ set.seed(42) x <- rpois(100,10) dotplot.mtb(x,main=\"No y-axis.\") dotplot.mtb(x,yaxis=TRUE,main=\"With y-axis displayed.\") dotplot.mtb(x,hist=TRUE,main=\"An \\\"h\\\" style plot.\") dotplot.mtb(x,xlim=c(4,16),main=\"With the x-axis limited.\") dotplot.mtb(x,yaxis=TRUE,mtbstyle=FALSE,main=\"Non-Minitab style.\") dotplot.mtb(x,yaxis=TRUE,xlab=\"x\",ylab=\"count\", main=\"With x and y axis labels.\") } # }"},{"path":"/reference/draw.arc.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw arc — draw.arc","title":"Draw arc — draw.arc","text":"Draw one arcs using classic graphics.","code":""},{"path":"/reference/draw.arc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw arc — draw.arc","text":"","code":"draw.arc(x=1,y=NULL,radius=1,angle1=deg1*pi/180,angle2=deg2*pi/180, deg1=0,deg2=45,n=0.05,col=NA,lwd=NA,...)"},{"path":"/reference/draw.arc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw arc — draw.arc","text":"x x coordinate center. Scalar vector. y y coordinate center. Scalar vector. radius radius. Scalar vector. angle1 Starting angle radians. Scalar vector. angle2 Ending angle radians. Scalar vector. deg1 Starting angle degrees. Scalar vector. deg2 Ending angle degrees. Scalar vector. n Number polygons use approximate arc. col Arc colors. lwd Line width arc. ... arguments passed segments. Vectorization supported .","code":""},{"path":"/reference/draw.arc.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Draw arc — draw.arc","text":"Draws one arcs angle1 angle2. angle1 numerically greater angle2, angles swapped. sure use aspect ratio 1 shown example avoid distortion. argument 'n' (may either scalar vector, although likely leave default value), integer value means use number segments approximate arc, non-integer value means use enough segments angle successive segments make one another n radians.","code":""},{"path":"/reference/draw.arc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Draw arc — draw.arc","text":"Returns matrix expanded arguments invisibly.","code":""},{"path":"/reference/draw.arc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Draw arc — draw.arc","text":"Gabor Grothendieck. Improvements Ted Toal.","code":""},{"path":"/reference/draw.arc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Draw arc — draw.arc","text":"","code":"plot(1:10, asp = 1,main=\"Test draw.arc\") draw.arc(5, 5, 1:10/10, deg2 = 1:10*10, col = \"blue\") draw.arc(8, 8, 1:10/10, deg2 = 1:10*10, col = 1:10) draw.arc(5, 5, 3, deg1=100, deg2=170, col=\"gold\", lwd=50, lend=1) # example taken from post by Hans Borcher: # https://stat.ethz.ch/pipermail/r-help/2009-July/205728.html # Note setting of aspect ratio to 1 first. curve(sin(x), 0, pi, col=\"blue\", asp=1) draw.arc(pi/2, 0, 1, deg1=45, deg2=135, col=\"red\")"},{"path":"/reference/draw.circle.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw a circle — draw.circle","title":"Draw a circle — draw.circle","text":"Draws circle existing plot.","code":""},{"path":"/reference/draw.circle.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw a circle — draw.circle","text":"","code":"draw.circle(x,y,radius,nv=100,border=NULL,col=NA,lty=1,density=NULL, angle=45,lwd=1)"},{"path":"/reference/draw.circle.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw a circle — draw.circle","text":"x,y Coordinates center circle. radius Radius (radii) circle(s) user units. nv Number vertices draw circle. border Color use drawing circumference. col Color use filling circle. lty Line type circumference. density Density patterned fill. See polygon. angle Angle patterned fill. See polygon. lwd Line width circumference.","code":""},{"path":"/reference/draw.circle.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Draw a circle — draw.circle","text":"list x y coordinates points circumference last circle displayed.","code":""},{"path":"/reference/draw.circle.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Draw a circle — draw.circle","text":"draw.circle uses dimensions plot x y coordinates draw circle rather ellipse.","code":""},{"path":"/reference/draw.circle.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Draw a circle — draw.circle","text":"Jim Lemon, thanks David Winsemius density angle args","code":""},{"path":[]},{"path":"/reference/draw.circle.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Draw a circle — draw.circle","text":"","code":"plot(1:5,seq(1,10,length=5),type=\"n\",xlab=\"\",ylab=\"\",main=\"Test draw.circle\") draw.circle(2,4,c(1,0.66,0.33),border=\"purple\", col=c(\"#ff00ff\",\"#ff77ff\",\"#ffccff\"),lty=1,lwd=1) draw.circle(2.5,8,0.6,border=\"red\",lty=3,lwd=3) draw.circle(4,3,0.7,border=\"green\",col=\"yellow\",lty=1, density=5,angle=30,lwd=10) draw.circle(3.5,8,0.8,border=\"blue\",lty=2,lwd=2)"},{"path":"/reference/draw.ellipse.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw ellipse — draw.ellipse","title":"Draw ellipse — draw.ellipse","text":"Draws ellipses existing plot.","code":""},{"path":"/reference/draw.ellipse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw ellipse — draw.ellipse","text":"","code":"draw.ellipse(x, y, a = 1, b = 1, angle = 0, segment = NULL, arc.only = TRUE, deg = TRUE, nv = 100, border = NULL, col = NA, lty = 1, lwd = 1, ...)"},{"path":"/reference/draw.ellipse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw ellipse — draw.ellipse","text":"x vector matrix (y missing). y vector, can missing. ,b Vectors, radii ellypses along two axes user units. angle Angle rotation degrees (deg=TRUE) radians (deg=FALSE). segment Start endpoints arc degrees (deg=TRUE) radians (deg=FALSE). arc.Logical, segmen full ellipse drawn, radii ends arc drawn form sector (see Examples). deg Logical, angles given degrees (TRUE) radians. nv Number vertices draw ellipses. border Color use drawing circumference. col Color use filling circle. lty Line type circumference. lwd Line width circumference. ... Additional arguments passed polygon.","code":""},{"path":"/reference/draw.ellipse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Draw ellipse — draw.ellipse","text":"Draw ellipses side effect.","code":""},{"path":"/reference/draw.ellipse.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Draw ellipse — draw.ellipse","text":"Peter Solymos ","code":""},{"path":[]},{"path":"/reference/draw.ellipse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Draw ellipse — draw.ellipse","text":"","code":"plot(c(0,10), c(0,10), type=\"n\", main=\"test draw.ellipse\") draw.ellipse(c(3,7), c(8,8), c(0.5,1), c(1,0.5), col=c(2,4), angle=c(45,0), segment=rbind(c(0,45),c(45,360))) draw.ellipse(c(3,7), c(6,6), c(0.5,1), c(1,0.5), col=c(2,4), angle=c(45,0), segment=rbind(c(0,45),c(45,360)), arc.only=FALSE) draw.ellipse(c(3,7), c(4,4), c(0.5,1), c(1,0.5), border=c(2,4), angle=c(45,0), segment=rbind(c(0,45),c(45,360)), arc.only=FALSE) draw.ellipse(c(3,7), c(2,2), c(0.5,1), c(1,0.5), border=1, angle=c(45,0), lty=3) draw.ellipse(c(3,7), c(2,2), c(0.5,1), c(1,0.5), border=c(5,3), angle=c(45,0), nv=c(3,4), lty=2, lwd=2)"},{"path":"/reference/draw.radial.line.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw a radial line — draw.radial.line","title":"Draw a radial line — draw.radial.line","text":"Draws line radiating specified center, optionally expanding line width function distance center.","code":""},{"path":"/reference/draw.radial.line.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw a radial line — draw.radial.line","text":"","code":"draw.radial.line(start, end, center=c(0, 0), angle=0, deg=NA, expand=FALSE, col=NA, lwd=NA, ...)"},{"path":"/reference/draw.radial.line.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw a radial line — draw.radial.line","text":"start Distance center circular area start line x/y user units. end Distance center circular area end line x/y user units. center center circular area x/y user units. angle angular position line radians. deg angular position line degrees (takes precedence NA). expand TRUE expand line width proportion distance center. col color line, NA par(\"col\"). lwd width line device-specific units, NA par(\"lwd\"). ... Arguments passed 'lines' (expand=FALSE) 'polygon' (expand=TRUE).","code":""},{"path":"/reference/draw.radial.line.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Draw a radial line — draw.radial.line","text":"nil","code":""},{"path":"/reference/draw.radial.line.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Draw a radial line — draw.radial.line","text":"user passes value 'deg', overrides value passed 'angle'. 'expand' FALSE, line width constant (specified par(\"lwd\"). 'expand' TRUE, line width equal lwd value distance 'end' contracts moves towards 'start'. expand 'TRUE', lty ignored.","code":""},{"path":"/reference/draw.radial.line.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Draw a radial line — draw.radial.line","text":"Ted Toal","code":""},{"path":[]},{"path":"/reference/draw.radial.line.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Draw a radial line — draw.radial.line","text":"","code":"plot(0, xlim=c(1,5), ylim=c(1,5), main=\"Test of radial lines\", xlab=\"\", ylab=\"\", type=\"n\") points(3, 3, pch=20) draw.radial.line(1, 2, center=c(3,3)) draw.radial.line(1, 2, center=c(3,3), angle=pi/4) draw.radial.line(1, 2, center=c(3,3), angle=pi/4+0.1, col=\"blue\", lwd=4, lty=3) draw.radial.line(0.2, 1.2, center=c(3,3), deg=120, col=\"red\", lwd=10) draw.radial.line(0.2, 1.2, center=c(3,3), deg=145, col=\"purple\", lwd=10, lend=1) draw.radial.line(0.5, 2, center=c(3,3), deg=225, expand=TRUE, col=\"gold\") draw.radial.line(0.7, 1.4, center=c(3,3), deg=180, expand=TRUE, col=\"orange\", lwd=30) draw.radial.line(0.5, 1.5, center=c(3,3), deg=235, expand=TRUE, lwd=5, col=\"brown\") draw.radial.line(0.1, 1.5, center=c(3,3), deg=325, expand=TRUE, lwd=5, col=\"green\")"},{"path":"/reference/draw.tilted.sector.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a 3D pie sector — draw.tilted.sector","title":"Display a 3D pie sector — draw.tilted.sector","text":"Displays 3D pie sector.","code":""},{"path":"/reference/draw.tilted.sector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a 3D pie sector — draw.tilted.sector","text":"","code":"draw.tilted.sector(x=0,y=0,edges=NA,radius=1,height=0.1,theta=pi/6, start=0,end=pi*2,border=par(\"fg\"),col=par(\"bg\"),explode=0,shade=0.8)"},{"path":"/reference/draw.tilted.sector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a 3D pie sector — draw.tilted.sector","text":"x,y Position center pie sector user units edges Number edges draw complete ellipse radius radius pie user units height height pie user units theta angle viewing radians start Starting angle sector end Ending angle sector border color sector border lines col Color sector explode far \"explode\" sectors user units shade > 0 < 1, proportion reduce brightness sector color get better 3D effect.","code":""},{"path":"/reference/draw.tilted.sector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a 3D pie sector — draw.tilted.sector","text":"bisector pie sector radians.","code":""},{"path":"/reference/draw.tilted.sector.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a 3D pie sector — draw.tilted.sector","text":"draw.tilted.sector displays single 3D pie sector. probably useful called pie3D. shade argument proportionately reduces brightness RGB color sector produce top lighted effect. explode zero, top outer side sector displayed. sometimes fix problem pie one huge sector greater 3*pi/2 otherwise drawn.","code":""},{"path":"/reference/draw.tilted.sector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a 3D pie sector — draw.tilted.sector","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/drawNestedBars.html","id":null,"dir":"Reference","previous_headings":"","what":"Display nested bars — drawNestedBars","title":"Display nested bars — drawNestedBars","text":"Displays nested bars barNest.","code":""},{"path":"/reference/drawNestedBars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display nested bars — drawNestedBars","text":"","code":"drawNestedBars(x,start,end,shrink=0.1,errbars=FALSE,intervals=TRUE,col=NA, labelcex=1,lineht=NULL,showall=TRUE,Nwidths=FALSE,barlabels=NULL, showlabels=TRUE,arrow.cap=NA)"},{"path":"/reference/drawNestedBars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display nested bars — drawNestedBars","text":"x One level breakdown produced brkdnNest. start,end left right x coordinates bar group bars displayed. shrink proportion shrink width bars level. errbars Whether display error bars bars. intervals Whether use offsets absolute values displaying measures dispersion. col colors use fill bars. See Details. labelcex Character size group labels. lineht height margin line user units. showall Whether display bars levels last. Nwidths Whether scale widths bars number observations. barlabels Optional labels display bars. showlabels Whether display labels bars. arrow.cap width \"cap\" error bars user units, defaulting 0.01 width plot.","code":""},{"path":"/reference/drawNestedBars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display nested bars — drawNestedBars","text":"nil","code":""},{"path":"/reference/drawNestedBars.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display nested bars — drawNestedBars","text":"drawNestedBars displays bars nested breakdown performed brkdnNest. starts top list calls level breakdown. unlikely useful anything else. combination showlabels=TRUE showall=FALSE allows display labels plot last set bars displayed. set labels displayed, pass explicit barlabels zero length labels level labels.","code":""},{"path":"/reference/drawNestedBars.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display nested bars — drawNestedBars","text":"Jim Lemon Ofir Levy","code":""},{"path":[]},{"path":"/reference/drawSectorAnnulus.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a radial pie sector — drawSectorAnnulus","title":"Display a radial pie sector — drawSectorAnnulus","text":"Displays radial pie sector optional annuli.","code":""},{"path":"/reference/drawSectorAnnulus.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a radial pie sector — drawSectorAnnulus","text":"","code":"drawSectorAnnulus(angle1,angle2,radius1,radius2,col,angleinc=0.03)"},{"path":"/reference/drawSectorAnnulus.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a radial pie sector — drawSectorAnnulus","text":"angle1,angle2 Start end angle sector. radius1,radius2 Start end radial extent annulus. col Color sector. angleinc angular increment use drawing arcs.","code":""},{"path":"/reference/drawSectorAnnulus.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a radial pie sector — drawSectorAnnulus","text":"nil","code":""},{"path":"/reference/drawSectorAnnulus.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a radial pie sector — drawSectorAnnulus","text":"drawSectorAnnulus displays single radial pie sector. probably useful called radial.pie.","code":""},{"path":"/reference/drawSectorAnnulus.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a radial pie sector — drawSectorAnnulus","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/ehplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Engelmann-Hecker-Plot - EH-Plot — ehplot","title":"Engelmann-Hecker-Plot - EH-Plot — ehplot","text":"R function provides convenient way visualize distribution grouped numerical data.","code":""},{"path":"/reference/ehplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Engelmann-Hecker-Plot - EH-Plot — ehplot","text":"","code":"ehplot(data, groups, intervals=50, offset=0.1, log=FALSE, median=TRUE, box=FALSE, boxborder=\"grey50\", xlab=\"groups\", ylab=\"values\", col=\"black\", add=FALSE, sort=TRUE, ...)"},{"path":"/reference/ehplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Engelmann-Hecker-Plot - EH-Plot — ehplot","text":"data Vector numerical data. groups Vector group names length data. intervals data splitted certain number intervals. data points interval drawn side--side. offset x-distance two data points interval. log Logarithmic display median show median group. NAs data considered calculating medians. box underlay boxplot. boxborder color boxplot boxplot drawn. xlab x-axis label ylab y-axis label col vector colors datapoints. (recycled necessary). add add plot existing one (.e. call plot.new). sort normally, groups sorted name. keep order provided groups-vector, set FALSE ... additional plot-parameters passed plot-function","code":""},{"path":"/reference/ehplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Engelmann-Hecker-Plot - EH-Plot — ehplot","text":"Robby Engelmann Michael Hecker ","code":""},{"path":"/reference/ehplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Engelmann-Hecker-Plot - EH-Plot — ehplot","text":"","code":"data(iris) ehplot(iris$Sepal.Length, iris$Species, intervals=20, cex=1.8, pch=20) ehplot(iris$Sepal.Width, iris$Species, intervals=20, box=TRUE, median=FALSE) #> Warning: Some points are overplotted in group virginica. Please consider using a lower offset-value. ehplot(iris$Petal.Length, iris$Species, pch=17, col=\"red\", log=TRUE) #> Warning: Some points are overplotted in group setosa. Please consider using a lower offset-value. ehplot(iris$Petal.Length, iris$Species, offset=0.06, pch=as.numeric(iris$Species)) # Groups don't have to be presorted: rnd <- sample(150) plen <- iris$Petal.Length[rnd] pwid <- abs(rnorm(150, 1.2)) spec <- iris$Species[rnd] ehplot(plen, spec, pch=19, cex=pwid, col=rainbow(3, alpha=0.6)[as.numeric(spec)]) #> Warning: Some points are overplotted in group setosa. Please consider using a lower offset-value."},{"path":"/reference/election.html","id":null,"dir":"Reference","previous_headings":"","what":"Assign party members to seats — election","title":"Assign party members to seats — election","text":"Create layout election result assembly","code":""},{"path":"/reference/election.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assign party members to seats — election","text":"","code":"election(seats,result,formula,colours = sample(rainbow(length(counts))))"},{"path":"/reference/election.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assign party members to seats — election","text":"seats data frame x y positions, row numbers angles (usually output seats function). result data frame party names seat counts. formula formula party name column left count column right. Think twiddle symbol \"got\". colours vector colours. missing random rainbow used. may cause Green parties show red.","code":""},{"path":"/reference/election.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assign party members to seats — election","text":"data frame including: x x positions seats plotted semi-circular arcs. y y positions seats plotted semi-circular arcs. r row numbers seat. theta angle seat, going pi zero radians. party labels party holding seat. colour colour assigned party.","code":""},{"path":"/reference/election.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Assign party members to seats — election","text":"Barry Rowlingson","code":""},{"path":[]},{"path":"/reference/election.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assign party members to seats — election","text":"","code":"# The EU parliament has 751 seats, and Wikipedia currently shows this eu = structure(list(colour = c(\"#3399FF\", \"#F0001C\", \"#0054A5\", \"#FFD700\", \"#990000\", \"#909090\", \"#32CD32\", \"#40E0D0\"), party = c(\"EPP\", \"S and D\", \"ECR\", \"ALDE\", \"GUE-NGL\", \"Non-Inscrits\", \"Greens-EFA\", \"EFDD\"), members = c(220L, 191L, 70L, 68L, 52L, 52L, 50L, 48L )), .Names = c(\"colour\", \"party\", \"members\"), row.names = c(NA, -8L), class = \"data.frame\") strasbourg = seats(751, 16) eugov = election(strasbourg, eu, party~members, colours=eu$colour) oldmar<-par(mar=c(2,4,4,2)) plot(eugov$x, eugov$y, col=eugov$colour, asp=1, pch=19, ylim=c(-2,2.5), xlab=\"\", ylab=\"\", main=\"EU Parliament 2014\", axes=FALSE) legend(-0.7,-0.3,eu$party,fill=eu$colour) par(oldmar) # or using ggplot2 if (FALSE) { # \\dontrun{ require(ggplot2) blank = theme(axis.line=element_blank(), axis.text.x=element_blank(), axis.text.y=element_blank(), axis.ticks=element_blank(), axis.title.x=element_blank(), axis.title.y=element_blank(), panel.background=element_blank(), panel.border=element_blank(), panel.grid.major=element_blank(), panel.grid.minor=element_blank(), plot.background=element_blank()) ggplot(eugov, aes(x=x,y=y,col=party)) + geom_point() + coord_fixed() + blank } # }"},{"path":"/reference/emptyspace.html","id":null,"dir":"Reference","previous_headings":"","what":"Find an empty space on a plot — emptyspace","title":"Find an empty space on a plot — emptyspace","text":"Try find largest empty rectangle plot.","code":""},{"path":"/reference/emptyspace.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find an empty space on a plot — emptyspace","text":"","code":"emptyspace(x,y=NULL)"},{"path":"/reference/emptyspace.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find an empty space on a plot — emptyspace","text":"x,y x y positions points plot.","code":""},{"path":"/reference/emptyspace.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find an empty space on a plot — emptyspace","text":"emptyspace searches pairs points plot find largest rectangular space within none points lie. guarantee space large enough fit legend text. Two alternatives largest.empty function Hmisc package maxEmptyRect function. maxEmptyRect generally outperform emptyspace, emptyspace sometimes find slightly smaller, \"squarer\" rectangle.","code":""},{"path":"/reference/emptyspace.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find an empty space on a plot — emptyspace","text":"x y coordinates center rectangle found.","code":""},{"path":"/reference/emptyspace.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find an empty space on a plot — emptyspace","text":"Ray Brownrigg","code":""},{"path":"/reference/emptyspace.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find an empty space on a plot — emptyspace","text":"","code":"x<-rnorm(100) y<-rnorm(100) plot(x,y,main=\"Find the empty space\",xlab=\"X\",ylab=\"Y\") es<-emptyspace(x,y) # use a transparent background so that any overplotted points are shown boxed.labels(es,labels=\"Here is the\\nempty space\",bg=\"transparent\")"},{"path":"/reference/fan.plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a fan plot — fan.plot","title":"Display a fan plot — fan.plot","text":"Displays numerical values arcs overlapping sectors.","code":""},{"path":"/reference/fan.plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a fan plot — fan.plot","text":"","code":"fan.plot(x,edges=200,radius=1,col=NULL,align.at=NULL,max.span=NULL, labels=NULL,labelpos=NULL,label.radius=1.2,align=\"left\",shrink=0.02, main=\"\",ticks=NULL,include.sumx=FALSE,...)"},{"path":"/reference/fan.plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a fan plot — fan.plot","text":"x Vector numbers. edges number edges draw circle. radius radius sectors. col colors fill sectors. align.align sectors (see Details). max.span angle maximal sector radians. default scale x sums 2*pi. labels Labels placed around sector arcs. labelpos Optional circumferential positions labels. label.radius far away sectors labels placed. May vector radius label. align Position alignment sectors (see Details). shrink much shrink successive sector user units. main Optional title plot. ticks number ticks appear sectors pie chart. Default ticks, TRUE gives number ticks equal integer sum x, fairly sensible x vector integers. include.sumx Whether include sum x values largest sector. ... Additional arguments passed polygon.","code":""},{"path":"/reference/fan.plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a fan plot — fan.plot","text":"fan.plot displays sectors much like pie chart except sectors overlapped. allows angular extents sectors visually compared much accurately viewer. Sectors plotted largest smallest, shrinking radius successive sector. sending output postscript device, resulting image can trimmed changing values BoundingBox header text editor.","code":""},{"path":"/reference/fan.plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a fan plot — fan.plot","text":"circumferential positions labels radians. returned order decreasing size values plotted.","code":""},{"path":"/reference/fan.plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a fan plot — fan.plot","text":"Jim Lemon, Anupam Tyagi","code":""},{"path":"/reference/fan.plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a fan plot — fan.plot","text":"","code":"iucn.df<-data.frame(area=c(\"Africa\",\"Asia\",\"Europe\",\"N&C America\", \"S America\",\"Oceania\"),threatened=c(5994,7737,1987,4716,5097,2093)) fan.plot(iucn.df$threatened,max.span=pi, labels=paste(iucn.df$area,iucn.df$threatened,sep=\"-\"), main=\"Threatened species by geographical area (fan.plot)\",ticks=276)"},{"path":"/reference/feather.plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display vectors along a horizontal reference line — feather.plot","title":"Display vectors along a horizontal reference line — feather.plot","text":"Displays vectors along line usually representing time position.","code":""},{"path":"/reference/feather.plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display vectors along a horizontal reference line — feather.plot","text":"","code":"feather.plot(r,theta,xpos,yref=0,use.arrows=TRUE, col.refline=\"lightgray\",fp.type=\"s\",main=\"\",xlab=\"\",ylab=\"\", xlabels=NULL,...)"},{"path":"/reference/feather.plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display vectors along a horizontal reference line — feather.plot","text":"r radii vectors theta direction vectors radians xpos start vector along reference line yref vertical position place reference line use.arrows whether put arrow heads ends vectors col.refline color reference line fp.type whether use \"standard\" coordinates (begin right move counterclockwise) \"meteorological\" coordinates (begin top move clockwise) interpreting values theta main title plot xlab label reference line ylab label vertical axis xlabels optional labels reference line ... additional arguments passed arrows segments","code":""},{"path":"/reference/feather.plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display vectors along a horizontal reference line — feather.plot","text":"function places vectors length r angle theta along reference line may represent time position value. user responsible spacing vectors overlap desired. Feather plots typically wider high. user probably want specify graphics device leave lots blank space plot.","code":""},{"path":"/reference/feather.plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display vectors along a horizontal reference line — feather.plot","text":"nil","code":""},{"path":"/reference/feather.plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display vectors along a horizontal reference line — feather.plot","text":"Jim Lemon, Eduardo Klein","code":""},{"path":[]},{"path":"/reference/feather.plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display vectors along a horizontal reference line — feather.plot","text":"","code":"dev.new(width=8,height=3) r<-0.6+rnorm(24)/5 theta<-c(seq(15*pi/16,pi/16,length.out=12), seq(17*pi/16,31*pi/16,length.out=12)) feather.plot(r,theta,xlabels=1:24, main=\"Standard Coordinates\",xlab=\"Time\",ylab=\"Value\") # rearrange theta for meteorological coordinates feather.plot(r,c(theta[19:24],rev(theta[7:18]),theta[1:6]),xlabels=1:24,fp.type=\"m\", main=\"Meteorological Coordinates\",xlab=\"Time\",ylab=\"Value\") dev.off() #> agg_record_1280622654 #> 2"},{"path":"/reference/fill.corner.html","id":null,"dir":"Reference","previous_headings":"","what":"Fill a ","title":"Fill a ","text":"Fills one corner matrix supplied values, leaving rest filled default value.","code":""},{"path":"/reference/fill.corner.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fill a ","text":"","code":"fill.corner(x,nrow,ncol,na.value=NA)"},{"path":"/reference/fill.corner.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fill a ","text":"x vector values. nrow,ncol number rows columns matrix returned. na.value default value unfilled cells.","code":""},{"path":"/reference/fill.corner.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fill a ","text":"fill.corner creates nrow ncol matrix fills lower left corner values supplied x. values x cells matrix, first nrow*ncol values inserted.","code":""},{"path":"/reference/fill.corner.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fill a ","text":"nrow ncol matrix containing values x.","code":""},{"path":"/reference/fill.corner.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fill a ","text":"Jim Lemon","code":""},{"path":"/reference/find_max_cell.html","id":null,"dir":"Reference","previous_headings":"","what":"Maximum (or minimum) value cell in a matrix. — find_max_cell","title":"Maximum (or minimum) value cell in a matrix. — find_max_cell","text":"Find indices maximum value matrix.","code":""},{"path":"/reference/find_max_cell.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Maximum (or minimum) value cell in a matrix. — find_max_cell","text":"","code":"find_max_cell(x,max=TRUE)"},{"path":"/reference/find_max_cell.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Maximum (or minimum) value cell in a matrix. — find_max_cell","text":"x numeric matrix max default return indices maximum value(s). max=FALSE returns minimum.","code":""},{"path":"/reference/find_max_cell.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Maximum (or minimum) value cell in a matrix. — find_max_cell","text":"list containing column (x) row (y) indices.","code":""},{"path":"/reference/find_max_cell.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Maximum (or minimum) value cell in a matrix. — find_max_cell","text":"Intended enable user mark cells color2D.matplot. Remember subtract 0.5 values center mark cell.","code":""},{"path":"/reference/find_max_cell.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Maximum (or minimum) value cell in a matrix. — find_max_cell","text":"Jim Lemon","code":""},{"path":"/reference/floating.pie.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a floating pie chart — floating.pie","title":"Display a floating pie chart — floating.pie","text":"Displays pie chart arbitrary position existing plot","code":""},{"path":"/reference/floating.pie.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a floating pie chart — floating.pie","text":"","code":"floating.pie(xpos=0,ypos=0,x,edges=200,radius=1,col=NULL,startpos=0, shadow=FALSE,shadow.col=c(\"#ffffff\",\"#cccccc\"),explode=0,...)"},{"path":"/reference/floating.pie.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a floating pie chart — floating.pie","text":"xpos,ypos x y position center pie chart x numeric vector value sector edges number lines forming circle radius radius pie user units col colors sectors - defaults rainbow startpos starting position drawing sectors radians. shadow Logical - whether draw shadow shadow.col Colors use shadow. explode much \"explode\" one sectors. ... graphical parameters passed polygon","code":""},{"path":"/reference/floating.pie.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a floating pie chart — floating.pie","text":"floating.pie displays pie chart optional shadow existing plot (see polygon.shadow). floating.pie now accepts NAs zeros x, simply ignores . floating.pie can useful multiple pie charts placed plot overlaying something else, like map.","code":""},{"path":"/reference/floating.pie.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a floating pie chart — floating.pie","text":"bisecting angle sectors radians. Useful placing text labels sector. values x zero NA, angle returned value. means user must adjust labels accordingly pie.labels called. floating.pie called graphics device, try open one appropriate dimensions. pie.labels called, ensure center pie chart explode values .","code":""},{"path":"/reference/floating.pie.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Display a floating pie chart — floating.pie","text":"pie charts, simplicity essential. Trying display complicated breakdown data rarely succeeds.","code":""},{"path":"/reference/floating.pie.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a floating pie chart — floating.pie","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/floating.pie.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a floating pie chart — floating.pie","text":"","code":"plot(1:5,type=\"n\",main=\"Floating Pie test\",xlab=\"\",ylab=\"\",axes=FALSE) box() polygon(c(0,0,5.5,5.5),c(0,3,3,0),border=\"#44aaff\",col=\"#44aaff\") floating.pie(1.7,3,c(2,4,4,2,8),radius=0.5, col=c(\"#ff0000\",\"#80ff00\",\"#00ffff\",\"#44bbff\",\"#8000ff\")) floating.pie(3.1,3,c(1,4,5,2,8),radius=0.5, col=c(\"#ff0000\",\"#80ff00\",\"#00ffff\",\"#44bbff\",\"#8000ff\")) floating.pie(4,1.5,c(3,4,6,7),radius=0.5, col=c(\"#ff0066\",\"#00cc88\",\"#44bbff\",\"#8000ff\")) draw.circle(3.9,2.1,radius=0.04,col=\"white\") draw.circle(3.9,2.1,radius=0.04,col=\"white\") draw.circle(3.9,2.1,radius=0.04,col=\"white\") draw.circle(4,2.3,radius=0.04,col=\"white\") draw.circle(4.07,2.55,radius=0.04,col=\"white\") draw.circle(4.03,2.85,radius=0.04,col=\"white\") text(c(1.7,3.1,4),c(3.7,3.7,3.7),c(\"Pass\",\"Pass\",\"Fail\")) plot(0,xlim=c(-1.5,1.5),ylim=c(-1.5,1.5),type=\"n\",axes=FALSE, main=\"Floating pie with minor explosions\",xlab=\"\",ylab=\"\") floating.pie(x=1:5,explode=c(0,0.1,0,0.2,0))"},{"path":"/reference/fullaxis.html","id":null,"dir":"Reference","previous_headings":"","what":"Add an axis with a line to the edge of the plot — fullaxis","title":"Add an axis with a line to the edge of the plot — fullaxis","text":"axis, draws \"box\" line color axis.","code":""},{"path":"/reference/fullaxis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add an axis with a line to the edge of the plot — fullaxis","text":"","code":"fullaxis(side=1,at=NULL,labels=TRUE,line=NA,pos=NA,outer=FALSE, font=NA,lty=\"solid\",lwd=1,lwd.ticks=lwd,col=NULL,col.ticks=NULL, hadj=NA,padj=NA,...)"},{"path":"/reference/fullaxis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add an axis with a line to the edge of the plot — fullaxis","text":"side side plot draw axis Optional positions user units tick marks. labels Optional labels tick marks. line Optional line margin. pos Optional position user units axis. Defaults edge. outer Whether use outer margin axis. font Font labels. lty Line type. lwd Line width axis. lwd.ticks Line width ticks. col color axis tick marks. See Details label color. col.ticks Color tick marks different axis. hadj,padj Justification labels. See axis. ... arguments passed axis.","code":""},{"path":"/reference/fullaxis.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add an axis with a line to the edge of the plot — fullaxis","text":"fullaxis draws line edges plot calls axis draw axis. fullaxis mainly useful drawing colored axis boxed plot. order get tick labels color axis ticks, pass col.axis argument (part ...) well col. See example useful tips.","code":""},{"path":"/reference/fullaxis.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add an axis with a line to the edge of the plot — fullaxis","text":"positions tick marks user units.","code":""},{"path":"/reference/fullaxis.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add an axis with a line to the edge of the plot — fullaxis","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/fullaxis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add an axis with a line to the edge of the plot — fullaxis","text":"","code":"plot(runif(20,-1,1),runif(20,-1,1),xlim=c(-1,1.5),main=\"Demo of fullaxis\", xlab=\"X\",ylab=\"Y\",axes=FALSE) fullaxis(1,col=\"red\",col.axis=\"red\") fullaxis(2,col=\"blue\",col.axis=\"blue\") fullaxis(4,at=c(-0.5,0,0.5),labels=c(\"Negative\",\"Zero\",\"Positive\"),pos=1.2, col=\"green\",las=1) # add a top line to complete the \"box\" xylim<-par(\"usr\") segments(xylim[1],xylim[4],xylim[2],xylim[4])"},{"path":"/reference/gantt.chart.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a Gantt chart — gantt.chart","title":"Display a Gantt chart — gantt.chart","text":"Displays Gantt chart priority coloring","code":""},{"path":"/reference/gantt.chart.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a Gantt chart — gantt.chart","text":"","code":"gantt.chart(x=NULL,format=\"%Y/%m/%d\",xlim=NULL,taskcolors=NULL, priority.legend=FALSE,vgridpos=NULL,vgridlab=NULL, vgrid.format=\"%Y/%m/%d\", half.height=0.25,hgrid=FALSE,main=\"\",xlab=\"\",cylindrical=FALSE, label.cex=1,border.col=NA,priority.label=\"Priorities\", priority.extremes=c(\"High\",\"Low\"),time.axis=3)"},{"path":"/reference/gantt.chart.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a Gantt chart — gantt.chart","text":"x list task labels, start/end times task priorities returned get.gantt.info. present, get.gantt.info called. format format used entering dates/times (see strptime). xlim horizontal limits plot (see Details). taskcolors vector colors used illustrate task priority. priority.legend Whether display priority color legend. vgridpos optional positions vertical grid lines. vgridlab optional labels vertical grid lines. vgrid.format format vertical grid labels. half.height proportion spacing task bars filled bar side - 0.5 leave space. hgrid logical - whether display grid lines bars. main title plot - note actually displayed using mtext. xlab horizontal axis label - usually suppressed. cylindrical Whether give bars cylindrical appearance. label.cex Relative size task labels left side. border.col color optional border bars (NA=none). priority.label Label priority color legend. priority.extremes Labels end priority color legend. time.axis place time axis labels.","code":""},{"path":"/reference/gantt.chart.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a Gantt chart — gantt.chart","text":"list used create chart - see get.gantt.info details. can saved reused rather manually entering information time chart displayed.","code":""},{"path":"/reference/gantt.chart.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a Gantt chart — gantt.chart","text":"\"time\" axis calculated using POSIXct values, values passed xlim must also POSIXct. See second plot examples. task priority colors wanted, set taskcolors single value suppress coloring. done, rainbow called generate different color task. colors rainbow wanted, remember pass enough colors one lowest (highest numerically) priority. can now one time interval task. , one bar displayed interval, may task , rather intervals related labels. Colors can specified labels intervals many colors intervals, first \"number unique labels\" colors assigned unique label. make every bar label color, aware colors distributed alphabetical order entity labels. least many taskcolors intervals, assigned intervals order taskcolors vector. examples make clearer. Since gantt.chart can used display things prioritized tasks, labels priority legend can now specified.","code":""},{"path":"/reference/gantt.chart.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a Gantt chart — gantt.chart","text":"Jim Lemon (original Scott Waichler - features Ulrike Gromping - added label colors Nicolas Immelman)","code":""},{"path":[]},{"path":"/reference/gantt.chart.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a Gantt chart — gantt.chart","text":"","code":"Ymd.format<-\"%Y/%m/%d\" gantt.info<-list(labels= c(\"First task\",\"Second task\",\"Third task\",\"Fourth task\",\"Fifth task\"), starts= as.POSIXct(strptime( c(\"2004/01/01\",\"2004/02/02\",\"2004/03/03\",\"2004/05/05\",\"2004/09/09\"), format=Ymd.format)), ends= as.POSIXct(strptime( c(\"2004/03/03\",\"2004/05/05\",\"2004/05/05\",\"2004/08/08\",\"2004/12/12\"), format=Ymd.format)), priorities=c(1,2,3,4,5)) vgridpos<-as.POSIXct(strptime(c(\"2004/01/01\",\"2004/02/01\",\"2004/03/01\", \"2004/04/01\",\"2004/05/01\",\"2004/06/01\",\"2004/07/01\",\"2004/08/01\", \"2004/09/01\",\"2004/10/01\",\"2004/11/01\",\"2004/12/01\"),format=Ymd.format)) vgridlab<- c(\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\") gantt.chart(gantt.info,main=\"Calendar date Gantt chart (2004)\", priority.legend=TRUE,vgridpos=vgridpos,vgridlab=vgridlab,hgrid=TRUE) # add a little extra space on the right side gantt.chart(gantt.info,main=\"Calendar date Gantt chart (2004)\", priority.legend=TRUE,vgridpos=vgridpos,vgridlab=vgridlab,hgrid=TRUE, xlim=as.POSIXct(strptime(c(\"2004/01/01\",\"2004/12/20\"), format=Ymd.format))) # if both vgidpos and vgridlab are specified, # starts and ends don't have to be dates info2<-list(labels=c(\"Jim\",\"Joe\",\"Jim\",\"John\",\"John\",\"Jake\",\"Joe\",\"Jed\",\"Jake\"), starts=c(8.1,8.7,13.0,9.1,11.6,9.0,13.6,9.3,14.2), ends=c(12.5,12.7,16.5,10.3,15.6,11.7,18.1,18.2,19.0)) gantt.chart(info2,vgridlab=8:19,vgridpos=8:19, main=\"All bars the same color\",taskcolors=\"lightgray\") gantt.chart(info2,vgridlab=8:19,vgridpos=8:19, main=\"A color for each label\",taskcolors=c(2,3,7,4,8)) gantt.chart(info2,vgridlab=8:19,vgridpos=8:19, main=\"A color for each interval - with borders\", taskcolors=c(2,3,7,4,8,5,3,6,\"purple\"),border.col=\"black\")"},{"path":"/reference/gap.barplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a barplot with a gap (missing range) on one axis — gap.barplot","title":"Display a barplot with a gap (missing range) on one axis — gap.barplot","text":"Displays barplot missing range.","code":""},{"path":"/reference/gap.barplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a barplot with a gap (missing range) on one axis — gap.barplot","text":"","code":"gap.barplot(y,gap,xaxlab,xtics,yaxlab,ytics,xlim=NA,ylim=NA,xlab=NULL, ylab=NULL,horiz=FALSE,col,...)"},{"path":"/reference/gap.barplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a barplot with a gap (missing range) on one axis — gap.barplot","text":"y vector data values gap range values left xaxlab labels x axis ticks xtics position x axis ticks yaxlab labels y axis ticks ytics position y axis ticks xlim Optional x limits plot ylim optional y limits plot xlab label x axis ylab label y axis horiz whether vertical horizontal bars col color(s) plot values ... arguments passed barplot.","code":""},{"path":"/reference/gap.barplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a barplot with a gap (missing range) on one axis — gap.barplot","text":"center positions bars.","code":""},{"path":"/reference/gap.barplot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a barplot with a gap (missing range) on one axis — gap.barplot","text":"Displays barplot omitting range values X Y axis. Typically used relatively large gap range values represented bar heights. See axis.break brief discussion plotting discontinuous coordinates. user ask specific y limits, function calculate limits based range data values. passing specific limits, remember subtract gap upper limit.","code":""},{"path":"/reference/gap.barplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a barplot with a gap (missing range) on one axis — gap.barplot","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/gap.barplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a barplot with a gap (missing range) on one axis — gap.barplot","text":"","code":"twogrp<-c(rnorm(10)+4,rnorm(10)+20) gap.barplot(twogrp,gap=c(8,16),xlab=\"Index\",ytics=c(3,6,17,20), ylab=\"Group values\",main=\"Barplot with gap\") #> ylim -5.174695 13.64423 gap.barplot(twogrp,gap=c(8,16),xlab=\"Index\",ytics=c(3,6,17,20), ylab=\"Group values\",horiz=TRUE,main=\"Horizontal barplot with gap\") #> ylim -5.174695 13.64423"},{"path":"/reference/gap.boxplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a boxplot with a gap (missing range) — gap.boxplot","title":"Display a boxplot with a gap (missing range) — gap.boxplot","text":"Displays boxplot missing range.","code":""},{"path":"/reference/gap.boxplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a boxplot with a gap (missing range) — gap.boxplot","text":"","code":"gap.boxplot(x,...,gap=list(top=c(NA,NA),bottom=c(NA,NA)), range=1.5,width=NULL,varwidth=FALSE,notch=FALSE,outline=TRUE, names,xlim=NA,ylim=NA,plot=TRUE,border=par(\"fg\"),col=NULL,log=\"\", axis.labels=NULL,axes=TRUE,pars=list(boxwex=0.8,staplewex=0.5,outwex=0.5), horizontal=FALSE,add=FALSE,at=NULL,main=NULL,xlab=\"\",ylab=\"\")"},{"path":"/reference/gap.boxplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a boxplot with a gap (missing range) — gap.boxplot","text":"x numeric vector list vectors ... arguments passed boxplot. gap range(s) omitted - list two components, top bottom specifying range omit. default range c(NA,NA) means omitted range range far extend whiskers, (see boxplot) width relative widths boxes varwidth TRUE, box widths proportional square roots number observations notch whether display confidence intervals median notches outline whether display outliers names optional names display beneath boxplot xlim,ylim Optional x y axis limits plot. boxwex scale factor box widths staplewex staple width proportional box width outwex outlier line width plot dummy argument consistency boxplot - always plots border optional color(s) box lines col optional color(s) fill boxes log whether use log scale - currently nothing axis.labels Optional axis labels. axes Whether display axes. pars optional parameters consistency boxplot horizontal whether plot horizontal boxplots - currently nothing add whether add boxplot(s) existing plot - currently nothing. optional horizontal locations boxplots. main title plot. xlab,ylab X Y axis labels.","code":""},{"path":"/reference/gap.boxplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a boxplot with a gap (missing range) — gap.boxplot","text":"list structure returned boxplot, except values elements beyond gap(s) true positions plot rather original values. example, second example, value returned upper staple right boxplot 14 rather 20, due 6 unit gap.","code":""},{"path":"/reference/gap.boxplot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a boxplot with a gap (missing range) — gap.boxplot","text":"Displays boxplot(s) omitting range(s) values top /bottom plot. Typically used outliers far boxes. See boxplot detailed descriptions arguments. gaps specified include values stats matrix returned boxplot, function exit error message. prevents generation NAs indexing operations, fail anyway. gap can include part box, unlikely intended user. See axis.break brief discussion plotting discontinuous coordinates.","code":""},{"path":"/reference/gap.boxplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a boxplot with a gap (missing range) — gap.boxplot","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/gap.boxplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a boxplot with a gap (missing range) — gap.boxplot","text":"","code":"twovec<-list(vec1=c(rnorm(30),-6),vec2=c(sample(1:10,40,TRUE),20)) gap.boxplot(twovec,gap=list(top=c(12,18),bottom=c(-5,-3)), main=\"Show outliers separately\") if(dev.interactive()) par(ask=TRUE) gap.boxplot(twovec,gap=list(top=c(12,18),bottom=c(-5,-3)),range=0, main=\"Include outliers in whiskers\") par(ask=FALSE)"},{"path":"/reference/gap.plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a plot with one or two gaps (missing ranges) on one axis — gap.plot","title":"Display a plot with one or two gaps (missing ranges) on one axis — gap.plot","text":"Displays plot one two missing ranges one axes.","code":""},{"path":"/reference/gap.plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a plot with one or two gaps (missing ranges) on one axis — gap.plot","text":"","code":"gap.plot(x,y,gap,gap.axis=\"y\", bgcol=\"white\",breakcol=\"black\",brw=0.02, xlim=range(x),ylim=range(y),xticlab,xtics=NA,yticlab,ytics=NA, lty=rep(1,length(x)),col=rep(par(\"col\"),length(x)),pch=rep(1,length(x)), add=FALSE,stax=FALSE, style=\"gap\",bty=par(\"bty\"),xaxt=par(\"xaxt\"),yaxt=par(\"yaxt\"),...)"},{"path":"/reference/gap.plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a plot with one or two gaps (missing ranges) on one axis — gap.plot","text":"x,y data values gap range(s) values left gap.axis whether gaps x y axis bgcol color plot background breakcol color \"break\" marker brw break width relative plot width xlim,ylim plot limits. xticlab labels x axis ticks xtics position x axis ticks yticlab labels y axis ticks ytics position y axis ticks lty line type(s) use lines col color(s) plot values pch symbols use plotting. add whether add values existing plot. stax whether call staxlab staggered axis labels. style style use break; see axis.break bty,xaxt,yaxt type box axes (see par details.) ... arguments passed plot points.","code":""},{"path":"/reference/gap.plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a plot with one or two gaps (missing ranges) on one axis — gap.plot","text":"nil","code":""},{"path":"/reference/gap.plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a plot with one or two gaps (missing ranges) on one axis — gap.plot","text":"Displays plot omitting one two ranges values one axis. Typically used relatively large gap two overall range one set values, often outliers. function warns user values may omitted \"gap\". See axis.break brief discussion plotting discontinuous coordinates. add data series gap plot, call gap.plot add = TRUE. gap gap.axis arguments initial call must passed data displayed correctly. Remember pass explicit xlim ylim initial call added data exceed range data initially displayed. Also remember subtract width(s) gap(s) passing explicit xlim ylim. gaps take space, possible data value just gap plotted gap. answer make lower gap limit little higher problem. least four values passed gap, first four used calculate two \"gaps\" plot instead one. function check whether values sensible, quite easy ask silly plot. default ticks usually ideal, users want pass tick positions perhaps labels. Note lines appears use first col lty argument value, must lines different colors types, use add=TRUE add separately (see third example problem solution).","code":""},{"path":"/reference/gap.plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a plot with one or two gaps (missing ranges) on one axis — gap.plot","text":"Jim Lemon Ben Bolker (thanks Zheng Lu \"add\" idea, Art Roberts helping get gaps right.)","code":""},{"path":[]},{"path":"/reference/gap.plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a plot with one or two gaps (missing ranges) on one axis — gap.plot","text":"","code":"twogrp<-c(rnorm(5)+4,rnorm(5)+20,rnorm(5)+5,rnorm(5)+22) gpcol<-c(2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5) gap.plot(twogrp,gap=c(8,16),xlab=\"Index\",ylab=\"Group values\", main=\"Gap on Y axis\",col=gpcol) gap.plot(twogrp,rnorm(20),gap=c(8,16),gap.axis=\"x\",xlab=\"X values\", xtics=c(4,7,17,20),ylab=\"Y values\",main=\"Gap on X axis with added lines\") gap.plot(c(seq(3.5,7.5,by=0.5),seq(16.5,22.5,by=0.5)), rnorm(22),gap=c(8,16),gap.axis=\"x\",type=\"l\",add=TRUE,col=2,) gap.plot(twogrp,gap=c(8,16,25,35), xlab=\"X values\",ylab=\"Y values\",xlim=c(1,30),ylim=c(0,42), main=\"Test two gap plot with the lot\",xtics=seq(0,30,by=5), ytics=c(4,6,18,20,22,38,40,42), lty=c(rep(1,10),rep(2,10)), pch=c(rep(2,10),rep(3,10)), col=c(rep(2,10),rep(3,10)), type=\"b\") gap.plot(21:30,rnorm(10)+40,gap=c(8,16,25,35),add=TRUE, lty=rep(3,10),col=rep(4,10),type=\"l\") # Use non-standard box type and break gap.plot(twogrp,gap=c(7,17),xlab=\"Index\",ylab=\"Group values\", main=\"Gap on Y axis\",col=gpcol,bty=\"L\",style=\"slash\", ytics=pretty(twogrp, 8))"},{"path":"/reference/gap_barp.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a barplot with a gap (missing range) on one axis — gap_barp","title":"Display a barplot with a gap (missing range) on one axis — gap_barp","text":"Displays barplot missing range.","code":""},{"path":"/reference/gap_barp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a barplot with a gap (missing range) on one axis — gap_barp","text":"","code":"gap_barp(height,gap,width=0.4,names.arg=names(height), col=NULL,main=\"\",xlab=\"\",ylab=\"\",xlim=NULL,ylim=NULL,x=NULL, height.at=pretty(height),height.lab=NULL,...)"},{"path":"/reference/gap_barp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a barplot with a gap (missing range) on one axis — gap_barp","text":"height vector data values gap range values left width proportion bar width bar spacing divided 2. width=1 means spaces bars. names.arg labels bars. col color(s) plot values main title plot. xlab label x axis ylab label y axis xlim Optional x limits plot ylim optional y limits plot x optional x positions bars. height.explicit positions y axis ticks height.lab explicit labels y axis ticks. ... arguments passed barp.","code":""},{"path":"/reference/gap_barp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a barplot with a gap (missing range) on one axis — gap_barp","text":"center positions bars.","code":""},{"path":"/reference/gap_barp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a barplot with a gap (missing range) on one axis — gap_barp","text":"Displays barplot omitting range values X Y axis. Typically used relatively large gap range values represented bar heights. See axis.break brief discussion plotting discontinuous coordinates. user ask specific y limits, function calculate limits based range data values. passing specific limits, remember subtract gap upper lower limit.","code":""},{"path":"/reference/gap_barp.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a barplot with a gap (missing range) on one axis — gap_barp","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/gap_barp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a barplot with a gap (missing range) on one axis — gap_barp","text":"","code":"oneout<-c(rnorm(5,sd=5),20,rnorm(5,sd=5)) gap_barp(oneout,gap=c(8,16),xlab=\"Index\",height.at=c(-5,0,5,20), ylab=\"Group values\",main=\"Barplot with gap above zero\") #> Warning: some heights within gap oneout[6]<--20 gap_barp(oneout,gap=c(-8,-16),xlab=\"Index\",height.at=c(-20,-5,0,5), ylab=\"Group values\",main=\"Barplot with gap below zero\")"},{"path":"/reference/get.breaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the breakpoints for a weighted histogram — get.breaks","title":"Get the breakpoints for a weighted histogram — get.breaks","text":"Gets breakpoints weighted histogram.","code":""},{"path":"/reference/get.breaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the breakpoints for a weighted histogram — get.breaks","text":"","code":"get.breaks(x,breaks)"},{"path":"/reference/get.breaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the breakpoints for a weighted histogram — get.breaks","text":"x numeric vector. breaks Either name function calculate breakpoints, number categories vector breakpoints.","code":""},{"path":"/reference/get.breaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get the breakpoints for a weighted histogram — get.breaks","text":"get.breaks either calls functions hist get breakpoints calculates given number just returns breaks already specified.","code":""},{"path":"/reference/get.breaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the breakpoints for a weighted histogram — get.breaks","text":"vector breakpoints.","code":""},{"path":"/reference/get.breaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get the breakpoints for a weighted histogram — get.breaks","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/get.gantt.info.html","id":null,"dir":"Reference","previous_headings":"","what":"Gather the information to create a Gantt chart — get.gantt.info","title":"Gather the information to create a Gantt chart — get.gantt.info","text":"Allows user enter information Gantt chart.","code":""},{"path":"/reference/get.gantt.info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gather the information to create a Gantt chart — get.gantt.info","text":"","code":"get.gantt.info(format=\"%Y/%m/%d\")"},{"path":"/reference/get.gantt.info.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gather the information to create a Gantt chart — get.gantt.info","text":"format format used entering dates/times. Defaults YYYY/mm/dd. See strptime various date/time formats.","code":""},{"path":"/reference/get.gantt.info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gather the information to create a Gantt chart — get.gantt.info","text":"list used create chart. Elements : labels task labels displayed left chart. starts,ends task starts/ends POSIXct dates/times. priorities Task priorities integers range 1 10. can less 10 levels priority, priorities start 1 (assumed highest), default priority colors calculated 1.","code":""},{"path":"/reference/get.gantt.info.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Gather the information to create a Gantt chart — get.gantt.info","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/get.gantt.info.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Gather the information to create a Gantt chart — get.gantt.info","text":"","code":"cat(\"Enter task times using HH:MM (hour:minute) format\\n\") #> Enter task times using HH:MM (hour:minute) format get.gantt.info(\"%H:%M\") #> Enter the label, start and finish time for each task. #> Default format for time is year/month/day e.g. 2005/2/22 #> Enter a blank label to end. #> Task label - #> $labels #> [1] NA #> #> $starts #> [1] NA #> #> $ends #> [1] NA #> #> $priorities #> [1] NA #>"},{"path":"/reference/get.segs.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the midpoints and limits for a centipede plot — get.segs","title":"Calculate the midpoints and limits for a centipede plot — get.segs","text":"Calculates midpoints limits list data frame use centipede.plot.","code":""},{"path":"/reference/get.segs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the midpoints and limits for a centipede plot — get.segs","text":"","code":"get.segs(x,mct=\"mean\",lower.limit=\"std.error\",upper.limit=lower.limit)"},{"path":"/reference/get.segs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the midpoints and limits for a centipede plot — get.segs","text":"x list data frame. mct name function calculate midpoints. lower.limit,upper.limit names function(s) calculate lower upper limits.","code":""},{"path":"/reference/get.segs.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate the midpoints and limits for a centipede plot — get.segs","text":"get.segs calls functions whose names passed calculate midpoints limits list element data frame column. user can define special functions central dispersion measures desired.","code":""},{"path":"/reference/get.segs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the midpoints and limits for a centipede plot — get.segs","text":"matrix four rows many columns object x. first row contains midpoint values, second third lower upper limit values respectively fourth row number valid observations columns.","code":""},{"path":"/reference/get.segs.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate the midpoints and limits for a centipede plot — get.segs","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/get.soil.texture.html","id":null,"dir":"Reference","previous_headings":"","what":"Enter soil texture data — get.soil.texture","title":"Enter soil texture data — get.soil.texture","text":"get.soil.texture calls get.triprop allow user enter soil textures proportions percentages three components, sand, silt clay.","code":""},{"path":"/reference/get.soil.texture.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enter soil texture data — get.soil.texture","text":"","code":"get.soil.texture(use.percentages=FALSE,cnames=c(\"sand\",\"silt\",\"clay\"))"},{"path":"/reference/get.soil.texture.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enter soil texture data — get.soil.texture","text":"use.percentages Logical - whether treat entries percentages scale proportions. cnames column names resulting three column matrix.","code":""},{"path":"/reference/get.soil.texture.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enter soil texture data — get.soil.texture","text":"matrix components one soil samples.","code":""},{"path":"/reference/get.soil.texture.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Enter soil texture data — get.soil.texture","text":"Sander Oom Jim Lemon","code":""},{"path":[]},{"path":"/reference/get.soil.texture.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Enter soil texture data — get.soil.texture","text":"","code":"if(dev.interactive()) { newsp<-get.soil.texture() # show the soil triangle soil.texture() # now plot the observations show.soil.texture(newsp) }"},{"path":"/reference/get.tablepos.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the position for a legend or table — get.tablepos","title":"Get the position for a legend or table — get.tablepos","text":"Gets x y positions justification legend table user units string descriptors like \"top\".","code":""},{"path":"/reference/get.tablepos.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the position for a legend or table — get.tablepos","text":"","code":"get.tablepos(x)"},{"path":"/reference/get.tablepos.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the position for a legend or table — get.tablepos","text":"x valid position descriptor like \"top\".","code":""},{"path":"/reference/get.tablepos.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get the position for a legend or table — get.tablepos","text":"get.tablepos checks one nine valid position descriptors: topleft, top, topright, left, center, right, bottomleft, bottom bottomright. none descriptors found, return center position justification.","code":""},{"path":"/reference/get.tablepos.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the position for a legend or table — get.tablepos","text":"list containing: x x position y y position xjust x (horizontal) justification yjust y (vertical) justification","code":""},{"path":"/reference/get.tablepos.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get the position for a legend or table — get.tablepos","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/get.triprop.html","id":null,"dir":"Reference","previous_headings":"","what":"Enter three proportion data - usually soil textures — get.triprop","title":"Enter three proportion data - usually soil textures — get.triprop","text":"get.triprop allows user enter triplets proportions percentages three components sand, silt clay soils.","code":""},{"path":"/reference/get.triprop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enter three proportion data - usually soil textures — get.triprop","text":"","code":"get.triprop(use.percentages=FALSE,cnames=c(\"1st\",\"2nd\",\"3rd\"))"},{"path":"/reference/get.triprop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enter three proportion data - usually soil textures — get.triprop","text":"use.percentages Logical - whether treat entries percentages scale proportions. cnames column names resulting three column matrix.","code":""},{"path":"/reference/get.triprop.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Enter three proportion data - usually soil textures — get.triprop","text":"three proportions row must sum 100 1 within 1% function warn operator.","code":""},{"path":"/reference/get.triprop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enter three proportion data - usually soil textures — get.triprop","text":"matrix components one observations.","code":""},{"path":"/reference/get.triprop.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Enter three proportion data - usually soil textures — get.triprop","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/get.triprop.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Enter three proportion data - usually soil textures — get.triprop","text":"","code":"if(dev.interactive()) { # get some proportions newsp<-get.triprop() # show the triangle triax.frame(main=\"Test triax.plot\") # now plot the observations triax.points(newsp) }"},{"path":"/reference/getFigCtr.html","id":null,"dir":"Reference","previous_headings":"","what":"Get coordinates in the figure region in user units. — getFigCtr","title":"Get coordinates in the figure region in user units. — getFigCtr","text":"Calculates coordinates proportional point figure region user units.","code":""},{"path":"/reference/getFigCtr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get coordinates in the figure region in user units. — getFigCtr","text":"","code":"getFigCtr(pos=c(0.5,0.5))"},{"path":"/reference/getFigCtr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get coordinates in the figure region in user units. — getFigCtr","text":"pos proportion figure region find (see Details).","code":""},{"path":"/reference/getFigCtr.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get coordinates in the figure region in user units. — getFigCtr","text":"getFigCtr reads parameters current plot calculates vertical horizontal centers figure region default. typically useful placing centered title plots left right margins different. changing pos, proportional points figure region can returned. example, pos=c(0,0) return left bottom coordinates figure region.","code":""},{"path":"/reference/getFigCtr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get coordinates in the figure region in user units. — getFigCtr","text":"two element vector containing coordinates center figure region user units.","code":""},{"path":"/reference/getFigCtr.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get coordinates in the figure region in user units. — getFigCtr","text":"Jim Lemon (thanks Karl Brand adjustable coordinates)","code":""},{"path":"/reference/getIntersectList.html","id":null,"dir":"Reference","previous_headings":"","what":"Enter a set intersection list — getIntersectList","title":"Enter a set intersection list — getIntersectList","text":"Enter information set intersection display.","code":""},{"path":"/reference/getIntersectList.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enter a set intersection list — getIntersectList","text":"","code":"getIntersectList(nelem,xnames=NULL,sep=\"+\")"},{"path":"/reference/getIntersectList.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enter a set intersection list — getIntersectList","text":"nelem number sets intersections displayed. xnames labels set intersections. function creates names combinations first nelem capital letters none given. sep separator use calling paste.","code":""},{"path":"/reference/getIntersectList.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Enter a set intersection list — getIntersectList","text":"getIntersectList allows user manually enter counts set intersections rather build information matrix data. probably useful producing intersection diagram counts intersections already known, values proportions rather counts example. helpful large numbers elements, makeIntersectList function runs slowly.","code":""},{"path":"/reference/getIntersectList.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enter a set intersection list — getIntersectList","text":"list counts elements set intersections.","code":""},{"path":"/reference/getIntersectList.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Enter a set intersection list — getIntersectList","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/getIntersectList.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Enter a set intersection list — getIntersectList","text":"","code":"# this example is from a haplotype mapping problem submitted by Mao Jianfeng if (FALSE) { # \\dontrun{ hapIntList<- getIntersectList(3,xnames=c(\"hap.Pd\",\"hap.Pt\",\"hap.Py\")) # enter the data as follows: # Number of elements in hap.Pd - 1: 27.586 # Number of elements in hap.Pt - 1: 20.689 # Number of elements in hap.Py - 1: 31.035 # Number of elements in hap.Pd-hap.Pt - 1: 10.345 # Number of elements in hap.Pd-hap.Py - 1: 10.345 # Number of elements in hap.Pt-hap.Py - 1: 0 # Number of elements in hap.Pd-hap.Pt-hap.Py - 1: 0 # Total number of elements - 1: 100 } # } hapIntList<-structure(list(structure(c(27.586, 20.689, 31.035), .Names = c(\"hap.Pd\",\"hap.Pt\",\"hap.Py\")), structure(c(10.345, 10.345, 0), .Names = c(\"hap.Pd-hap.Pt\",\"hap.Pd-hap.Py\",\"hap.Pt-hap.Py\")), structure(0, .Names = \"hap.Pd-hap.Pt-hap.Py\"),100), class = \"intersectList\") intersectDiagram(hapIntList)"},{"path":"/reference/getMarginWidth.html","id":null,"dir":"Reference","previous_headings":"","what":"Find the margin width necessary to fit text or a legend next to a plot — getMarginWidth","title":"Find the margin width necessary to fit text or a legend next to a plot — getMarginWidth","text":"Calculates margin width necessary fit text legend next plot.","code":""},{"path":"/reference/getMarginWidth.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find the margin width necessary to fit text or a legend next to a plot — getMarginWidth","text":"","code":"getMarginWidth(side=4,labels,is.legend=FALSE)"},{"path":"/reference/getMarginWidth.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find the margin width necessary to fit text or a legend next to a plot — getMarginWidth","text":"side side plot (axis). labels text place next plot. .legend Whether text legend .","code":""},{"path":"/reference/getMarginWidth.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find the margin width necessary to fit text or a legend next to a plot — getMarginWidth","text":"getMarginWidth reads parameters current plot calculates left right (default) margin necessary fit strings passed labels legend containing strings.","code":""},{"path":"/reference/getMarginWidth.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find the margin width necessary to fit text or a legend next to a plot — getMarginWidth","text":"two element list containing number margin lines necessary fit text legend horizontal center margin user units.","code":""},{"path":"/reference/getMarginWidth.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find the margin width necessary to fit text or a legend next to a plot — getMarginWidth","text":"Jim Lemon","code":""},{"path":"/reference/getMarginWidth.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find the margin width necessary to fit text or a legend next to a plot — getMarginWidth","text":"","code":"plot(rnorm(10)) newmarinfo<-getMarginWidth(labels=c(\"Long label\",\"Even longer label\")) #> plotprop 0.814 marprop 0.063 plotwidth 9.72 marwidth 2.861766 oldmar<-par(\"mar\") par(mar=c(oldmar[1:3],newmarinfo$newmar)) plot(rnorm(10)) par(xpd=TRUE) text(rep(newmarinfo$marcenter,2),c(0.5,-0.5), c(\"Long label\",\"Even longer label\")) par(mar=oldmar,xpd=FALSE)"},{"path":"/reference/getYmult.html","id":null,"dir":"Reference","previous_headings":"","what":"Correct for aspect and coordinate ratio — getYmult","title":"Correct for aspect and coordinate ratio — getYmult","text":"Calculate multiplication factor Y dimension correct unequal plot aspect coordinate ratios current graphics device.","code":""},{"path":"/reference/getYmult.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correct for aspect and coordinate ratio — getYmult","text":"","code":"getYmult()"},{"path":"/reference/getYmult.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correct for aspect and coordinate ratio — getYmult","text":"getYmult retrieves plot aspect ratio coordinate ratio current graphics device, calculates multiplicative factor equalize X Y dimensions plotted graphic object.","code":""},{"path":"/reference/getYmult.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correct for aspect and coordinate ratio — getYmult","text":"correction factor Y dimension.","code":""},{"path":"/reference/getYmult.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correct for aspect and coordinate ratio — getYmult","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/get_axispos3d.html","id":null,"dir":"Reference","previous_headings":"","what":"Get axis positions on a 3D plot — get_axispos3d","title":"Get axis positions on a 3D plot — get_axispos3d","text":"Calculate axis positions 3D plot.","code":""},{"path":"/reference/get_axispos3d.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get axis positions on a 3D plot — get_axispos3d","text":"","code":"get_axispos3d(edge,pmat,at,pos=NULL, dist=0)"},{"path":"/reference/get_axispos3d.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get axis positions on a 3D plot — get_axispos3d","text":"edge axis calculate. pmat matrix transform coordinates. position axis. pos position axis relative axes. dist Offset axis.","code":""},{"path":"/reference/get_axispos3d.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get axis positions on a 3D plot — get_axispos3d","text":"position 2D coordinates","code":""},{"path":"/reference/get_axispos3d.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get axis positions on a 3D plot — get_axispos3d","text":"Ben Bolker","code":""},{"path":"/reference/gradient.rect.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a rectangle filled with an arbitrary color gradient — gradient.rect","title":"Display a rectangle filled with an arbitrary color gradient — gradient.rect","text":"gradient.rect draws rectangle consisting nslices subrectangles colors col returned color.gradient col NULL. rectangle 'sliced' direction specified gradient.","code":""},{"path":"/reference/gradient.rect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a rectangle filled with an arbitrary color gradient — gradient.rect","text":"","code":"gradient.rect(xleft,ybottom,xright,ytop,reds,greens,blues,col=NULL, nslices=50,gradient=\"x\",border=par(\"fg\"))"},{"path":"/reference/gradient.rect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a rectangle filled with an arbitrary color gradient — gradient.rect","text":"xleft,ybottom,xright,ytop Positions relevant corners desired rectangle, rect. reds,greens,blues vectors values color components either 0 1 ,value greater 1, 0 255. col Vector colors. supplied, takes precedence reds, greens, blues nslices set length. nslices number sub-rectangles drawn. gradient whether gradient horizontal (x) vertical. border color border around rectangle (NA none).","code":""},{"path":"/reference/gradient.rect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a rectangle filled with an arbitrary color gradient — gradient.rect","text":"vector hexadecimal color values color.gradient col.","code":""},{"path":"/reference/gradient.rect.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a rectangle filled with an arbitrary color gradient — gradient.rect","text":"Jim Lemon","code":""},{"path":"/reference/gradient.rect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a rectangle filled with an arbitrary color gradient — gradient.rect","text":"","code":"# get an empty box plot(0:10,type=\"n\",axes=FALSE) # run across the three primaries gradient.rect(1,0,3,6,reds=c(1,0), greens=c(seq(0,1,length=10),seq(1,0,length=10)), blues=c(0,1),gradient=\"y\") # now a \"danger gradient\" gradient.rect(4,0,6,6,c(seq(0,1,length=10),rep(1,10)), c(rep(1,10),seq(1,0,length=10)),c(0,0),gradient=\"y\") # now just a smooth gradient across the bar gradient.rect(7,0,9,6,col=smoothColors(\"red\",38,\"blue\"),border=NA)"},{"path":"/reference/hexagon.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw a hexagon — hexagon","title":"Draw a hexagon — hexagon","text":"Draws hexagon current graphic device","code":""},{"path":"/reference/hexagon.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw a hexagon — hexagon","text":"","code":"hexagon(x,y,unitcell=1,col=NA,border=\"black\")"},{"path":"/reference/hexagon.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw a hexagon — hexagon","text":"x,y x y position bottom left corner square pack space hexagon. unitcell dimension side abovementioned square. col color fill hexagon - default fill. border color perimeter hexagon.","code":""},{"path":"/reference/hexagon.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Draw a hexagon — hexagon","text":"Draws hexagon center square pack dimensions hexagon. , given grid squares alternate rows shifted one half length sides, hexagons drawn close packed. use plotrix package provide alternative unit cell color2D.matplot function.","code":""},{"path":"/reference/hexagon.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Draw a hexagon — hexagon","text":"nil","code":""},{"path":"/reference/hexagon.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Draw a hexagon — hexagon","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/histStack.html","id":null,"dir":"Reference","previous_headings":"","what":"Histogram ","title":"Histogram ","text":"Histogram quantitative variable bars \"stacked\" values factor variable.","code":""},{"path":"/reference/histStack.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Histogram ","text":"","code":"histStack(x,...) # S3 method for class 'formula' histStack(x,data,breaks=\"Sturges\",col=\"rainbow\", right=TRUE,main=\"\",xlab=NULL,legend.pos=NULL,cex.legend=0.75,...) # Default S3 method histStack(x,z,breaks=\"Sturges\",col=\"rainbow\", right=TRUE,main=\"\",xlab=NULL,legend.pos=NULL,cex.legend=0.75,...)"},{"path":"/reference/histStack.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Histogram ","text":"x vector quantitative data formula form x~z (see z ). z vector categorical data (factor) define “stacks”. data data frame contains x z. breaks Breaks use categorizing values x. col Either vector colors legitimate form character string specifies function requires length vector argument return vector colors length. (see Details) right logical indicates whether bins right-open (left-closed; =TRUE) right-closed (left-open; =FALSE; default). main character string forms main title plot. xlab character string labeling x-axis. legend.pos character string two numeric values indicating position stacking legend. cex.legend numeric character expansion value legend. Values less 1 make legend smaller. ... Additional arguments sent hist function.","code":""},{"path":"/reference/histStack.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Histogram ","text":"histStack displays “stacked histogram” using many arguments hist(). argument z converted factor warning already factor. color functions grDevices (e.g. \"gray.colors\") always valid passed col argument. function return vector n colors called single argument n exists current environment work. error occur length(col)==1 value function described col (e.g., col=\"blue\" result error).fewer colors levels z passed, recycled.","code":""},{"path":"/reference/histStack.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Histogram ","text":"nil. plot displayed.","code":""},{"path":"/reference/histStack.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Histogram ","text":"function currently experimental.","code":""},{"path":"/reference/histStack.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Histogram ","text":"Derek Ogle modifications Jim Lemon","code":""},{"path":[]},{"path":"/reference/histStack.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Histogram ","text":"","code":"set.seed(409) df<-data.frame(len=rnorm(100)+5, grp=sample(c(\"A\",\"B\",\"C\",\"D\"),100,replace=TRUE)) histStack(len~grp,data=df,main=\"Default (rainbow) colors\", xlab=\"Length category\") #> Warning: z was converted to a factor histStack(len~grp,data=df,col=\"heat.colors\",main=\"Heat colors\", xlab=\"Length category\",legend.pos=\"topright\") #> Warning: z was converted to a factor histStack(len~grp,data=df,col=2:5,main=\"Colors by number\", xlab=\"Length category\",legend.pos=c(2.8,18)) #> Warning: z was converted to a factor"},{"path":"/reference/intersectDiagram.html","id":null,"dir":"Reference","previous_headings":"","what":"Display set intersections — intersectDiagram","title":"Display set intersections — intersectDiagram","text":"Display set intersections rows rectangles.","code":""},{"path":"/reference/intersectDiagram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display set intersections — intersectDiagram","text":"","code":"intersectDiagram(x,pct=FALSE,show.nulls=FALSE,xnames=NULL,sep=\"+\", mar=c(0,0,3,0),main=\"Intersection Diagram\",cex=1,col=NULL, minspacing=NA,all.intersections=FALSE,include=NULL,null.label=\"Non-set\")"},{"path":"/reference/intersectDiagram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display set intersections — intersectDiagram","text":"x list containing many numeric vectors sets. first vector contains counts percentages elements one set, next vector contains counts percentages elements two sets . matrix set membership indicators two column matrix object identifiers attribute identifiers can passed - see Details. pct Whether display counts (FALSE) percentages (TRUE) number entities. show.nulls Whether display number original objects members set. value NA become label category. xnames Optional user supplied names set categories (see Details). sep separator use category names (see Details). mar margins diagram. margins effect function called restored. main title diagram. col Colors sets (see Details). cex Character expansion intersection labels. minspacing minimum spacing rectangles (see Details). .intersections Whether display intersections, even empty (Dangerous - see Detail). include set identifiers include diagram (see Details). null.label label non-set entities displayed.","code":""},{"path":"/reference/intersectDiagram.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display set intersections — intersectDiagram","text":"intersectDiagram displays rows optionally colored rectangles represent intersections set memberships (attributes) set objects. topmost row represents intersections fewest sets, succeeding rows represent intersections sets. objects original data set members set, percentages calculated reflect . setting show.nulls TRUE, counts percentages objects displayed intersections empty rectangle scaled count percentage. Important - .intersections argument TRUE, intersections displayed, whether empty (see example). mostly demonstration purposes, number sets large, likely produce messy diagram. Similarly, sets large numbers intersections populated require large displays readable, even small numbers intersections. like see action, pass data frame setdf categoryReshape example intersectDiagram .intersections TRUE. intersectDiagram attempt display set intersections pattern overlapping geometric figures, rather relative numbers objects sharing intersection. three intersecting sets generally produce complex difficult interpret Venn diagram, provides alternative way display size intersections larger numbers sets. intersectDiagram now allows user display part set intersections, useful analyzing complex intersections. controlled include argument. defaults sets attributes include=NULL. one labels sets attributes passed, intersections containing labels displayed. See examples 2 3 . set (attribute) assigned color col NA. rainbow called col NULL, otherwise colors passed used. intersection, colors representing sets intersecting included rectangle. strings displayed rectangle taken argument xnames unless NULL, names intersectList object passed x returned call makeIntersectList. matrix data frame set membership indicators passed x, passed makeIntersectList conversion. column must represent set, values columns must 0 1, FALSE TRUE. Similarly, matrix data frame first column object identifiers second column attributes, passed makeIntersectList. spacing largest rectangles controlled minspacing. minspacing units object counts defaults 0.1 times largest number objects intersection. number objects different intersections given level varies widely, labels intersections objects may overlap wide relative rectangle representing number objects. can corrected passing minspacing argument increase space rectangles /decreasing character size labels. labels set relatively long, setting namesep=\"\\n\" may help. Note different separator passed, separator must explicitly passed subsequent calls using intersectList object - see examples 1 3 .","code":""},{"path":"/reference/intersectDiagram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display set intersections — intersectDiagram","text":"Returns intersectionList object invisibly.","code":""},{"path":"/reference/intersectDiagram.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display set intersections — intersectDiagram","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/intersectDiagram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display set intersections — intersectDiagram","text":"","code":"# create a matrix where each row represents an element and # a 1 (or TRUE) in each column indicates that the element is a member # of that set. druguse<-matrix(c(sample(c(0,1),200,TRUE,prob=c(0.15,0.85)), sample(c(0,1),200,TRUE,prob=c(0.35,0.65)), sample(c(0,1),200,TRUE,prob=c(0.5,0.5)), sample(c(0,1),200,TRUE,prob=c(0.9,0.1))),ncol=4) colnames(druguse)<-c(\"Alc\",\"Tob\",\"THC\",\"Amp\") druglist<-makeIntersectList(druguse,sep=\"\\n\") # first display it as counts intersectDiagram(druglist,main=\"Patterns of drug use\",sep=\"\\n\") # then display only the intersections containing \"Alc\" intersectDiagram(druglist,main=\"Patterns of drug use (Alcohol users only)\", sep=\"\\n\",include=\"alc\") # now display only the intersections containing \"Amp\" intersectDiagram(druglist,main=\"Patterns of drug use (Speed users only)\", sep=\"\\n\",include=\"amp\") # then as percent with non.members, passing the initial matrix intersectDiagram(druguse,pct=TRUE,show.nulls=TRUE) # alter the data to have more multiple intersections druguse[which(as.logical(druguse[,1]))[1:40],2]<-1 druguse[which(as.logical(druguse[,1]))[31:70],3]<-1 druguse[,4]<-sample(c(0,1),200,TRUE,prob=c(0.9,0.1)) intersectDiagram(druguse,main=\"Smaller font in labels\", col=c(\"gray20\",\"gray40\",\"gray60\",\"gray80\"),cex=0.8) # transform the spacing - usually makes it too close, first try minspacing intersectDiagram(druguse,col=\"gray\",main=\"Minimum spacing = 30 cases\", minspacing=30) # then try cex - may need both for large differences intersectDiagram(druguse,main=\"Very boring single color\",col=\"gray\",cex=0.8) # create a matrix with empty intersections druguse<-matrix(c(sample(c(0,1),20,TRUE), sample(c(0,1),20,TRUE), sample(c(0,1),20,TRUE), sample(c(0,1),20,TRUE)),ncol=4) # show only the populated intersections intersectDiagram(druguse,main=\"Display only populated intersections\") # show all intersections intersectDiagram(druguse,main=\"Display empty intersections\",all.intersections=TRUE)"},{"path":"/reference/jiggle.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate equally spaced values within a range. — jiggle","title":"Calculate equally spaced values within a range. — jiggle","text":"Calculates specified number equally spaced values range","code":""},{"path":"/reference/jiggle.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate equally spaced values within a range. — jiggle","text":"","code":"jiggle(n,range=c(-1,1))"},{"path":"/reference/jiggle.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate equally spaced values within a range. — jiggle","text":"n number values calculate. range range within fit values.","code":""},{"path":"/reference/jiggle.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate equally spaced values within a range. — jiggle","text":"jiggle alternative jitter function. Instead using runif provide values, calls sample scales resulting values range specified. guarantees values evenly spaced.","code":""},{"path":"/reference/jiggle.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate equally spaced values within a range. — jiggle","text":"vector n values within range specified.","code":""},{"path":"/reference/jiggle.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate equally spaced values within a range. — jiggle","text":"Jim Lemon","code":""},{"path":"/reference/jiggle.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate equally spaced values within a range. — jiggle","text":"","code":"ahw.df<-data.frame(Age=rnorm(100,35,10), Height=rnorm(100,160,15),Weight=rnorm(100,75,20)) par(mfrow=c(1,3)) boxplot(ahw.df$Age,main=\"Age\") points(jiggle(100,c(0.5,1.5)),ahw.df$Age,col=\"red\") boxplot(ahw.df$Height,main=\"Height\") points(jiggle(100,c(0.5,1.5)),ahw.df$Height,col=\"green\") boxplot(ahw.df$Weight,main=\"Weight\") points(jiggle(100,c(0.5,1.5)),ahw.df$Weight,col=\"blue\")"},{"path":"/reference/joyPlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a series of density curves. — joyPlot","title":"Display a series of density curves. — joyPlot","text":"joyPlot displays matrix density curves two component lists whose names x y. labels line/polygon displayed left axis plot. labels default names components x present.","code":""},{"path":"/reference/joyPlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a series of density curves. — joyPlot","text":"","code":"joyPlot(x,mar=c(5,4,4,2),newrange=c(0,1),border=NA,fill=NULL, main=\"\",xlab=\"\",ylab=\"\",xlim=NA,line_labels=names(x),xat=NULL, xaxlab=NULL)"},{"path":"/reference/joyPlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a series of density curves. — joyPlot","text":"x list density curves objects x y values. mar Margins plot. newrange Passed rescale scale values fit bands plot. See Details. border border colors polygons. fill Optional fill colors polygons. main Text title plot. xlab,ylab x y axis labels. xlim Optional limit x axis density returns values outside range values x. line_labels Labels lines/polygons dieplayed. xat Optional custom x tick positions. xaxlab Optional custom x tick labels.","code":""},{"path":"/reference/joyPlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a series of density curves. — joyPlot","text":"density curves x/y lists scaled largest fit one user unit band allocated curve default. second value newrange changed, heights curves change proportionately. See third exampls.","code":""},{"path":"/reference/joyPlot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a series of density curves. — joyPlot","text":"nil","code":""},{"path":"/reference/joyPlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a series of density curves. — joyPlot","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/joyPlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a series of density curves. — joyPlot","text":"","code":"x1<-c(sample(20:50,20),sample(40:80,30)) x2<-c(sample(10:40,30),sample(50:90,30)) x3<-sample(20:90,50) xdens1<-density(x1) xdens2<-density(x2) xdens3<-density(x3) joyPlot(list(xdens1,xdens2,xdens3),main=\"joyPlot with lines\", xlab=\"Position\",xlim=c(0,100)) xlist<-list(first=xdens1,second=xdens2,third=xdens3) joyPlot(xlist,main=\"joyPlot with polygons\",xlab=\"Position\", fill=c(\"#ffcccc\",\"#ccffcc\",\"#ccccff\"),xlim=c(0,100)) joyPlot(xlist,main=\"joyPlot with overlapping polygons\", fill=c(\"#ffcccc\",\"#ccffcc\",\"#ccccff\"),xlim=c(0,100), newrange=c(0,1.5),xlab=\"Position\")"},{"path":"/reference/kiteChart.html","id":null,"dir":"Reference","previous_headings":"","what":"Magnitude by position chart. — kiteChart","title":"Magnitude by position chart. — kiteChart","text":"Display numeric values widths polygon along dimension time.","code":""},{"path":"/reference/kiteChart.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Magnitude by position chart. — kiteChart","text":"","code":"kiteChart(x,xlim=NA,ylim=NA,timex=TRUE,main=\"Kite chart\", xlab=ifelse(timex,\"Time\",\"Groups\"),ylab=ifelse(timex,\"Groups\",\"Time\"), border=par(\"fg\"),col=NULL,varpos=NA,varlabels=NA,varscale=FALSE, timepos=NA,timelabels=NA,mar=c(5,4,4,4),axlab=c(1,2,3,4), normalize=FALSE,shownorm=TRUE,...)"},{"path":"/reference/kiteChart.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Magnitude by position chart. — kiteChart","text":"x Numeric matrix data frame xlim Horizontal extent chart. Defaults 1:dim(x)[2]. ylim Vertical extent chart. Defaults 0.5:dim(x)[1]+0.5. timex Whether \"time\" axis x (horizontal) . main,xlab,ylab plot. border border color(s) polygons. col fill colors polygons. varpos Optional positions \"kite lines\". Defaults 1:dimx[1]. (see Details) varlabels Labels rows values - defaults rownames, missing, varpos[1:dim(x)[1]]. varscale Whether show maximum extent \"kite line\". timepos positions values along x axis, usually times, defaulting 1:dim(x)[2]. timelabels Labels positions, defaulting timepos. mar Plot margins. leave space normalization multipliers right top side (see Details). axlab put axis tick labels multipliers. See Details. normalize Whether scale row values maximum width 1. shownorm Whether display normalization multipliers. ... additional arguments passed plot.","code":""},{"path":"/reference/kiteChart.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Magnitude by position chart. — kiteChart","text":"kiteChart displays row x sequence widths, allowing relationships values dimension along occur (usually time) illustrated. values x scaled maximum polygon width 1 normalize TRUE. avoid overlapping polygons. may cases values can displayed directly. normalized, multipliers displayed row right top side chart unless shownorm FALSE. Remember specify mar argument space top needed. axlab argument allows user place axis tick labels normalization multipliers different axes. default places tick labels bottom left sides plot multipliers right top. Using axlab=c(3,4,1,2) places tick labels top right multipliers left bottom. mar argument may adjusted. user can display raw values default, setting varpos TRUE. Setting varpos vector positions place \"kite lines\" values. row names varlabels argument NA, values varpos used labels \"kite line\". maximum extent \"kite line\" can displayed setting varscale TRUE. varscale TRUE, one extra line added top margin. varpos[1] NA, normalize FALSE default.","code":""},{"path":"/reference/kiteChart.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Magnitude by position chart. — kiteChart","text":"values mar current kiteChart called.","code":""},{"path":"/reference/kiteChart.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Magnitude by position chart. — kiteChart","text":"Jim Lemon (Thanks Michael Bedward suggestions arguments Nikolaus Lampadariou suggestions displaying raw values)","code":""},{"path":[]},{"path":"/reference/kiteChart.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Magnitude by position chart. — kiteChart","text":"","code":"testmat<-matrix(c(runif(50),sample(1:50,50),rnorm(50)+5, sin(1:50)),ncol=50,byrow=TRUE) kiteChart(testmat,varlabels=c(\"Uniform\",\"Sample\",\"Normal\",\"Sine\"), timepos=seq(1,50,by=5),timex=FALSE) # not enough space for the last label, add it mtext(\"Sine\",at=65,side=1,line=2) # now show it with kite line maxima kiteChart(testmat,varlabels=c(\"Uniform\",\"Sample\",\"Normal\",\"Sine\"), timepos=seq(1,50,by=5),timex=FALSE,varscale=TRUE) mtext(\"Sine\",at=65,side=1,line=2) musicmat<-matrix(c(c(0.5,0.4,0.3,0.25,0.2,0.15,0.1,rep(0.05,44))+runif(51,0,0.05), c(0.1,0.2,0.3,0.35,0.4,0.5,0.4,rep(0.5,14),rep(0.4,15),rep(0.3,15))+runif(51,0,0.1), rep(0.15,51)+runif(51,0,0.1), c(rep(0,29),c(0.1,0.2,0.4,0.5,0.3,0.2,rep(0.05,16))+runif(22,0,0.05)), c(rep(0,38),c(rep(0.05,6),0.08,0.15,0.20,0.25,0.2,0.25,0.3)+runif(13,0,0.05))), ncol=51,byrow=TRUE) kiteChart(musicmat,varlabels=c(\"Swing\",\"Rock\",\"Jazz\",\"Disco\",\"Rap\"), main=\"An utterly imaginary chart of music popularity\", timepos=seq(1,51,by=10),timelabels=seq(1950,2000,by=10),mar=c(5,4,4,2)) # now flip it to vertical, normalize and show the normalization factors kiteChart(musicmat,varlabels=c(\"Swing\",\"Rock\",\"Jazz\",\"Disco\",\"Rap\"), main=\"An utterly imaginary chart of music popularity\",xlab=\"Style\", timepos=seq(1,51,by=10),timelabels=seq(1950,2000,by=10),mar=c(5,4,4,2), timex=FALSE,normalize=TRUE,shownorm=TRUE)"},{"path":"/reference/l2010.html","id":null,"dir":"Reference","previous_headings":"","what":"World lightning strike data from 2010 — l2010","title":"World lightning strike data from 2010 — l2010","text":"list two 50x100 matrices containing world lightning strike data 2010. produced makeDensityMatrix 171 file (3 Gb) data consisting two geographic coordinates approximate location recorded strike estimated intensity strike kVA.","code":""},{"path":"/reference/l2010.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"World lightning strike data from 2010 — l2010","text":"","code":"data(l2010)"},{"path":"/reference/labbePlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a L'Abbe plot — labbePlot","title":"Display a L'Abbe plot — labbePlot","text":"Display percentages successes two conditions compared circles, area proportional number observations.","code":""},{"path":"/reference/labbePlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a L'Abbe plot — labbePlot","text":"","code":"labbePlot(x,main=\"L'Abbe plot\",xlab=\"Percent positive response with placebo\", ylab=\"Percent positive response with treatment\",labels=NULL,col=NA, circle.mag=0.5,add=FALSE,...)"},{"path":"/reference/labbePlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a L'Abbe plot — labbePlot","text":"x list either 2x2 tables three element vectors (see Details). main title plot. xlab,ylab x y axis labels plot. labels Text strings displayed center circles. col list colors circles. circle.mag fudge factor small large numbers observations. add Whether add information x existing L'Abbe plot. ... additional arguments passed plot.","code":""},{"path":"/reference/labbePlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a L'Abbe plot — labbePlot","text":"elements x may tables rows represent conditions compared, comparison condition first (often \"placebo\") condition interest (often \"intervention\") second. columns represent counts successes failures. elements x can also vectors three numeric values, first percentage successes comparison condition, second percentage successes condition interest finally number observations. Tables vectors can mixed. radius circle square root number observations multiplied circle.mag. allows small numbers observations expanded large numbers reduced size. area circle proportional number observations, circle.mag must circles. user may wish expand contract circles plot fit within box. labels, NULL, displayed circles. function tries work whether white black text easily read based background color displays text accordingly.","code":""},{"path":"/reference/labbePlot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a L'Abbe plot — labbePlot","text":"nil","code":""},{"path":"/reference/labbePlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a L'Abbe plot — labbePlot","text":"Jim Lemon - thanks Whitney Melroy asking .","code":""},{"path":[]},{"path":"/reference/labbePlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a L'Abbe plot — labbePlot","text":"","code":"# first fake something like the data from a clinical trial didf<-data.frame(subject=1:50,interv=rep(c(\"therapist\",\"ex-drinker\"),each=25), outcome=sample(c(\"more\",\"less\"),50,TRUE)) # make it into a table didf.tab<-table(didf$interv,didf$outcome) # now mix in some raw percentages just for the example didf2<-c(74,46,200) didf3<-c(33,87,500) x<-list(didf.tab,didf2,didf3) labbecol<-list(\"red\",\"green\",\"blue\") labbePlot(x,main=\"Ex-drinkers vs therapists\", xlab=\"Percent reduced drinking (ex-drinkers)\", ylab=\"Percent reduced drinking (therapists)\", labels=list(\"A\",\"B52\",\"X117\"),col=labbecol) labbePlot(list(c(20,40,20)),col=list(\"purple\"),labels=list(\"Z\"),add=TRUE)"},{"path":"/reference/ladderplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Ladder Plot — ladderplot","title":"Ladder Plot — ladderplot","text":"Makes ladder plot, similar parcoord flexibility graphical options.","code":""},{"path":"/reference/ladderplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Ladder Plot — ladderplot","text":"","code":"ladderplot(x, ...) # Default S3 method ladderplot(x, scale=FALSE, col=1, pch=19, lty=1, xlim=c(0.5, ncol(x) + 0.5), ylim=range(x), vertical = TRUE, ordered=FALSE,...)"},{"path":"/reference/ladderplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Ladder Plot — ladderplot","text":"x matrix data frame least 2 columns. scale Logical, original data columns scaled unit (0-1) interval. col Color values use rows x. longer 1, value recycled. pch Point type use. longer 1, value recycled. lty Line type use. longer 1, value recycled. xlim, ylim Limits axes. vertical Logical, orientation ladderplot vertical horizontal. ordered Logical, columns x ordered. ... arguments passed function stripchart.","code":""},{"path":"/reference/ladderplot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Ladder Plot — ladderplot","text":"function uses stripchart plot 1-D scatter plots column x. points joined lines rows x.","code":""},{"path":"/reference/ladderplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Ladder Plot — ladderplot","text":"Makes plot side effect. Returns NULL invisibly.","code":""},{"path":"/reference/ladderplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Ladder Plot — ladderplot","text":"Peter Solymos ","code":""},{"path":[]},{"path":"/reference/ladderplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Ladder Plot — ladderplot","text":"","code":"x<-data.frame(A=c(1:10), B=c(2:11)+rnorm(10)) y<-data.frame(x, C=c(1:10)+rnorm(10)) opar <- par(mfrow=c(1,3)) ladderplot(x) ladderplot(x, col=1:10, vertical=FALSE) ladderplot(y, col=1:10) par(opar) ## examples from parcoord if (FALSE) { # \\dontrun{ if (require(MASS)) { opar <- par(mfrow=c(2,3)) z1 <- state.x77[, c(7, 4, 6, 2, 5, 3)] parcoord(z1, main=\"parcoord state.x77\") ladderplot(z1, pch=NA, scale=TRUE, main=\"ladderplot state.x77 original\") ladderplot(z1, main=\"ladderplot state.x77 original\") ir <- rbind(iris3[,,1], iris3[,,2], iris3[,,3]) z2 <- log(ir)[, c(3, 4, 2, 1)] parcoord(z2, col = 1 + (0:149)) ladderplot(z2, scale=TRUE, col = 1 + (0:149), main=\"ladderplot iris original\") ladderplot(z2, col = 1 + (0:149)) par(opar) } } # }"},{"path":"/reference/legendg.html","id":null,"dir":"Reference","previous_headings":"","what":"Legend with grouped bars, lines or symbols — legendg","title":"Legend with grouped bars, lines or symbols — legendg","text":"Displays legend one rectangle, symbol line.","code":""},{"path":"/reference/legendg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Legend with grouped bars, lines or symbols — legendg","text":"","code":"legendg(x,y=NULL,legend,fill=NULL,col=par(\"col\"), border=list(\"black\"),lty,lwd,pch=NULL,angle=45,density=NULL, bty=\"o\",bg=par(\"bg\"),box.lwd=par(\"lwd\"),box.lty=par(\"lty\"), box.col=par(\"fg\"),pt.bg=NA,cex=1,pt.cex=cex,pt.lwd=lwd, pt.space=1,xjust=0,yjust=1,x.intersp=1,y.intersp=1, adj=c(0,0.5),text.width=NULL,text.col=par(\"col\"),merge=FALSE, trace=FALSE,plot=TRUE,ncol=1,horiz=FALSE,title=NULL, inset=0,xpd,title.col=text.col)"},{"path":"/reference/legendg.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Legend with grouped bars, lines or symbols — legendg","text":"x,y Position legend legend. legend Labels legend legend. fill List fill colors rectangles. col Color(s), perhaps list, symbols. border Border color(s) rectangles. lty Line type, currently ignored set 1. lwd Line width, currently ignored. pch List symbols legend. angle,density Currently ignored. bty Legend box type displayed. bg Background color legend. box.lwd,box.lty,box.col Line width, type color surrounding box. cex Character expansion text. pt.bg,pt.cex,pt.lwd Background color, character expansion line width symbols. pt.space Spacing symbols multiplier strwidth(\"O\"). xjust,yjust Justification legend. x.intersp,y.intersp x y character spacing legend text. adj Text adjustment. text.width,text.col Width color legend text. merge Whether merge points lines. trace Show legend calculated. plot Whether plot legend. ncol Number columns legend. horiz Whether display horizontal legend. title Title legend. inset Inset distances use keywords. xpd optional value par(xpd=). title.col Color legend title.","code":""},{"path":"/reference/legendg.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Legend with grouped bars, lines or symbols — legendg","text":"value returned legend returned invisibly.","code":""},{"path":"/reference/legendg.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Legend with grouped bars, lines or symbols — legendg","text":"legendg calls legend display legend blank space left labels. attempts display groups colored rectangles symbols space depending upon contents either fill pch. form list number elements equal number labels, one fills symbols label. legendg display four fills symbols next label, allowing user label group rather just one per label.","code":""},{"path":"/reference/legendg.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Legend with grouped bars, lines or symbols — legendg","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/legendg.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Legend with grouped bars, lines or symbols — legendg","text":"","code":"plot(0.5,0.5,xlim=c(0,1),ylim=c(0,1),type=\"n\", main=\"Test of grouped legend function\") legendg(0.5,0.8,c(\"one\",\"two\",\"three\"),pch=list(1,2:3,4:6), col=list(1,2:3,4:6),pt.space=1.5) legendg(0.5,0.5,c(\"one\",\"two\",\"three\"),fill=list(1,2:3,4:6)) # fake a line/point with text points legendg(0.2,0.25,c(\"letter\",\"number\"), pch=list(c(\"-\",\"A\",\"-\"),c(\"-\",\"1\",\"-\")), col=list(rep(2,3),rep(3,3)))"},{"path":"/reference/lengthKey.html","id":null,"dir":"Reference","previous_headings":"","what":"Key for interpreting lengths in a plot — lengthKey","title":"Key for interpreting lengths in a plot — lengthKey","text":"Key interpreting lengths plot","code":""},{"path":"/reference/lengthKey.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Key for interpreting lengths in a plot — lengthKey","text":"","code":"lengthKey(x,y,tickpos,scale)"},{"path":"/reference/lengthKey.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Key for interpreting lengths in a plot — lengthKey","text":"x,y position left end key user units. tickpos labels appear key. scale value scale length key.","code":""},{"path":"/reference/lengthKey.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Key for interpreting lengths in a plot — lengthKey","text":"nil","code":""},{"path":"/reference/lengthKey.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Key for interpreting lengths in a plot — lengthKey","text":"lengthKey displays line tick marks values tickpos tickmarks. useful line segments plot represent numeric values. Note plot 1:1 aspect ratio, length key usually misleading.","code":""},{"path":"/reference/lengthKey.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Key for interpreting lengths in a plot — lengthKey","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/lengthKey.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Key for interpreting lengths in a plot — lengthKey","text":"","code":"# manufacture a matrix of orientations in radians o<-matrix(rep(pi*seq(0.1,0.8,by=0.1),7),ncol=8,byrow=TRUE) m<-matrix(rnorm(56)+4,ncol=8,byrow=TRUE) # get an empty plot of approximately 1:1 aspect ratio plot(0,xlim=c(0.7,8.3),ylim=c(0.7,7.3),type=\"n\") vectorField(o,m,vecspec=\"rad\") # the scaling usually has to be worked out by trial and error lengthKey(0.3,-0.5,c(0,5,10),0.24)"},{"path":"/reference/makeDensityMatrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute a matrix of counts from a list of x,y positions — makeDensityMatrix","title":"Compute a matrix of counts from a list of x,y positions — makeDensityMatrix","text":"Compute matrix counts cell represent number occurrences cell's coordinates list x,y cooordinate values, optionally computing second matrix average values attached coordinate observations.","code":""},{"path":"/reference/makeDensityMatrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute a matrix of counts from a list of x,y positions — makeDensityMatrix","text":"","code":"makeDensityMatrix(x,y,z=NULL,nx=100,ny=50,zfun=c(\"mean\",\"sum\"), xlim=c(-180,180),ylim=c(-90,90),geocoord=TRUE)"},{"path":"/reference/makeDensityMatrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute a matrix of counts from a list of x,y positions — makeDensityMatrix","text":"x,y Vectors x y coordinates. usually combined matrix data frame two columns. z Optional values attached coordinate pair. present, can matrix data frame three columns, x, y z. nx number \"x\" cells output matrix. ny number \"y\" cells output matrix. zfun function apply summed values attached coordinate pair. Currently defaults mean, otherwise sum returned. xlim extreme coordinates horizontal direction (see Details). ylim extreme coordinates vertical direction (see Details). geocoord Whether correct matrix values areal distortion Mercator projection.","code":""},{"path":"/reference/makeDensityMatrix.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute a matrix of counts from a list of x,y positions — makeDensityMatrix","text":"makeDensityMatrix expects two vectors matrix data frame least two columns. function written geographic coordinates, also work numeric coordinates. optional third vector column values coordinate processed. coordinate pair adds count cell matrix. third element, value added second matrix position. default, function computes mean values cell. zfun=\"sum\", sum values cell returned. geograhic data sets may large, leading memory problems, makeDensityMatrix can run small sections data set resulting matrices added together long coordinate limits consistent throughout.","code":""},{"path":"/reference/makeDensityMatrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute a matrix of counts from a list of x,y positions — makeDensityMatrix","text":"Either matrix counts coordinate pairs within cell list two matrices, second containing mean sum values associated coordinate pairs.","code":""},{"path":"/reference/makeDensityMatrix.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Compute a matrix of counts from a list of x,y positions — makeDensityMatrix","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/makeDensityMatrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute a matrix of counts from a list of x,y positions — makeDensityMatrix","text":"","code":"x<-sample(1:20,400,TRUE) y<-sample(1:20,400,TRUE) z<-runif(400,5,20) xyz<-makeDensityMatrix(x,y,z,nx=20,ny=20,xlim=c(1,10),ylim=c(1,10), geocoord=FALSE) #> Range of density (>0) - 1 5 #> Range of intensity (>0) - 5.111809 19.95792 par(mar=c(7,3,2,3)) plot(0,xlim=c(1,10),ylim=c(1,10),type=\"n\",xlab=\"\",axes=FALSE) box() densityGrid(xyz,range.cex=c(1,4),xlim=c(1,10),ylim=c(1,10), red=c(0,0.5,0.8,1),green=c(1,0.8,0.5,0),blue=0,pch=15) color.legend(3,-0.7,7,-0.2,c(5,10,15,20), rect.col=color.scale(1:4,cs1=c(0,0.5,0.8,1),cs2=c(1,0.8,0.5,0),cs3=0,alpha=1)) par(xpd=TRUE) text(5,0.3,\"Intensity\") points(c(3.5,4.5,5.5,6.5),rep(-1.7,4),pch=15,cex=1:4) text(c(3.5,4.5,5.5,6.5),rep(-1.3,4),1:4) text(5,-1,\"Density\") par(xpd=FALSE)"},{"path":"/reference/makeIntersectList.html","id":null,"dir":"Reference","previous_headings":"","what":"Count set intersections — makeIntersectList","title":"Count set intersections — makeIntersectList","text":"Create list set intersections matrix indicators","code":""},{"path":"/reference/makeIntersectList.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count set intersections — makeIntersectList","text":"","code":"makeIntersectList(x,xnames=NULL,sep=\"+\")"},{"path":"/reference/makeIntersectList.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Count set intersections — makeIntersectList","text":"x data frame matrix rows represent objects columns attributes. 1 TRUE indicates object (row) attribute member set (column). x can also matrix data frame first column contains object identifiers second contains attribute codes. xnames Optional user-supplied names attributes x. sep character use separator attribute labels.","code":""},{"path":"/reference/makeIntersectList.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Count set intersections — makeIntersectList","text":"makeIntersectList reads matrix (data frame values type) containing dichotomous values (either 0/1 FALSE/TRUE) labels (see next paragraph). first type input, row represents object column represents set. value 1 TRUE indicates object member set. function creates list vectors correspond combinations sets (set intersections) inserts counts elements combination. row x zeros, counted, second last element list returned contains count rows x thus non-members can calculated. matrix (data frame values type) containing values 0/1 TRUE/FALSE, passed categoryReshape conversion data frame described . See categoryReshape details . makeIntersectList combines set attribute names form intersection names. intersection sets B, name +B (unless sep changed) . names displayed intersectDiagram. change , use xnames argument.","code":""},{"path":"/reference/makeIntersectList.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count set intersections — makeIntersectList","text":"list intersection counts percentages, total number objects attribute codes.","code":""},{"path":"/reference/makeIntersectList.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Count set intersections — makeIntersectList","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/makeIntersectList.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Count set intersections — makeIntersectList","text":"","code":"# create a matrix where each row represents an element and # a 1 (or TRUE) in each column indicates that the element is a member # of that set. setdf<-data.frame(A=sample(c(0,1),100,TRUE,prob=c(0.7,0.3)), B=sample(c(0,1),100,TRUE,prob=c(0.7,0.3)), C=sample(c(0,1),100,TRUE,prob=c(0.7,0.3)), D=sample(c(0,1),100,TRUE,prob=c(0.7,0.3))) makeIntersectList(setdf) #> [[1]] #> 0+1 #> 2 #> #> [[2]] #> Total #> 2 #> #> [[3]] #> attributes #> \"0\" \"1\" #> #> attr(,\"class\") #> [1] \"intersectList\" ns<-sample(1:8,20,TRUE) objects<-0 for(i in 1:length(ns)) objects<-c(objects,rep(i,ns[i])) attributes<-\"Z\" for(i in 1:length(ns)) attributes<-c(attributes,sample(LETTERS[1:8],ns[i])) setdf2<-data.frame(objects[-1],attributes[-1]) makeIntersectList(setdf2) #> [[1]] #> A B C D E F G H #> 0 0 0 0 0 1 0 0 #> #> [[2]] #> A+B A+C A+D A+E A+F A+G A+H B+C B+D B+E B+F B+G B+H C+D C+E C+F C+G C+H D+E D+F #> 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 #> D+G D+H E+F E+G E+H F+G F+H G+H #> 0 0 0 0 0 0 0 0 #> #> [[3]] #> A+B+C A+B+D A+B+E A+B+F A+B+G A+B+H A+C+D A+C+E A+C+F A+C+G A+C+H A+D+E A+D+F #> 0 0 0 0 0 0 0 0 0 0 0 0 0 #> A+D+G A+D+H A+E+F A+E+G A+E+H A+F+G A+F+H A+G+H B+C+D B+C+E B+C+F B+C+G B+C+H #> 0 0 0 0 0 1 0 0 0 0 0 0 0 #> B+D+E B+D+F B+D+G B+D+H B+E+F B+E+G B+E+H B+F+G B+F+H B+G+H C+D+E C+D+F C+D+G #> 0 0 0 0 0 0 0 0 0 0 1 0 0 #> C+D+H C+E+F C+E+G C+E+H C+F+G C+F+H C+G+H D+E+F D+E+G D+E+H D+F+G D+F+H D+G+H #> 0 0 0 0 0 0 0 0 0 0 0 0 0 #> E+F+G E+F+H E+G+H F+G+H #> 0 0 0 0 #> #> [[4]] #> A+B+C+D A+B+C+E A+B+C+F A+B+C+G A+B+C+H A+B+D+E A+B+D+F A+B+D+G A+B+D+H A+B+E+F #> 0 0 0 0 0 1 0 0 0 0 #> A+B+E+G A+B+E+H A+B+F+G A+B+F+H A+B+G+H A+C+D+E A+C+D+F A+C+D+G A+C+D+H A+C+E+F #> 0 1 0 1 0 0 0 0 0 0 #> A+C+E+G A+C+E+H A+C+F+G A+C+F+H A+C+G+H A+D+E+F A+D+E+G A+D+E+H A+D+F+G A+D+F+H #> 0 0 0 0 0 0 0 0 0 0 #> A+D+G+H A+E+F+G A+E+F+H A+E+G+H A+F+G+H B+C+D+E B+C+D+F B+C+D+G B+C+D+H B+C+E+F #> 0 0 0 0 0 0 0 0 0 0 #> B+C+E+G B+C+E+H B+C+F+G B+C+F+H B+C+G+H B+D+E+F B+D+E+G B+D+E+H B+D+F+G B+D+F+H #> 0 0 0 0 0 0 0 0 0 0 #> B+D+G+H B+E+F+G B+E+F+H B+E+G+H B+F+G+H C+D+E+F C+D+E+G C+D+E+H C+D+F+G C+D+F+H #> 0 0 0 0 0 0 0 0 0 0 #> C+D+G+H C+E+F+G C+E+F+H C+E+G+H C+F+G+H D+E+F+G D+E+F+H D+E+G+H D+F+G+H E+F+G+H #> 0 0 0 0 0 0 0 0 0 0 #> #> [[5]] #> A+B+C+D+E A+B+C+D+F A+B+C+D+G A+B+C+D+H A+B+C+E+F A+B+C+E+G A+B+C+E+H A+B+C+F+G #> 0 0 0 0 0 0 0 0 #> A+B+C+F+H A+B+C+G+H A+B+D+E+F A+B+D+E+G A+B+D+E+H A+B+D+F+G A+B+D+F+H A+B+D+G+H #> 0 0 0 0 0 0 0 0 #> A+B+E+F+G A+B+E+F+H A+B+E+G+H A+B+F+G+H A+C+D+E+F A+C+D+E+G A+C+D+E+H A+C+D+F+G #> 0 0 0 1 0 0 0 0 #> A+C+D+F+H A+C+D+G+H A+C+E+F+G A+C+E+F+H A+C+E+G+H A+C+F+G+H A+D+E+F+G A+D+E+F+H #> 0 0 0 0 0 0 0 1 #> A+D+E+G+H A+D+F+G+H A+E+F+G+H B+C+D+E+F B+C+D+E+G B+C+D+E+H B+C+D+F+G B+C+D+F+H #> 0 0 0 0 0 0 0 0 #> B+C+D+G+H B+C+E+F+G B+C+E+F+H B+C+E+G+H B+C+F+G+H B+D+E+F+G B+D+E+F+H B+D+E+G+H #> 0 0 0 0 0 0 0 0 #> B+D+F+G+H B+E+F+G+H C+D+E+F+G C+D+E+F+H C+D+E+G+H C+D+F+G+H C+E+F+G+H D+E+F+G+H #> 0 0 0 0 0 0 0 0 #> #> [[6]] #> A+B+C+D+E+F A+B+C+D+E+G A+B+C+D+E+H A+B+C+D+F+G A+B+C+D+F+H A+B+C+D+G+H #> 0 0 0 0 0 0 #> A+B+C+E+F+G A+B+C+E+F+H A+B+C+E+G+H A+B+C+F+G+H A+B+D+E+F+G A+B+D+E+F+H #> 0 0 1 0 0 0 #> A+B+D+E+G+H A+B+D+F+G+H A+B+E+F+G+H A+C+D+E+F+G A+C+D+E+F+H A+C+D+E+G+H #> 0 0 0 1 0 0 #> A+C+D+F+G+H A+C+E+F+G+H A+D+E+F+G+H B+C+D+E+F+G B+C+D+E+F+H B+C+D+E+G+H #> 0 0 0 0 0 0 #> B+C+D+F+G+H B+C+E+F+G+H B+D+E+F+G+H C+D+E+F+G+H #> 0 0 0 0 #> #> [[7]] #> A+B+C+D+E+F+G A+B+C+D+E+F+H A+B+C+D+E+G+H A+B+C+D+F+G+H A+B+C+E+F+G+H #> 0 1 0 0 1 #> A+B+D+E+F+G+H A+C+D+E+F+G+H B+C+D+E+F+G+H #> 1 0 1 #> #> [[8]] #> A+B+C+D+E+F+G+H #> 3 #> #> [[9]] #> Total #> 20 #> #> [[10]] #> attributes #> \"A\" \"B\" \"C\" \"D\" \"E\" \"F\" \"G\" #> #> \"H\" #> #> attr(,\"class\") #> [1] \"intersectList\""},{"path":"/reference/maxEmptyRect.html","id":null,"dir":"Reference","previous_headings":"","what":"Find an empty space on a plot — maxEmptyRect","title":"Find an empty space on a plot — maxEmptyRect","text":"Try find largest empty rectangle plot.","code":""},{"path":"/reference/maxEmptyRect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find an empty space on a plot — maxEmptyRect","text":"","code":"maxEmptyRect(ax,ay,x,y)"},{"path":"/reference/maxEmptyRect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find an empty space on a plot — maxEmptyRect","text":"ax,ay rectangle within points contained. Usually limits plot. x,y x y positions points.","code":""},{"path":"/reference/maxEmptyRect.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find an empty space on a plot — maxEmptyRect","text":"maxEmptyRect searches pairs points plot find largest rectangular space within none points lie. guarantee space large enough fit legend text. Two alternatives largest.empty function Hmisc package emptyspace function. maxEmptyRect appears outperform emptyspace, particularly running time. However, emptyspace sometimes find \"squarer\" rectangle maxEmptyRect finds slightly larger narrow rectangle.","code":""},{"path":"/reference/maxEmptyRect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find an empty space on a plot — maxEmptyRect","text":"list containing area rectangle coordinates lower left upper right corners (used rect) rectangle found.","code":""},{"path":"/reference/maxEmptyRect.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find an empty space on a plot — maxEmptyRect","text":"Hans Borchers","code":""},{"path":"/reference/maxEmptyRect.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Find an empty space on a plot — maxEmptyRect","text":". Naamad, D. T. Lee, W.-L. Hsu (1984). Maximum Empty Rectangle Problem. Discrete Applied Mathematics, 8: 267-277.","code":""},{"path":"/reference/maxEmptyRect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find an empty space on a plot — maxEmptyRect","text":"","code":"x<-runif(100) y<-runif(100) plot(x,y,main=\"Find the maximum empty rectangle\",xlab=\"X\",ylab=\"Y\") mer<-maxEmptyRect(c(0,1),c(0,1),x,y) rect(mer$rect[1],mer$rect[2],mer$rect[3],mer$rect[4],border=\"red\")"},{"path":"/reference/mtext3d.html","id":null,"dir":"Reference","previous_headings":"","what":"Display text in the margins of a 3D plot — mtext3d","title":"Display text in the margins of a 3D plot — mtext3d","text":"Display text margins 3D plot.","code":""},{"path":"/reference/mtext3d.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display text in the margins of a 3D plot — mtext3d","text":"","code":"mtext3d(edge,pmat,labels=TRUE,at=NULL,dist=0.3,xpd=NA,...)"},{"path":"/reference/mtext3d.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display text in the margins of a 3D plot — mtext3d","text":"edge axis calculate. pmat matrix transform coordinates. labels labels display margin. position axis. dist Offset axis. xpd set clipping display. ... additional arguments passed ptext3d.","code":""},{"path":"/reference/mtext3d.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display text in the margins of a 3D plot — mtext3d","text":"nil","code":""},{"path":"/reference/mtext3d.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display text in the margins of a 3D plot — mtext3d","text":"Ben Bolker","code":""},{"path":"/reference/multhist.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot a multiple histogram, as a barplot — multhist","title":"Plot a multiple histogram, as a barplot — multhist","text":"Given list, plots side--side barplot containing histograms elements","code":""},{"path":"/reference/multhist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot a multiple histogram, as a barplot — multhist","text":"","code":"multhist(x,beside=TRUE,freq=NULL,probability=!freq,plot.it=TRUE,...)"},{"path":"/reference/multhist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot a multiple histogram, as a barplot — multhist","text":"x list numeric vectors beside plot histogram bars groups side--side? freq logical; 'TRUE', histogram graphic representation frequencies, 'counts' component result; 'FALSE', probability densities, component 'density', plotted (histogram total area one). Defaults 'TRUE' 'probability' specified (consider equidistant breaks hist) probability alias '!freq', S compatibility plot.Whether display histogram. ... additional arguments hist barplot","code":""},{"path":"/reference/multhist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot a multiple histogram, as a barplot — multhist","text":"list including return value first call hist (list) values bar heights.","code":""},{"path":"/reference/multhist.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot a multiple histogram, as a barplot — multhist","text":"Ben Bolker","code":""},{"path":[]},{"path":"/reference/multhist.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Plot a multiple histogram, as a barplot — multhist","text":"'inside' argument barplot (currently implemented barplot anyway) deleted argument list. default value NULL freq consistency hist equivalent TRUE.","code":""},{"path":"/reference/multhist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot a multiple histogram, as a barplot — multhist","text":"","code":"set.seed(1234) l <- list(runif(10)*10,1:10,c(1,1,1,1,4,8)) multhist(l)"},{"path":"/reference/multivari.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to draw a multivari chart — multivari","title":"Function to draw a multivari chart — multivari","text":"multivari chart one quantitative response variable depending two four categorical variables can drawn.","code":""},{"path":"/reference/multivari.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to draw a multivari chart — multivari","text":"","code":"multivari(var, fac1, fac2, fac3 = NULL, fac4 = NULL, data, sort = FALSE, fun = mean, pch = list(15, 16, 17), col = list(\"black\", \"blue\", \"red\"), col0 = \"black\", cex = 1, fac.cex = 2, xlab.depth = 3, legend = FALSE, main = paste(\"multivari chart of\", var), add = FALSE, ...)"},{"path":"/reference/multivari.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to draw a multivari chart — multivari","text":"var variable name (character string) column index response variable, required fac1 variable name (character string) column index first level factor, required; precedes fac2 fac3 (present) hierarchy (see Details) fac2 variable name (character string) column index second level factor, required; follows fac1 precedes fac3 (present) hierarchy (see Details) fac3 variable name (character string) column index third level factor, optional; present, fac3 last factor hierarchy (see Details) fac4 variable name (character string) column index fourth level factor, optional; can specified also third level factor; present, factor first hierarchy (see Details), separate multivari charts first three factors drawn level factor data data frame, required sort logical, specifying whether levels sorted, converting character vectors factors (single choice factors needed); default: FALSE fun function used aggregation; default: mean pch list length 2 3, depending whether fac3 specified; ith list element can individual plotting symbol (like usual pch entry) vector plot symbols level fac_i col list length 2 3, depending whether fac3 specified; ith list element can individual color vector colors level fac_i; color specification used plot symbols fac_i levels lines connecting symbols next level hierarchy col0 color first line drawn cex size axis annotation text (annotation fourth level header 1.5 times size) fac.cex multiplier cex; plot symbol sizes fac.cex*cex; default: 2 xlab.depth labels horizontal axis printed level hierarchy (default: 3); depth reduced, different plot symbols used, legend drawn legend logical determining whether legend drawn (default: FALSE); function determines wether top right bottom right yields better position (guaranteed overlab); work well, one can manually draw legend outer margin main title, usual; default provided add logical; add existing plot (course suitable axis limits)?; default: FALSE; note horizontal axis labeling always printed function multivari, vertical axis labeling omitted add=TRUE ... arguments functions plot, lines, points, mtext","code":""},{"path":"/reference/multivari.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Function to draw a multivari chart — multivari","text":"function inspired Minitabs behavior multivari charts (see also Bruno Scibilia's blog linked references). attempt visualize individual observations. multivari chart mainly serves exploratory purposes. works particularly well balanced data, can also used messy data. multivari can visualize dependence single quantitative variable four factors (.e., interactions order four can visualized). display hierarchical: factors later hierarchy, conditional means given level combinations factors earlier hierarchy displayed. Therefore, order factors can make big difference display. natural order, may worthwhile inspect several orders. interactions two factors , often preferrable use function interaction.plot raw.means.plot.","code":""},{"path":"/reference/multivari.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to draw a multivari chart — multivari","text":"list (lists ) data frames summary statistics plotted","code":""},{"path":"/reference/multivari.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Function to draw a multivari chart — multivari","text":"Scibilia, Bruno (2013). Using Multi-Vari Charts Analyze Families Variations. https://blog.minitab.com/en/blog/using-variability-charts--analyze-call-center-wait-times.","code":""},{"path":"/reference/multivari.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Function to draw a multivari chart — multivari","text":"Ulrike Groemping","code":""},{"path":[]},{"path":"/reference/multivari.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function to draw a multivari chart — multivari","text":"","code":"##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. if (FALSE) { # \\dontrun{ require(car) multivari(\"cycles\", \"len\", \"load\", \"amp\", data=Wool, col=list(\"black\",\"red\",c(\"grey70\",\"grey45\",\"grey20\")), pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2) multivari(\"cycles\", \"load\", \"len\", \"amp\", data=Wool, col=list(\"black\",c(\"red\",\"blue\",\"darkgreen\"), c(\"grey70\",\"grey45\",\"grey20\")), pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2) ## create a fake fourth factor fakedat <- rbind(cbind(newfac=\"blabla\",Wool),cbind(newfac=\"albalb\",Wool)) ## make it character for demonstrating the effect of sort option fakedat$newfac <- as.character(fakedat$newfac) ## default: sort order in the data is respected (order of unique is used) multivari(\"cycles\", \"load\", \"len\", \"amp\", \"newfac\", data=fakedat, col=list(\"black\",c(\"red\",\"blue\",\"darkgreen\"), c(\"grey70\",\"grey45\",\"grey20\")), pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2, cex=0.8) ## sort=TRUE: levels are sorted (order of sort(unique)) multivari(\"cycles\", \"load\", \"len\", \"amp\", \"newfac\", data=fakedat, col=list(\"black\",c(\"red\",\"blue\",\"darkgreen\"), c(\"grey70\",\"grey45\",\"grey20\")), pch=list(15,17,8), legend=TRUE, xlab.depth = 2, lwd=2, cex=0.8, sort=TRUE) } # }"},{"path":"/reference/multsymbolbox.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw boxes filled with symbols — multsymbolbox","title":"Draw boxes filled with symbols — multsymbolbox","text":"Draw boxes current figure filled symbols representing individual counts.","code":""},{"path":"/reference/multsymbolbox.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw boxes filled with symbols — multsymbolbox","text":"","code":"multsymbolbox(x1,y1,x2,y2,tot,relw=0.8,fg=par(\"fg\"),bg=par(\"bg\"), box=TRUE,debug=FALSE,...)"},{"path":"/reference/multsymbolbox.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw boxes filled with symbols — multsymbolbox","text":"x1 numeric vector: left sides boxes y1 numeric vector: bottom sides boxes x2 numeric vector: right sides boxes y2 numeric vector: top sides boxes tot numeric vector: total numbers symbols put box relw relative width (relative height) symbols n fg foreground color(s) bg background color(s) box (logical) draw box borders? debug debug output? ... additional arguments polygon() drawing boxes","code":""},{"path":"/reference/multsymbolbox.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Draw boxes filled with symbols — multsymbolbox","text":"none","code":""},{"path":"/reference/multsymbolbox.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Draw boxes filled with symbols — multsymbolbox","text":"Ben Bolker","code":""},{"path":"/reference/multsymbolbox.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Draw boxes filled with symbols — multsymbolbox","text":"","code":"plot(1:10,1:10,type=\"n\") multsymbolbox(c(2,4),5,c(4,5),8,tot=c(10,8))"},{"path":"/reference/oz.windrose.html","id":null,"dir":"Reference","previous_headings":"","what":"Display an Australian wind rose — oz.windrose","title":"Display an Australian wind rose — oz.windrose","text":"Displays wind rose style used Australian Bureau Meteorology.","code":""},{"path":"/reference/oz.windrose.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display an Australian wind rose — oz.windrose","text":"","code":"oz.windrose(windagg,maxpct=20,wrmar=c(4,5,6,5),scale.factor=30, speed.col=c(\"#dab286\",\"#fe9a66\",\"#ce6733\",\"#986434\"), speed.width=NA,show.legend=TRUE,legend.pos=NA,...)"},{"path":"/reference/oz.windrose.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display an Australian wind rose — oz.windrose","text":"windagg matrix percentages rows representing speed ranges columns indicating wind directions. maxpct maximum percentage displayed radial grid. wrmar Plot margins diagram. scale.factor scale factor diagram. speed.col Colors representing speed ranges. speed.width Half widths bars representing speed ranges. show.legend Logical indicating whether display legend. legend.pos vertical position wind rose legend. Australian Bureau Meteorology displays legend top plot ... additional arguments passed plot.","code":""},{"path":"/reference/oz.windrose.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display an Australian wind rose — oz.windrose","text":"oz.windrose displays wind rose style used Australian Bureau Meteorology. limb represents bin wind directions, conventionally eight bins. windagg eight columns, limbs displayed. rows windagg represent speed ranges used Australian Bureau Meteorology (0, 0-10, 10-20, 20-30 30 km/hour). diameter central circle calculated (percent calm observations)/(number direction bins). remaining grid circles spaced circumference \"Calm\" circle.","code":""},{"path":"/reference/oz.windrose.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Display an Australian wind rose — oz.windrose","text":"title desired, remember move legend bottom plot. function passed values sum 100, resulting plot best misleading.","code":""},{"path":"/reference/oz.windrose.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display an Australian wind rose — oz.windrose","text":"nil","code":""},{"path":"/reference/oz.windrose.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display an Australian wind rose — oz.windrose","text":"Jim Lemon (thanks Anna Sydney BoM office Alejo finding problem heavily prevailing winds.)","code":""},{"path":[]},{"path":"/reference/oz.windrose.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display an Australian wind rose — oz.windrose","text":"","code":"windagg<-matrix(c(8,0,0,0,0,0,0,0,4,6,2,1,6,3,0,4,2,8,5,3,5,2,1,1, 5,5,2,4,1,4,1,2,1,2,4,0,3,1,3,1),nrow=5,byrow=TRUE) oz.windrose(windagg) #> Warning: argument 1 does not name a graphical parameter #> NULL"},{"path":"/reference/oz.windrose.legend.html","id":null,"dir":"Reference","previous_headings":"","what":"Display an Australian wind rose legend — oz.windrose.legend","title":"Display an Australian wind rose legend — oz.windrose.legend","text":"Displays wind rose legend style used Australian Bureau Meteorology.","code":""},{"path":"/reference/oz.windrose.legend.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display an Australian wind rose legend — oz.windrose.legend","text":"","code":"oz.windrose.legend(maxpct=20,scale.factor=30, speed.col=c(\"#dab286\",\"#fe9a66\",\"#ce6733\",\"#986434\"), speed.width=NA,legend.pos=NA)"},{"path":"/reference/oz.windrose.legend.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display an Australian wind rose legend — oz.windrose.legend","text":"maxpct maximum percentage display radial grid. scale.factor scale factor plot. speed.col Colors representing speed ranges. speed.width Half widths bars representing speed ranges. legend.pos vertical position wind rose legend. Australian Bureau Meteorology displays legend top plot","code":""},{"path":"/reference/oz.windrose.legend.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display an Australian wind rose legend — oz.windrose.legend","text":"nil","code":""},{"path":"/reference/oz.windrose.legend.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display an Australian wind rose legend — oz.windrose.legend","text":"Jim Lemon (thanks Anna Sydney BoM office)","code":""},{"path":[]},{"path":"/reference/oz.windrose.legend.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display an Australian wind rose legend — oz.windrose.legend","text":"","code":"plot(0,xlim=c(-20,20),ylim=c(-20,20),type=\"n\",axes=FALSE,xlab=\"\",ylab=\"\") par(xpd=TRUE) oz.windrose.legend() par(xpd=FALSE)"},{"path":"/reference/p2p_arrows.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw arrows between points — p2p_arrows","title":"Draw arrows between points — p2p_arrows","text":"Displays arrows existing plot specified points.","code":""},{"path":"/reference/p2p_arrows.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw arrows between points — p2p_arrows","text":"","code":"p2p_arrows(x1,y1,x2,y2,space=0.05,col=par(\"fg\"),...)"},{"path":"/reference/p2p_arrows.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw arrows between points — p2p_arrows","text":"x1 Starting x positions labels. y1 Starting y positions labels. x2 Ending x positions labels. y2 Ending y positions labels. space proportion distance points leave space arrow. col Color(s) arrows. ... Extra arguments passed arrows.","code":""},{"path":"/reference/p2p_arrows.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Draw arrows between points — p2p_arrows","text":"p2p_arrows displays arrows plot one pairs specified points.","code":""},{"path":"/reference/p2p_arrows.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Draw arrows between points — p2p_arrows","text":"nil","code":""},{"path":"/reference/p2p_arrows.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Draw arrows between points — p2p_arrows","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/panes.html","id":null,"dir":"Reference","previous_headings":"","what":"Prepare a ","title":"Prepare a ","text":"Split graphics device \"panel\" type layout group plots","code":""},{"path":"/reference/panes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prepare a ","text":"","code":"panes(mat=NULL,widths=rep(1,ncol(mat)),heights=rep(1,nrow(mat)), nrow=2,ncol=2,mar=c(0,0,1.6,0),oma=c(2.5,1,1,1))"},{"path":"/reference/panes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prepare a ","text":"mat matrix representing number panes created order plotting. widths,heights widths heights panes. See layout. nrow,ncol numbers rows columns layout. See par(mfrow). mar margins plot panes. oma outer margins entire group panes.","code":""},{"path":"/reference/panes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Prepare a ","text":"panes combines information displaying set plots \"panel\" layout. default values usually produce desired result calling par(mfrow). mat NULL, layout function called instead par(mfrow). two methods included convenience user. Note panes produce plots user must call tab.title get \"look\" panel plot. overall title usually centered left edge (example) center one plots bottom row.","code":""},{"path":"/reference/panes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prepare a ","text":"values par options existed panes called. list usually used restore values.","code":""},{"path":"/reference/panes.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Prepare a ","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/panes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Prepare a ","text":"","code":"y<-runif(8) oldpar<-panes(matrix(1:4,nrow=2,byrow=TRUE)) par(mar=c(0,2,1.6,0)) boxplot(y,axes=FALSE) axis(2) box() par(mar=c(0,0,1.6,2)) tab.title(\"Boxplot of y\",tab.col=\"#88dd88\") barplot(y,axes=FALSE,col=2:9) axis(4) box() tab.title(\"Barplot of y\",tab.col=\"#88dd88\") par(mar=c(2,2,1.6,0)) pie(y,col=2:9) tab.title(\"Pie chart of y\",tab.col=\"#88dd88\") box() par(mar=c(2,0,1.6,2)) plot(y,xaxs=\"i\",xlim=c(0,9),axes=FALSE,col=2:9) axis(4) box() tab.title(\"Scatterplot of y\",tab.col=\"#88dd88\") # center the title at the left edge of the last plot mtext(\"Test of panes function\",at=0,side=1,line=0.8,cex=1.5) panes(matrix(1:3,ncol=1),heights=c(0.7,0.8,1)) #> $mar #> [1] 2.0 0.0 1.6 2.0 #> #> $mfrow #> [1] 2 2 #> #> $oma #> [1] 0 0 0 0 #> par(mar=c(0,2,2,2)) plot(sort(runif(7)),type=\"l\",axes=FALSE) axis(2,at=seq(0.1,0.9,by=0.2)) box() tab.title(\"Rising expectations\",tab.col=\"#ee6666\") barplot(rev(sort(runif(7))),col=\"blue\",axes=FALSE) axis(2,at=seq(0.1,0.9,by=0.2)) box() tab.title(\"Diminishing returns\",tab.col=\"#6666ee\") par(mar=c(4,2,2,2)) tso<-c(0.2,0.3,0.5,0.4,0.6,0.8,0.1) plot(tso,type=\"n\",axes=FALSE,xlab=\"\") if (FALSE) { # \\dontrun{ # the following needs a Unicode locale to work (and a suitable font) # Few devices can plot these -- and not the default pdf() for checking. points(1:7,tso,pch=c(rep(-0x263a,6),-0x2639),cex=2) } # } axis(1,at=1:7, labels=c(\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\",\"Sunday\",\"Monday\")) axis(2,at=seq(0.1,0.9,by=0.2)) box() tab.title(\"The sad outcome\",tab.col=\"#66ee66\") mtext(\"A lot of malarkey\",side=1,line=2.5) par(oldpar)"},{"path":"/reference/pasteCols.html","id":null,"dir":"Reference","previous_headings":"","what":"Paste the columns of a matrix together — pasteCols","title":"Paste the columns of a matrix together — pasteCols","text":"Paste columns matrix together form many \"words\" columns.","code":""},{"path":"/reference/pasteCols.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Paste the columns of a matrix together — pasteCols","text":"","code":"pasteCols(x,sep=\"\")"},{"path":"/reference/pasteCols.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Paste the columns of a matrix together — pasteCols","text":"x matrix. sep separator use paste command.","code":""},{"path":"/reference/pasteCols.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Paste the columns of a matrix together — pasteCols","text":"pasteCols pastes columns matrix together form vector element concatenation elements columns matrix. intended producing identifiers matrix returned combn function.","code":""},{"path":"/reference/pasteCols.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Paste the columns of a matrix together — pasteCols","text":"vector character strings.","code":""},{"path":"/reference/pasteCols.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Paste the columns of a matrix together — pasteCols","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/pasteCols.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Paste the columns of a matrix together — pasteCols","text":"","code":"# create a matrix of the combinations of the first five letters of the # alphabet taken two at a time. alpha5<-combn(LETTERS[1:5],2,simplify=TRUE) pasteCols(alpha5,sep=\"+\") #> [1] \"A+B\" \"A+C\" \"A+D\" \"A+E\" \"B+C\" \"B+D\" \"B+E\" \"C+D\" \"C+E\" \"D+E\""},{"path":"/reference/paxis3d.html","id":null,"dir":"Reference","previous_headings":"","what":"Display text in the margins of a 3D plot — paxis3d","title":"Display text in the margins of a 3D plot — paxis3d","text":"Display text margins 3D plot.","code":""},{"path":"/reference/paxis3d.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display text in the margins of a 3D plot — paxis3d","text":"","code":"paxis3d(edge,pmat,at=NULL,labels=TRUE,tick=TRUE, pos=NULL,nticks=5,ticklen=0.05,labdist=0.15,xpd=NA,...)"},{"path":"/reference/paxis3d.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display text in the margins of a 3D plot — paxis3d","text":"edge axis calculate. pmat matrix transform coordinates. position axis. labels labels display margin. tick whether draw axis tick marks. pos axis position relative axes. nticks number tick marks. ticklen length tick marks proportion plot dimensions. labdist distance labels axis. xpd parameter set plot clipping. ... additional arguments passed ptext3d.","code":""},{"path":"/reference/paxis3d.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display text in the margins of a 3D plot — paxis3d","text":"nil","code":""},{"path":"/reference/paxis3d.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display text in the margins of a 3D plot — paxis3d","text":"Ben Bolker","code":""},{"path":"/reference/paxis3d.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display text in the margins of a 3D plot — paxis3d","text":"","code":"x <- 1:10 y <- 1:10 z <- outer(x,y,function(x,y) { 3*sin(2*pi*x)/(2*pi*x)+exp(y/10)+(x*y)/1000 }) par(mar=c(5,10,2,2)) pp <- perspx(x,y,z,ticktype=\"detailed\",phi=30,theta=80,nticks=3,r=10, axes=FALSE) ## axis labels not drawn when axes=FALSE paxis3d(\"X-\",pp,at=c(1,2,9)) paxis3d(\"Y+\",pp) paxis3d(\"Z-\",pp) mtext3d(\"X-\",pp,expression(alpha^sqrt(beta))) ## if you want labels parallel to axis, still have to figure out 'srt' ## by trial and error mtext3d(\"Y+\",pp,expression(\"velocity (\"*gamma*\", furlongs/fortnight)\"), xpd=NA,srt=6) mtext3d(\"Z-\",pp,\"Range\\n(r*)\",dist=0.5)"},{"path":"/reference/perspx.html","id":null,"dir":"Reference","previous_headings":"","what":"Display perspective plot — perspx","title":"Display perspective plot — perspx","text":"Display enhanced perspective plot additional return values","code":""},{"path":"/reference/perspx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display perspective plot — perspx","text":"","code":"perspx(x,y,z,...)"},{"path":"/reference/perspx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display perspective plot — perspx","text":"x,y,z x, y z coordinates plot. ... arguments passed persp.","code":""},{"path":"/reference/perspx.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display perspective plot — perspx","text":"Displays z values plotted x,y grid.","code":""},{"path":"/reference/perspx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display perspective plot — perspx","text":"list three elements, ranges x, y z.","code":""},{"path":"/reference/perspx.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display perspective plot — perspx","text":"Ben Bolker","code":""},{"path":"/reference/perspx.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display perspective plot — perspx","text":"","code":"x <- 1:10 y <- 1:10 z <- outer(x,y,function(x,y) { 3*sin(2*pi*x)/(2*pi*x)+exp(y/10)+(x*y)/1000 }) par(mar=c(5,10,2,2)) pp <- perspx(x,y,z,ticktype=\"detailed\",phi=30,theta=80,nticks=3,r=10, axes=FALSE)"},{"path":"/reference/pie.labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Place labels on a pie chart — pie.labels","title":"Place labels on a pie chart — pie.labels","text":"Places labels pie chart","code":""},{"path":"/reference/pie.labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Place labels on a pie chart — pie.labels","text":"","code":"pie.labels(x=0,y=0,angles,labels,radius=1.05,bg=\"white\",border=TRUE, minangle=NA,boxed=FALSE,explode=0,...)"},{"path":"/reference/pie.labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Place labels on a pie chart — pie.labels","text":"x,y x y position center pie chart angles numeric vector representing angles radians. return value floating.pie. labels Text strings label sector. radius radius place labels user units. default 1.05. bg color rectangles labels displayed. border Whether draw borders around rectangles. minangle Minimum angle labels. boxed Whether use text boxed.labels display labels. explode much pie chart \"exploded\". ... Arguments passed text boxed.labels.","code":""},{"path":"/reference/pie.labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Place labels on a pie chart — pie.labels","text":"nil","code":""},{"path":"/reference/pie.labels.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Place labels on a pie chart — pie.labels","text":"Labels may placed within pie (radius less pie radius), edge outside examples . within pie, probably best use boxed=TRUE. labels overlap, passing value radians minangle may used spread .","code":""},{"path":"/reference/pie.labels.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Place labels on a pie chart — pie.labels","text":"Remember x y specify center pie chart label positions specified angles radii center.","code":""},{"path":"/reference/pie.labels.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Place labels on a pie chart — pie.labels","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/pie.labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Place labels on a pie chart — pie.labels","text":"","code":"pieval<-c(2,1,3,94) plot(0,xlim=c(1.5,5),ylim=c(1,5),type=\"n\",axes=FALSE,xlab=\"\",ylab=\"\") box() bisect.angles<-floating.pie(3,3,pieval,explode=c(0.1,0.2,0.3,0)) pie.labels(3,3,bisect.angles,c(\"two\",\"one\",\"three\",\"ninety\\nfour\"), minangle=0.2,,explode=c(0.1,0.2,0.3,0))"},{"path":"/reference/pie3D.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a 3D pie chart — pie3D","title":"Display a 3D pie chart — pie3D","text":"Displays 3D pie chart optional labels.","code":""},{"path":"/reference/pie3D.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a 3D pie chart — pie3D","text":"","code":"pie3D(x,edges=NA,radius=1,height=0.1,theta=pi/6,start=0,border=par(\"fg\"), col=NULL,labels=NULL,labelpos=NULL,labelcol=par(\"fg\"),labelcex=1.5, sector.order=NULL,explode=0,shade=0.8,mar=c(4,4,4,4),pty=\"s\",...)"},{"path":"/reference/pie3D.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a 3D pie chart — pie3D","text":"x numeric vector value sector edges number lines forming ellipse radius radius pie user units height height pie user units theta angle viewing radians start angle start drawing sectors. border color sector border lines col colors sectors labels Optional labels sector labelpos Optional positions labels (see examples) labelcol color labels labelcex character expansion factor labels sector.order Allows operator specify order sectors drawn. explode amount \"explode\" pie user units shade > 0 < 1, proportion reduce brightness sector color get better 3D effect. mar Margins around pie. pty Whether force square plot region . (see Details) ... graphical parameters passed plot","code":""},{"path":"/reference/pie3D.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a 3D pie chart — pie3D","text":"bisecting angle sectors radians.","code":""},{"path":"/reference/pie3D.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a 3D pie chart — pie3D","text":"pie3D scales values x total 2*pi, dropping zeros NAs. displays empty plot, calculates sequence drawing sectors calls draw.tilted.sector draw sector. labels supplied, call pie3D.label place outside sector. supplied, number labels, label positions sector colors must least equal number values x. labels long, may help reduce radius pie change position example . order make dimensions pie reasonably accurate, square plot region (pty=\"s\") default. pty set \"m\", user can change margins, usually resulting non-square plot area. probably distort pie somewhat.","code":""},{"path":"/reference/pie3D.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Display a 3D pie chart — pie3D","text":"Due somewhat primitive method used draw sectors, sector extends beyond pi/2 3*pi/2 radians either direction may display properly. Setting start pi/2 often fix , user may adjust start order sectors extreme cases. argument sector.order allows user specify vector integers override calculation order sectors drawn. usually necessary large sector extends past 3*pi/2 overlapped smaller sector next . last resort, user can try setting explode zero. draws top outer sides sector. Also due sector drawing method, setting theta values smaller pi/8 larger pi/4 produce obviously misaligned sectors. Contributed fixes improvements: thanks Jesse Brown \"shade\" fix Qinghua Zhao alerting problem labels margins","code":""},{"path":"/reference/pie3D.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a 3D pie chart — pie3D","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/pie3D.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a 3D pie chart — pie3D","text":"","code":"pieval<-c(2,4,6,8) pielabels<- c(\"We hate\\n pies\",\"We oppose\\n pies\",\"We don't\\n care\",\"We just love pies\") # grab the radial positions of the labels lp<-pie3D(pieval,radius=0.9,labels=pielabels,explode=0.1,main=\"3D PIE OPINIONS\") # lengthen the last label and move it to the left pielabels[4]<-\"We cannot survive without our pies\" lp[4]<-4.8 # specify some new colors pie3D(pieval,radius=0.9,labels=pielabels,explode=0.1,main=\"3D PIE OPINIONS\", col=c(\"brown\",\"#ddaa00\",\"pink\",\"#dd00dd\"),labelpos=lp)"},{"path":"/reference/pie3D.labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Display labels on a 3D pie chart — pie3D.labels","title":"Display labels on a 3D pie chart — pie3D.labels","text":"Displays labels 3D pie chart.","code":""},{"path":"/reference/pie3D.labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display labels on a 3D pie chart — pie3D.labels","text":"","code":"pie3D.labels(radialpos,radius=1,height=0.1,theta=pi/6, labels,labelcol=par(\"fg\"),labelcex=1.5,labelrad=1.25,minsep=0.3)"},{"path":"/reference/pie3D.labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display labels on a 3D pie chart — pie3D.labels","text":"radialpos Position label radians radius radius pie user units height height pie user units theta angle viewing radians labels label display labelcol color labels labelcex character expansion factor labels labelrad expansion labels around pie. minsep minimum angular separation label positions.","code":""},{"path":"/reference/pie3D.labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display labels on a 3D pie chart — pie3D.labels","text":"nil","code":""},{"path":"/reference/pie3D.labels.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display labels on a 3D pie chart — pie3D.labels","text":"pie3D.label displays labels 3D pie chart. positions labels given angles radians (usually bisector pie sectors). labels can passed directly pie3D, function probably called user. pie3D.labels tries separate labels placed closer minsep radians. simple system handle minor crowding labels. labels crowded, capturing return value pie3D editing label positions may allow user avoid manually placing labels.","code":""},{"path":"/reference/pie3D.labels.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display labels on a 3D pie chart — pie3D.labels","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/pie3D.labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display labels on a 3D pie chart — pie3D.labels","text":"","code":"pieval<-c(2,4,6,8) bisectors<-pie3D(pieval,explode=0.1,main=\"3D PIE OPINIONS\") pielabels<- c(\"We hate\\n pies\",\"We oppose\\n pies\",\"We don't\\n care\",\"We just love pies\") pie3D.labels(bisectors,labels=pielabels)"},{"path":"/reference/placeLabels.html","id":null,"dir":"Reference","previous_headings":"","what":"Place labels in boxes — placeLabels","title":"Place labels in boxes — placeLabels","text":"Places labels boxes existing plot","code":""},{"path":"/reference/placeLabels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Place labels in boxes — placeLabels","text":"","code":"placeLabels(x,y=NA,labels,pointer=TRUE,cex=1,labelcol=par(\"fg\"), labelbg=\"white\",border=par(\"fg\"),pointercol=par(\"fg\"), pch=1,col=1,bg=\"white\",flagcol=\"red\")"},{"path":"/reference/placeLabels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Place labels in boxes — placeLabels","text":"x,y x y position centers labels. x can xy.coords list. labels Text strings pointer Whether draw line segment label points labeled. cex Character expansion. See text. labelcol color(s) text labels. labelbg background color(s) labels. border color(s) borders around rectangles. pointercol color(s) pointer lines. pch symbol(s) use redisplaying original points (see Details). col color(s) original points. bg background color(s) original points. flagcol color use \"flagging\" point.","code":""},{"path":"/reference/placeLabels.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Place labels in boxes — placeLabels","text":"placeLabels steps points indexed x y, allowing operator manually place labels point. point \"flagged\" displaying small colored circle (red default). label point placed, original symbol displayed next point flagged. point label can different colors backgrounds.","code":""},{"path":"/reference/placeLabels.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Place labels in boxes — placeLabels","text":"function handy one-plots moderate number points. can useful plots clumps points.","code":""},{"path":"/reference/placeLabels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Place labels in boxes — placeLabels","text":"nil - adds labels existing plot.","code":""},{"path":"/reference/placeLabels.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Place labels in boxes — placeLabels","text":"Jim Lemon - thanks Marna Wagley idea.","code":""},{"path":[]},{"path":"/reference/placeLabels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Place labels in boxes — placeLabels","text":"","code":"# won't check because of the call to locator if (FALSE) { # \\dontrun{ x<-rnorm(10) y<-rnorm(10) plot(x,y) placeLabels(x,y,LETTERS[1:10],flagcol=\"purple\") } # }"},{"path":"/reference/plotCI.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot confidence intervals/error bars — plotCI","title":"Plot confidence intervals/error bars — plotCI","text":"Given set x y values upper lower bounds, function plots points error bars.","code":""},{"path":"/reference/plotCI.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot confidence intervals/error bars — plotCI","text":"","code":"plotCI(x,y=NULL,uiw,liw=uiw,ui=NULL,li=NULL,err=\"y\", sfrac=0.01,gap=0,slty=par(\"lty\"),add=FALSE,scol=NULL,pt.bg=par(\"bg\"),...)"},{"path":"/reference/plotCI.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot confidence intervals/error bars — plotCI","text":"x x coordinates points plot y y coordinates points plot uiw width upper portion confidence region, (liw missing) width halves confidence region liw width lower portion confidence region ( missing, function assumes symmetric confidence bounds) ui absolute upper limit confidence region li absolute lower limit confidence region err direction error bars: \"x\" horizontal, \"y\" vertical (\"xy\" nice implemented yet; know quite everything specified. See examples composing plot simultaneous horizontal vertical error bars) gap Size gap error bars around points (default 0;gap=TRUE gives gap size 0.01) sfrac Scaling factor size \"serifs\" (end bars) confidence bars, x-axis units add FALSE (default), create new plot; TRUE, add error bars existing plot. slty Line type error bars scol Color error bars: col specified optional arguments, scol set ; otherwise set par(col) pt.bg Background color points (use pch=21, pt.bg=par(\"bg\") get open points superimposed error bars) ... parameters passed plot.default, points, arrows, etc. (e.g. lwd, col, pch, axes, xlim, ylim). xlim ylim set default include data points error bars. xlab ylab set names x y. pch==NA, points drawn (e.g. leaving room text labels instead)","code":""},{"path":"/reference/plotCI.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot confidence intervals/error bars — plotCI","text":"invisible(x,y); creates plot current device.","code":""},{"path":"/reference/plotCI.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot confidence intervals/error bars — plotCI","text":"Ben Bolker (documentation tweaking function provided Bill Venables, additional feature ideas Gregory Warnes)","code":""},{"path":[]},{"path":"/reference/plotCI.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot confidence intervals/error bars — plotCI","text":"","code":"y<-runif(10) err<-runif(10) plotCI(1:10,y,err,main=\"Basic plotCI\") plotCI(1:10,y,err,2*err,lwd=2,col=\"red\",scol=\"blue\", main=\"Add colors to the points and error bars\") err.x<-runif(10) err.y<-runif(10) plotCI(1:10,y,err.y,pt.bg=par(\"bg\"),pch=21,xlim=c(0,11), main=\"plotCI with extra space on the x axis\") plotCI(1:10,y,err.x,pt.bg=par(\"bg\"),pch=21,err=\"x\",add=TRUE) mtext(\"for adding horizontal error bars\",3,0.5) data(warpbreaks) attach(warpbreaks) wmeans<-by(breaks,tension,mean) wsd<-by(breaks,tension,sd) ## note that barplot() returns the midpoints of the bars, which plotCI ## uses as x-coordinates plotCI(barplot(wmeans,col=\"gray\",ylim=c(0,max(wmeans+wsd))),wmeans,wsd,add=TRUE) ## using labels instead of points labs<-sample(LETTERS,replace=TRUE,size=10) plotCI(1:10,y,err,pch=NA,gap=0.02,main=\"plotCI with labels at points\") text(1:10,y,labs)"},{"path":"/reference/plotH.html","id":null,"dir":"Reference","previous_headings":"","what":"Scatterplot with histogram-like bars. — plotH","title":"Scatterplot with histogram-like bars. — plotH","text":"Scatterplot histogram-like bars; modification plot(...,type=\"h\").","code":""},{"path":"/reference/plotH.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scatterplot with histogram-like bars. — plotH","text":"","code":"plotH(x,...) # S3 method for class 'formula' plotH(x,data=NULL,xlab=names(mf)[2],ylab=names(mf)[1],...) # Default S3 method plotH(x,y,xlab=paste(deparse(substitute(x))), ylab=paste(deparse(substitute(y))),width=0.6,ylim=NULL,col=\"gray\",...)"},{"path":"/reference/plotH.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scatterplot with histogram-like bars. — plotH","text":"x Vector x-coordinates formula form y~x (see y). y Vector y-coordinates. xlab string labeling x-axis. ylab string labeling y-axis. data data frame formula evaluated. width numeric indicates width bars. ylim vector length two indicates limits plot y-axis. See details. col string indicates fill color bars. ... Additional arguments sent plot barplot functions.","code":""},{"path":"/reference/plotH.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Scatterplot with histogram-like bars. — plotH","text":"plotH meant modification type=\"h\" version plot \"bars\" appears actual rectangles rather vertical lines. defaults lower bound y-axis 0; change ylim=NULL -ride default (return default used plot. pass-barplot used x (\"RHS\") variable categorical.","code":""},{"path":"/reference/plotH.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scatterplot with histogram-like bars. — plotH","text":"None, plot produced.","code":""},{"path":"/reference/plotH.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Scatterplot with histogram-like bars. — plotH","text":"function currently experimental.","code":""},{"path":"/reference/plotH.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Scatterplot with histogram-like bars. — plotH","text":"Derek Ogle","code":""},{"path":[]},{"path":"/reference/plotH.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Scatterplot with histogram-like bars. — plotH","text":"","code":"d<-data.frame(x=c(1,5,10:20),y=runif(13)+1, yn1=runif(13)-0.5,yn2=runif(13)-2, g=factor(sample(c(\"A\",\"B\",\"C\"),13,replace=TRUE))) # new plotH function with formula notation plotH(y~x,data=d) # old plot() function with formula notation -- for comparison's purpose plot(y~x,data=d,type=\"h\") # new function over-riding default ylim, increasing bar width, # and changing bar color plotH(y~x,data=d,ylim=range(d$y),width=0.9,col=\"red\") # handling some negative values plotH(yn1~x,data=d) # not so good, because of default ylim plotH(yn1~x,data=d,ylim=c(0,max(d$yn1))) # old look # handling all negative values plotH(yn2~x,data=d) plotH(yn2~x,data=d,ylim=range(d$yn2)) # old look # example of pass-through to barplot smry<-by(d$y,d$g,mean) plotH(levels(d$g),smry,ylab=\"Mean of Random Variable\",xlab=\"Group\") # example of non-formula usage x1 <- d$x y1 <- d$y plotH(x1,y1,col=\"blue\")"},{"path":"/reference/plot_bg.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a background color to a plot — plot_bg","title":"Add a background color to a plot — plot_bg","text":"Displays colored rectangle entire area plot","code":""},{"path":"/reference/plot_bg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a background color to a plot — plot_bg","text":"","code":"plot_bg(col=\"lightgray\")"},{"path":"/reference/plot_bg.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a background color to a plot — plot_bg","text":"col color background","code":""},{"path":"/reference/plot_bg.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a background color to a plot — plot_bg","text":"plot_bg probably useful part .first argument another plot function add background color plot.","code":""},{"path":"/reference/plot_bg.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a background color to a plot — plot_bg","text":"nil","code":""},{"path":"/reference/plot_bg.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add a background color to a plot — plot_bg","text":"Jim Lemon","code":""},{"path":"/reference/plot_bg.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a background color to a plot — plot_bg","text":"","code":"barp(1:5,do.first=\"plot_bg()\",col=1:5)"},{"path":"/reference/plotrix-package.html","id":null,"dir":"Reference","previous_headings":"","what":"Specialized plots and plotting accessories — plotrix-package","title":"Specialized plots and plotting accessories — plotrix-package","text":"large number specialized plots accessory functions like color scaling, text placement legends.","code":""},{"path":"/reference/plotrix-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Specialized plots and plotting accessories — plotrix-package","text":"plotrix package intended provide method getting many sorts specialized plots quickly, yet allow easy customization plots without learning great deal specialized syntax. three major aims can represented follows: Fast foods Think plotrix graphics vending machine fast graphics cafe. walk , make choice get lunch. may exactly lunch want, get pretty good lunch, fast. can get junk food health food, make choice. Hot rods can customize plotrix much want. Like ageing machinery usually bolted hot rods, base graphics package fairly easy understand. plotrix modular. can create frame plot, can add whatever bits like instead just taking default plot available. can wide wheels chromed exhaust pipes want. black boxes want go pushing fast food button hot rodding, hard. source code functions written understood. something goes wrong, can usually find happened right away work . means can learn functions rather just . write recursive functions R! plotrix encourages users learn works, usually begin pretty quickly. Users often decide write versions plotrix functions sometimes contribute results back plotrix. may find like graphics systems like grid lattice better. great, one idea behind plotrix get R can get things done quickly easily, stick soon want get things done way.","code":""},{"path":"/reference/plotrix-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Specialized plots and plotting accessories — plotrix-package","text":"Jim Lemon , many others Maintainer: Jim Lemon ","code":""},{"path":"/reference/polar.plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot values on a circular grid of 0 to 360 degrees — polar.plot","title":"Plot values on a circular grid of 0 to 360 degrees — polar.plot","text":"polar.plot displays plot radial lines, symbols polygon centered midpoint plot frame 0:360 circle. Positions interpreted beginning right moving counterclockwise unless start specifies another starting point clockwise TRUE. add=TRUE passed one additional arguments, values added current plot. radial.lim argument passed initial plot, must passed add values values displayed incorrectly.","code":""},{"path":"/reference/polar.plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot values on a circular grid of 0 to 360 degrees — polar.plot","text":"","code":"polar.plot(lengths,polar.pos=NULL,labels,label.pos=NULL, start=0,clockwise=FALSE,rp.type=\"r\",loglen=FALSE,explab=FALSE,...)"},{"path":"/reference/polar.plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot values on a circular grid of 0 to 360 degrees — polar.plot","text":"lengths numeric data vector. Magnitudes represented radial positions symbols, line ends polygon vertices. polar.pos numeric vector positions 0:360 degree circle. converted radians passed radial.plot. labels text labels place periphery circle. defaults labels every 20 degrees. labels, pass empty string. label.pos positions peripheral labels degrees start position zero degrees plot degrees. clockwise Whether increase angles clockwise rather default counterclockwise. rp.type Whether plot radial lines, symbols polygon. loglen Whether log transform length values. base 10 logs available. explab Whether use default fixed (FALSE) exponential (TRUE) notation radial labels. ... additional arguments passed radial.plot plot.","code":""},{"path":"/reference/polar.plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot values on a circular grid of 0 to 360 degrees — polar.plot","text":"list parameters altered radial.plot.","code":""},{"path":"/reference/polar.plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot values on a circular grid of 0 to 360 degrees — polar.plot","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/polar.plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot values on a circular grid of 0 to 360 degrees — polar.plot","text":"","code":"testlen<-c(rnorm(36)*2+5) testpos<-seq(0,350,by=10) polar.plot(testlen,testpos,main=\"Test Polar Plot\",lwd=3,line.col=4) oldpar<-polar.plot(testlen,testpos,main=\"Test Clockwise Polar Plot\", radial.lim=c(0,15),start=90,clockwise=TRUE,lwd=3,line.col=4) # reset everything par(oldpar)"},{"path":"/reference/polygon.shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a shadow effect for an arbitrary polygon — polygon.shadow","title":"Display a shadow effect for an arbitrary polygon — polygon.shadow","text":"Displays shadow effect existing plot","code":""},{"path":"/reference/polygon.shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a shadow effect for an arbitrary polygon — polygon.shadow","text":"","code":"polygon.shadow(x,y=NULL,offset=NA,inflate=NA,col=c(\"#ffffff\",\"#cccccc\"))"},{"path":"/reference/polygon.shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a shadow effect for an arbitrary polygon — polygon.shadow","text":"x,y x y coordinate vertices polygon. y can missing x list x y components. offset vector containing values x y offsets shadow. Defaults 1/20 maximum x y dimensions polygon. col colors shadow outer edge central part. inflate amount \"inflate\" shadow relative polygon (.e. penumbra). Defaults values offset.","code":""},{"path":"/reference/polygon.shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a shadow effect for an arbitrary polygon — polygon.shadow","text":"nil","code":""},{"path":"/reference/polygon.shadow.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a shadow effect for an arbitrary polygon — polygon.shadow","text":"polygon.shadow typically called just drawing polygon. displays shadow effect drawing polygon ten times, beginning first color col stepping second color create \"shadow\" (\"halo\" prefer). successive polygon shrunk 10% inflate. default shadow effect light upper left. effect may also used text background.","code":""},{"path":"/reference/polygon.shadow.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Display a shadow effect for an arbitrary polygon — polygon.shadow","text":"background must constant color shadow effect look right. good starting point two colors color background RGB components color multiplied 0.8. Use smaller multiplier darker shadow.","code":""},{"path":"/reference/polygon.shadow.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a shadow effect for an arbitrary polygon — polygon.shadow","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/polygon.shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a shadow effect for an arbitrary polygon — polygon.shadow","text":"","code":"par(pty=\"s\") plot(1:5,type=\"n\",main=\"Polygon Shadow test\",xlab=\"\",ylab=\"\",axes=FALSE) box() # do a shadow on a yellow square polygon(c(1,2.2,2.2,1),c(5,5,3.8,3.8),col=\"#ffff00\") polygon.shadow(c(1.2,2,2,1.2),c(4.8,4.8,4,4),col=c(\"#ffff00\",\"#cccc00\")) polygon(c(1.2,2,2,1.2),c(4.8,4.8,4,4),col=c(\"#ff0000\")) # a green triangle on a light blue square with a big offset polygon(c(4,5,5,4),c(2,2,1,1),col=\"#aaaaff\") polygon.shadow(c(4.5,4.8,4.2),c(1.7,1.2,1.2),col=c(\"#aaaaff\",\"#8888cc\"), offset=c(0.1,-0.1),inflate=c(0.2,0.2)) polygon(c(4.5,4.8,4.2),c(1.7,1.2,1.2),col=c(\"#00ff00\")) # now a circle as a background polygon.shadow(cos(seq(0,2*pi,by=pi/20))+3,sin(seq(0,2*pi,by=pi/20))+3, offset=c(0,0),inflate=c(0.1,0.1)) text(3,3,\"Polygon shadow\\nas a circular\\ntext background\",cex=1.5)"},{"path":"/reference/print.brklist.html","id":null,"dir":"Reference","previous_headings":"","what":"Display the output of brkdnNest — print.brklist","title":"Display the output of brkdnNest — print.brklist","text":"Displays list values produced brkdnNest.","code":""},{"path":"/reference/print.brklist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display the output of brkdnNest — print.brklist","text":"","code":"# S3 method for class 'brklist' print(x,...)"},{"path":"/reference/print.brklist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display the output of brkdnNest — print.brklist","text":"x list summary values produced \\link{brkdnNest} ... additional arguments passed print.","code":""},{"path":"/reference/print.brklist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display the output of brkdnNest — print.brklist","text":"print.brklist displays frequency tables produced brkdnNest. mainly convenience, make nicer display passed directly print","code":""},{"path":"/reference/print.brklist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display the output of brkdnNest — print.brklist","text":"nil","code":""},{"path":"/reference/print.brklist.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display the output of brkdnNest — print.brklist","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/print.brklist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display the output of brkdnNest — print.brklist","text":"","code":"printbrktest<-data.frame(A=c(sample(1:10,99,TRUE),NA), B=sample(c(\"Yes\",\"No\"),100,TRUE), C=sample(LETTERS[1:3],100,TRUE)) pbt<-brkdnNest(A~B+C,printbrktest) print(pbt) #> mean #> Overall 5.424242 #> \t No 5.3125 #> \t \t A 5.5 #> \t \t B 5 #> \t \t C 5.4 #> \t Yes 5.529412 #> \t \t A 5.125 #> \t \t B 5.666667 #> \t \t C 5.75 #> sd #> Overall 2.846734 #> \t No 2.88913 #> \t \t A 2.82162 #> \t \t B 2.908872 #> \t \t C 3.050453 #> \t Yes 2.830922 #> \t \t A 2.895399 #> \t \t B 2.716791 #> \t \t C 2.971354 #> sd #> Overall 2.846734 #> \t No 2.88913 #> \t \t A 2.82162 #> \t \t B 2.908872 #> \t \t C 3.050453 #> \t Yes 2.830922 #> \t \t A 2.895399 #> \t \t B 2.716791 #> \t \t C 2.971354 #> valid.n #> Overall 99 #> \t No 48 #> \t \t A 14 #> \t \t B 14 #> \t \t C 20 #> \t Yes 51 #> \t \t A 16 #> \t \t B 15 #> \t \t C 20"},{"path":"/reference/propbrk.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the proportion of specified values in a vector — propbrk","title":"Calculate the proportion of specified values in a vector — propbrk","text":"Calculates proportion values vector equal specified value.","code":""},{"path":"/reference/propbrk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the proportion of specified values in a vector — propbrk","text":"","code":"propbrk(x,trueval=TRUE,na.rm=TRUE)"},{"path":"/reference/propbrk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the proportion of specified values in a vector — propbrk","text":"x character, factor numeric vector. trueval value matched x. na.rm whether remove NA values.","code":""},{"path":"/reference/propbrk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate the proportion of specified values in a vector — propbrk","text":"propbrk calculates proportion values matching specified value. mainly allow proportions calculated brkdnNest function. always discards NAs x summing number equal trueval, respects na.rm argument calculating total number values x.","code":""},{"path":"/reference/propbrk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the proportion of specified values in a vector — propbrk","text":"nil","code":""},{"path":"/reference/propbrk.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate the proportion of specified values in a vector — propbrk","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/propbrk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate the proportion of specified values in a vector — propbrk","text":"","code":"propbrk(sample(LETTERS,100,TRUE),trueval=\"M\") #> [1] 0.05"},{"path":"/reference/psegments3d.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw segments on a 3D plot — psegments3d","title":"Draw segments on a 3D plot — psegments3d","text":"Draw segments 3D plot defined list coordinates","code":""},{"path":"/reference/psegments3d.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw segments on a 3D plot — psegments3d","text":"","code":"psegments3d(x,y=NULL,z=NULL,pmat,...)"},{"path":"/reference/psegments3d.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw segments on a 3D plot — psegments3d","text":"x,y,z x, y z coordinates plot. x may list three components. pmat matrix transform coordinates. ... arguments passed segments.","code":""},{"path":"/reference/psegments3d.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Draw segments on a 3D plot — psegments3d","text":"Draws segments perspective plot.","code":""},{"path":"/reference/psegments3d.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Draw segments on a 3D plot — psegments3d","text":"nil","code":""},{"path":"/reference/psegments3d.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Draw segments on a 3D plot — psegments3d","text":"Ben Bolker","code":""},{"path":"/reference/ptext3d.html","id":null,"dir":"Reference","previous_headings":"","what":"Display text on a 3D plot — ptext3d","title":"Display text on a 3D plot — ptext3d","text":"Display text 3D plot defined list coordinates","code":""},{"path":"/reference/ptext3d.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display text on a 3D plot — ptext3d","text":"","code":"ptext3d(x,y=NULL,z=NULL,texts,pmat,...)"},{"path":"/reference/ptext3d.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display text on a 3D plot — ptext3d","text":"x,y,z x, y z coordinates plot. x may list three components. pmat matrix transform coordinates. texts text display. ... arguments passed segments.","code":""},{"path":"/reference/ptext3d.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display text on a 3D plot — ptext3d","text":"Draws text perspective plot.","code":""},{"path":"/reference/ptext3d.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display text on a 3D plot — ptext3d","text":"nil","code":""},{"path":"/reference/ptext3d.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display text on a 3D plot — ptext3d","text":"Ben Bolker","code":""},{"path":"/reference/pyramid.plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Pyramid plot — pyramid.plot","title":"Pyramid plot — pyramid.plot","text":"Displays pyramid (opposed horizontal bar) plot current graphics device.","code":""},{"path":"/reference/pyramid.plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pyramid plot — pyramid.plot","text":"","code":"pyramid.plot(lx,rx,labels=NULL,top.labels=c(\"Male\",\"Age\",\"Female\"), main=\"\",laxlab=NULL,raxlab=NULL,unit=\"%\",lxcol,rxcol,gap=1,space=0.2, ppmar=c(4,2,4,2),labelcex=1,add=FALSE,xlim,show.values=FALSE,ndig=1, do.first=NULL)"},{"path":"/reference/pyramid.plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pyramid plot — pyramid.plot","text":"lx,rx Vectors matrix data frame (see Details) equal length. labels Labels categories represented pair bars. label lx rx value, even empty. labels matrix data frame, first two columns used left right category labels respectively. top.labels two categories represented left right sides plot heading labels center. main Optional title plot. laxlab Optional labels left x axis ticks. raxlab Optional labels right x axis ticks. unit label units plot. lxcol,rxcol Color(s) left right sets bars. default rainbow(length(labels)). gap One half space two sets bars labels user units. space Space bars. 0 <= space < 1. ppmar Margins plot (see Details). labelcex Expansion category labels. add Whether add bars existing plot. Usually involves overplotting second set bars, perhaps transparent. xlim Optional x limit plot (see Details). show.values Whether display lx rx ends bars. ndig number digits round values displayed. .first Optional expression evaluate displaying anything.","code":""},{"path":"/reference/pyramid.plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Pyramid plot — pyramid.plot","text":"pyramid.plot principally intended population pyramids, although can display types opposed bar charts suitable modification arguments. user wants different unit display, just change unit accordingly. default gap two units usually satisfactory four six percent range bars population pyramids. labels matrix data frame least two columns, first column displayed left side gap center, second right. almost always require increasing gap width perhaps also specifying wider plotting device. Displaying values usually require increasing left /right margins plot, setting xlim larger largest value. gap width zero passed, category labels displayed left right extents plot. usually requires setting xlim values larger maximum extent lx rx. user can pass two different values xlim, almost always bad idea, lengths bars proportion values left right sides. bars category labels vertically centered integer values, allowing user easily add components plot. lx rx values specifying left right extents left right bars respectively. matrices data frames, pyramid.plot produce opposed stacked bars first columns innermost. mode, colors limited one per column. stacked bar mode general work add method gap zero. Note stacked bar mode can get messy quickly. add argument allows one sets bars plotted existing plot. transparent, bar shorter bar overplots disappear. graphic devices (e.g. pdf) handle transparency. order add bars, function restore initial margin values new bars plot properly. automatically restore plot margins, call function example.","code":""},{"path":"/reference/pyramid.plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pyramid plot — pyramid.plot","text":"return value par(\"mar\") function called.","code":""},{"path":"/reference/pyramid.plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Pyramid plot — pyramid.plot","text":"Jim Lemon (thanks Susumu Tanimura patch omits ticks NA values vector input Igor Rebeiro space argument)","code":""},{"path":[]},{"path":"/reference/pyramid.plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pyramid plot — pyramid.plot","text":"","code":"xy.pop<-c(3.2,3.5,3.6,3.6,3.5,3.5,3.9,3.7,3.9,3.5,3.2,2.8,2.2,1.8, 1.5,1.3,0.7,0.4) xx.pop<-c(3.2,3.4,3.5,3.5,3.5,3.7,4,3.8,3.9,3.6,3.2,2.5,2,1.7,1.5, 1.3,1,0.8) agelabels<-c(\"0-4\",\"5-9\",\"10-14\",\"15-19\",\"20-24\",\"25-29\",\"30-34\", \"35-39\",\"40-44\",\"45-49\",\"50-54\",\"55-59\",\"60-64\",\"65-69\",\"70-74\", \"75-79\",\"80-44\",\"85+\") mcol<-color.gradient(c(0,0,0.5,1),c(0,0,0.5,1),c(1,1,0.5,1),18) fcol<-color.gradient(c(1,1,0.5,1),c(0.5,0.5,0.5,1),c(0.5,0.5,0.5,1),18) par(mar=pyramid.plot(xy.pop,xx.pop,labels=agelabels, main=\"Australian population pyramid 2002\",lxcol=mcol,rxcol=fcol, gap=0.5,show.values=TRUE)) #> 4 4 # three column matrices avtemp<-c(seq(11,2,by=-1),rep(2:6,each=2),seq(11,2,by=-1)) malecook<-matrix(avtemp+sample(-2:2,30,TRUE),ncol=3) femalecook<-matrix(avtemp+sample(-2:2,30,TRUE),ncol=3) # group by age agegrps<-c(\"0-10\",\"11-20\",\"21-30\",\"31-40\",\"41-50\",\"51-60\", \"61-70\",\"71-80\",\"81-90\",\"91+\") oldmar<-pyramid.plot(malecook,femalecook,labels=agegrps, unit=\"Bowls per month\",lxcol=c(\"#ff0000\",\"#eeee88\",\"#0000ff\"), rxcol=c(\"#ff0000\",\"#eeee88\",\"#0000ff\"),laxlab=c(0,10,20,30), raxlab=c(0,10,20,30),top.labels=c(\"Males\",\"Age\",\"Females\"),gap=4, do.first=\"plot_bg(\\\"#eedd55\\\")\") #> 30 30 # put a box around it box() # give it a title mtext(\"Porridge temperature by age and sex of bear\",3,2,cex=1.5) # stick in a legend legend(par(\"usr\")[1],11,c(\"Too hot\",\"Just right\",\"Too cold\"), fill=c(\"#ff0000\",\"#eeee88\",\"#0000ff\")) # don't forget to restore the margins and background par(mar=oldmar,bg=\"transparent\")"},{"path":"/reference/radial.grid.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a radial grid — radial.grid","title":"Display a radial grid — radial.grid","text":"radial.grid displays radial grid radial.plot radial.pie functions.","code":""},{"path":"/reference/radial.grid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a radial grid — radial.grid","text":"","code":"radial.grid(labels=NA,label.pos=NULL,radlab=FALSE,radial.lim=NULL, start=0,clockwise=FALSE,label.prop=1.1,grid.pos=seq(0.25,1,0.25), rad.col=\"gray\",grid.col=\"gray\",grid.bg=\"transparent\",show.radial.grid=TRUE, start.plot=FALSE)"},{"path":"/reference/radial.grid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a radial grid — radial.grid","text":"labels labels display around circumference grid. label.pos Radial positions labels. radlab Whether rotate labels radial orientation. radial.lim Optional radial limits circular plot. specified, must radial limits original plot. start zero position plot units label.pos. clockwise Whether increase angles clockwise rather default counterclockwise. label.prop Proportion radial.lim place labels. grid.pos Radial positions circular grid lines. rad.col Color radial grid lines. grid.col Color circumferential grid lines. grid.bg Background color radial grid. show.radial.grid Whether display radial lines grid. start.plot TRUE, sets blank radial grid.","code":""},{"path":"/reference/radial.grid.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a radial grid — radial.grid","text":"nil","code":""},{"path":"/reference/radial.grid.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a radial grid — radial.grid","text":"Jim Lemon","code":""},{"path":"/reference/radial.pie.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot sectors/annuli on a circular grid of 0 to 2*pi radians — radial.pie","title":"Plot sectors/annuli on a circular grid of 0 to 2*pi radians — radial.pie","text":"Plot numeric values sectors optional annuli circular field directions defined angles radians.","code":""},{"path":"/reference/radial.pie.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot sectors/annuli on a circular grid of 0 to 2*pi radians — radial.pie","text":"","code":"radial.pie(radial.extents,sector.edges=NULL, sector.colors=NULL,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1), alpha=1,labels=NA,label.pos=NULL,radlab=FALSE,start=0, clockwise=FALSE,label.prop=1.1,radial.lim=NULL,main=\"\",xlab=\"\",ylab=\"\", mar=c(2,2,3,2),show.grid=TRUE,show.grid.labels=4,show.radial.grid=TRUE, grid.col=\"gray\",grid.bg=\"transparent\",grid.unit=NULL, radial.labels=NULL,boxed.radial=TRUE,add=FALSE,...)"},{"path":"/reference/radial.pie.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot sectors/annuli on a circular grid of 0 to 2*pi radians — radial.pie","text":"radial.extents numeric data vector list. radial.extents list, elements list considered separate data vectors. sector.edges numeric vector positions radians. interpreted beginning right (0 radians) moving counterclockwise unless clockwise TRUE. sector.colors Optional colors sectors annuli. Defaults rainbow(nsectors) fading outward annuli specified. cs1, cs2, cs3, alpha Color scaling arguments - see color.scale. labels Character strings placed outer ends lines. set NA, suppress printing labels, missing, radial positions used. label.pos positions labels around plot radians. radlab Whether rotate outer labels radial orientation. start place starting (zero) point. Defaults 3 o'clock position. clockwise Whether interpret positive positions clockwise starting point. default counterclockwise. label.prop label position radius proportion maximum line length. radial.lim inner outer radial limits plot. Defaults range radial.extents, although zero max(radial.extents) often wanted. main title plot. xlab,ylab Normally x y axis labels suppressed. mar Margins plot. Allows user leave space legends, long labels, etc. show.grid Logical - whether draw circular grid. show.grid.labels Whether display labels grid - see Details. show.radial.grid Whether draw radial lines plot labels. grid.col Color circular grid. grid.bg Fill color . grid.unit Optional unit description grid. radial.labels Optional labels radial grid. default values radial.lim. boxed.radial Whether use boxed.labels text radial labels. add Whether add one series existing plot. ... Additional arguments passed plot.","code":""},{"path":"/reference/radial.pie.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot sectors/annuli on a circular grid of 0 to 2*pi radians — radial.pie","text":"par values changed function time radial.pie called.","code":""},{"path":"/reference/radial.pie.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot sectors/annuli on a circular grid of 0 to 2*pi radians — radial.pie","text":"radial.pie displays plot radial sectors optional annular sections centered midpoint plot frame, lengths corresponding numeric magnitudes radial.extents. series added existing plot, radial.pie try maintain current plot parameters. However, seems unlikely adding series sensible radial.pie. argument may dropped proves useless. size labels outside plot can adjusted setting par(cex.axis=) labels inside setting par(cex.lab=). radlab TRUE, labels rotated radial alignment. may help many values labels. labels still crowded, try running label.pos spreadout function. show.grid.labels argument number 1 4, labels placed along horizontal vertical radius. numbers represent positions axis, default (4) right. suppress labels, pass zero FALSE. radial.pie works somewhat differently radial.plot family still development. released order get feedback improve design programming. successful, hope merge code radial.plot function.","code":""},{"path":"/reference/radial.pie.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot sectors/annuli on a circular grid of 0 to 2*pi radians — radial.pie","text":"Jim Lemon - thanks Patrick Jemison asking .","code":""},{"path":[]},{"path":"/reference/radial.pie.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot sectors/annuli on a circular grid of 0 to 2*pi radians — radial.pie","text":"","code":"pie1<-c(3,6,5,4,7,8,9,1,4) pie2<-list(0:3,1:6,2:5,1:4,0:7,4:8,2:9,0:1,0:4) pie3<-sample(10:60,36) pie4<-list(sort(sample(1:60,8))) for(sector in 2:36) pie4[[sector]]<-sort(sample(1:60,8)) oldpar<-radial.pie(pie1,labels=LETTERS[1:9]) radial.pie(pie2,labels=letters[2:10]) radial.pie(pie3,labels=1:36) radial.pie(pie4,labels=1:36) # restore the par values par(oldpar)"},{"path":"/reference/radial.plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot values on a circular grid of 0 to 2*pi radians — radial.plot","title":"Plot values on a circular grid of 0 to 2*pi radians — radial.plot","text":"Plot numeric values distances center circular field directions defined angles radians.","code":""},{"path":"/reference/radial.plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot values on a circular grid of 0 to 2*pi radians — radial.plot","text":"","code":"radial.plot(lengths,radial.pos=NULL,labels=NA,label.pos=NULL,radlab=FALSE, start=0,clockwise=FALSE,rp.type=\"r\",label.prop=1.1,main=\"\",xlab=\"\",ylab=\"\", line.col=par(\"fg\"),lty=par(\"lty\"),lwd=par(\"lwd\"),mar=c(2,2,3,2), show.grid=TRUE,show.grid.labels=4,show.radial.grid=TRUE,rad.col=\"gray\", grid.col=\"gray\",grid.bg=\"transparent\",grid.left=FALSE,grid.unit=NULL, point.symbols=1,point.col=par(\"fg\"),show.centroid=FALSE,radial.lim=NULL, radial.labels=NULL,boxed.radial=TRUE,poly.col=NA,add=FALSE, loglen=FALSE,explab=FALSE,...)"},{"path":"/reference/radial.plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot values on a circular grid of 0 to 2*pi radians — radial.plot","text":"lengths numeric data vector matrix. lengths matrix, rows considered separate data vectors. radial.pos numeric vector matrix positions radians. interpreted beginning right (0 radians) moving counterclockwise. radial.pos matrix, rows must correspond rows lengths. labels Character strings placed outer ends lines. set NULL, suppress printing labels, missing, radial positions used. label.pos positions labels around plot radians. radlab Whether rotate outer labels radial orientation. start place starting (zero) point. Defaults 3 o'clock position. clockwise Whether interpret positive positions clockwise starting point. default counterclockwise. rp.type Whether draw (r)adial lines, (p)olygon, (s)ymbols, (t)ext, combination . lengths matrix rp.type vector, row lengths can displayed differently. label.prop label position radius proportion maximum line length. main title plot. xlab,ylab Normally x y axis labels suppressed. line.col color radial lines polygons drawn. lty line type(s) used polygons radial lines. lwd line width(s) used polygons radial lines. mar Margins plot. Allows user leave space legends, long labels, etc. show.grid Logical - whether draw circular grid. show.grid.labels Whether display labels grid - see Details. show.radial.grid Whether draw radial lines plot labels. rad.col Color radial lines grid. grid.col Color circumferential lines grid. grid.bg Fill color . grid.left Whether place radial grid labels left side. grid.unit Optional unit description grid. point.symbols symbols plotting (pch) rp.type \"t\", text displayed. point.col Colors symbols. show.centroid Whether display centroid. radial.lim range grid circle. Defaults pretty(range(lengths)), two values passed, exact values displayed. radial.labels Optional labels radial grid. default values radial.lim, loglen TRUE, corresponding log values. boxed.radial Whether use boxed.labels text radial labels. poly.col Fill color polygons drawn. Use NA fill. add Whether add one series existing plot. loglen Whether log transform length values. base 10 logs available. Keep mind values actually plotted logarithms, although exponentiated logs displayed. explab Whether use default fixed (FALSE) exponential (TRUE) notation radial labels. ... Additional arguments passed plot.","code":""},{"path":"/reference/radial.plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot values on a circular grid of 0 to 2*pi radians — radial.plot","text":"par values changed function time radial.plot called.","code":""},{"path":"/reference/radial.plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot values on a circular grid of 0 to 2*pi radians — radial.plot","text":"radial.plot displays plot radial lines, polygon(s), symbols, text combination centered midpoint plot frame, lengths, vertices positions corresponding numeric magnitudes data values. Note log transformation requested loglen, values plotted logs, values displayed plot. show.centroid TRUE, enlarged point centroid values displayed. centroid calculated average x y values unless rp.type=\"p\". case, barycenter polygon calculated. Make sure suit purpose, otherwise calculate centroid really want add points function. Note observations taken equal intervals around circle, centroid may mean much. text option rp.type allows user place text point. useful adding labels arbitrary points existing plot perhaps labelling points letters digits rather different symbols. See last example. user wants plot several sets lines, points symbols passing matrices data frames lengths radial.pos, remember grouped row, transpose data grouped columns. series added existing plot, radial.plot try maintain current plot parameters. Resetting parameters initial plot almost certainly mess series added. Series added plotted \"top\" existing plot, possibly overplotting things. added series larger range initial series, set radial.lim account initial plot, radial.lim specified initial plot, remember repeat added series example. size labels outside plot can adjusted setting par(cex.axis=) labels inside setting par(cex.lab=). radlab TRUE, labels rotated radial alignment. may help many values labels. labels still crowded, try running label.pos spreadout function. show.grid.labels argument number 1 4, labels placed along horizontal vertical radius. numbers represent positions axis, default (4) right. radial.plot family plots useful illustrating cyclic data wind direction speed (see oz.windrose ), activity different times day, . radial.plot actually plotting, another function usually called specific types cyclic data.","code":""},{"path":"/reference/radial.plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot values on a circular grid of 0 to 2*pi radians — radial.plot","text":"Jim Lemon","code":""},{"path":"/reference/radial.plot.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Plot values on a circular grid of 0 to 2*pi radians — radial.plot","text":"Thanks Jeremy Claisse Antonio Hernandez Matias lty rp.type suggestions respectively Patrick Baker request led radlab Thomas Steiner request radial.lim radial.labels modifications Evan Daugharty requesting add argument James MacCarthy requesting better radial labels Steve Ellison noticing return values functions changed Don Dennerline requesting rank clock Mehdi Nellen different colors radial circumferential lines grid Mayeul Kauffmann noticing radial label bug separate radial.grid included Ogbos Okike requesting text option rp.type Keziah Conroy requesting log option","code":""},{"path":[]},{"path":"/reference/radial.plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot values on a circular grid of 0 to 2*pi radians — radial.plot","text":"","code":"testlen<-runif(10,0,10) testpos<-seq(0,18*pi/10,length=10) testlab<-letters[1:10] oldpar<-radial.plot(testlen,testpos,main=\"Test Radial Lines\",line.col=\"red\", lwd=3,rad.col=\"lightblue\") testlen<-c(sin(seq(0,1.98*pi,length=100))+2+rnorm(100)/10) testpos<-seq(0,1.98*pi,length=100) radial.plot(testlen,testpos,rp.type=\"p\",main=\"Test Polygon\",line.col=\"blue\", labels=LETTERS[1:8],label.pos=seq(0,14*pi/8,length.out=8)) # now do a 12 o'clock start with clockwise positive radial.plot(testlen,testpos,start=pi/2,clockwise=TRUE,show.grid.labels=2, rp.type=\"s\",main=\"Test Symbols (clockwise)\",radial.lim=c(0,3.5), point.symbols=16,point.col=\"green\",show.centroid=TRUE, labels=LETTERS[1:6],label.pos=seq(0,10*pi/6,length.out=6)) # one without the circular grid and multiple polygons # see the \"diamondplot\" function for variation on this posmat<-matrix(sample(2:9,30,TRUE),nrow=3) radial.plot(posmat,labels=paste(\"X\",1:10,sep=\"\"),rp.type=\"p\", main=\"Spiderweb plot\",line.col=2:4,show.grid=FALSE,lwd=1:3, radial.lim=c(0,10)) # dissolved ions in water ions<-c(3.2,5,1,3.1,2.1,4.5) ion.names<-c(\"Na\",\"Ca\",\"Mg\",\"Cl\",\"HCO3\",\"SO4\") radial.plot(ions,labels=ion.names,rp.type=\"p\",main=\"Dissolved ions in water\", grid.unit=\"meq/l\",radial.lim=c(0,5),poly.col=\"yellow\",show.grid.labels=3) # add the names of the ions to the plot radial.plot(ions,rp.type=\"t\",point.symbols=ion.names,radial.lim=c(0,5), add=TRUE) # add points inside the polygon - radial.lim is supplied by plotrix_env radial.plot(ions-0.4,rp.type=\"s\",point.symbols=4,point.col=\"red\",add=TRUE) radmat<-matrix(c(sample(1:4,4),sample(1:4,4),sample(1:4,4),sample(1:4,4), sample(1:4,4),sample(1:4,4),sample(1:4,4),sample(1:4,4), sample(1:4,4),sample(1:4,4)),nrow=4) # finally a rank clock radial.plot(radmat,rp.type=\"l\",radial.pos=seq(0,20*pi/11.1,length.out=10), label.pos=seq(0,20*pi/11.1,length.out=10),start=pi/2,clockwise=TRUE, labels=2001:2010,radial.lim=c(0.2,4),main=\"Rank clock\") legend(-1.7,4,c(\"Black\",\"Red\",\"Green\",\"Blue\"),col=1:4,lty=1) par(xpd=oldpar$xpd,mar=oldpar$mar,pty=oldpar$pty) # reset the margins par(mar=c(5,4,4,2))"},{"path":"/reference/radial.plot.labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Display labels on a circular grid — radial.plot.labels","title":"Display labels on a circular grid — radial.plot.labels","text":"radial.plot.labels displays labels circular plot produced one radial.plot family functions.","code":""},{"path":"/reference/radial.plot.labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display labels on a circular grid — radial.plot.labels","text":"","code":"radial.plot.labels(lengths,radial.pos=NULL,units=\"radians\",radial.lim=NULL, start=0,clockwise=FALSE,labels,adj=NULL,pos=NULL,boxed.labels=FALSE,...)"},{"path":"/reference/radial.plot.labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display labels on a circular grid — radial.plot.labels","text":"lengths numeric data vector. Magnitudes represented radial positions symbols, line ends polygon vertices. radial.pos numeric vector radial positions. converted radians units argument \"radians\". units units radial.pos may degrees 24 hour clock positions. units \"polar\" \"clock24\" respectively, values radial.pos converted radians. radial.lim Optional radial limits circular plot. must radial limits original plot. start zero position plot units radial.pos. clockwise Whether increase angles clockwise rather default counterclockwise. labels text labels display plot. adj Text justification text function. pos Text position text function. boxed.labels Whether use boxed.labels text. ... additional arguments passed boxed.labels text.","code":""},{"path":"/reference/radial.plot.labels.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display labels on a circular grid — radial.plot.labels","text":"confuse function radial.labels argument radial.plot function. labels values rather grid.","code":""},{"path":"/reference/radial.plot.labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display labels on a circular grid — radial.plot.labels","text":"nil","code":""},{"path":"/reference/radial.plot.labels.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display labels on a circular grid — radial.plot.labels","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/radial.plot.labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display labels on a circular grid — radial.plot.labels","text":"","code":"testlen<-c(rnorm(10)*2+5) # do the labels in clock24 units testpos<-c(6.74,8.3,10.55,12.33,13.75,15.9,17.15,19.36,21.02,23.27) oldpar<-clock24.plot(testlen,testpos,main=\"Test radial.plot.labels\", rp.type=\"s\",point.symbols=3,point.col=\"green\") radial.plot.labels(testlen,testpos,units=\"clock24\",labels=LETTERS[1:10], pos=3,col=\"red\") testangle<-c(25,42,67,94,128,173,191,234,268,307) # now a polar plot polar.plot(testlen,testangle,main=\"Test radial.plot.labels\",rp.type=\"p\", poly.col=\"green\") radial.plot.labels(testlen,testangle,units=\"polar\",labels=LETTERS[1:10]) # reset par par(oldpar)"},{"path":"/reference/radialtext.html","id":null,"dir":"Reference","previous_headings":"","what":"Display text in a radial line — radialtext","title":"Display text in a radial line — radialtext","text":"Displays string radial line, rotating flow radial direction optionally scaling letter's size according distance center.","code":""},{"path":"/reference/radialtext.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display text in a radial line — radialtext","text":"","code":"radialtext(x, center=c(0,0), start=NA, middle=1, end=NA, angle=0, deg=NA, expand=0, stretch=1, nice=TRUE, cex=NA, ...)"},{"path":"/reference/radialtext.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display text in a radial line — radialtext","text":"x character string. center center circular area x/y user units. start starting distance string center x/y user units. middle middle distance string center x/y user units. end ending distance string center x/y user units. angle angular position string radians. deg angular position string degrees (takes precedence NA). expand Size expansion factor characters, used start specified. stretch much stretch string appearance, 1 none. nice TRUE auto-flip text keep upright, FALSE let upside . cex overall character expansion factor, NA par(\"cex\"). ... Additional arguments passed text.","code":""},{"path":"/reference/radialtext.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display text in a radial line — radialtext","text":"nil","code":""},{"path":"/reference/radialtext.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display text in a radial line — radialtext","text":"may work devices, graphic devices can rotate text arbitrary angles. output looks best Postscript similar device can rotate text without distortion. Rotated text often looks ragged small bitmaps. user passes value start, override value middle end. Likewise, value end override value middle. Also, value deg overrides value passed angle. expand 0, characters size, value 1 scale characters one twice far center twice large. Negative values permitted , expand used start specified.","code":""},{"path":"/reference/radialtext.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display text in a radial line — radialtext","text":"Ted Toal","code":""},{"path":[]},{"path":"/reference/radialtext.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display text in a radial line — radialtext","text":"","code":"plot(0, xlim=c(1,5), ylim=c(1,5), main=\"Test of radialtext\", xlab=\"\", ylab=\"\", type=\"n\") points(3, 3, pch=20) radialtext(\"uncooked spaghetti\", center=c(3,3), col=\"blue\") radialtext(\"uncooked spaghetti\", center=c(3,3), start=1.2, angle=pi/4, cex=0.8) radialtext(\"uncooked spaghetti\", center=c(3,3), middle=1.2, angle=pi/4+0.1, cex=0.8) radialtext(\"uncooked spaghetti\", center=c(3,3), end=1.2, angle=pi/4+0.2, cex=0.8) radialtext(\"uncooked spaghetti\", center=c(3,3), start=0.5, deg=135, cex=0.8, col=\"green\") radialtext(\"uncooked spaghetti\", center=c(3,3), start=0.5, deg=145, cex=0.8, stretch=2) radialtext(\"uncooked spaghetti\", center=c(3,3), start=0.5, deg=20, expand=0, col=\"red\") radialtext(\"uncooked spaghetti\", center=c(3,3), start=0.5, deg=250, expand=0.35) radialtext(\"uncooked spaghetti\", center=c(3,3), start=0.75, deg=225, expand=1, col=\"gold\") radialtext(\"uncooked spaghetti\", center=c(3,3), start=0.5, deg=325, expand=-0.25, cex=2)"},{"path":"/reference/raw.means.plot.html","id":null,"dir":"Reference","previous_headings":"","what":"raw.means.plot: Raw-Means Plots for Experimental Designs — raw.means.plot","title":"raw.means.plot: Raw-Means Plots for Experimental Designs — raw.means.plot","text":"raw.means.plot function visualizing results experimental designs two factors. plots raw data (background) factor/cell means (foreground) provide accurate visualization underlying distribution.","code":""},{"path":"/reference/raw.means.plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"raw.means.plot: Raw-Means Plots for Experimental Designs — raw.means.plot","text":"","code":"raw.means.plot(data, col.offset = 2, col.x = 3, col.value = 4, na.rm = FALSE, avoid.overlap = c(\"y\", \"x\", \"both\"), y.factor = 1, y.amount = NULL, x.amount = 0.05, pch = 21:25, lty = 1:5, bg.b.col = \"darkgrey\", bg.f.col = NULL, fg.b.col = \"black\",fg.f.col = \"black\", type = \"o\", pt.cex = 1, lwd = 1, xlab = \"\", ylab = \"\", ylim, max.offset = 0.2, xaxis = TRUE, x.labels, xaxt = \"n\", plot = TRUE, legend = TRUE, mar = NULL, reset.mar = TRUE, l.pos, yjust = 0.5, l.bty = \"n\", l.adj = c(0, 0.5), ...) raw.means.plot2(data, col.id, col.offset, col.x, col.value, fun.aggregate = \"mean\", ...)"},{"path":"/reference/raw.means.plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"raw.means.plot: Raw-Means Plots for Experimental Designs — raw.means.plot","text":"data data.frame long format (.e., datapoint one row, see \\link{reshape} reshape package) contains least three columns: one column coding first factor (col.offset), one column coding second factor (col.x), one column containing values (col.value). col.id character scalar, specifiying name column specifying id column. (raw.means.plot2) col.offset character numeric (raw.means.plot) scalar, specifiying either name number column coding different lines (offset first factor). col.x character numeric (raw.means.plot) scalar, specifiying either name number column coding x-axis factor. Default 3. col.value character numeric (raw.means.plot) scalar, specifiying either name number data column. Default 4. na.rm logical indicating whether NA values stripped computation proceeds. Default FALSE. Throws error message FALSE NAs encountered. avoid.overlap character. happen datapoints within one cell two factors value. \"y\" (default) jitter added overlapping points distinguishable y-axis \"x\" jitter added overlapping points distinguishable x-axis \"\" jitter added overlapping points distinguishable y- x-axis. anything else. jitter added. y.factor factor controlling amount jitter y-axis (passed jitter). y.amount amount controlling amount jitter y-axis (passed jitter). x.amount amount controlling amount jitter x-axis (passed jitter). pch pch values (plot symbols) taken plotting data. Note values taken raw data means. see points details. Recycled short (warning). Default 21:25, values can displayed filled non-filled. values used. lty lty values (line types) connecting means. See par details. Recycled short (warning). Default 1:5. bg.b.col background border color: border color raw data points. Silently recycled. Default: \"darkgrey\" bg.f.col background filling color: fill color raw data points. Silently recycled. Default: NULL fg.b.col foreground border color: border color mean data points. Silently recycled. Default: black fg.f.col foreground fill color: fill color mean data points. Silently recycled. Default: black type type plot. Default: o (\"overplotted\") pt.cex numeric specifying cex value used plotting points. Default 1. lwd numeric specifying lwd value used plotting lines. Default 1. xlab x-axis label. Default: \"\" ylab y-axis label. Default: \"\" ylim y-axis limits plot. specified (default) taken data raw data points visible warning message displayed specifying ylim. max.offset numeric. maximal offset factor levels offset factor (col.offset) specifying different lines. centre factor x-axis full numbers (starting 1 ...). maximum reached number factor levels (col.offset) even. Default: 0.2. xaxis logical value indicating whether x-axis generated raw.means.plot. TRUE, labels x-axis taken either unique values col.x can specified x.labels. x.labels character vector specifiying col.x levels. relevant xaxis=TRUE. , values given displayed x-axis factor level col.x. xaxt character specifies whether ot x-axis plotted call plot function. Interfers aforementioned xaxis argument automatic xaxis function raw.means.plot. Just completeness. Default \"n\" (changed). plot logical. raw.means.plot drawn . TRUE (default) plot drawn. FALSE legend drawn (legend = TRUE) See details. legend logical indicating whether raw.means.plot automatically add legend right outside plot area indicating line points refer col.offset factor levels. Default TRUE. mar NULL numerical vector length 4 indicating margins plot (see par). NULL (default) right margin (.e., par(\"mar\")[4]) (imperfectly) guessed col.offset factors placing legend right plot. length four value taken. Ignored plot = FALSE. reset.mar logical indicating margins (mar) shall resetted setting internally. ignored legend = FALSE. Default TRUE changed (especially plot = FLASE). l.pos numeric vector length 2 indicating position legend. specified automatically determined. See details. yjust legend justified relative legend y location. value 0 means top, 0.5 means centered 1 means bottom justified. Default 0.5. l.bty type box drawn around legend. allowed values \"o\" \"n\" (default). l.adj numeric length 1 2; string adjustment legend text. Useful y-adjustment labels plotmath expression. see legend plotmath info. ... arguments either passed plot legend ( raw.means.plot raw.means.plot2). following arguments passed legend, others passed plot: \"fill\", \"border\", \"angle\", \"density\", \"box.lwd\", \"box.lty\", \"box.col\", \"pt.cex\", \"pt.lwd\", \"xjust\", \"x.intersp\", \"y.intersp\", \"text.width\", \"text.col\", \"merge\", \"trace\", \"plot\", \"ncol\", \"horiz\", \"title\", \"inset\", \"title.col\", \"title.adj\" fun.aggregate Function function name used aggregating data across two factors. Default \"mean\". (raw.means.plot2)","code":""},{"path":"/reference/raw.means.plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"raw.means.plot: Raw-Means Plots for Experimental Designs — raw.means.plot","text":"raw.means.plot2 probably useful function, allows using data.frame two-factors aggregates across factors, needs column specifying experimental unit (e.g., participant). raw.means.plot basically advanced wrapper two functions: plot (legend=TRUE) legend. Furthermore, raw data plotted call points means call lines. can use raw.means.plot plot legend setting plot = FALSE legend = TRUE. , raw.means.plot draw invisible plot xlim = c(0,10) ylim = c(0, 10) place legend invisible plot. can specify l.pos position legend, otherwise plotted c(5,5) (.e., middle plot). Note xpd = TRUE call legend (see par).","code":""},{"path":"/reference/raw.means.plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"raw.means.plot: Raw-Means Plots for Experimental Designs — raw.means.plot","text":"Nothing. function invoked side effects.","code":""},{"path":"/reference/raw.means.plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"raw.means.plot: Raw-Means Plots for Experimental Designs — raw.means.plot","text":"Henrik Singmann (henrik.singmann@psychologie.uni-freiburg.de) ideas Jim Lemon","code":""},{"path":[]},{"path":"/reference/raw.means.plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"raw.means.plot: Raw-Means Plots for Experimental Designs — raw.means.plot","text":"","code":"x <- data.frame(id = 1:150, offset = rep(c(\"Group A\", \"Group B\", \"Group C\"), each = 50), xaxis = sample(c(\"A\", \"B\", \"C\", \"D\"),150, replace = TRUE), data = c(rnorm(50, 10, 5), rnorm(50, 15,6), rnorm(50, 20, 5))) raw.means.plot(x) #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749 raw.means.plot(x, main = \"Example\", ylab = \"Values\", xlab = \"Factor\", title = \"Groups\") #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749 raw.means.plot(x, \"offset\", \"xaxis\", \"data\") #> Warning: Converting offset variable (column offset) to factor. #> Warning: Converting x-axis variable (column offset) to factor. #> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749 raw.means.plot(x, \"xaxis\", \"offset\", \"data\") #> Warning: Converting offset variable (column xaxis) to factor. #> Warning: Converting x-axis variable (column xaxis) to factor. #> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749 raw.means.plot(x, 3, 2, 4) #> Warning: Converting offset variable (column 3) to factor. #> Warning: Converting x-axis variable (column 3) to factor. #> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749 # different colors: raw.means.plot(x, main = \"Example\", ylab = \"Values\", xlab = \"Factor\", title = \"Groups\", fg.f.col = c(\"red\",\"blue\", \"green\")) #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749 x2 <- data.frame(id = 1:150, offset = rep(c(\"Group A\", \"Group B\", \"Group C\"), each = 50), xaxis = sample(c(\"A\", \"B\", \"C\", \"D\"),150, replace = TRUE), data = c(rnorm(50, 10, 5), rnorm(50, 15,6), rnorm(50, 20, 5))) layout(matrix(c(1,2,3,3), 2,2,byrow = TRUE), heights = c(7,1)) raw.means.plot(x, main = \"Data x1\", ylab = \"Values\", xlab = \"Factor\", legend = FALSE, mar = c(4,4,4,1)+0.1) #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: -2.24425496039227 - 32.2603172238749 raw.means.plot(x2, main = \"Data x2\", ylab = \"Values\", xlab = \"Factor\", legend = FALSE, mar = c(4,4,4,1)+0.1) #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: -4.6524102769029 - 31.9198591156234 raw.means.plot(x2, plot = FALSE, title = \"Groups\") #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: -4.6524102769029 - 31.9198591156234 y <- data.frame(id = 1:300, offset = rep(1, 300), axis = sample(LETTERS[1:6],300, replace = TRUE), data = c(rnorm(100, 1), rnorm(100), rnorm(100,1))) par(mfrow = c(2,2)) raw.means.plot(y, legend = FALSE) #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: -2.19848686444599 - 3.99587856614991 raw.means.plot(y, type = \"p\", legend = FALSE) #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: -2.19848686444599 - 3.99587856614991 raw.means.plot(y, type = \"l\", legend = FALSE) #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: -2.19848686444599 - 3.99587856614991 raw.means.plot(y, 3, 2, x.labels = \"one group only\") #> Warning: Converting offset variable (column 3) to factor. #> Warning: Converting x-axis variable (column 3) to factor. #> Warning: ylim not specified, taken from data: -2.19848686444599 - 3.99587856614991 #> Warning: pch vector too short. recycling pch vector. #> Warning: lty vector too short. recycling lty vector. # Example with overlapping points z <- data.frame (id = 1:200, offset = rep(c(\"C 1\", \"C 2\"), 200), axis = sample(LETTERS[1:4], 200, replace = TRUE), data = sample(1:20, 200, replace = TRUE)) # x versus y jitter par(mfrow = c(2,2)) raw.means.plot(z, avoid.overlap = \"none\", main = \"no-jitter\") #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: 1 - 20 raw.means.plot(z, main = \"y-axis jitter (default)\") #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: 1 - 20 raw.means.plot(z, avoid.overlap = \"x\", main = \"x-axis jitter\") #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: 1 - 20 raw.means.plot(z, avoid.overlap = \"both\", main = \"both-axis jitter\") #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: 1 - 20 # y-axis jitter (default) par(mfrow = c(2,2)) raw.means.plot(z, avoid.overlap = \"none\", main = \"no jitter\") #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: 1 - 20 raw.means.plot(z, y.factor = 0.5, main = \"smaller y-jitter\") #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: 1 - 20 raw.means.plot(z, main = \"standard y-jitter\") #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: 1 - 20 raw.means.plot(z, y.factor = 2, main = \"bigger y-jitter\") #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: 1 - 20 # x-axis jitter (default) par(mfrow = c(2,2)) raw.means.plot(z, avoid.overlap = \"none\", main = \"no jitter\") #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: 1 - 20 raw.means.plot(z, avoid.overlap = \"x\", x.amount = 0.025, main = \"smaller x -jitter\") #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: 1 - 20 raw.means.plot(z, avoid.overlap = \"x\", main = \"standard x-jitter\") #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: 1 - 20 raw.means.plot(z, avoid.overlap = \"x\", x.amount= 0.1, main = \"bigger x-jitter\") #> Warning: Converting offset variable (column 2) to factor. #> Warning: Converting x-axis variable (column 2) to factor. #> Warning: ylim not specified, taken from data: 1 - 20 if (FALSE) { # \\dontrun{ #The examples uses the OBrienKaiser dataset from car and needs reshape. require(reshape) require(car) data(OBrienKaiser) OBKnew <- cbind(factor(1:nrow(OBrienKaiser)), OBrienKaiser) colnames(OBKnew)[1] <- \"id\" OBK.long <- melt(OBKnew) OBK.long[, c(\"measurement\", \"time\")] <- t(vapply(strsplit(as.character(OBK.long$variable), \"\\\\.\"), \"[\", c(\"\", \"\"))) raw.means.plot2(OBK.long, \"id\", \"measurement\", \"gender\", \"value\") raw.means.plot2(OBK.long, \"id\", \"treatment\", \"gender\", \"value\") # also use add.ps: # For this example the position at each x-axis are within-subject comparisons! raw.means.plot2(OBK.long, \"id\", \"measurement\", \"gender\", \"value\") add.ps(OBK.long, \"id\", \"measurement\", \"gender\", \"value\", paired = TRUE) #reference is \"fup\" raw.means.plot2(OBK.long, \"id\", \"measurement\", \"gender\", \"value\") add.ps(OBK.long, \"id\", \"measurement\", \"gender\", \"value\", ref.offset = 2, paired = TRUE) #reference is \"post\" # Use R's standard (i.e., Welch test) raw.means.plot2(OBK.long, \"id\", \"treatment\", \"gender\", \"value\") add.ps(OBK.long, \"id\", \"treatment\", \"gender\", \"value\", prefixes = c(\"p(control vs. A)\", \"p(control vs. B)\")) # Use standard t-test raw.means.plot2(OBK.long, \"id\", \"treatment\", \"gender\", \"value\") add.ps(OBK.long, \"id\", \"treatment\", \"gender\", \"value\", var.equal = TRUE, prefixes = c(\"p(control vs. A)\", \"p(control vs. B)\")) } # }"},{"path":"/reference/rectFill.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw a rectangle filled with symbols — rectFill","title":"Draw a rectangle filled with symbols — rectFill","text":"Draws rectangle current figure filled arbitrary symbols.","code":""},{"path":"/reference/rectFill.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw a rectangle filled with symbols — rectFill","text":"","code":"rectFill(x1,y1,x2,y2,fg=par(\"fg\"),bg=par(\"bg\"),xinc=NA,yinc=NA, pch=1,pch.cex=1,pch.col=par(\"fg\"),...)"},{"path":"/reference/rectFill.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw a rectangle filled with symbols — rectFill","text":"x1,y1,x2,y2 Rectangle limits rect. fg Foreground color bg Background color xinc,yinc x y increments spacing symbols. pch symbol use pch.cex Character expansion symbols. pch.col Color(s) symbols. ... Additional arguments points symbols.","code":""},{"path":"/reference/rectFill.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Draw a rectangle filled with symbols — rectFill","text":"rectFill draws rectangle fills rectangle symbols requested. probably useful substitute fill colors black white environment.","code":""},{"path":"/reference/rectFill.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Draw a rectangle filled with symbols — rectFill","text":"nil","code":""},{"path":"/reference/rectFill.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Draw a rectangle filled with symbols — rectFill","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/rectFill.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Draw a rectangle filled with symbols — rectFill","text":"","code":"plot(1:7,type=\"n\",xlab=\"\",ylab=\"\",main=\"Test of rectFill\") rectFill(1:6,1:6,2:7,2:7,bg=2:7,pch=c(\"+\",\"*\",\"o\",\".\",\"#\",\"^\"), xinc=c(0.2,0.1,0.2,0.1,0.2,0.2),yinc=c(0.2,0.1,0.2,0.1,0.2,0.2), pch.col=1:6) barp(matrix(runif(9),nrow=3),main=\"Black and white bar plot\",pch=1:3)"},{"path":"/reference/rescale.html","id":null,"dir":"Reference","previous_headings":"","what":"Scale numbers into a new range — rescale","title":"Scale numbers into a new range — rescale","text":"Scale vector matrix numbers new range.","code":""},{"path":"/reference/rescale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scale numbers into a new range — rescale","text":"","code":"rescale(x,newrange)"},{"path":"/reference/rescale.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scale numbers into a new range — rescale","text":"x numeric vector, matrix data frame. newrange minimum maximum value range x scaled.","code":""},{"path":"/reference/rescale.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Scale numbers into a new range — rescale","text":"rescale performs simple linear conversion x range specified newrange. numeric vectors, matrices data frames variation accepted. NAs now preserved - formerly function fail.","code":""},{"path":"/reference/rescale.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scale numbers into a new range — rescale","text":"success, rescaled object, otherwise original object.","code":""},{"path":"/reference/rescale.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Scale numbers into a new range — rescale","text":"Jim Lemon","code":""},{"path":"/reference/rescale.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Scale numbers into a new range — rescale","text":"","code":"# scale one vector into the range of another normal.counts<-rnorm(100) normal.tab<-tabulate(cut(normal.counts,breaks=seq(-3,3,by=1))) normal.density<-rescale(dnorm(seq(-3,3,length=100)),range(normal.tab)) # now plot them plot(c(-2.5,-1.5,-0.5,0.5,1.5,2.5),normal.tab,xlab=\"X values\", type=\"h\",col=\"green\") lines(seq(-3,3,length=100),normal.density,col=\"blue\")"},{"path":"/reference/revaxis.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot with axis direction(s) reversed — revaxis","title":"Plot with axis direction(s) reversed — revaxis","text":"Reverses sense either x y axes.","code":""},{"path":"/reference/revaxis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot with axis direction(s) reversed — revaxis","text":"","code":"revaxis(x, y, xrev=FALSE, yrev=TRUE, xside=if (yrev) 3 else 1, yside=if (xrev) 4 else 2, xlab=NULL, ylab=NULL, bty=NULL, ...)"},{"path":"/reference/revaxis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot with axis direction(s) reversed — revaxis","text":"x Vector x-coordinates data plotted. y Vector y-coordinates data plotted. xrev Logical scalar; sense x-axis reversed? yrev Logical scalar; sense y-axis reversed? xside side plot x-axis labels go. yside side plot y-axis labels go. xlab Character string labelling x-axis. ylab Character string labelling y-axis. bty Single letter indicating type box drawn around plot. See par possible letters meaning. ... arguments passed plot.","code":""},{"path":"/reference/revaxis.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot with axis direction(s) reversed — revaxis","text":"nil","code":""},{"path":"/reference/revaxis.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot with axis direction(s) reversed — revaxis","text":"Rolf Turner","code":""},{"path":[]},{"path":"/reference/revaxis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot with axis direction(s) reversed — revaxis","text":"","code":"x <- runif(20) y <- runif(20) revaxis(x,y,yside=4)"},{"path":"/reference/ruginv.html","id":null,"dir":"Reference","previous_headings":"","what":"Add an Inverse Rug to a Plot — ruginv","title":"Add an Inverse Rug to a Plot — ruginv","text":"Adds rug representation (1D plot) data plot, coloring inverted.","code":""},{"path":"/reference/ruginv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add an Inverse Rug to a Plot — ruginv","text":"","code":"ruginv(x,ticksize=0.03,side=1,lwd=0.5,col=par(\"fg\"),col.ticks=\"white\", quiet=getOption(\"warn\") < 0,...)"},{"path":"/reference/ruginv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add an Inverse Rug to a Plot — ruginv","text":"x numeric vector. ticksize length ticks making 'rug'. Positive lengths produce inward ticks. side side plot box rug appear. Usually 1 (bottom) 3 (top). lwd line width ticks. col Color background ticks. col.ticks color ticks. quiet Logical indicating warning clipped values. ... arguments passed polygon plotting background ticks.","code":""},{"path":"/reference/ruginv.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add an Inverse Rug to a Plot — ruginv","text":"Peter Solymos","code":""},{"path":[]},{"path":"/reference/ruginv.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add an Inverse Rug to a Plot — ruginv","text":"","code":"require(stats) plot(density(faithful$eruptions,bw=0.15)) ruginv(faithful$eruptions,ticksize=-0.05) ruginv(jitter(faithful$eruptions,amount=0.01),side=3,col=\"lightblue\")"},{"path":"/reference/seats.html","id":null,"dir":"Reference","previous_headings":"","what":"Arrange N seats in M semicircular rows — seats","title":"Arrange N seats in M semicircular rows — seats","text":"Compute seat positions semicircular parliament","code":""},{"path":"/reference/seats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arrange N seats in M semicircular rows — seats","text":"","code":"seats(N, M, r0 = 2.5)"},{"path":"/reference/seats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Arrange N seats in M semicircular rows — seats","text":"N Total number seats. M Number semicircular arcs distribute seats. r0 Radius inner arc user units.","code":""},{"path":"/reference/seats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Arrange N seats in M semicircular rows — seats","text":"data frame including: x x positions seats plotted semi-circular arcs. y y positions seats plotted semi-circular arcs. r row numbers seat. theta angle seat, going pi zero radians.","code":""},{"path":"/reference/seats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Arrange N seats in M semicircular rows — seats","text":"Duncan Murdoch Barry Rowlingson","code":""},{"path":[]},{"path":"/reference/size_n_color.html","id":null,"dir":"Reference","previous_headings":"","what":"Display circles with specified size and color — size_n_color","title":"Display circles with specified size and color — size_n_color","text":"Display plot circles specified locations, specified size color.","code":""},{"path":"/reference/size_n_color.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display circles with specified size and color — size_n_color","text":"","code":"size_n_color(x=NULL,y,size,sizefun=\"sqrt\",col,main=\"\", xlim=NA,xlab=\"\",xat=NULL,xaxlab=NULL,xcex=1,xlas=0,xgrid=FALSE, ylim=NA,ylab=\"\",yat=NULL,yaxlab=NULL,ycex=1,ylas=1,ygrid=TRUE, mar=c(5,4,4,2),boxit=TRUE,add=FALSE,...)"},{"path":"/reference/size_n_color.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display circles with specified size and color — size_n_color","text":"x,y Vectors matrices x y positions symbols. size Sizes symbols expressed numbers. sizefun function use transforming values radii circles. Square root gives areas proportional values. col Colors symbols (see Details). main Title plot. xlim,ylim Explicit x y limits plot . xlab,ylab Labels x y axes. xat,yat place ticks tick labels axes. xaxlab,yaxlab Tick labels x y axes. xcex,ycex Character expansions axis tick labels. xlas,ylas Orientation axis tick labels (see par). xgrid,ygrid Whether display grid along x y direction. mar Margins plot (see Details). boxit Whether draw box around plot. add Whether draw new plot (FALSE) add symbols existing plot (TRUE). ... Additional arguments passed plot.","code":""},{"path":"/reference/size_n_color.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display circles with specified size and color — size_n_color","text":"size_n_color plots circles centered x y coordinates. size color circles may also specified individually, allowing four dimensions variation displayed plot. size_n_color may also used display \"visual table\" second example. x y coordinates used associate symbols two categorical variables, underlying cause death year observation. x values passed function, try space circles evenly representation matrix. matrix square, use plotting device proportion height width matrix.","code":""},{"path":"/reference/size_n_color.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display circles with specified size and color — size_n_color","text":"nil","code":""},{"path":"/reference/size_n_color.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display circles with specified size and color — size_n_color","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/size_n_color.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display circles with specified size and color — size_n_color","text":"","code":"meantemp<-c(19,22,25,29,21,20,16,27,23,26) totalrain<-c(174,152,196,120,177,183,92,153,161,85) numpumpkin<-c(53,47,61,63,38,42,48,71,66,29) meanwt<-c(1.5,2.3,2.8,1.9,2.4,1.8,2.6,2.2,1.7) size_n_color(meantemp,totalrain,meanwt/5,NA,xlim=c(15,30), color.scale(numpumpkin,c(0.8,0),c(0.8,1),0), xlab=\"Temperature (degrees C)\",ylab=\"Rainfall (mm)\", main=\"Number and weight of pumpkins by temperature and rainfall\", xat=seq(15,30,by=5),yat=seq(80,200,by=20)) color.legend(15,55,18.5,60,seq(40,70,by=10), rect.col=color.scale(seq(40,70,by=10),c(0.8,0),c(0.8,1),0)) points(15:18,rep(126,4),cex=seq(1.5,3.0,by=0.5)) text(15:19,rep(134,5),c(\"1.5\",\"2.0\",\"2.5\",\"3.0\",\"kg\")) par(xpd=TRUE) text(13.5,60,\"Number of\\npumpkins\") par(xpd=FALSE) # now display a \"visual table\" of delayed registrations by underlying cause of # death and year of observation. The sizes of the circles represent the log of # the number of deaths and the colors represent the percentage of deaths that # occurred in the year prior to registration or earlier data(death_reg) size_n_color(x=matrix(rep(1996:2010,each=22),nrow=22), y=matrix(rep(1:22,15),nrow=22),size=t(death_reg[[1]])/200, col=color.scale(t(death_reg[[2]]),c(0,0.8,1),c(1,0.2,0),0), ylim=c(1,22),main=\"Delayed registrations by ICD chapter\", xlab=\"Year\",xaxlab=1996:2010,xat=1996:2010,xcex=0.8, yaxlab=colnames(death_reg[[1]]),ycex=0.8,ygrid=TRUE,mar=c(5,6,4,2)) color.legend(1994,-3.5,2000,-2.5,seq(0,50,by=10),cex=0.8, rect.col=color.scale(seq(0,50,by=10),c(0,0.8,1),c(1,0.2,0),0)) par(xpd=TRUE) text(1993.4,-2.5,\"Pct.\\nslow\",cex=0.8) par(xpd=FALSE)"},{"path":"/reference/sizeplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot with repeated symbols by size — sizeplot","title":"Plot with repeated symbols by size — sizeplot","text":"Plots set (x,y) data repeated points denoted larger symbol sizes","code":""},{"path":"/reference/sizeplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot with repeated symbols by size — sizeplot","text":"","code":"sizeplot(x, y, scale=1, pow=0.5, powscale=TRUE, size=c(1,4), add=FALSE, ...)"},{"path":"/reference/sizeplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot with repeated symbols by size — sizeplot","text":"x x coordinates data y y coordinates data scale scaling factor size symbols pow power exponent size symbols powscale (logical) use power scaling symbol size? size (numeric vector) min max size scaling, powscale=FALSE add (logical) add existing plot? ... arguments plot() points()","code":""},{"path":"/reference/sizeplot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot with repeated symbols by size — sizeplot","text":"useful plotting (e.g.) discrete data, repeats likely. points repeated equally, gives warning. size point given \\(scale*n^pow\\), n number repeats, powscale TRUE, scaled size[1] size[2], powscale FALSE.","code":""},{"path":"/reference/sizeplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot with repeated symbols by size — sizeplot","text":"plot produced current device, points added current plot add=TRUE.","code":""},{"path":"/reference/sizeplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot with repeated symbols by size — sizeplot","text":"Ben Bolker","code":""},{"path":[]},{"path":"/reference/sizeplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot with repeated symbols by size — sizeplot","text":"","code":"x <- c(0.1,0.1,0.1,0.1,0.1,0.2,0.2,0.2,0.2,0.3,0.3) y <- c( 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5 ) plot(x,y) sizeplot(x,y) sizeplot(x,y,pch=2)"},{"path":"/reference/sizetree.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a hierarchical breakdown of disjunct categories — sizetree","title":"Display a hierarchical breakdown of disjunct categories — sizetree","text":"Display data frame values successive column represent subcategories previous column stacked rectangles.","code":""},{"path":"/reference/sizetree.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a hierarchical breakdown of disjunct categories — sizetree","text":"","code":"sizetree(x,left=0,top,right=1,lastcenter=NA,showval=TRUE,showcount=TRUE, stacklabels=TRUE,firstcall=TRUE,col=NULL,border=NA,toplab=NULL,base.cex=1, ...)"},{"path":"/reference/sizetree.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a hierarchical breakdown of disjunct categories — sizetree","text":"x data frame successive column represents subcategories previous column. left left edge current stack rectangles user units. top top current stack rectangles user units. right right edge current stack rectangles user units. lastcenter center previous rectangle next breakdown categories arises. almost reason change . showval Whether display values representing categories. showcount Whether display count categories. stacklabels Whether display names dataframe beneath stacked rectangles. firstcall flag function - alter . col Optional fill colors rectangles. See Details border Color border around rectangles. See details toplab Optional labels display top stack. base.cex base character expansion labels. ... additional arguments passed plot.","code":""},{"path":"/reference/sizetree.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a hierarchical breakdown of disjunct categories — sizetree","text":"nil","code":""},{"path":"/reference/sizetree.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a hierarchical breakdown of disjunct categories — sizetree","text":"sizetree displays disjunct hierarchical categories stacked rectangles. accepts data frame values first column represent categories, values second column represent subcategories first column, . first column displayed stack rectangles, height proportional count category. substack rectangles second stack represent breakdown counts superordinate category columns. Empty categories ignored NAs produce gaps, propagate across subsequent stacks. user can simply pass data frame, contain columns hierarchical categories (example 1). colors probably ideal. user can pass colors levels (example 2). done, sizetree try match colors categories number categories diminishing (e.g. levels missing sub-categories) columns x factors levels order. work category labels level, remember add names colors passing function. work categories lower levels. col list, done, user work correct colors level. particularly important category labels number categories different different levels (example 3). sizetrees, subcategory counts low compared overall number data objects. results rectangles thin vertically. One way get better legibility labels use dark colors rectangles, labels white, borders (set border NA). user can also select part data frame x expand sections sizetree last example. labels sized fit vertical extent bars. However, possible labels may extend horizontally beyond bar(s). base.cex argument can used shrink labels happens. Remember base.cex shrink labels, just ones wide. firstcall argument necessary function initialize plot, breakdown involves recursive call. changed, best can expected uninformative plot.","code":""},{"path":"/reference/sizetree.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a hierarchical breakdown of disjunct categories — sizetree","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/sizetree.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a hierarchical breakdown of disjunct categories — sizetree","text":"","code":"cat1<-factor(sample(c(\"None\",\"Low\",\"Medium\",\"High\",\"Extreme\"),40,TRUE), levels=c(\"None\",\"Low\",\"Medium\",\"High\",\"Extreme\")) cat2<-factor(sample(c(\"None\",\"Low\",\"Medium\",\"High\"),40,TRUE), levels=c(\"None\",\"Low\",\"Medium\",\"High\")) cat3<-factor(sample(c(\"None\",\"Low\",\"High\"),40,TRUE), levels=c(\"None\",\"Low\",\"High\")) hcats<-data.frame(cat1,cat2,cat3) # throw in a few NAs hcats$cat1[10]<-NA hcats$cat2[c(15,20)]<-NA hcats$cat3[c(11,14,25)]<-NA # first let sizetree work out the colors sizetree(hcats,main=\"Sizetree with automatic colors\") #> 1 NA values dropped from first stack. # now see what happens with a list of the same colors for each level bhcol<-c(\"#ff8080\",\"#dddd80\",\"#80ff80\",\"#0000ff\",\"#80dddd\") sizetree(hcats,col=list(bhcol,bhcol,bhcol), main=\"Sizetree with the same colors each level\") #> 1 NA values dropped from first stack. # finally, specify different colors for categories with different labels sexhaireye<-data.frame(sex=factor(sample(c(\"Male\",\"Female\"),50,TRUE)), hair=factor(sample(c(\"Blond\",\"Red\",\"Brown\",\"Black\"),50,TRUE)), eye=factor(sample(c(\"Gold\",\"Green\",\"Blue\"),50,TRUE))) shecol<-list(c(\"pink\",\"lightblue\"),c(\"#000000\",\"#dddd00\",\"#886600\",\"#ee8800\"), c(\"blue\",\"gold\",\"green\")) sizetree(sexhaireye,main=\"Sex, hair and eye color\", col=shecol,toplab=c(\"Sex\",\"Hair color\",\"Eye color\")) # now expand the female part of the sizetree sizetree(sexhaireye[sexhaireye[,1]==\"Female\",], main=\"Sex, hair and eye color (Females only)\", col=shecol,toplab=c(\"Sex\",\"Hair color\",\"Eye color\"))"},{"path":"/reference/sliceArray.html","id":null,"dir":"Reference","previous_headings":"","what":"Slice an array — sliceArray","title":"Slice an array — sliceArray","text":"Slices one dimension array taking one element first dimension.","code":""},{"path":"/reference/sliceArray.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Slice an array — sliceArray","text":"","code":"sliceArray(x,slice)"},{"path":"/reference/sliceArray.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Slice an array — sliceArray","text":"x array slice index slice take first dimension array.","code":""},{"path":"/reference/sliceArray.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Slice an array — sliceArray","text":"sliceArray builds extractor string containing value slice first element many commas needed match dimensions array. applies extractor function x returns result. Note array \"slice\" swaps dimensions example.","code":""},{"path":"/reference/sliceArray.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Slice an array — sliceArray","text":"desired slice array.","code":""},{"path":"/reference/sliceArray.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Slice an array — sliceArray","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/sliceArray.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Slice an array — sliceArray","text":"","code":"a1<-array(1:27,dim=c(3,3,3)) a1 #> , , 1 #> #> [,1] [,2] [,3] #> [1,] 1 4 7 #> [2,] 2 5 8 #> [3,] 3 6 9 #> #> , , 2 #> #> [,1] [,2] [,3] #> [1,] 10 13 16 #> [2,] 11 14 17 #> [3,] 12 15 18 #> #> , , 3 #> #> [,1] [,2] [,3] #> [1,] 19 22 25 #> [2,] 20 23 26 #> [3,] 21 24 27 #> sliceArray(a1,2) #> [,1] [,2] [,3] #> [1,] 2 11 20 #> [2,] 5 14 23 #> [3,] 8 17 26"},{"path":"/reference/smoothColors.html","id":null,"dir":"Reference","previous_headings":"","what":"Build a vector of color values — smoothColors","title":"Build a vector of color values — smoothColors","text":"smoothColors calculates sequence colors. two color names arguments separated number, number interpolated colors inserted two color endpoints. number color names integers may passed, last argument must color name. one integer appears two color names, first used interpolation others ignored.","code":""},{"path":"/reference/smoothColors.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Build a vector of color values — smoothColors","text":"","code":"smoothColors(...,alpha=NA)"},{"path":"/reference/smoothColors.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Build a vector of color values — smoothColors","text":"... arbitrary sequence color names integers beginning ending color name. alpha optional alpha (transparency) value.","code":""},{"path":"/reference/smoothColors.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Build a vector of color values — smoothColors","text":"vector hexadecimal color values used col.","code":""},{"path":"/reference/smoothColors.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Build a vector of color values — smoothColors","text":"R functions transform numeric values colors produce colors can used represent values, see colourschemes package.","code":""},{"path":"/reference/smoothColors.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Build a vector of color values — smoothColors","text":"Barry Rowlingson","code":""},{"path":[]},{"path":"/reference/smoothColors.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Build a vector of color values — smoothColors","text":"","code":"plot(1:10,main=\"Test opaque colors\",type=\"n\",axes=FALSE) box() rect(1:7,1:7,3:9,3:9,col=smoothColors(\"red\",2,\"green\",2,\"blue\"))"},{"path":"/reference/soil.texture.html","id":null,"dir":"Reference","previous_headings":"","what":"Soil texture triangle plot — soil.texture","title":"Soil texture triangle plot — soil.texture","text":"Display USDA soil texture triangle optional grid, labels soil texture points.","code":""},{"path":"/reference/soil.texture.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Soil texture triangle plot — soil.texture","text":"","code":"soil.texture(soiltexture=NULL, main=\"\", at=seq(0.1, 0.9, by=0.1), axis.labels=c(\"percent sand\", \"percent silt\", \"percent clay\"), tick.labels=list(l=seq(10, 90, by=10), r=seq(10, 90, by=10), b=seq(10, 90, by=10)), show.names=TRUE, show.lines=TRUE, col.names=\"gray\", bg.names=par(\"bg\"), show.grid=FALSE, col.axis=\"black\", col.lines=\"gray\", col.grid=\"gray\", lty.grid=3, show.legend=FALSE, label.points=FALSE, point.labels=NULL, col.symbols=\"black\", pch=par(\"pch\"), ...)"},{"path":"/reference/soil.texture.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Soil texture triangle plot — soil.texture","text":"soiltexture Matrix soil textures row soil sample three columns contain proportions components sand, silt clay range 0 1 percentages range 0 100. main title soil texture plot. Defaults nothing. Positions three axes ticks drawn. axis.labels Labels axes. tick.labels tick labels three axes. show.names Logical - whether show names different soil types within soil triangle. show.lines Logical - whether show boundaries different soil types within soil triangle. col.names Color soil names. Defaults gray. bg.names Color use drawing blank patch names soil types. show.grid Logical - whether show grid lines 10 level soil component. col.axis Color triangular axes, ticks labels. col.lines Color boundary lines. Defaults gray. col.grid Color grid lines. Defaults gray. lty.grid Type line grid. Defaults dashed. show.legend Logical - whether display legend. label.points Logical - whether call thigmophobe.labels label points. point.labels Optional labels points legend. col.symbols Color symbols representing value. pch Symbols use plotting values. ... Additional arguments passed triax.points points.","code":""},{"path":"/reference/soil.texture.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Soil texture triangle plot — soil.texture","text":"soil.texture displays triangular plot area soil textures defined proportions sand, silt clay can plotted. Optional grid, vertex labels, soil type divisions names may also displayed. matrix soil textures present, plotted.","code":""},{"path":"/reference/soil.texture.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Soil texture triangle plot — soil.texture","text":"soiltexture included, list x,y positions soil types plotted. , nil.","code":""},{"path":"/reference/soil.texture.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Soil texture triangle plot — soil.texture","text":"now special case triax.plot.","code":""},{"path":"/reference/soil.texture.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Soil texture triangle plot — soil.texture","text":"Sander Oom, Jim Lemon, Michael Toews","code":""},{"path":"/reference/soil.texture.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Soil texture triangle plot — soil.texture","text":"U.S. Department Agriculture, Natural Resources Conservation Service, 2007. National Soil Survey Handbook, title 430-VI.// formerly https://www.nrcs.usda.gov/wps/portal/nrcs/detail/soils/survey/class/taxonomy/?cid=nrcs142p2_053577 U.S. Department Agriculture, Natural Resources Conservation Service, 2007. Soil Texture Calculator// formerly https://www.nrcs.usda.gov/wps/portal/nrcs/detail/soils/survey/class/taxonomy/?cid=nrcs142p2_053577","code":""},{"path":[]},{"path":"/reference/soil.texture.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Soil texture triangle plot — soil.texture","text":"","code":"data(soils) soil.texture(main=\"NO DATA\") #> NULL soil.texture(soils, main=\"DEFAULT\", pch=2) soil.texture(soils, main=\"LINES AND NAMES\", show.lines=TRUE, show.names=TRUE, pch=3) soiltex.return<-soil.texture(soils[1:6,], main=\"GRID AND LEGEND\", show.grid=TRUE, pch=4, col.symbols=1:6, show.legend=TRUE) par(soiltex.return$oldpar) #> named list()"},{"path":"/reference/soil.texture.uk.html","id":null,"dir":"Reference","previous_headings":"","what":"Soil texture triangle plot using UK conventions — soil.texture.uk","title":"Soil texture triangle plot using UK conventions — soil.texture.uk","text":"Display UK style soil texture triangle optional grid, labels soil texture points.","code":""},{"path":"/reference/soil.texture.uk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Soil texture triangle plot using UK conventions — soil.texture.uk","text":"","code":"soil.texture.uk(soiltexture = NULL, main = \"\",at = seq(0.1, 0.9, by = 0.1), axis.labels = c(\"percent sand\", \"percent silt\", \"percent clay\"), tick.labels = list(l = seq(10, 90, by = 10), r = seq(10, 90, by = 10), b = seq(10, 90, by = 10)), show.names = TRUE, show.lines = TRUE, col.names = \"gray\", bg.names = par(\"bg\"), show.grid = FALSE, col.axis = \"black\", col.lines = \"gray\", col.grid = \"gray\", lty.grid = 3, show.legend = FALSE, label.points = FALSE, point.labels = NULL, col.symbols = \"black\", pch = par(\"pch\"), h1 = NA, h3 = NA, t1 = NA, t3 = NA, lwduk = 2, xpos = NA, ypos = NA, snames = NA, cexuk = 1.1, ...)"},{"path":"/reference/soil.texture.uk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Soil texture triangle plot using UK conventions — soil.texture.uk","text":"soiltexture Matrix soil textures row soil sample three columns containing percentages components sand, silt clay range 0 100. main title soil texture plot. Defaults nothing. Positions three axes ticks drawn. axis.labels Labels axes. tick.labels tick labels three axes. show.names Logical - whether show names different soil types within soil triangle. show.lines Logical - whether show boundaries different soil types within soil triangle. col.names Color soil names. Defaults gray. bg.names Color use drawing blank patch names soil types. show.grid Logical - whether show grid lines 10 level soil component. col.axis Color triangular axes, ticks labels. col.lines Color boundary lines. Defaults gray. col.grid Color grid lines. Defaults gray. lty.grid Type line grid. Defaults dashed. show.legend Logical - whether display legend. label.points Logical - whether call thigmophobe.labels label points. point.labels Optional labels points legend. col.symbols Color symbols representing value. pch Symbols use plotting values. h1,h3,t1,t3 Points used drawing boundaries soil types. lwduk Line width boundaries xpos,ypos Positions soil type labels. snames Soil type labels. cexuk Character expansion soil type labels. ... Additional arguments passed triax.points points.","code":""},{"path":"/reference/soil.texture.uk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Soil texture triangle plot using UK conventions — soil.texture.uk","text":"soil.texture.uk displays triangular plot area soil textures defined proportions sand, silt clay can plotted. similar soil.texture function uses UK display conventions.","code":""},{"path":"/reference/soil.texture.uk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Soil texture triangle plot using UK conventions — soil.texture.uk","text":"soiltexture included, list x,y positions soil types plotted. , nil.","code":""},{"path":"/reference/soil.texture.uk.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Soil texture triangle plot using UK conventions — soil.texture.uk","text":"Julian Stander","code":""},{"path":[]},{"path":"/reference/soil.texture.uk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Soil texture triangle plot using UK conventions — soil.texture.uk","text":"","code":"soils.sw.percent<-data.frame( Sand=c(67,67,66,67,36,25,24,59,27,9,8,8,20, 45,50,56,34,29,39,41,94,98,97,93,96,99), Silt=c(17,16,9,8,39,48,54,27,46,70,68,68,66, 34,30,24,48,53,46,48,2,2,2,4,1,1), Clay=c(16,17,25,25,25,27,22,14,27,21,24,24, 14,21,20,20,18,18,15,11,4,0,1,3,3,0)) soils.sw.cols <- c(1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6) soils.sw.names <- c(\"Ardington\",\"Astrop\",\"Atrim\", \"Banbury\",\"Beacon\",\"Beckfoot\") soil.texture.uk(soils.sw.percent, main = \"Ternary Diagram for Some Soils from South West England\", col.lines = \"black\", col.names = \"black\", show.grid = TRUE, col.grid = \"blue\", lty.grid = 2, pch = 16, cex = 1.0, col.symbols = soils.sw.cols, h1 = NA, h3 = NA, t1 = NA, t3 = NA , lwduk = 2, xpos = NA, ypos = NA, snames = NA, cexuk = 1.1) legend(\"topleft\", legend = soils.sw.names, col = 1:max(soils.sw.cols), pch = 16, cex = 1.1, title = \"Location\", bty = \"n\")"},{"path":"/reference/soils.html","id":null,"dir":"Reference","previous_headings":"","what":"Soil texture data from 125 soils — soils","title":"Soil texture data from 125 soils — soils","text":"set 125 soil texture measurements soils various parts world.","code":""},{"path":"/reference/soils.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Soil texture data from 125 soils — soils","text":"","code":"data(soils)"},{"path":"/reference/soils.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Soil texture data from 125 soils — soils","text":"T.H. Skaggs, L.M. Arya, P.J. Shouse B.P. Mohanty (2001) Estimating Particle-Size Distribution Limited Soil Texture Data. Soil Science Society America Journal 65:1038-1044.","code":""},{"path":"/reference/spread.labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Spread labels for irregularly spaced values — spread.labels","title":"Spread labels for irregularly spaced values — spread.labels","text":"Places labels irregularly spaced values regular staggered order","code":""},{"path":"/reference/spread.labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spread labels for irregularly spaced values — spread.labels","text":"","code":"spread.labels(x,y,labels=NULL,ony=NA,offsets=NA,between=FALSE, linecol=par(\"fg\"),srt=0,...)"},{"path":"/reference/spread.labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Spread labels for irregularly spaced values — spread.labels","text":"x,y x y data values labels text strings ony Whether force labels spread horizontally (FALSE) vertically (TRUE). Defaults whichever way points spread . offsets far away data points place labels. Defaults one quarter plot span , staggered side. Whether place labels two sets points. linecol Optional colors lines drawn points. srt Rotation labels degrees. ... additional arguments passed text.","code":""},{"path":"/reference/spread.labels.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Spread labels for irregularly spaced values — spread.labels","text":"function mainly useful labeling irregularly spaced data points \"spread \" along one dimension. places labels regularly spaced staggered long dimension data, drawing lines label point describes. TRUE, function expects two points label attempt place labels two vertical lines points. Lines drawn ends label two corresponding points. spreading labels horizontally, user may wish rotate labels 90 degrees (srt=90). long labels run edge plot, increase xlim extra room.","code":""},{"path":"/reference/spread.labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Spread labels for irregularly spaced values — spread.labels","text":"nil","code":""},{"path":"/reference/spread.labels.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Spread labels for irregularly spaced values — spread.labels","text":"Jim Lemon","code":""},{"path":"/reference/spread.labels.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Spread labels for irregularly spaced values — spread.labels","text":"Cooke, L.J. & Wardle, J. (2005) Age gender differences children's food preferences. British Journal Nutrition, 93: 741-746.","code":""},{"path":[]},{"path":"/reference/spread.labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Spread labels for irregularly spaced values — spread.labels","text":"","code":"# spread labels out in the x dimension using defaults x<-sort(rnorm(10)) y<-rnorm(10)/10 plot(x,y,ylim=c(-1,1),type=\"p\") nums<-c(\"one\",\"two\",\"three\",\"four\",\"five\",\"six\",\"seven\",\"eight\",\"nine\",\"ten\") spread.labels(x,y,nums) # food preferences of children by sex (Cooke & Wardle, 2005) fpkids<-data.frame(Food=c(\"Fatty/sugary\",\"Fruit\",\"Starchy\",\"Meat\", \"Proc.meat\",\"Eggs\",\"Fish\",\"Dairy\",\"Vegetables\"), Female=c(4.21,4.22,3.98,3.57,3.55,3.46,3.34,3.26,3.13), Male=c(4.35,4.13,4.02,3.9,3.81,3.64,3.45,3.27,2.96)) plot(rep(1,9),fpkids$Female,xlim=c(0.8,2.2), ylim=range(c(fpkids$Female,fpkids$Male)),xlab=\"Sex\",xaxt=\"n\", ylab=\"Preference rating\",main=\"Children's food preferences by sex\", col=\"red\") axis(1,at=1:2,labels=c(\"Female\",\"Male\")) points(rep(2,9),fpkids$Male,col=\"blue\",pch=2) spread.labels(rep(1:2,each=9),c(fpkids$Female,fpkids$Male), fpkids$Food,between=TRUE,linecol=c(\"red\",\"blue\"))"},{"path":"/reference/spreadout.html","id":null,"dir":"Reference","previous_headings":"","what":"Spread out a vector of numbers to a minimum interval — spreadout","title":"Spread out a vector of numbers to a minimum interval — spreadout","text":"Spread vector numbers minimum interval two numbers ascending descending order.","code":""},{"path":"/reference/spreadout.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spread out a vector of numbers to a minimum interval — spreadout","text":"","code":"spreadout(x,mindist)"},{"path":"/reference/spreadout.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Spread out a vector of numbers to a minimum interval — spreadout","text":"x numeric vector may contain NAs. mindist minimum interval two values ascending descending order.","code":""},{"path":"/reference/spreadout.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Spread out a vector of numbers to a minimum interval — spreadout","text":"spreadout starts near middle vector increases intervals ordered values. NAs preserved. spreadout first tries spread groups values intervals less mindist neatly away mean group. entirely succeed, second pass forces values away middle performed. spreadout currently used avoid overplotting axis tick labels may close together.","code":""},{"path":"/reference/spreadout.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Spread out a vector of numbers to a minimum interval — spreadout","text":"success, spread values. less two valid values, original vector returned.","code":""},{"path":"/reference/spreadout.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Spread out a vector of numbers to a minimum interval — spreadout","text":"Jim Lemon","code":""},{"path":"/reference/spreadout.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Spread out a vector of numbers to a minimum interval — spreadout","text":"","code":"spreadout(c(1,3,3,3,3,5),0.2) #> [1] 1.0 2.7 2.9 3.1 3.3 5.0 spreadout(c(1,2.5,2.5,3.5,3.5,5),0.2) #> [1] 1.0 2.4 2.6 3.4 3.6 5.0 spreadout(c(5,2.5,2.5,NA,3.5,1,3.5,NA),0.2) #> [1] 5.0 2.4 2.6 NA 3.4 1.0 3.6 NA # this will almost always invoke the brute force second pass spreadout(rnorm(10),0.5) #> [1] 1.2278347 -1.2721653 -2.2721653 1.7278347 0.2278347 -0.2721653 #> [7] -0.7721653 -1.7721653 0.7278347 2.2278347"},{"path":"/reference/stackpoly.html","id":null,"dir":"Reference","previous_headings":"","what":"Display the columns of a matrix or data frame as stacked polygons — stackpoly","title":"Display the columns of a matrix or data frame as stacked polygons — stackpoly","text":"Plot one columns numeric values top edges polygons instead lines.","code":""},{"path":"/reference/stackpoly.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display the columns of a matrix or data frame as stacked polygons — stackpoly","text":"","code":"stackpoly(x,y=NULL,main=\"\",xlab=\"\",ylab=\"\",xat=NA,xaxlab=NA, xlim=NA,ylim=NA,lty=1,lwd=1,border=NA,col=NULL,staxx=FALSE,stack=FALSE, axis2=TRUE,axis4=TRUE,padj=0,...)"},{"path":"/reference/stackpoly.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display the columns of a matrix or data frame as stacked polygons — stackpoly","text":"x numeric data frame matrix x values. y NULL, become y values x positions integers 1 dim(x)[1]. y y values. main title plot. xlab,ylab x y axis labels plot. xat put optional xaxlabs. xaxlab Optional labels x positions. xlim Optional x limits. ylim Optional y limits. lty Line type polygon borders. lwd Line width polygon borders. border Color polygon borders. col Color fill polygons. NULL, rainbow called generate colors. NA, polygons filled. staxx Whether call staxlab stagger x axis labels. stack Whether stack successive values top . axis2 Whether display left ordinate plot. axis4 Whether display right ordinate plot. padj Vertical justfication x axis labels, defaulting \"top\". Can vector element label. ... Additional arguments passed plot.","code":""},{"path":"/reference/stackpoly.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display the columns of a matrix or data frame as stacked polygons — stackpoly","text":"nil","code":""},{"path":"/reference/stackpoly.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display the columns of a matrix or data frame as stacked polygons — stackpoly","text":"stackpoly similar line plot area lines filled color(s). Ideally, successive set y values greater values previous set polygons form rising series crests. stack TRUE, problem unless values x negative. x y vector, matrix list, values displayed \"waterfall plot\". options axis2 axis4 can used produce panel plots. See last example.","code":""},{"path":"/reference/stackpoly.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display the columns of a matrix or data frame as stacked polygons — stackpoly","text":"Jim Lemon Thomas Petzoldt (waterfall plot option) - thanks Phil Novack-Gottshall mismatched x y fix","code":""},{"path":[]},{"path":"/reference/stackpoly.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display the columns of a matrix or data frame as stacked polygons — stackpoly","text":"","code":"testx<-matrix(abs(rnorm(100)),nrow=10) stackpoly(matrix(cumsum(testx),nrow=10),main=\"Test Stackpoly I\", xaxlab=c(\"One\",\"Two\",\"Three\",\"Four\",\"Five\", \"Six\",\"Seven\",\"Eight\",\"Nine\",\"Ten\"),border=\"black\",staxx=TRUE) stackpoly(testx,main=\"Test Stackpoly II\", xaxlab=c(\"One\",\"Two\",\"Three\",\"Four\",\"Five\", \"Six\",\"Seven\",\"Eight\",\"Nine\",\"Ten\"),border=\"black\", staxx=TRUE,stack=TRUE) layout(matrix(1:2,nrow=1)) oldmar<-par(mar=c(5,4,4,0)) stackpoly(rev(sort(testx-mean(testx))), main=\"Waterfall Plot (x-mean)\",xat=seq(10,90,by=10), xlab=\"Index\",ylab=\"Value\",lwd=3,col=\"green\",border=\"black\", axis4=FALSE) ylim<-par(\"usr\")[3:4] par(mar=c(5,0,4,4)) stackpoly(rev(sort((testx-mean(testx))/sd(as.vector(testx)))), ylim=ylim,main=\"Waterfall Plot ((x-mean)/sd)\",xat=seq(10,90,by=10), xlab=\"Index\",lwd=3,col=\"lightblue\",border=\"black\",axis2=FALSE) par(oldmar)"},{"path":"/reference/staircase.plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a staircase plot — staircase.plot","title":"Display a staircase plot — staircase.plot","text":"Displays plot showing sequence changing totals increments successive linked bars.","code":""},{"path":"/reference/staircase.plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a staircase plot — staircase.plot","text":"","code":"staircase.plot(heights,totals=NA,labels=NULL,halfwidth=0.3,main=\"\", mar=NA,total.col=\"blue\",inc.col=NA,bg.col=NA,direction=\"e\",las=1, display.height=TRUE,stagger=FALSE,cex=par(\"cex\"),prefix=\"\",suffix=\"\",...)"},{"path":"/reference/staircase.plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a staircase plot — staircase.plot","text":"heights vector numeric values matrix data frame least two columns. first column must numeric second may numeric logical. totals vector logicals zero/non-zero values indicating whether corresponding height total (TRUE) increment (FALSE). labels optional vector labels bars. halfwidth Half width bar proportion. See Details. main title plot. mar Margins plot. Defaults 10 baseline axis, 3 top 1 two sides. total.col Color(s) bars representing successive totals. inc.col Color(s) bars representing increments. bg.col background color plot. direction Direction bars presented. See Details. las Orientation bar labels. See par. display.height Whether display totals increments upper ends bars. Defaults TRUE. stagger Whether stagger labels avoid overlap. cex usual character expansion value. prefix prefix numbers displayed next bars (e.g. $). suffix suffix prefix (e.g. %). ... arguments passed plot.","code":""},{"path":"/reference/staircase.plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a staircase plot — staircase.plot","text":"nil","code":""},{"path":"/reference/staircase.plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a staircase plot — staircase.plot","text":"Displays plot representing successive changes counts values. example, research study attempts contact certain number people contacted, decline participate, ineligible, final sample smaller initial contact list. first value total attempts, number decrements, last value actual sample. may intermediate totals specified. produces visual display sampling procedure. See example. bars placed integer values axis representing succession counts values. width bars determined argument halfwidth. defaults 0.3, meaning bar extends 0.3 side, proportion bar space 0.6 0.4. succession bars determined direction argument. default \"e\" (east), meaning first bar left plot subsequent bars placed right. three possibilities follow conventional compass layout. prefix suffix arguments allow user specify units numbers displayed next bars. single value passed, numbers get prefix suffix. Different prefixes suffixes number can passed vectors. getFigCtr function called center plot title figure region plot area typically center.","code":""},{"path":"/reference/staircase.plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a staircase plot — staircase.plot","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/staircase.plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a staircase plot — staircase.plot","text":"","code":"sample_size<-c(500,-72,428,-94,334,-45,289) totals<-c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE) labels<-c(\"Contact list\",\"Uncontactable\",\"\",\"Declined\",\"\",\"Ineligible\", \"Final sample\") staircase.plot(sample_size,totals,labels, main=\"Acquisition of the sample (staircase.plot)\", total.col=\"gray\",inc.col=2:4,bg.col=\"#eeeebb\",direction=\"s\")"},{"path":"/reference/staircasePlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a staircase plot — staircasePlot","title":"Display a staircase plot — staircasePlot","text":"Displays plot showing sequence changing totals increments successive linked bars.","code":""},{"path":"/reference/staircasePlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a staircase plot — staircasePlot","text":"","code":"staircasePlot(heights,totals=NA,labels=NULL,halfwidth=0.3,main=\"\",mar=NA, stair.info=list(total.col=\"blue\",inc.col=NA,border=par(\"fg\")),bg.col=NA, direction=\"e\",las=1,display.height=TRUE,stagger=FALSE,cex=par(\"cex\"), prefix=\"\",suffix=\"\",...)"},{"path":"/reference/staircasePlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a staircase plot — staircasePlot","text":"heights vector numeric values matrix data frame least two columns. first column must numeric second may numeric logical. totals vector logicals zero/non-zero values indicating whether corresponding height total (TRUE) increment (FALSE). labels optional vector labels bars. halfwidth Half width bar proportion. See Details. main title plot. mar Margins plot. Defaults 10 baseline axis, 3 top 1 two sides. stair.info list arguments bars including color(s) bars representing successive totals, increments border color. bg.col background color plot. direction Direction bars presented. See Details. las Orientation bar labels. See par. display.height Whether display totals increments upper ends bars. Defaults TRUE. stagger Whether stagger labels avoid overlap. cex usual character expansion value. prefix prefix numbers displayed next bars (e.g. $). suffix suffix prefix (e.g. %). ... arguments passed plot.","code":""},{"path":"/reference/staircasePlot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a staircase plot — staircasePlot","text":"nil","code":""},{"path":"/reference/staircasePlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a staircase plot — staircasePlot","text":"Displays plot representing successive changes counts values. example, research study attempts contact certain number people contacted, decline participate, ineligible, final sample smaller initial contact list. first value total attempts, number decrements, last value actual sample. may intermediate totals specified. produces visual display sampling procedure. See example. bars placed integer values axis representing succession counts values. width bars determined argument halfwidth. defaults 0.3, meaning bar extends 0.3 side, proportion bar space 0.6 0.4. succession bars determined direction argument. default \"e\" (east), meaning first bar left plot subsequent bars placed right. three possibilities follow conventional compass layout. prefix suffix arguments allow user specify units numbers displayed next bars. single value passed, numbers get prefix suffix. Different prefixes suffixes number can passed vectors. getFigCtr function called center plot title figure region plot area typically center.","code":""},{"path":"/reference/staircasePlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a staircase plot — staircasePlot","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/staircasePlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a staircase plot — staircasePlot","text":"","code":"sample_size<-c(500,-72,428,-94,334,-45,289) totals<-c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE) labels<-c(\"Contact list\",\"Uncontactable\",\"\",\"Declined\",\"\",\"Ineligible\", \"Final sample\") staircasePlot(sample_size,totals,labels, main=\"Acquisition of the sample (staircasePlot)\", total.col=\"gray\",inc.col=2:4,bg.col=\"#eeeebb\",direction=\"s\") #> Warning: \"total.col\" is not a graphical parameter #> Warning: \"inc.col\" is not a graphical parameter #> Warning: \"total.col\" is not a graphical parameter #> Warning: \"inc.col\" is not a graphical parameter #> Warning: \"total.col\" is not a graphical parameter #> Warning: \"inc.col\" is not a graphical parameter"},{"path":"/reference/starPie.html","id":null,"dir":"Reference","previous_headings":"","what":"A pie-like graphic object — starPie","title":"A pie-like graphic object — starPie","text":"Display polygon sector proportional vector numeric values.","code":""},{"path":"/reference/starPie.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A pie-like graphic object — starPie","text":"","code":"starPie(x,y,radext,values,maxval=NA,border=par(\"fg\"),col=NA,prop.area=FALSE, label=\"\",labelpos=1)"},{"path":"/reference/starPie.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A pie-like graphic object — starPie","text":"x,y coordinate position center starPie. radext maximum distance center starPie one vertex polygon. values vector numeric values. maxval maximum value scaling values radius. NA, maximum value values used. border color use borders polygon sectors. col color(s) use fills polygon. prop.area Whether scale values area (TRUE) radial extent (FALSE) polygon sectors. label Optional text labels starPies. labelpos Positions labels relative starPies.","code":""},{"path":"/reference/starPie.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A pie-like graphic object — starPie","text":"nil","code":""},{"path":"/reference/starPie.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A pie-like graphic object — starPie","text":"starPie displays polygon centered x,y position sectors equal angular extent. radial extent sector proportional values numeric vector lengths. prop.area argument TRUE, proportion based area sector, prop.area FALSE, proportion radial extent. function intended exaggerate differences different starPies, default produces sectors proportional squares lengths. starPie intended display visual analog relative value matched attributes number similar objects groups. Thus objects similar attributes produce similar looking starPies. constructing matrix, necessary maxval specified, usually overall maximum value attribute value vectors. maxval specified situation, relative values within vector determine radial extents starPie. appears reason different sector colors different objects, user can display one set starPies plot different sector colors necessary. starPie calls getYmult automatically adjust aspect coordinate ratio plot.","code":""},{"path":"/reference/starPie.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"A pie-like graphic object — starPie","text":"Jim Lemon","code":""},{"path":"/reference/starPie.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"A pie-like graphic object — starPie","text":"","code":"date_mat<-data.frame(sex=rep(c(\"M\",\"F\"),each=10), names=c(\"Abe\",\"Bob\",\"Col\",\"Dave\",\"Eddie\",\"Frank\",\"Geoff\",\"Harry\",\"Igor\",\"Jack\", \"Alice\",\"Betty\",\"Clare\",\"Dora\",\"Eva\",\"Fran\",\"Grace\",\"Hilda\",\"Iris\",\"Joan\"), eating=sample(0:100,20),dancing=sample(0:100,20),movies=sample(0:100,20), reading=sample(0:100,20),travel=sample(0:100,20)) plot(0,xlim=c(0.5,10.5),ylim=c(0,3),type=\"n\",axes=FALSE,xlab=\"\",ylab=\"Sex\", main=\"Date matching matrix\") par(xpd=TRUE) legend(0.7,-0.3,c(\"Eat out\",\"Dance\",\"Movies\",\"Read\",\"Travel\"),fill=rainbow(5), ncol=5) par(xpd=FALSE) box() axis(2,at=c(0.9,2.4),labels=c(\"Male\",\"Female\")) starPie(x=rep(1:10,2),y=rep(c(0.9,2.4),each=10),radext=0.5, values=as.matrix(date_mat[,3:7]),label=as.character(date_mat[[\"names\"]]))"},{"path":"/reference/staxlab.html","id":null,"dir":"Reference","previous_headings":"","what":"Place staggered or angled labels on an axis — staxlab","title":"Place staggered or angled labels on an axis — staxlab","text":"Places labels axis regular staggered order angle","code":""},{"path":"/reference/staxlab.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Place staggered or angled labels on an axis — staxlab","text":"","code":"staxlab(side=1,at,labels,nlines=2,top.line=0.5,line.spacing=0.8, srt=NULL,ticklen=0.03,adj=1,...)"},{"path":"/reference/staxlab.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Place staggered or angled labels on an axis — staxlab","text":"side axis place labels, axis place labels user units, axis labels text strings nlines many lines use stagger labels. top.line Distance axis place first line text. line.spacing Spacing lines text labels. srt Text rotation. ticklen Proportion plot height user units place text plot. adj horizontal adjustment labels. ... Additional arguments passed mtext text.","code":""},{"path":"/reference/staxlab.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Place staggered or angled labels on an axis — staxlab","text":"function mainly useful either long axis labels large number labels placed without overlapping. staggers labels along axis specified. user may wish increase space beneath plot using mar calling staxlab. probably useful bottom left side plot. srt NULL, labels rotated srt degrees placed plot. method place labels bottom. Note option works lower left axes.","code":""},{"path":"/reference/staxlab.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Place staggered or angled labels on an axis — staxlab","text":"nil","code":""},{"path":"/reference/staxlab.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Place staggered or angled labels on an axis — staxlab","text":"Jim Lemon (thanks Tim Elwell-Sutton log axis fix)","code":""},{"path":[]},{"path":"/reference/staxlab.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Place staggered or angled labels on an axis — staxlab","text":"","code":"x<-rnorm(12) plot(x,axes=FALSE) box() months<-c(\"January\",\"February\",\"March\",\"April\",\"May\",\"June\", \"July\",\"August\",\"September\",\"October\",\"November\",\"December\") staxlab(1,1:12,months) plot(x,axes=FALSE) box() staxlab(1,1:12,months,srt=45) ylabels<-round(seq(min(x),max(x),length.out=10),3) staxlab(2,ylabels,ylabels,srt=45)"},{"path":"/reference/std.error.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate standard error of the mean — std.error","title":"Calculate standard error of the mean — std.error","text":"Calculates standard error mean.","code":""},{"path":"/reference/std.error.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate standard error of the mean — std.error","text":"","code":"std.error(x,na.rm)"},{"path":"/reference/std.error.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate standard error of the mean — std.error","text":"x vector numerical observations. na.rm Dummy argument match functions.","code":""},{"path":"/reference/std.error.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate standard error of the mean — std.error","text":"std.error accept numeric vector.","code":""},{"path":"/reference/std.error.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate standard error of the mean — std.error","text":"conventional standard error mean = sd(x)/sqrt(sum(!.na(x)))","code":""},{"path":"/reference/std.error.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate standard error of the mean — std.error","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/sumbrk.html","id":null,"dir":"Reference","previous_headings":"","what":"Count specified values in a vector — sumbrk","title":"Count specified values in a vector — sumbrk","text":"Counts number values vector equal specified value.","code":""},{"path":"/reference/sumbrk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count specified values in a vector — sumbrk","text":"","code":"sumbrk(x,trueval=TRUE,na.rm=TRUE)"},{"path":"/reference/sumbrk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Count specified values in a vector — sumbrk","text":"x character, factor numeric vector. trueval value matched x. na.rm whether remove NA values.","code":""},{"path":"/reference/sumbrk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Count specified values in a vector — sumbrk","text":"sumbrk counts values x matching specified value. mainly allow sums calculated brkdnNest function.","code":""},{"path":"/reference/sumbrk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count specified values in a vector — sumbrk","text":"nil","code":""},{"path":"/reference/sumbrk.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Count specified values in a vector — sumbrk","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/sumbrk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Count specified values in a vector — sumbrk","text":"","code":"sumbrk(sample(LETTERS,100,TRUE),trueval=\"M\") #> [1] 5"},{"path":"/reference/symbolbarplot.html","id":null,"dir":"Reference","previous_headings":"","what":"barplot filled with symbols — symbolbarplot","title":"barplot filled with symbols — symbolbarplot","text":"Produces barplot piece barplot filled number symbols equal size bar","code":""},{"path":"/reference/symbolbarplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"barplot filled with symbols — symbolbarplot","text":"","code":"symbolbarplot(height,width=1,space=NULL,names.arg=NULL, legend.text=NULL,beside=FALSE,horiz=FALSE,col=heat.colors(NR), border=par(\"fg\"),main=NULL,sub=NULL,xlab=NULL,ylab=NULL,xlim=NULL, ylim=NULL,axes=TRUE,axisnames=TRUE,inside=TRUE,plot=TRUE,rel.width=0.8, symbol=\"circles\",symbbox=TRUE,debug=FALSE,...)"},{"path":"/reference/symbolbarplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"barplot filled with symbols — symbolbarplot","text":"height numeric vector matrix barplot heights width width bars space space bars names.arg vector names legend.text vector legend text beside (logical) plot bars beside ? horiz (logical) horizontal barplot? col vector colors border plot border? main main title sub subtitle xlab x axis label ylab y axis label xlim x limits ylim y limits axes draw axes? axisnames label horizontal axis? inside draw lines dividing adjacent bars? plot produce plot? rel.width relative width symbols symbol symbol use symbbox draw boxes symbol boxes? debug debug output? ... arguments multsymbolbox","code":""},{"path":"/reference/symbolbarplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"barplot filled with symbols — symbolbarplot","text":"Nil","code":""},{"path":"/reference/symbolbarplot.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"barplot filled with symbols — symbolbarplot","text":"mostly hack barplot()","code":""},{"path":"/reference/symbolbarplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"barplot filled with symbols — symbolbarplot","text":"Ben Bolker","code":""},{"path":"/reference/symbolbarplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"barplot filled with symbols — symbolbarplot","text":"","code":"set.seed(1001) bvals <- matrix(rpois(12,20),nrow=3) b <- symbolbarplot(bvals)"},{"path":"/reference/symbolbox.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw a box filled with symbols — symbolbox","title":"Draw a box filled with symbols — symbolbox","text":"Draws box current figure filled symbols representing individual counts","code":""},{"path":"/reference/symbolbox.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw a box filled with symbols — symbolbox","text":"","code":"symbolbox(x1,y1,x2,y2,tot,relw=0.5,fg=par(\"fg\"),bg=par(\"bg\"),box=TRUE, debug = TRUE,...)"},{"path":"/reference/symbolbox.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw a box filled with symbols — symbolbox","text":"x1 left side box y1 bottom side box x2 right side box y2 top side box tot total number symbols put box relw relative width (relative height) symbols fg foreground color bg background color box (logical) draw box border? debug debug output? ... additional arguments polygon() drawing box","code":""},{"path":"/reference/symbolbox.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Draw a box filled with symbols — symbolbox","text":"tries automatically figure appropriate scaling fit symbols box","code":""},{"path":"/reference/symbolbox.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Draw a box filled with symbols — symbolbox","text":"none; draws current figure","code":""},{"path":"/reference/symbolbox.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Draw a box filled with symbols — symbolbox","text":"Ben Bolker","code":""},{"path":[]},{"path":"/reference/symbolbox.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Draw a box filled with symbols — symbolbox","text":"","code":"plot(1:10,1:10,type=\"n\") symbolbox(2,5,3,7,tot=20) #> symbolbox: 2 5 3 7 20 #> symbolbox: 0.558299 0.9931413 3 7 3 7 20 symbolbox(6,2,10,6,tot=50,fg=\"blue\",bg=\"magenta\") #> symbolbox: 6 2 10 6 50 #> symbolbox: 2.233196 1.986283 7 8 7 8 50"},{"path":"/reference/tab.title.html","id":null,"dir":"Reference","previous_headings":"","what":"Display the title of a plot as a colored tab — tab.title","title":"Display the title of a plot as a colored tab — tab.title","text":"Display title plot colored tab.","code":""},{"path":"/reference/tab.title.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display the title of a plot as a colored tab — tab.title","text":"","code":"tab.title(label,text.col=par(\"fg\"),tab.col=par(\"bg\"),border=par(\"fg\"), lwd=par(\"lwd\"),cex=1.5,pad.mult=1.6,radius=0)"},{"path":"/reference/tab.title.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display the title of a plot as a colored tab — tab.title","text":"label title plot. text.col color title text. tab.col color tab fill. border color tab border. lwd line width border. cex Character expansion title. pad.mult much higher make tab relative label. radius proportion tab corners round .","code":""},{"path":"/reference/tab.title.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display the title of a plot as a colored tab — tab.title","text":"nil","code":""},{"path":"/reference/tab.title.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display the title of a plot as a colored tab — tab.title","text":"tab.title displays plot title colored tab. tab can rounded upper corners specifying proportion tab height rounded number 0 1. tab high fit figure region, warning displayed tab still shown.","code":""},{"path":"/reference/tab.title.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display the title of a plot as a colored tab — tab.title","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/tab.title.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display the title of a plot as a colored tab — tab.title","text":"","code":"testx<-matrix(cumsum(rnorm(30)^2)+1,nrow=10) stackpoly(testx,main=\"\", xaxlab=c(\"One\",\"Two\",\"Three\",\"Four\",\"Five\", \"Six\",\"Seven\",\"Eight\",\"Nine\",\"Ten\"),staxx=TRUE) tab.title(\"Three Squiggly Lines\",tab.col=\"yellow\",radius=0.5)"},{"path":"/reference/taylor.diagram.html","id":null,"dir":"Reference","previous_headings":"","what":"Taylor diagram — taylor.diagram","title":"Taylor diagram — taylor.diagram","text":"Display Taylor diagram","code":""},{"path":"/reference/taylor.diagram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Taylor diagram — taylor.diagram","text":"","code":"taylor.diagram(ref,model,add=FALSE,col=\"red\",pch=19,pos.cor=TRUE, xlab=\"Standard deviation\",ylab=\"\",main=\"Taylor Diagram\", show.gamma=TRUE,ngamma=3,gamma.col=8,sd.arcs=0, ref.sd=FALSE,sd.method=\"sample\",grad.corr.lines=c(0.2,0.4,0.6,0.8,0.9), pcex=1,cex.axis=1,normalize=FALSE,mar=c(4,3,4,3),...)"},{"path":"/reference/taylor.diagram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Taylor diagram — taylor.diagram","text":"ref numeric vector - reference values. model numeric vector - predicted model values. add whether draw diagram just add point. col color points displayed. pch type point display. pos.cor whether display positive (TRUE) values correlation (FALSE). xlab,ylab plot axis labels. main title plot. show.gamma whether display standard deviation arcs around reference point (pos.cor=TRUE). ngamma number gammas display (default=3). gamma.col color use gamma arcs (pos.cor=TRUE). sd.arcs whether display arcs along standard deviation axes (see Details). ref.sd whether display arc representing reference standard deviation. sd.method Whether use sample estimated population SD. grad.corr.lines values radial lines correlation values (see Details). pcex character expansion plotted points. cex.axis character expansion axis text. normalize whether normalize models reference standard deviation 1. mar margins - applies pos.cor=TRUE plot. ... Additional arguments passed plot.","code":""},{"path":"/reference/taylor.diagram.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Taylor diagram — taylor.diagram","text":"Taylor diagram used display quality model predictions reference values, typically direct observations. diagram built plotting one model reference, adding alternative model points. normalize=TRUE plotting first model, remember set TRUE plotting additional models. Two displays available. One displays entire range correlations -1 1. Setting pos.cor FALSE produce display. -1 1 display includes radial grid correlation values. pos.cor set TRUE, range 0 1 displayed. gamma lines arc reference standard deviation optional display. standard deviation arcs gamma lines optional pos.cor=TRUE version. Setting sd.arcs grad.corr.lines zero FALSE cause displayed. one value passed sd.arcs, function try use values passed, otherwise call pretty calculate values.","code":""},{"path":"/reference/taylor.diagram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Taylor diagram — taylor.diagram","text":"values par preceded function. allows user add points diagram, restore original values. necessary using 0 1 correlation range.","code":""},{"path":"/reference/taylor.diagram.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Taylor diagram — taylor.diagram","text":"Taylor, K.E. (2001) Summarizing multiple aspects model performance single diagram. Journal Geophysical Research, 106: 7183-7192.","code":""},{"path":"/reference/taylor.diagram.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Taylor diagram — taylor.diagram","text":"Olivier Eterradossi modifications Jim Lemon","code":""},{"path":"/reference/taylor.diagram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Taylor diagram — taylor.diagram","text":"","code":"# fake some reference data ref<-rnorm(30,sd=2) # add a little noise model1<-ref+rnorm(30)/2 # add more noise model2<-ref+rnorm(30) # display the diagram with the better model oldpar<-taylor.diagram(ref,model1) # now add the worse model taylor.diagram(ref,model2,add=TRUE,col=\"blue\") # get approximate legend position lpos<-1.5*sd(ref) # add a legend legend(lpos,lpos,legend=c(\"Better\",\"Worse\"),pch=19,col=c(\"red\",\"blue\")) # now restore par values par(oldpar) # show the \"all correlation\" display taylor.diagram(ref,model1,pos.cor=FALSE) taylor.diagram(ref,model2,add=TRUE,col=\"blue\")"},{"path":"/reference/textbox.html","id":null,"dir":"Reference","previous_headings":"","what":"Add text box — textbox","title":"Add text box — textbox","text":"Add text plot, justified, box","code":""},{"path":"/reference/textbox.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add text box — textbox","text":"","code":"textbox(x, y, textlist, justify=c('l','c','r'), cex=1, leading=0.5, box=TRUE, adj=c(0,0), font=NULL, vfont=NULL, col=NULL, border=NULL, fill=NA, density=NULL, angle=45, lty=par(\"lty\"), lwd=par(\"lwd\"), margin=0)"},{"path":"/reference/textbox.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add text box — textbox","text":"x x position: vector min. max. x-position y y position: location top box textlist vector text strings justify x alignment: 'l'=left, 'c'=center, 'r'=right. cex character expansion leading inter-line spacing box whether draw box around text adj adjustment x y position, default adjustment, see Details font text font, see Details vfont text font, see Details col text color border box border color fill box fill color density box shading line density, see Details angle box shading line angle, see Details lty box border shading line types, see Details lwd box border shading line width, see Details margin amount adjust box border . See Details","code":""},{"path":"/reference/textbox.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add text box — textbox","text":"Draws text box pasting textlist vector together, splitting words, adding words current line line wide enough moving next line. margin may vector 1, 2, 4 values, corresponding adjustment borders (1 value), top/bottom left/right borders (2 values), bottom/left/top/right borders (4 values). positive value moves text inwards specified (x,y) position border remaining (x,y), negative value moves border outwards (x,y) text remaining (x,y). density angle arguments behavior rect function. adj, font vfont arguments behavior text function. lty lwd arguments behavior lines function.","code":""},{"path":"/reference/textbox.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add text box — textbox","text":"y-position bottom line box, y-position next line box.","code":""},{"path":"/reference/textbox.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add text box — textbox","text":"Ben Bolker. Improvements Ted Toal.","code":""},{"path":"/reference/textbox.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add text box — textbox","text":"","code":"plot.new() textbox(c(0,0.2), 1, c(\"many words\",\"more words\",\"why not?\", \"keep going\",rep(\"and going\",10))) #> [1] 1.0000000 0.9580456 0.9160912 0.8741367 0.8321823 0.7902279 0.7482735 #> [8] 0.7063191 0.6643646 0.6224102 0.5804558 0.5385014 0.4965470 0.4545925 #> [15] 0.4126381 0.3706837 0.3287293 textbox(c(0.3,0.5), 1, c(\"keep going\",rep(\"and going\",10)), cex=0.45, col=\"blue\", border=\"red\", fill=\"#00FFEE80\", density=25, angle=60) #> [1] 1.0000000 0.9813212 0.9626423 0.9439635 0.9252847 0.9066058 0.8879270 textbox(c(0.6,0.8), 1, c(\"keep going\",rep(\"and going\",10)), justify='c', cex=0.6, leading=1, font=4, border=\"gold\", lty=2, lwd=4, margin=0.025) #> [1] 0.9750000 0.9438686 0.9127372 0.8816058 0.8504744 0.8193430 0.7882116 #> [8] 0.7570802 0.7259488 0.6948174 0.6636860 0.6325546 textbox(c(0.6,0.8), 0.5, c(\"keep going\",rep(\"and going\",10)), justify='r', cex=0.7, col=\"purple\", font=3, border=\"green\", margin=-0.025) #> [1] 0.5000000 0.4719991 0.4439983 0.4159974 0.3879965 0.3599957 0.3319948 #> [8] 0.3039940 0.2759931 lines(c(0,1), c(1,1), col=\"red\", lty=2) lines(c(0,1), c(0.5,0.5), col=\"red\", lty=2)"},{"path":"/reference/thigmophobe.html","id":null,"dir":"Reference","previous_headings":"","what":"Find the direction away from the closest point — thigmophobe","title":"Find the direction away from the closest point — thigmophobe","text":"Find direction away closest point","code":""},{"path":"/reference/thigmophobe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find the direction away from the closest point — thigmophobe","text":"","code":"thigmophobe(x,y=NULL,names=seq_along(z),xlog=par(\"xlog\"),ylog=par(\"ylog\"), usr=par(\"usr\"),pin=par(\"pin\"),eps=.Machine$double.eps,pi=base::pi)"},{"path":"/reference/thigmophobe.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find the direction away from the closest point — thigmophobe","text":"x,y Numeric data vectors. Typically x/y coordinates plotted points. arrays passed, silently coerced numeric vectors. names Names vector directions. xlog,ylog Flags logarithmic axes. See Note. usr extent plot user units. pin Extent plot inches. eps smallest number can represented system. pi value pi.","code":""},{"path":"/reference/thigmophobe.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find the direction away from the closest point — thigmophobe","text":"thigmophobe returns direction (1|2|3|4 - see pos= text) away nearest point points described x y.","code":""},{"path":"/reference/thigmophobe.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Find the direction away from the closest point — thigmophobe","text":"thigmophobe typically used get offsets automatically place labels scatterplot similar using thigmophobe.labels avoid overlapping labels. name means \"one fears touched\". plot.span, xlog ylog arguments added allow thigmophobe used outside base graphics.","code":""},{"path":"/reference/thigmophobe.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find the direction away from the closest point — thigmophobe","text":"vector directions away point nearest point.","code":""},{"path":"/reference/thigmophobe.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find the direction away from the closest point — thigmophobe","text":"Bill Venables","code":""},{"path":[]},{"path":"/reference/thigmophobe.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find the direction away from the closest point — thigmophobe","text":"","code":"x<-rnorm(10) y<-rnorm(10) thigmophobe(x,y) #> 1 2 3 4 5 6 7 8 9 10 #> 1 4 2 4 2 4 3 2 2 4"},{"path":"/reference/thigmophobe.labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Place labels away from the nearest point — thigmophobe.labels","title":"Place labels away from the nearest point — thigmophobe.labels","text":"thigmophobe.labels places labels adjacent point, offsetting label direction returned thigmophobe.","code":""},{"path":"/reference/thigmophobe.labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Place labels away from the nearest point — thigmophobe.labels","text":"","code":"thigmophobe.labels(x,y,labels=NULL,text.pos=NULL,...)"},{"path":"/reference/thigmophobe.labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Place labels away from the nearest point — thigmophobe.labels","text":"x,y Numeric data vectors list two components. Typically x/y coordinates plotted points. labels vector strings placed adjacent point. Defaults indices coordinates. text.pos optional vector text positions (see text). ... additional arguments passed text .","code":""},{"path":"/reference/thigmophobe.labels.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Place labels away from the nearest point — thigmophobe.labels","text":"Typically used automatically place labels scatterplot similar avoid overlapping labels. thigmophobe.labels sometimes place label plot fail separate labels clusters points. user can manually adjust errant labels running thigmophobe first saving returned vector. modify position values place labels properly pass edited vector thigmophobe.labels text.pos argument. takes precedence positions calculated thigmophobe. thigmophobe fail two labels, figure nearest neighbors. really want use two labels, just eyeball plot work direction labels go. pass directions thigmophobe.labels text.pos argument. else fails, look placeLabels. pointLabel maptools package spread.labs TeachingDemos package use sophisticated algorithms place labels worth try thigmophobe just get right.","code":""},{"path":"/reference/thigmophobe.labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Place labels away from the nearest point — thigmophobe.labels","text":"vector directions away point nearest point.","code":""},{"path":"/reference/thigmophobe.labels.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Place labels away from the nearest point — thigmophobe.labels","text":"Jim Lemon (thanks Stephen Milborrow finding single point bug Erik Aronesty finding two point problem.)","code":""},{"path":[]},{"path":"/reference/thigmophobe.labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Place labels away from the nearest point — thigmophobe.labels","text":"","code":"x<-rnorm(20) y<-rnorm(20) xlim<-range(x) xspace<-(xlim[2]-xlim[1])/20 xlim<-c(xlim[1]-xspace,xlim[2]+xspace) ylim<-range(y) yspace<-(ylim[2]-ylim[1])/20 ylim<-c(ylim[1]-yspace,ylim[2]+yspace) plotlabels<- c(\"one\",\"two\",\"three\",\"four\",\"five\",\"six\",\"seven\",\"eight\",\"nine\",\"ten\", \"eleven\",\"twelve\",\"thirteen\",\"fourteen\",\"fifteen\",\"sixteen\",\"seventeen\", \"eighteen\",\"nineteen\",\"twenty\") plot(x=x,y=y,xlim=xlim,ylim=ylim,main=\"Test thigmophobe.labels\") # skip the almost invisible yellow label, make them bold thigmophobe.labels(x,y,plotlabels,col=c(2:6,8:12),font=2)"},{"path":"/reference/triax.abline.html","id":null,"dir":"Reference","previous_headings":"","what":"Lines for triangle plot — triax.abline","title":"Lines for triangle plot — triax.abline","text":"Display lines triangle plot.","code":""},{"path":"/reference/triax.abline.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Lines for triangle plot — triax.abline","text":"","code":"triax.abline(b=NULL,r=NULL,l=NULL,col=par(\"col\"),lty=par(\"lty\"), cc.axes=FALSE)"},{"path":"/reference/triax.abline.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lines for triangle plot — triax.abline","text":"b Lines relating bottom axis. r Lines relating right axis. l Lines relating left axis. col Color(s) lines. lty Type(s) lines. cc.axes Clockwise/counterclockwise axes ticks.","code":""},{"path":"/reference/triax.abline.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Lines for triangle plot — triax.abline","text":"triax.abline displays one lines triangle plot. Lines oriented conventional way, horizontal left axis, slanting right right axis left bottom axis. cc.axes TRUE, orientation -left left axis, horizontal right axis -right bottom axis. Remember call triax.plot .add=FALSE restore graphics parameters example lines placed properly.","code":""},{"path":"/reference/triax.abline.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Lines for triangle plot — triax.abline","text":"nil","code":""},{"path":"/reference/triax.abline.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Lines for triangle plot — triax.abline","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/triax.abline.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Lines for triangle plot — triax.abline","text":"","code":"triax.return<-triax.plot(data.frame(bottom=0.4,right=0.3,left=0.3), main=\"Triax ablines\",no.add=FALSE) triax.abline(l=0.3,col=\"red\") triax.abline(r=0.3,col=\"green\") triax.abline(b=0.4,col=\"blue\") par(triax.return$oldpar)"},{"path":"/reference/triax.fill.html","id":null,"dir":"Reference","previous_headings":"","what":"Triangle plot fill — triax.fill","title":"Triangle plot fill — triax.fill","text":"Fill triangle plot smaller triangles.","code":""},{"path":"/reference/triax.fill.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Triangle plot fill — triax.fill","text":"","code":"triax.fill(col)"},{"path":"/reference/triax.fill.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Triangle plot fill — triax.fill","text":"col List colors (see Details).","code":""},{"path":"/reference/triax.fill.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Triangle plot fill — triax.fill","text":"order triax.fill fill existing plot created call triax.plot, user must supply list fill colors. first element list must begin least one value can interpreted color. second element must begin least three values, , adding two values element list. list element displayed row colored triangles starting top plot. number elements list determines number rows displayed.","code":""},{"path":"/reference/triax.fill.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Triangle plot fill — triax.fill","text":"nil","code":""},{"path":"/reference/triax.fill.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Triangle plot fill — triax.fill","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/triax.fill.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Triangle plot fill — triax.fill","text":"","code":"# the data will be something like response at different proportions fillval<-list(0,c(0,0.1,0),c(0,0.1,0.2,0.1,0), c(0,0.1,0.2,0.3,0.2,0.1,0),c(0,0.1,0.2,0.3,0.4,0.3,0.2,0.1,0), c(0,0.1,0.2,0.3,0.4,0.5,0.4,0.3,0.2,0.1,0), c(0,0,0.1,0.2,0.3,0.4,0.5,0.4,0.3,0.2,0.1,0,0), c(0,0,0,0.1,0.1,0.2,0.3,0.4,0.3,0.2,0.1,0.1,0,0,0)) # use some method of converting values to colors fillcol<-sapply(fillval,function(x) {x*10+1} ) oldpar<-triax.plot(main=\"Test of triax.fill function\") triax.fill(fillcol) par(oldpar) #> Warning: \"xypos\" is not a graphical parameter #> Warning: \"oldpar\" is not a graphical parameter"},{"path":"/reference/triax.frame.html","id":null,"dir":"Reference","previous_headings":"","what":"Triangle plot frame — triax.frame","title":"Triangle plot frame — triax.frame","text":"Display three axis frame optional grid.","code":""},{"path":"/reference/triax.frame.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Triangle plot frame — triax.frame","text":"","code":"triax.frame(at=seq(0.1,0.9,by=0.1),axis.labels=NULL, tick.labels=NULL,col.axis=\"black\",cex.axis=1,cex.ticks=1, align.labels=TRUE,show.grid=FALSE,col.grid=\"gray\",lty.grid=par(\"lty\"), cc.axes=FALSE)"},{"path":"/reference/triax.frame.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Triangle plot frame — triax.frame","text":"tick positions three axes. axis.labels Labels three axes order bottom, right left. Defaults column names. tick.labels tick labels axes. Defaults argument (proportions). col.axis Color triangular axes, ticks labels. cex.axis Character expansion axis labels. cex.ticks Character expansion tick labels. align.labels Logical - whether align axis tick labels axes. show.grid Whether display grid lines ticks. col.grid Color grid lines. Defaults gray. lty.grid Type line grid. cc.axes Whether align axes clockwise counterclockwise.","code":""},{"path":"/reference/triax.frame.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Triangle plot frame — triax.frame","text":"triax.frame displays triangular plot area proportions percentages may displayed. optional grid may also displayed. cc.axes TRUE, axes axis ticks reverse order.","code":""},{"path":"/reference/triax.frame.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Triangle plot frame — triax.frame","text":"nil","code":""},{"path":"/reference/triax.frame.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Triangle plot frame — triax.frame","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/triax.frame.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Triangle plot frame — triax.frame","text":"","code":"triax.plot(main=\"DEFAULT\") triax.plot(main=\"Clockwise axes\",cc.axes=TRUE)"},{"path":"/reference/triax.plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Triangle plot — triax.plot","title":"Triangle plot — triax.plot","text":"Display triangle plot optional grid.","code":""},{"path":"/reference/triax.plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Triangle plot — triax.plot","text":"","code":"triax.plot(x=NULL,main=\"\",at=seq(0.1,0.9,by=0.1), axis.labels=NULL,tick.labels=NULL,col.axis=\"black\",cex.axis=1, cex.ticks=1, align.labels=TRUE,show.grid=FALSE,col.grid=\"gray\",lty.grid=par(\"lty\"), cc.axes=FALSE,show.legend=FALSE,label.points=FALSE,point.labels=NULL, col.symbols=\"black\",pch=par(\"pch\"),mar=c(5,2,4,2),no.add=TRUE,...)"},{"path":"/reference/triax.plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Triangle plot — triax.plot","text":"x Matrix row three proportions percentages must sum 1 100 respectively. main title triangle plot. Defaults nothing. tick positions three axes. axis.labels Labels three axes order left, right, bottom. Defaults column names. tick.labels tick labels three axes list three components l, r b (left, right bottom). Defaults argument (proportions). col.axis Color triangular axes, ticks labels. cex.axis Character expansion axis labels. cex.ticks Character expansion tick labels. align.labels Logical - whether align axis tick labels axes. show.grid Whether display grid lines ticks. col.grid Color grid lines. Defaults gray. lty.grid Type line grid. cc.axes Whether axes axis ticks clockwise counterclockwise. show.legend Logical - whether display legend. label.points Logical - whether call thigmophobe.labels label points. point.labels Optional labels points /legend. col.symbols Color symbols representing value. pch Symbols use plotting values. mar Margins triangle plot. .add Whether restore previous plotting parameters (TRUE) leave , allowing points added. ... Additional arguments passed points.","code":""},{"path":"/reference/triax.plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Triangle plot — triax.plot","text":"triax.plot displays triangular plot area proportions percentages displayed. grid legend may also displayed.","code":""},{"path":"/reference/triax.plot.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Triangle plot — triax.plot","text":"three axis plot can properly display one sets three proportions sum 1 (percentages sum 100). values may scaled proportions (percentages), unless set three sums 1 (100), plot properly triax.points complain appropriately. Note also triax.plot display properly square plot, forced par(pty=\"s\"). case user want plot values different sums, axis tick labels can set different ranges accomodate . triax.points still complain, plot values. planning add points triax.points call triax.plot .add=FALSE restore plotting parameters points added.","code":""},{"path":"/reference/triax.plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Triangle plot — triax.plot","text":"list containing xypos (x,y positions plotted) oldpar (plotting parameters time triax.plot called).","code":""},{"path":"/reference/triax.plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Triangle plot — triax.plot","text":"Jim Lemon - thanks Ben Daughtry info counterclockwise axes.","code":""},{"path":[]},{"path":"/reference/triax.plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Triangle plot — triax.plot","text":"","code":"data(soils) triax.plot(soils[1:10,],main=\"DEFAULT\") triax.plot(soils[1:10,],main=\"PERCENTAGES (Counterclockwise axes)\", tick.labels=list(l=seq(10,90,by=10),r=seq(10,90,by=10),b=seq(10,90,by=10)), pch=3,cc.axes=TRUE) triax.return<-triax.plot(soils[1:6,],main=\"GRID AND LEGEND\", show.grid=TRUE,show.legend=TRUE,col.symbols=1:6,pch=4) # triax.plot changes a few parameters par(triax.return$oldpar)"},{"path":"/reference/triax.points.html","id":null,"dir":"Reference","previous_headings":"","what":"Triangle plot points — triax.points","title":"Triangle plot points — triax.points","text":"Display points triangle plot.","code":""},{"path":"/reference/triax.points.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Triangle plot points — triax.points","text":"","code":"triax.points(x,show.legend=FALSE,label.points=FALSE, point.labels=NULL,col.symbols=par(\"fg\"),pch=par(\"pch\"), bg.symbols=par(\"bg\"),cc.axes=FALSE,...)"},{"path":"/reference/triax.points.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Triangle plot points — triax.points","text":"x Matrix data frame row three proportions percentages must sum 1 100 respectively. show.legend Logical - whether display legend. label.points Logical - whether call thigmophobe.labels label points. point.labels Optional labels points /legend. col.symbols Color symbols representing value. pch Symbols use plotting values. bg.symbols Background color plotting symbols. cc.axes Clockwise counterclockwise axes ticks. ... Additional arguments passed points.","code":""},{"path":"/reference/triax.points.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Triangle plot points — triax.points","text":"order triax.points add points existing plot, argument .add initial call triax.plot must set FALSE. Failing result points plotted wrong places. user call par example restore plotting parameters altered triangle plot. triax.points displays triplet proportions percentages symbol triangle plot. Unless triplet sums 1 (100), plot properly triax.points complain appropriately.","code":""},{"path":"/reference/triax.points.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Triangle plot points — triax.points","text":"list x,y positions plotted.","code":""},{"path":"/reference/triax.points.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Triangle plot points — triax.points","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/triax.points.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Triangle plot points — triax.points","text":"","code":"data(soils) triax.return<-triax.plot(soils[1:10,], main=\"Adding points to a triangle plot\",no.add=FALSE) triax.points(soils[11:20,],col.symbols=\"green\",pch=3) par(triax.return$oldpar)"},{"path":"/reference/tsxpos.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate equispaced x positions. — tsxpos","title":"Calculate equispaced x positions. — tsxpos","text":"Calculate equispaced x positions values plotted plot command.","code":""},{"path":"/reference/tsxpos.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate equispaced x positions. — tsxpos","text":"","code":"tsxpos(x,xlim,nint)"},{"path":"/reference/tsxpos.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate equispaced x positions. — tsxpos","text":"x vector numeric values time series object created ts function. xlim Explicit x limits x positions. nint number intervals x positions.","code":""},{"path":"/reference/tsxpos.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate equispaced x positions. — tsxpos","text":"tsxpos calculates equispaced x positions vector values time series created ts command stats package. assumes default x limits used existing plot. adds appropriate padding par(\"xaxs\") \"r\". mainly useful x axis labels markers added time series plot. plot device must open. user wishes specify explicit x limits number intervals (values), override calculations x values.","code":""},{"path":"/reference/tsxpos.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate equispaced x positions. — tsxpos","text":"calculated x positions user units.","code":""},{"path":"/reference/tsxpos.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate equispaced x positions. — tsxpos","text":"Jim Lemon (thanks Prof J.C. Nash idea)","code":""},{"path":"/reference/tsxpos.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate equispaced x positions. — tsxpos","text":"","code":"# create a vector of numbers y<-rnorm(28) par(mfrow=c(2,1),mar=c(6,4,4,2)) plot(y,main=\"Plot of the values\") # convert it into a time series object yt<-ts(y,start=2011,frequency=12) # don't use the default axis plot(yt,main=\"Plot of the time series\",xaxt=\"n\",xlab=\"Month\") labelpos<-tsxpos(yt) # display an axis showing the months only staxlab(1,labelpos,rep(month.abb,length.out=28)) par(mfrow=c(1,1),mar=c(5,4,4,2))"},{"path":"/reference/twoord.plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot with two ordinates — twoord.plot","title":"Plot with two ordinates — twoord.plot","text":"Two sets values displayed plot different ordinate scales left right.","code":""},{"path":"/reference/twoord.plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot with two ordinates — twoord.plot","text":"","code":"twoord.plot(lx,ly,rx,ry,data=NULL,main=\"\",xlim=NULL,lylim=NULL,rylim=NULL, mar=c(5,4,4,4),lcol=1,rcol=2,xlab=\"\",lytickpos=NA,ylab=\"\",ylab.at=NA, rytickpos=NA,rylab=\"\",rylab.at=NA,lpch=1,rpch=2, type=\"b\",xtickpos=NULL,xticklab=NULL,halfwidth=0.4,axislab.cex=1, do.first=NULL,xaxt=\"s\",...)"},{"path":"/reference/twoord.plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot with two ordinates — twoord.plot","text":"lx,ly,rx,ry y optional x values plot data optional data frame obtain values main Title plot xlim optional x limits plot lylim,rylim optional y limits left right axes respectively mar optional margin adjustment, defaults c(5,4,4,4) lcol,rcol colors distinguish two sets values xlab X axis label plot lytickpos Optional positions left axis tick labels. ylab Left Y axis label plot ylab.Optional position left Y axis label rytickpos Optional positions right axis tick labels. rylab Right Y axis label rylab.Optional position right Y axis label lpch,rpch plot symbols distinguish two sets values type plot xtickpos Optional positions x-axis tick labels. xticklab Optional labels x-axis. Useful things like dates. halfwidth Half width bars user units. bars centered successive integers x values supplied. axislab.cex Character expansion axis labels tick labels. .first Optional command(s) executed immediately blank plot displayed. xaxt Whether display x-axis - \"n\" = . ... additional arguments passed plot points.","code":""},{"path":"/reference/twoord.plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot with two ordinates — twoord.plot","text":"nil","code":""},{"path":"/reference/twoord.plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot with two ordinates — twoord.plot","text":"twoord.plot automates process displaying two sets values different ranges plot. principally useful illustrating relationship values across observations. assumed lx rx values least adjacent, probably overlapping. best pass arguments lx, ly, rx, ry, function attempt substitute sensible x values one two missing. least one type arguments \"bar\", bars plotted instead points lines. best plot bars first (.e. relative left axis) type points lines, bars usually obscure least points lines. Using NA color bars partially correct . types bars, remember pass somewhat different x values bars overplotted. Note values can added plot using points lines, remember plotted relative left ordinate. .first argument useful adding background color grid plot shown first two examples.","code":""},{"path":"/reference/twoord.plot.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Plot with two ordinates — twoord.plot","text":"many objections use plots two different ordinate scales, even sensible supported controlled observation. Many objections rest assertions spatial arrangement values plotted override evidence. two: viewer assume vertical position data points indicates quantitative relationship. extent. probably good idea spatial relationship points opposed numerical relationship. say, one set values range 0-10 20-100, best arrange plot latter values plotted former. See second example, illustrates method separating two series offsetting axes. viewer assume intersection lines indicates intersection values. visual elements representing values can arranged avoid intersections, much better. Many people trouble distinguishing visual elements linked axis long coded similarly, usually colors /symbols. special case underlying relationship two probability value occurring conditions, may help mark point(s) occurs. may useful consider gap.plot separate plots alternative.","code":""},{"path":"/reference/twoord.plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot with two ordinates — twoord.plot","text":"Jim Lemon (thanks Christophe Dutang idea using bars lines plot, Clair Crossupton pointing dates x-axis good, Jacob Kasper axis character expansion Ye Lin finally motivating add .first argument.)","code":""},{"path":[]},{"path":"/reference/twoord.plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot with two ordinates — twoord.plot","text":"","code":"xval1 <- seq.Date(as.Date(\"2017-01-02\"), as.Date(\"2017-01-10\"), by=\"day\") xval2 <- seq.Date(as.Date(\"2017-01-01\"), as.Date(\"2017-01-15\"), by=\"day\") going_up<-seq(3,7,by=0.5)+rnorm(9) going_down<-rev(60:74)+rnorm(15) twoord.plot(2:10,going_up,1:15,going_down,xlab=\"Sequence\", ylab=\"Ascending values\",rylab=\"Descending values\",lcol=4, main=\"Plot with two ordinates - points and lines\", do.first=\"plot_bg();grid(col=\\\"white\\\",lty=1)\") axis.Date(1,xval2) # now separate the lines twoord.plot(2:10,going_up,1:15,going_down,xlab=\"Sequence\", lylim=range(going_up)+c(-1,10),rylim=range(going_down)+c(-10,2), ylab=\"Ascending values\",ylab.at=5,rylab=\"Descending values\", rylab.at=65,lcol=4,main=\"Plot with two ordinates - separated lines\", lytickpos=3:7,rytickpos=seq(55,75,by=5), do.first=\"plot_bg();grid(col=\\\"white\\\",lty=1)\") twoord.plot(2:10,going_up,1:15,going_down,xlab=\"Sequence\", lylim=range(going_up)+c(-1,10),rylim=range(going_down)+c(-10,2), type=c(\"bar\",\"l\"),ylab=\"Ascending values\",ylab.at=5, rylab=\"Descending values\",rylab.at=65, main=\"Bars on left axis, lines on right axis\", lytickpos=3:7,rytickpos=seq(55,75,by=5), lcol=3,rcol=4,do.first=\"plot_bg()\") twoord.plot(2:10,going_up,1:15,going_down,xlab=\"Sequence\", lylim=c(-3,8),rylim=c(50,100),type=c(\"l\",\"bar\"), ylab=\"Ascending values\",rylab=\"Descending values\", lytickpos=3:7,rytickpos=seq(55,75,by=5),ylab.at=5,rylab.at=65, main=\"Lines on left axis, bars on right axis\", lcol=3,rcol=4,do.first=\"plot_bg(\\\"yellow\\\")\") # histogram with density curve superimposed xhist<-hist(rnorm(100),plot=FALSE) xdens<-dnorm(seq(-3,3,by=0.05)) twoord.plot(xhist$mids,xhist$counts,seq(-3,3,by=0.05), xdens,type=c(\"bar\",\"l\"),lcol=4,rcol=2,ylab=\"Counts\", rylab=\"Density\",main=\"Histogram and density curve\", halfwidth=0.2,lylim=c(0,max(xhist$counts)+1),rylim=c(0,0.45),lwd=2)"},{"path":"/reference/twoord.stackplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Multiple (stack) plot with two ordinates — twoord.stackplot","title":"Multiple (stack) plot with two ordinates — twoord.stackplot","text":"Two set data plotted two different ordinate scales.","code":""},{"path":"/reference/twoord.stackplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multiple (stack) plot with two ordinates — twoord.stackplot","text":"","code":"twoord.stackplot(lx, rx, ldata, rdata, lcol, rcol, ltype, rtype, border, rylab, lylab, xlab, ..., incrylim=NULL, halfwidth=0.4, leftfront=FALSE, mar = c(5, 4, 4, 4))"},{"path":"/reference/twoord.stackplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multiple (stack) plot with two ordinates — twoord.stackplot","text":"lx,rx x-values left/right data. ldata,rdata data left/right y-axes. lcol, rcol colors used left/right data. ltype, rtype line types used left/right data, see details. border color border barplot rylab,lylab labels left/right y-axes. xlab labels x-axis. ... arguments passed plot. incrylim number increase limits y-axes. halfwidth half width bars user units. \tbars centered successive integers x values supplied leftfront TRUE, plot left data front layer. mar optional margin adjustment, defaults c(5,4,4,4).","code":""},{"path":"/reference/twoord.stackplot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Multiple (stack) plot with two ordinates — twoord.stackplot","text":"twoord.stackplot works way twoord.plot heavily inspired. functions let user plot multiple curve/point bar plots graph two different axes. line type can one following \"l\" lines, \"p\" points, \"b\" points line, \"o\" overplotted, \"bar\" barplot.","code":""},{"path":"/reference/twoord.stackplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Multiple (stack) plot with two ordinates — twoord.stackplot","text":"nil","code":""},{"path":[]},{"path":"/reference/twoord.stackplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Multiple (stack) plot with two ordinates — twoord.stackplot","text":"Christophe Dutang","code":""},{"path":"/reference/twoord.stackplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Multiple (stack) plot with two ordinates — twoord.stackplot","text":"","code":"# plot data # time <- 0:25 A <- 1+1/2*sin(time/2) B <- A + rnorm(length(A), sd=1/10) B <- B + rnorm(length(A), sd=1/10) sizeA <- floor(450*(1 + 1/4*sin(time/2+2))*(1+.1)) sizeB <- 1000-sizeA C <- (A*sizeA + B*sizeB)/(sizeA+sizeB) #typical usage # twoord.stackplot(lx=time, rx=time, ldata=cbind(sizeA, sizeB), rdata=cbind(A, B, C), lcol=c(\"grey80\", \"white\"), rcol=c(\"blue\", \"red\",\"black\"), ltype=\"bar\", rtype=c(\"l\",\"p\",\"o\"), border=\"grey80\", lylab=\"Size\", rylab=\"A,B,C\", xlab=\"Time\", main=\"a plot\", incrylim=2/100) #add a legend # par(xpd=TRUE) #extend the area of plotting par(new=TRUE) #to add new graph \"layers\" plot(0:1, 0:1, type=\"n\", xlab=\"\",ylab=\"\", axes=FALSE) #redo the x/y limits #first legend legend(-0.18, 1.2, leg=c(\"Size A\", \"Size B\"), fill=c(\"grey80\", \"white\")) #second legend legend(.97, -0.08, leg=c(\"A\", \"B\", \"C\"), col=c(\"blue\", \"red\",\"black\"), pch=c(NA, 19, 19), lty=c(1,NA,1)) par(xpd=FALSE, new=FALSE) #default setting #reverse the order of plotting twoord.stackplot(lx=time, rx=time, ldata=cbind(sizeA, sizeB), rdata=cbind(A, B, C), lcol=c(\"grey80\", \"white\"), rcol=c(\"blue\", \"red\",\"black\"), ltype=\"bar\", rtype=c(\"l\",\"p\",\"o\"), border=\"grey80\", lylab=\"Size\", rylab=\"A,B,C\", xlab=\"Time\", main=\"a plot\", incrylim=2/100, leftfront=TRUE)"},{"path":"/reference/valid.n.html","id":null,"dir":"Reference","previous_headings":"","what":"Find the number of valid (not NA) values — valid.n","title":"Find the number of valid (not NA) values — valid.n","text":"Finds number valid (NA) total values object.","code":""},{"path":"/reference/valid.n.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find the number of valid (not NA) values — valid.n","text":"","code":"valid.n(x,na.rm=TRUE)"},{"path":"/reference/valid.n.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find the number of valid (not NA) values — valid.n","text":"x object. na.rm Whether count values (FALSE) NA.","code":""},{"path":"/reference/valid.n.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find the number of valid (not NA) values — valid.n","text":"valid.n finds number valid values object na.rm=TRUE.","code":""},{"path":"/reference/valid.n.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find the number of valid (not NA) values — valid.n","text":"number valid values length object.","code":""},{"path":"/reference/valid.n.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find the number of valid (not NA) values — valid.n","text":"Jim Lemon","code":""},{"path":"/reference/vectorField.html","id":null,"dir":"Reference","previous_headings":"","what":"Display magnitude/direction vectors — vectorField","title":"Display magnitude/direction vectors — vectorField","text":"Display magnitude/direction vectors arrows existing plot.","code":""},{"path":"/reference/vectorField.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display magnitude/direction vectors — vectorField","text":"","code":"vectorField(u,v,xpos=NA,ypos=NA,scale=1,headspan=0.1, vecspec=c(\"lonlat\",\"rad\",\"deg\"),col=par(\"fg\"))"},{"path":"/reference/vectorField.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display magnitude/direction vectors — vectorField","text":"u,v x (longitude) y (latitude) offsets orientation magnitude either radians degrees. See details. xpos,ypos centers vectors user units. scale proportion cell maximal vector fill. See details. headspan extent heads arrows proportion cell size. vecspec vectors described. See details col Color(s) arrows.","code":""},{"path":"/reference/vectorField.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display magnitude/direction vectors — vectorField","text":"nil","code":""},{"path":"/reference/vectorField.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display magnitude/direction vectors — vectorField","text":"vectorField displays arrows existing plot. arrow specified position plot xpos,ypos either x/y offsets orientation magnitude. default x/y offsets, user must specify whether radians degrees used orientation/magnitude option used. first four arguments matrices, must missing values. arguments vectors, calculation scaling magnitudes length arrowheads may slightly different.","code":""},{"path":"/reference/vectorField.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display magnitude/direction vectors — vectorField","text":"Jim Lemon (original code Robin Hankin Brian Ripley)","code":""},{"path":[]},{"path":"/reference/vectorField.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display magnitude/direction vectors — vectorField","text":"","code":"if (FALSE) { # \\dontrun{ # this requires the maps package, and just wouldn't pass check require(maps) map(\"world\",xlim=c(110,155),ylim=c(-40,-10)) par(xpd=TRUE) text(132,-5,\"Approximate magnetic deviation - Australia\",cex=1.5) par(xpd=FALSE) long<-rep(seq(117.5,152.5,by=5),6) lat<-rep(c(-12.5,-17.5,-22.5,-27.5,-32.5,-37.5),each=8) # just show the direction, don't have a magnitude difference mag<-rep(1,48) devdeg<-c(110,98,85,65,65,65,65,65, 115,100,90,80,72,66,63,55, 130,100,90,82,72,67,62,54, 122,111,95,86,70,67,56,48, 118,116,110,87,74,68,62,45, 128,115,107,90,78,66,53,45) vectorField(devdeg,mag,long,lat,scale=0.7,vecspec=\"deg\") } # } # do a magnitude/direction plot with radians plot(1:10,type=\"n\",main=\"Random vectors\") mag<-runif(100)+1 dir<-runif(100)*2*pi xpos<-rep(1:10,10) ypos<-rep(1:10,each=10) vectorcol<-sample(colors(),100) vectorField(dir,mag,xpos,ypos,scale=0.8,vecspec=\"rad\",col=vectorcol)"},{"path":"/reference/violin_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a ","title":"Display a ","text":"Displays violin plots (rotated kernel density plots side boxplots).","code":""},{"path":"/reference/violin_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a ","text":"","code":"violin_plot(X=rnorm(50),at,add=FALSE,na.rm=TRUE,bw,violin_width, violin_end_width=0.005,equal_width=TRUE,show_box=TRUE,box_width=0.01, box_col=\"black\",show_outliers=TRUE,outlier_pch=NA,range=1.5,xlim,ylim, axes=TRUE,ann=TRUE,xlab=\"\",ylab=\"\",x_axis_labels,main=\"Violin Plot\", col=\"red\",median_col=\"white\",show_mean=FALSE,mean_pch=19, mean_pch_col=\"yellow\",...)"},{"path":"/reference/violin_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a ","text":"X vector matrix data frame numeric values. Horizontal position(s) violin plot(s). add Whether violin added existing plot. na.rm Remove NA values. Passed functions boxplot density. bw Vector bandwidth values density. recycled. provided calculated using bw.nrd0. violin_width Multiplier scale width violin. violin_end_width Multiplier scale width ends violin. equal_width violin widths equal? show_box Whether display box. box_width Multiplier width internal boxes. box_col Fill color internal rectangle. show_outliers Whther display outliers points. outlier_pch Symbol displaying outliers. range Passed boxplot. xlim,ylim Explicitly set plot limits. axes Logical value indicating whether axes drawn plot. ann Annotate plots axis titles overall titles. xlab,ylab Labels X Y axes. x_axis_labels Labels violins. main Title violin plot. col Fill color violin(s). recycled. median_col Fill color median mark. show_mean Whether plot mean well median. mean_pch Symbol use mean. mean_pch_col Fill color mean symbol. ... Extra arguments passed polygon used representing violin(s).","code":""},{"path":"/reference/violin_plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a ","text":"violin_plot displays one violin plots drawing rotated kernel density curves side box plots.","code":""},{"path":"/reference/violin_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a ","text":"nil","code":""},{"path":"/reference/violin_plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a ","text":"Darshan Baral","code":""},{"path":"/reference/violin_plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a ","text":"","code":"# plotting a data frame violin_plot(mtcars) set.seed(42) normvar<-c(rnorm(49),-3) unifvar<-runif(50,-2,2) normvar2<-rnorm(45) # plotting a matrix violin_plot(matrix(c(normvar,unifvar),ncol=2), main=\"Default Plot\",x_axis_labels=c(\"Normal\",\"Uniform\")) # plotting with different colors and with at specified violin_plot(matrix(c(normvar,unifvar),ncol=2),at=1:3, main=\"Different colors and extra space\", x_axis_labels=c(\"Normal\",\"Uniform\",\"Normal\"), show_outliers=TRUE,col=c(\"blue\",\"red\"),median_col=\"lightgray\", pch=6) # adding a violin to existing plot violin_plot(normvar2,at=3,add=TRUE,col=\"green\",violin_width=1)"},{"path":"/reference/weighted.hist.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a weighted histogram — weighted.hist","title":"Display a weighted histogram — weighted.hist","text":"Calculate counts weighted values specified bins optionally display either frequency density histogram.","code":""},{"path":"/reference/weighted.hist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a weighted histogram — weighted.hist","text":"","code":"weighted.hist(x,w,breaks=\"Sturges\",col=NULL,plot=TRUE, freq=TRUE,ylim=NA,ylab=NULL,xaxis=TRUE,...)"},{"path":"/reference/weighted.hist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a weighted histogram — weighted.hist","text":"x vector numeric values w vector weights least long x. breaks endpoints ranges count weighted values. col optional vector colors bars histogram. plot Whether plot histogram. freq Whether plot counts densities. ylim limits plot ordinate. ylab Label ordinate. xaxis Whether display X axis. ... additional arguments passed barplot.","code":""},{"path":"/reference/weighted.hist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a weighted histogram — weighted.hist","text":"weighted.hist calculates weighted counts values falling ranges specified breaks. Instead counting value 1, counts corresponding value w (weight). breaks may specified monotonically increasing vector numbers interpreted endpoints ranges, single number representing number ranges desired name function calculate ranges (see hist). vector numbers passed include values x, user warned.","code":""},{"path":"/reference/weighted.hist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a weighted histogram — weighted.hist","text":"list containing: breaks - endpoints intervals counts - weighted counts density - weighted counts divided sum. mids - midpoints intervals bars displayed. xname - name x.","code":""},{"path":"/reference/weighted.hist.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a weighted histogram — weighted.hist","text":"Jim Lemon Hadley Wickham - thanks Ben Graf asking custom x axis option Martin Maechler fixing barplot problem","code":""},{"path":[]},{"path":"/reference/weighted.hist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a weighted histogram — weighted.hist","text":"","code":"testx<-sample(1:10,300,TRUE) testw<-seq(1,4,by=0.01) weighted.hist(testx,testw,breaks=1:10,main=\"Test weighted histogram\")"},{"path":"/reference/zoomInPlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Display a plot with a rectangular section expanded in an adjacent plot — zoomInPlot","title":"Display a plot with a rectangular section expanded in an adjacent plot — zoomInPlot","text":"Display one plot left half device expanded section plot right half device connecting lines showing expansion.","code":""},{"path":"/reference/zoomInPlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display a plot with a rectangular section expanded in an adjacent plot — zoomInPlot","text":"","code":"zoomInPlot(x,y=NULL,xlim=NULL,ylim=NULL,rxlim=xlim,rylim=ylim,xend=NA, zoomtitle=NULL,titlepos=NA,...)"},{"path":"/reference/zoomInPlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display a plot with a rectangular section expanded in an adjacent plot — zoomInPlot","text":"x,y numeric data vectors. y specified, set equal x x set 1:length(y). xlim,ylim Limits initial plot. rxlim,rylim Limits expanded plot. must within . xend end segments indicate expansion. Defaults just left tick labels left ordinate. zoomtitle title plot, display top center. titlepos horizontal position title user units zoomed plot. ... additional arguments passed plot.","code":""},{"path":"/reference/zoomInPlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Display a plot with a rectangular section expanded in an adjacent plot — zoomInPlot","text":"zoomInPlot sets two column layout current device calls plot display plot left column. draws rectangle corresponding rxlim rylim arguments displays second plot rectangle right column. currently simple probably become flexible future versions. just . rxlim set NA, locator called user can define zoomed rectangle clicking corner. shameless ripoff suggestion Greg Snow help list. Thanks, Greg.","code":""},{"path":"/reference/zoomInPlot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display a plot with a rectangular section expanded in an adjacent plot — zoomInPlot","text":"nil","code":""},{"path":"/reference/zoomInPlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Display a plot with a rectangular section expanded in an adjacent plot — zoomInPlot","text":"Jim Lemon","code":""},{"path":[]},{"path":"/reference/zoomInPlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Display a plot with a rectangular section expanded in an adjacent plot — zoomInPlot","text":"","code":"zoomInPlot(rnorm(100),rnorm(100),rxlim=c(-1,1),rylim=c(-1,1), zoomtitle=\"Zoom In Plot\",titlepos=-1.5)"}] diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..5e6160b --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,171 @@ + +/404.html +/authors.html +/index.html +/reference/ablineclip.html +/reference/add.ps.html +/reference/addtable2plot.html +/reference/arctext.html +/reference/axis.break.html +/reference/axis.mult.html +/reference/barNest.html +/reference/barlabels.html +/reference/barp.html +/reference/battleship.plot.html +/reference/bin.wind.records.html +/reference/binciW.html +/reference/binciWl.html +/reference/binciWu.html +/reference/box.heresy.html +/reference/boxed.labels.html +/reference/brkdn.plot.html +/reference/brkdnNest.html +/reference/bumpchart.html +/reference/categoryReshape.html +/reference/centipede.plot.html +/reference/clean.args.html +/reference/clock24.plot.html +/reference/clplot.html +/reference/cluster.overplot.html +/reference/clustered.dotplots.html +/reference/color.axis.html +/reference/color.gradient.html +/reference/color.id.html +/reference/color.legend.html +/reference/color.scale.html +/reference/color.scale.lines.html +/reference/color2D.matplot.html +/reference/corner.label.html +/reference/count.overplot.html +/reference/cylindrect.html +/reference/death_reg.html +/reference/dendroPlot.html +/reference/densityGrid.html +/reference/diamondplot.html +/reference/dispersion.html +/reference/do.first.html +/reference/dotplot.mtb.html +/reference/draw.arc.html +/reference/draw.circle.html +/reference/draw.ellipse.html +/reference/draw.radial.line.html +/reference/draw.tilted.sector.html +/reference/drawNestedBars.html +/reference/drawSectorAnnulus.html +/reference/ehplot.html +/reference/election.html +/reference/emptyspace.html +/reference/fan.plot.html +/reference/feather.plot.html +/reference/fill.corner.html +/reference/find_max_cell.html +/reference/floating.pie.html +/reference/fullaxis.html +/reference/gantt.chart.html +/reference/gap.barplot.html +/reference/gap.boxplot.html +/reference/gap.plot.html +/reference/gap_barp.html +/reference/get.breaks.html +/reference/get.gantt.info.html +/reference/get.segs.html +/reference/get.soil.texture.html +/reference/get.tablepos.html +/reference/get.triprop.html +/reference/getFigCtr.html +/reference/getIntersectList.html +/reference/getMarginWidth.html +/reference/getYmult.html +/reference/get_axispos3d.html +/reference/gradient.rect.html +/reference/hexagon.html +/reference/histStack.html +/reference/index.html +/reference/intersectDiagram.html +/reference/jiggle.html +/reference/joyPlot.html +/reference/kiteChart.html +/reference/l2010.html +/reference/labbePlot.html +/reference/ladderplot.html +/reference/legendg.html +/reference/lengthKey.html +/reference/makeDensityMatrix.html +/reference/makeIntersectList.html +/reference/maxEmptyRect.html +/reference/mtext3d.html +/reference/multhist.html +/reference/multivari.html +/reference/multsymbolbox.html +/reference/oz.windrose.html +/reference/oz.windrose.legend.html +/reference/p2p_arrows.html +/reference/panes.html +/reference/pasteCols.html +/reference/paxis3d.html +/reference/perspx.html +/reference/pie.labels.html +/reference/pie3D.html +/reference/pie3D.labels.html +/reference/placeLabels.html +/reference/plotCI.html +/reference/plotH.html +/reference/plot_bg.html +/reference/plotrix-package.html +/reference/polar.plot.html +/reference/polygon.shadow.html +/reference/print.brklist.html +/reference/propbrk.html +/reference/psegments3d.html +/reference/ptext3d.html +/reference/pyramid.plot.html +/reference/radial.grid.html +/reference/radial.pie.html +/reference/radial.plot.html +/reference/radial.plot.labels.html +/reference/radialtext.html +/reference/raw.means.plot.html +/reference/rectFill.html +/reference/rescale.html +/reference/revaxis.html +/reference/ruginv.html +/reference/seats.html +/reference/size_n_color.html +/reference/sizeplot.html +/reference/sizetree.html +/reference/sliceArray.html +/reference/smoothColors.html +/reference/soil.texture.html +/reference/soil.texture.uk.html +/reference/soils.html +/reference/spread.labels.html +/reference/spreadout.html +/reference/stackpoly.html +/reference/staircase.plot.html +/reference/staircasePlot.html +/reference/starPie.html +/reference/staxlab.html +/reference/std.error.html +/reference/sumbrk.html +/reference/symbolbarplot.html +/reference/symbolbox.html +/reference/tab.title.html +/reference/taylor.diagram.html +/reference/textbox.html +/reference/thigmophobe.html +/reference/thigmophobe.labels.html +/reference/triax.abline.html +/reference/triax.fill.html +/reference/triax.frame.html +/reference/triax.plot.html +/reference/triax.points.html +/reference/tsxpos.html +/reference/twoord.plot.html +/reference/twoord.stackplot.html +/reference/valid.n.html +/reference/vectorField.html +/reference/violin_plot.html +/reference/weighted.hist.html +/reference/zoomInPlot.html + +