<html><head></head><body>Ps, can you also confirm that you&#39;ve reinstalled your api key?<br><br><div class="gmail_quote">On July 13, 2017 12:43:52 PM EDT, Ezra Haber Glenn &lt;eglenn@mit.edu&gt; wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail"><br />There have been some issues with the online variable lookup tables<br />that the package needs to access.  Can you try this function (just<br />once -- no need to use it every time) :<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> acs.tables.install()<br /></blockquote><br />after that, see if your script works.<br /><br />Thanks.<br /><br />--Ezra<br /><br /><br />On Thu, 13 Jul 2017 12:33:39 -0400, Sara Hintze wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> <br /> [1  &lt;multipart/alternative (7bit)&gt;]<br /> [1.1  &lt;text/plain; us-ascii (quoted-printable)&gt;]<br /> [1.2  &lt;text/html; us-ascii (quoted-printable)&gt;]<br /> Hi all,<br /> <br /> I recently upgraded from acs 2.0 to 2.1 and am receiving errors from a script that<br /> previously worked under acs 2.0. I&rsquo;ve attached the original script along with the console<br /> output. Have I missed something obvious and/or has anyone else had similar issues?<br /> <br /> Thanks,<br /> <br /> Sara<br /> <br /> Sara Hintze<br /> <br /> GIS Data Developer/Analyst | Research Services<br /> <br /> Mid-America Regional Council<br /> <br /> 600 Broadway Blvd., Ste 200<br /> <br /> Kansas City, MO 64105<br /> <br /> 816-701-8220 | <a href="http://www.marc.org">www.marc.org</a><br /> <br /> <br /> [2 Script.r &lt;application/octet-stream (base64)&gt;]<br /> [3 ConsoleOutput.txt &lt;text/plain (base64)&gt;]<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> # Call the acs package for data processing<br /> library(acs)<br /></blockquote> Loading required package: stringr<br /> Loading required package: XML<br /> <br /> Attaching package: &lsquo;acs&rsquo;<br /> <br /> The following object is masked from &lsquo;package:base&rsquo;:<br /> <br />     apply<br /> <br /> Warning message:<br /> package &lsquo;acs&rsquo; was built under R version 3.3.3 <br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> <br /> # Variables to specify end year of ACS to pull from, as well as the span, which specifies the estimates to pull for that end year (1-year, 3-year, or 5-year), and the geographic level<br /> year_endyear = 2015<br /> year_span = 5 # 1-year estimates are not available at the tract or block group level<br /> fileGeo = &quot;County&quot;<br /> <br /> # Additional geography fields for output<br /> countyFIPS = &quot;&quot;<br /> countyName = &quot;&quot;<br /> stateFIPS = &quot;&quot;<br /> stateAbbr = &quot;&quot;<br /> <br /> if (fileGeo == &quot;BlockGroup&quot;) {<br /></blockquote> + # Block Group Geographies<br /> + mo.geo=geo.make(state=29, county=c(3,13,21,25,37,47,49,63,95,101,107,165,177), tract=&quot;*&quot;, <a href="http://block.group">block.group</a>=&quot;*&quot;) <br /> + ks.geo=geo.make(state=20, county=c(1,5,43,45,59,91,103,107,121,209), tract=&quot;*&quot;, <a href="http://block.group">block.group</a>=&quot;*&quot;)<br /> + <br /> + # Combine the Missouri and Kansas geographies, so we're pulling all data in a single request<br /> + geo = mo.geo + ks.geo<br /> + } else if (fileGeo == &quot;Tract&quot;) {<br /> + # Tract Geographies:<br /> + mo.geo=geo.make(state=29, county=c(3,13,21,25,37,47,49,63,95,101,107,165,177), tract=&quot;*&quot;) <br /> + ks.geo=geo.make(state=20, county=c(1,5,43,45,59,91,103,107,121,209), tract=&quot;*&quot;)<br /> + <br /> + # Combine the Missouri and Kansas geographies, so we're pulling all data in a single request<br /> + geo = mo.geo + ks.geo<br /> + } else if (fileGeo == &quot;Place&quot;) {<br /> + # Place Geographies:<br /> + mo.geo=geo.make(state=29, place=&quot;*&quot;)<br /> + ks.geo=geo.make(state=20, place=&quot;*&quot;)<br /> + <br /> + # Combine the Missouri and Kansas geographies, so we're pulling all data in a single request<br /> + geo = mo.geo + ks.geo<br /> + } else if (fileGeo == &quot;County&quot;) {<br /> + # County Geographies: <br /> + # Top 2 are for counties in the MSA, plus counties needed for REACH data (Allen County, KS and Lafayette County, MO)]<br /> + # Bottom 2 are the counties in the MARC region only<br /> + <br /> + #All Counties in the CSA (??) (plus Allen County, KS)<br /> + if (year_span == 5){<br /> + mo.geo=geo.make(state=29, county=c(3,13,21,25,37,47,49,63,95,101,107,165,177)) <br /> + ks.geo=geo.make(state=20, county=c(1,5,43,45,59,91,103,107,121,209))<br /> + } else {<br /> + #Counties Available within the 1-Year ACS Estimates<br /> + mo.geo=geo.make(state=29, county=c(21,37,47,95,165)) <br /> + ks.geo=geo.make(state=20, county=c(45,91,103,209))<br /> + }<br /> + <br /> + # Combine the Missouri and Kansas geographies, so we're pulling all data in a single request<br /> + geo = mo.geo + ks.geo<br /> + } else if (fileGeo == &quot;MSA&quot;) {<br /> + # MSA Geographies - cannot be pulled by County or State, so getting all<br /> + geo &lt;- geo.make(msa=&quot;*&quot;) <br /> + # Set the stateFIPS so that data appends correctly<br /> + stateFIPS = 99<br /> + }<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> <br /> # Clean up variables that are no longer needed.<br /> if (fileGeo != &quot;MSA&quot;) {<br /></blockquote> + rm(mo.geo, ks.geo)<br /> + }<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> <br /> # Set up acs.lookup objects for data we want to retrieve<br /> population.under18 = acs.lookup(<a href="http://table.name">table.name</a> = &quot;B09001&quot;, span=year_span, endyear = year_endyear)<br /></blockquote> trying URL '<a href="http://web.mit.edu/eglenn/www/acs/acs-variables/acs_5yr_2015_var.xml.gz">http://web.mit.edu/eglenn/www/acs/acs-variables/acs_5yr_2015_var.xml.gz</a>'<br /> Content type 'application/xml' length 735879 bytes (718 KB)<br /> downloaded 718 KB<br /> <br /> Warning message:<br /> In acs.lookup(<a href="http://table.name">table.name</a> = &quot;B09001&quot;, span = year_span, endyear = year_endyear) :<br />   XML variable lookup tables for this request<br />   seem to be missing from ' <a href="https://api.census.gov/data/2015/acs5/variables.xml">https://api.census.gov/data/2015/acs5/variables.xml</a> ';<br />   temporarily downloading and using archived copies instead;<br />   since this is *much* slower, recommend running<br />   acs.tables.install()<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> ownChildren.byFamilyType = acs.lookup(<a href="http://table.name">table.name</a>=&quot;B09002&quot;, span=year_span, endyear=year_endyear)<br /></blockquote> trying URL '<a href="http://web.mit.edu/eglenn/www/acs/acs-variables/acs_5yr_2015_var.xml.gz">http://web.mit.edu/eglenn/www/acs/acs-variables/acs_5yr_2015_var.xml.gz</a>'<br /> Content type 'application/xml' length 735879 bytes (718 KB)<br /> downloaded 718 KB<br /> <br /> Warning message:<br /> In acs.lookup(<a href="http://table.name">table.name</a> = &quot;B09002&quot;, span = year_span, endyear = year_endyear) :<br />   XML variable lookup tables for this request<br />   seem to be missing from ' <a href="https://api.census.gov/data/2015/acs5/variables.xml">https://api.census.gov/data/2015/acs5/variables.xml</a> ';<br />   temporarily downloading and using archived copies instead;<br />   since this is *much* slower, recommend running<br />   acs.tables.install()<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> <br /> # Select out just those variables we want<br /> population.under18.vars = population.under18[1:10]<br /> ownchildren.byfamilytype.vars = ownChildren.byFamilyType[1:20]<br /> children.vars = population.under18.vars + ownchildren.byfamilytype.vars<br /> <br /> # Request/fetch the data, and then add to a dataframe for output<br /> children.data = acs.fetch(endyear=year_endyear, span=year_span, geography=geo, variable=children.vars, dataset=&quot;acs&quot;)<br /></blockquote> Error in if (url.test[&quot;statusMessage&quot;] != &quot;OK&quot;) { : <br />   missing value where TRUE/FALSE needed<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> <br /> # Create a complete FIPS code ID for the block group, tract, place, or county - this is what is used to join this data to geography<br /> if (fileGeo == &quot;Tract&quot;) {<br /></blockquote> + myFIPS = paste(geography(children.data)$state, sprintf(&quot;%03d&quot;,geography(children.data)$county), geography(children.data)$tract, sep=&quot;&quot;)<br /> + } else if (fileGeo == &quot;County&quot;) {<br /> + myFIPS = paste(geography(children.data)$state, sprintf(&quot;%03s&quot;,geography(children.data)$county), sep=&quot;&quot;)<br /> + } else if (fileGeo == &quot;Place&quot;) {<br /> + myFIPS = paste(geography(children.data)$state, sprintf(&quot;%05s&quot;,geography(children.data)$place), sep=&quot;&quot;)<br /> + } else if (fileGeo == &quot;BlockGroup&quot;) {<br /> + myFIPS = paste(geography(children.data)$state, sprintf(&quot;%03d&quot;,geography(children.data)$county), sprintf(&quot;%06d&quot;,geography(children.data)$tract), geography(children.data)$blockgroup, sep=&quot;&quot;)<br /> + } else if (fileGeo == &quot;MSA&quot;) {<br /> + myFIPS = geography(children.data)$metropolitanstatisticalareamicropolitanstatisticalarea<br /> + }<br /> Error in geography(children.data) : object 'children.data' not found<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> <br /> if (fileGeo != &quot;MSA&quot; &amp;&amp; fileGeo != &quot;Place&quot;) {<br /></blockquote> + countyFIPS = paste(geography(children.data)$state, sprintf(&quot;%03s&quot;,geography(children.data)$county), sep=&quot;&quot;)<br /> + stateFIPS = geography(children.data)$state<br /> + } else if(fileGeo != &quot;MSA&quot;) {<br /> + stateFIPS = geography(children.data)$state<br /> + }<br /> Error in geography(children.data) : object 'children.data' not found<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> <br /> children.df = data.frame(geography(children.data)$NAME, myFIPS, countyFIPS, countyName, stateFIPS, stateAbbr, year_endyear, year_span, estimate(children.data))<br /></blockquote> Error in geography(children.data) : object 'children.data' not found<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> <br /> # Overwrite default ACS field names with English<br /> cols_children = c(&quot;GeoStr&quot;, &quot;FIPS&quot;, &quot;CountyFIPS&quot;, &quot;CountyName&quot;, &quot;StateFIPS&quot;, &quot;StateAbbr&quot;, &quot;Period&quot;, &quot;Dataset&quot;, &quot;PopulationUnder18&quot;, &quot;Under18InHouseholds&quot;, &quot;AgeUnder3Years&quot;, &quot;Age3to4&quot;, &quot;Age5&quot;, &quot;Age6to8&quot;, &quot;Age9to11&quot;, &quot;Age12to14&quot;, &quot;Age15to17&quot;, &quot;Under18InGroupQuarters&quot;, &quot;OwnChildrenUnder18&quot;, &quot;InMarriedCouples&quot;,&quot;InMarriedCouples_Under3years&quot;,&quot;InMarriedCouples_3to4years&quot;,&quot;InMarriedCouples_5years&quot;,&quot;InMarriedCouples_6to11years&quot;,&quot;InMarriedCouples_12to17years&quot;,&quot;InOtherFamilies&quot;,&quot;MaleHoH&quot;,&quot;MaleHoH_Under3years&quot;,&quot;MaleHoH_3to4years&quot;,&quot;MaleHoH_5years&quot;,&quot;MaleHoH_6to11years&quot;,&quot;MaleHoH_12to17years&quot;,&quot;FemaleHoH&quot;,&quot;FemaleHoH_Under3years&quot;,&quot;FemaleHoH_3to4years&quot;,&quot;FemaleHoH_5years&quot;,&quot;FemaleHoH_6to11years&quot;,&quot;FemaleHoH_12to17years&quot;)<br /> colnames(children.df)=cols_children<br /></blockquote> Error in colnames(children.df) = cols_children : <br />   object 'children.df' not found<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> <br /> # Set rownames to NULL, so it defaults to a sequential numeric output<br /> rownames(children.df) &lt;- NULL<br /></blockquote> Error in rownames(children.df) &lt;- NULL : object 'children.df' not found<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> <br /> #Clean up unneeded variables<br /> rm(ownChildren.byFamilytype, ownchildren.byfamilytype.vars, population.under18, population.under18.vars, children.vars, children.data, children.df)<br /></blockquote> Warning messages:<br /> 1: In rm(ownChildren.byFamilytype, ownchildren.byfamilytype.vars, population.under18,  :<br />   object 'ownChildren.byFamilytype' not found<br /> 2: In rm(ownChildren.byFamilytype, ownchildren.byfamilytype.vars, population.under18,  :<br />   object 'children.data' not found<br /> 3: In rm(ownChildren.byFamilytype, ownchildren.byfamilytype.vars, population.under18,  :<br />   object 'children.df' not found<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> <br /></blockquote> [4  &lt;text/plain; us-ascii (7bit)&gt;]<br /><hr /><br /> acs-r mailing list<br /> acs-r@mit.edu<br /> <a href="http://mailman.mit.edu/mailman/listinfo/acs-r">http://mailman.mit.edu/mailman/listinfo/acs-r</a><br /></blockquote><br />--<br />Ezra Haber Glenn, AICP<br />Department of Urban Studies and Planning<br />Massachusetts Institute of Technology<br />77 Massachusetts Ave., Room 7-346<br />Cambridge, MA 02139<br />eglenn@mit.edu <br /><a href="http://dusp.mit.edu/faculty/ezra-glenn">http://dusp.mit.edu/faculty/ezra-glenn</a><br />617.253.2024 (w)<br />617.721.7131 (c)<br /><br /><hr /><br />acs-r mailing list<br />acs-r@mit.edu<br /><a href="http://mailman.mit.edu/mailman/listinfo/acs-r">http://mailman.mit.edu/mailman/listinfo/acs-r</a><br /></pre></blockquote></div><br>
--<br>
Ezra Haber Glenn<br>
Department of Urban Studies and Planning<br>
Massachusetts Institute of Technology<br>
eglenn@mit.edu / 617.721.7131</body></html>