Learn R Programming

vivainsights

Overview

This is an R package for analyzing and visualizing data from Microsoft Viva Advanced Insights (previously Microsoft Workplace Analytics).

With the vivainsights package, you can...

  1. Run prebuilt analysis and visualizations off advanced insights data with settings for HR variables, privacy threshold, etc.

  2. Leverage advanced analytics functions which are built for Viva Insights metrics

  3. Integrate analysis of Viva Insights data with your R workflow seamlessly

This library is compatible with the latest implementation of the Viva Insights Analyst Workbench. For the R library compatible with the legacy implementation, please visit the wpa package website or GitHub repository .

Installation

# Install from CRAN:
install.packages("vivainsights")

# Install development version from GitHub:
pak::pak("microsoft/vivainsights")

Usage

To get started with the package, please see the following links:

Privacy threshold with mingroup

Most plotting and analysis functions support the mingroup argument (default: 5) to suppress very small groups for privacy and readability.

data("pq_data")

# Check available HR variables and how many groups they have
pq_data %>%
  hrvar_count_all(return = "table")

# Set a higher threshold when plotting
pq_data %>%
  meeting_trend(hrvar = "Organization", mingroup = 10, return = "plot")

Cheatsheet

Also check out our package cheat sheet for a quick glimpse of what vivainsights offers:

Related repositories


Code of Conduct

We would ask you to please read the Microsoft Open Source Code of Conduct prior to engaging with this package.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.


Finding this project useful?

:star: Please star this repository to keep us going!

Copy Link

Version

Install

install.packages('vivainsights')

Monthly Downloads

424

Version

0.7.3

License

MIT + file LICENSE

Maintainer

Martin Chan

Last Published

August 4th, 2026

Functions in vivainsights (0.7.3)

collaboration_dist

Distribution of Collaboration Hours as a 100% stacked bar
collaboration_sum

Collaboration Summary
collaboration_fizz

Distribution of Collaboration Hours (Fizzy Drink plot)
collaboration_trend

Collaboration Time Trend
collaboration_line

Collaboration Time Trend - Line Chart
check_query

Check a query to ensure that it is suitable for analysis
collaboration_rank

Collaboration Ranking
camel_clean

Convert "CamelCase" to "Camel Case"
collaboration_area

Collaboration - Stacked Area Plot
check_inputs

Check whether a data frame contains all the required variable
comma

Add comma separator for thousands
create_bubble

Create a bubble plot with two selected Viva Insights metrics (General Purpose), with size representing the number of employees in the group.
copy_df

Copy a data frame to clipboard for pasting in Excel
create_density

Create a density plot for any metric
create_boxplot

Box Plot for any metric
create_dist

Horizontal 100 percent stacked bar plot for any metric
create_dt

Create interactive tables in HTML with 'download' buttons.
create_IV

Compute Information Value for Predictive Variables
create_bar_asis

Create a bar chart without aggregation for any metric
create_bar

Mean Bar Plot for any metric
create_radar_calc

Radar Chart (Calculation)
create_line

Time Trend - Line Chart for any metric
create_radar

Radar Chart for multiple metrics
create_inc

Create an incidence analysis reflecting proportion of population scoring above or below a threshold for a metric
create_period_scatter

Period comparison scatter plot for any two metrics
create_lorenz

Calculate the Lorenz Curve and Gini Coefficient in a Person Query
create_itsa

Estimate an effect of intervention on every Viva Insights metric in input file by applying single-group Interrupted Time-Series Analysis (ITSA)
create_line_asis

Create a line chart without aggregation for any metric
create_fizz

Fizzy Drink / Jittered Scatter Plot for any metric
create_hist

Create a histogram plot for any metric
create_sankey

Create a sankey chart from a two-column count table
create_survival_prep

Prepare Survival Data from a Panel Dataset
create_rank

Rank all groups across HR attributes on a selected Viva Insights metric
create_rogers

Generate Rogers Adoption Curve plots for Copilot usage
create_survival_calc

Kaplan–Meier Survival Curve (Calculation)
create_rank_combine

Create combination pairs of HR variables and run 'create_rank()'
create_radar_viz

Radar Chart (Visualization)
create_scatter

Create a Scatter plot with two selected Viva Insights metrics (General Purpose)
create_survival

Kaplan–Meier Survival Curve
create_stacked

Horizontal stacked bar plot for any metric
email_trend

Email Hours Time Trend
email_rank

Email Hours Ranking
create_trend

Heat mapped horizontal bar plot over time for any metric
email_line

Email Time Trend - Line Chart
email_fizz

Distribution of Email Hours (Fizzy Drink plot)
email_dist

Distribution of Email Hours as a 100% stacked bar
create_tracking

Create a line chart that tracks metrics over time with a 4-week rolling average
email_summary

Email Summary
cut_hour

Convert a numeric variable for hours into categorical
create_survival_viz

Kaplan–Meier Survival Curve (Visualization)
external_dist

Distribution of External Collaboration Hours as a 100% stacked bar
extract_date_range

Extract date period
flag_em_ratio

Flag Persons with unusually high Email Hours to Emails Sent ratio
external_sum

External Collaboration Summary
external_fizz

Distribution of External Collaboration Hours (Fizzy Drink plot)
export

Export 'vivainsights' outputs to CSV, clipboard, or save as images
extract_hr

Extract HR attribute variables
external_rank

Rank groups with high External Collaboration Hours
flag_ch_ratio

Flag unusual high collaboration hours to after-hours collaboration hours ratio
external_line

External Collaboration Hours Time Trend - Line Chart
generate_report2

Generate HTML report based on existing RMarkdown documents
generate_report

Generate HTML report with list inputs
flag_outlooktime

Flag unusual outlook time settings for work day start and end time
g2g_data

Sample Group-to-Group dataset
hr_trend

Employee count over time
hrvar_trend

Track count of distinct people over time in a specified HR variable
heat_colours

Generate a vector of n contiguous colours, as a red-yellow-green palette.
flag_extreme

Warn for extreme values by checking against a threshold
hrvar_count

Create a count of distinct people in a specified HR variable
hrvar_count_all

Create count of distinct fields and percentage of employees with missing values for all HR variables
identify_shifts

Identify shifts based on outlook time settings for work day start and end time
identify_outlier

Identify metric outliers over a date interval
identify_habit

Identify whether a habitual behaviour exists over a given interval of time
identify_datefreq

Identify date frequency based on a series of dates
identify_nkw

Identify Non-Knowledge workers in a Person Query using Collaboration Hours
identify_privacythreshold

Identify groups under privacy threshold
identify_inactiveweeks

Identify Inactive Weeks
identify_holidayweeks

Identify Holiday Weeks based on outliers
identify_retention

Identify Retention Rate Between Two Time Periods
identify_churn

Identify employees who have churned from the dataset
maxmin

Max-Min Scaling Function
jitter_metrics

Jitter metrics in a data frame
keymetrics_scan_asis

Run a summary of Key Metrics without aggregation
keymetrics_scan

Run a summary of Key Metrics from the Standard Person Query data
identify_tenure

Tenure calculation based on different input dates, returns data summary table or histogram
meeting_fizz

Distribution of Meeting Hours (Fizzy Drink plot)
identify_usage_segments

Identify Usage Segments based on a metric
is_date_format

Identify whether string is a date format
meeting_dist

Distribution of Meeting Hours as a 100% stacked bar
import_query

Import a query from Viva Insights Analyst Experience
meeting_line

Meeting Time Trend - Line Chart
meeting_rank

Meeting Hours Ranking
meeting_trend

Meeting Hours Time Trend
meeting_tm_report

Generate a Meeting Text Mining report in HTML
meeting_summary

Meeting Summary
network_g2g

Create a network plot with the group-to-group query
network_summary

Summarise node centrality statistics with an igraph object
network_p2p

Perform network analysis with the person-to-person query
one2one_dist

Distribution of Manager 1:1 Time as a 100% stacked bar
mt_data

Sample Meeting Query dataset
one2one_freq

Frequency of Manager 1:1 Meetings as bar or 100% stacked bar chart
p2p_data_sim

Simulate a person-to-person query using a Watts-Strogatz model
pairwise_count

Perform a pairwise count of words by id
one2one_fizz

Distribution of Manager 1:1 Time (Fizzy Drink plot)
one2one_line

Manager 1:1 Time Trend - Line Chart
pad2

Create the two-digit zero-padded format
one2one_sum

Manager 1:1 Time Summary
p2p_data

Sample person-to-person dataset
one2one_rank

Manager 1:1 Time Ranking
one2one_trend

Manager 1:1 Time Trend
tm_cooc

Analyse word co-occurrence in subject lines and return a network plot
%>%

Pipe operator
plot_ts_us

Plot Usage Segments over time
tm_clean

Clean subject line text prior to analysis
prep_query

Prepare variable names and types in query data frame for analysis
rgb2hex

Convert rgb to HEX code
theme_wpa

Main theme for 'vivainsights' visualisations
read_preamble

Read preamble
theme_wpa_basic

Basic theme for 'vivainsights' visualisations
pq_data

Sample Person Query dataset
us_to_space

Replace underscore with space
track_HR_change

Sankey chart of organizational movement between HR attributes and missing values (outside company move) (Data Overview)
validation_report

Generate a Data Validation report in HTML
tm_freq

Perform a Word or Ngram Frequency Analysis and return a Circular Bar Plot
wrap

Add a character at the start and end of a character string
tm_wordcloud

Generate a wordcloud with meeting subject lines
xicor

Calculate Chatterjee's Rank Correlation Coefficient
totals_col

Fabricate a 'Total' HR variable
vivainsights-package

vivainsights: Analyze and Visualize Data from 'Microsoft Viva Insights'
tstamp

Generate a time stamp
wrap_text

Wrap text based on character threshold
totals_bind

Row-bind an identical data frame for computing grouped totals
IV_report

Generate a Information Value HTML Report
afterhours_summary

Summary of After-Hours Collaboration Hours
afterhours_dist

Distribution of After-hours Collaboration Hours as a 100% stacked bar
afterhours_trend

After-Hours Time Trend
anonymise

Anonymise a categorical variable by replacing values
afterhours_line

After-hours Collaboration Time Trend - Line Chart
afterhours_rank

Rank groups with high After-Hours Collaboration Hours
calculate_distribution_summary

Calculate Distribution Summary Statistics
afterhours_fizz

Distribution of After-hours Collaboration Hours (Fizzy Drink plot)
any_idate

Identify whether variable is an IDate class.