set.seed(999)
dat <- as.Date(Sys.Date()) + sample(-3:50, 100, replace = TRUE)
x <- incidence(dat, interval = "month")
# the value stored in the interval element
get_interval(x)
# the numeric value of the interval in days
get_interval(x, integer = FALSE)
# the number of observations in the object
get_n(x)
# the length of time represented
get_timespan(x)
# the number of groups
ncol(x)
# the number of bins (intervals)
nrow(x)
Run the code above in your browser using DataLab