Learn R Programming

smoothSurv (version 0.7)

piece: Left Continuous Piecewise Constant Function with a Finite Support.

Description

Function to evaluate a left continuous piecewise constant function with a finite support.

Usage

piece(x, breaks, values)

Arguments

x
Vector of values where the piecewise constant function should be evaluated.
breaks
Vector of sorted breakpoints of the piecewise constant function.
values
Values of the piecewise constant function. It takes the value value[i] on the interval (breaks[i], breaks[i+1]]. The function is assumed to be zero outside its range specified as (breaks[1], breaks[length

Value

  • The value of the piecewise constant function.

Examples

Run this code
my.breaks <- c(-2, 1.5, 4, 7)
my.values <- c(0.5, 0.9, -2)
grid <- seq(-3, 8, by = 0.25)
piece(grid, my.breaks, my.values)

Run the code above in your browser using DataLab