Search
Question: removeEdge: strange error
0
11.8 years ago by
Dan Bebber50
Dan Bebber50 wrote:
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
modified 11.8 years ago • written 11.8 years ago by Dan Bebber50
0
11.8 years ago by
Seth Falcon7.4k
Seth Falcon7.4k wrote:
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
0
11.8 years ago by
Seth Falcon7.4k
Seth Falcon7.4k wrote:
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
0
11.8 years ago by
Dan Bebber50
Dan Bebber50 wrote:
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