Learn R Programming

jollofR (version 0.6.5)

boxLine: boxLine: Produces two graphs - boxplots of disaggregated population counts across groups and a line plot showing the distribution of the aggregated totals of the disaggregated counts

Description

This function automatically generates two graphs that are combined together - (a) a boxplot of the distribution of the various groups' disaggregated population counts, and (b) a line graph of the aggregated counts across all groups (e.g., total number of individuals for each group). Here, the input data could come from any of the disaggregation functions within the 'jollofR' package such as 'cheesecake', 'cheesepop', 'slices' & 'spices'.

Usage

boxLine(dmat, xlab, ylab)

Value

A graphic image of two combined graphs - a boxplot and a line plot showing the distribution of the disaggregated population counts across the groups.

Arguments

dmat

A data frame containing the group-structured disaggregated population estimates which could be observed or from modelled estimates based on any of the functions - cheesecake', 'cheesepop', 'slices','spices', 'spray' , 'sprinkle', 'splash', 'spray', 'sprinkle1', 'splash1', or 'spray1'. considered.

xlab

A user-defined label for the x-axis (e.g., 'Age group').

ylab

A user-defined label for the y-axis (e.g., 'Population count').

Examples

Run this code
# \donttest{
if (requireNamespace("INLA", quietly = TRUE)) {
 library(ggplot2)
 data(toydata)
 result <- cheesepop(df = toydata$admin,output_dir = tempdir())
 boxLine(dmat=result$male_age_pop,
         xlab="Age group (years)",
         ylab = "Population Count")
}
# }

Run the code above in your browser using DataLab