Hello,
I want to change the facet_wrap labels, because the parameters have subscripts and superscripts. I tried to create the labels and use label_parsed, but it didn't work.
Can anyone help?
facet_wrap() has an option to rewrite the facet labels. It is a bit unintuitive as it requires a special function called a labeller. But it's very easy to create using as_labeller(). You just need to provide a named vector that gets used as lookup table. For example:
But you have an additional difficulty: you want your labels to contain subscripts and superscripts. So you have to tell as_labeller() that it will need to parse the labels you provide, using its second argument (the default labeller):
I don't understand your question exactly. Do you mean how to use those who already have a symbol such as °?
If that's the case, I don't have a good solution (perhaps label_bquote(), but I can't figure out how to use it here). I would go with replacing these characters beforehand:
Hello,
The variables in the database were like symbols, so I replaced them with letters and ran the first command suggested by Alexis again, using the name of the symbols (gamma, eta ...)
I also removed the spaces, as they were generating the above error.
In some cases I had to add the symbol "*" between the symbol name and the letter. Now it worked perfectly. = D
Thank you for your help!!
Yeah I should have insisted on that strange quirk of plotmath where you need * to keep symbols together and ~ to add a space. I'm not sure where that decision comes from.