Ind: An indicator function to reveal if a given observation belong...

Description Usage Arguments Value

Description

An indicator function to reveal if a given observation belong to a specified event.

Usage

1
2
Ind(x, .type = "c", event, border_criteria = c("<=", "<="),
  .res_type = "L")

Arguments

x

A vector of observations from some distribution.

.type

Either "c" for continuous (default) or "d" for discrete. If the value is "c", then event must be a numeric vector of length 2, otherwise it can be a vector of any length.

event

A numeric vector. The vector must have length 2 when .type="c", since the values then will be used as the lower and upper limits of an interval. The argument border_criteria endpoints of the intervals are included in the event.

border_criteria

A vector of length two, that must be one the following four: c("<=", "<=") (default), c("<", "<="), c("<", "<"), c("<", "<="). This is needed when .type="c", since it will govern whether or not the endpoints of the interval should be included in event. This argument is ignored when .type="d".

.res_type

Either "L" for logical (default) or "I" for integer. Governs the format of the resulting vector.

Value

This function will return vector of the same length as x, which depending on .res_type either will be of type logical or of type integer. The values will be used to indicate whether or not the observations in x was contained in the set defined by event.


LAJordanger/HVLstatistikk documentation built on June 21, 2019, 7:56 p.m.