Skip to contents

Title

Usage

facet_barchart(.data, xcol, ycol, groupcol, textsize = 1, diffcolours = TRUE)

Arguments

.data

A dataframe containing your data, ideally a 3 column dataframe with one value column and two categorical columns

xcol

The column which contains the variable to go on the x axis of the column chart

ycol

The column which contains the value to go on the y axis

groupcol

The column which contains the categorical variable which the graphs will be faceted by

textsize

The text size, initially set to 1, the size is a ratio to the normal dluhc_style size of 2

diffcolours

A TRUE/FALSE variable which determines if you want each of the charts to have the same colour, or for each graph to have one of the six colours from the DLUHC theme. If you want neither of these options, this can be overridden with the scale_fill_manual() ggplot function.

Value

a ggplot object

Examples

df <- dluhctheme::Net_Additions_Regional
df <- dplyr::filter(df,Region %in% c("North East","North West","South East","South West","London", "East Midlands"))
df$year <- substr(df$Year,7,10)
facet_barchart(df,xcol = year,ycol = Net_Additions,groupcol=Region)