igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] how to change x type attribute to numeric type attribute?


From: Fatemeh a
Subject: Re: [igraph] how to change x type attribute to numeric type attribute?
Date: Sat, 6 Dec 2014 17:33:44 +0330

Hi, 
Thank you Gabor,
Please consider this example , with the attached file :

               karate3=read.csv(file.choose(), header=TRUE, stringsAsFactors=FALSE,as.is=TRUE)
               karate3[,1]=as.numeric(as.character(karate3[,1])) 
               karate3[,2]=as.numeric(as.character(karate3[,2]))
               E(karate3)$weight <- 5

> karate3
IGRAPH UNW- 26 31 -- 
+ attr: name (v/c), weight (e/n)

              graph_simplify=simplify(karate3,remove.multiple = TRUE,edge.attr.comb=list(Weight="mean"))

> graph_simplify
IGRAPH UNW- 26 29 -- 
+ attr: name (v/c), weight (e/x)

> sum(E(karate3)$weight)
[1] 155
> sum(E(graph_simplify)$weight)
[1] 0


Regards,
Fatemeh

On Sat, Dec 6, 2014 at 5:18 PM, Gábor Csárdi <address@hidden> wrote:
Hi, we need a complete reproducible example to be able to help you.

Gabor

On Sat, Dec 6, 2014 at 6:54 AM, Fatemeh a <address@hidden> wrote:
Hi,

I was wondering how could I resolve this issue :
after using 
  graph_simplify=simplify(graph,remove.multiple = TRUE,edge.attr.comb=list(Weight="mean"))
and the type of the edge attribute weight
change from n(numeric) to x(other) and when i execute sum(E(graph)$weight) , I got zero , how should I change the x type attribute to numeric one ?

thank you in advance,

--
regards
F..A

_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help



_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help




--
regards
F..A

Attachment: karate3.csv
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]