Skip to content

Commit

Permalink
export as S3 method, @Usage removal
Browse files Browse the repository at this point in the history
  • Loading branch information
kaz-yos committed Feb 9, 2014
1 parent 951da6c commit 79fe0af
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 42 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
S3method(print,CatTable)
S3method(print,ContTable)
S3method(summary,CatTable)
S3method(summary,ContTable)
export(CreateCatTable)
export(CreateContTable)
export(ShowRegTable)
Expand Down
4 changes: 0 additions & 4 deletions R/CreateCatTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -38,8 +36,6 @@
##' @author Kazuki YOSHIDA
##' @seealso print.CatTable, summary.CatTable, CreateContTable,
##' print.ContTable, summary.ContTable
## @references
## @keywords ~kwd1 ~kwd2
##' @examples
##'
##' ## Load
Expand Down
6 changes: 0 additions & 6 deletions R/CreateContTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -48,8 +44,6 @@
##' @author Kazuki YOSHIDA
##' @seealso print.ContTable, summary.ContTable, CreateCatTable,
##' print.CatTable, summary.CatTable
## @references
## @keywords ~kwd1 ~kwd2
##' @examples
##'
##' ## Load
Expand Down
4 changes: 0 additions & 4 deletions R/ShowRegTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,8 +22,6 @@
##' @author Kazuki Yoshida
##' @seealso CreateContTable, print.ContTable, summary.ContTable,
##' CreateCatTable, print.CatTable, summary.CatTable
## @references
## @keywords ~kwd1 ~kwd2
##' @examples
##'
##' ## Load
Expand Down
7 changes: 1 addition & 6 deletions R/print.CatTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -46,8 +42,6 @@
##' @author Kazuki YOSHIDA
##' @seealso CreateCatTable, summary.CatTable, CreateContTable,
##' print.ContTable, summary.ContTable
## @references
## @keywords ~kwd1 ~kwd2
##' @examples
##'
##' ## Load
Expand Down Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions R/print.ContTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -35,8 +33,6 @@
##' @author Kazuki YOSHIDA
##' @seealso CreateContTable, summary.ContTable, CreateCatTable,
##' print.CatTable, summary.CatTable
## @references
## @keywords ~kwd1 ~kwd2
##' @examples
##'
##' ## Load
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 2 additions & 4 deletions R/summary.CatTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -22,8 +21,6 @@
##' @author Kazuki YOSHIDA
##' @seealso CreateCatTable, print.CatTable, CreateContTable, print.ContTable,
##' summary.ContTable
## @references
## @keywords ~kwd1 ~kwd2
##' @examples
##'
##' ## Load
Expand All @@ -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")

Expand Down
4 changes: 1 addition & 3 deletions R/summary.ContTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -22,8 +21,6 @@
##' @author Kazuki YOSHIDA
##' @seealso CreateContTable, print.ContTable, CreateCatTable, print.CatTable,
##' summary.CatTable
## @references
## @keywords ~kwd1 ~kwd2
##' @examples
##'
##' ## Load
Expand All @@ -48,6 +45,7 @@
##' ## which will show more details.
##' summary(contTableOverall)
##'
##' @S3method summary ContTable
##' @export summary.ContTable
summary.ContTable <- function(object, digits = 2, ...) {

Expand Down
2 changes: 1 addition & 1 deletion R/tableone-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions man/print.CatTable.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions man/print.ContTable.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions man/summary.CatTable.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions man/summary.ContTable.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion man/tableone-package.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 79fe0af

Please sign in to comment.