Learn R Programming

useful (version 1.2.6)

interval.check: interval.check

Description

Check which interval a number belongs to

Usage

interval.check(data, input = "Stop", times, fun = "

Value

Vector indicating which element of times that row belongs to. If the row is beyond any element NA is in it's spot.

Arguments

data

data.frame

input

character name of column we wish to compare

times

vector in ascending order where the differences between sequential elements are the intervals

fun

character containing comparator

Author

Jared P. Lander

Details

This function takes in a data.frame with a specified column and compares that to a vector of times

Examples

Run this code

head(cars)
interval.check(cars, input="speed", times=seq(min(cars$speed), max(cars$speed), length=10))

Run the code above in your browser using DataLab