Learn R Programming

oce (version 0.9-23)

findInOrdered: Find indices of times in an ordered vector [deprecated]

Description

WARNING: This function will be removed soon; see oce-deprecated. The replacement is trivial: just change a call like e.g. findInOrdered(x,f) to findInterval(f,x) (which is what the function started doing, on 2017-09-07, after a major bug was found).

Usage

findInOrdered(x, f)

Arguments

x

a numeric vector, in increasing order by value.

f

a numeric vector of items whose indices are sought.

Value

A numerical vector indicating the indices of left-sided neighbors.

Details

The indices point to the largest items in x that are less than or equal the values in f. This works by simply calling findInterval(x=f, vec=x), and users are probably better off using findInterval directly.

Examples

Run this code
# NOT RUN {
findInOrdered(seq(0, 10, 1), c(1.2, 7.3))
# }

Run the code above in your browser using DataLab