sobota, 26 marca 2016

VBA: Simple and excellent example of using R from Excel

Acomed Statistik from Leipzig! Thanks for this very simple example of using R from Excel with VBA - here to calculate data for a kernel density plot. I recommend studying this simple example and will certainly try to adapt it to my needs. http://www.acomed-statistics.com/simple-interface-r-excel_engl.html

Another interesting tutorial to show how to drive R scripts from Excel. http://shashiasrblog.blogspot.com/2013/10/vba-front-end-for-r.html

The quickest setup for R available in Excel (UDF's) functions working on Excel ranges, and the easiest one: http://bert-toolkit.com/
eg. I wrote these in BERT config file (a file in R format) to get clustering functionality
KMEANS_CLUST <- function( mat, ncenters ){ kmeans(mat,centers = ncenters) }


HTREE_CLUST<- function ( mat, cutheight ) {
    myclust<-hclust(dist(mat));
    myclust<-cutree(myclust,h=cutheight);             
    return(myclust)
    }
---

Brak komentarzy:

Prześlij komentarz