invwhich: Inverse of which.

Description Usage Arguments Value Author(s) Examples

Description

Converts a vector of indices to a logical vector.

Usage

1
invwhich(indices, length.out, useNames = TRUE)

Arguments

indices

A vector of indices.

length.out

The length of the output

use.names

Whether names of indices should be used.

Value

A logical vector of length length.out with TRUE at the positions specified in indices and FALSE elsewhere.

Author(s)

flying sheep (http://stackoverflow.com/a/31114463/4477223)

Examples

1
invwhich(c(5, 3, 7), 10)

DominikMueller64/dmisc documentation built on May 6, 2019, 2:52 p.m.