Hi Hanna, That is because "dotplot" is a lattice graphics function and "legend" is a base graphics function. There are two things you can do to fix this. One is to use the "dotchart" function in base graphics. The other is to use simpleKey in the latticeExtra package for the legend.
Jim On Wed, Jun 3, 2015 at 1:06 PM, li li <hannah....@gmail.com> wrote: > Hi all, > I wanted to add the legend to a dotplot using legend funciton. If > does not seem to be working? Anyone have any suggestions? > Thanks! > Hanna > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.