Merge pull request #13 from microsoft/patch/1.3.0.-3
Patch: v1.3.0-3 minor changes
|
@ -1,3 +1,42 @@
|
|||
# Distribution
|
||||
|
||||
_Coming soon..._
|
||||
**Distribution** functions allow you to go beyond aggregated averages, and diagnose whether metrics are skewed, evenly distributed, or contain outliers.
|
||||
|
||||
You can use the `fizz` and `dist` family of functions for this. For email hours, you can run the following:
|
||||
|
||||
```R
|
||||
sq_data %>% email_dist() # 100% horizontal stacked bar
|
||||
```
|
||||
|
||||
<img src="https://raw.githubusercontent.com/microsoft/wpa/main/.github/gallery/email_dist.png" align ="center" width=80%>
|
||||
|
||||
You can also return a jittered scatter plot ('fizzy drink plot').
|
||||
|
||||
```R
|
||||
sq_data %>% email_fizz() # Fizzy drink plot
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
Other examples of distribution functions include:
|
||||
|
||||
### Dist
|
||||
|
||||
- `collaboration_dist()`
|
||||
- `meeting_dist()`
|
||||
- `one2one_dist()`
|
||||
- `afterhours_dist()`
|
||||
- `workloads_dist()`
|
||||
|
||||
### Fizz
|
||||
|
||||
- `collaboration_fizz()`
|
||||
- `meeting_fizz()`
|
||||
- `one2one_fizz()`
|
||||
- `afterhours_fizz()`
|
||||
- `workloads_fizz()`
|
||||
|
||||
### Flexible functions
|
||||
- `create_dist()`
|
||||
- `create_fizz()`
|
||||
- `create_boxplot()`
|
|
@ -8,12 +8,30 @@ An instance of a summary function in action would be:
|
|||
sq_data %>% collaboration_summary()
|
||||
```
|
||||
|
||||
<img src="https://raw.githubusercontent.com/microsoft/wpa/main/.github/gallery/collab_sum.png" align ="center" width=80%>
|
||||
|
||||
This returns a plot that you can either as a SVG (vector) or PNG (scalar) image by passing the output to `export()`. Since the plot output is a ggplot object, you can also make further customizations to it by appending ggplot layers, for instance:
|
||||
|
||||
```R
|
||||
sq_data %>%
|
||||
collaboration_summary() +
|
||||
ggtitle("This is a custom title")
|
||||
```
|
||||
|
||||
You can use return a summary table rather than a plot:
|
||||
|
||||
```R
|
||||
sq_data %>% collaboration_summary(return = "table")
|
||||
```
|
||||
|
||||
To export the results to a clipboard, you can pass the outputs to `export()` again:
|
||||
|
||||
```R
|
||||
sq_data %>%
|
||||
collaboration_summary(return = "table") %>%
|
||||
export()
|
||||
```
|
||||
|
||||
There is also an option to change the threshold for excluding group size:
|
||||
|
||||
```
|
||||
|
@ -23,8 +41,6 @@ sq_data %>%
|
|||
return = "table")
|
||||
```
|
||||
|
||||
|
||||
|
||||
Other similar functions include:
|
||||
|
||||
- `email_summary()`
|
||||
|
@ -32,3 +48,6 @@ Other similar functions include:
|
|||
- `one2one_summary()`
|
||||
- `workloads_summary()`
|
||||
- `afterhours_summary()`
|
||||
|
||||
See `create_bar()` for creating summary functions with other Workplace Analytics metrics.
|
||||
|
||||
|
|
|
@ -1,3 +1,36 @@
|
|||
# Trend
|
||||
|
||||
_Coming soon..._
|
||||
**Trend** functions analyze Workplace Analytics metrics over time.
|
||||
|
||||
<img src="https://raw.githubusercontent.com/microsoft/wpa/main/.github/gallery/collab_area.png" align ="center" width=80%>
|
||||
|
||||
## Functions
|
||||
|
||||
Trend functions include:
|
||||
|
||||
### Trend
|
||||
|
||||
- `collaboration_trend()`
|
||||
- `meeting_trend()`
|
||||
- `email_trend()`
|
||||
- `one2one_trend()`
|
||||
- `afterhours_trend()`
|
||||
- `workloads_trend()`
|
||||
|
||||
### Line
|
||||
|
||||
- `collaboration_line()`
|
||||
- `meeting_line()`
|
||||
- `email_line()`
|
||||
- `one2one_line()`
|
||||
- `afterhours_line()`
|
||||
- `workloads_line()`
|
||||
|
||||
### Flexible functions
|
||||
|
||||
- `create_trend()`
|
||||
- `create_line()`
|
||||
|
||||
### Other
|
||||
|
||||
- `collab_area()`
|
После Ширина: | Высота: | Размер: 159 KiB |
После Ширина: | Высота: | Размер: 78 KiB |
После Ширина: | Высота: | Размер: 180 KiB |
После Ширина: | Высота: | Размер: 100 KiB |
После Ширина: | Высота: | Размер: 92 KiB |
После Ширина: | Высота: | Размер: 82 KiB |
После Ширина: | Высота: | Размер: 109 KiB |
После Ширина: | Высота: | Размер: 157 KiB |
После Ширина: | Высота: | Размер: 676 KiB |
После Ширина: | Высота: | Размер: 208 KiB |
После Ширина: | Высота: | Размер: 272 KiB |
После Ширина: | Высота: | Размер: 89 KiB |
|
@ -1,4 +1,4 @@
|
|||
## :package: Package Structure
|
||||
# :package: Package Structure
|
||||
|
||||
There are four main types of functions in **wpa**:
|
||||
1. Standard Analysis
|
||||
|
|
|
@ -58,7 +58,7 @@ create_fizz <- function(data,
|
|||
check_inputs(requirements = required_variables)
|
||||
|
||||
## Clean metric name
|
||||
clean_nm <- gsub(pattern = "_", replacement = "", x = metric)
|
||||
clean_nm <- gsub(pattern = "_", replacement = " ", x = metric)
|
||||
|
||||
## Plot data
|
||||
plot_data <-
|
||||
|
@ -93,15 +93,7 @@ create_fizz <- function(data,
|
|||
ylim(0, max_point) +
|
||||
annotate("text", x = plot_legend$group, y = 0, label = plot_legend$Employee_Count) +
|
||||
scale_x_discrete(labels = scales::wrap_format(10)) +
|
||||
theme_classic() +
|
||||
theme(axis.text=element_text(size=12),
|
||||
axis.text.x = element_text(angle = 30, hjust = 1),
|
||||
plot.title = element_text(color="grey40", face="bold", size=18),
|
||||
plot.subtitle = element_text(size=14),
|
||||
legend.position = "top",
|
||||
legend.justification = "right",
|
||||
legend.title=element_text(size=14),
|
||||
legend.text=element_text(size=14)) +
|
||||
theme_wpa_basic() +
|
||||
labs(title = clean_nm,
|
||||
subtitle = paste("Distribution of",
|
||||
tolower(clean_nm),
|
||||
|
|
|
@ -40,7 +40,7 @@ The package comes shipped with a sample Standard Query dataset (`sq_data`), so y
|
|||
```R
|
||||
collaboration_sum(sq_data, return = "plot")
|
||||
```
|
||||
<img src="man/figures/collaboration_sum2.jpg" align="center" width=80% />
|
||||
<img src=".github/gallery/collab_sum.png" align="center" width=80% />
|
||||
|
||||
By passing 'table' to the `return` argument, the function will return a data frame with the relevant summary statistics.
|
||||
|
||||
|
|