Skip to content

Commit

Permalink
0.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jinseob2kim committed Aug 4, 2023
1 parent fa358d1 commit 22f2ccb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: jskm
Title: Kaplan-Meier Plot with 'ggplot2'
Version: 0.5.1
Date: 2023-07-26
Version: 0.5.2
Date: 2023-08-04
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
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# jskm 0.5.2

* Update: Add `linewidth` option

# jskm 0.5.1

* Fix: line color problem when apply landmark analysis
Expand Down
6 changes: 4 additions & 2 deletions R/jskm.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#' @param cut.landmark cut-off for landmark analysis, Default = NULL
#' @param showpercent Shows the percentages on the right side.
#' @param status.cmprsk Status value when competing risk analysis, Default = 2nd level of status variable
#' @param linewidth Line witdh, Default = 0.75
#' @param ... PARAM_DESCRIPTION
#' @return Plot
#' @details DETAILS
Expand Down Expand Up @@ -109,6 +110,7 @@ jskm <- function(sfit,
cut.landmark = NULL,
showpercent = F,
status.cmprsk = NULL,
linewidth = 0.75,
...) {


Expand Down Expand Up @@ -347,13 +349,13 @@ jskm <- function(sfit,

#Add lines too plot
if (is.null(cut.landmark)){
p <- p + geom_step(linewidth = 0.75) +
p <- p + geom_step(linewidth = linewidth) +
scale_linetype_manual(name = ystrataname, values=linetype) +
scale_colour_brewer(name = ystrataname, palette=linecols)
} else{
p <- p +
scale_linetype_manual(name = ystrataname, values=linetype) +
geom_step(data = subset(df, time >= cut.landmark), linewidth = 0.75) + geom_step(data = subset(df, time < cut.landmark), linewidth = 0.75) +
geom_step(data = subset(df, time >= cut.landmark), linewidth = linewidth) + geom_step(data = subset(df, time < cut.landmark), linewidth = linewidth) +
scale_colour_brewer(name = ystrataname, palette=linecols)
}

Expand Down
6 changes: 4 additions & 2 deletions R/svyjskm.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#' @param size.label.nrisk Font size of label.nrisk. Default = 10
#' @param cut.landmark cut-off for landmark analysis, Default = NULL
#' @param showpercent Shows the percentages on the right side.
#' @param linewidth Line witdh, Default = 0.75
#' @param ... PARAM_DESCRIPTION
#' @return plot
#' @details DETAILS
Expand Down Expand Up @@ -74,6 +75,7 @@ svyjskm <- function(sfit,
size.label.nrisk = 10,
cut.landmark = NULL,
showpercent = F,
linewidth = 0.75,
...) {

surv <- strata <- lower <- upper <- NULL
Expand Down Expand Up @@ -276,11 +278,11 @@ svyjskm <- function(sfit,

#Add lines too plot
if (is.null(cut.landmark)){
p <- p + geom_step(linewidth = 0.75) +
p <- p + geom_step(linewidth = linewidth) +
scale_linetype_manual(name = ystrataname, values=linetype) +
scale_colour_brewer(name = ystrataname, palette=linecols)
} else{
p <- p + geom_step(data = subset(df, time < cut.landmark), linewidth = 0.75) + geom_step(data = subset(df, time >= cut.landmark), linewidth = 0.75) +
p <- p + geom_step(data = subset(df, time < cut.landmark), linewidth = linewidth) + geom_step(data = subset(df, time >= cut.landmark), linewidth = linewidth) +
scale_linetype_manual(name = ystrataname, values=linetype) +
scale_colour_brewer(name = ystrataname, palette=linecols)
}
Expand Down

0 comments on commit 22f2ccb

Please sign in to comment.