Skip to content

Commit d2cc05c

Browse files
authored
Merge pull request #52 from neilstats/fix
fix bug with ggtitle
2 parents bd1c6c2 + 1cb03b9 commit d2cc05c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Title: Create CKB Plots
33
Description: ckbplotr provides functions to help create and style plots in R.
44
It is being developed by, and primarily for, China Kadoorie Biobank
55
researchers.
6-
Version: 0.6.0
6+
Version: 0.6.1
77
Authors@R:
88
person(given = "Neil",
99
family = "Wright",

R/make_shape_plot.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,12 @@ make_shape_plot <- function(data,
369369
codetext$titles <- c(
370370
'# Add titles',
371371
sprintf('xlab("%s") +', xlab),
372-
sprintf('ylab("%s")', ylab),
373-
sprintf('+ ggtitle("%s")', title),
372+
if (!is.null(title) && !title %in% c("", NA)){
373+
c(sprintf('ylab("%s") +', ylab),
374+
sprintf('ggtitle("%s")', title))
375+
} else {
376+
sprintf('ylab("%s")', ylab)
377+
},
374378
''
375379
)
376380

0 commit comments

Comments
 (0)