diff --git a/.Rbuildignore b/.Rbuildignore index 4d76716..4c2a16e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -4,6 +4,7 @@ # ----- Git ----- ^.gitignore$ +^\.github$ # ----- devtools ----- ^revdep$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..c9f0165 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,50 @@ +# 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 + +permissions: read-all + +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@v4 + + - 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.5.0 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.gitignore b/.gitignore index 477daf2..c7997bf 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ man revdep pkgdown CRAN-RELEASE +docs diff --git a/DESCRIPTION b/DESCRIPTION index 7e415a6..01aaef9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,9 +1,16 @@ +Type: Package Package: desplot Title: Plotting Field Plans for Agricultural Experiments Version: 1.10 -Authors@R: person("Kevin","Wright", email="kw.stat@gmail.com", comment=c(ORCID = "0000-0002-0617-8673"), role=c("aut","cre","cph")) -Type: Package -Description: A function for plotting maps of agricultural field experiments that are laid out in grids. See Ryder (1981) . +Authors@R: + person("Kevin", "Wright", , "kw.stat@gmail.com", role = c("aut", "cre", "cph"), + comment = c(ORCID = "0000-0002-0617-8673")) +Description: A function for plotting maps of agricultural field + experiments that are laid out in grids. See Ryder (1981) + . +License: MIT + file LICENSE +URL: https://kwstat.github.io/desplot/, http://kwstat.github.io/desplot/ +BugReports: https://github.com/kwstat/desplot/issues Imports: ggplot2, grid, @@ -15,11 +22,8 @@ Suggests: knitr, rmarkdown, testthat -License: MIT + file LICENSE -URL: https://kwstat.github.io/desplot/ -BugReports: https://github.com/kwstat/desplot/issues VignetteBuilder: knitr -RoxygenNote: 7.2.2 Encoding: UTF-8 Language: en-US +RoxygenNote: 7.3.2 diff --git a/NEWS.md b/NEWS.md index f67bce3..485cb89 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,60 +2,61 @@ * Switch to MIT license. -# desplot 1.10 - Mar 2023 +# desplot 1.10 (2023-03-01) * One-row panels no longer have whitespace. Issue #9. * Replace `aes_string(x=x.string)` with `aes(x=.data[[x.string]])` etc. -# desplot 1.9 - Oct 2021 + +# desplot 1.9 (2021-10-30) * Tweaks to `ggdesplot` output. * Remove LazyData from DESCRIPTION. -# desplot 1.8 - Oct 2020 +# desplot 1.8 (2020-10-21) * Bug fix for `dq` with multiple panels. * Use `inherits` to check class #4. -# desplot 1.7 - Jul 2020 +# desplot 1.7 (2020-07-20) * Please use `desplot(data,formula)` instead of `desplot(formula,data)`. -# desplot 1.6 - Sep 2019 +# desplot 1.6 (2019-09-13) * New argument `dq` for showing data quality on heatmaps. -# desplot 1.5 - Apr 2019 +# desplot 1.5 (2019-04-04) * Beta version of `ggdesplot()` to create `ggplot2` graphics. * New argument `subset` to subset data before analysis. -# desplot 1.3 - Oct 2017 +# desplot 1.3 (2017-10-13) * Bug fix. -# desplot 1.2 - Jul 2017 +# desplot 1.2 (2017-07-13) * Now using `testthat` and `covr` packages. -# desplot 1.1 - Dec 2016 +# desplot 1.1 (2016-12-18) -* New function argument `midpoint="median"` uses the median to determine the midpoint for the ribbon. Previously, the midpoint was halfway between the minimum and maximum data values. Use `midpoint=NULL` or `midpoint="midrange"` to restore the old behavior. +* New function argument `midpoint="median"` uses the median to determine the midpoint for the ribbon. Previously, the midpoint was halfway between the minimum and maximum data values. -# desplot 1.0 - Dec 2015 +# desplot 1.0 (2015-12-14) * The `desplot` package has been split off from the `agridat` package. -# desplot 0.0 - 2008 +# desplot 0.0 (2008) * Original creation of function. diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..84a92fb --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,4 @@ +url: http://kwstat.github.io/desplot/ +template: + bootstrap: 5 + diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index 0cee7ac..0000000 --- a/docs/404.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - -Page not found (404) β€’ desplot - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
-
- - -Content not found. Please use links in the navbar. - -
- - - -
- - - -
- - -
-

Site built with pkgdown 1.6.1.

-
- -
-
- - - - - - - - diff --git a/docs/apple-touch-icon-120x120.png b/docs/apple-touch-icon-120x120.png deleted file mode 100644 index f95362b..0000000 Binary files a/docs/apple-touch-icon-120x120.png and /dev/null differ diff --git a/docs/apple-touch-icon-152x152.png b/docs/apple-touch-icon-152x152.png deleted file mode 100644 index 5dfb888..0000000 Binary files a/docs/apple-touch-icon-152x152.png and /dev/null differ diff --git a/docs/apple-touch-icon-60x60.png b/docs/apple-touch-icon-60x60.png deleted file mode 100644 index 22299d4..0000000 Binary files a/docs/apple-touch-icon-60x60.png and /dev/null differ diff --git a/docs/apple-touch-icon-76x76.png b/docs/apple-touch-icon-76x76.png deleted file mode 100644 index 539a1ba..0000000 Binary files a/docs/apple-touch-icon-76x76.png and /dev/null differ diff --git a/docs/apple-touch-icon.png b/docs/apple-touch-icon.png deleted file mode 100644 index 239fb23..0000000 Binary files a/docs/apple-touch-icon.png and /dev/null differ diff --git a/docs/articles/desplot_examples.html b/docs/articles/desplot_examples.html deleted file mode 100644 index 3c91e0a..0000000 --- a/docs/articles/desplot_examples.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - -Plotting field maps with the desplot package β€’ desplot - - - - - - - - - - - - - - - - - -
-
- - - - -
-
- - - - -
-

-Abstract

-

This short note shows how to plot a field map from an agricultural experiment and why that may be useful.

-
-
-

-R setup

-
library("knitr")
-knitr::opts_chunk$set(fig.align="center", fig.width=6, fig.height=6)
-options(width=90)
-
-

-Example 1

-

First, a plot of the experimental design of the oats data from Yates (1935).

-
library(agridat)
-library(desplot)
-data(yates.oats)
-# Older versions of agridat used x/y here instead of col/row
-if(is.element("x",names(yates.oats)))
-   yates.oats <- transform(yates.oats, col=x, row=y)
-desplot(yates.oats, block ~ col+row,
-        col=nitro, text=gen, cex=1, out1=block,
-        out2=gen, out2.gpar=list(col = "gray50", lwd = 1, lty = 1))
-

-
-
-

-Example 2

-

This next example is from Ryder (1981). Fit an ordinary RCB model with fixed effects for block and genotype. Plot a heatmap of the residuals.

-
library(agridat)
-library(desplot)
-data(ryder.groundnut)
-gnut <- ryder.groundnut
-m1 <- lm(dry ~ block + gen, gnut) # Standard RCB model
-gnut$res <- resid(m1)
-desplot(gnut, res ~ col + row, text=gen, cex=1,
-        main="ryder.groundnut residuals from RCB model")
-

Note the largest positive/negative residuals are adjacent to each other, perhaps caused by the original data values being swapped. Checking with experiment investigators (managers, data collectors, etc.) is recommended.

-
-
-

-References

-
-
-

Ryder, K. 1981. β€œField Plans: Why the Biometrician Finds Them Useful.” Experimental Agriculture 17: 243–56. https://doi.org/10.1017/S0014479700011601.

-
-
-

Yates, Frank. 1935. β€œComplex Experiments.” Journal of the Royal Statistical Society Suppl 2: 181–247. https://doi.org/10.2307/2983638.

-
-
-
-
-
- - - -
- - - -
- -
-

Site built with pkgdown 1.5.1.

-
- -
-
- - - - - - diff --git a/docs/articles/desplot_examples_files/accessible-code-block-0.0.1/empty-anchor.js b/docs/articles/desplot_examples_files/accessible-code-block-0.0.1/empty-anchor.js deleted file mode 100644 index ca349fd..0000000 --- a/docs/articles/desplot_examples_files/accessible-code-block-0.0.1/empty-anchor.js +++ /dev/null @@ -1,15 +0,0 @@ -// Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> -// v0.0.1 -// Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. - -document.addEventListener('DOMContentLoaded', function() { - const codeList = document.getElementsByClassName("sourceCode"); - for (var i = 0; i < codeList.length; i++) { - var linkList = codeList[i].getElementsByTagName('a'); - for (var j = 0; j < linkList.length; j++) { - if (linkList[j].innerHTML === "") { - linkList[j].setAttribute('aria-hidden', 'true'); - } - } - } -}); diff --git a/docs/articles/desplot_examples_files/figure-html/ryder-1.png b/docs/articles/desplot_examples_files/figure-html/ryder-1.png deleted file mode 100644 index 0521177..0000000 Binary files a/docs/articles/desplot_examples_files/figure-html/ryder-1.png and /dev/null differ diff --git a/docs/articles/desplot_examples_files/figure-html/yates-1.png b/docs/articles/desplot_examples_files/figure-html/yates-1.png deleted file mode 100644 index a9f5c42..0000000 Binary files a/docs/articles/desplot_examples_files/figure-html/yates-1.png and /dev/null differ diff --git a/docs/articles/index.html b/docs/articles/index.html deleted file mode 100644 index e357a51..0000000 --- a/docs/articles/index.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - -Articles β€’ desplot - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
-
- - -
-

All vignettes

-

- -
-
Plotting field maps with the desplot package
-
-
-
-
-
- - -
- - -
-

Site built with pkgdown 1.6.1.

-
- -
-
- - - - - - - - diff --git a/docs/authors.html b/docs/authors.html deleted file mode 100644 index 5f6eead..0000000 --- a/docs/authors.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - -Authors β€’ desplot - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
-
- - -
    -
  • -

    Kevin Wright. Author, maintainer. -

    -
  • -
- -
- -
- - - -
- - -
-

Site built with pkgdown 1.6.1.

-
- -
-
- - - - - - - - diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css deleted file mode 100644 index 5a85941..0000000 --- a/docs/bootstrap-toc.css +++ /dev/null @@ -1,60 +0,0 @@ -/*! - * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ - -/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ - -/* All levels of nav */ -nav[data-toggle='toc'] .nav > li > a { - display: block; - padding: 4px 20px; - font-size: 13px; - font-weight: 500; - color: #767676; -} -nav[data-toggle='toc'] .nav > li > a:hover, -nav[data-toggle='toc'] .nav > li > a:focus { - padding-left: 19px; - color: #563d7c; - text-decoration: none; - background-color: transparent; - border-left: 1px solid #563d7c; -} -nav[data-toggle='toc'] .nav > .active > a, -nav[data-toggle='toc'] .nav > .active:hover > a, -nav[data-toggle='toc'] .nav > .active:focus > a { - padding-left: 18px; - font-weight: bold; - color: #563d7c; - background-color: transparent; - border-left: 2px solid #563d7c; -} - -/* Nav: second level (shown on .active) */ -nav[data-toggle='toc'] .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} -nav[data-toggle='toc'] .nav .nav > li > a { - padding-top: 1px; - padding-bottom: 1px; - padding-left: 30px; - font-size: 12px; - font-weight: normal; -} -nav[data-toggle='toc'] .nav .nav > li > a:hover, -nav[data-toggle='toc'] .nav .nav > li > a:focus { - padding-left: 29px; -} -nav[data-toggle='toc'] .nav .nav > .active > a, -nav[data-toggle='toc'] .nav .nav > .active:hover > a, -nav[data-toggle='toc'] .nav .nav > .active:focus > a { - padding-left: 28px; - font-weight: 500; -} - -/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ -nav[data-toggle='toc'] .nav > .active > ul { - display: block; -} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js deleted file mode 100644 index 1cdd573..0000000 --- a/docs/bootstrap-toc.js +++ /dev/null @@ -1,159 +0,0 @@ -/*! - * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ -(function() { - 'use strict'; - - window.Toc = { - helpers: { - // return all matching elements in the set, or their descendants - findOrFilter: function($el, selector) { - // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ - // http://stackoverflow.com/a/12731439/358804 - var $descendants = $el.find(selector); - return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); - }, - - generateUniqueIdBase: function(el) { - var text = $(el).text(); - var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); - return anchor || el.tagName.toLowerCase(); - }, - - generateUniqueId: function(el) { - var anchorBase = this.generateUniqueIdBase(el); - for (var i = 0; ; i++) { - var anchor = anchorBase; - if (i > 0) { - // add suffix - anchor += '-' + i; - } - // check if ID already exists - if (!document.getElementById(anchor)) { - return anchor; - } - } - }, - - generateAnchor: function(el) { - if (el.id) { - return el.id; - } else { - var anchor = this.generateUniqueId(el); - el.id = anchor; - return anchor; - } - }, - - createNavList: function() { - return $(''); - }, - - createChildNavList: function($parent) { - var $childList = this.createNavList(); - $parent.append($childList); - return $childList; - }, - - generateNavEl: function(anchor, text) { - var $a = $(''); - $a.attr('href', '#' + anchor); - $a.text(text); - var $li = $('
  • '); - $li.append($a); - return $li; - }, - - generateNavItem: function(headingEl) { - var anchor = this.generateAnchor(headingEl); - var $heading = $(headingEl); - var text = $heading.data('toc-text') || $heading.text(); - return this.generateNavEl(anchor, text); - }, - - // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). - getTopLevel: function($scope) { - for (var i = 1; i <= 6; i++) { - var $headings = this.findOrFilter($scope, 'h' + i); - if ($headings.length > 1) { - return i; - } - } - - return 1; - }, - - // returns the elements for the top level, and the next below it - getHeadings: function($scope, topLevel) { - var topSelector = 'h' + topLevel; - - var secondaryLevel = topLevel + 1; - var secondarySelector = 'h' + secondaryLevel; - - return this.findOrFilter($scope, topSelector + ',' + secondarySelector); - }, - - getNavLevel: function(el) { - return parseInt(el.tagName.charAt(1), 10); - }, - - populateNav: function($topContext, topLevel, $headings) { - var $context = $topContext; - var $prevNav; - - var helpers = this; - $headings.each(function(i, el) { - var $newNav = helpers.generateNavItem(el); - var navLevel = helpers.getNavLevel(el); - - // determine the proper $context - if (navLevel === topLevel) { - // use top level - $context = $topContext; - } else if ($prevNav && $context === $topContext) { - // create a new level of the tree and switch to it - $context = helpers.createChildNavList($prevNav); - } // else use the current $context - - $context.append($newNav); - - $prevNav = $newNav; - }); - }, - - parseOps: function(arg) { - var opts; - if (arg.jquery) { - opts = { - $nav: arg - }; - } else { - opts = arg; - } - opts.$scope = opts.$scope || $(document.body); - return opts; - } - }, - - // accepts a jQuery object, or an options object - init: function(opts) { - opts = this.helpers.parseOps(opts); - - // ensure that the data attribute is in place for styling - opts.$nav.attr('data-toggle', 'toc'); - - var $topContext = this.helpers.createChildNavList(opts.$nav); - var topLevel = this.helpers.getTopLevel(opts.$scope); - var $headings = this.helpers.getHeadings(opts.$scope, topLevel); - this.helpers.populateNav($topContext, topLevel, $headings); - } - }; - - $(function() { - $('nav[data-toggle="toc"]').each(function(i, el) { - var $nav = $(el); - Toc.init($nav); - }); - }); -})(); diff --git a/docs/docsearch.css b/docs/docsearch.css deleted file mode 100644 index e5f1fe1..0000000 --- a/docs/docsearch.css +++ /dev/null @@ -1,148 +0,0 @@ -/* Docsearch -------------------------------------------------------------- */ -/* - Source: https://github.com/algolia/docsearch/ - License: MIT -*/ - -.algolia-autocomplete { - display: block; - -webkit-box-flex: 1; - -ms-flex: 1; - flex: 1 -} - -.algolia-autocomplete .ds-dropdown-menu { - width: 100%; - min-width: none; - max-width: none; - padding: .75rem 0; - background-color: #fff; - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, .1); - box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); -} - -@media (min-width:768px) { - .algolia-autocomplete .ds-dropdown-menu { - width: 175% - } -} - -.algolia-autocomplete .ds-dropdown-menu::before { - display: none -} - -.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { - padding: 0; - background-color: rgb(255,255,255); - border: 0; - max-height: 80vh; -} - -.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { - margin-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion { - padding: 0; - overflow: visible -} - -.algolia-autocomplete .algolia-docsearch-suggestion--category-header { - padding: .125rem 1rem; - margin-top: 0; - font-size: 1.3em; - font-weight: 500; - color: #00008B; - border-bottom: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { - float: none; - padding-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { - float: none; - width: auto; - padding: 0; - text-align: left -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content { - float: none; - width: auto; - padding: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content::before { - display: none -} - -.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { - padding-top: .75rem; - margin-top: .75rem; - border-top: 1px solid rgba(0, 0, 0, .1) -} - -.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { - display: block; - padding: .1rem 1rem; - margin-bottom: 0.1; - font-size: 1.0em; - font-weight: 400 - /* display: none */ -} - -.algolia-autocomplete .algolia-docsearch-suggestion--title { - display: block; - padding: .25rem 1rem; - margin-bottom: 0; - font-size: 0.9em; - font-weight: 400 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--text { - padding: 0 1rem .5rem; - margin-top: -.25rem; - font-size: 0.8em; - font-weight: 400; - line-height: 1.25 -} - -.algolia-autocomplete .algolia-docsearch-footer { - width: 110px; - height: 20px; - z-index: 3; - margin-top: 10.66667px; - float: right; - font-size: 0; - line-height: 0; -} - -.algolia-autocomplete .algolia-docsearch-footer--logo { - background-image: url("data:image/svg+xml;utf8,"); - background-repeat: no-repeat; - background-position: 50%; - background-size: 100%; - overflow: hidden; - text-indent: -9000px; - width: 100%; - height: 100%; - display: block; - transform: translate(-8px); -} - -.algolia-autocomplete .algolia-docsearch-suggestion--highlight { - color: #FF8C00; - background: rgba(232, 189, 54, 0.1) -} - - -.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { - box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) -} - -.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { - background-color: rgba(192, 192, 192, .15) -} diff --git a/docs/docsearch.js b/docs/docsearch.js deleted file mode 100644 index b35504c..0000000 --- a/docs/docsearch.js +++ /dev/null @@ -1,85 +0,0 @@ -$(function() { - - // register a handler to move the focus to the search bar - // upon pressing shift + "/" (i.e. "?") - $(document).on('keydown', function(e) { - if (e.shiftKey && e.keyCode == 191) { - e.preventDefault(); - $("#search-input").focus(); - } - }); - - $(document).ready(function() { - // do keyword highlighting - /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ - var mark = function() { - - var referrer = document.URL ; - var paramKey = "q" ; - - if (referrer.indexOf("?") !== -1) { - var qs = referrer.substr(referrer.indexOf('?') + 1); - var qs_noanchor = qs.split('#')[0]; - var qsa = qs_noanchor.split('&'); - var keyword = ""; - - for (var i = 0; i < qsa.length; i++) { - var currentParam = qsa[i].split('='); - - if (currentParam.length !== 2) { - continue; - } - - if (currentParam[0] == paramKey) { - keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); - } - } - - if (keyword !== "") { - $(".contents").unmark({ - done: function() { - $(".contents").mark(keyword); - } - }); - } - } - }; - - mark(); - }); -}); - -/* Search term highlighting ------------------------------*/ - -function matchedWords(hit) { - var words = []; - - var hierarchy = hit._highlightResult.hierarchy; - // loop to fetch from lvl0, lvl1, etc. - for (var idx in hierarchy) { - words = words.concat(hierarchy[idx].matchedWords); - } - - var content = hit._highlightResult.content; - if (content) { - words = words.concat(content.matchedWords); - } - - // return unique words - var words_uniq = [...new Set(words)]; - return words_uniq; -} - -function updateHitURL(hit) { - - var words = matchedWords(hit); - var url = ""; - - if (hit.anchor) { - url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; - } else { - url = hit.url + '?q=' + escape(words.join(" ")); - } - - return url; -} diff --git a/docs/favicon-16x16.png b/docs/favicon-16x16.png deleted file mode 100644 index ba7339f..0000000 Binary files a/docs/favicon-16x16.png and /dev/null differ diff --git a/docs/favicon-32x32.png b/docs/favicon-32x32.png deleted file mode 100644 index 4152103..0000000 Binary files a/docs/favicon-32x32.png and /dev/null differ diff --git a/docs/favicon.ico b/docs/favicon.ico deleted file mode 100644 index 1aa2422..0000000 Binary files a/docs/favicon.ico and /dev/null differ diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index ae523ec..0000000 --- a/docs/index.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - -Plotting Field Plans for Agricultural Experiments β€’ desplot - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    -
    -
    - - -

    Homepage: https://kwstat.github.io/desplot

    -

    Repository: https://github.com/kwstat/desplot

    -

    desplot makes it easy to plot experimental designs of field trials in agriculture.

    -

    Key features:

    -
      -
    • Flexible options to customize appearance of graphic.

    • -
    • Stable, well-tested using lattice graphics.

    • -
    • Beta version using ggplot2 graphics. Note ggplot2 is about 4 times slower.

    • -
    -
    -

    -Installation

    -
    -# Install the released version from CRAN:
    -install.packages("desplot")
    -
    -# Install the development version from GitHub:
    -install.packages("devtools")
    -devtools::install_github("kwstat/desplot")
    -
    -
    -

    -Example 1

    -

    This data is is from a split-plot experiment with 6 replicates. The replicates are shown by the colored regions and outlined by the thick lines. The text codes and the thin lines define the whole-plots. The nitrogen sub-plot treatments are shown by the text colors.

    -
    -require(agridat)
    -require(desplot)
    -desplot(yates.oats, block ~ col+row,
    -        col=nitro, text=gen, cex=1, aspect=511/176,
    -        out1=block, out2=gen, 
    -        out2.gpar=list(col = "gray50", lwd = 1, lty = 1))
    -

    desplot

    -

    The default graphics are based on lattice. It is also possible to create graphics based on ggplot2 by adding β€˜gg=TRUE’ to the function. This functionality is in development and the legend for the ggplot version is not as polished as the lattice version.

    -
    -require(agridat)
    -require(desplot)
    -desplot(yates.oats, block ~ col+row,
    -        col=nitro, text=gen, cex=1, aspect=511/176,
    -        out1=block, out2=gen, 
    -        out2.gpar=list(col = "gray50", lwd = 1, lty = 1), gg=TRUE)
    -        # note, out2.gpar is ignored
    -

    desplot

    -
    -
    -

    -Example 2

    -

    Another very useful technique is to color the cells according to a continuous response variable (such as plot yield).

    -
    -require(agridat)
    -require(desplot)
    -desplot(yates.oats, yield ~ col*row,
    -        col=gen, num=nitro, cex=1, out1=block, aspect=511/176)
    -

    desplot

    -
    -
    -
    - - -
    - - -
    - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - diff --git a/docs/link.svg b/docs/link.svg deleted file mode 100644 index 88ad827..0000000 --- a/docs/link.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/docs/logo.png b/docs/logo.png deleted file mode 100644 index 2e89f2d..0000000 Binary files a/docs/logo.png and /dev/null differ diff --git a/docs/news/index.html b/docs/news/index.html deleted file mode 100644 index 6bc3f69..0000000 --- a/docs/news/index.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - - -Changelog β€’ desplot - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    -desplot 1.8 Unreleased -

    -
      -
    • Bug fix for dq with multiple panels.

    • -
    • Use inherits to check class #4.

    • -
    -
    -
    -

    -desplot 1.7 - Jul 2020 2020-07-20 -

    - -
    -
    -

    -desplot 1.6 - Sep 2019 2019-09-13 -

    -
      -
    • New argument dq for showing data quality on heatmaps.
    • -
    -
    -
    -

    -desplot 1.5 - Apr 2019 2019-04-03 -

    -
      -
    • Beta version of ggdesplot() to create ggplot2 graphics.

    • -
    • New argument subset to subset data before analysis.

    • -
    -
    -
    -

    -desplot 1.3 - Oct 2017 2017-10-13 -

    -
      -
    • Bug fix.
    • -
    -
    -
    -

    -desplot 1.2 - Jul 2017 2017-07-13 -

    -
      -
    • Now using testthat and covr packages.
    • -
    -
    -
    -

    -desplot 1.1 - Dec 2016 2016-12-18 -

    -
      -
    • New function argument midpoint="median" uses the median to determine the midpoint for the ribbon. Previously, the midpoint was halfway between the minimum and maximum data values. Use midpoint=NULL or midpoint="midrange" to restore the old behavior.
    • -
    -
    -
    -

    -desplot 1.0 - Dec 2015 2015-12-14 -

    -
      -
    • The desplot package has been split off from the agridat package.
    • -
    -
    -
    -

    -desplot 0.0 - 2008 Unreleased -

    -
      -
    • Original creation of function.
    • -
    -
    -
    - - - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/pkgdown.css b/docs/pkgdown.css deleted file mode 100644 index 1273238..0000000 --- a/docs/pkgdown.css +++ /dev/null @@ -1,367 +0,0 @@ -/* Sticky footer */ - -/** - * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ - * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css - * - * .Site -> body > .container - * .Site-content -> body > .container .row - * .footer -> footer - * - * Key idea seems to be to ensure that .container and __all its parents__ - * have height set to 100% - * - */ - -html, body { - height: 100%; -} - -body { - position: relative; -} - -body > .container { - display: flex; - height: 100%; - flex-direction: column; -} - -body > .container .row { - flex: 1 0 auto; -} - -footer { - margin-top: 45px; - padding: 35px 0 36px; - border-top: 1px solid #e5e5e5; - color: #666; - display: flex; - flex-shrink: 0; -} -footer p { - margin-bottom: 0; -} -footer div { - flex: 1; -} -footer .pkgdown { - text-align: right; -} -footer p { - margin-bottom: 0; -} - -img.icon { - float: right; -} - -img { - max-width: 100%; -} - -/* Fix bug in bootstrap (only seen in firefox) */ -summary { - display: list-item; -} - -/* Typographic tweaking ---------------------------------*/ - -.contents .page-header { - margin-top: calc(-60px + 1em); -} - -dd { - margin-left: 3em; -} - -/* Section anchors ---------------------------------*/ - -a.anchor { - margin-left: -30px; - display:inline-block; - width: 30px; - height: 30px; - visibility: hidden; - - background-image: url(./link.svg); - background-repeat: no-repeat; - background-size: 20px 20px; - background-position: center center; -} - -.hasAnchor:hover a.anchor { - visibility: visible; -} - -@media (max-width: 767px) { - .hasAnchor:hover a.anchor { - visibility: hidden; - } -} - - -/* Fixes for fixed navbar --------------------------*/ - -.contents h1, .contents h2, .contents h3, .contents h4 { - padding-top: 60px; - margin-top: -40px; -} - -/* Navbar submenu --------------------------*/ - -.dropdown-submenu { - position: relative; -} - -.dropdown-submenu>.dropdown-menu { - top: 0; - left: 100%; - margin-top: -6px; - margin-left: -1px; - border-radius: 0 6px 6px 6px; -} - -.dropdown-submenu:hover>.dropdown-menu { - display: block; -} - -.dropdown-submenu>a:after { - display: block; - content: " "; - float: right; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - border-width: 5px 0 5px 5px; - border-left-color: #cccccc; - margin-top: 5px; - margin-right: -10px; -} - -.dropdown-submenu:hover>a:after { - border-left-color: #ffffff; -} - -.dropdown-submenu.pull-left { - float: none; -} - -.dropdown-submenu.pull-left>.dropdown-menu { - left: -100%; - margin-left: 10px; - border-radius: 6px 0 6px 6px; -} - -/* Sidebar --------------------------*/ - -#pkgdown-sidebar { - margin-top: 30px; - position: -webkit-sticky; - position: sticky; - top: 70px; -} - -#pkgdown-sidebar h2 { - font-size: 1.5em; - margin-top: 1em; -} - -#pkgdown-sidebar h2:first-child { - margin-top: 0; -} - -#pkgdown-sidebar .list-unstyled li { - margin-bottom: 0.5em; -} - -/* bootstrap-toc tweaks ------------------------------------------------------*/ - -/* All levels of nav */ - -nav[data-toggle='toc'] .nav > li > a { - padding: 4px 20px 4px 6px; - font-size: 1.5rem; - font-weight: 400; - color: inherit; -} - -nav[data-toggle='toc'] .nav > li > a:hover, -nav[data-toggle='toc'] .nav > li > a:focus { - padding-left: 5px; - color: inherit; - border-left: 1px solid #878787; -} - -nav[data-toggle='toc'] .nav > .active > a, -nav[data-toggle='toc'] .nav > .active:hover > a, -nav[data-toggle='toc'] .nav > .active:focus > a { - padding-left: 5px; - font-size: 1.5rem; - font-weight: 400; - color: inherit; - border-left: 2px solid #878787; -} - -/* Nav: second level (shown on .active) */ - -nav[data-toggle='toc'] .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} - -nav[data-toggle='toc'] .nav .nav > li > a { - padding-left: 16px; - font-size: 1.35rem; -} - -nav[data-toggle='toc'] .nav .nav > li > a:hover, -nav[data-toggle='toc'] .nav .nav > li > a:focus { - padding-left: 15px; -} - -nav[data-toggle='toc'] .nav .nav > .active > a, -nav[data-toggle='toc'] .nav .nav > .active:hover > a, -nav[data-toggle='toc'] .nav .nav > .active:focus > a { - padding-left: 15px; - font-weight: 500; - font-size: 1.35rem; -} - -/* orcid ------------------------------------------------------------------- */ - -.orcid { - font-size: 16px; - color: #A6CE39; - /* margins are required by official ORCID trademark and display guidelines */ - margin-left:4px; - margin-right:4px; - vertical-align: middle; -} - -/* Reference index & topics ----------------------------------------------- */ - -.ref-index th {font-weight: normal;} - -.ref-index td {vertical-align: top; min-width: 100px} -.ref-index .icon {width: 40px;} -.ref-index .alias {width: 40%;} -.ref-index-icons .alias {width: calc(40% - 40px);} -.ref-index .title {width: 60%;} - -.ref-arguments th {text-align: right; padding-right: 10px;} -.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} -.ref-arguments .name {width: 20%;} -.ref-arguments .desc {width: 80%;} - -/* Nice scrolling for wide elements --------------------------------------- */ - -table { - display: block; - overflow: auto; -} - -/* Syntax highlighting ---------------------------------------------------- */ - -pre { - word-wrap: normal; - word-break: normal; - border: 1px solid #eee; -} - -pre, code { - background-color: #f8f8f8; - color: #333; -} - -pre code { - overflow: auto; - word-wrap: normal; - white-space: pre; -} - -pre .img { - margin: 5px 0; -} - -pre .img img { - background-color: #fff; - display: block; - height: auto; -} - -code a, pre a { - color: #375f84; -} - -a.sourceLine:hover { - text-decoration: none; -} - -.fl {color: #1514b5;} -.fu {color: #000000;} /* function */ -.ch,.st {color: #036a07;} /* string */ -.kw {color: #264D66;} /* keyword */ -.co {color: #888888;} /* comment */ - -.message { color: black; font-weight: bolder;} -.error { color: orange; font-weight: bolder;} -.warning { color: #6A0366; font-weight: bolder;} - -/* Clipboard --------------------------*/ - -.hasCopyButton { - position: relative; -} - -.btn-copy-ex { - position: absolute; - right: 0; - top: 0; - visibility: hidden; -} - -.hasCopyButton:hover button.btn-copy-ex { - visibility: visible; -} - -/* headroom.js ------------------------ */ - -.headroom { - will-change: transform; - transition: transform 200ms linear; -} -.headroom--pinned { - transform: translateY(0%); -} -.headroom--unpinned { - transform: translateY(-100%); -} - -/* mark.js ----------------------------*/ - -mark { - background-color: rgba(255, 255, 51, 0.5); - border-bottom: 2px solid rgba(255, 153, 51, 0.3); - padding: 1px; -} - -/* vertical spacing after htmlwidgets */ -.html-widget { - margin-bottom: 10px; -} - -/* fontawesome ------------------------ */ - -.fab { - font-family: "Font Awesome 5 Brands" !important; -} - -/* don't display links in code chunks when printing */ -/* source: https://stackoverflow.com/a/10781533 */ -@media print { - code a:link:after, code a:visited:after { - content: ""; - } -} diff --git a/docs/pkgdown.js b/docs/pkgdown.js deleted file mode 100644 index 7e7048f..0000000 --- a/docs/pkgdown.js +++ /dev/null @@ -1,108 +0,0 @@ -/* http://gregfranko.com/blog/jquery-best-practices/ */ -(function($) { - $(function() { - - $('.navbar-fixed-top').headroom(); - - $('body').css('padding-top', $('.navbar').height() + 10); - $(window).resize(function(){ - $('body').css('padding-top', $('.navbar').height() + 10); - }); - - $('[data-toggle="tooltip"]').tooltip(); - - var cur_path = paths(location.pathname); - var links = $("#navbar ul li a"); - var max_length = -1; - var pos = -1; - for (var i = 0; i < links.length; i++) { - if (links[i].getAttribute("href") === "#") - continue; - // Ignore external links - if (links[i].host !== location.host) - continue; - - var nav_path = paths(links[i].pathname); - - var length = prefix_length(nav_path, cur_path); - if (length > max_length) { - max_length = length; - pos = i; - } - } - - // Add class to parent
  • , and enclosing
  • if in dropdown - if (pos >= 0) { - var menu_anchor = $(links[pos]); - menu_anchor.parent().addClass("active"); - menu_anchor.closest("li.dropdown").addClass("active"); - } - }); - - function paths(pathname) { - var pieces = pathname.split("/"); - pieces.shift(); // always starts with / - - var end = pieces[pieces.length - 1]; - if (end === "index.html" || end === "") - pieces.pop(); - return(pieces); - } - - // Returns -1 if not found - function prefix_length(needle, haystack) { - if (needle.length > haystack.length) - return(-1); - - // Special case for length-0 haystack, since for loop won't run - if (haystack.length === 0) { - return(needle.length === 0 ? 0 : -1); - } - - for (var i = 0; i < haystack.length; i++) { - if (needle[i] != haystack[i]) - return(i); - } - - return(haystack.length); - } - - /* Clipboard --------------------------*/ - - function changeTooltipMessage(element, msg) { - var tooltipOriginalTitle=element.getAttribute('data-original-title'); - element.setAttribute('data-original-title', msg); - $(element).tooltip('show'); - element.setAttribute('data-original-title', tooltipOriginalTitle); - } - - if(ClipboardJS.isSupported()) { - $(document).ready(function() { - var copyButton = ""; - - $(".examples, div.sourceCode").addClass("hasCopyButton"); - - // Insert copy buttons: - $(copyButton).prependTo(".hasCopyButton"); - - // Initialize tooltips: - $('.btn-copy-ex').tooltip({container: 'body'}); - - // Initialize clipboard: - var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { - text: function(trigger) { - return trigger.parentNode.textContent; - } - }); - - clipboardBtnCopies.on('success', function(e) { - changeTooltipMessage(e.trigger, 'Copied!'); - e.clearSelection(); - }); - - clipboardBtnCopies.on('error', function() { - changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); - }); - }); - } -})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml deleted file mode 100644 index de0bfe1..0000000 --- a/docs/pkgdown.yml +++ /dev/null @@ -1,7 +0,0 @@ -pandoc: 2.9.2.1 -pkgdown: 1.6.1 -pkgdown_sha: ~ -articles: - desplot_examples: desplot_examples.html -last_built: 2020-10-20T20:44Z - diff --git a/docs/reference/RedGrayBlue-1.png b/docs/reference/RedGrayBlue-1.png deleted file mode 100644 index 34f6c9f..0000000 Binary files a/docs/reference/RedGrayBlue-1.png and /dev/null differ diff --git a/docs/reference/RedGrayBlue.html b/docs/reference/RedGrayBlue.html deleted file mode 100644 index 9f491af..0000000 --- a/docs/reference/RedGrayBlue.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - -Function to create a Red-Gray-Blue palette β€” RedGrayBlue β€’ desplot - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    A function to create a Red-Gray-Blue palette.

    -
    - -
    RedGrayBlue(n)
    - -

    Arguments

    - - - - - - -
    n

    Number of colors to create

    - -

    Value

    - -

    A vector of n colors.

    -

    Details

    - -

    Using gray instead of white allows missing values to appear as white -(actually, transparent).

    - -

    Examples

    -
    pie(rep(1,11), col=RedGrayBlue(11))
    title("RedGrayBlue(11)")
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.5.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/desplot-1.png b/docs/reference/desplot-1.png deleted file mode 100644 index 2542d8c..0000000 Binary files a/docs/reference/desplot-1.png and /dev/null differ diff --git a/docs/reference/desplot-2.png b/docs/reference/desplot-2.png deleted file mode 100644 index 81cff0e..0000000 Binary files a/docs/reference/desplot-2.png and /dev/null differ diff --git a/docs/reference/desplot.html b/docs/reference/desplot.html deleted file mode 100644 index 457698d..0000000 --- a/docs/reference/desplot.html +++ /dev/null @@ -1,479 +0,0 @@ - - - - - - - - -Plot the layout/data of a field experiment. β€” desplot β€’ desplot - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Use this function to plot the layout of a rectangular lattice -field experiment and also the observed data values.

    -
    - -
    desplot(
    -  data,
    -  form = formula(NULL ~ x + y),
    -  num = NULL,
    -  num.string = NULL,
    -  col = NULL,
    -  col.string = NULL,
    -  text = NULL,
    -  text.string = NULL,
    -  out1 = NULL,
    -  out1.string = NULL,
    -  out2 = NULL,
    -  out2.string = NULL,
    -  dq = NULL,
    -  dq.string = NULL,
    -  col.regions = RedGrayBlue,
    -  col.text = NULL,
    -  text.levels = NULL,
    -  out1.gpar = list(col = "black", lwd = 3),
    -  out2.gpar = list(col = "yellow", lwd = 1, lty = 1),
    -  at,
    -  midpoint = "median",
    -  ticks = FALSE,
    -  flip = FALSE,
    -  main = NULL,
    -  xlab,
    -  ylab,
    -  shorten = "abb",
    -  show.key = TRUE,
    -  key.cex,
    -  cex = 0.4,
    -  strip.cex = 0.75,
    -  subset = TRUE,
    -  gg = FALSE,
    -  ...
    -)
    -
    -ggdesplot(
    -  data,
    -  form = formula(NULL ~ x + y),
    -  num = NULL,
    -  num.string = NULL,
    -  col = NULL,
    -  col.string = NULL,
    -  text = NULL,
    -  text.string = NULL,
    -  out1 = NULL,
    -  out1.string = NULL,
    -  out2 = NULL,
    -  out2.string = NULL,
    -  dq = NULL,
    -  dq.string = NULL,
    -  col.regions = RedGrayBlue,
    -  col.text = NULL,
    -  text.levels = NULL,
    -  out1.gpar = list(col = "black", lwd = 3),
    -  out2.gpar = list(col = "yellow", lwd = 1, lty = 1),
    -  at,
    -  midpoint = "median",
    -  ticks = FALSE,
    -  flip = FALSE,
    -  main = NULL,
    -  xlab,
    -  ylab,
    -  shorten = "abb",
    -  show.key = TRUE,
    -  key.cex,
    -  cex = 0.4,
    -  strip.cex = 0.75,
    -  subset = TRUE,
    -  gg = FALSE,
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    data

    A data frame.

    form

    A formula like yield~x*y|location. Note x,y are numeric.

    num

    Bare name (no quotes) of the column of the data to use -as a factor for number-coding the text in each cell.

    num.string

    String name of the column of the data to use -as a factor for number-coding the text in each cell.

    col

    Bare name (no quotes) of the column of the data to use -for color-coding the text shown in each cell.

    col.string

    String name of the column of the data to use -for color-coding the text shown in each cell.

    text

    Bare name (no quotes) of the column of the data to use -for the actual text shown in each cell.

    text.string

    String name of the column of the data to use -for the actual text shown in each cell.

    out1

    Bare name (no quotes) of the column of the data to use -for first-level outlining around blocks of cells.

    out1.string

    String name of the column of the data to use -for first-level outlining around blocks of cells.

    out2

    Bare name (no quotes) of the column of the data to use -for second-level outlining around blocks of cells.

    out2.string

    String name of the column of the data to use -for second-level outlining around blocks of cells.

    dq

    Bare name (no quotes) of the column of the data to use -for indicating bad data quality with diagonal lines. -This can either be a numeric vector or a factor/text. -Cells with 1/"Q"/"Questionable" have one diagonal line. -Cells with 2/"B"/"Bad","S","Suppressed" have crossed diagonal lines.

    dq.string

    String name of the column of the data to use -for indicating bad data quality with diagonal lines.

    col.regions

    Colors for the fill color of cells.

    col.text

    Vector of colors for text strings.

    text.levels

    Character strings to use instead of default 'levels'.

    out1.gpar

    A list of graphics parameters for first-level outlining. -Can either be an ordinary list() or a call to gpar() from the - grid package.

    out2.gpar

    Graphics parameters for second-level of outlining.

    at

    Breakpoints for the color ribbon. Use this instead of 'zlim'. -Note: using 'at' causes 'midpoint' to be set to NULL.

    midpoint

    Method to find midpoint of the color ribbon. -One of 'midrange', 'median, or a numeric value.

    ticks

    If TRUE, show tick marks along the bottom and left sides.

    flip

    If TRUE, vertically flip the image.

    main

    Main title.

    xlab

    Label for x axis.

    ylab

    Label for y axis.

    shorten

    Method for shortening text in the key, either 'abb', 'sub', 'no', or FALSE.

    show.key

    If TRUE, show the key on the left side. (This is not the ribbon.)

    key.cex

    Left legend cex.

    cex

    Expansion factor for text/number in each cell.

    strip.cex

    Strip cex.

    subset

    An expression that evaluates to logical index vector for subsetting the data.

    gg

    If TRUE, desplot() switches to ggdesplot().

    ...

    Other.

    - -

    Value

    - -

    A lattice or ggplot2 object

    -

    Details

    - -

    To create the plot using lattice graphics: -1. desplot(...).

    -

    To create the plot using ggplot2 graphics, use one of the following: -1. ggdesplot(...). -2. desplot(..., gg=TRUE). -3. options(desplot.gg=TRUE); desplot(...). -Method 3 is useful to modify all results from existing scripts.

    -

    The lattice version is complete, mature, and robust. -The ggplot2 version is incomplete. The legend can only show colors, -and some function arguments are ignored. -In general, lattice graphics are about 4-5 times faster than ggplot2 graphics. -Not all lattice parameters are passed down to xyplot, but it -is possible to make almost any change to the plot by assigning the -desplot object to a variable and then edit the object by hand or use -update to modify the object. Then print it manually. See the -first example below.

    -

    Use col.regions to specify fill colors. This can either be a vector -of colors or a function that produces a vector of colors. If the response -variable is a factor and col.regions is a function, it will -be ignored and the cells are filled with default light-colored backgrounds -and a key is placed on the left. If the response variable is -numeric, the cells are colored according to col.regions, and -a ribbon key is placed on the right.

    -

    Use shorten='abb' (this is default) to shorten the cell text using -the abbreviate function. -Use shorten='sub' to use a 3-character substring. -Use shorten='no' or shorten=FALSE for no shortening.

    -

    Note that two sub-plots with identical levels of the split-plot factor can -be adjacent to each other by virtue of appearing in different whole-plots. -To correctly outline the split-plot factor, simply concatenate the -whole-plot factor and sub-plot factor together.

    -

    To get a map of a field with a true aspect ratio (lattice version only), -include 'aspect=ylen/xlen' -in the call, where 'ylen' is the vertical length of the field and 'xlen' -is the horizontal length of the field.

    -

    To call this function inside another function, you can hack like this: -vr <- "yield"; vx <- "x"; vy <- "y"; -eval(parse(text=paste("desplot(", vr, "~", vx, "*", vy, ", data=yates.oats)")))

    -

    References

    - -

    K. Ryder (1981). -Field plans: why the biometrician finds them useful. -Experimental Agriculture, 17, 243--256.

    - -

    Examples

    -
    if(require(agridat)){ - -# Show how to customize any feature. Here: make the strips bigger. -data(besag.met) -d1 <- desplot(besag.met, - yield ~ col*row|county, - main="besag.met", - out1=rep, out2=block, out2.gpar=list(col="white"), strip.cex=2) -d1 <- update(d1, par.settings = list(layout.heights=list(strip=2))) -print(d1) - -# Show experiment layout -data(yates.oats) -desplot(yates.oats, - yield ~ col+row, - out1=block, out2=gen) - -desplot(yates.oats, - block ~ col+row, - col=nitro, text=gen, cex=1, out1=block, - out2=gen, out2.gpar=list(col = "gray50", lwd = 1, lty = 1)) - -}
    #> Loading required package: agridat
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.5.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/figures/logo.png b/docs/reference/figures/logo.png deleted file mode 100644 index 2e89f2d..0000000 Binary files a/docs/reference/figures/logo.png and /dev/null differ diff --git a/docs/reference/figures/yates_oats_design.png b/docs/reference/figures/yates_oats_design.png deleted file mode 100644 index 1a30065..0000000 Binary files a/docs/reference/figures/yates_oats_design.png and /dev/null differ diff --git a/docs/reference/figures/yates_oats_design_ggplot.png b/docs/reference/figures/yates_oats_design_ggplot.png deleted file mode 100644 index a642f30..0000000 Binary files a/docs/reference/figures/yates_oats_design_ggplot.png and /dev/null differ diff --git a/docs/reference/figures/yates_oats_yield.png b/docs/reference/figures/yates_oats_yield.png deleted file mode 100644 index e88c761..0000000 Binary files a/docs/reference/figures/yates_oats_yield.png and /dev/null differ diff --git a/docs/reference/geom_tileborder-1.png b/docs/reference/geom_tileborder-1.png deleted file mode 100644 index 8f68aeb..0000000 Binary files a/docs/reference/geom_tileborder-1.png and /dev/null differ diff --git a/docs/reference/geom_tileborder.html b/docs/reference/geom_tileborder.html deleted file mode 100644 index 924f924..0000000 --- a/docs/reference/geom_tileborder.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - - - -Borders between tiles β€” geom_tileborder β€’ desplot - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    `geom_tileborder` draws a border between tiles of different classes. -The required aesthetics are `aes(x,y,grp)`, where `grp` is the grouping -classification that separates tiles.

    -
    - -
    geom_tileborder(
    -  mapping = NULL,
    -  data = NULL,
    -  geom = "segment",
    -  position = "identity",
    -  na.rm = TRUE,
    -  show.legend = NA,
    -  inherit.aes = TRUE,
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    mapping

    Set of aesthetic mappings created by aes() or -aes_(). If specified and inherit.aes = TRUE (the -default), it is combined with the default mapping at the top level of the -plot. You must supply mapping if there is no plot mapping.

    data

    The data to be displayed in this layer. There are three -options:

    -

    If NULL, the default, the data is inherited from the plot -data as specified in the call to ggplot().

    -

    A data.frame, or other object, will override the plot -data. All objects will be fortified to produce a data frame. See -fortify() for which variables will be created.

    -

    A function will be called with a single argument, -the plot data. The return value must be a data.frame, and -will be used as the layer data. A function can be created -from a formula (e.g. ~ head(.x, 10)).

    geom

    The geometric object to use display the data

    position

    Position adjustment, either as a string, or the result of -a call to a position adjustment function.

    na.rm

    If FALSE, the default, missing values are removed with -a warning. If TRUE, missing values are silently removed.

    show.legend

    logical. Should this layer be included in the legends? -NA, the default, includes if any aesthetics are mapped. -FALSE never includes, and TRUE always includes. -It can also be a named logical vector to finely select the aesthetics to -display.

    inherit.aes

    If FALSE, overrides the default aesthetics, -rather than combining with them. This is most useful for helper functions -that define both data and aesthetics and shouldn't inherit behaviour from -the default plot specification, e.g. borders().

    ...

    Other arguments passed on to layer(). These are -often aesthetics, used to set an aesthetic to a fixed value, like -colour = "red" or size = 3. They may also be parameters -to the paired geom/stat.

    - -

    Details

    - -

    Note, we cannot use `aes(group)` because it groups the interaction of -ALL discrete variables including facets. Since we do not want to draw -a border between facets, we had to define a new aesthetic. -See: # http://ggplot2.tidyverse.org/reference/aes_group_order.html

    -

    Also, we do not want to split the data into separate groups for each level -of `grp`, so we need to include `aes(group=1)`.

    - -

    Examples

    -
    dd <- data.frame( - x=c(1,2,1,2,3,1,2,1,2,3), - y=c(2,2,2,2,2,1,1,1,1,1), - loc=factor(c(1,1,2,2,2,1,1,2,2,2)), - rep=factor(c(2,2,1,2,3,1,1,1,2,3))) -library(ggplot2) -ggplot(dd, aes(x=x, y=y)) + - facet_wrap( ~ loc) + - geom_tile(aes(fill=rep)) + - geom_tileborder(aes(group=1, grp=rep), lwd=1.5)
    # Compare to lattice version of desplot -# desplot::desplot(rep ~ x*y|loc, data=dd, out1=rep) - -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.5.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/index.html b/docs/reference/index.html deleted file mode 100644 index 747242c..0000000 --- a/docs/reference/index.html +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - -Function reference β€’ desplot - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    All functions

    -

    -
    -

    desplot() ggdesplot()

    -

    Plot the layout/data of a field experiment.

    -

    geom_tileborder()

    -

    Borders between tiles

    -

    panel.outlinelevelplot()

    -

    Panel Function for desplot

    -

    RedGrayBlue()

    -

    Function to create a Red-Gray-Blue palette

    -
    - - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/panel.outlinelevelplot.html b/docs/reference/panel.outlinelevelplot.html deleted file mode 100644 index 6d7c197..0000000 --- a/docs/reference/panel.outlinelevelplot.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - -Panel Function for desplot β€” panel.outlinelevelplot β€’ desplot - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    This is a panel function for desplot which fills cells with -a background color and adds outlines around blocks of cells.

    -
    - -
    panel.outlinelevelplot(
    -  x,
    -  y,
    -  z,
    -  subscripts,
    -  at,
    -  ...,
    -  alpha.regions = 1,
    -  out1f,
    -  out1g,
    -  out2f,
    -  out2g,
    -  dq
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    x

    Coordinates

    y

    Coordinates

    z

    Value for filling each cell.

    subscripts

    For compatability.

    at

    Breakpoints for the colors.

    ...

    Other

    alpha.regions

    Transparency for fill colors. Not well tested.

    out1f

    Factor to use for outlining (level 1).

    out1g

    Factor to use for outlining (level 2).

    out2f

    Graphics parameters to use for outlining.

    out2g

    Graphics parameters to use for outlining.

    dq

    Indicator of which cells should be flagged for data quality.

    - -

    Details

    - -

    It does not add the text labels, numbers, or colors.

    -

    The rule for determining where to draw outlines is to compare the -levels of the factor used for outlining. If bordering cells have -different levels of the factor, then a border is drawn. 'NA' values -are ignored (otherwise, too many lines would be drawn).

    -

    The code works, but is probably overkill and has not been streamlined.

    -

    References

    - -

    None

    - -
    - -
    - - - -
    - - - - - - - - diff --git a/man/geom_tileborder.Rd b/man/geom_tileborder.Rd index bafea83..3938469 100644 --- a/man/geom_tileborder.Rd +++ b/man/geom_tileborder.Rd @@ -38,14 +38,31 @@ the plot data. The return value must be a \code{data.frame}, and will be used as the layer data. A \code{function} can be created from a \code{formula} (e.g. \code{~ head(.x, 10)}).} -\item{geom}{The geometric object to use to display the data, either as a -\code{ggproto} \code{Geom} subclass or as a string naming the geom stripped of the -\code{geom_} prefix (e.g. \code{"point"} rather than \code{"geom_point"})} +\item{geom}{The geometric object to use to display the data for this layer. +When using a \verb{stat_*()} function to construct a layer, the \code{geom} argument +can be used to override the default coupling between stats and geoms. The +\code{geom} argument accepts the following: +\itemize{ +\item A \code{Geom} ggproto subclass, for example \code{GeomPoint}. +\item A string naming the geom. To give the geom as a string, strip the +function name of the \code{geom_} prefix. For example, to use \code{geom_point()}, +give the geom as \code{"point"}. +\item For more information and other ways to specify the geom, see the +\link[ggplot2:layer_geoms]{layer geom} documentation. +}} -\item{position}{Position adjustment, either as a string naming the adjustment -(e.g. \code{"jitter"} to use \code{position_jitter}), or the result of a call to a -position adjustment function. Use the latter if you need to change the -settings of the adjustment.} +\item{position}{A position adjustment to use on the data for this layer. This +can be used in various ways, including to prevent overplotting and +improving the display. The \code{position} argument accepts the following: +\itemize{ +\item The result of calling a position function, such as \code{position_jitter()}. +This method allows for passing extra arguments to the position. +\item A string naming the position adjustment. To give the position as a +string, strip the function name of the \code{position_} prefix. For example, +to use \code{position_jitter()}, give the position as \code{"jitter"}. +\item For more information and other ways to specify the position, see the +\link[ggplot2:layer_positions]{layer position} documentation. +}} \item{na.rm}{If \code{FALSE}, the default, missing values are removed with a warning. If \code{TRUE}, missing values are silently removed.} @@ -61,10 +78,33 @@ rather than combining with them. This is most useful for helper functions that define both data and aesthetics and shouldn't inherit behaviour from the default plot specification, e.g. \code{\link[ggplot2:borders]{borders()}}.} -\item{...}{Other arguments passed on to \code{\link[ggplot2:layer]{layer()}}. These are -often aesthetics, used to set an aesthetic to a fixed value, like -\code{colour = "red"} or \code{size = 3}. They may also be parameters -to the paired geom/stat.} +\item{...}{Other arguments passed on to \code{\link[ggplot2:layer]{layer()}}'s \code{params} argument. These +arguments broadly fall into one of 4 categories below. Notably, further +arguments to the \code{position} argument, or aesthetics that are required +can \emph{not} be passed through \code{...}. Unknown arguments that are not part +of the 4 categories below are ignored. +\itemize{ +\item Static aesthetics that are not mapped to a scale, but are at a fixed +value and apply to the layer as a whole. For example, \code{colour = "red"} +or \code{linewidth = 3}. The geom's documentation has an \strong{Aesthetics} +section that lists the available options. The 'required' aesthetics +cannot be passed on to the \code{params}. Please note that while passing +unmapped aesthetics as vectors is technically possible, the order and +required length is not guaranteed to be parallel to the input data. +\item When constructing a layer using +a \verb{stat_*()} function, the \code{...} argument can be used to pass on +parameters to the \code{geom} part of the layer. An example of this is +\code{stat_density(geom = "area", outline.type = "both")}. The geom's +documentation lists which parameters it can accept. +\item Inversely, when constructing a layer using a +\verb{geom_*()} function, the \code{...} argument can be used to pass on parameters +to the \code{stat} part of the layer. An example of this is +\code{geom_area(stat = "density", adjust = 0.5)}. The stat's documentation +lists which parameters it can accept. +\item The \code{key_glyph} argument of \code{\link[ggplot2:layer]{layer()}} may also be passed on through +\code{...}. This can be one of the functions described as +\link[ggplot2:draw_key]{key glyphs}, to change the display of the layer in the legend. +}} } \description{ `geom_tileborder` draws a border between tiles of different classes. diff --git a/vignettes/desplot_examples.Rmd b/vignettes/desplot_examples.Rmd index baec95d..f9c7536 100644 --- a/vignettes/desplot_examples.Rmd +++ b/vignettes/desplot_examples.Rmd @@ -30,9 +30,6 @@ First, a plot of the experimental design of the oats data from @yates1935complex library(agridat) library(desplot) data(yates.oats) -# Older versions of agridat used x/y here instead of col/row -if(is.element("x",names(yates.oats))) - yates.oats <- transform(yates.oats, col=x, row=y) desplot(yates.oats, block ~ col+row, col=nitro, text=gen, cex=1, out1=block, out2=gen, out2.gpar=list(col = "gray50", lwd = 1, lty = 1))