Skip to content

Commit 7114224

Browse files
Apply automatic stylistic changes
1 parent 38bb977 commit 7114224

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

R/jskm.R

+9-7
Original file line numberDiff line numberDiff line change
@@ -380,20 +380,22 @@ jskm <- function(sfit,
380380
geom_step(data = subset(df, time >= cut.landmark), linewidth = linewidth) + geom_step(data = subset(df, time < cut.landmark), linewidth = linewidth)
381381
}
382382

383-
brewer.palette <- c("BrBG", "PiYG", "PRGn", "PuOr", "RdBu", "RdGy", "RdYlBu", "RdYlGn", "Spectral", "Accent", "Dark2", "Paired", "Pastel1", "Pastel2",
384-
"Set1", "Set2", "Set3", "Blues", "BuGn", "BuPu", "GnBu", "Greens", "Greys", "Oranges", "OrRd", "PuBu", "PuBuGn", "PuRd", "Purples",
385-
"RdPu", "Reds", "YlGn", "YlGnBu", "YlOrBr", "YlOrRd")
386-
383+
brewer.palette <- c(
384+
"BrBG", "PiYG", "PRGn", "PuOr", "RdBu", "RdGy", "RdYlBu", "RdYlGn", "Spectral", "Accent", "Dark2", "Paired", "Pastel1", "Pastel2",
385+
"Set1", "Set2", "Set3", "Blues", "BuGn", "BuPu", "GnBu", "Greens", "Greys", "Oranges", "OrRd", "PuBu", "PuBuGn", "PuRd", "Purples",
386+
"RdPu", "Reds", "YlGn", "YlGnBu", "YlOrBr", "YlOrRd"
387+
)
388+
387389
if (!is.null(theme) && theme == "jama") {
388390
col.pal <- c("#00AFBB", "#E7B800", "#FC4E07")
389-
col.pal <- rep(col.pal, ceiling(length(ystratalabs)/3))
391+
col.pal <- rep(col.pal, ceiling(length(ystratalabs) / 3))
390392
} else if (all(linecols %in% brewer.palette)) {
391393
col.pal <- NULL
392394
} else {
393395
col.pal <- linecols
394-
col.pal <- rep(col.pal, ceiling(length(ystratalabs)/length(linecols)))
396+
col.pal <- rep(col.pal, ceiling(length(ystratalabs) / length(linecols)))
395397
}
396-
398+
397399
if (is.null(col.pal)) {
398400
p <- p + scale_colour_brewer(name = ystrataname, palette = linecols)
399401
} else {

R/svyjskm.R

+10-8
Original file line numberDiff line numberDiff line change
@@ -317,26 +317,28 @@ svyjskm <- function(sfit,
317317
scale_linetype_manual(name = ystrataname, values = linetype)
318318
}
319319

320-
brewer.palette <- c("BrBG", "PiYG", "PRGn", "PuOr", "RdBu", "RdGy", "RdYlBu", "RdYlGn", "Spectral", "Accent", "Dark2", "Paired", "Pastel1", "Pastel2",
321-
"Set1", "Set2", "Set3", "Blues", "BuGn", "BuPu", "GnBu", "Greens", "Greys", "Oranges", "OrRd", "PuBu", "PuBuGn", "PuRd", "Purples",
322-
"RdPu", "Reds", "YlGn", "YlGnBu", "YlOrBr", "YlOrRd")
323-
320+
brewer.palette <- c(
321+
"BrBG", "PiYG", "PRGn", "PuOr", "RdBu", "RdGy", "RdYlBu", "RdYlGn", "Spectral", "Accent", "Dark2", "Paired", "Pastel1", "Pastel2",
322+
"Set1", "Set2", "Set3", "Blues", "BuGn", "BuPu", "GnBu", "Greens", "Greys", "Oranges", "OrRd", "PuBu", "PuBuGn", "PuRd", "Purples",
323+
"RdPu", "Reds", "YlGn", "YlGnBu", "YlOrBr", "YlOrRd"
324+
)
325+
324326
if (!is.null(theme) && theme == "jama") {
325327
col.pal <- c("#00AFBB", "#E7B800", "#FC4E07")
326-
col.pal <- rep(col.pal, ceiling(length(ystratalabs)/3))
328+
col.pal <- rep(col.pal, ceiling(length(ystratalabs) / 3))
327329
} else if (all(linecols %in% brewer.palette)) {
328330
col.pal <- NULL
329331
} else {
330332
col.pal <- linecols
331-
col.pal <- rep(col.pal, ceiling(length(ystratalabs)/length(linecols)))
333+
col.pal <- rep(col.pal, ceiling(length(ystratalabs) / length(linecols)))
332334
}
333-
335+
334336
if (is.null(col.pal)) {
335337
p <- p + scale_colour_brewer(name = ystrataname, palette = linecols)
336338
} else {
337339
p <- p + scale_color_manual(name = ystrataname, values = col.pal)
338340
}
339-
341+
340342
# Add 95% CI to plot
341343
if (ci == TRUE) {
342344
if (all(linecols2 == "black")) {

0 commit comments

Comments
 (0)