Skip to content

Commit

Permalink
Updated parameter from .data to x following changes to {NHSRpostcodet…
Browse files Browse the repository at this point in the history
…ools}
  • Loading branch information
Lextuga007 committed Jan 26, 2024
1 parent 2d46396 commit c70a4f1
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
21 changes: 21 additions & 0 deletions NHSRpopulation.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
2 changes: 1 addition & 1 deletion R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' information
#' @export
check_postcodes <- function(data) {
NHSRpostcodetools::postcode_data_join(.data = data)
NHSRpostcodetools::postcode_data_join(x = data)
}

#' Connect to services1.arcgis API for data
Expand Down
12 changes: 6 additions & 6 deletions R/imd.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Function that validates postcodes and links to IMD datasets, returning the
#' score and generated deciles and quintiles.
#'
#' @param .data A data frame with a column of postcodes, or a vector
#' @param x A data frame with a column of postcodes, or a vector
#' of postcodes.
#' @param var String or symbol. The name of the variable in the data frame that
#' comprises the postcodes to be submitted.
Expand All @@ -11,10 +11,10 @@
#' or contain typos).
#' @export
get_imd <- function(
.data,
x,
var = "postcode",
fix_invalid = TRUE) {
check_postcodes <- check_postcodes(.data)
check_postcodes <- check_postcodes(x)

set_params <- set_params(
data = check_postcodes,
Expand Down Expand Up @@ -60,13 +60,13 @@ get_imd <- function(

#' Function that gets IMD deciles and quintiles for LSOA codes.
#'
#' @param .data A data frame with a column of lsoas, or a vector
#' @param x A data frame with a column of lsoas, or a vector
#' of lsoas.
#' @param return data frame of all postcodes in the LSOA area as default,
#' one random from a decile or the first from a decile for example postcodes.
#'
#' @export
get_lsoa <- function(.data,
get_lsoa <- function(x,
return = c(
"all",
"random",
Expand All @@ -75,7 +75,7 @@ get_lsoa <- function(.data,
return <- match.arg(return)

set_params <- set_params(
data = .data,
data = x,
type = "lsoa"
)

Expand Down
4 changes: 2 additions & 2 deletions man/get_imd.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/get_lsoa.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c70a4f1

Please sign in to comment.