- Adjust family
- Created two templates: ch.R and spq-params.R
- General code formatting
This commit is contained in:
Martin Chan 2021-03-05 11:18:35 +00:00
Родитель 617ff636ba
Коммит 2f6b9cfd97
122 изменённых файлов: 1107 добавлений и 322 удалений

Просмотреть файл

@ -72,6 +72,7 @@ export(flag_outlooktime)
export(flex_index)
export(g2g_network)
export(generate_report)
export(heat_colors)
export(heat_colours)
export(hr_trend)
export(hrvar_count)

Просмотреть файл

@ -3,27 +3,52 @@
# Licensed under the MIT License. See LICENSE.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#' @title Identify the WPA metrics that have the biggest change between two periods.
#' @title Identify the WPA metrics that have the biggest change between two
#' periods.
#'
#' @description
#' This function uses the Information Value algorithm to predict which WPA metrics are most explained by the change in dates.
#' `r lifecycle::badge('experimental')`
#'
#' This function uses the Information Value algorithm to predict
#' which Workplace Analytics metrics are most explained by the change in dates.
#'
#' @param data Person Query as a dataframe including date column named "Date"
#' This function assumes the data format is MM/DD/YYYY as is standard in a WpA query output.
#' @param before_start Start date of "before" time period in YYYY-MM-DD. Defaults to earliest date in dataset.
#' @param before_end End date of "before" time period in YYYY-MM-DD
#' @param after_start Start date of "after" time period in YYYY-MM-DD. Defaults to day after before_end.
#' @param after_end End date of "after" time period in YYYY-MM-DD. Defaults to latest date in dataset.
#' @param mybins Number of bins to cut the data into for Information Value analysis. Defaults to 10.
#' @param return Specify whether to return a summary table or detailed Excel and PDF files
#' Specify "table" or "detailed" for outputs. Defaults to table.
#' This function assumes the data format is `MM/DD/YYYY` as is standard in a
#' WpA query output.
#' @param before_start Start date of "before" time period in `YYYY-MM-DD`.
#' Defaults to earliest date in dataset.
#' @param before_end End date of "before" time period in `YYYY-MM-DD`
#' @param after_start Start date of "after" time period in `YYYY-MM-DD`.
#' Defaults to day after before_end.
#' @param after_end End date of "after" time period in `YYYY-MM-DD`. Defaults to
#' latest date in dataset.
#' @param mybins Number of bins to cut the data into for Information Value
#' analysis. Defaults to 10.
#' @param return String specifying what to return. The current only valid
#' option is `"table"`.
#'
#' @return
#' data frame containing all the variables and the corresponding Information
#' Value.
#'
#' @import dplyr
#' @import Information
#'
#'
#' @family Flexible Input
#' @family Variable Association
#' @family Information Value
#' @family Time-series
#'
#' @examples
#' # Returns a data frame
#' \donttest{
#' sq_data %>%
#' IV_by_period(
#' before_start = "2019-11-03",
#' before_end = "2019-11-09",
#' after_start = "2019-11-10",
#' after_end = "2019-11-16"
#' )
#' }
#'
#' @export
@ -141,7 +166,7 @@ IV_by_period <-
}
# Return ranking table
return(create_dt(Tables$Summary, rounding = 2))
return(Tables$Summary)
# print("Access individual metrics via Outputs[[metric_name]], e.g., Outputs[[Workweek_span]]")
# # Store each variable's plot

Просмотреть файл

@ -34,6 +34,7 @@
#' }
#'
#' @family Reports
#' @family Variable Association
#' @family Information Value
#'
#' @inherit generate_report return

Просмотреть файл

@ -10,8 +10,7 @@
#' Returns a stacked bar plot by default.
#' Additional options available to return a table with distribution elements.
#'
#' @details
#' Uses the metric `Collaboration_hours`.
#' @template ch
#'
#' @inheritParams create_dist
#' @inherit create_dist return

Просмотреть файл

@ -10,8 +10,7 @@
#' a 'fizzy' scatter plot by default.
#' Additional options available to return a table with distribution elements.
#'
#' @details
#' Uses the metric `Collaboration_hours`.
#' @template ch
#'
#' @inheritParams create_fizz
#' @inherit create_fizz return

Просмотреть файл

@ -11,8 +11,7 @@
#' with a separate panel per value in the HR attribute.
#' Additional options available to return a summary table.
#'
#' @details
#' Uses the metric `Collaboration_hours`.
#' @template ch
#'
#' @inheritParams create_line
#' @inherit create_line return

Просмотреть файл

@ -10,8 +10,7 @@
#' By default returns a week by week heatmap, highlighting the points in time with most activity.
#' Additional options available to return a summary table.
#'
#' @details
#' Uses the metric `Collaboration_hours`.
#' @template ch
#'
#' @inheritParams create_trend
#'

Просмотреть файл

@ -6,18 +6,17 @@
#' @title Mean Bar Plot for any metric
#'
#' @description
#' Provides an overview analysis of a selected metric by calculating a mean per metric.
#' Provides an overview analysis of a selected metric by calculating a mean per
#' metric.
#' Returns a bar plot showing the average of a selected metric by default.
#' Additional options available to return a summary table.
#'
#' @param data A Standard Person Query dataset in the form of a data frame.
#' @param metric Character string containing the name of the metric,
#' e.g. "Collaboration_hours"
#' @param hrvar HR Variable by which to split metrics, defaults to "Organization"
#' but accepts any character vector, e.g. "LevelDesignation"
#' @param mingroup Numeric value setting the privacy threshold / minimum group size. Defaults to 5.
#' @template spq-params
#' @param mingroup Numeric value setting the privacy threshold / minimum group
#' size. Defaults to 5.
#'
#' @param return String specifying what to return. This must be one of the following strings:
#' @param return String specifying what to return. This must be one of the
#' following strings:
#' - `"plot"`
#' - `"table"`
#'

Просмотреть файл

@ -10,6 +10,8 @@
#' of collaboration hours to after-hours collaboration hours.
#' Returns a character string by default.
#'
#' @template ch
#'
#' @import dplyr
#'
#' @param data A data frame containing a Person Query.

Просмотреть файл

@ -8,12 +8,16 @@
#' @param n the number of colors (>= 1) to be in the palette.
#' @param alpha an alpha-transparency level in the range of 0 to 1
#' (0 means transparent and 1 means opaque)
#' @param rev logical indicating whether the ordering of the colors should be reversed.
#' @param rev logical indicating whether the ordering of the colors should be
#' reversed.
#'
#' @examples
#' barplot(rep(10, 50), col = heat_colours(n = 50), border = NA)
#'
#' barplot(rep(10, 50), col = heat_colours(n = 50, alpha = 0.5, rev = TRUE), border = NA)
#' barplot(rep(10, 50), col = heat_colours(n = 50, alpha = 0.5, rev = TRUE),
#' border = NA)
#'
#' @family Support
#'
#' @return
#' A character vector containing the HEX codes and the same length as `n` is
@ -43,3 +47,8 @@ heat_colours <- function (n, alpha, rev = FALSE) {
cols
}
}
#' @rdname heat_colours
#' @export
heat_colors <- heat_colours

Просмотреть файл

@ -33,6 +33,7 @@
#' # Return summary table
#' hr_trend(dv_data, return = "table")
#'
#' @family Visualization
#' @family Data Validation
#'
#' @export

Просмотреть файл

@ -11,10 +11,10 @@
#' bar chart as typically seen in 'Analysis Scope'.
#'
#' @param data A Standard Person Query dataset in the form of a data frame.
#' @param hrvar HR Variable by which to split metrics, defaults to "Organization"
#' but accepts any character vector, e.g. "LevelDesignation".
#' If a vector with more than one value is provided, the HR attributes are automatically
#' concatenated.
#' @param hrvar HR Variable by which to split metrics, defaults to
#' "Organization" but accepts any character vector, e.g. "LevelDesignation".
#' If a vector with more than one value is provided, the HR attributes are
#' automatically concatenated.
#' @param return String specifying what to return. This must be one of the
#' following strings:
#' - `"plot"`

Просмотреть файл

@ -3,20 +3,25 @@
# Licensed under the MIT License. See LICENSE.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#' @title Create count of distinct fields and percentage of employees with NAs for all HR variables
#' @title Create count of distinct fields and percentage of employees with
#' missing values for all HR variables
#'
#' @description
#' This function enables you to create a summary table to validate organizational data. This table will provide a summary of the data found
#' in the WpA Sources page.
#' This function will return a summary table with the count of distinct fields per HR attribute and the percentage of
#' employees with NAs for that attribute.
#' See hrvar_count function for more detail on the specific HR attribute of interest.
#' This function enables you to create a summary table to validate
#' organizational data. This table will provide a summary of the data found in
#' the Workplace Analytics Sources page. This function will return a summary
#' table with the count of distinct fields per HR attribute and the percentage
#' of employees with missing values for that attribute. See `hrvar_count()`
#' function for more detail on the specific HR attribute of interest.
#'
#' @param data A Standard Person Query dataset in the form of a data frame.
#' @param n_var number of HR variables to include in report as rows. Default is set to 10 HR variables.
#' @param n_var number of HR variables to include in report as rows. Default is
#' set to 50 HR variables.
#' @param return String to specify what to return
#' @param threshold The max number of unique values allowed for any attribute. Default is 100.
#' @param maxna The max percentage of NAs allowable for any column. Default is 20.
#' @param threshold The max number of unique values allowed for any attribute.
#' Default is 100.
#' @param maxna The max percentage of NAs allowable for any column. Default is
#' 20.
#'
#' @import dplyr
#'
@ -28,8 +33,11 @@
#'
#' @return
#' Returns an error message by default, where 'text' is passed in `return`.
#' When 'table' is passed, a summary table listing the number of distinct fields and percentage of NAs for the specified number of HR attributes will be returned.
#' when 'message' is passed, outputs a message indicating which values are beyond the specified thresholds.
#' - `'table'`: data frame. A summary table listing the number of distinct
#' fields and percentage of missing values for the specified number of HR
#' attributes will be returned.
#' - `'message'`: outputs a message indicating which values are
#' beyond the specified thresholds.
#'
#' @export
hrvar_count_all <- function(data,

Просмотреть файл

@ -6,36 +6,56 @@
#' @title Identify employees who have churned from the dataset
#'
#' @description
#' This function identifies and counts the number of employees who have churned from
#' the dataset by measuring whether an employee who is present in the first `n` (n1) weeks
#' of the data is present in the last `n` (n2) weeks of the data.
#' This function identifies and counts the number of employees who have churned
#' from the dataset by measuring whether an employee who is present in the first
#' `n` (n1) weeks of the data is present in the last `n` (n2) weeks of the data.
#'
#' @details
#' An additional use case of this function is the ability to identify "new-joiners" by using
#' the argument `flip`.
#' An additional use case of this function is the ability to identify
#' "new-joiners" by using the argument `flip`.
#'
#' @param data A Person Query as a data frame. Must contain a `PersonId`.
#' @param n1 A numeric value specifying the number of weeks at the beginning of the period
#' that defines the measured employee set. Defaults to 6.
#' @param n2 A numeric value specifying the number of weeks at the end of the period
#' to calculate whether employees have churned from the data. Defaults to 6.
#' @param return String specifying what to return. Defaults to "message", with options to
#' return a character string ("text") or the `PersonId` of employees who have been identified
#' as churned ("data").
#' @param flip Logical, defaults to FALSE. This determines whether to reverse the logic of identifying the
#' non-overlapping set. If set to `TRUE`, this effectively identifies new-joiners, or those
#' who were not present in the first n weeks of the data but were present in the final n weeks.
#' @param n1 A numeric value specifying the number of weeks at the beginning of
#' the period that defines the measured employee set. Defaults to 6.
#' @param n2 A numeric value specifying the number of weeks at the end of the
#' period to calculate whether employees have churned from the data. Defaults
#' to 6.
#' @param return String specifying what to return. This must be one of the
#' following strings:
#' - `"message"` (default)
#' - `"text"`
#' - `"data"`
#'
#' See `Value` for more information.
#'
#' @param flip Logical, defaults to FALSE. This determines whether to reverse
#' the logic of identifying the non-overlapping set. If set to `TRUE`, this
#' effectively identifies new-joiners, or those who were not present in the
#' first n weeks of the data but were present in the final n weeks.
#'
#' @return
#' A different output is returned depending on the value passed to the `return`
#' argument:
#' - `"message"`: Message on console. A diagnostic message.
#' - `"text"`: String. A diagnostic message.
#' - `"data"`: Character vector containing the the `PersonId` of
#' employees who have been identified as churned.
#'
#' @details
#' If an employee is present in the first `n` weeks of the data but not present in the last
#' `n` weeks of the data, the function considers the employee as churned. As the measurement period
#' is defined by the number of weeks from the start and the end of the passed data frame, you
#' may consider filtering the dates accordingly before running this function.
#' If an employee is present in the first `n` weeks of the data but not present
#' in the last `n` weeks of the data, the function considers the employee as
#' churned. As the measurement period is defined by the number of weeks from the
#' start and the end of the passed data frame, you may consider filtering the
#' dates accordingly before running this function.
#'
#' Another assumption that is in place is that any employee whose `PersonId` is
#' not available in the data has churned. Note that there may be other reasons
#' why an employee's `PersonId` may not be present, e.g. maternity/paternity
#' leave, Workplace Analytics license has been removed, shift to a
#' low-collaboration role (to the extent that he/she becomes inactive).
#'
#' @family Data Validation
#'
#' Another assumption that is in place is that any employee whose `PersonId` is not available in the
#' data has churned. Note that there may be other reasons why an employee's `PersonId` may not
#' be present, e.g. maternity/paternity leave, Workplace Analytics license has been removed,
#' shift to a low-collaboration role (to the extent that he/she becomes inactive).
#' @examples
#' sq_data %>% identify_churn(n1 = 3, n2 = 3, return = "message")
#'
@ -100,18 +120,27 @@ identify_churn <- function(data,
" (", n1, " weeks).")
} else {
stop("Invalid argument for `flip`")
}
if(return == "message"){
message(printMessage)
} else if(return == "text"){
printMessage
} else if(return == "data"){
churner_id
} else {
stop("Invalid `return`")
}
}

Просмотреть файл

@ -6,21 +6,45 @@
#' @title Identify Holiday Weeks based on outliers
#'
#' @description
#' This function scans a standard query output for weeks where collaboration hours is far outside the mean.
#' Returns a list of weeks that appear to be holiday weeks and optionally an edited dataframe with outliers removed.
#' By default, missing values are excluded.
#' This function scans a standard query output for weeks where collaboration
#' hours is far outside the mean. Returns a list of weeks that appear to be
#' holiday weeks and optionally an edited dataframe with outliers removed. By
#' default, missing values are excluded.
#'
#' As best practice, run this function prior to any analysis to remove atypical collaboration weeks from your dataset.
#' As best practice, run this function prior to any analysis to remove atypical
#' collaboration weeks from your dataset.
#'
#' @template ch
#'
#' @param data A Standard Person Query dataset in the form of a data frame.
#' @param sd The standard deviation below the mean for collaboration hours that should define an outlier week. Enter a positive number. Default is 1 standard deviation.
#' @param return String to specify what to return. Returns a message by default (`return` = "message").
#' Valid options are:
#' - When 'message' is passed, a message is printed identifying holiday weeks.
#' - When 'data' is passed, a dataset with outlier weeks flagged in a new column is returned as a dataframe.
#' - When 'data_cleaned' is passed, a dataset with outlier weeks removed is returned as a dataframe.
#' - when 'data_dirty' is passed, a dataset with only outlier weeks is returned as a dataframe.
#' - when 'plot' is passed, a plot with holiday weeks highlighted is returned as a dataframe.
#' @param sd The standard deviation below the mean for collaboration hours that
#' should define an outlier week. Enter a positive number. Default is 1
#' standard deviation.
#'
#'#' @param return String specifying what to return. This must be one of the
#' following strings:
#' - `"message"` (default)
#' - `"data"`
#' - `"data_cleaned"`
#' - `"data_dirty"`
#' - `"plot"`
#'
#' See `Value` for more information.
#'
#' @return
#' A different output is returned depending on the value passed to the `return`
#' argument:
#' - `"message"`: message on console. a message is printed identifying holiday
#' weeks.
#' - `"data"`: data frame. A dataset with outlier weeks flagged in a new
#' column is returned as a dataframe.
#' - `"data_cleaned"`: data frame. A dataset with outlier weeks removed is
#' returned.
#' - `"data_dirty"`: data frame. A dataset with only outlier weeks is
#' returned.
#' - `"plot"`: ggplot object. A line plot of Collaboration Hours with holiday
#' weeks highlighted.
#'
#'
#' @import dplyr
#' @import ggplot2
@ -35,7 +59,6 @@
#' # Return plot
#' identify_holidayweeks(sq_data, return = "plot")
#'
#'
#' @export
identify_holidayweeks <- function(data, sd = 1, return = "message"){

Просмотреть файл

@ -6,23 +6,35 @@
#' @title Identify Inactive Weeks
#'
#' @description
#' This function scans a standard query output for weeks where collaboration hours is far outside the mean for any individual person in the dataset.
#' Returns a list of weeks that appear to be inactive weeks and optionally an edited dataframe with outliers removed.
#' This function scans a standard query output for weeks where collaboration
#' hours is far outside the mean for any individual person in the dataset.
#' Returns a list of weeks that appear to be inactive weeks and optionally an
#' edited dataframe with outliers removed.
#'
#' As best practice, run this function prior to any analysis to remove atypical collaboration weeks from your dataset.
#' As best practice, run this function prior to any analysis to remove atypical
#' collaboration weeks from your dataset.
#'
#' @param data A Standard Person Query dataset in the form of a data frame.
#' @param sd The standard deviation below the mean for collaboration hours that should define an outlier week. Enter a positive number. Default is 1 standard deviation.
#' @param return String to specify what to return.
#' @param sd The standard deviation below the mean for collaboration hours that
#' should define an outlier week. Enter a positive number. Default is 1
#' standard deviation.
#' @param return String specifying what to return. This must be one of the
#' following strings:
#' - `"text"`
#' - `"data_cleaned"`
#' - `"data_dirty"`
#'
#' See `Value` for more information.
#'
#' @import dplyr
#'
#' @family Data Validation
#'
#' @return
#' Returns an error message by default, where 'text' is returned.
#' When 'data_cleaned' is passed, a dataset with outlier weeks removed is returned as a dataframe.
#' When 'data_dirty' is passed, a dataset with outlier weeks is returned as a dataframe.
#' Returns an error message by default, where `'text'` is returned. When
#' `'data_cleaned'` is passed, a dataset with outlier weeks removed is returned
#' as a dataframe. When `'data_dirty'` is passed, a dataset with outlier weeks
#' is returned as a dataframe.
#'
#' @export
identify_inactiveweeks <- function(data, sd = 2, return = "text"){

Просмотреть файл

@ -3,26 +3,44 @@
# Licensed under the MIT License. See LICENSE.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#' @title Identify Non-Knowledge workers in a Person Query using Collaboration Hours
#' @title Identify Non-Knowledge workers in a Person Query using Collaboration
#' Hours
#'
#' @description
#' This function scans a standard query output to identify employees with consistently low collaboration signals.
#' Returns the % of non-knowledge workers identified by Organization, and optionally an edited dataframe with non-knowledge workers removed, or the full dataframe with the kw/nkw flag added.
#' This function scans a standard query output to identify employees with
#' consistently low collaboration signals. Returns the % of non-knowledge
#' workers identified by Organization, and optionally an edited dataframe with
#' non-knowledge workers removed, or the full dataframe with the kw/nkw flag
#' added.
#'
#' @param data A Standard Person Query dataset in the form of a data frame.
#' @param collab_threshold The collaboration hours threshold that should be exceeded as an average for the entire analysis period for the employee to be categorized as a knowledge worker ("kw").
#' Enter a positive number. Default is set to 5 collaboration hours.
#' @param return String to specify what to return
#' @param collab_threshold The collaboration hours threshold that should be
#' exceeded as an average for the entire analysis period for the employee to
#' be categorized as a knowledge worker ("kw"). Enter a positive number.
#' Default is set to 5 collaboration hours.
#' @param return String specifying what to return. This must be one of the
#' following strings:
#' - `"text"`
#' - `"data_with_flag"`
#' - `"data_clean"`
#' - `"data_summary"`
#'
#' See `Value` for more information.
#'
#' @import dplyr
#'
#' @family Data Validation
#'
#' @return
#' Returns an error message by default, where 'text' is passed in `return`.
#' When 'data_with_flag' is passed, a copy of your original dataframe with an additional column containing the kw/nkw flag will be returned.
#' When 'data_clean' is passed, a full dataframe excluding "nkw" employees will be returned.
#' when 'data_summmary' is passed, a summary table by organization listing the number and % of non-knowledge workers will be returned.
#' A different output is returned depending on the value passed to the `return`
#' argument:
#' - `"text"`: string. Returns a diagnostic message.
#' - `"data_with_flag"`: data frame. Original input data with an additional
#' column containing the `kw`/`nkw` flag.
#' - `"data_clean"`: data frame. Data frame with non-knowledge workers
#' excluded.
#' - `"data_summary"`: data frame. A summary table by organization listing
#' the number and % of non-knowledge workers.
#'
#' @export
identify_nkw <- function(data, collab_threshold = 5, return = "data_summary"){

Просмотреть файл

@ -27,7 +27,6 @@
#' Returns a data frame with `Date` (if grouping variable is not set),
#' the metric, and the corresponding z-score.
#'
#' @family General
#' @family Data Validation
#'
#' @export

Просмотреть файл

@ -6,16 +6,35 @@
#' @title Identify groups under privacy threshold
#'
#' @description
#' This function scans a standard query output for groups with of employees under the privacy threshold.
#' The method consists in reviewing each individual HR attribute, and count the distinct people within each group.
#' This function scans a standard query output for groups with of employees
#' under the privacy threshold. The method consists in reviewing each individual
#' HR attribute, and count the distinct people within each group.
#'
#' @param data A Standard Person Query dataset in the form of a data frame.
#' @param hrvar A list of HR Variables to consider in the scan.
#' Defaults to all HR attributes identified.
#' @param mingroup Numeric value setting the privacy threshold / minimum group size.
#' Defaults to 5.
#' @param return A character vector specifying what to return.
#' Valid values include "table" (default) and "text" (text)
#' @param mingroup Numeric value setting the privacy threshold / minimum group
#' size. Defaults to 5.
#' @param return String specifying what to return. This must be one of the
#' following strings:
#' - `"table"`
#' - `"text"`
#'
#' See `Value` for more information.
#'
#' @return
#' A different output is returned depending on the value passed to the `return`
#' argument:
#' - `"table"`: data frame. A summary table of groups that fall below the
#' privacy threshold.
#' - `"text"`: string. A diagnostic message.
#'
#' @examples
#' # Return a summary table
#' dv_data %>% identify_privacythreshold(return = "table")
#'
#' # Return a diagnostic message
#' dv_data %>% identify_privacythreshold(return = "text")
#'
#' @import dplyr
#' @import ggplot2

Просмотреть файл

@ -13,11 +13,13 @@
#' @param data A Workplace Analytics dataset in the form of a data frame.
#' If the data is not identified as a Workplace Analytics dataset, the function
#' will return an error.
#' @param threshold Debugging use only. Increase to raise the 'strictness' of the
#' guessing algorithm. Defaults to 2.
#' @param threshold Debugging use only. Increase to raise the 'strictness' of
#' the guessing algorithm. Defaults to 2.
#'
#' @family Data Validation
#'
#' @return String. A diagnostic message is returned.
#'
#' @examples
#' identify_query(sq_data) # Standard query
#' identify_query(mt_data) # Meeting query
@ -64,11 +66,17 @@ identify_query <- function(data, threshold = 2){
f_guess <- qlabels[which.min(total_check_vec)]
if(total_check_n == 0){
stop("Error: please check if query data is properly formatted query data.")
} else if(min_nm > threshold){
stop("Column mismatches: please check if query data is properly formatted query data.")
} else {
f_guess
}
}

Просмотреть файл

@ -28,11 +28,13 @@
#' argument:
#' - `"plot"`: ggplot object. A bar plot for the weekly count of shifts.
#' - `"table"`: data frame. A summary table for the count of shifts.
#' - `"data`: data frame. Input data appended with the following columns:
#' - `Shifts`
#' - `"data`: data frame. Input data appended with the `Shifts` columns.
#'
#' @importFrom data.table ":=" "%like%" "%between%"
#'
#' @family Data Validation
#' @family Working Patterns
#'
#' @examples
#' # Return plot
#' dv_data %>% identify_shifts()

Просмотреть файл

@ -37,6 +37,7 @@
#'
#' @importFrom data.table ":=" "%like%" "%between%"
#'
#' @family Data Validation
#' @family Working Patterns
#'
#' @examples

Просмотреть файл

@ -3,7 +3,8 @@
# Licensed under the MIT License. See LICENSE.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#' @title Tenure calculation based on different input dates, returns data summary table or histogram
#' @title Tenure calculation based on different input dates, returns data
#' summary table or histogram
#'
#' @description
#' This function calculates employee tenure based on different input dates.
@ -13,8 +14,10 @@
#' @family Data Validation
#'
#' @param data A Standard Person Query dataset in the form of a data frame.
#' @param end_date A string specifying the name of the date variable representing the latest date. Defaults to "Date".
#' @param beg_date A string specifying the name of the date variable representing the hire date. Defaults to "HireDate".
#' @param end_date A string specifying the name of the date variable
#' representing the latest date. Defaults to "Date".
#' @param beg_date A string specifying the name of the date variable
#' representing the hire date. Defaults to "HireDate".
#' @param maxten A numeric value representing the maximum tenure.
#' If the tenure exceeds this threshold, it would be accounted for in the flag message.
#' @param return String to specify what to return.
@ -95,9 +98,11 @@ identify_tenure <- function(data,
)
} else if(return == "data_cleaned"){
return(data %>% filter(!(PersonId %in% oddpeople$PersonId)) %>% data.frame())
} else if(return == "data_dirty"){
return(data %>% filter((PersonId %in% oddpeople$PersonId)) %>% data.frame())
} else if(return == "data"){
@ -108,7 +113,9 @@ identify_tenure <- function(data,
select(PersonId, TenureYear)
} else {
stop("Error: please check inputs for `return`")
}
}

Просмотреть файл

@ -8,7 +8,7 @@
#'
#' @description Uses `import_wpa()` to read a Workplace Analytics query in CSV
#' and convert this into the serialized FST format which is much faster to
#' read. The 'fst' package must be installed.
#' read. The 'fst' package must be installed, or an error message is returned.
#'
#' @details
#' The [fst](https://www.fstpackage.org/) package provides a way to serialize
@ -31,6 +31,8 @@
#' file will be saved in the same directory with a different file extension.
#' @param ... Additional arguments to pass to `import_wpa()`.
#'
#' @family Import and Export
#'
#' @export
import_to_fst <- function(path, ...){

Просмотреть файл

@ -6,8 +6,8 @@
#' @title Import a Workplace Analytics Query
#'
#' @description
#' Import a Workplace Analytics Query from a local CSV File, with variable classifications optimised
#' for other 'wpa' functions.
#' Import a Workplace Analytics Query from a local CSV File, with variable
#' classifications optimised for other 'wpa' functions.
#'
#' @details
#' `import_wpa()` uses `data.table::fread()` to import CSV files for speed,
@ -28,6 +28,8 @@
#'
#' @return A `tibble` is returned.
#'
#' @family Import and Export
#'
#' @export
import_wpa <- function(x,
standardise = FALSE,

Просмотреть файл

@ -6,9 +6,13 @@
#' @title Plot Internal Network Breadth and Size as a scatter plot
#'
#' @description
#' Plot the internal network metrics for a HR variable as a scatter plot, showing
#' Internal Network Breadth as the vertical axis and Internal Network Size as the
#' horizontal axis.
#' Plot the internal network metrics for a HR variable as a scatter plot,
#' showing Internal Network Breadth as the vertical axis and Internal Network
#' Size as the horizontal axis.
#'
#' @details
#' Uses the metrics `Internal_network_size` and
#' `Networking_outside_organization`.
#'
#' @inheritParams create_bubble
#'
@ -16,7 +20,11 @@
#' # Return plot
#' sq_data %>% internal_network_plot(return = "plot")
#'
#' @family Connectivity
#' # Return summary table
#' sq_data %>% internal_network_plot(return = "table")
#'
#' @family Visualization
#' @family Network
#'
#' @export

Просмотреть файл

@ -6,15 +6,19 @@
#' @title Identify whether string is a date format
#'
#' @description
#' This function uses regular expression to determine whether
#' a string is of the format "mdy", separated by "-", "/",
#' or ".", returning a logical vector.
#' This function uses regular expression to determine whether a string is of the
#' format `"mdy"`, separated by `"-"`, `"/"`, or `"."`, returning a logical
#' vector.
#'
#' @param string Character string to test whether is a date format.
#'
#' @return logical value indicating whether the string is a date format.
#'
#' @examples
#' is_date_format("1/5/2020")
#'
#' @family Support
#'
#' @export
is_date_format <- function(string){
grepl("^\\d{1,2}[- /.]\\d{1,2}[- /.]\\d{1,4}$",

Просмотреть файл

@ -8,12 +8,11 @@
#' @description
#' Returns a heatmapped table by default, with options to return a table.
#'
#' @param data A Standard Person Query dataset in the form of a data frame.
#' @param hrvar HR Variable by which to split metrics. Accepts a character vector, e.g. "Organization"
#' @param mingroup Numeric value setting the privacy threshold / minimum group size. Defaults to 5.
#' @param metrics A character vector containing the variable names to calculate averages of.
#' @template spq-params
#' @param metrics A character vector containing the variable names to calculate
#' averages of.
#' @param return Character vector specifying what to return, defaults to "plot".
#' Valid inputs are "plot" and "table".
#' Valid inputs are "plot" and "table".
#' @param textsize A numeric value specifying the text size to show in the plot.
#'
#' @import dplyr
@ -58,6 +57,12 @@ keymetrics_scan <- function(data,
return = "plot",
textsize = 2){
## Handling NULL values passed to hrvar
if(is.null(hrvar)){
data <- totals_col(data)
hrvar <- "Total"
}
myTable <-
data %>%
rename(group = !!sym(hrvar)) %>% # Rename HRvar to `group`

3
man-roxygen/ch.R Normal file
Просмотреть файл

@ -0,0 +1,3 @@
#' @section Metrics used:
#' The metric `Collaboration_hours` is used in the calculations. Please ensure
#' that your query contains a metric with the exact same name.

6
man-roxygen/spq-params.R Normal file
Просмотреть файл

@ -0,0 +1,6 @@
#' @param data A Standard Person Query dataset in the form of a data frame.
#' @param hrvar String containing the name of the HR Variable by which to split
#' metrics. Defaults to `"Organization"`. To run the analysis on the total
#' instead of splitting by an HR attribute, supply `NULL` (without quotes).
#' @param mingroup Numeric value setting the privacy threshold / minimum group
#' size. Defaults to 5.

Просмотреть файл

@ -2,7 +2,8 @@
% Please edit documentation in R/IV_by_Period.R
\name{IV_by_period}
\alias{IV_by_period}
\title{Identify the WPA metrics that have the biggest change between two periods.}
\title{Identify the WPA metrics that have the biggest change between two
periods.}
\usage{
IV_by_period(
data,
@ -16,31 +17,64 @@ IV_by_period(
}
\arguments{
\item{data}{Person Query as a dataframe including date column named "Date"
This function assumes the data format is MM/DD/YYYY as is standard in a WpA query output.}
This function assumes the data format is \code{MM/DD/YYYY} as is standard in a
WpA query output.}
\item{before_start}{Start date of "before" time period in YYYY-MM-DD. Defaults to earliest date in dataset.}
\item{before_start}{Start date of "before" time period in \code{YYYY-MM-DD}.
Defaults to earliest date in dataset.}
\item{before_end}{End date of "before" time period in YYYY-MM-DD}
\item{before_end}{End date of "before" time period in \code{YYYY-MM-DD}}
\item{after_start}{Start date of "after" time period in YYYY-MM-DD. Defaults to day after before_end.}
\item{after_start}{Start date of "after" time period in \code{YYYY-MM-DD}.
Defaults to day after before_end.}
\item{after_end}{End date of "after" time period in YYYY-MM-DD. Defaults to latest date in dataset.}
\item{after_end}{End date of "after" time period in \code{YYYY-MM-DD}. Defaults to
latest date in dataset.}
\item{mybins}{Number of bins to cut the data into for Information Value analysis. Defaults to 10.}
\item{mybins}{Number of bins to cut the data into for Information Value
analysis. Defaults to 10.}
\item{return}{Specify whether to return a summary table or detailed Excel and PDF files
Specify "table" or "detailed" for outputs. Defaults to table.}
\item{return}{String specifying what to return. The current only valid
option is \code{"table"}.}
}
\value{
data frame containing all the variables and the corresponding Information
Value.
}
\description{
This function uses the Information Value algorithm to predict which WPA metrics are most explained by the change in dates.
\ifelse{html}{\out{<a href='https://www.tidyverse.org/lifecycle/#experimental'><img src='figures/lifecycle-experimental.svg' alt='Experimental lifecycle'></a>}}{\strong{Experimental}}
This function uses the Information Value algorithm to predict
which Workplace Analytics metrics are most explained by the change in dates.
}
\examples{
# Returns a data frame
\donttest{
sq_data \%>\%
IV_by_period(
before_start = "2019-11-03",
before_end = "2019-11-09",
after_start = "2019-11-10",
after_end = "2019-11-16"
)
}
}
\seealso{
Other Flexible Input:
\code{\link{period_change}()}
Other Variable Association:
\code{\link{IV_report}()},
\code{\link{create_IV}()}
Other Information Value:
\code{\link{IV_report}()},
\code{\link{create_IV}()}
Other Time-series:
\code{\link{create_line_asis}()},
\code{\link{create_line}()},
\code{\link{create_period_scatter}()},
\code{\link{create_trend}()}
}
\concept{Flexible Input}
\concept{Information Value}
\concept{Time-series}
\concept{Variable Association}

Просмотреть файл

@ -64,9 +64,14 @@ Other Reports:
\code{\link{subject_validate_report}()},
\code{\link{validation_report}()}
Other Variable Association:
\code{\link{IV_by_period}()},
\code{\link{create_IV}()}
Other Information Value:
\code{\link{IV_by_period}()},
\code{\link{create_IV}()}
}
\concept{Information Value}
\concept{Reports}
\concept{Variable Association}

Просмотреть файл

@ -95,7 +95,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other After-hours Collaboration:
\code{\link{afterhours_fizz}()},

Просмотреть файл

@ -79,7 +79,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other After-hours Collaboration:
\code{\link{afterhours_dist}()},

Просмотреть файл

@ -83,7 +83,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other After-hours Collaboration:
\code{\link{afterhours_dist}()},

Просмотреть файл

@ -70,7 +70,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other After-hours Collaboration:
\code{\link{afterhours_dist}()},

Просмотреть файл

@ -12,12 +12,15 @@ afterhours_sum(data, hrvar = "Organization", mingroup = 5, return = "plot")
\arguments{
\item{data}{A Standard Person Query dataset in the form of a data frame.}
\item{hrvar}{HR Variable by which to split metrics, defaults to "Organization"
but accepts any character vector, e.g. "LevelDesignation"}
\item{hrvar}{String containing the name of the HR Variable by which to split
metrics. Defaults to \code{"Organization"}. To run the analysis on the total
instead of splitting by an HR attribute, supply \code{NULL} (without quotes).}
\item{mingroup}{Numeric value setting the privacy threshold / minimum group size. Defaults to 5.}
\item{mingroup}{Numeric value setting the privacy threshold / minimum group
size. Defaults to 5.}
\item{return}{String specifying what to return. This must be one of the following strings:
\item{return}{String specifying what to return. This must be one of the
following strings:
\itemize{
\item \code{"plot"}
\item \code{"table"}
@ -83,7 +86,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other After-hours Collaboration:
\code{\link{afterhours_dist}()},

Просмотреть файл

@ -72,7 +72,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other After-hours Collaboration:
\code{\link{afterhours_dist}()},

Просмотреть файл

@ -26,6 +26,8 @@ Other Support:
\code{\link{cut_hour}()},
\code{\link{extract_date_range}()},
\code{\link{extract_hr}()},
\code{\link{heat_colours}()},
\code{\link{is_date_format}()},
\code{\link{rgb2hex}()}
}
\concept{Support}

Просмотреть файл

@ -45,6 +45,8 @@ Other Support:
\code{\link{cut_hour}()},
\code{\link{extract_date_range}()},
\code{\link{extract_hr}()},
\code{\link{heat_colours}()},
\code{\link{is_date_format}()},
\code{\link{rgb2hex}()}
}
\concept{Support}

Просмотреть файл

@ -61,12 +61,15 @@ Other Data Validation:
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},

Просмотреть файл

@ -92,7 +92,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Collaboration:
\code{\link{collaboration_dist}()},

Просмотреть файл

@ -55,9 +55,12 @@ Analyze the distribution of Collaboration Hours.
Returns a stacked bar plot by default.
Additional options available to return a table with distribution elements.
}
\details{
Uses the metric \code{Collaboration_hours}.
\section{Metrics used}{
The metric \code{Collaboration_hours} is used in the calculations. Please ensure
that your query contains a metric with the exact same name.
}
\examples{
# Return plot
collaboration_dist(sq_data, hrvar = "Organization")
@ -100,7 +103,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Collaboration:
\code{\link{collaboration_area}()},

Просмотреть файл

@ -36,9 +36,12 @@ Analyze weekly collaboration hours distribution, and returns
a 'fizzy' scatter plot by default.
Additional options available to return a table with distribution elements.
}
\details{
Uses the metric \code{Collaboration_hours}.
\section{Metrics used}{
The metric \code{Collaboration_hours} is used in the calculations. Please ensure
that your query contains a metric with the exact same name.
}
\examples{
# Return plot
collaboration_fizz(sq_data, hrvar = "Organization", return = "plot")
@ -82,7 +85,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Collaboration:
\code{\link{collaboration_area}()},

Просмотреть файл

@ -38,9 +38,12 @@ By default returns a line chart for collaboration hours,
with a separate panel per value in the HR attribute.
Additional options available to return a summary table.
}
\details{
Uses the metric \code{Collaboration_hours}.
\section{Metrics used}{
The metric \code{Collaboration_hours} is used in the calculations. Please ensure
that your query contains a metric with the exact same name.
}
\examples{
# Return a line plot
collaboration_line(sq_data, hrvar = "LevelDesignation")
@ -84,7 +87,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Collaboration:
\code{\link{collaboration_area}()},

Просмотреть файл

@ -78,7 +78,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Collaboration:
\code{\link{collaboration_area}()},

Просмотреть файл

@ -78,7 +78,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Collaboration:
\code{\link{collaboration_area}()},

Просмотреть файл

@ -31,9 +31,12 @@ Provides a week by week view of collaboration time.
By default returns a week by week heatmap, highlighting the points in time with most activity.
Additional options available to return a summary table.
}
\details{
Uses the metric \code{Collaboration_hours}.
\section{Metrics used}{
The metric \code{Collaboration_hours} is used in the calculations. Please ensure
that your query contains a metric with the exact same name.
}
\seealso{
Other Visualization:
\code{\link{afterhours_dist}()},
@ -69,7 +72,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Collaboration:
\code{\link{collaboration_area}()},

Просмотреть файл

@ -40,6 +40,8 @@ Other Support:
\code{\link{cut_hour}()},
\code{\link{extract_date_range}()},
\code{\link{extract_hr}()},
\code{\link{heat_colours}()},
\code{\link{is_date_format}()},
\code{\link{rgb2hex}()}
}
\concept{Support}

Просмотреть файл

@ -30,6 +30,8 @@ https://www.github.com/martinctc/surveytoolbox.
\seealso{
Other Import and Export:
\code{\link{create_dt}()},
\code{\link{export}()}
\code{\link{export}()},
\code{\link{import_to_fst}()},
\code{\link{import_wpa}()}
}
\concept{Import and Export}

Просмотреть файл

@ -77,6 +77,10 @@ sq_data \%>\%
}
}
\seealso{
Other Variable Association:
\code{\link{IV_by_period}()},
\code{\link{IV_report}()}
Other Information Value:
\code{\link{IV_by_period}()},
\code{\link{IV_report}()}

Просмотреть файл

@ -17,15 +17,15 @@ create_bar(
\arguments{
\item{data}{A Standard Person Query dataset in the form of a data frame.}
\item{metric}{Character string containing the name of the metric,
e.g. "Collaboration_hours"}
\item{hrvar}{String containing the name of the HR Variable by which to split
metrics. Defaults to \code{"Organization"}. To run the analysis on the total
instead of splitting by an HR attribute, supply \code{NULL} (without quotes).}
\item{hrvar}{HR Variable by which to split metrics, defaults to "Organization"
but accepts any character vector, e.g. "LevelDesignation"}
\item{mingroup}{Numeric value setting the privacy threshold / minimum group
size. Defaults to 5.}
\item{mingroup}{Numeric value setting the privacy threshold / minimum group size. Defaults to 5.}
\item{return}{String specifying what to return. This must be one of the following strings:
\item{return}{String specifying what to return. This must be one of the
following strings:
\itemize{
\item \code{"plot"}
\item \code{"table"}
@ -49,7 +49,8 @@ A different output is returned depending on the value passed to the \code{return
}
}
\description{
Provides an overview analysis of a selected metric by calculating a mean per metric.
Provides an overview analysis of a selected metric by calculating a mean per
metric.
Returns a bar plot showing the average of a selected metric by default.
Additional options available to return a summary table.
}
@ -103,7 +104,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Flexible:
\code{\link{create_bar_asis}()},

Просмотреть файл

@ -127,7 +127,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Flexible:
\code{\link{create_bar}()},

Просмотреть файл

@ -103,7 +103,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Flexible:
\code{\link{create_bar_asis}()},

Просмотреть файл

@ -100,7 +100,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Flexible:
\code{\link{create_bar_asis}()},

Просмотреть файл

@ -100,7 +100,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Flexible:
\code{\link{create_bar_asis}()},

Просмотреть файл

@ -20,6 +20,8 @@ See https://martinctc.github.io/blog/vignette-downloadable-tables-in-rmarkdown-w
\seealso{
Other Import and Export:
\code{\link{copy_df}()},
\code{\link{export}()}
\code{\link{export}()},
\code{\link{import_to_fst}()},
\code{\link{import_wpa}()}
}
\concept{Import and Export}

Просмотреть файл

@ -90,7 +90,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Flexible:
\code{\link{create_bar_asis}()},

Просмотреть файл

@ -94,7 +94,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Flexible:
\code{\link{create_bar_asis}()},
@ -113,6 +115,7 @@ Other Flexible:
\code{\link{create_trend}()}
Other Time-series:
\code{\link{IV_by_period}()},
\code{\link{create_line_asis}()},
\code{\link{create_period_scatter}()},
\code{\link{create_trend}()}

Просмотреть файл

@ -98,7 +98,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Flexible:
\code{\link{create_bar_asis}()},
@ -117,6 +119,7 @@ Other Flexible:
\code{\link{create_trend}()}
Other Time-series:
\code{\link{IV_by_period}()},
\code{\link{create_line}()},
\code{\link{create_period_scatter}()},
\code{\link{create_trend}()}

Просмотреть файл

@ -108,7 +108,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Flexible:
\code{\link{create_bar_asis}()},
@ -127,6 +129,7 @@ Other Flexible:
\code{\link{create_trend}()}
Other Time-series:
\code{\link{IV_by_period}()},
\code{\link{create_line_asis}()},
\code{\link{create_line}()},
\code{\link{create_trend}()}

Просмотреть файл

@ -118,7 +118,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Flexible:
\code{\link{create_bar_asis}()},

Просмотреть файл

@ -75,7 +75,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Flexible:
\code{\link{create_bar_asis}()},

Просмотреть файл

@ -91,7 +91,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Flexible:
\code{\link{create_bar_asis}()},

Просмотреть файл

@ -104,7 +104,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Flexible:
\code{\link{create_bar_asis}()},

Просмотреть файл

@ -75,7 +75,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Flexible:
\code{\link{create_bar_asis}()},
@ -94,6 +96,7 @@ Other Flexible:
\code{\link{create_stacked}()}
Other Time-series:
\code{\link{IV_by_period}()},
\code{\link{create_line_asis}()},
\code{\link{create_line}()},
\code{\link{create_period_scatter}()}

Просмотреть файл

@ -36,6 +36,8 @@ Other Support:
\code{\link{combine_signals}()},
\code{\link{extract_date_range}()},
\code{\link{extract_hr}()},
\code{\link{heat_colours}()},
\code{\link{is_date_format}()},
\code{\link{rgb2hex}()}
}
\concept{Support}

Просмотреть файл

@ -92,7 +92,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Emails:
\code{\link{email_fizz}()},

Просмотреть файл

@ -77,7 +77,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Emails:
\code{\link{email_dist}()},

Просмотреть файл

@ -78,7 +78,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Emails:
\code{\link{email_dist}()},

Просмотреть файл

@ -78,7 +78,9 @@ Other Visualization:
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Emails:
\code{\link{email_dist}()},

Просмотреть файл

@ -12,12 +12,15 @@ email_sum(data, hrvar = "Organization", mingroup = 5, return = "plot")
\arguments{
\item{data}{A Standard Person Query dataset in the form of a data frame.}
\item{hrvar}{HR Variable by which to split metrics, defaults to "Organization"
but accepts any character vector, e.g. "LevelDesignation"}
\item{hrvar}{String containing the name of the HR Variable by which to split
metrics. Defaults to \code{"Organization"}. To run the analysis on the total
instead of splitting by an HR attribute, supply \code{NULL} (without quotes).}
\item{mingroup}{Numeric value setting the privacy threshold / minimum group size. Defaults to 5.}
\item{mingroup}{Numeric value setting the privacy threshold / minimum group
size. Defaults to 5.}
\item{return}{String specifying what to return. This must be one of the following strings:
\item{return}{String specifying what to return. This must be one of the
following strings:
\itemize{
\item \code{"plot"}
\item \code{"table"}
@ -80,7 +83,9 @@ Other Visualization:
\code{\link{email_rank}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Emails:
\code{\link{email_dist}()},

Просмотреть файл

@ -64,7 +64,9 @@ Other Visualization:
\code{\link{email_rank}()},
\code{\link{email_summary}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Emails:
\code{\link{email_dist}()},

Просмотреть файл

@ -58,6 +58,8 @@ the default behaviour is to export a PNG.
\seealso{
Other Import and Export:
\code{\link{copy_df}()},
\code{\link{create_dt}()}
\code{\link{create_dt}()},
\code{\link{import_to_fst}()},
\code{\link{import_wpa}()}
}
\concept{Import and Export}

Просмотреть файл

@ -75,10 +75,13 @@ Other Visualization:
\code{\link{email_rank}()},
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{hrvar_count}()}
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Network:
\code{\link{g2g_data}},
\code{\link{internal_network_plot}()},
\code{\link{network_g2g}()},
\code{\link{network_leiden}()},
\code{\link{network_louvain}()},

Просмотреть файл

@ -27,6 +27,8 @@ Other Support:
\code{\link{combine_signals}()},
\code{\link{cut_hour}()},
\code{\link{extract_hr}()},
\code{\link{heat_colours}()},
\code{\link{is_date_format}()},
\code{\link{rgb2hex}()}
}
\concept{Support}

Просмотреть файл

@ -52,6 +52,8 @@ Other Support:
\code{\link{combine_signals}()},
\code{\link{cut_hour}()},
\code{\link{extract_date_range}()},
\code{\link{heat_colours}()},
\code{\link{is_date_format}()},
\code{\link{rgb2hex}()}
Other Data Validation:
@ -63,12 +65,15 @@ Other Data Validation:
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},

Просмотреть файл

@ -35,6 +35,12 @@ This function flags persons who have an unusual ratio
of collaboration hours to after-hours collaboration hours.
Returns a character string by default.
}
\section{Metrics used}{
The metric \code{Collaboration_hours} is used in the calculations. Please ensure
that your query contains a metric with the exact same name.
}
\examples{
flag_ch_ratio(sq_data)
@ -55,12 +61,15 @@ Other Data Validation:
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},

Просмотреть файл

@ -50,12 +50,15 @@ Other Data Validation:
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},

Просмотреть файл

@ -62,12 +62,15 @@ Other Data Validation:
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},

Просмотреть файл

@ -63,12 +63,15 @@ Other Data Validation:
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},

Просмотреть файл

@ -130,6 +130,7 @@ em_data \%>\%
\seealso{
Other Working Patterns:
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{plot_flex_index}()},
\code{\link{workpatterns_area}()},
\code{\link{workpatterns_classify_bw}()},

Просмотреть файл

@ -35,6 +35,7 @@ Other Data:
Other Network:
\code{\link{external_network_plot}()},
\code{\link{internal_network_plot}()},
\code{\link{network_g2g}()},
\code{\link{network_leiden}()},
\code{\link{network_louvain}()},

Просмотреть файл

@ -2,9 +2,12 @@
% Please edit documentation in R/heat_colours.R
\name{heat_colours}
\alias{heat_colours}
\alias{heat_colors}
\title{Generate a vector of \code{n} contiguous colours, as a red-yellow-green palette.}
\usage{
heat_colours(n, alpha, rev = FALSE)
heat_colors(n, alpha, rev = FALSE)
}
\arguments{
\item{n}{the number of colors (>= 1) to be in the palette.}
@ -12,7 +15,8 @@ heat_colours(n, alpha, rev = FALSE)
\item{alpha}{an alpha-transparency level in the range of 0 to 1
(0 means transparent and 1 means opaque)}
\item{rev}{logical indicating whether the ordering of the colors should be reversed.}
\item{rev}{logical indicating whether the ordering of the colors should be
reversed.}
}
\value{
A character vector containing the HEX codes and the same length as \code{n} is
@ -25,6 +29,19 @@ corresponding to the heat map palette.
\examples{
barplot(rep(10, 50), col = heat_colours(n = 50), border = NA)
barplot(rep(10, 50), col = heat_colours(n = 50, alpha = 0.5, rev = TRUE), border = NA)
barplot(rep(10, 50), col = heat_colours(n = 50, alpha = 0.5, rev = TRUE),
border = NA)
}
\seealso{
Other Support:
\code{\link{camel_clean}()},
\code{\link{check_inputs}()},
\code{\link{combine_signals}()},
\code{\link{cut_hour}()},
\code{\link{extract_date_range}()},
\code{\link{extract_hr}()},
\code{\link{is_date_format}()},
\code{\link{rgb2hex}()}
}
\concept{Support}

Просмотреть файл

@ -40,6 +40,44 @@ hr_trend(dv_data, return = "table")
}
\seealso{
Other Visualization:
\code{\link{afterhours_dist}()},
\code{\link{afterhours_fizz}()},
\code{\link{afterhours_line}()},
\code{\link{afterhours_rank}()},
\code{\link{afterhours_summary}()},
\code{\link{afterhours_trend}()},
\code{\link{collaboration_area}()},
\code{\link{collaboration_dist}()},
\code{\link{collaboration_fizz}()},
\code{\link{collaboration_line}()},
\code{\link{collaboration_rank}()},
\code{\link{collaboration_sum}()},
\code{\link{collaboration_trend}()},
\code{\link{create_bar_asis}()},
\code{\link{create_bar}()},
\code{\link{create_boxplot}()},
\code{\link{create_bubble}()},
\code{\link{create_dist}()},
\code{\link{create_fizz}()},
\code{\link{create_line_asis}()},
\code{\link{create_line}()},
\code{\link{create_period_scatter}()},
\code{\link{create_rank}()},
\code{\link{create_sankey}()},
\code{\link{create_scatter}()},
\code{\link{create_stacked}()},
\code{\link{create_trend}()},
\code{\link{email_dist}()},
\code{\link{email_fizz}()},
\code{\link{email_line}()},
\code{\link{email_rank}()},
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hrvar_count}()},
\code{\link{internal_network_plot}()}
Other Data Validation:
\code{\link{check_query}()},
\code{\link{extract_hr}()},
@ -49,12 +87,15 @@ Other Data Validation:
\code{\link{flag_outlooktime}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},
@ -62,3 +103,4 @@ Other Data Validation:
\code{\link{track_HR_change}()}
}
\concept{Data Validation}
\concept{Visualization}

Просмотреть файл

@ -12,10 +12,10 @@ analysis_scope(data, hrvar = "Organization", return = "plot")
\arguments{
\item{data}{A Standard Person Query dataset in the form of a data frame.}
\item{hrvar}{HR Variable by which to split metrics, defaults to "Organization"
but accepts any character vector, e.g. "LevelDesignation".
If a vector with more than one value is provided, the HR attributes are automatically
concatenated.}
\item{hrvar}{HR Variable by which to split metrics, defaults to
"Organization" but accepts any character vector, e.g. "LevelDesignation".
If a vector with more than one value is provided, the HR attributes are
automatically concatenated.}
\item{return}{String specifying what to return. This must be one of the
following strings:
@ -82,7 +82,9 @@ Other Visualization:
\code{\link{email_rank}()},
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()}
\code{\link{external_network_plot}()},
\code{\link{hr_trend}()},
\code{\link{internal_network_plot}()}
Other Data Validation:
\code{\link{check_query}()},
@ -93,12 +95,15 @@ Other Data Validation:
\code{\link{flag_outlooktime}()},
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},

Просмотреть файл

@ -2,7 +2,8 @@
% Please edit documentation in R/hrvar_count_all.R
\name{hrvar_count_all}
\alias{hrvar_count_all}
\title{Create count of distinct fields and percentage of employees with NAs for all HR variables}
\title{Create count of distinct fields and percentage of employees with
missing values for all HR variables}
\usage{
hrvar_count_all(
data,
@ -15,25 +16,34 @@ hrvar_count_all(
\arguments{
\item{data}{A Standard Person Query dataset in the form of a data frame.}
\item{n_var}{number of HR variables to include in report as rows. Default is set to 10 HR variables.}
\item{n_var}{number of HR variables to include in report as rows. Default is
set to 50 HR variables.}
\item{return}{String to specify what to return}
\item{threshold}{The max number of unique values allowed for any attribute. Default is 100.}
\item{threshold}{The max number of unique values allowed for any attribute.
Default is 100.}
\item{maxna}{The max percentage of NAs allowable for any column. Default is 20.}
\item{maxna}{The max percentage of NAs allowable for any column. Default is
20.}
}
\value{
Returns an error message by default, where 'text' is passed in \code{return}.
When 'table' is passed, a summary table listing the number of distinct fields and percentage of NAs for the specified number of HR attributes will be returned.
when 'message' is passed, outputs a message indicating which values are beyond the specified thresholds.
\itemize{
\item \code{'table'}: data frame. A summary table listing the number of distinct
fields and percentage of missing values for the specified number of HR
attributes will be returned.
\item \code{'message'}: outputs a message indicating which values are
beyond the specified thresholds.
}
}
\description{
This function enables you to create a summary table to validate organizational data. This table will provide a summary of the data found
in the WpA Sources page.
This function will return a summary table with the count of distinct fields per HR attribute and the percentage of
employees with NAs for that attribute.
See hrvar_count function for more detail on the specific HR attribute of interest.
This function enables you to create a summary table to validate
organizational data. This table will provide a summary of the data found in
the Workplace Analytics Sources page. This function will return a summary
table with the count of distinct fields per HR attribute and the percentage
of employees with missing values for that attribute. See \code{hrvar_count()}
function for more detail on the specific HR attribute of interest.
}
\examples{
# Return a summary table of all HR attributes
@ -50,12 +60,15 @@ Other Data Validation:
\code{\link{flag_outlooktime}()},
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},

Просмотреть файл

@ -9,40 +9,86 @@ identify_churn(data, n1 = 6, n2 = 6, return = "message", flip = FALSE)
\arguments{
\item{data}{A Person Query as a data frame. Must contain a \code{PersonId}.}
\item{n1}{A numeric value specifying the number of weeks at the beginning of the period
that defines the measured employee set. Defaults to 6.}
\item{n1}{A numeric value specifying the number of weeks at the beginning of
the period that defines the measured employee set. Defaults to 6.}
\item{n2}{A numeric value specifying the number of weeks at the end of the period
to calculate whether employees have churned from the data. Defaults to 6.}
\item{n2}{A numeric value specifying the number of weeks at the end of the
period to calculate whether employees have churned from the data. Defaults
to 6.}
\item{return}{String specifying what to return. Defaults to "message", with options to
return a character string ("text") or the \code{PersonId} of employees who have been identified
as churned ("data").}
\item{return}{String specifying what to return. This must be one of the
following strings:
\itemize{
\item \code{"message"} (default)
\item \code{"text"}
\item \code{"data"}
}
\item{flip}{Logical, defaults to FALSE. This determines whether to reverse the logic of identifying the
non-overlapping set. If set to \code{TRUE}, this effectively identifies new-joiners, or those
who were not present in the first n weeks of the data but were present in the final n weeks.}
See \code{Value} for more information.}
\item{flip}{Logical, defaults to FALSE. This determines whether to reverse
the logic of identifying the non-overlapping set. If set to \code{TRUE}, this
effectively identifies new-joiners, or those who were not present in the
first n weeks of the data but were present in the final n weeks.}
}
\value{
A different output is returned depending on the value passed to the \code{return}
argument:
\itemize{
\item \code{"message"}: Message on console. A diagnostic message.
\item \code{"text"}: String. A diagnostic message.
\item \code{"data"}: Character vector containing the the \code{PersonId} of
employees who have been identified as churned.
}
}
\description{
This function identifies and counts the number of employees who have churned from
the dataset by measuring whether an employee who is present in the first \code{n} (n1) weeks
of the data is present in the last \code{n} (n2) weeks of the data.
This function identifies and counts the number of employees who have churned
from the dataset by measuring whether an employee who is present in the first
\code{n} (n1) weeks of the data is present in the last \code{n} (n2) weeks of the data.
}
\details{
An additional use case of this function is the ability to identify "new-joiners" by using
the argument \code{flip}.
An additional use case of this function is the ability to identify
"new-joiners" by using the argument \code{flip}.
If an employee is present in the first \code{n} weeks of the data but not present in the last
\code{n} weeks of the data, the function considers the employee as churned. As the measurement period
is defined by the number of weeks from the start and the end of the passed data frame, you
may consider filtering the dates accordingly before running this function.
If an employee is present in the first \code{n} weeks of the data but not present
in the last \code{n} weeks of the data, the function considers the employee as
churned. As the measurement period is defined by the number of weeks from the
start and the end of the passed data frame, you may consider filtering the
dates accordingly before running this function.
Another assumption that is in place is that any employee whose \code{PersonId} is not available in the
data has churned. Note that there may be other reasons why an employee's \code{PersonId} may not
be present, e.g. maternity/paternity leave, Workplace Analytics license has been removed,
shift to a low-collaboration role (to the extent that he/she becomes inactive).
Another assumption that is in place is that any employee whose \code{PersonId} is
not available in the data has churned. Note that there may be other reasons
why an employee's \code{PersonId} may not be present, e.g. maternity/paternity
leave, Workplace Analytics license has been removed, shift to a
low-collaboration role (to the extent that he/she becomes inactive).
}
\examples{
sq_data \%>\% identify_churn(n1 = 3, n2 = 3, return = "message")
}
\seealso{
Other Data Validation:
\code{\link{check_query}()},
\code{\link{extract_hr}()},
\code{\link{flag_ch_ratio}()},
\code{\link{flag_em_ratio}()},
\code{\link{flag_extreme}()},
\code{\link{flag_outlooktime}()},
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},
\code{\link{subject_validate}()},
\code{\link{track_HR_change}()}
}
\concept{Data Validation}

Просмотреть файл

@ -9,25 +9,53 @@ identify_holidayweeks(data, sd = 1, return = "message")
\arguments{
\item{data}{A Standard Person Query dataset in the form of a data frame.}
\item{sd}{The standard deviation below the mean for collaboration hours that should define an outlier week. Enter a positive number. Default is 1 standard deviation.}
\item{sd}{The standard deviation below the mean for collaboration hours that
should define an outlier week. Enter a positive number. Default is 1
standard deviation.
\item{return}{String to specify what to return. Returns a message by default (\code{return} = "message").
Valid options are:
#' @param return String specifying what to return. This must be one of the
following strings:
\itemize{
\item When 'message' is passed, a message is printed identifying holiday weeks.
\item When 'data' is passed, a dataset with outlier weeks flagged in a new column is returned as a dataframe.
\item When 'data_cleaned' is passed, a dataset with outlier weeks removed is returned as a dataframe.
\item when 'data_dirty' is passed, a dataset with only outlier weeks is returned as a dataframe.
\item when 'plot' is passed, a plot with holiday weeks highlighted is returned as a dataframe.
}}
\item \code{"message"} (default)
\item \code{"data"}
\item \code{"data_cleaned"}
\item \code{"data_dirty"}
\item \code{"plot"}
}
See \code{Value} for more information.}
}
\value{
A different output is returned depending on the value passed to the \code{return}
argument:
\itemize{
\item \code{"message"}: message on console. a message is printed identifying holiday
weeks.
\item \code{"data"}: data frame. A dataset with outlier weeks flagged in a new
column is returned as a dataframe.
\item \code{"data_cleaned"}: data frame. A dataset with outlier weeks removed is
returned.
\item \code{"data_dirty"}: data frame. A dataset with only outlier weeks is
returned.
\item \code{"plot"}: ggplot object. A line plot of Collaboration Hours with holiday
weeks highlighted.
}
}
\description{
This function scans a standard query output for weeks where collaboration hours is far outside the mean.
Returns a list of weeks that appear to be holiday weeks and optionally an edited dataframe with outliers removed.
By default, missing values are excluded.
This function scans a standard query output for weeks where collaboration
hours is far outside the mean. Returns a list of weeks that appear to be
holiday weeks and optionally an edited dataframe with outliers removed. By
default, missing values are excluded.
As best practice, run this function prior to any analysis to remove atypical collaboration weeks from your dataset.
As best practice, run this function prior to any analysis to remove atypical
collaboration weeks from your dataset.
}
\section{Metrics used}{
The metric \code{Collaboration_hours} is used in the calculations. Please ensure
that your query contains a metric with the exact same name.
}
\examples{
# Return a message by default
identify_holidayweeks(sq_data)
@ -35,7 +63,6 @@ identify_holidayweeks(sq_data)
# Return plot
identify_holidayweeks(sq_data, return = "plot")
}
\seealso{
Other Data Validation:
@ -48,11 +75,14 @@ Other Data Validation:
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},

Просмотреть файл

@ -9,20 +9,34 @@ identify_inactiveweeks(data, sd = 2, return = "text")
\arguments{
\item{data}{A Standard Person Query dataset in the form of a data frame.}
\item{sd}{The standard deviation below the mean for collaboration hours that should define an outlier week. Enter a positive number. Default is 1 standard deviation.}
\item{sd}{The standard deviation below the mean for collaboration hours that
should define an outlier week. Enter a positive number. Default is 1
standard deviation.}
\item{return}{String to specify what to return.}
\item{return}{String specifying what to return. This must be one of the
following strings:
\itemize{
\item \code{"text"}
\item \code{"data_cleaned"}
\item \code{"data_dirty"}
}
See \code{Value} for more information.}
}
\value{
Returns an error message by default, where 'text' is returned.
When 'data_cleaned' is passed, a dataset with outlier weeks removed is returned as a dataframe.
When 'data_dirty' is passed, a dataset with outlier weeks is returned as a dataframe.
Returns an error message by default, where \code{'text'} is returned. When
\code{'data_cleaned'} is passed, a dataset with outlier weeks removed is returned
as a dataframe. When \code{'data_dirty'} is passed, a dataset with outlier weeks
is returned as a dataframe.
}
\description{
This function scans a standard query output for weeks where collaboration hours is far outside the mean for any individual person in the dataset.
Returns a list of weeks that appear to be inactive weeks and optionally an edited dataframe with outliers removed.
This function scans a standard query output for weeks where collaboration
hours is far outside the mean for any individual person in the dataset.
Returns a list of weeks that appear to be inactive weeks and optionally an
edited dataframe with outliers removed.
As best practice, run this function prior to any analysis to remove atypical collaboration weeks from your dataset.
As best practice, run this function prior to any analysis to remove atypical
collaboration weeks from your dataset.
}
\seealso{
Other Data Validation:
@ -35,11 +49,14 @@ Other Data Validation:
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},

Просмотреть файл

@ -2,27 +2,49 @@
% Please edit documentation in R/identify_nkw.R
\name{identify_nkw}
\alias{identify_nkw}
\title{Identify Non-Knowledge workers in a Person Query using Collaboration Hours}
\title{Identify Non-Knowledge workers in a Person Query using Collaboration
Hours}
\usage{
identify_nkw(data, collab_threshold = 5, return = "data_summary")
}
\arguments{
\item{data}{A Standard Person Query dataset in the form of a data frame.}
\item{collab_threshold}{The collaboration hours threshold that should be exceeded as an average for the entire analysis period for the employee to be categorized as a knowledge worker ("kw").
Enter a positive number. Default is set to 5 collaboration hours.}
\item{collab_threshold}{The collaboration hours threshold that should be
exceeded as an average for the entire analysis period for the employee to
be categorized as a knowledge worker ("kw"). Enter a positive number.
Default is set to 5 collaboration hours.}
\item{return}{String to specify what to return}
\item{return}{String specifying what to return. This must be one of the
following strings:
\itemize{
\item \code{"text"}
\item \code{"data_with_flag"}
\item \code{"data_clean"}
\item \code{"data_summary"}
}
See \code{Value} for more information.}
}
\value{
Returns an error message by default, where 'text' is passed in \code{return}.
When 'data_with_flag' is passed, a copy of your original dataframe with an additional column containing the kw/nkw flag will be returned.
When 'data_clean' is passed, a full dataframe excluding "nkw" employees will be returned.
when 'data_summmary' is passed, a summary table by organization listing the number and \% of non-knowledge workers will be returned.
A different output is returned depending on the value passed to the \code{return}
argument:
\itemize{
\item \code{"text"}: string. Returns a diagnostic message.
\item \code{"data_with_flag"}: data frame. Original input data with an additional
column containing the \code{kw}/\code{nkw} flag.
\item \code{"data_clean"}: data frame. Data frame with non-knowledge workers
excluded.
\item \code{"data_summary"}: data frame. A summary table by organization listing
the number and \% of non-knowledge workers.
}
}
\description{
This function scans a standard query output to identify employees with consistently low collaboration signals.
Returns the \% of non-knowledge workers identified by Organization, and optionally an edited dataframe with non-knowledge workers removed, or the full dataframe with the kw/nkw flag added.
This function scans a standard query output to identify employees with
consistently low collaboration signals. Returns the \% of non-knowledge
workers identified by Organization, and optionally an edited dataframe with
non-knowledge workers removed, or the full dataframe with the kw/nkw flag
added.
}
\seealso{
Other Data Validation:
@ -35,11 +57,14 @@ Other Data Validation:
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},

Просмотреть файл

@ -42,11 +42,14 @@ Other Data Validation:
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},
@ -54,4 +57,3 @@ Other Data Validation:
\code{\link{track_HR_change}()}
}
\concept{Data Validation}
\concept{General}

Просмотреть файл

@ -17,19 +17,42 @@ identify_privacythreshold(
\item{hrvar}{A list of HR Variables to consider in the scan.
Defaults to all HR attributes identified.}
\item{mingroup}{Numeric value setting the privacy threshold / minimum group size.
Defaults to 5.}
\item{mingroup}{Numeric value setting the privacy threshold / minimum group
size. Defaults to 5.}
\item{return}{A character vector specifying what to return.
Valid values include "table" (default) and "text" (text)}
\item{return}{String specifying what to return. This must be one of the
following strings:
\itemize{
\item \code{"table"}
\item \code{"text"}
}
See \code{Value} for more information.}
}
\value{
A different output is returned depending on the value passed to the \code{return}
argument:
\itemize{
\item \code{"table"}: data frame. A summary table of groups that fall below the
privacy threshold.
\item \code{"text"}: string. A diagnostic message.
}
Returns a ggplot object by default, where 'plot' is passed in \code{return}.
When 'table' is passed, a summary table is returned as a data frame.
}
\description{
This function scans a standard query output for groups with of employees under the privacy threshold.
The method consists in reviewing each individual HR attribute, and count the distinct people within each group.
This function scans a standard query output for groups with of employees
under the privacy threshold. The method consists in reviewing each individual
HR attribute, and count the distinct people within each group.
}
\examples{
# Return a summary table
dv_data \%>\% identify_privacythreshold(return = "table")
# Return a diagnostic message
dv_data \%>\% identify_privacythreshold(return = "text")
}
\seealso{
Other Data Validation:
@ -42,11 +65,14 @@ Other Data Validation:
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},

Просмотреть файл

@ -11,8 +11,11 @@ identify_query(data, threshold = 2)
If the data is not identified as a Workplace Analytics dataset, the function
will return an error.}
\item{threshold}{Debugging use only. Increase to raise the 'strictness' of the
guessing algorithm. Defaults to 2.}
\item{threshold}{Debugging use only. Increase to raise the 'strictness' of
the guessing algorithm. Defaults to 2.}
}
\value{
String. A diagnostic message is returned.
}
\description{
Pass a Workplace Analytics dataset and return the identified
@ -39,11 +42,14 @@ Other Data Validation:
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},

Просмотреть файл

@ -26,10 +26,7 @@ argument:
\itemize{
\item \code{"plot"}: ggplot object. A bar plot for the weekly count of shifts.
\item \code{"table"}: data frame. A summary table for the count of shifts.
\item \verb{"data}: data frame. Input data appended with the following columns:
\itemize{
\item \code{Shifts}
}
\item \verb{"data}: data frame. Input data appended with the \code{Shifts} columns.
}
}
\description{
@ -45,3 +42,40 @@ dv_data \%>\% identify_shifts()
dv_data \%>\% identify_shifts(return = "table")
}
\seealso{
Other Data Validation:
\code{\link{check_query}()},
\code{\link{extract_hr}()},
\code{\link{flag_ch_ratio}()},
\code{\link{flag_em_ratio}()},
\code{\link{flag_extreme}()},
\code{\link{flag_outlooktime}()},
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},
\code{\link{subject_validate}()},
\code{\link{track_HR_change}()}
Other Working Patterns:
\code{\link{flex_index}()},
\code{\link{identify_shifts_wp}()},
\code{\link{plot_flex_index}()},
\code{\link{workpatterns_area}()},
\code{\link{workpatterns_classify_bw}()},
\code{\link{workpatterns_classify_pav}()},
\code{\link{workpatterns_classify}()},
\code{\link{workpatterns_hclust}()}
}
\concept{Data Validation}
\concept{Working Patterns}

Просмотреть файл

@ -76,8 +76,33 @@ em_data \%>\% identify_shifts_wp(return = "table")
}
\seealso{
Other Data Validation:
\code{\link{check_query}()},
\code{\link{extract_hr}()},
\code{\link{flag_ch_ratio}()},
\code{\link{flag_em_ratio}()},
\code{\link{flag_extreme}()},
\code{\link{flag_outlooktime}()},
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts}()},
\code{\link{identify_tenure}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},
\code{\link{subject_validate}()},
\code{\link{track_HR_change}()}
Other Working Patterns:
\code{\link{flex_index}()},
\code{\link{identify_shifts}()},
\code{\link{plot_flex_index}()},
\code{\link{workpatterns_area}()},
\code{\link{workpatterns_classify_bw}()},
@ -85,4 +110,5 @@ Other Working Patterns:
\code{\link{workpatterns_classify}()},
\code{\link{workpatterns_hclust}()}
}
\concept{Data Validation}
\concept{Working Patterns}

Просмотреть файл

@ -2,7 +2,8 @@
% Please edit documentation in R/identify_tenure.R
\name{identify_tenure}
\alias{identify_tenure}
\title{Tenure calculation based on different input dates, returns data summary table or histogram}
\title{Tenure calculation based on different input dates, returns data
summary table or histogram}
\usage{
identify_tenure(
data,
@ -15,9 +16,11 @@ identify_tenure(
\arguments{
\item{data}{A Standard Person Query dataset in the form of a data frame.}
\item{end_date}{A string specifying the name of the date variable representing the latest date. Defaults to "Date".}
\item{end_date}{A string specifying the name of the date variable
representing the latest date. Defaults to "Date".}
\item{beg_date}{A string specifying the name of the date variable representing the hire date. Defaults to "HireDate".}
\item{beg_date}{A string specifying the name of the date variable
representing the hire date. Defaults to "HireDate".}
\item{maxten}{A numeric value representing the maximum tenure.
If the tenure exceeds this threshold, it would be accounted for in the flag message.}
@ -53,12 +56,15 @@ Other Data Validation:
\code{\link{hr_trend}()},
\code{\link{hrvar_count_all}()},
\code{\link{hrvar_count}()},
\code{\link{identify_churn}()},
\code{\link{identify_holidayweeks}()},
\code{\link{identify_inactiveweeks}()},
\code{\link{identify_nkw}()},
\code{\link{identify_outlier}()},
\code{\link{identify_privacythreshold}()},
\code{\link{identify_query}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
\code{\link{remove_outliers}()},
\code{\link{subject_validate_report}()},
\code{\link{subject_validate}()},

Просмотреть файл

@ -18,7 +18,7 @@ file will be saved in the same directory with a different file extension.}
\description{
Uses \code{import_wpa()} to read a Workplace Analytics query in CSV
and convert this into the serialized FST format which is much faster to
read. The 'fst' package must be installed.
read. The 'fst' package must be installed, or an error message is returned.
}
\details{
The \href{https://www.fstpackage.org/}{fst} package provides a way to serialize
@ -35,3 +35,11 @@ at the start of your analysis script.
Internally, \code{import_to_fst()} uses \code{import_wpa()}, and additional arguments
to \code{import_wpa()} can be passed with \code{...}.
}
\seealso{
Other Import and Export:
\code{\link{copy_df}()},
\code{\link{create_dt}()},
\code{\link{export}()},
\code{\link{import_wpa}()}
}
\concept{Import and Export}

Просмотреть файл

@ -25,11 +25,19 @@ information. Defaults to \code{'UTF-8'}.}
A \code{tibble} is returned.
}
\description{
Import a Workplace Analytics Query from a local CSV File, with variable classifications optimised
for other 'wpa' functions.
Import a Workplace Analytics Query from a local CSV File, with variable
classifications optimised for other 'wpa' functions.
}
\details{
\code{import_wpa()} uses \code{data.table::fread()} to import CSV files for speed,
and by default \code{stringsAsFactors} is set to FALSE.
A data frame is returned by the function (not a \code{data.table}).
}
\seealso{
Other Import and Export:
\code{\link{copy_df}()},
\code{\link{create_dt}()},
\code{\link{export}()},
\code{\link{import_to_fst}()}
}
\concept{Import and Export}

Просмотреть файл

@ -28,13 +28,69 @@ following strings: - \code{"plot"} - \code{"table"}}
of the bubbles}
}
\description{
Plot the internal network metrics for a HR variable as a scatter plot, showing
Internal Network Breadth as the vertical axis and Internal Network Size as the
horizontal axis.
Plot the internal network metrics for a HR variable as a scatter plot,
showing Internal Network Breadth as the vertical axis and Internal Network
Size as the horizontal axis.
}
\details{
Uses the metrics \code{Internal_network_size} and
\code{Networking_outside_organization}.
}
\examples{
# Return plot
sq_data \%>\% internal_network_plot(return = "plot")
# Return summary table
sq_data \%>\% internal_network_plot(return = "table")
}
\concept{Connectivity}
\seealso{
Other Visualization:
\code{\link{afterhours_dist}()},
\code{\link{afterhours_fizz}()},
\code{\link{afterhours_line}()},
\code{\link{afterhours_rank}()},
\code{\link{afterhours_summary}()},
\code{\link{afterhours_trend}()},
\code{\link{collaboration_area}()},
\code{\link{collaboration_dist}()},
\code{\link{collaboration_fizz}()},
\code{\link{collaboration_line}()},
\code{\link{collaboration_rank}()},
\code{\link{collaboration_sum}()},
\code{\link{collaboration_trend}()},
\code{\link{create_bar_asis}()},
\code{\link{create_bar}()},
\code{\link{create_boxplot}()},
\code{\link{create_bubble}()},
\code{\link{create_dist}()},
\code{\link{create_fizz}()},
\code{\link{create_line_asis}()},
\code{\link{create_line}()},
\code{\link{create_period_scatter}()},
\code{\link{create_rank}()},
\code{\link{create_sankey}()},
\code{\link{create_scatter}()},
\code{\link{create_stacked}()},
\code{\link{create_trend}()},
\code{\link{email_dist}()},
\code{\link{email_fizz}()},
\code{\link{email_line}()},
\code{\link{email_rank}()},
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_network_plot}()},
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()}
Other Network:
\code{\link{external_network_plot}()},
\code{\link{g2g_data}},
\code{\link{network_g2g}()},
\code{\link{network_leiden}()},
\code{\link{network_louvain}()},
\code{\link{network_p2p}()},
\code{\link{p2p_data_sim}()}
}
\concept{Network}
\concept{Visualization}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше