get_length_range {Tivy}R Documentation

Get length range from frequencies

Description

Finds the minimum or maximum length with positive frequency.

Usage

get_length_range(frequency, length, type = "min")

Arguments

frequency

Numeric vector of length frequencies.

length

Numeric vector of corresponding lengths.

type

Either "min" or "max" to specify which range to return.

Value

Minimum or maximum length value with frequency > 0.

Examples

freq <- c(0, 0, 1, 2, 3, 4, 2, 1, 0)
lengths <- c(5, 6, 7, 8, 9, 10, 11, 12, 13)
min_length <- get_length_range(freq, lengths, type = "min")
max_length <- get_length_range(freq, lengths, type = "max")


[Package Tivy version 0.1.0 Index]