# 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 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 used:",outDir,"\n")
stList <- c("02","04","06","09","13",
"15","16","19","21","22",
"25","26","34","35","36",
"40","49","53","55")
stName <- c("Alaska","Arizona","California","Connecticut","Georgia",
"Hawaii","Idaho","Iowa","Kentucky","Louisiana",
"Massachusett","Michigan","New Jersery","New Mexico","New York",
"Oklahoma","Utah","Washington","Wisconsin")
cY <- "00"
outFile <- paste0("SeerMapperRegs",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=7)) { # Test draw 3 of 19 states (1, 8, 15)
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