Skip to content

Instantly share code, notes, and snippets.

@mhermans
Created July 19, 2012 14:55
Show Gist options
  • Save mhermans/3144500 to your computer and use it in GitHub Desktop.
Save mhermans/3144500 to your computer and use it in GitHub Desktop.
Rstudio crash
library(sp)
library(plyr)
library(spdep)
library(igraph)
#load(url("http://www.filefactory.com/file/778ibc72fct3/n/BEL_adm3_RData"))
load(url("http://www.filefactory.com/file/4gkfr4n087l1/n/BEL_adm4_RData"))
area <- function(polygon) {
polygon[1]@area
}
area <- laply(polygons(gadm)@polygons, .fun=slot, 'area')
arrond <- data.frame(cbind(gadm$PID, gadm$NAME_4, area))
arrond$area <- as.numeric(as.character(arrond$area))
names(arrond) <- c('PID', 'name', 'area')
arrond$cum.area <- round(cumsum(arrond$area)/sum(arrond$area)*100,2)
#arrond
neighb <- poly2nb(gadm)
g <- graph.adjlist(neighb)
#str(neighb)
V(g)$name <- gadm$NAME_4 # order zeker? http://lists.gnu.org/archive/html/igraph-help/2011-03/msg00113.html
V(g)$area <- arrond$area
f <- function(graph, data, extra) {
print(V(g)[data['succ']])
FALSE
}
graph.bfs(g, root=1, callback=f)
Vertex sequence:
[1] "Essen"
Assertion failed!
Program: C:\Program Files\RStudio\bin\rsession.exe
File: dqueue.pmt, Line 105
Expression: q->stor_begin != 0
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
sessionInfo()
R version 2.14.2 (2012-02-29)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=Dutch_Belgium.1252 LC_CTYPE=Dutch_Belgium.1252 LC_MONETARY=Dutch_Belgium.1252 LC_NUMERIC=C
[5] LC_TIME=Dutch_Belgium.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_2.14.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment