coerce_demog_change_component_df: Coerce to a 'demog_change_component_df'

coerce_demog_change_component_dfR Documentation

Coerce to a demog_change_component_df

Description

These functions coerce an object to a demog_change_component_df (or subclasses, as appropriate) if possible, or check if it is one.

Usage

as_demog_change_component_df(x, ...)

## Default S3 method:
as_demog_change_component_df(x, ...)

## S3 method for class 'data.frame'
as_demog_change_component_df(
  x,
  value_type = attr(x, "value_type"),
  value_scale = attr(x, "value_scale"),
  ...
)

## S3 method for class 'matrix'
as_demog_change_component_df(
  x,
  value_type = attr(x, "value_type"),
  value_scale = attr(x, "value_scale"),
  ...
)

## S3 method for class 'demog_change_component_df'
as_demog_change_component_df(x, ...)

is_demog_change_component_df(x)

Arguments

x

An object to coerce or check.

...

Further arguments passed to specific methods.

value_type

Scalar indicating the type of the “value” column (e.g., “count”, “rate”, etc.).

value_scale

Numeric scalar indicating the value_scale of the counts, e.g., 1, 1000, 1e6, etc.

Value

A coerced object in the case of the as_... functions; a logical for the is_... functions.

Author(s)

Mark Wheldon


markalava/ccmppWPP documentation built on April 21, 2022, 12:36 a.m.