Make code run faster with R

29 views
Skip to first unread message

euthymios kasvikis

unread,
Jan 17, 2016, 8:50:07 PM1/17/16
to Cambridge R user group
Hello guys i have this code and i have to run it 15 times on the same app which makes it very slow.Iassume that i need a kind of parallel processing.Any suggestions?


library("SportsAnalytics")
library("archetypes")
library("RColorBrewer")
library("googleVis")
col_pal <- brewer.pal(7, "Set1")
col_black <- rgb(0, 0, 0, 0.2)
dat <- subset(DatabaseEuroleague,
                select = -c(FGPerc,TwoPPerc,ThreePPerc,FTPerc,TOT))

mat <- as.data.frame(subset(dat, select = -c(Year,Name,Team)))

MAT <- na.exclude(mat)
DAT <- na.exclude(dat)
set.seed(4321)
as <- stepArchetypes(MAT, k = 1:10)

Laurent

unread,
Feb 15, 2016, 6:24:14 AM2/15/16
to Cambridge R user group
Start by identifying what command is the slowest - then you know where to look for improvement. I would bet on stepArchetypes.

Laurent
Reply all
Reply to author
Forward
0 new messages