Skip to content

Commit

Permalink
added handling in f_title for I
Browse files Browse the repository at this point in the history
  • Loading branch information
trinker committed Sep 7, 2017
1 parent c37ceaa commit 8284054
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/f_title.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
f_title <- function (x, ...) {

nas <- is.na(x)
out <- gsub('(^.)', '\\U\\1', tools::toTitleCase(x), perl = TRUE)
out <- gsub('\\bi\\b', 'I', gsub('(^.)', '\\U\\1', tools::toTitleCase(x), perl = TRUE))

out[nas] <- NA
out
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ dat %>%
axis.title.y = element_text(angle = 0)
) +
labs(x = 'State', y = 'Cash\nFlow',
title = "Look at How Professional I Look",
title = f_title("look at how professional i look"),
subtitle = 'Subtitles: For that extra professional look.'
)
```
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ functions (see [Plotting](#plotting) for usage).

<!-- html table generated in R 3.4.1 by xtable 1.8-2 package -->

<!-- Wed Sep 06 21:26:07 2017 -->
<!-- Wed Sep 06 21:35:12 2017 -->

<table>

Expand Down Expand Up @@ -797,7 +797,7 @@ Plotting
axis.title.y = element_text(angle = 0)
) +
labs(x = 'State', y = 'Cash\nFlow',
title = "Look at How Professional I Look",
title = f_title("look at how professional i look"),
subtitle = 'Subtitles: For that extra professional look.'
)

Expand Down

0 comments on commit 8284054

Please sign in to comment.