diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index d8aff94..0000000 --- a/docs/404.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - -Page not found (404) • intrval - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
-
- - -Content not found. Please use links in the navbar. - -
- -
- - - - -
- - - - - - - - diff --git a/docs/authors.html b/docs/authors.html deleted file mode 100644 index 53a3b91..0000000 --- a/docs/authors.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - -Authors • intrval - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
-
- - -
    -
  • -

    Peter Solymos. Maintainer. -

    -
  • -
- -
- -
- - - - -
- - - - - - - - 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/index.html b/docs/index.html deleted file mode 100644 index 383b3b3..0000000 --- a/docs/index.html +++ /dev/null @@ -1,597 +0,0 @@ - - - - - - - -Relational Operators for Intervals • intrval - - - - - - - - - - -
-
- - - - -
-
-
- - -

Evaluating if values of vectors are within different open/closed intervals (x %[]% c(a, b)), or if two closed intervals overlap (c(a1, b1) %[]o[]% c(a2, b2)). Operators for negation and directional relations also implemented.

-

-
-

-Install

-

Install from CRAN:

-
install.packages("intrval")
-

Install development version from GitHub:

-
if (!requireNamespace("remotes")) install.packages("remotes")
-remotes::install_github("psolymos/intrval")
-

User visible changes are listed in the NEWS file.

-

Use the issue tracker to report a problem.

-
-
-

-Value-to-interval relations

-

Values of x are compared to interval endpoints a and b (a <= b). Endpoints can be defined as a vector with two values (c(a, b)): these values will be compared as a single interval with each value in x. If endpoints are stored in a matrix-like object or a list, comparisons are made element-wise.

-
x <- rep(4, 5)
-a <- 1:5
-b <- 3:7
-cbind(x=x, a=a, b=b)
-x %[]% cbind(a, b) # matrix
-x %[]% data.frame(a=a, b=b) # data.frame
-x %[]% list(a, b) # list
-

If lengths do not match, shorter objects are recycled. Return values are logicals. Note: interval endpoints are sorted internally thus ensuring the condition a <= b is not necessary.

-

These value-to-interval operators work for numeric (integer, real) and ordered vectors, and object types which are measured at least on ordinal scale (e.g. dates).

-
-

-Closed and open intervals

-

The following special operators are used to indicate closed ([, ]) or open ((, )) interval endpoints:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OperatorExpressionCondition
%[]%x %[]% c(a, b)x >= a & x <= b
%[)%x %[)% c(a, b)x >= a & x < b
%(]%x %(]% c(a, b)x > a & x <= b
%()%x %()% c(a, b)x > a & x < b
-
-
-

-Negation and directional relations

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EqualNot equalLess thanGreater than
%[]%%)(%%[<]%%[>]%
%[)%%)[%%[<)%%[>)%
%(]%%](%%(<]%%(>]%
%()%%][%%(<)%%(>)%
-
-
-

-Dividing a range into 3 intervals

-

The functions %[c]%, %[c)%, %(c]%, and %(c)% return an integer vector taking values (the c within the brackets refer to ‘cut’):

-
    -
  • --1L when the value is less than or equal to a (a <= b), depending on the interval type,
  • -
  • -0L when the value is inside the interval, or
  • -
  • -1L when the value is greater than or equal to b (a <= b), depending on the interval type.
  • -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ExpressionEvaluates to -1Evaluates to 0Evaluates to 1
x %[c]% c(a, b)x < ax >= a & x <= bx > b
x %[c)% c(a, b)x < ax >= a & x < bx >= b
x %(c]% c(a, b)x <= ax > a & x <= bx > b
x %(c)% c(a, b)x <= ax > a & x < bx >= b
-
-
-
-

-Interval-to-interval relations

-

The operators define the open/closed nature of the lower/upper limits of the intervals on the left and right hand side of the o in the middle.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IntervalsInt. 2: [] -Int. 2: [) -Int. 2: (] -Int. 2: () -
Int. 1: []%[]o[]%%[]o[)%%[]o(]%%[]o()%
Int. 1: [)%[)o[]%%[)o[)%%[)o(]%%[)o()%
Int. 1: (]%(]o[]%%(]o[)%%(]o(]%%(]o()%
Int. 1: ()%()o[]%%()o[)%%()o(]%%()o()%
-

The overlap of two closed intervals, [a1, b1] and [a2, b2], is evaluated by the %[o]% (alias for %[]o[]%) operator (a1 <= b1, a2 <= b2). Endpoints can be defined as a vector with two values (c(a1, b1))or can be stored in matrix-like objects or a lists in which case comparisons are made element-wise. If lengths do not match, shorter objects are recycled. These value-to-interval operators work for numeric (integer, real) and ordered vectors, and object types which are measured at least on ordinal scale (e.g. dates), see Examples. Note: interval endpoints are sorted internally thus ensuring the conditions a1 <= b1 and a2 <= b2 is not necessary.

-
c(2, 3) %[]o[]% c(0, 1)
-list(0:4, 1:5) %[]o[]% c(2, 3)
-cbind(0:4, 1:5) %[]o[]% c(2, 3)
-data.frame(a=0:4, b=1:5) %[]o[]% c(2, 3)
-

If lengths do not match, shorter objects are recycled. These value-to-interval operators work for numeric (integer, real) and ordered vectors, and object types which are measured at least on ordinal scale (e.g. dates).

-

%)o(% is used for the negation of two closed interval overlap, directional evaluation is done via the operators %[<o]% and %[o>]%. The overlap of two open intervals is evaluated by the %(o)% (alias for %()o()%). %]o[% is used for the negation of two open interval overlap, directional evaluation is done via the operators %(<o)% and %(o>)%.

- - - - - - - - - - - - - - - - - - - - - -
EqualNot equalLess thanGreater than
%[o]%%)o(%%[<o]%%[o>]%
%(o)%%]o[%%(<o)%%(o>)%
-

Overlap operators with mixed endpoint do not have negation and directional counterparts.

-
-
-

-Operators for discrete variables

-

The previous operators will return NA for unordered factors. Set overlap can be evaluated by the base %in% operator and its negation %ni% (as in not in, the opposite of in). %nin% and %notin% are aliases for better code readability (%in% can look very much like %ni%).

-
-
-

-Examples

-

-
-

-Bounding box

-
set.seed(1)
-n <- 10^4
-x <- runif(n, -2, 2)
-y <- runif(n, -2, 2)
-d <- sqrt(x^2 + y^2)
-iv1 <- x %[]% c(-0.25, 0.25) & y %[]% c(-1.5, 1.5)
-iv2 <- x %[]% c(-1.5, 1.5) & y %[]% c(-0.25, 0.25)
-iv3 <- d %()% c(1, 1.5)
-plot(x, y, pch = 19, cex = 0.25, col = iv1 + iv2 + 1,
-    main = "Intersecting bounding boxes")
-plot(x, y, pch = 19, cex = 0.25, col = iv3 + 1,
-     main = "Deck the halls:\ndistance range from center")
-
-
-

-Time series filtering

-
x <- seq(0, 4*24*60*60, 60*60)
-dt <- as.POSIXct(x, origin="2000-01-01 00:00:00")
-f <- as.POSIXlt(dt)$hour %[]% c(0, 11)
-plot(sin(x) ~ dt, type="l", col="grey",
-    main = "Filtering date/time objects")
-points(sin(x) ~ dt, pch = 19, col = f + 1)
-
-
-

-Quality control chart (QCC)

-
library(qcc)
-data(pistonrings)
-mu <- mean(pistonrings$diameter[pistonrings$trial])
-SD <- sd(pistonrings$diameter[pistonrings$trial])
-x <- pistonrings$diameter[!pistonrings$trial]
-iv <- mu + 3 * c(-SD, SD)
-plot(x, pch = 19, col = x %)(% iv +1, type = "b", ylim = mu + 5 * c(-SD, SD),
-    main = "Shewhart quality control chart\ndiameter of piston rings")
-abline(h = mu)
-abline(h = iv, lty = 2)
-
- -
-

-Dates

-
DATE <- as.Date(c("2000-01-01","2000-02-01", "2000-03-31"))
-DATE %[<]% as.Date(c("2000-01-15", "2000-03-15"))
-# [1]  TRUE FALSE FALSE
-DATE %[]% as.Date(c("2000-01-15", "2000-03-15"))
-# [1] FALSE  TRUE FALSE
-DATE %[>]% as.Date(c("2000-01-15", "2000-03-15"))
-# [1] FALSE FALSE  TRUE
-
-dt1 <- as.Date(c("2000-01-01", "2000-03-15"))
-dt2 <- as.Date(c("2000-03-15", "2000-06-07"))
-dt1 %[]o[]% dt2
-# [1] TRUE
-dt1 %[]o[)% dt2
-# [1] TRUE
-dt1 %[]o(]% dt2
-# [1] FALSE
-dt1 %[]o()% dt2
-# [1] FALSE
-
- -
-

-Truncated distributions

-

-

Find the math here, as implemented in the package truncdist.

-
dtrunc <- function(x, ..., distr, lwr=-Inf, upr=Inf) {
-    f <- get(paste0("d", distr), mode = "function")
-    F <- get(paste0("p", distr), mode = "function")
-    Fx_lwr <- F(lwr, ..., log=FALSE)
-    Fx_upr <- F(upr, ..., log=FALSE)
-    fx     <- f(x,   ..., log=FALSE)
-    fx / (Fx_upr - Fx_lwr) * (x %[]% c(lwr, upr))
-}
-n <- 10^4
-curve(dtrunc(x, distr="norm"), -2.5, 2.5, ylim=c(0, 2), ylab="f(x)")
-curve(dtrunc(x, distr="norm", lwr=-0.5, upr=0.1), add=TRUE, col=4, n=n)
-curve(dtrunc(x, distr="norm", lwr=-0.75, upr=0.25), add=TRUE, col=3, n=n)
-curve(dtrunc(x, distr="norm", lwr=-1, upr=1), add=TRUE, col=2, n=n)
-
-
-

-Shiny example 1: regular slider

-

-
library(shiny)
-library(intrval)
-library(qcc)
-
-data(pistonrings)
-mu <- mean(pistonrings$diameter[pistonrings$trial])
-SD <- sd(pistonrings$diameter[pistonrings$trial])
-x <- pistonrings$diameter[!pistonrings$trial]
-
-## UI function
-ui <- fluidPage(
-  plotOutput("plot"),
-  sliderInput("x", "x SD:",
-    min=0, max=5, value=0, step=0.1,
-    animate=animationOptions(100)
-  )
-)
-
-# Server logic
-server <- function(input, output) {
-  output$plot <- renderPlot({
-    Main <- paste("Shewhart quality control chart", 
-        "diameter of piston rings", sprintf("+/- %.1f SD", input$x),
-        sep="\n")
-    iv <- mu + input$x * c(-SD, SD)
-    plot(x, pch = 19, col = x %)(% iv +1, type = "b", 
-        ylim = mu + 5 * c(-SD, SD), main = Main)
-    abline(h = mu)
-    abline(h = iv, lty = 2)
-  })
-}
-
-## Run shiny app
-if (interactive()) shinyApp(ui, server)
-
-
-

-Shiny example 2: range slider

-

-
library(shiny)
-library(intrval)
-
-set.seed(1)
-n <- 10^4
-x <- round(runif(n, -2, 2), 2)
-y <- round(runif(n, -2, 2), 2)
-d <- round(sqrt(x^2 + y^2), 2)
-
-## UI function
-ui <- fluidPage(
-  titlePanel("intrval example with shiny"),
-  sidebarLayout(
-    sidebarPanel(
-      sliderInput("bb_x", "x value:",
-        min=min(x), max=max(x), value=range(x), 
-        step=round(diff(range(x))/20, 1), animate=TRUE
-      ),
-      sliderInput("bb_y", "y value:",
-        min = min(y), max = max(y), value = range(y),
-        step=round(diff(range(y))/20, 1), animate=TRUE
-      ),
-      sliderInput("bb_d", "radial distance:",
-        min = 0, max = max(d), value = c(0, max(d)/2),
-        step=round(max(d)/20, 1), animate=TRUE
-      )
-    ),
-    mainPanel(
-      plotOutput("plot")
-    )
-  )
-)
-
-# Server logic
-server <- function(input, output) {
-  output$plot <- renderPlot({
-    iv1 <- x %[]% input$bb_x & y %[]% input$bb_y
-    iv2 <- x %[]% input$bb_y & y %[]% input$bb_x
-    iv3 <- d %()% input$bb_d
-    op <- par(mfrow=c(1,2))
-    plot(x, y, pch = 19, cex = 0.25, col = iv1 + iv2 + 3,
-        main = "Intersecting bounding boxes")
-    plot(x, y, pch = 19, cex = 0.25, col = iv3 + 1,
-         main = "Deck the halls:\ndistance range from center")
-    par(op)
-  })
-}
-
-## Run shiny app
-if (interactive()) shinyApp(ui, server)
-
-
-
-
- - -
- - - -
- - - - - - 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/news/index.html b/docs/news/index.html deleted file mode 100644 index 386cfa2..0000000 --- a/docs/news/index.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - -Changelog • intrval - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
-
- - -
-

-Version 0.1-2 – August 11, 2020 2020-08-12 -

- -
-
-

-Version 0.1-1 – January 21, 2017 2017-01-22 -

-
    -
  • -NA handling inconsistency fixed and documented (#8).
  • -
  • All possible interval-to-interval operators added (#6).
  • -
-
-
-

-Version 0.1-0 – December 5, 2016 2016-12-06 -

-
    -
  • CRAN release version.
  • -
  • Functions finalized.
  • -
  • Documentation and tests added.
  • -
-
-
-

-Version 0.0-1 – November 26, 2016 Unreleased -

-
    -
  • Initial bunch of functions.
  • -
-
-
- - - -
- - - -
- - - - - - - - diff --git a/docs/pkgdown.css b/docs/pkgdown.css deleted file mode 100644 index 9145958..0000000 --- a/docs/pkgdown.css +++ /dev/null @@ -1,256 +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 > .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); -} - -/* 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; -} - -/* Sidebar --------------------------*/ - -#sidebar { - margin-top: 30px; - position: -webkit-sticky; - position: sticky; - top: 70px; -} -#sidebar h2 { - font-size: 1.5em; - margin-top: 1em; -} - -#sidebar h2:first-child { - margin-top: 0; -} - -#sidebar .list-unstyled li { - margin-bottom: 0.5em; -} - -.orcid { - height: 16px; - /* 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;} -.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;} -.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 087a762..0000000 --- a/docs/pkgdown.js +++ /dev/null @@ -1,113 +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); - }); - - $('body').scrollspy({ - target: '#sidebar', - offset: 60 - }); - - $('[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 8999c6f..0000000 --- a/docs/pkgdown.yml +++ /dev/null @@ -1,5 +0,0 @@ -pandoc: 2.3.1 -pkgdown: 1.4.1 -pkgdown_sha: ~ -articles: [] - diff --git a/docs/reference/cut.html b/docs/reference/cut.html deleted file mode 100644 index 2558f21..0000000 --- a/docs/reference/cut.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - -Dividing a Range Into 3 Intervals — %[c]% • intrval - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Functions for evaluating if values of vectors are within intervals, -or less than or higher than interval endpoints. -The c within the brackets refer to cut, -a similar function.

    -
    - -
    x %[c]% interval
    -x %[c)% interval
    -x %(c]% interval
    -x %(c)% interval
    - -

    Arguments

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

    vector or NULL: the values to be compared to interval endpoints.

    interval

    vector, 2-column matrix, list, or NULL: the interval end points.

    - -

    Value

    - -

    Values of x are compared to interval endpoints -a and b (a <= b) (see %[]% for details). -The functions return an integer vector taking values --1L (value of x is less than or equal to a, -depending on the interval type), -0L (value of x is inside the interval), or -1L (value of x is greater than or equal to b, -depending on the interval type).

    -

    See also

    - -

    Similar functions (but not quite): sign, -cut, .bincode, findInterval.

    -

    See relational operators for intervals: %[]%.

    -

    See Syntax for operator precedence.

    - -

    Examples

    -
    x <- 1:5 -x %[c]% c(2,4)
    #> [1] -1 0 0 0 1
    x %[c)% c(2,4)
    #> [1] -1 0 0 1 1
    x %(c]% c(2,4)
    #> [1] -1 -1 0 0 1
    x %(c)% c(2,4)
    #> [1] -1 -1 0 1 1
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/index.html b/docs/reference/index.html deleted file mode 100644 index 8af88ea..0000000 --- a/docs/reference/index.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - -Function reference • intrval - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    All functions

    -

    -
    -

    `%[c]%` `%[c)%` `%(c]%` `%(c)%`

    -

    Dividing a Range Into 3 Intervals

    -

    intrval-package

    -

    Relational Operators for Intervals

    -

    `%[]%` `%)(%` `%[<]%` `%[>]%` `%[)%` `%)[%` `%[<)%` `%[>)%` `%(]%` `%](%` `%(<]%` `%(>]%` `%()%` `%][%` `%(<)%` `%(>)%` intrval_types()

    -

    Relational Operators Comparing Values to Intervals

    -

    `%ni%` `%nin%` `%notin%`

    -

    Negated Value Matching

    -

    `%[o]%` `%)o(%` `%[ `%[o>]%` `%(o)%` `%]o[%` `%( `%(o>)%` `%[]o[]%` `%[]o[)%` `%[]o(]%` `%[]o()%` `%[)o[]%` `%[)o[)%` `%[)o(]%` `%[)o()%` `%(]o[]%` `%(]o[)%` `%(]o(]%` `%(]o()%` `%()o[]%` `%()o[)%` `%()o(]%` `%()o()%`

    -

    Relational Operators Comparing Two Intervals

    -
    - - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/intrval-1.png b/docs/reference/intrval-1.png deleted file mode 100644 index 5520345..0000000 Binary files a/docs/reference/intrval-1.png and /dev/null differ diff --git a/docs/reference/intrval-2.png b/docs/reference/intrval-2.png deleted file mode 100644 index 41f077e..0000000 Binary files a/docs/reference/intrval-2.png and /dev/null differ diff --git a/docs/reference/intrval-3.png b/docs/reference/intrval-3.png deleted file mode 100644 index 835cfbc..0000000 Binary files a/docs/reference/intrval-3.png and /dev/null differ diff --git a/docs/reference/intrval-package.html b/docs/reference/intrval-package.html deleted file mode 100644 index 705f152..0000000 --- a/docs/reference/intrval-package.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - -Relational Operators for Intervals — intrval-package • intrval - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Evaluating if values - of vectors are within different open/closed intervals - (`x - intervals overlap (`c(a1, b1) - Operators for negation and directional relations also implemented.

    -
    - - - -

    Details

    - - - -

    The DESCRIPTION file: -This package was not yet installed at build time.
    - - -Index: This package was not yet installed at build time.

    -

    Relational operators for value-to-interval comparisons: -%[]% and alikes.

    -

    Relational operators for interval-to-interval comparisons: -%[o]% and alikes.

    -

    Negated value matching: %ni%.

    - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/intrval.html b/docs/reference/intrval.html deleted file mode 100644 index 1b7d35d..0000000 --- a/docs/reference/intrval.html +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - -Relational Operators Comparing Values to Intervals — intrval • intrval - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Functions for evaluating if values of vectors are within intervals.

    -
    - -
    x %[]% interval
    -x %)(% interval
    -x %[<]% interval
    -x %[>]% interval
    -
    -x %[)% interval
    -x %)[% interval
    -x %[<)% interval
    -x %[>)% interval
    -
    -x %(]% interval
    -x %](% interval
    -x %(<]% interval
    -x %(>]% interval
    -
    -x %()% interval
    -x %][% interval
    -x %(<)% interval
    -x %(>)% interval
    -
    -intrval_types(type = NULL, plot = FALSE)
    - -

    Arguments

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

    vector or NULL: the values to be compared to interval endpoints.

    interval

    vector, 2-column matrix, list, or NULL: the interval end points.

    type

    character, type of operator for subsetting the results. The default NULL -means that all types will be displayed.

    plot

    logical, whether to plot the results, or print a table to the console instead.

    - -

    Details

    - -

    Values of x are compared to interval endpoints -a and b (a <= b). -Endpoints can be defined as a vector with two values -(c(a, b)): these values will be compared as a single -interval with each value in x. -If endpoints are stored in a matrix-like object or a list, -comparisons are made element-wise. If lengths do not match, -shorter objects are recycled. -These value-to-interval operators work for numeric (integer, real) -and ordered vectors, and object types which are measured at -least on ordinal scale (e.g. dates), see Examples. -Note: interval endpoints are sorted internally thus ensuring the condition -a <= b is not necessary.

    -

    The type argument or the specification of the special function -determines the open (( and )) or -closed ([ and ]) endpoints and relations.

    -

    There are four types of intervals ([], [), (], ()), -their negation ()(, )[, ](, ][, respectively), -less than ([<], [<), (<], (<)), -and greater than ([>], [>), (>], (>)) relations.

    -

    Note that some operators return identical results but -are syntactically different: -%[<]% and %[<)% both evaluate x < a; -%[>]% and %(>]% both evaluate x > b; -%(<]% and %(<)% evaluate x <= a; -%[>)% and %(>)% both evaluate x >= b. -This is so because we evaluate only one end of the interval -but still conceptually referring to the relationship -defined by the right-hand-side interval object -and given that a <= b. -This implies 2 conditional logical evaluations -instead of treating it as a single 3-level ordered factor.

    -

    Value

    - -

    A logical vector, indicating if x is in the specified interval. -Values are TRUE, FALSE, or NA -(when any of the 3 values (x or endpoints in interval) -are NA).

    -

    The helper function intrval_types -can be used to understand and visualize the operators' effects. -It returns a matrix explaining the properties of the operators.

    -

    See also

    - -

    See help page for relational operators: Comparison.

    -

    See %[o]% for relational operators for -interval-to-interval comparisons.

    -

    See factor for the behavior with factor arguments. -See also %in% for value matching -and %ni% for negated value matching -for factors.

    -

    See Syntax for operator precedence.

    - -

    Examples

    -
    ## motivating example from example(lm) - -## Annette Dobson (1990) "An Introduction to Generalized Linear Models". -## Page 9: Plant Weight Data. -ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) -trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) -group <- gl(2, 10, 20, labels = c("Ctl","Trt")) -weight <- c(ctl, trt) -lm.D9 <- lm(weight ~ group) -## compare 95% confidence intervals with 0 -(CI.D9 <- confint(lm.D9))
    #> 2.5 % 97.5 % -#> (Intercept) 4.56934 5.4946602 -#> groupTrt -1.02530 0.2833003
    0 %[]% CI.D9
    #> (Intercept) groupTrt -#> FALSE TRUE
    -## comparing dates - -DATE <- as.Date(c("2000-01-01","2000-02-01", "2000-03-31")) -DATE %[<]% as.Date(c("2000-01-151", "2000-03-15"))
    #> [1] TRUE FALSE FALSE
    DATE %[]% as.Date(c("2000-01-151", "2000-03-15"))
    #> [1] FALSE TRUE FALSE
    DATE %[>]% as.Date(c("2000-01-151", "2000-03-15"))
    #> [1] FALSE FALSE TRUE
    -## interval formats - -x <- rep(4, 5) -a <- 1:5 -b <- 3:7 -cbind(x=x, a=a, b=b)
    #> x a b -#> [1,] 4 1 3 -#> [2,] 4 2 4 -#> [3,] 4 3 5 -#> [4,] 4 4 6 -#> [5,] 4 5 7
    x %[]% cbind(a, b) # matrix
    #> [1] FALSE TRUE TRUE TRUE FALSE
    x %[]% data.frame(a=a, b=b) # data.frame
    #> [1] FALSE TRUE TRUE TRUE FALSE
    x %[]% list(a, b) # list
    #> [1] FALSE TRUE TRUE TRUE FALSE
    -## helper functions - -intrval_types() # print
    #> Expression Visual Condition -#> %[]% x %[]% c(a, b) ---x===x--- x >= a & x <= b -#> %)(% x %)(% c(a, b) ===o---o=== x < a | x > b -#> %[<]% x %[<]% c(a, b) ===o---o--- x < a -#> %[>]% x %[>]% c(a, b) ---o---o=== x > b -#> %[)% x %[)% c(a, b) ---x===o--- x >= a & x < b -#> %)[% x %)[% c(a, b) ===o---x=== x < a | x >= b -#> %[<)% x %[<)% c(a, b) ===o---o--- x < a -#> %[>)% x %[>)% c(a, b) ---o---x=== x >= b -#> %(]% x %(]% c(a, b) ---o===x--- x > a & x <= b -#> %](% x %](% c(a, b) ===x---o=== x <= a | x > b -#> %(<]% x %(<]% c(a, b) ===x---o--- x <= a -#> %(>]% x %(>]% c(a, b) ---o---o=== x > b -#> %()% x %()% c(a, b) ---o===o--- x > a & x < b -#> %][% x %][% c(a, b) ===x---x=== x <= a | x >= b -#> %(<)% x %(<)% c(a, b) ===x---o--- x <= a -#> %(>)% x %(>)% c(a, b) ---o---x=== x >= b
    intrval_types(plot = TRUE) # plot
    -## graphical examples - -## bounding box -set.seed(1) -n <- 10^4 -x <- runif(n, -2, 2) -y <- runif(n, -2, 2) -iv1 <- x %[]% c(-1, 1) & y %[]% c(-1, 1) -plot(x, y, pch = 19, cex = 0.25, col = iv1 + 1, main = "Bounding box")
    -## time series filtering -x <- seq(0, 4*24*60*60, 60*60) -dt <- as.POSIXct(x, origin="2000-01-01 00:00:00") -f <- as.POSIXlt(dt)$hour %[]% c(0, 11) -plot(sin(x) ~ dt, type="l", col="grey", - main = "Filtering date/time objects")
    points(sin(x) ~ dt, pch = 19, col = f + 1)
    -## watch precedence -(2 * 1:5) %[]% (c(2, 3) * 2)
    #> [1] FALSE TRUE TRUE FALSE FALSE
    2 * 1:5 %[]% (c(2, 3) * 2)
    #> [1] 0 0 0 2 2
    (2 * 1:5) %[]% c(2, 3) * 2
    #> [1] 2 0 0 0 0
    2 * 1:5 %[]% c(2, 3) * 2
    #> [1] 0 4 4 0 0
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/ni.html b/docs/reference/ni.html deleted file mode 100644 index 14f9f15..0000000 --- a/docs/reference/ni.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - -Negated Value Matching — %ni% • intrval - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    %ni% is the negation of %in%, -which returns a logical vector indicating if there is a non-match or not -for its left operand. %nin% and %notin% are aliases for -better code readability (%in% can look very much like %ni%).

    -
    - -
    x %ni% table
    -x %nin% table
    -x %notin% table
    - -

    Arguments

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

    vector or NULL: the values to be matched.

    table

    vector or NULL: the values to be matched against.

    - -

    Value

    - -

    A logical vector, indicating if a non-match was located for each element of -x: thus the values are TRUE or FALSE and never NA.

    -

    See also

    - -

    All the opposite of what is written for %in%.

    -

    See relational operators for intervals: %[]%.

    -

    See Syntax for operator precedence.

    - -

    Examples

    -
    1:10 %ni% c(1,3,5,9)
    #> [1] FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE
    1:10 %nin% c(1,3,5,9)
    #> [1] FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE
    1:10 %notin% c(1,3,5,9)
    #> [1] FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE
    -sstr <- c("c","ab","B","bba","c",NA,"@","bla","a","Ba","%") -sstr[sstr %ni% c(letters, LETTERS)]
    #> [1] "ab" "bba" NA "@" "bla" "Ba" "%"
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/ovrlap.html b/docs/reference/ovrlap.html deleted file mode 100644 index 1f474e5..0000000 --- a/docs/reference/ovrlap.html +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - - - -Relational Operators Comparing Two Intervals — ovrlap • intrval - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Functions for evaluating if two intervals overlap or not.

    -
    - -
    interval1 %[o]% interval2
    -interval1 %)o(% interval2
    -interval1 %[<o]% interval2
    -interval1 %[o>]% interval2
    -
    -interval1 %(o)% interval2
    -interval1 %]o[% interval2
    -interval1 %(<o)% interval2
    -interval1 %(o>)% interval2
    -
    -interval1 %[]o[]% interval2
    -interval1 %[]o[)% interval2
    -interval1 %[]o(]% interval2
    -interval1 %[]o()% interval2
    -interval1 %[)o[]% interval2
    -interval1 %[)o[)% interval2
    -interval1 %[)o(]% interval2
    -interval1 %[)o()% interval2
    -interval1 %(]o[]% interval2
    -interval1 %(]o[)% interval2
    -interval1 %(]o(]% interval2
    -interval1 %(]o()% interval2
    -interval1 %()o[]% interval2
    -interval1 %()o[)% interval2
    -interval1 %()o(]% interval2
    -interval1 %()o()% interval2
    - -

    Arguments

    - - - - - - -
    interval1, interval2

    vector, 2-column matrix, list, or NULL: the interval end points -of two (sets) of closed intervals to compare.

    - -

    Details

    - -

    The operators define the open/closed nature of the lower/upper -limits of the intervals on the left and right hand side of the o -in the middle.

    -

    The overlap of two closed intervals, [a1, b1] and [a2, b2], -is evaluated by the %[o]% (alias for %[]o[]%) -operator (a1 <= b1, a2 <= b2). -Endpoints can be defined as a vector with two values -(c(a1, b1))or can be stored in matrix-like objects or a lists -in which case comparisons are made element-wise. -If lengths do not match, shorter objects are recycled. -These value-to-interval operators work for numeric (integer, real) -and ordered vectors, and object types which are measured at -least on ordinal scale (e.g. dates), see Examples. -Note: interval endpoints -are sorted internally thus ensuring the conditions -a1 <= b1 and a2 <= b2 is not necessary. -%)o(% is used for the negation of two closed interval overlap, -directional evaluation is done via the operators -%[<o]% and %[o>]%.

    -

    The overlap of two open intervals -is evaluated by the %(o)% (alias for %()o()%). -%]o[% is used for the negation of two open interval overlap, -directional evaluation is done via the operators -%(<o)% and %(o>)%.

    -

    Overlap operators with mixed endpoint do not have -negation and directional counterparts.

    -

    Value

    - -

    A logical vector, indicating if interval1 overlaps interval2. -Values are TRUE, FALSE, or NA.

    -

    See also

    - -

    See help page for relational operators: Comparison.

    -

    See %[]% for relational operators for -value-to-interval comparisons.

    -

    See factor for the behavior with factor arguments. -See also %in% for value matching -and %ni% for negated value matching -for factors.

    -

    See Syntax for operator precedence.

    - -

    Examples

    -
    ## motivating examples from example(lm) - -## Annette Dobson (1990) "An Introduction to Generalized Linear Models". -## Page 9: Plant Weight Data. -ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) -trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) -group <- gl(2, 10, 20, labels = c("Ctl","Trt")) -weight <- c(ctl, trt) -lm.D90 <- lm(weight ~ group - 1) # omitting intercept -## compare 95% confidence of the 2 groups to each other -(CI.D90 <- confint(lm.D90))
    #> 2.5 % 97.5 % -#> groupCtl 4.56934 5.49466 -#> groupTrt 4.19834 5.12366
    CI.D90[1,] %[o]% CI.D90[2,]
    #> 2.5 % -#> TRUE
    -## simple interval comparisons -c(2:3) %[o]% c(0:1)
    #> [1] FALSE
    -## vectorized comparisons -c(2:3) %[o]% list(0:4, 1:5)
    #> [1] FALSE TRUE TRUE TRUE FALSE
    c(2:3) %[o]% cbind(0:4, 1:5)
    #> [1] FALSE TRUE TRUE TRUE FALSE
    c(2:3) %[o]% data.frame(a=0:4, b=1:5)
    #> [1] FALSE TRUE TRUE TRUE FALSE
    list(0:4, 1:5) %[o]% c(2:3)
    #> [1] FALSE TRUE TRUE TRUE FALSE
    cbind(0:4, 1:5) %[o]% c(2:3)
    #> [1] FALSE TRUE TRUE TRUE FALSE
    data.frame(a=0:4, b=1:5) %[o]% c(2:3)
    #> [1] FALSE TRUE TRUE TRUE FALSE
    -list(0:4, 1:5) %[o]% cbind(rep(2,5), rep(3,5))
    #> [1] FALSE TRUE TRUE TRUE FALSE
    cbind(rep(2,5), rep(3,5)) %[o]% list(0:4, 1:5)
    #> [1] FALSE TRUE TRUE TRUE FALSE
    -cbind(rep(3,5),rep(4,5)) %)o(% cbind(1:5, 2:6)
    #> [1] TRUE FALSE FALSE FALSE TRUE
    cbind(rep(3,5),rep(4,5)) %[<o]% cbind(1:5, 2:6)
    #> [1] FALSE FALSE FALSE FALSE TRUE
    cbind(rep(3,5),rep(4,5)) %[o>]% cbind(1:5, 2:6)
    #> [1] TRUE FALSE FALSE FALSE FALSE
    -## open intervals - -list(0:4, 1:5) %(o)% cbind(rep(2,5), rep(3,5))
    #> [1] FALSE FALSE TRUE FALSE FALSE
    cbind(rep(2,5), rep(3,5)) %(o)% list(0:4, 1:5)
    #> [1] FALSE FALSE TRUE FALSE FALSE
    -cbind(rep(3,5),rep(4,5)) %]o[% cbind(1:5, 2:6)
    #> [1] TRUE TRUE FALSE TRUE TRUE
    cbind(rep(3,5),rep(4,5)) %(<o)% cbind(1:5, 2:6)
    #> [1] FALSE FALSE FALSE TRUE TRUE
    cbind(rep(3,5),rep(4,5)) %(o>)% cbind(1:5, 2:6)
    #> [1] TRUE TRUE FALSE FALSE FALSE
    -dt1 <- as.Date(c("2000-01-01", "2000-03-15")) -dt2 <- as.Date(c("2000-03-15", "2000-06-07")) - -dt1 %[]o[]% dt2
    #> [1] TRUE
    dt1 %[]o[)% dt2
    #> [1] TRUE
    dt1 %[]o(]% dt2
    #> [1] FALSE
    dt1 %[]o()% dt2
    #> [1] FALSE
    dt1 %[)o[]% dt2
    #> [1] FALSE
    dt1 %[)o[)% dt2
    #> [1] FALSE
    dt1 %[)o(]% dt2
    #> [1] FALSE
    dt1 %[)o()% dt2
    #> [1] FALSE
    dt1 %(]o[]% dt2
    #> [1] TRUE
    dt1 %(]o[)% dt2
    #> [1] TRUE
    dt1 %(]o(]% dt2
    #> [1] FALSE
    dt1 %(]o()% dt2
    #> [1] FALSE
    dt1 %()o[]% dt2
    #> [1] FALSE
    dt1 %()o[)% dt2
    #> [1] FALSE
    dt1 %()o(]% dt2
    #> [1] FALSE
    dt1 %()o()% dt2
    #> [1] FALSE
    -## watch precedence -(2 * c(1, 3)) %[o]% (c(2, 4) * 2)
    #> [1] TRUE
    (2 * c(1, 3)) %[o]% c(2, 4) * 2
    #> [1] 2
    2 * c(1, 3) %[o]% (c(2, 4) * 2)
    #> [1] 0
    2 * c(1, 3) %[o]% c(2, 4) * 2
    #> [1] 4
    -
    - -
    - - - -
    - - - - - - - -