Analyze weekly email hours distribution, and returns a 'fizzy' scatter plot by default. Additional options available to return a table with distribution elements.

email_fizz(data, hrvar = "Organization", mingroup = 5, return = "plot")

Arguments

data

A Standard Person Query dataset in the form of a data frame.

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).

mingroup

Numeric value setting the privacy threshold / minimum group size. Defaults to 5.

return

String specifying what to return. This must be one of the following strings:

  • "plot"

  • "table"

See Value for more information.

Value

A different output is returned depending on the value passed to the return argument:

  • "plot": 'ggplot' object. A jittered scatter plot for the metric.

  • "table": data frame. A summary table for the metric.

Examples


# Return plot
email_fizz(sq_data, hrvar = "Organization", return = "plot")


# Return summary table
email_fizz(sq_data, hrvar = "Organization", return = "table")
#> # A tibble: 15 × 8
#>    group                 mean median    sd   min   max range     n
#>    <chr>                <dbl>  <dbl> <dbl> <dbl> <dbl> <dbl> <int>
#>  1 Biz Dev               7.72   7.71  1.25  4.98  11.0  6.04    75
#>  2 Customer Service      9.49   9.02  2.44  4.95  15.4 10.5     61
#>  3 Facilities            9.20   8.82  2.38  5.49  14.2  8.75    72
#>  4 Finance-Corporate     8.13   7.53  2.18  4.84  13.4  8.55    68
#>  5 Finance-East         10.8   11.9   3.51  4.34  16.4 12.1     70
#>  6 Finance-South         9.37   8.49  3.15  4.51  15.9 11.4     81
#>  7 Finance-West         10.2    9.76  3.04  5.54  15.5  9.99    73
#>  8 Financial Planning    8.75   8.23  2.42  5.79  16.7 10.9     75
#>  9 G&A Central           9.65   9.14  2.75  5.47  15.3  9.79    57
#> 10 G&A East              8.36   8.26  1.47  5.25  11.7  6.50    65
#> 11 G&A South            11.4   11.7   3.09  4.98  17.7 12.7     76
#> 12 Human Resources      11.8   12.1   2.60  5.56  17.7 12.1     71
#> 13 IT-Corporate         11.5   11.1   3.70  4.86  21.1 16.3     68
#> 14 IT-East               9.78  10.3   2.55  5.33  15.6 10.3     62
#> 15 Inventory Management 12.5   11.9   2.91  5.83  19.7 13.8     60