docs: improve examples runtime

This commit is contained in:
Martin Chan 2021-07-05 16:14:30 +01:00
Родитель 36ebedef35
Коммит 801e2ba377
3 изменённых файлов: 21 добавлений и 10 удалений

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

@ -43,9 +43,12 @@
#' @family Flexible
#'
#' @examples
# Use a small sample for faster runtime
#' sq_data_small <- dplyr::slice_sample(sq_data, prop = 0.1)
#'
#' # Plot mode 1 - show top and bottom five groups
#' create_rank(
#' data = sq_data,
#' data = sq_data_small,
#' hrvar = c("FunctionType", "LevelDesignation"),
#' metric = "Emails_sent",
#' return = "plot",
@ -54,7 +57,7 @@
#'
#' # Plot mode 2 - show top and bottom groups per HR variable
#' create_rank(
#' data = sq_data,
#' data = sq_data_small,
#' hrvar = c("FunctionType", "LevelDesignation"),
#' metric = "Emails_sent",
#' return = "plot",
@ -63,14 +66,14 @@
#'
#' # Return a table
#' create_rank(
#' data = sq_data,
#' data = sq_data_small,
#' metric = "Emails_sent",
#' return = "table"
#' )
#'
#' # Return a table - combination mode
#' create_rank(
#' data = sq_data,
#' data = sq_data_small,
#' metric = "Emails_sent",
#' mode = "combine",
#' return = "table"
@ -277,8 +280,11 @@ create_rank <- function(data,
#' @inheritParams create_rank
#'
#' @examples
#' # Use a small sample for faster runtime
#' sq_data_small <- dplyr::slice_sample(sq_data, prop = 0.1)
#'
#' create_rank_combine(
#' data = sq_data,
#' data = sq_data_small,
#' metric = "Email_hours"
#' )
#'

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

@ -66,9 +66,11 @@ levels of a given Workplace Analytics Metric. Returns a table with all groups
(across multiple HR attributes) ranked by the specified metric.
}
\examples{
sq_data_small <- dplyr::slice_sample(sq_data, prop = 0.1)
# Plot mode 1 - show top and bottom five groups
create_rank(
data = sq_data,
data = sq_data_small,
hrvar = c("FunctionType", "LevelDesignation"),
metric = "Emails_sent",
return = "plot",
@ -77,7 +79,7 @@ create_rank(
# Plot mode 2 - show top and bottom groups per HR variable
create_rank(
data = sq_data,
data = sq_data_small,
hrvar = c("FunctionType", "LevelDesignation"),
metric = "Emails_sent",
return = "plot",
@ -86,14 +88,14 @@ create_rank(
# Return a table
create_rank(
data = sq_data,
data = sq_data_small,
metric = "Emails_sent",
return = "table"
)
# Return a table - combination mode
create_rank(
data = sq_data,
data = sq_data_small,
metric = "Emails_sent",
mode = "combine",
return = "table"

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

@ -38,8 +38,11 @@ This function is called when the \code{mode} argument in \code{create_rank()} is
specified as \code{"combine"}.
}
\examples{
# Use a small sample for faster runtime
sq_data_small <- dplyr::slice_sample(sq_data, prop = 0.1)
create_rank_combine(
data = sq_data,
data = sq_data_small,
metric = "Email_hours"
)