PlotAdaptiveReg = function(fit){
plot(fit$R2,type="l",xlab="Number of eigenvectors",ylab=expression(R^2),
main=paste("Optimal number of latent factors: ",fit$nv,sep=""))
abline(v=fit$nv,col="red",lty=2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.