Learn R Programming

useful (version 1.2.0)

interval.check: interval.check

Description

Check which interval a number belongs to

Usage

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

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 compator

Value

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

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