1

I wonder how to put a check mark symbol in parentheses i.e., (symbol(("\326"))) next to the main text of an R plot's main argument?

plot(1:10, main = paste("bbb", bquote(symbol(("\326")))), col.main = 2)
  • Do you want to bold the symbols or 'bbb'. Perhaps `plot(1:10, main = bquote(bold("bbb"~symbol(("\326")))), col.main = 2)` – akrun Nov 12 '19 at 19:47

1 Answers1

1

We don't need paste with bquote. When we use paste with bquote, it is converting it to literal strings and the evaluation is not happening. Instead, pass the string "bbb" inside the bquote and use connectors (~) to add a space

plot(1:10, main = bquote("bbb"~symbol(("\326"))), col.main = 2)

enter image description here


Another option if we need paste is expression

plot(1:10, main = expression(paste("bbb ", symbol(("\326")))), col.main = 2)
akrun
  • 874,273
  • 37
  • 540
  • 662
  • @Reza An option with `tidyverse` would be `pivot_longer(f, cols = -id) %>% count(id, name, value) %>% filter(n == 1) %>% select(-n) %>% group_by(id, name) %>% filter(n() == 1)` – akrun Nov 15 '19 at 19:17
  • Arun, I'm sure yo'll like this [data.frame question](https://stackoverflow.com/questions/58885625/class-changes-from-data-frame-to-integer-after-na-removal-in-r)? –  Nov 15 '19 at 22:45