Skip to content

Substituting vectors into a legend

2 messages · Bob O'Hara, David Winsemius

#
On Nov 12, 2009, at 4:59 AM, Bob O'Hara wrote:

            
#  First:
library(fortunes)
fortune("dog")

Searching in R-search reveals that Bill Dunlap has offered a few  
solutions to prior such questions. This is an adaptation of the  
shortest solution from:
http://finzi.psych.upenn.edu/Rhelp08/2009-August/209677.html

mu1=1:3   #
Mean=rep(mu1, each=20)
plot(runif(60), rnorm(60,Mean,0.1), pch=Mean) # create a plot
legend(0.6,1.7, as.expression(lapply(mu1, function(m) bquote(mu==. 
(m)))), pch=mu1)