# NOT RUN {
#
# These examples are a test to ensure each census tract file
# can be read and a plot of the state generated.
#
require("sp")
#
# If you want to save and see the example output PDF files, change the
# the following "tempDir()" to the path you want to save the output files.
# For Example: outDir <- "c:/RTestPDFs"
outDir <- tempdir()
cat("Output Directory:",outDir,"\n")
stList <- c("01","10","11","12","17",
"18","23","24","28","33",
"37","39","42","44","45",
"47","50","51","54","72")
stName <- c("Alabama","Delaware","Dist.of Columbia","Florida","Illinois",
"Indiana","Maine","Maryland","Mississippi","New Hampshire",
"North Carolina","Ohio","Pennsylvania","Rhode Island","South Carolina",
"Tennessee","Vermont","Virginia","West Virginia","Puerto Rico")
cY <- "00"
outFile <- paste0("SeerMapperEast",cY,"-CT.pdf")
outFN <- file.path(outDir,outFile)
cat("Output example PDF file:",outFN,"\n")
pdf(outFN,width=7,height=10)
for (stN in seq(from=1, to=length(stList), by=8)) { # Test draw 3 of 20 states (1, 9, and 17)
stID <- stList[stN]
stNa <- stName[stN]
trFN <- paste0("tr",stID,"_d",cY)
TT_tr <- paste0("U. S. Census Tracts - ",stNa," Fips=",stID," file=",trFN)
data(list=trFN)
wrSP <- get(trFN)
#str(wrSP)
plot(wrSP,main=TT_tr)
rm(list=trFN)
}
dev.off()
# }
Run the code above in your browser using DataLab