From d40ea11d620e81ca79ac074fbfc0e240dc9a6989 Mon Sep 17 00:00:00 2001 From: Qile0317 Date: Sun, 28 Jul 2024 21:49:46 -0700 Subject: [PATCH] fix examples --- R/validation.R | 2 +- man/colToRownames.Rd | 15 ++++++++++----- man/mutateToRownames.Rd | 12 ++++++++---- man/validateObject.Rd | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/R/validation.R b/R/validation.R index 87baef8..480db16 100644 --- a/R/validation.R +++ b/R/validation.R @@ -35,7 +35,7 @@ #' try( #' validateObject( #' obj, -#' list(checkNotNull, checkIsNumeric), errorHandler = stop) +#' list(checkNotNull, checkIsNumeric, errorHandler = stop) #' ), #' silent = TRUE #' ) diff --git a/man/colToRownames.Rd b/man/colToRownames.Rd index 65b20f2..d4a3118 100644 --- a/man/colToRownames.Rd +++ b/man/colToRownames.Rd @@ -9,18 +9,23 @@ colToRownames(df, col, .remove = TRUE, .uniqueSep = ".") \arguments{ \item{df}{A data frame.} -\item{col}{A character string specifying the name of the column to convert to row names.} +\item{col}{A character string specifying the name of the column to convert +to row names.} -\item{.remove}{A logical indicating whether to remove the selected column after converting to row names. Default is TRUE.} +\item{.remove}{A logical indicating whether to remove the selected column +after converting to row names. Default is TRUE.} -\item{.uniqueSep}{A character string to separate duplicate row names when ensuring uniqueness +\item{.uniqueSep}{A character string to separate duplicate row names when +ensuring uniqueness with \code{\link[=make.unique]{make.unique()}}. Default is ".".} } \value{ -A data frame with the specified column as row names. If \code{.remove} is TRUE, the original column is removed. +A data frame with the specified column as row names. If \code{.remove} +is TRUE, the original column is removed. } \description{ -This function converts a specified column of a data frame to row names, ensuring uniqueness if necessary. +This function converts a specified column of a data frame to row names, +ensuring uniqueness if necessary. } \examples{ # Convert the 'ID' column to row names diff --git a/man/mutateToRownames.Rd b/man/mutateToRownames.Rd index f9b6493..b829dbf 100644 --- a/man/mutateToRownames.Rd +++ b/man/mutateToRownames.Rd @@ -9,11 +9,14 @@ mutateToRownames(.data, expr, .remove = FALSE, .uniqueSep = ".") \arguments{ \item{.data}{A data frame.} -\item{expr}{A tidy evaluation expression specifying the columns to use for the new row names.} +\item{expr}{A tidy evaluation expression specifying the columns to use for +the new row names.} -\item{.remove}{A logical indicating whether to remove the selected columns. Default is FALSE.} +\item{.remove}{A logical indicating whether to remove the selected columns. +Default is FALSE.} -\item{.uniqueSep}{A character string to separate duplicate row names when ensuring uniqueness +\item{.uniqueSep}{A character string to separate duplicate row names when +ensuring uniqueness with \code{\link[=make.unique]{make.unique()}}. Default is ".".} } \value{ @@ -22,7 +25,8 @@ A data frame with updated row names. \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} -This function sets new row names for a data frame based on a tidy evaluation expression. +This function sets new row names for a data frame based on a tidy +evaluation expression. } \examples{ library(dplyr) diff --git a/man/validateObject.Rd b/man/validateObject.Rd index 62f78dc..05b2ce0 100644 --- a/man/validateObject.Rd +++ b/man/validateObject.Rd @@ -46,7 +46,7 @@ obj <- NULL try( validateObject( obj, - list(checkNotNull, checkIsNumeric), errorHandler = stop) + list(checkNotNull, checkIsNumeric, errorHandler = stop) ), silent = TRUE )