From d4b1408436d9a205dbd1f5ae3c42988ab29b2c63 Mon Sep 17 00:00:00 2001 From: Lextuga007 Date: Wed, 20 Mar 2024 11:51:47 +0000 Subject: [PATCH] Removed last chunk as repeat --- vignettes/NHSRpopulation.Rmd | 40 ++++--------------------------- vignettes/NHSRpopulation.Rmd.orig | 17 ++++--------- 2 files changed, 10 insertions(+), 47 deletions(-) diff --git a/vignettes/NHSRpopulation.Rmd b/vignettes/NHSRpopulation.Rmd index 1d0c530..7a1e6f6 100644 --- a/vignettes/NHSRpopulation.Rmd +++ b/vignettes/NHSRpopulation.Rmd @@ -12,7 +12,7 @@ vignette: > ### Indices of Multiple Deprivation (IMD) -To get the IMD scores (raw scores and ranked deciles) for a dataset run the +To get the IMD scores (raw scores and ranked deciles) for a dataset run the following code to generate some random example postcodes: @@ -91,8 +91,8 @@ NHSRpopulation::get_data(tibble_postcodes) |> #> 3 HD1 2UV HD1 2UD autocompleted E01011229 ``` -Note that this function uses the {NHSRpostcodetools} package to offer the -opportunity to fix postcodes which are terminated or are incorrect. +Note that this function uses the {NHSRpostcodetools} package to offer the +opportunity to fix postcodes which are terminated or are incorrect. This is default and appears in the column `new_postcode` and does not overwrite the original `postcode` column. Switching off this automatic fix can be done with the code and will accept both @@ -170,7 +170,7 @@ is on `lsoa11` data. # Column names Where data frames are used the expectation of the functions is that postcodes -will be in a column called `postcode` and IMD will be from `lsoa11`, however, +will be in a column called `postcode` and IMD will be from `lsoa11`, however, this can be overwritten: @@ -180,7 +180,7 @@ pcs_tb <- dplyr::tibble( pcs = postcodes ) -pcs_tb +pcs_tb #> # A tibble: 3 × 1 #> pcs #> @@ -252,33 +252,3 @@ NHSRpopulation::get_data(lsoa_tb, #> # dep_chi , pop16_59 , pop60 , work_pop , shape_area , shape_length ``` - -```r -NHSRpopulation::get_data(pcs_tb, - # url_type is set to postcodes as default - column = "pcs" -) -#> ℹ The following postcodes are terminated: -#> HD1 2UT -#> and have been replaced with these current postcodes: -#> HD1 2RD -#> ℹ The following postcodes are invalid: -#> HD1 2UV -#> and have been replaced with these nearby postcodes: -#> HD1 2UD -#> Joining with `by = join_by(pcs)` -#> # A tibble: 3 × 40 -#> pcs new_postcode result_type quality eastings northings country nhs_ha longitude latitude european_electoral_r…¹ -#> -#> 1 HD1 2UT HD1 2RD terminated 1 414639 416430 England Yorkshire and the … -1.78 53.6 Yorkshire and The Hum… -#> 2 HD1 2UU HD1 2UU valid 1 414433 416422 England Yorkshire and the … -1.78 53.6 Yorkshire and The Hum… -#> 3 HD1 2UV HD1 2UD autocompleted 1 414371 416317 England Yorkshire and the … -1.78 53.6 Yorkshire and The Hum… -#> # ℹ abbreviated name: ¹​european_electoral_region -#> # ℹ 29 more variables: primary_care_trust , region , lsoa , msoa , incode , outcode , -#> # parliamentary_constituency , parliamentary_constituency_2024 , admin_district , parish , -#> # date_of_introduction , admin_ward , ccg , nuts , pfa , admin_district_code , -#> # admin_county_code , admin_ward_code , parish_code , parliamentary_constituency_code , -#> # parliamentary_constituency_2024_code , ccg_code , ccg_id_code , ced_code , nuts_code , lsoa_code , -#> # msoa_code , lau2_code , pfa_code -``` - diff --git a/vignettes/NHSRpopulation.Rmd.orig b/vignettes/NHSRpopulation.Rmd.orig index ae1eb22..f0d9c36 100644 --- a/vignettes/NHSRpopulation.Rmd.orig +++ b/vignettes/NHSRpopulation.Rmd.orig @@ -21,7 +21,7 @@ knitr::opts_chunk$set( ### Indices of Multiple Deprivation (IMD) -To get the IMD scores (raw scores and ranked deciles) for a dataset run the +To get the IMD scores (raw scores and ranked deciles) for a dataset run the following code to generate some random example postcodes: ```{r, eval=TRUE} @@ -62,8 +62,8 @@ NHSRpopulation::get_data(tibble_postcodes) |> ) ``` -Note that this function uses the {NHSRpostcodetools} package to offer the -opportunity to fix postcodes which are terminated or are incorrect. +Note that this function uses the {NHSRpostcodetools} package to offer the +opportunity to fix postcodes which are terminated or are incorrect. This is default and appears in the column `new_postcode` and does not overwrite the original `postcode` column. Switching off this automatic fix can be done with the code and will accept both @@ -113,7 +113,7 @@ is on `lsoa11` data. # Column names Where data frames are used the expectation of the functions is that postcodes -will be in a column called `postcode` and IMD will be from `lsoa11`, however, +will be in a column called `postcode` and IMD will be from `lsoa11`, however, this can be overwritten: ```{r} @@ -122,7 +122,7 @@ pcs_tb <- dplyr::tibble( pcs = postcodes ) -pcs_tb +pcs_tb lsoa_tb <- dplyr::tibble( lower_soa = imd @@ -145,10 +145,3 @@ NHSRpopulation::get_data(lsoa_tb, ) ``` -```{r} -NHSRpopulation::get_data(pcs_tb, - # url_type is set to postcodes as default - column = "pcs" -) -``` -