## Some mid() function examples
## With IntervalData
interval <- IntervalData(0, 1)
spr(interval)
spr(interval) <- 0.75
spr(interval)
## With IntervalList
list <- IntervalList(c(1, 3, 5), c(2, 4, 6))
spr(list[c(1, 3)])
spr(list[c(1, 3)]) <- c(1, 3)
spr(list[c(1, 3)])
## With IntervalMatrix
m <- IntervalMatrix(matrix(c(1, 5, 2, 6, 6, 2,
7, 3, 3, 4, 4, 5), 2, 6))
spr(m[1, 1])
spr(m[1, 1]) <- 2
spr(m[1, 1])
spr(m[1, 1:2])
spr(m[1, 1:2]) <- c(2, 3)
spr(m[1, 1:2])
spr(m[, c(1, 3)])
spr(m[, c(1, 3)]) <- matrix(1:4, 2, 2)
spr(m[, c(1, 3)])
Run the code above in your browser using DataLab