Skip to content

Commit

Permalink
1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jinseob2kim committed Jul 13, 2024
1 parent 4a42e5f commit d2431a2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: jstable
Title: Create Tables from Different Types of Regression
Version: 1.3.0
Date: 2024-07-05
Version: 1.3.1
Date: 2024-07-13
Authors@R: c(person("Jinseob", "Kim", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9403-605X")),
person("Zarathu", role = c("cph", "fnd")),
person("Yoonkyoung","Jeon", role = c("aut")),
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# jstable 1.3.1

* Fix: `addOverall` options to `svyCreateTableOneJS`


# jstable 1.3.0

* Update: Add `weights` option to `TableSubgroupCox` and `TableSubgroupMultiCox` for marginal cox model. ex: `weights = "weights"`
Expand Down
2 changes: 1 addition & 1 deletion R/CreateTableOneJS.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ CreateTableOne2 <- function(data, strata, vars, factorVars, includeNA = F, test

if (Labels & !is.null(labeldata)) {
colname.group_var <- unlist(labeldata[.(strata, names(res$CatTable)), val_label])
if (is.na(colname.group_var[1])) {
if (is.na(colname.group_var[1]) & addOverall) {
colname.group_var[1] <- "Overall"
}
if (showAllLevels == T) {
Expand Down
8 changes: 4 additions & 4 deletions R/svyCreateTableOneJS.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ svyCreateTableOne2 <- function(data, strata, vars, factorVars, includeNA = F, te

res <- tableone::svyCreateTableOne(
vars = vars, strata = strata, data = data, factorVars = factorVars, includeNA = includeNA, test = test,
smd = smd
smd = smd, addOverall = addOverall
)

factor_vars <- res[["MetaData"]][["varFactors"]]
Expand All @@ -85,7 +85,7 @@ svyCreateTableOne2 <- function(data, strata, vars, factorVars, includeNA = F, te
}
ptb1.res0 <- print(res0,
showAllLevels = showAllLevels, printToggle = printToggle, quote = quote, varLabels = Labels, nonnormal = nonnormal,
catDigits = catDigits, contDigits = contDigits, minMax = minMax
catDigits = catDigits, contDigits = contDigits, minMax = minMax, addOverall = addOverall
)
ptb1.rn <- rownames(ptb1.res0)
ptb1.rn <- gsub("(mean (SD))", "", ptb1.rn, fixed = T)
Expand All @@ -111,7 +111,7 @@ svyCreateTableOne2 <- function(data, strata, vars, factorVars, includeNA = F, te

if (Labels & !is.null(labeldata)) {
colname.group_var <- unlist(labeldata[get("variable") == strata, "val_label"])
if (is.na(colname.group_var[1])) {
if (is.na(colname.group_var[1]) & addOverall) {
colname.group_var[1] <- "Overall"
}
if (showAllLevels == T) {
Expand Down Expand Up @@ -248,7 +248,7 @@ svyCreateTableOneJS <- function(vars, strata = NULL, strata2 = NULL, data, facto
ptb1.list <- lapply(data.strata, svyCreateTableOne2,
vars = vars, strata = strata2, factorVars = factorVars, includeNA = includeNA, test = test, smd = smd,
showAllLevels = showAllLevels, printToggle = printToggle, quote = quote, Labels = F, nonnormal = nonnormal,
catDigits = catDigits, contDigits = contDigits, pDigits = pDigits, minMax = minMax, showpm = showpm, addOverall = addOverall
catDigits = catDigits, contDigits = contDigits, pDigits = pDigits, minMax = minMax, showpm = showpm, addOverall = F
)


Expand Down

0 comments on commit d2431a2

Please sign in to comment.