renjin
renjin copied to clipboard
apply rowwise max is very slow
The following command needs for a 65700x2 matrix more than 30 seconds in renjin.
apply(fprob[1:nrow(fprob),],1,max)
Here is the fprob object: maxslowRData.zip
In R it is done in a couple of seconds. I'm using Renjin 0.8.2356
What is the reason?
Best, Thorsten
Good question! The indexing on fprob might be getting deferred... in which case it's possible something is going wrong. Will check it out. Thanks for the benchmark!
Any progress here? At the moment this is really a bottle neck for me :-( Or are there any alternative to do it faster?
Try pmax(fprob[,1], fprob[,2])
since it looks like your trying to find the largest value in each row.
If the number of columns is variable, you can do
do.call(pmax, lapply(seq(ncol(fprob)), function(col) fprob[,col]))
Thanks! This works perfectly!!!