Re: [R] Best way to store negative indexes

From: Adaikalavan Ramasamy <ramasamy_at_cancer.org.uk>
Date: Wed 28 Jul 2004 - 10:47:13 EST

Do you mean something like
  abs( my_vector[i] - my_vector[j] )

See if reading help("subset") helps.

On Wed, 2004-07-28 at 01:42, StephaneDemurget wrote:
> 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
>



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:57:19 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:18 EST