Learn R Programming

incidence2 (version 0.2.2)

accessors: Access various elements of an incidence object

Description

Access various elements of an incidence object

Usage

get_counts(x, ...)

# S3 method for default get_counts(x, ...)

# S3 method for incidence2 get_counts(x, ...)

get_counts_name(x, ...)

# S3 method for default get_counts_name(x, ...)

# S3 method for incidence2 get_counts_name(x, ...)

get_date_group_names(x, ...)

# S3 method for default get_date_group_names(x, ...)

# S3 method for incidence2 get_date_group_names(x, ...)

get_dates(x, ...)

# S3 method for default get_dates(x, ...)

# S3 method for incidence2 get_dates(x, ...)

get_dates_name(x, ...)

# S3 method for default get_dates_name(x, ...)

# S3 method for incidence2 get_dates_name(x, ...)

get_group_names(x, ...)

# S3 method for default get_group_names(x, ...)

# S3 method for incidence2 get_group_names(x, ...)

get_interval(x, ...)

# S3 method for default get_interval(x, ...)

# S3 method for incidence2 get_interval(x, integer = FALSE, ...)

get_n(x)

# S3 method for default get_n(x)

# S3 method for incidence2 get_n(x)

get_timespan(x, ...)

# S3 method for default get_timespan(x, ...)

# S3 method for incidence2 get_timespan(x, ...)

Arguments

x

An incidence() object.

...

Not used.

integer

When TRUE, the interval will be converted to an integer vector if it is stored as a character in the incidence object.

Value

  • get_counts: The count vector from x.

  • get_counts_name(): The name of the count variable of x.

  • get_date_group_names(): The names of the date group variables of x.

  • get_dates(): The date vector from x.

  • get_dates_name(): The name of the date variable of x.

  • get_group_names(): a character vector of the group variables of x or NULL if none are present.

  • get_interval(): if integer = TRUE, an integer vector, otherwise the character value of the interval

  • get_n() The total number of cases stored in the object

  • get_timespan(): an integer denoting the timespan in days represented by the incidence object.

Examples

Run this code
# NOT RUN {
if (requireNamespace("outbreaks", quietly = TRUE)) {
  withAutoprint({
    data(ebola_sim_clean, package = "outbreaks")
    dat <- ebola_sim_clean$linelist
    i <- incidence(dat,
                   date_index = date_of_onset,
                   groups = c(gender, hospital))

    get_counts(i)
    get_counts_name(i)

    get_group_names(i)

    get_dates(i)
    get_dates_name(i)

    get_date_group_names(i)

    get_interval(i)

    get_n(i)

    get_timespan(i)
  })
}

# }

Run the code above in your browser using DataLab