readBardCheckpoint {BARD} | R Documentation |
This checkpoints the BARD program state as an R image, and can be used to restart BARD.
readBardCheckpoint(filen, continue = TRUE) writeBardCheckpoint(filen, restart.fun = NULL)
filen |
Name (and path to) file to be read or written |
continue |
Run restart function |
restart.fun |
Function to run after reading back checkpoint to restart |
These functions read and write parts of the .GlobalEnv.
Write return logical success invisibly. Read returns logical success invisibly, and restores selected .GlobalEnv state. If doContinue is TRUE, and read is successful, it launches restart function on exit.
Micah Altman Micah_Altman@harvard.edu http://www.hmdc.harvard.edu/micah_altman/
Other methods for readBardImage
, writeBardImage
,
exportBardShape
, importBardShape
# read in a shapefile with demographic data suffolk.map <- importBardShape( system.file("shapefiles/suffolk_tracts.shp", package="BARD")) # choose number of districts ndists <- 5 # create some initial plans kplan1 <- createKmeansPlan(suffolk.map,ndists) kplan2 <- createKmeansPlan(suffolk.map,ndists) # read and write images writeBardCheckpoint(paste(tempdir(),"/checkpoint1",sep=""), restart.fun=function(){cat("Welcome back\n")}) readBardCheckpoint(paste(tempdir(),"/checkpoint1",sep=""))