Skip to content

Commit

Permalink
Merge branch 'rc0.2.1' to create 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kaz-yos committed Feb 15, 2014
2 parents 1b8c501 + cbea5d1 commit 9b93ff8
Show file tree
Hide file tree
Showing 24 changed files with 153 additions and 124 deletions.
12 changes: 6 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Package: tableone
Type: Package
Title: Create "Table 1" to describe baseline characteristics
Version: 0.2.0
Date: 2014-02-13
Version: 0.2.1
Date: 2014-02-15
Author: Kazuki Yoshida, Justin Bohn
Maintainer: Kazuki Yoshida <[email protected]>
Description: This package creates "Table 1", i.e., description of baseline
patient characteristics, which is essential every medical research. This
package provides functions to create such summaries for continuous and
categorical variables, optionally with subgroups and groupwise comparison.
The package was insipired by and based on descriptive statistics functions
in Deducer, a Java-based GUI package by Ian Fellows. This package does not
require GUI or Java, and intended for CUI users.
categorical variables, optionally with subgroups comparisons. The package
was insipired by and based on descriptive statistics functions in Deducer,
a Java-based GUI package by Ian Fellows. This package does not require GUI
or Java, and intended for CUI users.
License: GPL-2
Depends:
e1071,
Expand Down
24 changes: 12 additions & 12 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
tableone 0.2.0
tableone 0.2.1 (2014-02-15)
----------------------------------------------------------------
NEW FEATURES

* CreateTableOne and related print/summary methods were added.
BUG FIXES

* CreateTableOne can crate a table with both categorical and
continuous variables.
* Documentations were fixed to represent the current version.


tableone 0.1.3
tableone 0.2.0 (2014-02-14)
----------------------------------------------------------------
NEW FEATURES

* The print method can suppress printing by printToggle option.
* CreateTableOne and related print/summary methods were added.

* (CreateTableOne and related print and summary methods are introduced).
* CreateTableOne can crate a table with both categorical and
continuous variables.

* The print method can suppress printing by printToggle option.

BUG FIXES

* In the Roxygen part of the code, only at_export followed by nothing is used.


tableone 0.1.2
tableone 0.1.2 (2014-02-09)
----------------------------------------------------------------
BUG FIXES

Expand All @@ -33,7 +33,7 @@ BUG FIXES
* Passed all the default tests by R CMD check file.tar.gz


tableone 0.1.1
tableone 0.1.1 (2014-02-09)
----------------------------------------------------------------
BUG FIXES

Expand All @@ -42,7 +42,7 @@ BUG FIXES
* Documents are now included in


tableone 0.1.0
tableone 0.1.0 (2014-02-08)
----------------------------------------------------------------
FIRST DEVELOPMENTAL VERSION

Expand Down
2 changes: 1 addition & 1 deletion R/CreateCatTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
##' @return An object of class \code{CatTable}, which really is a \code{\link{by}} object with
##' additional attributes. Each element of the \code{\link{by}} part is a matrix with rows
##' representing variables, and columns representing summary statistics.
##' @author Kazuki Yoshida
##' @author Kazuki Yoshida (based on \code{Deducer::frequencies()})
##' @seealso
##' \code{\link{CreateCatTable}}, \code{\link{print.CatTable}}, \code{\link{summary.CatTable}},
##' \code{\link{CreateContTable}}, \code{\link{print.ContTable}}, \code{\link{summary.ContTable}},
Expand Down
10 changes: 4 additions & 6 deletions R/CreateContTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
##' kurtosis (same definition as in SAS). All of them can be seen in the
##' summary method output. The print method uses subset of these. You can
##' choose subset of them or reorder them. They are all configure to omit NA
##' values (na.rm = TRUE).
##' @param func.additional Additional functions can be given as a named list.
##' For example, list(sum = sum).
##' values (\code{na.rm = TRUE}).
##' @param func.additional Additional functions can be given as a named list. For example, \code{list(sum = sum)}.
##' @param test If TRUE, as in the default and there are more than two groups,
##' groupwise comparisons are performed. Both tests that assume normality and
##' tests that do not are performed. Either one of the result can be obtained
Expand All @@ -27,14 +26,14 @@
##' tests. The default is \code{\link{oneway.test}}. This is equivalent of the t-test when there are only two groups.
##' @param argsNormal A named list of arguments passed to the function specified in \code{testNormal}. The default is \code{list(var.equal = TRUE)}, which makes it the ordinary ANOVA that assumes equal variance across groups.
##' @param testNonNormal A function used to perform the nonparametric tests.
##' The default is \code{kruskal.test} (Kruskal-Wallis Rank Sum Test). This is
##' The default is \code{kruskal.test} (Kruskal-Wallis rank sum test). This is
##' equivalent of the wilcox.test (Man-Whitney U test) when there are only two
##' groups.
##' @param argsNonNormal A named list of arguments passed to the function specified in \code{testNonNormal}. The default is \code{list(NULL)}, which is just a placeholder.
##' @return An object of class \code{ContTable}, which really is a \code{\link{by}} object with
##' additional attributes. Each element of the \code{\link{by}} part is a matrix with rows
##' representing variables, and columns representing summary statistics.
##' @author Kazuki Yoshida
##' @author Kazuki Yoshida (based on \code{Deducer::descriptive.table()})
##' @seealso
##' \code{\link{CreateContTable}}, \code{\link{print.ContTable}}, \code{\link{summary.ContTable}},
##' \code{\link{CreateCatTable}}, \code{\link{print.CatTable}}, \code{\link{summary.CatTable}},
Expand All @@ -53,7 +52,6 @@
##' ## Create an overall table for continuous variables
##' contVars <- c("time","age","bili","chol","albumin","copper",
##' "alk.phos","ast","trig","platelet","protime")
##'
##' contTableOverall <- CreateContTable(vars = contVars, data = pbc)
##'
##' ## Simply typing the object name will invoke the print.ContTable method,
Expand Down
26 changes: 19 additions & 7 deletions R/CreateTableOne.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
##' Create an object summarizing both categorical and continuous variables
##'
##' Create an object summarizing 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. See also \code{\link{print.TableOne}} and \code{\link{summary.TableOne}}.
##'
##' Create an object summarizing all baseline 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. See also \code{\link{print.TableOne}} and \code{\link{summary.TableOne}}.
##'
##' @param vars Variables to be summarized given as a character vector. Factors are
##' handled as categorical variables, whereas numeric variables are handled as continuous variables.
##' @param strata Stratifying (grouping) variable name(s) given as a character
Expand All @@ -29,14 +27,19 @@
##' memory limitation. In this situation, the large sample approximation based
##' should suffice.
##' @param argsExact A named list of arguments passed to the function specified in testExact. The default is \code{list(workspace = 2*10^5)}, which specifies the memory space allocated for \code{\link{fisher.test}}.
##' @return An object of class \code{TableOne}, which really is a list of three objects. The first object named \code{object$TableOne} is the categorical-continuous mixture table formatted and printed by the \code{\link{print.TableOne}} method. The second object named \code{object$ContTable} is the table object containing continuous variables only. The third object named \code{object$CatTable} is the table object containing categorical variables only. The second and third objects can be then be examined with the \code{print} and \code{summary} method, for example, \code{summary(object$CatTable)} to examine the categorical variables in detail.
##' @return An object of class \code{TableOne}, which really is a list of three objects.
##' @return \item{TableOne}{a categorical-continuous mixture data formatted and printed by the \code{\link{print.TableOne}} method}
##' @return \item{ContTable}{an object of class \code{ContTable}, containing continuous variables only}
##' @return \item{CatTable}{ an object of class \code{CatTable}, containing categorical variables only}
##' @return The second and third objects can be then be examined with the \code{print} and \code{summary} method, for example, \code{summary(object$CatTable)} to examine the categorical variables in detail.
##'
##' @author Justin Bohn, Kazuki Yoshida
##' @seealso
##' \code{\link{CreateTableOne}}, \code{\link{print.TableOne}}, \code{\link{summary.TableOne}},
##' \code{\link{CreateCatTable}}, \code{\link{print.CatTable}}, \code{\link{summary.CatTable}},
##' \code{\link{CreateContTable}}, \code{\link{print.ContTable}}, \code{\link{summary.ContTable}}
##' @examples
##'
##'
##' ## Load
##' library(tableone)
##'
Expand Down Expand Up @@ -66,16 +69,25 @@
##' ## Specifying nonnormal variables will show the variables appropriately,
##' ## and show nonparametric test p-values. Specify variables in the exact
##' ## argument to obtain the exact test p-values.
##' print(tableOne, nonnormal = c("time"), exact = c("ascites"))
##' print(tableOne, nonnormal = c("bili","chol","copper","alk.phos","trig"),
##' exact = c("status","stage"))
##'
##' ## Use the summary.TableOne method for detailed summary
##' summary(tableOne)
##'
##' ## See the categorical part only using $ operator
##' tableOne$CatTable
##' summary(tableOne$CatTable)
##'
##' ## See the continuous part only using $ operator
##' tableOne$ContTable
##' summary(tableOne$ContTable)
##'
##' ## If your work flow includes copying to Excel and Word when writing manuscripts,
##' ## you may benefit from the quote argument. This will quote everything so that
##' ## Excel does not mess up the cells.
##' print(tableOne, nonnormal = c("bili","chol","copper","alk.phos","trig"),
##' exact = c("status","stage"), quote = TRUE)
##'
##' @export
CreateTableOne <-
Expand Down
24 changes: 7 additions & 17 deletions R/ShowRegTable.R
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
##' Format regression results in medically decent format
##'
##' It shows the regression result in the HR [95\% CI] p-value format, which is
##' usually the form used in medical research papers.
##' It shows the regression result in the HR [95\% CI] p-value format, which is usually the form used in medical research papers.
##'
##'
##' @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
##' is has the indentity link function (linear regression, etc).
##' @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 is has the indentity link function (linear regression, etc).
##' @param digits Number of digits to print for the main part.
##' @param pDigits Number of digits to print for the p-values.
##' @param quote Whether to show everything in quotes. The default is FALSE. If
##' TRUE, everything including the row and column names are quoted so that you
##' can copy it to Excel easily.
##' @return A matrix containing what you see is returned invisibly. You can
##' capture it by assignment to an object.
##' @param quote Whether to show everything in quotes. The default is FALSE. If TRUE, everything including the row and column names are quoted so that you can copy it to Excel easily.
##' @return A matrix containing what you see is returned invisibly. You can capture it by assignment to an object.
##' @author Kazuki Yoshida
##' @seealso CreateContTable, \code{\link{print.ContTable}}, \code{\link{summary.ContTable}},
##' \code{\link{CreateCatTable}}, \code{\link{print.CatTable}}, \code{\link{summary.CatTable}}
##' @examples
##'
##' ## Load
Expand All @@ -30,10 +22,8 @@
##' head(pbc)
##'
##' ## Fit a Cox regression model
##' objCoxph <-
##' coxph(formula = Surv(time, status == 2) ~ trt + age + albumin + ascites,
##' data = pbc,
##' ties = c("efron","breslow","exact")[1])
##' objCoxph <- coxph(formula = Surv(time, status == 2) ~ trt + age + albumin + ascites,
##' data = pbc)
##'
##' ## Show the simple table
##' ShowRegTable(objCoxph)
Expand Down
4 changes: 1 addition & 3 deletions R/print.CatTable.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
##' Format and print the \code{CatTable} class objects
##'
##' This is the print method for the CatTable class objects created by
##' CreateCatTable function.
##'
##' This is the \code{print} method for the \code{CatTable} class objects created by \code{\link{CreateCatTable}} function.
##'
##' @param x The result of a call to the \code{\link{CreateCatTable}} function.
##' @param missing Whether to show missing data information (not implemented
Expand Down
4 changes: 1 addition & 3 deletions R/print.ContTable.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
##' Format and print the \code{ContTable} class objects
##'
##' This is the print method for the ContTable class objects created by
##' CreateContTable function.
##'
##' This is the \code{print} method for the \code{ContTable} class objects created by \code{\link{CreateContTable}} function.
##'
##' @param x The result of a call to the \code{\link{CreateContTable}} function.
##' @param missing Whether to show missing data information (not implemented
Expand Down
15 changes: 11 additions & 4 deletions R/print.TableOne.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
##' Format and print the \code{TableOne} class objects
##'
##' This is the print method for the TableOne class objects created by
##' CreateTableOne function.
##'
##' This is the \code{print} method for the \code{TableOne} class objects created by \code{\link{CreateTableOne}} function.
##'
##' @param x The result of a call to the \code{\link{CreateTableOne}} function.
##' @param missing Whether to show missing data information (not implemented
Expand Down Expand Up @@ -65,10 +63,19 @@
##' ## Specifying nonnormal variables will show the variables appropriately,
##' ## and show nonparametric test p-values. Specify variables in the exact
##' ## argument to obtain the exact test p-values.
##' print(tableOne, nonnormal = c("time"), exact = c("ascites"))
##' print(tableOne, nonnormal = c("bili","chol","copper","alk.phos","trig"),
##' exact = c("status","stage"))
##'
##' ## Use the summary.TableOne method for detailed summary
##' summary(tableOne)
##'
##' ## See the categorical part only using $ operator
##' tableOne$CatTable
##' summary(tableOne$CatTable)
##'
##' ## See the continuous part only using $ operator
##' tableOne$ContTable
##' summary(tableOne$ContTable)
##'
##' @export
print.TableOne <- function(x, missing = FALSE,
Expand Down
6 changes: 1 addition & 5 deletions R/summary.CatTable.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
##' Shows all results in a \code{CatTable} class object
##'
##' This method shows all the data a CatTable class object has. This includes
##' the (optionally stratified) part with summary statistics and p-values from
##' the approximation method test (chisq.test by default) and exact method test
##' (fisher.test by default).
##'
##' This method shows all the data a \code{CatTable} class object has. This includes the (optionally stratified) part with summary statistics and , if available, p-values from the approximation method test (\code{\link{chisq.test}} by default) and exact method test (\code{\link{fisher.test}} by default).
##'
##' @param object An object that has the \code{CatTable} class to be shown.
##' @param digits Number of digits to print.
Expand Down
6 changes: 1 addition & 5 deletions R/summary.ContTable.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
##' Shows all results in a \code{ContTable} class object
##'
##' This method shows all the data a \code{ContTable} class object has. This includes
##' the (optionally stratified) part with summary statistics and p-values from
##' the normal assupmtion-based test (oneway.test by default) and nonparametric
##' test (kruskal.test by default).
##'
##' This method shows all the data a \code{ContTable} class object has. This includes the (optionally stratified) part with summary statistics and , if available, p-values from the normal assupmtion-based test (\code{\link{oneway.test}} by default) and nonparametric test (\code{\link{kruskal.test}} by default).
##'
##' @param object An object that has the \code{ContTable} class to be shown.
##' @param digits Number of digits to print.
Expand Down
5 changes: 0 additions & 5 deletions R/summary.TableOne.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@
##' ## Just typing the object name will invoke the print.TableOne method
##' tableOne
##'
##' ## Specifying nonnormal variables will show the variables appropriately,
##' ## and show nonparametric test p-values. Specify variables in the exact
##' ## argument to obtain the exact test p-values.
##' print(tableOne, nonnormal = c("time"), exact = c("ascites"))
##'
##' ## Use the summary.TableOne method for detailed summary
##' summary(tableOne)
##'
Expand Down
15 changes: 13 additions & 2 deletions R/tableone-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
##'
##' Hadley Wickham for packaging advice and for creating tools this package was made with (roxygen2, devtools, testthat).
##'
##' Members of Facebook Organization of R Users for Medical Statistics in Japan (FORUMS-J) for testing pre-release versions.
##'
##' Developmental repository is on github. Your contributions are appreciated.
##'
##' https://github.com/kaz-yos/tableone
Expand Down Expand Up @@ -54,15 +56,24 @@
##' ## Specifying nonnormal variables will show the variables appropriately,
##' ## and show nonparametric test p-values. Specify variables in the exact
##' ## argument to obtain the exact test p-values.
##' print(tableOne, nonnormal = c("time"), exact = c("ascites"))
##' print(tableOne, nonnormal = c("bili","chol","copper","alk.phos","trig"),
##' exact = c("status","stage"))
##'
##' ## Use the summary.TableOne method for detailed summary
##' summary(tableOne)
##'
##'
##' ## See the categorical part only using $ operator
##' tableOne$CatTable
##' summary(tableOne$CatTable)
##'
##' ## See the continuous part only using $ operator
##' tableOne$ContTable
##' summary(tableOne$ContTable)
##'
##' ## If your work flow includes copying to Excel and Word when writing manuscripts,
##' ## you may benefit from the quote argument. This will quote everything so that
##' ## Excel does not mess up the cells.
##' print(tableOne, nonnormal = c("bili","chol","copper","alk.phos","trig"),
##' exact = c("status","stage"), quote = TRUE)
##'
NULL
2 changes: 1 addition & 1 deletion man/CreateCatTable.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ summary(catTableBySexTrt)
print(catTableBySexTrt, exact = "ascites", quote = TRUE)
}
\author{
Kazuki Yoshida
Kazuki Yoshida (based on \code{Deducer::frequencies()})
}
\seealso{
\code{\link{CreateCatTable}}, \code{\link{print.CatTable}},
Expand Down
Loading

0 comments on commit 9b93ff8

Please sign in to comment.