Skip to content
Closed
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
7 changes: 5 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: phslookups
Title: PHS Lookups
Version: 0.1.0
Version: 0.1.0.9000
Authors@R: c(
person("James", "Hayes", , "james.hayes2@phs.scot", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-5380-2029")),
Expand All @@ -20,10 +20,13 @@ Imports:
cli,
dplyr,
fs,
janitor,
phsmethods,
readr,
rlang,
stringr,
tibble
tibble,
tidyr
Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
Expand Down
5 changes: 5 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Generated by roxygen2: do not edit by hand

export(get_ca_pop_est)
export(get_dz_pop_est)
export(get_hb_pop_est)
export(get_hscp_locality)
export(get_hscp_pop_est)
export(get_iz_pop_est)
export(get_simd_datazone)
export(get_simd_postcode)
export(get_spd)
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# phslookups (development version)

- Add [`get_pop_est()`](https://public-health-scotland.github.io/phslookups/reference/get_pop_est.html)
for retrieving the population lookups. This function has arguments that should
make it simple to reshape the files as needed.

# phslookups 0.1.0

- Initial version which includes: [`get_hscp_locality()`](https://public-health-scotland.github.io/phslookups/reference/get_hscp_locality.html), [`get_simd_datazone()`](https://public-health-scotland.github.io/phslookups/reference/get_simd_datazone.html), [`get_simd_postcode()`](https://public-health-scotland.github.io/phslookups/reference/get_simd_postcode.html), and [`get_spd()`](https://public-health-scotland.github.io/phslookups/reference/get_spd.html)
7 changes: 5 additions & 2 deletions R/find_latest_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#' @param selection_method Valid arguments are "modification_date"
#' (the default) or "file_name".
#' @param quiet (default: FALSE) Used to suppress message output
#' @param ... Additional arguments passed to [fs::dir_info()].
#'
#' @return the [fs::path()] to the file
#' @examples
Expand All @@ -28,14 +29,16 @@ find_latest_file <- function(
directory,
regexp,
selection_method = "modification_date",
quiet = FALSE
quiet = FALSE,
...
) {
if (selection_method == "modification_date") {
latest_file_options <- fs::dir_info(
path = directory,
type = "file",
regexp = regexp,
recurse = TRUE
recurse = TRUE,
...
) |>
dplyr::arrange(
dplyr::desc(.data$birth_time),
Expand Down
Loading