removeEdge: strange error
3
0
Entering edit mode
Dan Bebber ▴ 50
@dan-bebber-1711
Last seen 9.7 years ago
Hello, I am having problems removing multiple edges from graphs. When I try to remove many edges, I get 'Error: subscript out of bounds', despite the fact that there are enough edges in the graph. An example follows: library(graph) #load library From<-c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, #these are the 'from' nodes 2, 5, 5, 8, 8, 8, 8, 8, 11, 11, 12, 12, 12, 14, 14, 16, 16, 20, 20, 23, 23, 24, 24, 25, 25, 29, 29, 32, 32, 32, 32, 38, 38, 41, 41, 41, 43, 43, 54, 54, 59, 59, 60, 68, 68, 69, 72, 82, 83, 88, 88, 88, 88, 89, 89, 90, 90, 96, 97, 98, 98, 98) To<-c(2, 5, 8, 11, 12, 14, 16, 20, 23, 37, 38, 54, 57, 68, 72, 81, #these are the 'to' nodes 86, 87, 97, 88, 100, 32, 102, 38, 41, 49, 51, 53, 58, 59, 60, 63, 67, 71, 72, 75, 76, 84, 85, 24, 29, 25, 28, 26, 27, 30, 31, 33, 34, 35, 36, 40, 41, 42, 43, 47, 44, 45, 55, 56, 60, 62, 61, 70, 71, 71, 73, 84, 84, 89, 90, 93, 94, 97, 141, 95, 141, 141, 98, 99, 141, 158) FT<-matrix(c(From,To),nc=2) #create a 'from-to' matrix g<-ftM2graphNEL(FT,edgemode="undirected") #generate the graph g gr<-removeEdge(from=as.character(From[1:2]),to=as.character(To[1:2]),g ) #this works, and removes 2 edges gr gr<-removeEdge(from=as.character(From[1:20]),to=as.character(To[1:20]) ,g) #this gives 'Error: subscript out of bounds' Thanks, Dan Bebber ________________________ Dr. Daniel P. Bebber Department of Plant Sciences University of Oxford South Parks Road Oxford OX1 3RB UK Tel. 01865 275060
graph graph • 981 views
ADD COMMENT
0
Entering edit mode
Seth Falcon ★ 7.4k
@seth-falcon-992
Last seen 9.7 years ago
Hi Dan, "Dan Bebber" <danbebber at="" forestecology.co.uk=""> writes: > I am having problems removing multiple edges from graphs. > When I try to remove many edges, I get 'Error: subscript out of bounds', > despite the fact that there are enough edges in the graph. > An example follows: Thanks for the reproducible example. I'm investigating. It is a bug. A work around for now is to do the edge removals serially: gr <- g for (i in 1:20) { gr <- removeEdge(from=as.character(From[i]), to=as.character(To[i]), gr) } Will try to have a fix available soon. + seth
ADD COMMENT
0
Entering edit mode
Seth Falcon ★ 7.4k
@seth-falcon-992
Last seen 9.7 years ago
Hi again, I believe that I've identified the culprit and have committed a fix to svn. Look for graph_1.11.19 (should hit the repositories in < 48hrs). Thanks again for the bug report. Best, + seth
ADD COMMENT
0
Entering edit mode
Dan Bebber ▴ 50
@dan-bebber-1711
Last seen 9.7 years ago
Seth, thanks very much for the rapid response. Dan ----- Original Message ----- From: "Seth Falcon" <sfalcon@fhcrc.org> To: "Dan Bebber" <danbebber at="" forestecology.co.uk=""> Cc: <bioconductor at="" stat.math.ethz.ch=""> Sent: Friday, September 22, 2006 1:25 AM Subject: Re: [BioC] removeEdge: strange error > Hi again, > > I believe that I've identified the culprit and have committed a fix to > svn. Look for graph_1.11.19 (should hit the repositories in < 48hrs). > > Thanks again for the bug report. > > Best, > > + seth
ADD COMMENT

Login before adding your answer.

Traffic: 722 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6