Hello all,
Thanks for your answers! I'll give your suggestions a try later on today.
Cheers,
Léa
--
View this message in context:
http://r.789695.n4.nabble.com/Trouble-creating-and-adjacency-matrix-tp3842106p3843660.html
Sent from the R help mailing list archive at Nabble.com.
___
See end of message.
On 26/09/11 10:07, Spartina wrote:
Hello all,
I'm having trouble creating an adjacency matrix.
Basically, I need to turn the following distance matrix into an adjacency
matrix based on whether values are>1.5 or not. If they are>1.5, then the
returned value should be 0. If
Hi Léa,
Try
ifelse(DistanceMatrix > 1.5, 0, 1)
HTH,
Jorge
On Sun, Sep 25, 2011 at 5:07 PM, Spartina <> wrote:
> Hello all,
>
> I'm having trouble creating an adjacency matrix.
>
> Basically, I need to turn the following distance matrix into an adjacency
> matrix based on whether values are >1
Hello all,
I'm having trouble creating an adjacency matrix.
Basically, I need to turn the following distance matrix into an adjacency
matrix based on whether values are >1.5 or not. If they are >1.5, then the
returned value should be 0. If they are =<1.5, then the returned value
should be 1.
Di
x<-rnorm(25,1.5,1)
dim(x)=c(5,5)
x
y<-ifelse(c(x)>1.5,1,0)
dim(y)<-dim(x)
HTH,
Daniel
Spartina wrote:
>
> Hello all,
>
> I'm having trouble creating an adjacency matrix.
>
> Basically, I need to turn the following distance matrix into an adjacency
> matrix based on whether values are >1.5 o
5 matches
Mail list logo