Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
jinseob2kim committed Sep 12, 2020
1 parent 2ef76ec commit 94d5203
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion 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: 0.9.7
Date: 2020-09-01
Date: 2020-09-12
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"))
)
Expand Down
10 changes: 8 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# jstable 0.9.7

* Bugfix `TableSubgroupCox`: apply `extend = T` option to `summary.survfit`
## Bugfix

* Update `CreateTableOneJS`, `svyCreateTableOneJS`: Add `showpm` option to show normal distributed continuous variables as Mean ± SD.
* `TableSubgroupCox`: apply `extend = T` option to `summary.survfit`

* `LabelepiDisplay`, `LabeljsTable` with only 1 independent variable.

## Update

* `CreateTableOneJS`, `svyCreateTableOneJS`: Add `showpm` option to show normal distributed continuous variables as Mean ± SD.


# jstable 0.9.6
Expand Down
8 changes: 5 additions & 3 deletions R/label.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ LabelepiDisplay = function(epiDisplay.obj, label = F, ref){
cond.lv2 <- grepl(":", rownames(tb.compact)[1]) & grepl("vs", rownames(tb.compact)[1])
rownames(tb.compact) <- gsub(vname, ref[variable == vname, var_label][1], rownames(tb.compact))
if (cond.lv2){
lv2 <- strsplit(strsplit(rownames(tb.compact)[1], ": ")[[1]][[2]], " vs ")[[1]]
vll <- ref[variable == vname & level %in% lv2, c("level", "val_label")]
rownames(tb.compact) <- gsub(paste(vll[level == lv2[1], level], " vs ", vll[level == lv2[2], level], sep=""), paste(vll[level == lv2[1], val_label], " vs ", vll[level == lv2[2], val_label], sep=""), rownames(tb.compact))
rownames(tb.compact) <- paste(ref[variable == vname, var_label][1], ": ", vll[level == lv2[1], val_label], " vs ", vll[level == lv2[2], val_label], sep = "")
}
}

Expand Down Expand Up @@ -180,9 +181,10 @@ LabeljsTable = function(obj.table, ref){
cond.lv2 <- grepl(":", rownames(tb.compact)[1]) & grepl("vs", rownames(tb.compact)[1])
rownames(tb.compact) <- gsub(vname, ref[variable == vname, var_label][1], rownames(tb.compact))
if (cond.lv2){
lv2 <- strsplit(strsplit(rownames(tb.compact)[1], ": ")[[1]][[2]], " vs ")[[1]]
vll <- ref[variable == vname & level %in% lv2, c("level", "val_label")]
rownames(tb.compact) <- gsub(paste(vll[level == lv2[1], level], " vs ", vll[level == lv2[2], level], sep=""), paste(vll[level == lv2[1], val_label], " vs ", vll[level == lv2[2], val_label], sep=""), rownames(tb.compact))
}
rownames(tb.compact) <- paste(ref[variable == vname, var_label][1], ": ", vll[level == lv2[1], val_label], " vs ", vll[level == lv2[2], val_label], sep = "")
}

}

Expand Down

0 comments on commit 94d5203

Please sign in to comment.