From ce911751327f2dcce3bd0f4edc1e8179a58a8af9 Mon Sep 17 00:00:00 2001 From: elimillera Date: Thu, 15 Jun 2023 15:59:32 +0000 Subject: [PATCH] Describe metadata type for df_label as dataset metadata --- R/df_label.R | 2 ++ R/length.R | 2 +- man/xportr_df_label.Rd | 4 ++-- man/xportr_format.Rd | 2 +- man/xportr_label.Rd | 8 ++++---- man/xportr_length.Rd | 8 ++++---- man/xportr_metadata.Rd | 2 +- man/xportr_order.Rd | 12 ++++++------ man/xportr_type.Rd | 14 +++++++------- 9 files changed, 28 insertions(+), 26 deletions(-) diff --git a/R/df_label.R b/R/df_label.R index 3c986c02..0b3b7194 100644 --- a/R/df_label.R +++ b/R/df_label.R @@ -3,6 +3,8 @@ #' Assigns dataset label from a dataset level metadata to a given data frame. #' This is stored in the 'label' attribute of the dataframe. #' +#' @param metadata A data frame containing dataset. See 'Metadata' section for +#' details. #' @inheritParams xportr_length #' #' @return Data frame with label attributes. diff --git a/R/length.R b/R/length.R index bb74ee02..17627268 100644 --- a/R/length.R +++ b/R/length.R @@ -6,7 +6,7 @@ #' the 'width' attribute of the column. #' #' @param .df A data frame of CDISC standard. -#' @param metadata A data frame containing dataset/variable level metadata. See +#' @param metadata A data frame containing variable level metadata. See #' 'Metadata' section for details. #' @param domain Appropriate CDSIC dataset name, e.g. ADAE, DM. Used to subset #' the metadata object. If none is passed, then name of the dataset passed as diff --git a/man/xportr_df_label.Rd b/man/xportr_df_label.Rd index 88db94ee..e0a461fd 100644 --- a/man/xportr_df_label.Rd +++ b/man/xportr_df_label.Rd @@ -9,8 +9,8 @@ xportr_df_label(.df, metadata = NULL, domain = NULL, metacore = deprecated()) \arguments{ \item{.df}{A data frame of CDISC standard.} -\item{metadata}{A data frame containing dataset/variable level metadata. See -'Metadata' section for details.} +\item{metadata}{A data frame containing dataset. See 'Metadata' section for +details.} \item{domain}{Appropriate CDSIC dataset name, e.g. ADAE, DM. Used to subset the metadata object. If none is passed, then name of the dataset passed as diff --git a/man/xportr_format.Rd b/man/xportr_format.Rd index 9f9043d3..a4f06222 100644 --- a/man/xportr_format.Rd +++ b/man/xportr_format.Rd @@ -9,7 +9,7 @@ xportr_format(.df, metadata = NULL, domain = NULL, metacore = deprecated()) \arguments{ \item{.df}{A data frame of CDISC standard.} -\item{metadata}{A data frame containing dataset/variable level metadata. See +\item{metadata}{A data frame containing variable level metadata. See 'Metadata' section for details.} \item{domain}{Appropriate CDSIC dataset name, e.g. ADAE, DM. Used to subset diff --git a/man/xportr_label.Rd b/man/xportr_label.Rd index ff52c3e2..a74137ed 100644 --- a/man/xportr_label.Rd +++ b/man/xportr_label.Rd @@ -15,7 +15,7 @@ xportr_label( \arguments{ \item{.df}{A data frame of CDISC standard.} -\item{metadata}{A data frame containing dataset/variable level metadata. See +\item{metadata}{A data frame containing variable level metadata. See 'Metadata' section for details.} \item{domain}{Appropriate CDSIC dataset name, e.g. ADAE, DM. Used to subset @@ -34,14 +34,14 @@ Data frame with label attributes for each variable. } \description{ Assigns variable label from a variable level metadata to a given data frame. -This function will give an error if a label is presented that is greater than +This function will give detect if a label is greater than 40 characters which isn't allowed in XPT v5. If labels aren't present for the variable it will be assigned an empty character value. Labels are stored in the 'label' attribute of the column. } \section{Messaging}{ - \code{label_log} is the primary messaging tool for -\code{xportr_label}. If there are any columns present in the '.df' that are not + \code{label_log()} is the primary messaging tool for +\code{xportr_label()}. If there are any columns present in the '.df' that are not noted in the metadata, they cannot be assigned a label and a message will be generated noting the number or variables that have not been assigned a label. diff --git a/man/xportr_length.Rd b/man/xportr_length.Rd index 409678e2..89fb5703 100644 --- a/man/xportr_length.Rd +++ b/man/xportr_length.Rd @@ -15,7 +15,7 @@ xportr_length( \arguments{ \item{.df}{A data frame of CDISC standard.} -\item{metadata}{A data frame containing dataset/variable level metadata. See +\item{metadata}{A data frame containing variable level metadata. See 'Metadata' section for details.} \item{domain}{Appropriate CDSIC dataset name, e.g. ADAE, DM. Used to subset @@ -33,7 +33,7 @@ metadata now renamed with \code{metadata}} Data frame with \code{SASlength} attributes for each variable. } \description{ -Assigns SAS length from a variable level metadata to a given data frame. If a +Assigns SAS length from a metadata object to a given data frame. If a length isn't present for a variable the length value is set to 200 for character columns, and 8 for non-character columns. This value is stored in the 'width' attribute of the column. @@ -47,12 +47,12 @@ length. If variables were not found in the metadata and the value passed to the 'verbose' argument is 'stop', 'warn', or 'message', a message will be -generated detailing the variables that were missing in metadata. +generated detailing the variables that were missing in the metadata. } \section{Metadata}{ The argument passed in the 'metadata' argument can either -be a metacore object, or a data.frame containing the data listed below. If +be a \code{{metacore}} object, or a data.frame containing the data listed below. If metacore is used, no changes to options are required. For data.frame 'metadata' arguments three columns must be present: diff --git a/man/xportr_metadata.Rd b/man/xportr_metadata.Rd index f610f366..75f3005b 100644 --- a/man/xportr_metadata.Rd +++ b/man/xportr_metadata.Rd @@ -9,7 +9,7 @@ xportr_metadata(.df, metadata, domain = NULL) \arguments{ \item{.df}{A data frame of CDISC standard.} -\item{metadata}{A data frame containing dataset/variable level metadata. See +\item{metadata}{A data frame containing variable level metadata. See 'Metadata' section for details.} \item{domain}{Appropriate CDSIC dataset name, e.g. ADAE, DM. Used to subset diff --git a/man/xportr_order.Rd b/man/xportr_order.Rd index b1018557..e8ea269c 100644 --- a/man/xportr_order.Rd +++ b/man/xportr_order.Rd @@ -15,7 +15,7 @@ xportr_order( \arguments{ \item{.df}{A data frame of CDISC standard.} -\item{metadata}{A data frame containing dataset/variable level metadata. See +\item{metadata}{A data frame containing variable level metadata. See 'Metadata' section for details.} \item{domain}{Appropriate CDSIC dataset name, e.g. ADAE, DM. Used to subset @@ -33,14 +33,14 @@ metadata now renamed with \code{metadata}} Dataframe that has been re-ordered according to spec } \description{ -The \code{dplyr::arange} function is used to order the columns of the dataframe. -Any variables that are missing an order value are appended to the dataframe +The \code{dplyr::arrange()} function is used to order the columns of the dataframe. +Any variables that are missing an order value are appended to the end of the dataframe after all of the variables that have an order. } \section{Messaging}{ - \code{var_ord_msg} is the primary messaging tool for -\code{xportr_order}. There are two primary messages that are output from -\code{var_ord_msg}. The first is the "moved" variables. These are the variables + \code{var_ord_msg()} is the primary messaging tool for +\code{xportr_order()}. There are two primary messages that are output from +\code{var_ord_msg()}. The first is the "moved" variables. These are the variables that were not found in the metadata file and moved to the end of the dataset. A message will be generated noting the number, if any, of variables that were moved to the end of the dataset. If any variables were diff --git a/man/xportr_type.Rd b/man/xportr_type.Rd index d1d5b595..9c5896d6 100644 --- a/man/xportr_type.Rd +++ b/man/xportr_type.Rd @@ -15,7 +15,7 @@ xportr_type( \arguments{ \item{.df}{A data frame of CDISC standard.} -\item{metadata}{A data frame containing dataset/variable level metadata. See +\item{metadata}{A data frame containing variable level metadata. See 'Metadata' section for details.} \item{domain}{Appropriate CDSIC dataset name, e.g. ADAE, DM. Used to subset @@ -41,12 +41,12 @@ will collapse a column to a numeric type. If no type is passed for a variable, it is assumed to be numeric and coerced with \code{as.numeric}. } \section{Messaging}{ - \code{type_log} is the primary messaging tool for -\code{xportr_type}. The number of column types that mismatch the reported type -in the metadata, if any, is reported by by \code{xportr_type}. If there are any + \code{type_log()} is the primary messaging tool for +\code{xportr_type()}. The number of column types that mismatch the reported type +in the metadata, if any, is reported by by \code{xportr_type()}. If there are any type mismatches, and the 'verbose' argument is 'stop', 'warn', or -'message', the type mismatches will be detailed the actual type and the -type reported in the metadata. +'message', each mismatch will be detailed with the actual type in the data +and the type noted in the metadata. } \section{Metadata}{ @@ -54,7 +54,7 @@ type reported in the metadata. be a metacore object, or a data.frame containing the data listed below. If metacore is used, no changes to options are required. -For data.frame 'metadata' arguments three columns must be present: +For data.frame 'metadata' arguments four columns must be present: \enumerate{ \item Domain Name - passed as the 'xportr.domain_name' option. Default: "dataset". This is the column subset by the 'domain' argument in the