Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4 hourly pay gap data process #6

Merged
merged 19 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
^gitleaks.toml$
^\.github$
^\.lintr$
^data_temp$
^\./R/data\.r$
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ rsconnect
# Excel files (including macros and templates) #
################################################
*.[xX][lL][sS][xXmMtT]?
# Any RDA files
*.[rR][dD][aA]
data/*
data_temp/*
15 changes: 6 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,21 @@ Imports:
htmltools,
magrittr,
nhsbsaR,
rlang,
scrollytell,
shiny,
shinyjs,
dplyr (>= 1.1.3),
dbplyr (>= 2.3.3),
forcats (>= 1.0.0),
futile.logger (>= 1.4.3),
stringr,
formatR,
tidyr
htmlwidgets
Suggests:
pkgload,
testthat (>= 3.0.0),
usethis
usethis,
tidyr,
graphics,
stats
Remotes:
nhsbsa-data-analytics/nhsbsaR,
statistiekcbs/scrollytell
nhsbsa-data-analytics/nhsbsaR
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
Expand Down
8 changes: 6 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Generated by roxygen2: do not edit by hand

export("%>%")
export(gender_profile)
export(gpg_data)
export(gpg_pyramid)
export(gpg_stack)
export(gpg_trend)
export(h1_tabstop)
export(h2_tabstop)
export(h3_tabstop)
export(h4_tabstop)
export(h5_tabstop)
export(h6_tabstop)
export(headcount_data)
export(nhs_card)
export(nhs_card_tabstop)
export(nhs_footer)
Expand All @@ -27,3 +29,5 @@ importFrom(golem,bundle_resources)
importFrom(golem,favicon)
importFrom(golem,with_golem_options)
importFrom(magrittr,"%>%")
importFrom(shiny,NS)
importFrom(shiny,tagList)
4 changes: 1 addition & 3 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@
#' @noRd
app_server <- function(input, output, session) {
# Your application server logic
mod_markdown_example_server("markdown_example_ui_1")
mod_chart_example_server("chart_example_ui_1")
mod_scrollytell_example_server("scrollytell_example_1")
mod_introduction_server("introduction_1")
}
12 changes: 2 additions & 10 deletions R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,8 @@ app_ui <- function(request) {
well = FALSE,
widths = c(3, 9),
tabPanel(
title = "Introduction",
mod_markdown_example_ui("markdown_example_ui_1")
),
tabPanel(
title = "Charts",
mod_chart_example_ui("chart_example_ui_1")
),
tabPanel(
title = "Scrolly example",
mod_scrollytell_example_ui("scrollytell_example_1")
title = "Report",
mod_introduction_ui("introduction_1")
)
)
)
Expand Down
83 changes: 68 additions & 15 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,69 @@
#' NHSBSA employee headcount
#'
#' A dataset containing NHSBSA employee headcount
#' since financial year 2017/18, split by gender, AFC band
#' and FTE (full time or part time)
#'
#' @format A data frame
#' \describe{
#' \item{FINANCIAL_YEAR}{01-Mar-year, factor}
#' \item{GENDER}{Male or Female, character}
#' \item{PAY_GRADE_NAME}{AFC band}
#' \item{FTE_GROUP}{employee full time or part time info}
#' \item{HEADCOUNT}To get number of employees}
#' ...
#' NHSBSA employee afc_staff
#'
#' A dataset containing NHSBSA employee hourly pay
#' by reporting period split by gender, FTE, AFC band, directorate.
#' \itemize{
#' \item period. 2018/19, 2019/20 etc character
#' \item gender. Male or Female, character
#' \item headcount. employee headcount used for aggregation
#' \item hourly_rate. hourly rate as shown pay slip
#' \item quartile. split hourly_rate by quartile by gender
#' \item fte. employee full time or part time information
#' \item afc_band. AFC band
#' \item directorate. NHSBSA directorate
#' }
#'
#' @docType data
#' @keywords datasets
#' @name afc_staff
#' @usage afc_staff
#' @format A data frame with gender pay gap information
#'
#'
"afc_staff"


#' NHSBSA employee paygap
#'
#' A dataset containing NHSBSA employee paygap
#' Directly pulled from ESR dashboard (NHS National Returns)
#' gender, average hourly rate, median hourly rate and pay gap%
#'
#' \itemize{
#' \item period. 2018/19, 2019/20 etc character
#' \item avg_hr_gpg. Mean gender pay gap % based on male full-pay relevant employees
#' \item median_hr_gpg. Median gender pay gap % based
#' on male full-pay relevant employees
#' }
"headcount"
#'
#' @docType data
#' @keywords datasets
#' @name paygap
#' @usage paygap
#' @format A data frame with paygap information

"paygap"


#' NHSBSA employee quartile
#'
#' A dataset containing NHSBSA employee hourly pay
#' by reporting period from 2018 (eg. snapshot 31/03/2018 for 2018/19 report etc)
#' by quartiles
#'
#'
#' \itemize{
#' \item period. 2018/19, 2019/20 etc character
#' \item quartile. split hourly pay into quartiles
#' \item female. number of female employees in each quartile
#' \item male. number of male employees in each quartile
#' \item quartile. split hourly_rate by quartile by gender
#' }
#'
#' @docType data
#' @keywords datasets
#' @name quartile
#' @usage quartile
#' @format data frame with employee gender hourly pay by quartiles

"quartile"
23 changes: 0 additions & 23 deletions R/faithful.R

This file was deleted.

Loading