Learn R Programming

RtsEva (version 1.1.0)

findMax: findMax

Description

findMax is a function that takes a subset of a vector and returns the index of the maximum value in that subset.

Usage

findMax(subIndxs, srs)

Value

The index of the maximum value in the subset.

Arguments

subIndxs

A numeric vector representing the subset of indices to consider.

srs

A vector of numerical data

Examples

Run this code
srs <- c(10, 20, 30, 40, 50)
findMax(c(1, 3, 5),srs)
#result is 5.

Run the code above in your browser using DataLab