find: Find indices and values of nonzero elements

View source: R/find.R

findR Documentation

Find indices and values of nonzero elements

Description

Emulates behavior of find

Usage

find(x, sort = TRUE)

Arguments

x

object or logic operation on an object

sort

sort output?

Value

A vector of indices of x that satisfy the logical test (nonzero, by default).

Examples

X <- matrix(c(1, 0, 2, 0, 1, 1, 0, 0, 4), 3, byrow = TRUE)
Y <- seq(1, 19, 2)
find(X)
find(Y == 13)

matlab2r documentation built on Feb. 16, 2023, 10:39 p.m.

Related to find in matlab2r...