This function provides a custom print method for objects of class cd_data
,
displaying a summary of the dataset, including data dimensions, available years,
regions, variable groups, and any quality metrics associated with the data.
It uses the cli
package for enhanced, styled output.
Usage
# S3 method for class 'cd_data'
print(x, ...)
Value
Invisibly returns x
. This function is called for its side effect of printing
a formatted summary of the cd_data
object.
Details
This print method provides the following summary sections:
Data Summary: Shows the number of observations and variables in
merged_data
.Years Available: Lists unique years present in
merged_data
.Regions Available: Lists unique regions in the
adminlevel_1
column.Variable Groups: Displays predefined groups of variables, including ANC, delivery, vaccination, PNC, OPD, and IPD groups.
Quality Metrics: If present, prints
quality_metrics
for additional data insights.
Variable Groups
ancvargroup
: Variables related to antenatal care.idelvvargroup
: Variables related to delivery.vaccvargroup
: Variables related to vaccinations.pncvargroup
: Variables related to postnatal care.opdvargroup
: Variables related to outpatient care.ipdvargroup
: Variables related to inpatient care.
Examples
if (FALSE) { # \dontrun{
# Assuming `cd_data_obj` is an object of class `cd_data`:
print(cd_data_obj)
} # }