Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
RobLBaker committed Jun 27, 2024
1 parent ea58d30 commit 1f506d1
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions R/replace_blanks.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#' Replaces all blank cells with NA
#' Replaces all blank cells a missing value code of your choice
#'
#' @details `replace_blanks()` is particularly useful for exporting data from a
#' database (such as access) and converting it to a data package with metadata.
#' @description `replace_blanks()` is particularly useful for exporting data
#' from a database (such as access) and converting it to a data package with
#' metadata.
#'
#' `replace_blanks()` will import all .csv files in the specified working
#' directory. The files are then written back out to the same directory,
Expand All @@ -10,9 +11,23 @@
#' If no missing value is specified, the function defaults to replacing all
#' blanks with "NA".
#'
#' One exception is if a .csv contains NO data (i.e. just column names and no
#' data in any of the cells). In this case, the blanks will not be replaced with
#' NA (as the function cannot determine how many NAs to include).
#' Please keep in mind the "missing" is a general term for all data
#' not present in the data file or data package. Although you may have a very
#' good reason for not providing data and that data may not, from the data
#' package creator's perspective, be "missing" (maybe you never intended to
#' collect it) from a data package user's perspective any data that is not in
#' the data package is effectively "missing" from the data package. Therefore,
#' it is critical to document in metadata any data that are absent with an
#' appropriate "missingValueCode" and "missingValueDefinition". These terms are
#' defined by the metadata schema and are broadly used to apply to any data not
#' present.
#'
#' This function will replace all empty cells and all cells with NA with a
#' "missingValueCode" of your choice (although it defaults to NA).
#'
#' @details One exception is if a .csv contains NO data (i.e. just column names
#' and no data in any of the cells). In this case, the blanks will not be
#' replaced with NA (as the function cannot determine how many NAs to include).
#'
#' @param directory String. Path to the file(s) to have blanks replaced with
#' NAs. Defaults to the working directory of the project (here::here())
Expand Down

0 comments on commit 1f506d1

Please sign in to comment.