diff --git a/DESCRIPTION b/DESCRIPTION index 020269b..e2c4280 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -28,4 +28,4 @@ Config/testthat/edition: 3 Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 diff --git a/NAMESPACE b/NAMESPACE index afd9c7d..a0e96f4 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,6 +1,5 @@ # Generated by roxygen2: do not edit by hand -export(find_latest_file) export(get_hscp_locality) export(get_simd_datazone) export(get_simd_postcode) diff --git a/R/find_latest_file.R b/R/find_latest_file.R index bc1fae5..adabf1a 100644 --- a/R/find_latest_file.R +++ b/R/find_latest_file.R @@ -14,8 +14,6 @@ #' (the default) or "file_name". #' #' @return the [fs::path()] to the file -#' @export -#' #' @examples #' \dontrun{ #' find_latest_file( @@ -23,6 +21,8 @@ #' regexp = "Scottish_Postcode_Directory_.+?\\.rds" #' ) #' } +#' @noRd +#' @keywords internal find_latest_file <- function(directory, regexp, selection_method = "modification_date") { diff --git a/R/read_file.R b/R/read_file.R index e1bf0ce..b604575 100644 --- a/R/read_file.R +++ b/R/read_file.R @@ -11,6 +11,8 @@ #' @param ... Addition arguments passed to the relevant function. #' #' @return the data a [tibble][tibble::tibble-package] +#' @noRd +#' @keywords internal read_file <- function(path, col_select = NULL, as_data_frame = TRUE, ...) { valid_extensions <- c( "rds", diff --git a/man/find_latest_file.Rd b/man/find_latest_file.Rd deleted file mode 100644 index cd54324..0000000 --- a/man/find_latest_file.Rd +++ /dev/null @@ -1,35 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/find_latest_file.R -\name{find_latest_file} -\alias{find_latest_file} -\title{Find the latest version of a file} -\usage{ -find_latest_file(directory, regexp, selection_method = "modification_date") -} -\arguments{ -\item{directory}{The directory in which to search.} - -\item{regexp}{a -\href{https://www.regular-expressions.info/quickstart.html}{regular expression} -passed to \code{\link[fs:dir_ls]{fs::dir_info()}} to search for the file.} - -\item{selection_method}{Valid arguments are "modification_date" -(the default) or "file_name".} -} -\value{ -the \code{\link[fs:path]{fs::path()}} to the file -} -\description{ -This will return the latest created file matching -the criteria. It uses \code{\link[fs:dir_ls]{fs::dir_info()}} to -find the files then picks the one with the latest -\code{birthtime}. -} -\examples{ -\dontrun{ -find_latest_file( - directory = "/conf/linkage/output/lookups/Unicode", - regexp = "Scottish_Postcode_Directory_.+?\\\\.rds" -) -} -} diff --git a/man/read_file.Rd b/man/read_file.Rd deleted file mode 100644 index 472aaf5..0000000 --- a/man/read_file.Rd +++ /dev/null @@ -1,33 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/read_file.R -\name{read_file} -\alias{read_file} -\title{Read a file} -\usage{ -read_file(path, col_select = NULL, as_data_frame = TRUE, ...) -} -\arguments{ -\item{path}{The file path to be read} - -\item{col_select}{A character vector of column names to keep, as in the -"select" argument to \code{data.table::fread()}, or a -\link[tidyselect:eval_select]{tidy selection specification} -of columns, as used in \code{dplyr::select()}.} - -\item{as_data_frame}{Should the function return a \code{tibble} (default) or -an Arrow \link[arrow]{Table}?} - -\item{...}{Addition arguments passed to the relevant function.} -} -\value{ -the data a \link[tibble:tibble-package]{tibble} -} -\description{ -Read a file, the function chosen to read the file is dependent -on the file path. -\itemize{ -\item \code{.rds} uses \code{\link[readr:read_rds]{readr::read_rds()}}. -\item \code{.csv} use \code{\link[readr:read_delim]{readr::read_csv()}}. -\item \code{.parquet} uses \code{\link[arrow:read_parquet]{arrow::read_parquet()}}. -} -}