Learn R Programming

YEAB (version 1.0.6)

curv_index_int: Curvature index by numerical integration

Description

Curvature index by numerical integration

Usage

curv_index_int(cr, time_in)

Value

a numeric value that is the proportion of a rect triangle area minus the area under the curve

Arguments

cr

numeric, cumulative response

time_in

numeric, time (or the x axis in a cumulative response plot)

Examples

Run this code
data("r_times")
r_times <- r_times[r_times < 60]
cr <- seq_along(r_times)

plot(r_times, cr, type = "s")
curv_index_int(cr, r_times)
segments(
  x0 = min(r_times), y0 = min(cr),
  x1 = max(r_times), y1 = max(cr)
)
segments(
  x0 = min(r_times) + (max(r_times) - min(r_times)) / 2, y0 = min(cr),
  x1 = max(r_times), y1 = max(cr),
  col = "red"
)

Run the code above in your browser using DataLab