agepyramid: Age Pyramid

View source: R/agepyramid.h.R

agepyramidR Documentation

Age Pyramid

Description

Age Pyramid

Usage

agepyramid(
  data,
  age,
  gender,
  female,
  bin_width = 5,
  plot_title = "Age Pyramid"
)

Arguments

data

The data as a data frame.

age

a string naming the variable from data that contains the continuous values used for the report

gender

a string naming the variable from data that contains the categorical values used for the report

female

a string naming the level from gender that contains the level female

bin_width

The width of the age bins in years. Adjust this to change the granularity of the age groups.

plot_title

The title displayed on the age pyramid plot.

Value

A results object containing:

results$pyramidTable a table
results$plot an image

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$pyramidTable$asDF

as.data.frame(results$pyramidTable)


sbalci/ClinicoPathJamoviModule documentation built on Feb. 25, 2025, 6:34 a.m.