R/dim.R
, R/get_interval.R
, R/get_n.R
, and 1 more
accessors.Rd
Access various elements of an incidence object
# S3 method for incidence dim(x) get_interval(x, ...) # S3 method for default get_interval(x, ...) # S3 method for incidence get_interval(x, integer = TRUE, ...) get_n(x) # S3 method for default get_n(x) # S3 method for incidence get_n(x) get_timespan(x) # S3 method for default get_timespan(x) # S3 method for incidence get_timespan(x)
x | an incidence object. |
---|---|
... | Unused |
integer | When |
dim()
the dimensions in the number of bins and number of groups
get_interval()
if integer = TRUE
: an integer vector, otherwise: the
value stored in x$interval
get_n()
The total number of cases stored in the object
get_timespan()
: an integer
denoting the timespan represented by the
incidence object.
get_counts()
to access the matrix of counts
get_dates()
to access the dates on the right, left, and center of the
interval.
group_names()
to access and possibly re-name the groups
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)#> [1] 31 31 30# the numeric value of the interval in days get_interval(x, integer = FALSE)#> [1] "month"# the number of observations in the object get_n(x)#> [1] 100# the length of time represented get_timespan(x)#> Time difference of 63 days#> [1] 1#> [1] 3