• using R version 2.10.0 Patched (2009-11-03 r50304)
  • using session charset: UTF-8
  • checking for file 'BARD/DESCRIPTION' ... OK
  • checking extension type ... Package
  • this is package 'BARD' version '1.05'
  • checking package name space information ... OK
  • checking package dependencies ... OK
  • checking if this is a source package ... OK
  • checking whether package 'BARD' can be installed ... OK
  • checking package directory ... OK
  • checking for portable file names ... OK
  • checking for sufficient/correct file permissions ... OK
  • checking DESCRIPTION meta-information ... OK
  • checking top-level files ... OK
  • checking index information ... OK
  • checking package subdirectories ... OK
  • checking R files for non-ASCII characters ... OK
  • checking R files for syntax errors ... OK
  • checking whether the package can be loaded ... OK
  • checking whether the package can be loaded with stated dependencies ... OK
  • checking whether the name space can be loaded with stated dependencies ... OK
  • checking for unstated dependencies in R code ... OK
  • checking S3 generic/method consistency ... OK
  • checking replacement functions ... OK
  • checking foreign function calls ... OK
  • checking R code for possible problems ... OK
  • checking Rd files ... OK
  • checking Rd metadata ... OK
  • checking Rd cross-references ... OK
  • checking for missing documentation entries ... OK
  • checking for code/documentation mismatches ... OK
  • checking Rd \usage sections ... OK
  • checking line endings in C/C++/Fortran sources/headers ... OK
  • checking line endings in Makefiles ... OK
  • checking for portable compilation flags in Makevars ... OK
  • checking for portable use of $BLAS_LIBS ... OK
  • checking examples ... ERROR
    Running examples in 'BARD-Ex.R' failed.
    The error most likely occurred in:

    > ### * BARD.package
    >
    > flush(stderr()); flush(stdout())
    >
    > ### Name: BARD-package
    > ### Title: A package for better automated redistricting.
    > ### Aliases: BARD-package BARD
    > ### Keywords: spatial IO spatial optimize models distribution
    >
    > ### ** Examples
    >
    >
    > suffolk.map <- importBardShape(
    + file.path(system.file("shapefiles", package="BARD"),"suffolk_tracts")
    + )
    Shapefile type: Polygon, (5), # of Shapes: 320
    >
    >
    > numberdists <- 5
    > kplan <- createKmeansPlan(suffolk.map,numberdists)
    > rplan <- createRandomPlan(suffolk.map,numberdists)
    > rplan2 <- createRandomPopPlan(suffolk.map,numberdists)
    > plot(kplan)
    >
    > reportPlans(plans=list("kmeans"=kplan,"random 1"=rplan,"random pop"=rplan2), doplot=TRUE)
    Plan Scores

    Plan DistrictID RecodedID Contiguity Holes LW Compact Reock
    1 kmeans 1 1 0.0000000 NA 0.08745115 0.3883830
    2 kmeans 2 2 0.0000000 NA 0.13276734 0.6475287
    3 kmeans 3 3 0.0000000 NA 0.07392494 0.5432474
    4 kmeans 4 4 0.0000000 NA 0.37793995 0.6615332
    5 kmeans 5 5 0.0000000 NA 0.15240584 0.5042317
    6 kmeans Total Total 0.0000000 0 0.82448922 2.7449241
    7 random 1 1 2 0.9655172 NA 0.52801530 0.8986329
    8 random 1 2 3 0.9687500 NA 0.60587172 0.9635140
    9 random 1 3 5 0.9642857 NA 0.60656867 0.9199742
    10 random 1 4 1 0.9666667 NA 0.57862408 0.9124522
    11 random 1 5 4 0.9565217 NA 0.73649144 0.9637701
    12 random 1 Total Total 4.8217414 0 3.05557122 4.6583433
    13 random pop 1 5 0.9705882 NA 0.73142962 0.9600882
    14 random pop 2 4 0.9655172 NA 0.58192456 0.8923634
    15 random pop 3 3 0.9642857 NA 0.55893342 0.9603486
    16 random pop 4 2 0.9600000 NA 0.61155854 0.8698290
    17 random pop 5 1 0.9696970 NA 0.51182008 0.9621503
    18 random pop Total Total 4.8300882 0 2.99566623 4.6447795


    Plan Differences


    Comparing plan kmeans with plan random 1 :

    Dist ID New ID # of original blocks # Blocks Removed # Added % Shared
    1 1 2 93 72 45 15.20
    2 2 3 39 29 51 11.10
    3 3 5 103 78 47 16.70
    4 4 1 21 16 49 7.14
    5 5 4 64 54 57 8.26
    Holes NA NA 0 0 0 NA

    Comparing plan kmeans with plan random pop :

    Dist ID New ID # of original blocks # Blocks Removed # Added % Shared
    1 1 5 93 72 42 15.60
    2 2 4 39 28 51 12.20
    3 3 3 103 76 41 18.80
    4 4 2 21 16 60 6.17
    5 5 1 64 53 51 9.57
    Holes NA NA 0 0 0 NA
    >
    > ## Not run:
    > ##D if (require("iplots",quietly=TRUE)) {
    > ##D rplan<-editPlanInteractive(rplan,calcPopScore,predvar="POP")
    > ##D }
    > ##D
    > ## End(Not run)
    >
    > myScore<-function(plan,...) {
    + return(calcContiguityScore(plan,...))
    + }
    >
    > #just for quick demonstration -- nelder method not effective
    >
    > improvedRplan<-refineNelderPlan(plan=rplan2, score.fun=myScore, displaycount=100, historysize=0, dynamicscoring=FALSE, tracelevel=1, maxit=100)
    [1] "Score 0.96969696969697 0.96 0.964285714285714 0.96551724137931 0.970588235294118 iteration 100 2009-11-06 11:26:08"
    [1] "Iterations: 100 ( 0.96969696969697 0.96 0.964285714285714 0.96551724137931 0.970588235294118 ) 2009-11-06 11:26:09"
    [1] "Score 0.96969696969697 0.96 0.964285714285714 0.96551724137931 0.970588235294118 iteration 200 2009-11-06 11:26:09"
    [1] "Iterations: 200 ( 0.96969696969697 0.96 0.964285714285714 0.96551724137931 0.970588235294118 )* 2009-11-06 11:26:09"
    [1] "Score 0.96969696969697 0.96 0.964285714285714 0.96551724137931 0.970588235294118 iteration 300 2009-11-06 11:26:09"
    [1] "Iterations: 300 ( 0.96969696969697 0.96 0.964285714285714 0.96551724137931 0.970588235294118 )* 2009-11-06 11:26:09"
    >
    > ## Not run:
    > ##D # This works better, but will take a while
    > ##D improvedRplan<-refineAnnealPlan(plan=rplan2, score.fun=myScore, historysize=0, dynamicscoring=FALSE, tracelevel=1)
    > ## End(Not run)
    >
    > samples<-samplePlans(kplan, score.fun=myScore, ngenplans=10, gen.fun = "createRandomPlan", refine.fun="refineNelderPlan",refine.args=list(maxit=200,dynamicscoring=TRUE))
    [1] "Generating plan # 1"
    [1] "Generating plan # 2"
    [1] "Generating plan # 3"
    [1] "Generating plan # 4"
    [1] "Generating plan # 5"
    [1] "Generating plan # 6"
    [1] "Generating plan # 7"
    [1] "Generating plan # 8"
    [1] "Generating plan # 9"
    [1] "Generating plan # 10"
    [1] "Starting refinement phase"
    [1] "Refining plan..."

    *** caught segfault ***
    address 0x2b38425d2000, cause 'invalid permissions'

    Traceback:
    1: optim(plan, nelderScoreFun, method = "Nelder-Mead", control = control)
    2: refineNelderPlan(maxit = 200, dynamicscoring = TRUE, plan = iplan, score.fun = score.fun)
    3: do.call(refine.fun, myargs)
    4: FUN(X[[1L]], ...)
    5: lapply(X, FUN, ...)
    6: lapplyBardCluster(combinedplans, myrefplan)
    7: samplePlans(kplan, score.fun = myScore, ngenplans = 10, gen.fun = "createRandomPlan", refine.fun = "refineNelderPlan", refine.args = list(maxit = 200, dynamicscoring = TRUE))
    aborting ...