Package: wpa 1.9.1

Martin Chan

wpa: Tools for Analysing and Visualising Viva Insights Data

Opinionated functions that enable easier and faster analysis of Viva Insights data. There are three main types of functions in 'wpa': (i) Standard functions create a 'ggplot' visual or a summary table based on a specific Viva Insights metric; (2) Report Generation functions generate HTML reports on a specific analysis area, e.g. Collaboration; (3) Other miscellaneous functions cover more specific applications (e.g. Subject Line text mining) of Viva Insights data. This package adheres to 'tidyverse' principles and works well with the pipe syntax. 'wpa' is built with the beginner-to-intermediate R users in mind, and is optimised for simplicity.

Authors:Martin Chan [aut, cre], Carlos Morales [aut], Mark Powers [ctb], Ainize Cidoncha [ctb], Rosamary Ochoa Vargas [ctb], Tannaz Sattari [ctb], Lucas Hogner [ctb], Jasminder Thind [ctb], Simone Liebal [ctb], Aleksey Ashikhmin [ctb], Ellen Trinklein [ctb], Microsoft Corporation [cph]

wpa_1.9.1.tar.gz
wpa_1.9.1.zip(r-4.5)wpa_1.9.1.zip(r-4.4)wpa_1.9.1.zip(r-4.3)
wpa_1.9.1.tgz(r-4.4-any)wpa_1.9.1.tgz(r-4.3-any)
wpa_1.9.1.tar.gz(r-4.5-noble)wpa_1.9.1.tar.gz(r-4.4-noble)
wpa_1.9.1.tgz(r-4.4-emscripten)wpa_1.9.1.tgz(r-4.3-emscripten)
wpa.pdf |wpa.html
wpa/json (API)
NEWS

# Install 'wpa' in R:
install.packages('wpa', repos = c('https://microsoft.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/microsoft/wpa/issues

Datasets:
  • dv_data - Sample Standard Person Query dataset for Data Validation
  • em_data - Sample Hourly Collaboration data
  • g2g_data - Sample Group-to-Group dataset
  • mt_data - Sample Meeting Query dataset
  • sq_data - Sample Standard Person Query dataset

On CRAN:

workplace-analytics

6.48 score 29 stars 1 packages 39 scripts 966 downloads 191 exports 95 dependencies

Last updated 3 months agofrom:61cb7a6a27. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 23 2024
R-4.5-winOKOct 23 2024
R-4.5-linuxOKOct 23 2024
R-4.4-winOKOct 23 2024
R-4.4-macOKOct 23 2024
R-4.3-winOKOct 23 2024
R-4.3-macOKOct 23 2024

Exports:%>%afterhours_distafterhours_fizzafterhours_lineafterhours_rankafterhours_sumafterhours_summaryafterhours_trendanalysis_scopeanonymiseanonymizecamel_cleancapacity_reportcheck_inputscheck_querycoaching_reportcollab_areacollab_distcollab_fizzcollab_linecollab_rankcollab_sumcollab_summarycollaboration_areacollaboration_distcollaboration_fizzcollaboration_linecollaboration_rankcollaboration_reportcollaboration_sumcollaboration_summarycollaboration_trendcombine_signalscommaconnectivity_reportcopy_dfcreate_barcreate_bar_asiscreate_boxplotcreate_bubblecreate_densitycreate_distcreate_dtcreate_fizzcreate_histcreate_inccreate_incidencecreate_ITSAcreate_IVcreate_linecreate_line_asiscreate_period_scattercreate_rankcreate_rank_combinecreate_sankeycreate_scattercreate_stackedcreate_trackingcreate_trendcut_houremail_distemail_fizzemail_lineemail_rankemail_sumemail_summaryemail_trendexportexternal_distexternal_fizzexternal_lineexternal_network_plotexternal_rankexternal_sumexternal_summaryextract_date_rangeextract_hrflag_ch_ratioflag_em_ratioflag_extremeflag_outlooktimeflex_indexg2g_networkgenerate_reportgenerate_report2GetResidualsheat_colorsheat_colourshr_trendhrvar_counthrvar_count_allhrvar_trendidentify_churnidentify_datefreqidentify_holidayweeksidentify_inactiveweeksidentify_nkwidentify_outlieridentify_privacythresholdidentify_queryidentify_shiftsidentify_shifts_wpidentify_tenureimport_to_fstimport_wpainternal_network_plotis_date_formatIV_by_periodIV_reportjitter_metricskeymetrics_scankeymetrics_scan_asisLjungBoxmaxminmeeting_distmeeting_extractmeeting_fizzmeeting_linemeeting_qualitymeeting_rankmeeting_skimmeeting_summeeting_summarymeeting_tm_reportmeeting_trendmeetingtype_distmeetingtype_dist_cameetingtype_dist_mtmeetingtype_summeetingtype_summarymgrcoatt_distmgrrel_matrixnetwork_describenetwork_g2gnetwork_p2pnetwork_summaryone2one_distone2one_fizzone2one_freqone2one_lineone2one_rankone2one_sumone2one_summaryone2one_trendp_testp2p_data_simpad2pairwise_countperiod_changepersonas_hclustplot_flex_indexplot_hourly_patplot_WOEread_preambleremove_outliersrgb2hexstandardise_pqstandardize_pqsubject_classifysubject_scansubject_validatesubject_validate_reporttheme_wpatheme_wpa_basictm_cleantm_cooctm_freqtm_scantm_wordcloudtotals_bindtotals_coltotals_reordertrack_HR_changetstampus_to_spacevalidation_reportwellbeing_reportworkloads_distworkloads_fizzworkloads_lineworkloads_rankworkloads_sumworkloads_summaryworkloads_trendworkpatterns_areaworkpatterns_classifyworkpatterns_hclustworkpatterns_rankworkpatterns_reportwrapwrap_text

Dependencies:base64encbslibcachemclicolorspacecommonmarkcpp11crosstalkcurldata.tabledigestdplyrDTevaluatefansifarverfastmapfontawesomefsgenericsggforceggplot2ggraphggrepelggwordcloudgluegraphlayoutsgridExtragridtextgtablehighrhtmltoolshtmlwidgetshttpuvigraphisobandjaneaustenrjpegjquerylibjsonliteknitrlabelinglaterlatticelazyevallifecyclemagrittrmarkdownMASSMatrixmemoisemgcvmimemunsellnetworkD3nlmepillarpkgconfigplyrpngpolyclippromisesproxypurrrR6rappdirsRColorBrewerRcppRcppArmadilloRcppEigenreshape2rlangrmarkdownsassscalesSnowballCstringistringrsystemfontstibbletidygraphtidyrtidyselecttidytexttinytextokenizerstweenrutf8vctrsviridisviridisLitewithrxfunxml2yaml

Readme and manuals

Help Manual

Help pageTopics
Distribution of After-hours Collaboration Hours as a 100% stacked barafterhours_dist
Distribution of After-hours Collaboration Hours (Fizzy Drink plot)afterhours_fizz
After-hours Collaboration Time Trend - Line Chartafterhours_line
Rank groups with high After-Hours Collaboration Hoursafterhours_rank
Summary of After-Hours Collaboration Hoursafterhours_sum afterhours_summary
After-Hours Time Trendafterhours_trend
Anonymise a categorical variable by replacing valuesanonymise anonymize
Calculate Weight of Evidence (WOE) and Information Value (IV) between a single predictor and a single outcome variable.calculate_IV
Convert "CamelCase" to "Camel Case"camel_clean
Generate a Capacity report in HTMLcapacity_report
Check whether a data frame contains all the required variablecheck_inputs
Check a query to ensure that it is suitable for analysischeck_query
Generate a Coaching report in HTMLcoaching_report
Collaboration - Stacked Area Plotcollaboration_area collab_area
Distribution of Collaboration Hours as a 100% stacked barcollaboration_dist collab_dist
Distribution of Collaboration Hours (Fizzy Drink plot)collaboration_fizz collab_fizz
Collaboration Time Trend - Line Chartcollaboration_line collab_line
Collaboration Rankingcollaboration_rank collab_rank
Generate a Collaboration Report in HTMLcollaboration_report
Collaboration Summarycollaboration_sum collaboration_summary collab_sum collab_summary
Collaboration Time Trendcollaboration_trend
Combine signals from the Hourly Collaboration querycombine_signals
Add comma separator for thousandscomma
Generate a Connectivity report in HTMLconnectivity_report
Copy a data frame to clipboard for pasting in Excelcopy_df
Mean Bar Plot for any metriccreate_bar
Create a bar chart without aggregation for any metriccreate_bar_asis
Box Plot for any metriccreate_boxplot
Create a bubble plot with two selected Viva Insights metrics (General Purpose), with size representing the number of employees in the group.create_bubble
Create a density plot for any metriccreate_density
Horizontal 100 percent stacked bar plot for any metriccreate_dist
Create interactive tables in HTML with 'download' buttons.create_dt
Fizzy Drink / Jittered Scatter Plot for any metriccreate_fizz
Create a histogram plot for any metriccreate_hist
Create an incidence analysis reflecting proportion of population scoring above or below a threshold for a metriccreate_inc create_incidence
Estimate an effect of intervention on every Viva Insights metric in input file by applying single-group Interrupted Time-Series Analysis (ITSA)create_ITSA
Calculate Information Value for a selected outcome variablecreate_IV
Time Trend - Line Chart for any metriccreate_line
Create a line chart without aggregation for any metriccreate_line_asis
Period comparison scatter plot for any two metricscreate_period_scatter
Rank all groups across HR attributes on a selected Viva Insights metriccreate_rank
Create combination pairs of HR variables and run 'create_rank()'create_rank_combine
Create a sankey chart from a two-column count tablecreate_sankey
Create a Scatter plot with two selected Viva Insights metrics (General Purpose)create_scatter
Horizontal stacked bar plot for any metriccreate_stacked
Create a line chart that tracks metrics over time with a 4-week rolling averagecreate_tracking
Heat mapped horizontal bar plot over time for any metriccreate_trend
Convert a numeric variable for hours into categoricalcut_hour
Sample Standard Person Query dataset for Data Validationdv_data
Sample Hourly Collaboration dataem_data
Distribution of Email Hours as a 100% stacked baremail_dist
Distribution of Email Hours (Fizzy Drink plot)email_fizz
Email Time Trend - Line Chartemail_line
Email Hours Rankingemail_rank
Email Summaryemail_sum email_summary
Email Hours Time Trendemail_trend
Export 'wpa' outputs to CSV, clipboard, or save as imagesexport
Distribution of External Collaboration Hours as a 100% stacked barexternal_dist
Distribution of External Collaboration Hours (Fizzy Drink plot)external_fizz
External Collaboration Hours Time Trend - Line Chartexternal_line
Plot External Network Breadth and Size as a scatter plotexternal_network_plot
Rank groups with high External Collaboration Hoursexternal_rank
External Collaboration Summaryexternal_sum external_summary
Extract date periodextract_date_range
Extract HR attribute variablesextract_hr
Flag unusual high collaboration hours to after-hours collaboration hours ratioflag_ch_ratio
Flag Persons with unusually high Email Hours to Emails Sent ratioflag_em_ratio
Warn for extreme values by checking against a thresholdflag_extreme
Flag unusual outlook time settings for work day start and end timeflag_outlooktime
Compute a Flexibility Index based on the Hourly Collaboration Queryflex_index
Sample Group-to-Group datasetg2g_data
Generate HTML report with list inputsgenerate_report
Generate HTML report based on existing RMarkdown documentsgenerate_report2
Extract Residuals from ARIMA, VAR, or any Simulated Fitted Time Series ModelGetResiduals
Generate a vector of 'n' contiguous colours, as a red-yellow-green palette.heat_colors heat_colours
Employee count over timehr_trend
Create a count of distinct people in a specified HR variableanalysis_scope hrvar_count
Create count of distinct fields and percentage of employees with missing values for all HR variableshrvar_count_all
Track count of distinct people over time in a specified HR variablehrvar_trend
Identify employees who have churned from the datasetidentify_churn
Identify date frequency based on a series of datesidentify_datefreq
Identify Holiday Weeks based on outliersidentify_holidayweeks
Identify Inactive Weeksidentify_inactiveweeks
Identify Non-Knowledge workers in a Person Query using Collaboration Hoursidentify_nkw
Identify metric outliers over a date intervalidentify_outlier
Identify groups under privacy thresholdidentify_privacythreshold
Identify the query type of the passed data frameidentify_query
Identify shifts based on outlook time settings for work day start and end timeidentify_shifts
Identify shifts based on binary activityidentify_shifts_wp
Tenure calculation based on different input dates, returns data summary table or histogramidentify_tenure
Read a Workplace Analytics query in '.csv' using and create a '.fst' file in the same directory for faster readingimport_to_fst
Import a Workplace Analytics Queryimport_wpa
Plot Internal Network Breadth and Size as a scatter plotinternal_network_plot
Identify whether string is a date formatis_date_format
Identify the WPA metrics that have the biggest change between two periods.IV_by_period
Generate a Information Value HTML ReportIV_report
Jitter metrics in a data framejitter_metrics
Run a summary of Key Metrics from the Standard Person Query datakeymetrics_scan
Run a summary of Key Metrics without aggregationkeymetrics_scan_asis
Ljung and Box Portmanteau TestLjungBox
Calculate Weight of Evidence (WOE) and Information Value (IV) between multiple predictors and a single outcome variable, returning a list of statistics.map_IV
Max-Min Scaling Functionmaxmin
Distribution of Meeting Hours as a 100% stacked barmeeting_dist
Extract top low-engagement meetings from the Meeting Querymeeting_extract
Distribution of Meeting Hours (Fizzy Drink plot)meeting_fizz
Meeting Time Trend - Line Chartmeeting_line
Run a meeting habits / meeting quality analysismeeting_quality
Meeting Hours Rankingmeeting_rank
Produce a skim summary of meeting hoursmeeting_skim
Meeting Summarymeeting_sum meeting_summary
Generate a Meeting Text Mining report in HTMLmeeting_tm_report
Meeting Hours Time Trendmeeting_trend
Distribution of Meeting Types by number of Attendees and Durationmeetingtype_dist
Meeting Type Distribution (Ways of Working Assessment Query)meetingtype_dist_ca
Meeting Type Distribution (Meeting Query)meetingtype_dist_mt
Create a summary bar chart of the proportion of Meeting Hours spent in Long or Large Meetingsmeetingtype_sum meetingtype_summary
Manager meeting coattendance distributionmgrcoatt_dist
Manager Relationship 2x2 Matrixmgrrel_matrix
Sample Meeting Query datasetmt_data
Uncover HR attributes which best represent a population for a Person to Person querynetwork_describe
Create a network plot with the group-to-group queryg2g_network network_g2g
Perform network analysis with the person-to-person querynetwork_p2p
Summarise node centrality statistics with an igraph objectnetwork_summary
Distribution of Manager 1:1 Time as a 100% stacked barone2one_dist
Distribution of Manager 1:1 Time (Fizzy Drink plot)one2one_fizz
Frequency of Manager 1:1 Meetings as bar or 100% stacked bar chartone2one_freq
Manager 1:1 Time Trend - Line Chartone2one_line
Manager 1:1 Time Rankingone2one_rank
Manager 1:1 Time Summaryone2one_sum one2one_summary
Manager 1:1 Time Trendone2one_trend
Calculate the p-value of the null hypothesis that two outcomes are from the same datasetp_test
Simulate a person-to-person query using a Watts-Strogatz modelp2p_data_sim
Create the two-digit zero-padded formatpad2
Perform a pairwise count of words by idpairwise_count
Plot the distribution of percentage change between periods of a Viva Insights metric by the number of employees.period_change
Create hierarchical clusters of selected metrics using a Person querypersonas_hclust
Plot a Sample of Working Patterns using Flexibility Index outputplot_flex_index
Internal function for plotting the hourly activity patterns.plot_hourly_pat
Plot WOE graphs with an IV objectplot_WOE
Read preambleread_preamble
Remove outliers from a person query across timeremove_outliers
Convert rgb to HEX codergb2hex
Sample Standard Person Query datasetsq_data
Standardise variable names to a Standard Person Querystandardise_pq standardize_pq
Create a new logical variable that classifies meetings by patterns in subject linessubject_classify
Count top words in subject lines grouped by a custom attributesubject_scan tm_scan
Scan meeting subject and highlight items for reviewsubject_validate
Generate Meeting Text Mining report in HTML for Common Exclusion Termssubject_validate_report
Main theme for 'wpa' visualisationstheme_wpa
Basic theme for 'wpa' visualisationstheme_wpa_basic
Clean subject line text prior to analysistm_clean
Analyse word co-occurrence in subject lines and return a network plottm_cooc
Perform a Word or Ngram Frequency Analysis and return a Circular Bar Plottm_freq
Generate a wordcloud with meeting subject linestm_wordcloud
Row-bind an identical data frame for computing grouped totalstotals_bind
Fabricate a 'Total' HR variabletotals_col
Reorder a value to the top of the summary tabletotals_reorder
Sankey chart of organizational movement between HR attributes and missing values (outside company move) (Data Overview)track_HR_change
Generate a time stamptstamp
Replace underscore with spaceus_to_space
Generate a Data Validation report in HTMLvalidation_report
Generate a Wellbeing Report in HTMLwellbeing_report
Distribution of Work Week Span as a 100% stacked barworkloads_dist
Distribution of Work Week Span (Fizzy Drink plot)workloads_fizz
Workloads Time Trend - Line Chartworkloads_line
Rank all groups across HR attributes for Work Week Spanworkloads_rank
Work Week Span Summaryworkloads_sum workloads_summary
Work Week Span Time Trendworkloads_trend
Create an area plot of emails and IMs by hour of the dayworkpatterns_area
Classify working pattern personas using a rule based algorithmworkpatterns_classify
Classify working pattern week archetypes using a rule-based algorithm, using the binary week-based ('bw') method.workpatterns_classify_bw
Classify working pattern personas using a rule based algorithm, using the person-average volume-based ('pav') method.workpatterns_classify_pav
Create a hierarchical clustering of email or IMs by hour of dayworkpatterns_hclust
Create a rank table of working patternsworkpatterns_rank
Generate a report on working patterns in HTMLworkpatterns_report
Add a character at the start and end of a character stringwrap
Wrap text based on character thresholdwrap_text