Skip to content

Data

scgUtils comes with a number of functions for processing and exploring survey data easily. It also contains a sample dataset, “survey”.

survey
Wave 25 of the 2014-2023 British Election Study Internet Panel
survey_wt
Wave 25 of the 2014-2023 British Election Study Internet Panel

Processing

Functions for accessing and processing labelled data.

get_data()
Get Dataset
get_file()
Retrieve and Process File from Various Sources
get_question()
Retrieve Original Question Label
process_factors()
Remove Unused Levels from Factors

Exploring

Functions for exploring data, including the creation of crosstabs.

compile()
Compile Multiple Data Frames into One
crosstab()
Produce Crosstabs / Contingency Tables for Analysis
grid_vars()
Pivot Binary Grid Survey Questions Longer
grp_freq()
Grouped Frequencies in Survey Data
grp_mean()
Calculate Grouped Mean in Survey Data

Visualisation

Functions to visualise data

plot_bars()
Plot Bar Charts with Grouped Frequencies and Percentages
plot_bigfive()
Visualise Big Five Personality Traits with Radar Plots
plot_binary()
Visualise Binary Survey Data with Bar Plots
plot_likert()
Visualise Likert Scales with Stacked, Divergent, and Facetted Bar Plots
plot_parliament()
Visualise Parliamentary Seats by Party
plot_popn()
Visualise Population Profile of Survey Data
plot_sankey()
Visualise Data Flow with a Sankey Diagram
plot_waffle()
Create a Waffle Plot

Styling

scgUtils comes with a number of functions to assist in styling graphs.

Colour

Colour functions for graphs.

colour_pal()
Get Colour Palettes
colour_display()
Diplay Colour Options
colour_prep()
Prepare a Named Colour Palette for Data Columns

Themes

theme_scg()
Custom Theme for scg Plots