[R] using a variable and a superscript in a legend

Patrick Giraudoux p@tr|ck@g|r@udoux @end|ng |rom un|v-|comte@|r
Sun Oct 20 14:28:27 CEST 2019


Dear listers,

I am trying to pass an expression inlcuding a variable and a 
superpscript to a legend. What I want to obtain is e.g. with densren = 1.25

1.25 ind./km^2

I have tried many variants of the following:

legend=bquote(.(densren) (ind./km)^2)

but if not errors, do obtain

1.25 (ind./km^2)

hence not what I want (no parenthesis, 2 in superscript...)

Any idea about a correct syntax to get what I need ?

Best,

Patrick


	[[alternative HTML version deleted]]



More information about the R-help mailing list