[R] Graph in R with edge weights

2010-12-01 Thread arturs . onzuls
Can you please show code example, how to draw graph with some nodes and
edges, but with weights. I only found here
http://www.bioconductor.org/packages/release/bioc/vignettes/Rgraphviz/inst/doc/Rgraphviz.pdf-
Using edge weights for labels, but...

Here an example:

 library(graph); library(Rgraphviz)
 myNodes = c(s, p, q, r)
 myEdges = list(
s = list(edges = c(p, q)),
p = list(edges = c(p, q)),
q = list(edges = c(p, r)),
r = list(edges = c(s)))
 g = new(graphNEL, nodes = myNodes,
edgeL = myEdges, edgemode =
directed)
 plot(g)

but how about weights?


Thanx.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Working with necessary columns in R (CSV)

2010-11-17 Thread arturs . onzuls
Hi all. It will be great if some one will help me to solve my home task. So,
the deal : i have .pcap file, i convert it to csv using tcpdump (tcpdump -tt
-n -r x.pcap  x.csv)

CSV file looks like that :

12890084,761659 IP 10.10.20.20.47808  10.10.20.255.47808: UDP, length 12
12890084,761659 IP 10.10.20.20.47808  10.10.20.255.47808: TCP, length 12
12890084,761659 IP 10.10.20.20.47808  10.10.20.255.47808: HTML, length 12
...

10 rows.

Now, i need to open csv in R, and solve 5 problems, but i need to work only
with UDP packets (not TCP,HTMP...). For example i need to count how many
UDP packets are there, max and min time in UDP and so on. I see only two
answers.. i need to scan (but how?) for UDP or i need to separate this
csv, cut only needed rows, and work with them. Please help.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.