numero: returns the positions of identifiers

Description Usage Arguments Value Examples

View source: R/f0.rbsb1.code.r

Description

Returns the positions of identifiers. From a reference set of identifiers 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
numero(qui, dans, strict=TRUE, repe=TRUE)

Arguments

qui

Identifiers the position of them is looked for. Must be a character or a numeric.

dans

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

strict

Must qui be a subset of dans.

repe

Are repeatitions allowed?

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
 rbsb3k("RESET"); # needed only for R checking, to be forgotten
 numero(10:1, 1:10);
 numero(c("Z", "E", "P", "L", "I", "N"), LETTERS);
 numero(c("B", "o", "F", "!"), LETTERS, strict=FALSE);
 numero(c("B", "E", "B", "E"), LETTERS);

rbsb documentation built on May 31, 2017, 1:45 a.m.