## read shapefile into bnd object
shpName <- sub(pattern="(.*)\\.dbf", replacement="\\1",
x=system.file("examples/northamerica_adm0.dbf",
package="BayesX"))
north <- shp2bnd(shpname=shpName, regionnames="COUNTRY")
## draw the map
drawmap(map=north)
## compare with shipped bnd file
shippedBnd <- read.bnd(system.file("examples/northamerica.bnd", package="BayesX"))
stopifnot(all.equal(north, shippedBnd))
Run the code above in your browser using DataLab