posi9: returns the positions of identifiers

Description Usage Arguments Value Examples

View source: R/rbsa0.code.r

Description

Returns the positions of identifiers (an identifier is character(1) or integer(1)). From a reference set of identifiers (a vector in fact) returns the positions of some of them. If they don't belong to the list, an error is issued according to strict. If there are repetitions an error is issued or not according to repe.

Usage

1
2
3
 
  posi9(which,within,strict=TRUE,repe=TRUE,
        monitor=rbsa0$monitor$v) 

Arguments

which

Identifiers, their position is looked for. Must be a character or a numeric.

within

The ordered vector of all identifiers. Must be a character or a numeric of distinct values.

strict

Must which be a subset of within.

repe

Are repetitions allowed?

monitor

List of constants indicating the monitoring choices, see the rbsa0$monitor$v provided object as an example.

Value

A numeric vector of the positions. It is named with the identifiers. When the identifier does not belong to the list and strict is FALSE, NA values are returned.

Examples

1
2
3
4
5
6
 
  posi9(10:1,1:10); 
  posi9(c("Z","E","P","L","I","N"),LETTERS); 
  posi9(c("B","o","F","!"),LETTERS,strict=FALSE); 
  posi9(c("B","E","B","E"),LETTERS); 
  ## Not run: posi9(c("B","E","B","E"),LETTERS,repe=FALSE); 

rbsa documentation built on May 2, 2019, 6:07 p.m.