Re: [R] converting an R function into VBA

2008-06-21 Thread Kenn Konstabel
Can't you just import data from Excel using RODBC, then use your function in R, and then write the results to Excel again? It would be much less painful than doing it in VBA... Otherwise, look for MMult and Transpose and similar things in VB help, and then ask some VB experts... Kenn On Sat, Jun

[R] converting an R function into VBA

2008-06-21 Thread Eric yang
Hi everyone, I want to convert an R function into VBA for calculating the eigenvectors and eigenvalues of a matrix using the "Power Method". The function is: PowerMethod <- function(x, tolerance) {     my.mat <- var(x[,-1], na.method="available")     matSize <- dim(my.mat)[1]     eigenVec <- ma