Skip to content

Commit 22f2ccb

Browse files
committed
0.5.2
1 parent fa358d1 commit 22f2ccb

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: jskm
22
Title: Kaplan-Meier Plot with 'ggplot2'
3-
Version: 0.5.1
4-
Date: 2023-07-26
3+
Version: 0.5.2
4+
Date: 2023-08-04
55
Authors@R: c(person("Jinseob", "Kim", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9403-605X")),
66
person("Zarathu", role = c("cph", "fnd"))
77
)

NEWS.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# jskm 0.5.2
2+
3+
* Update: Add `linewidth` option
4+
15
# jskm 0.5.1
26

37
* Fix: line color problem when apply landmark analysis

R/jskm.R

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#' @param cut.landmark cut-off for landmark analysis, Default = NULL
3434
#' @param showpercent Shows the percentages on the right side.
3535
#' @param status.cmprsk Status value when competing risk analysis, Default = 2nd level of status variable
36+
#' @param linewidth Line witdh, Default = 0.75
3637
#' @param ... PARAM_DESCRIPTION
3738
#' @return Plot
3839
#' @details DETAILS
@@ -109,6 +110,7 @@ jskm <- function(sfit,
109110
cut.landmark = NULL,
110111
showpercent = F,
111112
status.cmprsk = NULL,
113+
linewidth = 0.75,
112114
...) {
113115

114116

@@ -347,13 +349,13 @@ jskm <- function(sfit,
347349

348350
#Add lines too plot
349351
if (is.null(cut.landmark)){
350-
p <- p + geom_step(linewidth = 0.75) +
352+
p <- p + geom_step(linewidth = linewidth) +
351353
scale_linetype_manual(name = ystrataname, values=linetype) +
352354
scale_colour_brewer(name = ystrataname, palette=linecols)
353355
} else{
354356
p <- p +
355357
scale_linetype_manual(name = ystrataname, values=linetype) +
356-
geom_step(data = subset(df, time >= cut.landmark), linewidth = 0.75) + geom_step(data = subset(df, time < cut.landmark), linewidth = 0.75) +
358+
geom_step(data = subset(df, time >= cut.landmark), linewidth = linewidth) + geom_step(data = subset(df, time < cut.landmark), linewidth = linewidth) +
357359
scale_colour_brewer(name = ystrataname, palette=linecols)
358360
}
359361

R/svyjskm.R

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#' @param size.label.nrisk Font size of label.nrisk. Default = 10
2828
#' @param cut.landmark cut-off for landmark analysis, Default = NULL
2929
#' @param showpercent Shows the percentages on the right side.
30+
#' @param linewidth Line witdh, Default = 0.75
3031
#' @param ... PARAM_DESCRIPTION
3132
#' @return plot
3233
#' @details DETAILS
@@ -74,6 +75,7 @@ svyjskm <- function(sfit,
7475
size.label.nrisk = 10,
7576
cut.landmark = NULL,
7677
showpercent = F,
78+
linewidth = 0.75,
7779
...) {
7880

7981
surv <- strata <- lower <- upper <- NULL
@@ -276,11 +278,11 @@ svyjskm <- function(sfit,
276278

277279
#Add lines too plot
278280
if (is.null(cut.landmark)){
279-
p <- p + geom_step(linewidth = 0.75) +
281+
p <- p + geom_step(linewidth = linewidth) +
280282
scale_linetype_manual(name = ystrataname, values=linetype) +
281283
scale_colour_brewer(name = ystrataname, palette=linecols)
282284
} else{
283-
p <- p + geom_step(data = subset(df, time < cut.landmark), linewidth = 0.75) + geom_step(data = subset(df, time >= cut.landmark), linewidth = 0.75) +
285+
p <- p + geom_step(data = subset(df, time < cut.landmark), linewidth = linewidth) + geom_step(data = subset(df, time >= cut.landmark), linewidth = linewidth) +
284286
scale_linetype_manual(name = ystrataname, values=linetype) +
285287
scale_colour_brewer(name = ystrataname, palette=linecols)
286288
}

0 commit comments

Comments
 (0)