dgroup {UpAndDownPlots}R Documentation

Draws UpAndDown plots for different grouping variables

Description

This function draws plots to compare the effects of different grouping variables.

Usage

dgroup(data, byvars, weight=1, v1, v2)

Arguments

data

the dataset to be analysed

byvars

the grouping variables to be used

weight

a variable for weighting the individual items, the default is for every item to be weighted equally

v1

the variable specifying the start value in the comparison

v2

the variable specifying the end value in the comparison

Details

This function prepares UpAndDown plots showing percentage and absolute changes for different grouping variables. All unlabelled plots have the same vertical scale to ease comparisons. Scales of labelled plots are affected by label lengths.

To draw an unlabelled or labelled set of plots, apply grid.arrange to the appropriate output of dgroup.

Value

uad

unlabelled horizontal UpAndDown plots

uadl

vertical UpAndDown plots with labelling

Author(s)

Antony Unwin unwin@math.uni-augsburg.de

Examples

library(gridExtra)
zs <- dgroup(NIpop, byvars=c("age", "gender", "LGD2014_name", "area_name"), v1="y2011", v2="y2017")
grid.arrange(zs$uadg)
grid.arrange(zs$uadgl)

[Package UpAndDownPlots version 0.5.0 Index]