[R] Graphic legend with mathematical symbol, numeric variable and character variable
ehlers at ucalgary.ca
Wed Mar 21 12:57:17 CET 2012
On 2012-03-20 06:09, "ECOTIÈRE David (Responsable d'activité) - CETE
Est/LRPC de Strasbourg/6 Acoustique" wrote:
> I'd like to make a legend with a mix of mathematical symbol (tau),
> numeric variable and character variables.I have tried :
> types<-c("Type 1","Type 2","Type 2")
> but it doesn't work: the 'tau' symbol is not written in its 'symbol
> style' but as 'tau'
> Any (good) idea ?
> Thank you in advance !
Does this do what you want:
types <- paste('Type', 1:3, sep='~')
mytau <- 4:6
leg <- parse(text=paste(types, "~~tau==", mytau, sep='~'))
The '~' symbols generate spaces; use more if you want more spacing.
More information about the R-help