# Create a random dataset of 100 changes (between 100 and 0 Ma):
change_times <- stats::runif(n = 100, min = 0, max = 100)
# Create 10 equal-length time bins:
time_bins <- matrix(data = c(seq(from = 100, to = 10, length.out = 10),
seq(from = 90, to = 0, length.out = 10)), ncol = 2,
dimnames = list(LETTERS[1:10], c("fad", "lad")))
# Set class as timeBins:
class(time_bins) <- "timeBins"
# Get N changes for each bin:
bin_changes(change_times = change_times, time_bins = time_bins)
Run the code above in your browser using DataLab