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

Add documentation regarding dimensionless units #276

Merged
merged 5 commits into from
May 22, 2019
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
62 changes: 38 additions & 24 deletions R/set_attributes.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,56 @@
#' headers shown here. The attributes data frame must contain columns for required metadata.
#' These are:
#'
#' For all data:
#' - attributeName (required, free text field)
#' \strong{For all data:}
#'
#' - attributeDefinition (required, free text field)
#' \itemize{
#' \item attributeName (required, free text field)
#'
#' - measurementScale (required, "nominal", "ordinal", "ratio", "interval", or "dateTime",
#' \item attributeDefinition (required, free text field)
#'
#' \item measurementScale (required, "nominal", "ordinal", "ratio", "interval", or "dateTime",
#' case sensitive) but it can be inferred from col_classes.
#'
#' - domain (required, "numericDomain", "textDomain", "enumeratedDomain", or "dateTimeDomain",
#' \item domain (required, "numericDomain", "textDomain", "enumeratedDomain", or "dateTimeDomain",
#' case sensitive) but it can be inferred from col_classes.
#'
#' For numeric (ratio or interval) data:
#' - unit (required)
#'
#' For character (textDomain) data:
#' - definition (required)
#'
#' For dateTime data:
#' - formatString (required)
#' }
#'
#' \strong{For numeric (ratio or interval) data:}
#' \itemize{
#' \item unit (required). Unitless values should use "dimensionless" as the unit.
#' }
#'
#' \strong{For character (textDomain) data:}
#' \itemize{
#' \item definition (required)
#' }
#'
#' \strong{For dateTime data:}
#' \itemize{
#' \item formatString (required)
#' }
#'
#' Other optional allowed columns in the attributes table are:
#' source, pattern, precision, numberType, missingValueCode, missingValueCodeExplanation,
#' attributeLabel, storageType, minimum, maximum
#'
#' The factors data frame, required for attributes in an enumerated domain, must use only the
#' The \strong{factors} data frame, required for attributes in an enumerated domain, must use only the
#' following recognized column headers:
#' \itemize{
#' \item attributeName (required)
#' \item code (required)
#' \item definition (required)
#' }
#'
#' - attributeName (required)
#' - code (required)
#' - definition (required)
#'
#' The missingValues data frame, optional, can be used in the case that multiple missing value codes
#' The \strong{missingValues} data frame, optional, can be used in the case that multiple missing value codes
#' need to be set for the same attribute. This table must contain the following recognized column
#' headers.
#' \itemize{
#' \item attributeName (required)
#' \item code (required)
#' \item definition (required)
#' }
#'
#' - attributeName (required)
#' - code (required)
#' - definition (required)
#'
#' @return an eml "attributeList" object
#' @export
set_attributes <-
Expand Down Expand Up @@ -130,6 +141,9 @@ set_attribute <- function(row, factors = NULL, missingValues = NULL) {
"' is not a recognized standard unit; treating as custom unit. ",
"Please be sure you also define a custom unit in your EML record, ",
"or replace with a recognized standard unit. ",
ifelse(is.na(row[["unit"]]),
'For unitless values, use "dimensionless" as the unit. ',
NULL),
"See set_unitList() for details."
)
} else {
Expand Down
7 changes: 5 additions & 2 deletions docs/LICENSE-text.html

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

7 changes: 5 additions & 2 deletions docs/LICENSE.html

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

Loading