diff --git a/DESCRIPTION b/DESCRIPTION index ca504eb..8bc91d7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: tableone Type: Package Title: Create the "Table 1" to describe baseline characteristics -Version: 0.1.1 +Version: 0.1.2 Date: 2014-02-09 Author: Kazuki Yoshida Maintainer: Kazuki Yoshida diff --git a/NAMESPACE b/NAMESPACE index 7dae9c0..4a7ddf0 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,3 +1,7 @@ +S3method(print,CatTable) +S3method(print,ContTable) +S3method(summary,CatTable) +S3method(summary,ContTable) export(CreateCatTable) export(CreateContTable) export(ShowRegTable) diff --git a/R/CreateCatTable.R b/R/CreateCatTable.R index 8026e0e..3bf0e24 100644 --- a/R/CreateCatTable.R +++ b/R/CreateCatTable.R @@ -6,8 +6,6 @@ ##' also \code{\link{print.CatTable}} and \code{\link{summary.CatTable}}. ##' ##' -## @usage CreateCatTable(vars, strata, data, test = TRUE, testApprox = -## chisq.test, testExact = fisher.test) ##' @param vars Variable(s) to be summarized given as a character vector. ##' @param strata Stratifying (grouping) variable name(s) given as a character ##' vector. If omitted, the overall results are returned. @@ -38,8 +36,6 @@ ##' @author Kazuki YOSHIDA ##' @seealso print.CatTable, summary.CatTable, CreateContTable, ##' print.ContTable, summary.ContTable -## @references -## @keywords ~kwd1 ~kwd2 ##' @examples ##' ##' ## Load diff --git a/R/CreateContTable.R b/R/CreateContTable.R index c9fdab9..2894826 100644 --- a/R/CreateContTable.R +++ b/R/CreateContTable.R @@ -5,10 +5,6 @@ ##' object gives a table that is easy to use in medical research papers. ##' ##' -## @usage CreateContTable(vars, strata, data, func.names = c("n", "miss", -## "mean", "sd", "median", "p25", "p75", "min", "max", "skew", "kurt"), -## func.additional, test = TRUE, testNormal = oneway.test, testNonNormal = -## kruskal.test) ##' @param vars Variable(s) to be summarized given as a character vector. ##' @param strata Stratifying (grouping) variable name(s) given as a character ##' vector. If omitted, the overall results are returned. @@ -48,8 +44,6 @@ ##' @author Kazuki YOSHIDA ##' @seealso print.ContTable, summary.ContTable, CreateCatTable, ##' print.CatTable, summary.CatTable -## @references -## @keywords ~kwd1 ~kwd2 ##' @examples ##' ##' ## Load diff --git a/R/ShowRegTable.R b/R/ShowRegTable.R index a46a4a0..2c77f9f 100644 --- a/R/ShowRegTable.R +++ b/R/ShowRegTable.R @@ -4,8 +4,6 @@ ##' usually the form used in medical research papers. ##' ##' -## @usage ShowRegTable(model, exp = TRUE, digits = 2, pDigits = 3, quote = -## FALSE) ##' @param model Regression model result objects that have the summary and ##' confint methods. ##' @param exp TRUE by default. You need to specify exp = FALSE if your model @@ -24,8 +22,6 @@ ##' @author Kazuki Yoshida ##' @seealso CreateContTable, print.ContTable, summary.ContTable, ##' CreateCatTable, print.CatTable, summary.CatTable -## @references -## @keywords ~kwd1 ~kwd2 ##' @examples ##' ##' ## Load diff --git a/R/print.CatTable.R b/R/print.CatTable.R index 3748541..0186ada 100644 --- a/R/print.CatTable.R +++ b/R/print.CatTable.R @@ -4,10 +4,6 @@ ##' CreateCatTable function. ##' ##' -## @usage ## S3 method for class 'CatTable' print.CatTable(CatTable, missing = -## FALSE, format = c("fp", "f", "p", "pf")[1], digits = 1, exact = NULL, quote -## = FALSE, test = TRUE, pDigits = 3, showAllLevels = FALSE, explain = TRUE, -## CrossTable = FALSE) ##' @param x The result of a call to the \code{\link{CreateCatTable}} function. ##' @param missing Whether to show missing data information (not implemented ##' yet, placeholder) @@ -46,8 +42,6 @@ ##' @author Kazuki YOSHIDA ##' @seealso CreateCatTable, summary.CatTable, CreateContTable, ##' print.ContTable, summary.ContTable -## @references -## @keywords ~kwd1 ~kwd2 ##' @examples ##' ##' ## Load @@ -100,6 +94,7 @@ ##' ## Excel does not mess up the cells. ##' print(catTableBySexTrt, exact = "ascites", quote = TRUE) ##' +##' @S3method print CatTable ##' @export print.CatTable print.CatTable <- function(x, missing = FALSE, format = c("fp","f","p","pf")[1], # Format f_requency and/or p_ercent diff --git a/R/print.ContTable.R b/R/print.ContTable.R index ba2e337..9ad9e8d 100644 --- a/R/print.ContTable.R +++ b/R/print.ContTable.R @@ -4,8 +4,6 @@ ##' CreateContTable function. ##' ##' -## @usage print.ContTable(ContTable, missing = FALSE, digits = 2, nonnormal = -## NULL, quote = FALSE, test = TRUE, pDigits = 3, explain = TRUE) ##' @param x The result of a call to the \code{\link{CreateContTable}} function. ##' @param missing Whether to show missing data information (not implemented ##' yet, placeholder) @@ -35,8 +33,6 @@ ##' @author Kazuki YOSHIDA ##' @seealso CreateContTable, summary.ContTable, CreateCatTable, ##' print.CatTable, summary.CatTable -## @references -## @keywords ~kwd1 ~kwd2 ##' @examples ##' ##' ## Load @@ -88,6 +84,7 @@ ##' ## Excel does not mess up the cells. ##' print(contTableBySexTrt, nonnormal = nonNormalVars, quote = TRUE) ##' +##' @S3method print ContTable ##' @export print.ContTable print.ContTable <- function(x, missing = FALSE, digits = 2, nonnormal = NULL, quote = FALSE, diff --git a/R/summary.CatTable.R b/R/summary.CatTable.R index 030a7f2..be92124 100644 --- a/R/summary.CatTable.R +++ b/R/summary.CatTable.R @@ -6,7 +6,6 @@ ##' (fisher.test by default). ##' ##' -## @usage summary.CatTable(CatTable, digits = 1) ##' @param object An object that has the \code{CatTable} class to be shown. ##' @param digits Number of digits to print. ##' @param ... For compatibility with generic. Ignored. @@ -22,8 +21,6 @@ ##' @author Kazuki YOSHIDA ##' @seealso CreateCatTable, print.CatTable, CreateContTable, print.ContTable, ##' summary.ContTable -## @references -## @keywords ~kwd1 ~kwd2 ##' @examples ##' ##' ## Load @@ -48,12 +45,13 @@ ##' ## which will show more details. ##' summary(catTableOverall) ##' +##' @S3method summary CatTable ##' @export summary.CatTable summary.CatTable <- function(object, digits = 1, ...) { ## object and ... required to be consistent with generic summary(object, ...) CatTable <- object - + ## Create format fmt <- paste0("%.", digits, "f") diff --git a/R/summary.ContTable.R b/R/summary.ContTable.R index 030e33e..5a0b765 100644 --- a/R/summary.ContTable.R +++ b/R/summary.ContTable.R @@ -6,7 +6,6 @@ ##' test (kruskal.test by default). ##' ##' -## @usage summary.ContTable(ContTable, digits = 2) ##' @param object An object that has the \code{ContTable} class to be shown. ##' @param digits Number of digits to print. ##' @param ... For compatibility with generic. Ignored. @@ -22,8 +21,6 @@ ##' @author Kazuki YOSHIDA ##' @seealso CreateContTable, print.ContTable, CreateCatTable, print.CatTable, ##' summary.CatTable -## @references -## @keywords ~kwd1 ~kwd2 ##' @examples ##' ##' ## Load @@ -48,6 +45,7 @@ ##' ## which will show more details. ##' summary(contTableOverall) ##' +##' @S3method summary ContTable ##' @export summary.ContTable summary.ContTable <- function(object, digits = 2, ...) { diff --git a/R/tableone-package.R b/R/tableone-package.R index e53130e..bd5a6b0 100644 --- a/R/tableone-package.R +++ b/R/tableone-package.R @@ -8,7 +8,7 @@ ##' GUI or Java, and intended for CUI users. ##' ##' \tabular{ll}{ Package: \tab tableone\cr Type: \tab Package\cr Version: \tab -##' 0.1.1\cr Date: \tab 2014-02-08\cr License: \tab GPL-2\cr } Create an object +##' 0.1.2\cr Date: \tab 2014-02-08\cr License: \tab GPL-2\cr } Create an object ##' summarizing continous and categorical variables optionally stratifying by ##' one or more startifying variables and performing statistical tests. The ##' object gives a table that is easy to use in medical research papers. diff --git a/man/print.CatTable.Rd b/man/print.CatTable.Rd index 0de534f..a61885f 100644 --- a/man/print.CatTable.Rd +++ b/man/print.CatTable.Rd @@ -48,8 +48,7 @@ held internally using gmodels::CrossTable function. This will give an output similar to the PROC FREQ in SAS.} - \item{...}{Additional arguments. Required for the generic - print(x, ...). (not implemented yet, placeholder)} + \item{...}{For compatibility with generic. Ignored.} } \value{ It is mainly for printing the result. But this function diff --git a/man/print.ContTable.Rd b/man/print.ContTable.Rd index 326994f..2305f44 100644 --- a/man/print.ContTable.Rd +++ b/man/print.ContTable.Rd @@ -35,8 +35,7 @@ names, i.e., (mean (sd) or median [IQR]) is added to the variable names.} - \item{...}{Additional arguments. Required for the generic - print(x, ...). (not implemented yet, placeholder)} + \item{...}{For compatibility with generic. Ignored.} } \value{ It is mainly for printing the result. But this function diff --git a/man/summary.CatTable.Rd b/man/summary.CatTable.Rd index 0a37090..02173b7 100644 --- a/man/summary.CatTable.Rd +++ b/man/summary.CatTable.Rd @@ -10,8 +10,7 @@ \item{digits}{Number of digits to print.} - \item{...}{Additional arguments. Required for the generic - summary(object, ...). (not implemented yet, placeholder)} + \item{...}{For compatibility with generic. Ignored.} } \value{ It will print the results. diff --git a/man/summary.ContTable.Rd b/man/summary.ContTable.Rd index 68d5be2..74ecc37 100644 --- a/man/summary.ContTable.Rd +++ b/man/summary.ContTable.Rd @@ -10,8 +10,7 @@ \item{digits}{Number of digits to print.} - \item{...}{Additional arguments. Required for the generic - summary(object, ...). (not implemented yet, placeholder)} + \item{...}{For compatibility with generic. Ignored.} } \value{ It will print the results. diff --git a/man/tableone-package.Rd b/man/tableone-package.Rd index 5417deb..b4e22b5 100644 --- a/man/tableone-package.Rd +++ b/man/tableone-package.Rd @@ -15,7 +15,7 @@ or Java, and intended for CUI users. } \details{ \tabular{ll}{ Package: \tab tableone\cr Type: \tab -Package\cr Version: \tab 0.1.1\cr Date: \tab 2014-02-08\cr +Package\cr Version: \tab 0.1.2\cr Date: \tab 2014-02-08\cr License: \tab GPL-2\cr } Create an object summarizing continous and categorical variables optionally stratifying by one or more startifying variables and performing