This question raised by trying to solve this one How to write partial string of X labels in italics using ggplot2?:
I want to know how we could only italicize characters in a string that are lower case:
string <- "wbfV/wcvB"
[1] "wbfV/wcvB"
Desired output:
- wbfV/wcvB
Background: I would like to use it then for labelling in a plot.
I thought to do it like this way, but obviously it is not working:
library(stringr)
expression(str_detect(string, '[a-z]'~italic(str_detect(string, '[A-Z]'))))
which I tried to label
plot(1, xlab=expression(str_detect(string, '[a-z]'~italic(str_detect(string, '[A-Z]')))))