r plot text adding variable for text to be bolded

In the example below, the variable holds the letter a. But the legend in legend just returns temp rather than a bolded a. How to make this work like it 'should'?

a <- 2
b <- 5
temp <- letters[1]
temp
plot(a,b)

legend("topleft", legend = c(as.expression(bquote(bold(get(temp)))),
                             as.expression(bquote(temp))))


Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept