There are four main types of functions in wpa: 1. Standard Analysis 2. Report Generation 3. Advanced / Support Functions 4. Sample datasets
Standard Analysis functions are the most common type of functions in wpa. They typically accept a data frame as an input (usually requiring a Standard Person Query), and can return either a pre-designed graph as a ggplot object, or a summary data table as a data frame.
Here is an example of
collaboration_sum(sq_data, return = "plot")
For the standard functions, there are six basic plot types which could be paired with six different key metrics. The six plot types are:
_summary(): produces a summary bar plot of the metric.
_dist(): produces a stacked bar plot of the metric.
_fizz(): produces a jittered, ‘fizzy drink’ plot of the metric.
_line(): produces a time-series line plot of the metric, with organizational attributes shown as facets.
_trend(): produces heatmap bars of the metric to show intensity over time.
_rank(): produces a rank table of all sub-groups (as per a set of organizational attributes) for a given metric. This is the only exception where the function returns a data frame by default, rather than a plot.
The six key metrics are:
collab: stands for Collaboration Hours, and uses the metric
meeting: stands for Meeting Hours, and uses the metric
afterhours: stands for After-hours Collaboration Hours, and uses the metric
one2one: stands for one-to-one collaboration hours with direct manager. Uses the metric
workloads: stands for Work Week Span, and uses the metric
You can combine the plot types and the key metrics (as prefixes and suffixes) to generate the desired output, e.g.
For more advanced users, there are also a number of flexible analysis functions which allow you to generate the plots with any Workplace Analytics metric, where the metric name needs to be supplied in addition to the function. For instance,
create_bar(sq_data, metric = "Email_hours")
would return a similar result as
email_summary(sq_data), but where you can replace the metric with one of your own choice. Here are some of the available flexible analysis functions, which are typically prefixed with
You can find out more about the feature of each individual function by running
?function once you have the package loaded.
Report Generation functions are a special class of functions within wpa which outputs an interactive HTML report on a specific area based on the data you supply.
This group consists of miscellaneous functions which either perform a specific piece of analysis (e.g. computing the Information Value score), or are designed to be used with Standard Analysis functions.
A significant example of this is
export(), which you can use with a Standard Analysis function to:
There are several pre-loaded demo Workplace Analytics datasets that you can use straight away from the package, to help you explore the functions more easily. Here is a list of them:
sq_data: Standard Person Query
mt_data: Standard Meeting Query
em_data: Hourly Collaboration Query
g2g_data: Group-to-group Query
You can explore the structure of these datasets by running
dplyr::glimpse(sq_data), for instance.