The data file is here.
Here are my codes:
> ftable=read.table(file.choose()) > start.time=Sys.time() > 1-length(which(ftable==1))/sum(ftable)  0.12 > end.time=Sys.time() > end.time-start.time Time difference of 0.004880905 secs
I understand that 0.00488 secs are not a lot. But I have to repeatedly do this calculation over different and larger tables. I am wondering if the function '
which' can be replaced by a more efficient one.
Thanks in advance!
Note: This piece of codes is to calculate the percentage of singletons in ftable. If there is a more efficient way, please let me know. Thank you!