Skip to content

Commit

Permalink
Updated README with contribution information
Browse files Browse the repository at this point in the history
  • Loading branch information
Lextuga007 committed Jan 26, 2024
1 parent 6e04503 commit 7924956
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 32 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ Imports:
Depends:
R (>= 2.10)
Suggests:
rmarkdown,
knitr,
testthat (>= 3.0.0),
PostcodesioR,
purrr,
tibble,
PostcodesioR
rmarkdown,
testthat (>= 3.0.0),
tibble
Remotes: nhs-r-community/NHSRpostcodetools
VignetteBuilder: knitr
Config/testthat/edition: 3
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,18 @@ from the
and licenced under the [Open Government Licence
v3.0](http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).

## Code of Conduct
## Contributing

Please note that the `NHSRpopulation` project is released with a
[Contributor Code of
Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html).
Please see our
[guidance on how to contribute](https://tools.nhsrcommunity.com/contribution.html).

This project is released with a Contributor [Code of Conduct](./CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.

The simplest way to contribute is to raise an issue detailing the feature or
functionality you would like to see added, or any unexpected behaviour or bugs
you have experienced.

## Special note of thanks

This package was originally created by [Milan
Expand Down
47 changes: 23 additions & 24 deletions vignettes/NHSRpopulation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ library(NHSRpopulation)
postcodes <- purrr::map_chr(
1:10,
.f = ~PostcodesioR::random_postcode() |>
purrr::pluck(1)
)
.f = ~ PostcodesioR::random_postcode() |>
purrr::pluck(1)
)
tibble_postcodes <- postcodes |>
tibble_postcodes <- postcodes |>
tibble::as_tibble()
```

Then, using the `get_imd()` function for a vector (returning just the first five columns):

```{r}
NHSRpopulation::get_imd(postcodes) |>
NHSRpopulation::get_imd(postcodes) |>
dplyr::select(1:5)
```

Or with a data frame (returning just the first five columns):

```{r}
NHSRpopulation::get_imd(tibble_postcodes$value) |>
NHSRpopulation::get_imd(tibble_postcodes$value) |>
dplyr::select(1:5)
```

Expand All @@ -59,9 +59,8 @@ This function can be used to fix missing postcodes as some are terminated or are
```{r}
postcodes <- c("HD1 2UT", "HD1 2UU", "HD1 2UV")
NHSRpopulation::get_imd(postcodes) |>
NHSRpopulation::get_imd(postcodes) |>
dplyr::select(1:5)
```

Currently, although the postcode is fixed with the column `new_postcode` the IMD is not overwritten.
Expand All @@ -72,31 +71,31 @@ To return the `IMD`, `imd_decile` and `imd_quintile` for LSOAs this can be as a

```{r}
# Example LSOAs from each England Decile group
lsoa_imd <- c("E01000002",
"E01000001",
"E01000117",
"E01000119",
"E01000069",
"E01000070",
"E01000066",
"E01000005",
"E01000008",
"E01000048")
NHSRpopulation::get_lsoa(lsoa_imd) |>
lsoa_imd <- c(
"E01000002",
"E01000001",
"E01000117",
"E01000119",
"E01000069",
"E01000070",
"E01000066",
"E01000005",
"E01000008",
"E01000048"
)
NHSRpopulation::get_lsoa(lsoa_imd) |>
head(10) # first 10 rows
```

Or from a data frame:

```{r}
tibble_lsoa_imd <- lsoa_imd |>
tibble_lsoa_imd <- lsoa_imd |>
tibble::as_tibble()
NHSRpopulation::get_lsoa(tibble_lsoa_imd$value) |>
NHSRpopulation::get_lsoa(tibble_lsoa_imd$value) |>
head(10)
```

The functions return everything in those LSOAs and if you would like to return some random postcodes from each decile:
Expand Down

0 comments on commit 7924956

Please sign in to comment.