January 26, 2017 Code R functions special intrval

An update (v 0.1-1) of the **intrval** package was recently published on CRAN. The package simplifies interval related logical operations (read more about the motivation in this post).
So what is new in this version? Some of the inconsistencies in the 1st CRAN release have been cleaned up, and I have been pushed hard (see GitHub issue to implement all the 16
interval-to-interval operators.
These 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 as in `c(a1, b1) %[]o[]% c(a2, b2)`

.

Interval 1: | Interval 2: `[]` |
`[)` |
`(]` |
`()` |
---|---|---|---|---|

`[]` |
`%[]o[]%` |
`%[]o[)%` |
`%[]o(]%` |
`%[]o()%` |

`[)` |
`%[)o[]%` |
`%[)o[)%` |
`%[)o(]%` |
`%[)o()%` |

`(]` |
`%(]o[]%` |
`%(]o[)%` |
`%(]o(]%` |
`%(]o()%` |

`()` |
`%()o[]%` |
`%()o[)%` |
`%()o(]%` |
`%()o()%` |

The overlap of two closed intervals, [a1, b1] and [a2, b2],
is evaluated by the `%[]o[]%`

(`%[o]%`

is an alias)
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).
Note that 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 (`%[o]%`

),
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.

Equal | Not equal | Less than | Greater than |
---|---|---|---|

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

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

Thanks for all the feedback so far and please keepâ€™em coming: leave a comment below or use the issue tracker to provide feedback or report a problem.

In a paper recently published in the Condor, titled *Evaluating time-removal models for estimating availability of boreal birds during point-count surveys: sample size requirements and model complexity*, we assessed different ways of controlling for point-count duration in bird counts using data from the Boreal Avian Modelling Project. As the title indicates, the paper describes a cost-benefit analysis to make recommendations about when to use different types of the removal model. The paper is open access, so feel free to read the whole paper here).

- Fitting removal models with the detect R package
- Shiny slider examples with the intrval R package
- Phylogeny and species traits predict bird detectability
- PVA: Publication Viability Analysis, round 3
- The progress bar just got a lot cheaper

ABMI (6) ARU (1) C (1) CRAN (1) Hungary (2) JOSM (2) PVA (2) PVAClone (1) QPAD (2) R (20) R packages (1) bioacoustics (1) biodiversity (1) birds (2) course (2) data (1) data cloning (4) dclone (3) dependencies (1) detect (3) detectability (2) footprint (3) forecasting (1) functions (3) intrval (4) lhreg (1) mefa4 (1) monitoring (2) pbapply (5) phylogeny (1) plyr (1) poster (2) processing time (2) progress bar (4) publications (2) report (1) sector effects (1) shiny (1) single visit (1) site (1) slider (1) slides (2) special (3) species (1) trend (1) tutorials (2) video (4)