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

Latest development merge #99

Merged
merged 23 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
828ed61
Added local skills improvement plan area to geography matrix
rmbielby Nov 1, 2023
05bed89
Added LSIPS codes and names file
rmbielby Nov 1, 2023
e2bfd36
Added unique LSIP combos
rmbielby Nov 1, 2023
5d7459a
Added lsip_combinations function
rmbielby Nov 1, 2023
c9c519f
Added LSIPs to combinations and overcompleted cols tests
rmbielby Nov 1, 2023
eb2a4e0
Added testhat test for lsip_combinations
rmbielby Nov 1, 2023
e0f8113
tidy code
rmbielby Nov 1, 2023
4ef4381
renv package update
rmbielby Nov 1, 2023
16d900b
Add console messages to UI tests - previously incomplete
cjrace Nov 2, 2023
87a245d
Cleaned up commenting in overcomplete cols functions and removed extr…
rmbielby Nov 3, 2023
ba7d342
Merge branch 'add_lsip' of https://github.com/dfe-analytical-services…
rmbielby Nov 3, 2023
51a114d
Trimmed code for combining overcomple cols results
rmbielby Nov 3, 2023
bd77f43
Fixing some geography_matrix indices that I missed
rmbielby Nov 3, 2023
e016f4c
Added geographic data sources section with listing for LSIPs
rmbielby Nov 3, 2023
722a838
Reduced lsip test file size and added info to readme
rmbielby Nov 3, 2023
3f30ffa
Removed readme.html
rmbielby Nov 7, 2023
49a990e
Added README.html to .gitignore
rmbielby Nov 7, 2023
c686977
Merge pull request #98 from dfe-analytical-services/add_lsip
rmbielby Nov 7, 2023
827d725
Updated renv a little
rmbielby Nov 14, 2023
0b49c5b
Merge branch 'development' of https://github.com/dfe-analytical-servi…
rmbielby Nov 14, 2023
e102e14
renv update
rmbielby Nov 14, 2023
641ad8f
Rolling back png to 0.1-7 for Posit Connect server
rmbielby Nov 14, 2023
78ade9d
Cleaning out packages a little
rmbielby Nov 14, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.Rhistory
.RData
.Ruserdata
README.html
16 changes: 15 additions & 1 deletion R/knownVariables.r
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ gssRndcode <- "low"
gss_symbols <- c(gssNApcode, gssNAvcode, gssSupcode, gssRndcode)
legacy_gss_symbols <- c("~", ":")


geography_matrix <- matrix(
c(
"National", "country_code", "country_name", NA,
Expand All @@ -47,6 +46,7 @@ geography_matrix <- matrix(
"Local authority district", "lad_code", "lad_name", NA,
"RSC region", "rsc_region_lead_name", NA, NA,
"Parliamentary constituency", "pcon_code", "pcon_name", NA,
"Local skills improvement plan area", "lsip_code", "lsip_name", NA,
"Local enterprise partnership", "local_enterprise_partnership_code", "local_enterprise_partnership_name", NA,
"English devolved area", "english_devolved_area_code", "english_devolved_area_name", NA,
"Opportunity area", "opportunity_area_code", "opportunity_area_name", NA,
Expand All @@ -62,8 +62,20 @@ geography_matrix <- matrix(
byrow = TRUE
)

geography_dataframe <- geography_matrix %>%
as.data.frame() %>%
select(geographic_level = V1, code_field = V2, name_field = V3, code_field_secondary = V4)

# Pull out lower level geographies that we don't have standardised lists for (and excluding school-provider etc levels)
lower_level_geog_levels <- c("Opportunity area", "Ward", "MAT", "Sponsor")
lower_level_geog_names <- geography_dataframe %>%
filter(geographic_level %in% lower_level_geog_levels) %>%
pivot_longer(c(code_field, name_field)) %>%
pull(value)

countries <- suppressMessages(read_csv("data/country.csv")) # change this to database eventually
regions <- suppressMessages(read_csv("data/regions.csv")) # change this to database eventually
lsips <- suppressMessages(read_csv("data/lsips.csv")) # change this to database eventually
las <- suppressMessages(read_csv("data/las.csv")) # change this to database eventually
lads <- suppressMessages(read_csv("data/lads.csv")) # change this to database eventually
pcons <- suppressMessages(read_csv("data/pcons.csv")) # change this to database eventually
Expand All @@ -74,6 +86,8 @@ expected_country_combinations <- unique(paste(countries$country_code, countries$

expected_region_combinations <- unique(paste(regions$region_code, regions$region_name))

expected_lsip_combinations <- unique(paste(lsips$lsip_code, lsips$lsip_name))

expected_la_combinations <- unique(paste(las$old_la_code, las$new_la_code, las$la_name))

expected_lad_combinations <- unique(paste(lads$lad_code, lads$lad_name))
Expand Down
227 changes: 136 additions & 91 deletions R/mainTests.r

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<a href="#introduction">Introduction</a> |
<a href="#requirements">Requirements</a> |
<a href="#how-to-use">How to use</a> |
<a href="#data-sources">Data sources</a> |
<a href="#contact">Contact</a>
</p>

Expand Down Expand Up @@ -104,6 +105,18 @@ The function `tidy_code()` is created in the Rprofile script and therefore is al

---

## Data sources

### Geographies

The standard geographies used in this tool are sourced from (or developed with) the Office for National Statistics (ONS). As such, they are maintained in line with the ONS's [open geography portal](https://geoportal.statistics.gov.uk/). Some further details on specific geographic levels are provided below.

#### Local skills improvement plan area (LSIP)

These were developed in direct communications with the ONS ([ONS Geography e-mail](mailto:[email protected])) and they provided the basis for the code and name file used in this tool. At the time of writing, this has not been added to the open geography portal, although boundary files have been ([LSIP boundary map files](https://geoportal.statistics.gov.uk/search?collection=Dataset&sort=name&tags=all(BDY_LSIP%2CAUG_2023))).

---

## Contact


Expand Down
39 changes: 39 additions & 0 deletions data/lsips.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
lsip_code,lsip_name
E69000001,"Brighton and Hove, East Sussex, West Sussex"
E69000002,Buckinghamshire
E69000003,Cambridgeshire and Peterborough
E69000004,Cheshire and Warrington
E69000005,Cornwall and the Isles of Scilly
E69000006,Cumbria
E69000007,Derbyshire and Nottinghamshire
E69000008,Dorset
E69000009,Enterprise M3
E69000010,"Essex, Southend-on-Sea and Thurrock "
E69000011,G First (Gloucestershire)
E69000012,Greater Lincolnshire
E69000013,Greater London
E69000014,Greater Manchester
E69000015,Heart of the South-West
E69000016,Hertfordshire
E69000017,Hull and East Yorkshire
E69000018,Kent and Medway
E69000019,Lancashire
E69000020,Leicester and Leicestershire
E69000021,Liverpool City Region
E69000022,New Anglia
E69000023,North East
E69000024,North of Tyne
E69000025,Oxfordshire
E69000026,Solent
E69000027,South-East Midlands
E69000028,South Yorkshire
E69000029,Stoke-on-Trent and Staffordshire
E69000030,Swindon and Wiltshire
E69000031,Tees Valley
E69000032,Thames Valley Berkshire
E69000033,The Marches
E69000034,West Midlands and Warwickshire
E69000035,Worcestershire
E69000036,West of England and North Somerset
E69000037,West Yorkshire
E69000038,York and North Yorkshire
4 changes: 2 additions & 2 deletions global.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ shhh(library(shinyjs))
shhh(library(tools))
shhh(library(readr))
shhh(library(testthat))
shhh(library(shinytest))
# shhh(library(shinytest))
shhh(library(styler))
shhh(library(tidyr))
shhh(library(ggplot2))
Expand All @@ -29,7 +29,7 @@ shhh(library(shinyWidgets))
shhh(library(shinycssloaders))
shhh(library(sparkline))
shhh(library(config))
shhh(library(rsconnect))
# shhh(library(rsconnect))
shhh(library(shinyalert))
shhh(library(shinydisconnect))

Expand Down
Loading
Loading