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

Updated README with contribution information #36

Merged
merged 1 commit into from
Jan 26, 2024
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
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
Loading