Skip to content

Commit

Permalink
Resolves a bug where survival_plot function does not display the Y-ax…
Browse files Browse the repository at this point in the history
…is percentage correctly
  • Loading branch information
benben-miao committed Jan 10, 2024
1 parent 6cbc207 commit afd29aa
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: TOmicsVis
Type: Package
Title: TOmicsVis An All-in-One Transcriptomic Analysis and Visualization R Package with shinyapp Interface
Version: 2.0.0
Version: 2.1.1
Authors@R: c(
person(given = "Benben", family = "Miao", email = "[email protected]",
role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7307-1331")),
Expand Down
14 changes: 13 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
## TOmicsVis 2.0.0
## TOmicsVis 2.1.1

**Date**: 2024-01-10

<span style="background-color: green; border-radius: 10px; padding: 0px 5px; font-weight: bold; color: white;">New Features:</span>

<span style="background-color: red; border-radius: 10px; padding: 0px 5px; font-weight: bold; color: white;">Bugs Fixed:</span>

1. Resolves a bug where `?TOmicsVis::survival_plot` function does not display the Y-axis percentage correctly.

---

## TOmicsVis 2.1.0

**Date**: 2023-10-16

Expand Down
20 changes: 11 additions & 9 deletions R/survival_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#' @param y_start Numeric: y-axis start value. Default: 0, min: 0, max: 100.
#' @param y_end Numeric: y-axis end value. Default: 100, min: 0, max: 100.
#' @param x_break Numeric: x-axis break value. Default: 10, min: 0, max: null.
#' @param y_break Numeric: y-axis break value. Default: 10, min: 0, max: 100.
#'
#' @import ggplot2
#' @import ggsci
Expand Down Expand Up @@ -51,8 +50,8 @@ survival_plot <- function(data,
x_start = 0,
y_start = 0,
y_end = 100,
x_break = 10,
y_break = 10
x_break = 10
# y_break = 10
){
# -> 2. Data
data <- as.data.frame(data)
Expand Down Expand Up @@ -147,25 +146,28 @@ survival_plot <- function(data,
fit,
data = data,
fun = curve_function,
risk.table = risk_table,
pval = TRUE,
conf.int = conf_inter,
conf.int.style = interval_style,
size = 1,
# conf.int.alpha = 0.50,
pval = TRUE,
pval.method = FALSE,
xlab = "Time",
ylab = "Survival probability",
ggtheme = gg_theme,
risk.table.y.text.col = TRUE,
risk.table = risk_table,
risk.table.height = 0.25,
risk.table.y.text = TRUE,
risk.table.y.text.col = TRUE,
ncensor.plot = num_censor,
ncensor.plot.height = 0.25,
cumevents = FALSE,
cumcensor = FALSE,
surv.median.line = "hv",
palette = sci_palette,
xlim = c(x_start, xLimEnd),
ylim = c(y_start, y_end),
break.x.by = x_break,
break.y.by = y_break
break.x.by = x_break
# break.y.by = y_break
)
# p
# # <- 4. Plot
Expand Down
5 changes: 1 addition & 4 deletions man/survival_plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit afd29aa

Please sign in to comment.