R/classes.R

Defines functions plot.ascfcd_transitions summary.ascfcd_transitions print.ascfcd_transitions plot.ascfcd_entities summary.ascfcd_entities print.ascfcd_entities summary.ascfcd_space print.ascfcd_space summary.ascfcd_base print.ascfcd_base plot.ascfcd_pw summary.ascfcd_pw print.ascfcd_pw plot.ascfcd summary.ascfcd print.ascfcd .is_pairwise .is_paired

Documented in plot.ascfcd plot.ascfcd_entities plot.ascfcd_pw plot.ascfcd_transitions print.ascfcd print.ascfcd_base print.ascfcd_entities print.ascfcd_pw print.ascfcd_space print.ascfcd_transitions summary.ascfcd summary.ascfcd_base summary.ascfcd_entities summary.ascfcd_pw summary.ascfcd_space summary.ascfcd_transitions

# ==============================================================================
# CLASS NAMES
# ==============================================================================
# Since 0.5.1 the classes are named after the function that creates each
# object (ascent_paired, ascent_pairwise, ascent_baseline, ascent_space,
# ascent_entities, ascent_transitions). New objects also carry the class of
# 0.5.0 (ascfcd, ascfcd_pw, ...) as a second class, so code written for 0.5.0
# keeps working, and the methods below handle objects saved with 0.5.0, which
# have only the old class. The old names will be dropped in 0.6.0.

# Objects from asc_paired() (internal)
.is_paired <- function(x) inherits(x, c("ascent_paired", "ascfcd"))

# Objects from asc_pairwise() (internal)
.is_pairwise <- function(x) inherits(x, c("ascent_pairwise", "ascfcd_pw"))

#' Methods for objects created with ascent 0.5.0
#'
#' @description
#' In ascent 0.5.0 the classes had other names (\code{ascfcd},
#' \code{ascfcd_pw}, \code{ascfcd_base}, \code{ascfcd_space},
#' \code{ascfcd_entities} and \code{ascfcd_transitions}). Since 0.5.1 they are
#' named after the function that creates each object (\code{ascent_paired},
#' \code{ascent_pairwise}, \code{ascent_baseline}, \code{ascent_space},
#' \code{ascent_entities} and \code{ascent_transitions}). These methods let
#' \code{print()}, \code{summary()} and \code{plot()} work with objects saved
#' with 0.5.0. They will be removed in 0.6.0: re-create old objects with the
#' current version.
#'
#' @param x,object An object created with ascent 0.5.0.
#' @param ... Passed to the method for the current class.
#'
#' @return The same as the method for the current class.
#' @name ascent-legacy-classes
#' @keywords internal
NULL

#' @rdname ascent-legacy-classes
#' @export
print.ascfcd <- function(x, ...) print.ascent_paired(x, ...)
#' @rdname ascent-legacy-classes
#' @export
summary.ascfcd <- function(object, ...) summary.ascent_paired(object, ...)
#' @rdname ascent-legacy-classes
#' @export
plot.ascfcd <- function(x, ...) plot.ascent_paired(x, ...)

#' @rdname ascent-legacy-classes
#' @export
print.ascfcd_pw <- function(x, ...) print.ascent_pairwise(x, ...)
#' @rdname ascent-legacy-classes
#' @export
summary.ascfcd_pw <- function(object, ...) summary.ascent_pairwise(object, ...)
#' @rdname ascent-legacy-classes
#' @export
plot.ascfcd_pw <- function(x, ...) plot.ascent_pairwise(x, ...)

#' @rdname ascent-legacy-classes
#' @export
print.ascfcd_base <- function(x, ...) print.ascent_baseline(x, ...)
#' @rdname ascent-legacy-classes
#' @export
summary.ascfcd_base <- function(object, ...) summary.ascent_baseline(object, ...)

#' @rdname ascent-legacy-classes
#' @export
print.ascfcd_space <- function(x, ...) print.ascent_space(x, ...)
#' @rdname ascent-legacy-classes
#' @export
summary.ascfcd_space <- function(object, ...) summary.ascent_space(object, ...)

#' @rdname ascent-legacy-classes
#' @export
print.ascfcd_entities <- function(x, ...) print.ascent_entities(x, ...)
#' @rdname ascent-legacy-classes
#' @export
summary.ascfcd_entities <- function(object, ...) summary.ascent_entities(object, ...)
#' @rdname ascent-legacy-classes
#' @export
plot.ascfcd_entities <- function(x, ...) plot.ascent_entities(x, ...)

#' @rdname ascent-legacy-classes
#' @export
print.ascfcd_transitions <- function(x, ...) print.ascent_transitions(x, ...)
#' @rdname ascent-legacy-classes
#' @export
summary.ascfcd_transitions <- function(object, ...) summary.ascent_transitions(object, ...)
#' @rdname ascent-legacy-classes
#' @export
plot.ascfcd_transitions <- function(x, ...) plot.ascent_transitions(x, ...)

Try the ascent package in your browser

Any scripts or data that you put into this service are public.

ascent documentation built on Nov. 30, 2026, 1:07 a.m.