[R] Computing the power of a matrix efficiently and accurately

2010-07-17 Thread Miguel Lacerda
on in the Malmig package, although repeatedly calling this function is not efficient as I need to extract the m-th row of the matrix raised to each power from 1:n. Any suggestions? Could I possibly exploit the fact that X is tridiagonal in my application? Thanks! Miguel -- Miguel Lacerda

[R] Background colour of axis

2009-07-21 Thread Miguel Lacerda
Hi, I would like to be able to shade the background of part of an axis. To illustrate, consider the following code: par(xaxt="n") x=1:10 y=rnorm(10,0,1) plot(x,y,type="l",xlab=NA) mtext(text=LETTERS[1:10], side=1, at=1:10) How can I make the background behind, say, "G H I" on the x-axis red? I h