Displaying 1 result from an estimated 1 matches for "dailytopn".
2004 Dec 20
1
faster row by row data frame processing
...have a working solution (below), however I find it rather slow. Is
there something I could do to increase the speed? (The code is
CPU-bound; Pentium 4 @ 2.4 GHz, 512 MB RAM, Win XP, R 2.0.0.)
Thank you,
b.
#all is the original data frame (date + a number of columns)
#set up the output data frame
DailyTopN <- data.frame(all[1,1],matrix(ncol=ncol(all)-1))
names(DailyTopN) <- names(all)
top <- 20
for (i in 1:1000) #the rows to be processed
{
#data frame row as vector
onerow <- na.omit(as.matrix(all[i,][2:ncol(all)])[1, ])
#select the 'top' highest absolute values
r <- rank(a...