Skip to contents

Returns a line chart showing the change in employee count over time. Part of a data validation process to check for unusual license growth / declines over time.

Usage

hr_trend(data, return = "plot")

Arguments

data

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

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 line plot showing employee count over time.

  • "table": data frame containing a summary table.

Examples

# Return plot
hr_trend(pq_data)


# Return summary table
hr_trend(pq_data, return = "table")
#> # A tibble: 10 × 2
#>    Date           n
#>    <date>     <int>
#>  1 2022-05-01   100
#>  2 2022-05-08   100
#>  3 2022-05-15   100
#>  4 2022-05-22   100
#>  5 2022-05-29   100
#>  6 2022-06-05   100
#>  7 2022-06-12   100
#>  8 2022-06-19   100
#>  9 2022-06-26   100
#> 10 2022-07-03   100