Skip to content

Commit

Permalink
Merge branch 'rc-0.7.0'
Browse files Browse the repository at this point in the history
See NEWS for details
* Weighted data support via survey
* SMD support along with vignette and ExtractSmd()
* includeNA option for constructors
* ShowRegTable() can use custom confint function
* print.TableOne() aligns sample size
  • Loading branch information
kaz-yos committed Aug 10, 2015
2 parents 7630829 + e77d4c8 commit 8c29aaa
Show file tree
Hide file tree
Showing 140 changed files with 9,885 additions and 3,509 deletions.
11 changes: 11 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@
## Avoid git(hub) related files
\.git/*
README.md
cran-comment.md

## Avoid Makefile, testing-related files, and archives
Makefile
revdep_check.txt
tableone.Rcheck
.*.tar.gz
.*.gif

## unit testing
test-all.txt
tests/testthat/ref-*

## CRAN compatibility check
cran-check.txt
## Travis-CI
^\.travis\.yml$
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*~
*.DS_Store
*.zip
*.pdf
*.Rhistory
*.tar.gz
*.Rcheck
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Sample .travis.yml for R projects

language: r
warnings_are_errors: true
sudo: required

env:
global:
- CRAN: http://cran.rstudio.com

notifications:
email:
on_success: change
on_failure: change
29 changes: 19 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
Package: tableone
Type: Package
Title: Create "Table 1" to describe baseline characteristics
Version: 0.6.3
Date: 2014-12-28
Title: Create "Table 1" to Describe Baseline Characteristics
Version: 0.7.0
Date: 2015-08-10
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 in every medical research. This
package provides functions to create such summaries for continuous and
categorical variables, optionally with subgroup comparisons. The package
was inspired 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 command-line users.
Description: Creates "Table 1", i.e., description of baseline patient
characteristics, which is essential in every medical research.
Supports both continuous and categorical variables, as well as
p-values and standardized mean differences. Weighted data are
supported via the survey package. See github for a screencast.
tableone was inspired by descriptive statistics functions in
Deducer , a Java-based GUI package by Ian Fellows. This package
does not require GUI or Java, and intended for command-line users.
License: GPL-2
Imports:
survey,
MASS,
e1071,
zoo,
gmodels
Suggests:
survival,
testthat,
Matrix,
dummies,
Matching,
reshape2,
ggplot2,
knitr
URL: https://github.com/kaz-yos/tableone
VignetteBuilder: knitr
24 changes: 21 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,29 @@ PKG_VERSION=$(shell grep -i ^version: DESCRIPTION | cut -d : -d \ -f 2)

## Define files to check for updates
R_FILES := $(wildcard R/*.R)
TST_FILES := $(wildcard tests/testthat/*.R)
SRC_FILES := $(wildcard src/*) $(addprefix src/, $(COPY_SRC))
VIG_FILES := $(wildcard vignettes/*)
PKG_FILES := DESCRIPTION NAMESPACE NEWS $(R_FILES) $(SRC_FILES) $(VIG_FILES)
PKG_FILES := DESCRIPTION NAMESPACE NEWS $(R_FILES) $(TST_FILES) $(SRC_FILES) $(VIG_FILES)


## .PHONY to allow non-file targets (file targets should not be here)
## https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: build check install clean
.PHONY: test build_win build check revdep install clean


### Define targets

## test just runs testthat scripts. No dependencies.
test:
Rscript -e "devtools::test()" | tee test-all.txt

## build_win always build regardless of file update status
## Links to results e-mailed (no useful output locally)
build_win:
Rscript -e "devtools::build_win(version = 'R-devel')"
Rscript -e "devtools::build_win(version = 'R-release')"

## build depends on the *.tar.gz file, i.e., its own product.
## *.tar.gz file is defined seprately to prevent build execution on every invocation.
build: $(PKG_NAME)_$(PKG_VERSION).tar.gz
Expand All @@ -43,7 +54,11 @@ NAMESPACE: $(R_FILES)

## check requires the *.tar.gz file, and execute strict tests on it.
check: $(PKG_NAME)_$(PKG_VERSION).tar.gz
R CMD check --as-cran ./$(PKG_NAME)_$(PKG_VERSION).tar.gz
R CMD check --as-cran ./$(PKG_NAME)_$(PKG_VERSION).tar.gz | tee cran-check.txt

## revdep requires the *.tar.gz file, and execute strict tests on it.
revdep: $(PKG_NAME)_$(PKG_VERSION).tar.gz
Rscript -e "devtools::revdep_check()" | tee revdep_check.txt

## install requires the *.tar.gz file, and execute installation using it.
install: $(PKG_NAME)_$(PKG_VERSION).tar.gz
Expand All @@ -64,6 +79,9 @@ list:
@echo "R files:"
@echo $(R_FILES)
@echo
@echo "Test files:"
@echo $(TST_FILES)
@echo
@echo "Source files:"
@echo $(SRC_FILES)
@echo
Expand Down
26 changes: 23 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
# Generated by roxygen2 (4.1.0): do not edit by hand
# Generated by roxygen2 (4.1.1): do not edit by hand

S3method(print,CatTable)
S3method(print,ContTable)
S3method(print,TableOne)
S3method(print,svyCatTable)
S3method(print,svyContTable)
S3method(summary,CatTable)
S3method(summary,ContTable)
S3method(summary,TableOne)
S3method(summary,svyCatTable)
S3method(summary,svyContTable)
export(CreateCatTable)
export(CreateContTable)
export(CreateTableOne)
export(ExtractSmd)
export(ShowRegTable)
import(e1071)
import(gmodels)
export(svyCreateCatTable)
export(svyCreateContTable)
export(svyCreateTableOne)
import(survey)
importFrom(stats,as.formula)
importFrom(stats,chisq.test)
importFrom(stats,coef)
importFrom(stats,confint)
importFrom(stats,fisher.test)
importFrom(stats,kruskal.test)
importFrom(stats,median)
importFrom(stats,oneway.test)
importFrom(stats,quantile)
importFrom(stats,sd)
importFrom(stats,var)
importFrom(stats,xtabs)
importFrom(utils,combn)
57 changes: 57 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
tableone 0.7.0 (2015-08-10)
----------------------------------------------------------------

NEW FEATURES

* Weighted data are now supported via the survey package.
svydesign() should be used to create a survey design object,
and this object should be used for svyCreateTableOne() instead
of a data frame. Other options are essentially the same. All
results will be weighted results.

* Standardized mean differences are calculated. print() methods
include smd option, which defaults to FALSE for backward
compatibility. If TRUE, SMD is shown on the right side of the
table. To suppress p-values, use test = FALSE option.
summary() methods also print SMDs. If there are more than two
strata, all possible pairwise contrasts are shown along with the
average SMD across all contrats. In this case, print methods only
prints the average SMD for brevity. For categorical variables
Yang and Dalton's suggested method (A unified approach to
measuring the effect size between two groups using SAS.
SAS Paper 335-2012) is used. SMDs for weighted data are
experimental.

* ExtractSmd() function can be used to extract SMD values as a
numeric matrix, which then can be used for plotting, etc.

* An new RMarkdown vignette explains the use of standardized
mean differences.

* The includeNA option for CreateTableOne() and svyCreateTableOne()
make NA's in factors treated as a regular level.

* ShowRegTable() now has ciFun option, which allows use of
the confint.default function if calculation is too slow for
glm results.

* print.TableOne() aligns the sample size with other summaries.


OTHER CHANGES

* ShowRegTable() uses coef to refer to coefficients.

* Unit tests were extended to cover more functions.

* CreateTableOne() was refactored to avoid redundant calculation.

* New dependencies: survey, MASS, and zoo


BUG FIXES

* Fixed pDigits option in print.ContTable(), which was not correctly
functional as advertised.


tableone 0.6.3 (2014-12-28)
----------------------------------------------------------------

Expand Down
Loading

0 comments on commit 8c29aaa

Please sign in to comment.