[R] Greek letters with subscript numbers on x-axis

Frank S. f_j_rod at hotmail.com
Wed Jun 3 21:39:07 CEST 2015


Hi everyone, I have allocated greek letters with subscript numbers on x-axis of my R plot this way:
 plot(10:18, 30:38, lwd=2, xlim=c(10,18), ylim=c(30,38),  xaxt="n",  xlab="weights", ylab="value")
points(10:18, 30:38, pch=19)
axis(1, at=10:18, labels=c(expression(hat(lambda)[1]), expression(hat(lambda)[2]), expression(hat(lambda)[3]),
      expression(hat(lambda)[4]),expression(hat(lambda)[5]),expression(hat(lambda)[6]),
      expression(hat(lambda)[7]),expression(hat(lambda)[8]),expression(hat(lambda)[9])),  padj = 0.25) However, as you see in the last lines, it's not an efficient code. I think it could be done more efficiently with a loop. I've searched about this question and I've found some very similar question, but the given answer does not work (with do.call and lapply). Maybe another functions like substitute or parse. Does anybody can help me? Thanks a bunch!! Frank S. 		 	   		  
	[[alternative HTML version deleted]]



More information about the R-help mailing list