<div dir="ltr">I am trying to use geo.make to create a geography of all zip codes / zctas in the continental US. This is slightly challenging because the documentation to geo.make says that if you specify the zip.code parameter then no other geographies can be selected. <div>
<br></div><div>My solution is to use the zipcode package to create a list of all zipcodes in the continental us, and then pass that to geo.make. However, this creates an error:</div><div><br></div><div><div>library(maps)</div>
<div>library(zipcode)</div><div>data(zipcode)</div><div><br></div><div>states_continental = setdiff(state.abb, c("AK", "HI"))</div><div>states_continental = c(states_continental, "DC")</div><div>
zips = zipcode[zipcode$state %in% states_continental, "zip"]</div><div><br></div><div>geo = geo.make(zip.code=zips)</div><div>Error: evaluation nested too deeply: infinite recursion / options(expressions=)?</div>
<div>Error during wrapup: evaluation nested too deeply: infinite recursion / options(expressions=)?</div></div><div><br>I tried to step thru the geo.make code but was not sure how it worked. I suspect the error is that the zipcode package includes valid zips that are not zctas (e.g. zip codes that refer to post offices), and that might cause a problem. But I am wondering if there is a bug in the acs code, or if there is a better way to get the result I am looking for. </div>
<div><br></div><div>As a workaround, is there an easy way to remove elements from the result of geo.make(zip.code="*")? The resulting object is an S4 object, which I don't have experience with. If the result were a data.frame I could just use subsetting against the zips variable I have above. But I am not sure how to do the equivalent operation with the resulting S4 object.</div>
<div><br></div><div>Thanks.</div><div><br></div><div>Ari</div></div>