[R] Best way to store negative indexes

From: StephaneDemurget <demurget_at_aleks.com>
Date: Wed 28 Jul 2004 - 10:42:30 EST


Hi,

I'm trying to figure out how to properly construct a graph of frequencies of a difference between 2 values, that is | i | - | j |. I'd like to know the best way to store the actual data because of course doing my_vector[i -j] will not work because the index could be negative.

I know there's no hash table so what's the best solution, simplicity-wise ? Use a list of pair of values {index, i - j} ? Or can I somehow use negative index, perhaps using 0array ? Any help would be appreciated :)

ATM, I use as.character (i-j) to index my data, but I lose all the processing power of R there after.

Sorry If it's written somewhere, but I read a lot of docs about it, searched through the ML archives and didn't manage to find an answer.

Please also answer me back at my email address as I am not subscribed to the list.

Best regards,

--Stephane



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jul 28 10:44:08 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 02:40:22 EST