How do I right-align text and symbols in my legend box when specifying "topright." : Basically I want my legend to be in a box on the top right corner of my plot, and have all my text right-aligned, not left aligned. 

I'd also like the symbols to be on the right rather than the left side of the legend, if possible.

I tried using xjust which did not work for me.

  
  legend("topright", legend=c("data", "data", "data", 
                              "data", "data",
                              "data",
                              "data", 
                              "data", 
                              "data",
                              "data",
                              "data"),
         ncol=1,
         lty = c(1,NA,NA,NA,NA,1,1,1,2,2,2), 
         pch=c(NA, sym[1],sym[2],sym[2],sym[3], 19, 17, 15, 19, 17, 15), 
         col= c(blue, aa, aa, aa, aa, gr, bl, pu, gr, bl, pu),
         pt.bg = c(NA,a,b,c,d,NA,NA,NA,NA,NA,NA), 
         pt.cex = c(NA, 1, 1, 1, 1,.5,.5,.5,.5,.5,.5),
         cex=.75, 
         lwd=c(2,NA,NA,NA,NA,1,1,1,1,1,1),
         text.col="black"
         
  )