<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">When you run
</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#1F497D">acs.tables.install()</span><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">,
</span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">where are the table files supposed to go? I found them in the main acs package folder; I would have expected them in the extdata folder where the key is stored.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Michael Laviolette PhD MPH<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Public Health Statistician<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Bureau of Public Health Statistics and Informatics<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">New Hampshire Division of Public Health Services<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">29 Hazen Drive<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Concord, NH 03301-6504<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Phone: 603-271-5688<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Email: Michael.Laviolette@dhhs.nh.gov<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&quot;Improving Health, Preventing Disease, Reducing Costs for All&quot;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> acs-r-bounces@mit.edu [mailto:acs-r-bounces@mit.edu]
<b>On Behalf Of </b>Ezra Haber Glenn<br>
<b>Sent:</b> Thursday, July 13, 2017 12:53 PM<br>
<b>To:</b> acs-r@mit.edu; Sara Hintze<br>
<b>Cc:</b> 'acs-r@mit.edu'<br>
<b>Subject:</b> Re: [acs-r] ACS 2.1<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Ps, can you also confirm that you've reinstalled your api key?<o:p></o:p></p>
<div>
<p class="MsoNormal">On July 13, 2017 12:43:52 PM EDT, Ezra Haber Glenn &lt;<a href="mailto:eglenn@mit.edu">eglenn@mit.edu</a>&gt; wrote:<o:p></o:p></p>
<pre style="margin-bottom:12.0pt"><br>There have been some issues with the online variable lookup tables<br>that the package needs to access.&nbsp; Can you try this function (just<br>once -- no need to use it every time) :<o:p></o:p></pre>
<pre> acs.tables.install()<o:p></o:p></pre>
<pre><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:<o:p></o:p></pre>
<pre> <br>&nbsp;[1&nbsp; &lt;multipart/alternative (7bit)&gt;]<br> [1.1 &nbsp;&lt;text/plain; us-ascii (quoted-printable)&gt;]<br> [1.2&nbsp; &lt;text/html; us-ascii (quoted-printable)&gt;]<br> Hi all,<br> <br>&nbsp;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’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>&nbsp;Thanks,<br> <br>&nbsp;Sara<br> <br>&nbsp;Sara Hintze<br> <br>&nbsp;GIS Data Developer/Analyst | Research Services<br> <br>&nbsp;Mid-America Regional Council<br> <br>&nbsp;600 Broadway Blvd., Ste 200<br> <br>&nbsp;Kansas City, MO 64105<br> <br>&nbsp;816-701-8220 | <a href="http://www.marc.org">www.marc.org</a><br> <br>&nbsp;<br>&nbsp;[2 Script.r &lt;application/octet-stream (base64)&gt;]<br> [3 ConsoleOutput.txt &lt;text/plain (base64)&gt;]<o:p></o:p></pre>
<pre> # Call the acs package for data processing<br> library(acs)<o:p></o:p></pre>
<pre> Loading required package: stringr<br> Loading required package: XML<br> <br>&nbsp;Attaching package: ‘acs’<br> <br>&nbsp;The following object is masked from ‘package:base’:<br> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;apply<br> <br>&nbsp;Warning message:<br> package ‘acs’ was built under R version 3.3.3 <o:p></o:p></pre>
<pre>&nbsp;<br>&nbsp;# 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>&nbsp;# Additional geography fields for output<br> countyFIPS = &quot;&quot;<br> countyName = &quot;&quot;<br> stateFIPS = &quot;&quot;<br> stateAbbr = &quot;&quot;<br> <br>&nbsp;if (fileGeo == &quot;BlockGroup&quot;) {<o:p></o:p></pre>
<pre> &#43; # Block Group Geographies<br> &#43; 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>&nbsp;&#43; 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> &#43; <br>&nbsp;&#43; # Combine the Missouri and Kansas geographies, so we're pulling all data in a single request<br> &#43; geo = mo.geo &#43; ks.geo<br> &#43; } else if (fileGeo == &quot;Tract&quot;) {<br> &#43; # Tract Geographies:<br> &#43; 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>&nbsp;&#43; ks.geo=geo.make(state=20, county=c(1,5,43,45,59,91,103,107,121,209), tract=&quot;*&quot;)<br> &#43; <br>&nbsp;&#43; # Combine the Missouri and Kansas geographies, so we're pulling all data in a single request<br> &#43; geo = mo.geo &#43; ks.geo<br> &#43; } else if (fileGeo == &quot;Place&quot;) {<br> &#43; # Place Geographies:<br> &#43; mo.geo=geo.make(state=29, place=&quot;*&quot;)<br> &#43; ks.geo=geo.make(state=20, place=&quot;*&quot;)<br> &#43; <br>&nbsp;&#43; # Combine the Missouri and Kansas geographies, so we're pulling all data in a single request<br> &#43; geo = mo.geo &#43; ks.geo<br> &#43; } else if (fileGeo == &quot;County&quot;) {<br> &#43; # County Geographies: <br>&nbsp;&#43; # Top 2 are for counties in the MSA, plus counties needed for REACH data (Allen County, KS and Lafayette County, MO)]<br> &#43; # Bottom 2 are the counties in the MARC region only<br> &#43; <br>&nbsp;&#43; #All Counties in the CSA (??) (plus Allen County, KS)<br> &#43; if (year_span == 5){<br> &#43; mo.geo=geo.make(state=29, county=c(3,13,21,25,37,47,49,63,95,101,107,165,177)) <br>&nbsp;&#43; ks.geo=geo.make(state=20, county=c(1,5,43,45,59,91,103,107,121,209))<br> &#43; } else {<br> &#43; #Counties Available within the 1-Year ACS Estimates<br> &#43; mo.geo=geo.make(state=29, county=c(21,37,47,95,165)) <br>&nbsp;&#43; ks.geo=geo.make(state=20, county=c(45,91,103,209))<br> &#43; }<br> &#43; <br>&nbsp;&#43; # Combine the Missouri and Kansas geographies, so we're pulling all data in a single request<br> &#43; geo = mo.geo &#43; ks.geo<br> &#43; } else if (fileGeo == &quot;MSA&quot;) {<br> &#43; # MSA Geographies - cannot be pulled by County or State, so getting all<br> &#43; geo &lt;- geo.make(msa=&quot;*&quot;) <br>&nbsp;&#43; # Set the stateFIPS so that data appends correctly<br> &#43; stateFIPS = 99<br> &#43; }<o:p></o:p></pre>
<pre> <br>&nbsp;# Clean up variables that are no longer needed.<br> if (fileGeo != &quot;MSA&quot;) {<o:p></o:p></pre>
<pre> &#43; rm(mo.geo, ks.geo)<br> &#43; }<o:p></o:p></pre>
<pre> <br>&nbsp;# 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)<o:p></o:p></pre>
<pre> 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>&nbsp;Warning message:<br> In acs.lookup(<a href="http://table.name">table.name</a> = &quot;B09001&quot;, span = year_span, endyear = year_endyear) :<br>&nbsp;&nbsp; XML variable lookup tables for this request<br>&nbsp;&nbsp; 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>&nbsp;&nbsp; temporarily downloading and using archived copies instead;<br>&nbsp;&nbsp; since this is *much* slower, recommend running<br>&nbsp;&nbsp; acs.tables.install()<o:p></o:p></pre>
<pre> ownChildren.byFamilyType = acs.lookup(<a href="http://table.name">table.name</a>=&quot;B09002&quot;, span=year_span, endyear=year_endyear)<o:p></o:p></pre>
<pre> 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>&nbsp;Warning message:<br> In acs.lookup(<a href="http://table.name">table.name</a> = &quot;B09002&quot;, span = year_span, endyear = year_endyear) :<br>&nbsp;&nbsp; XML variable lookup tables for this request<br>&nbsp;&nbsp; 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>&nbsp;&nbsp; temporarily downloading and using archived copies instead;<br>&nbsp;&nbsp; since this is *much* slower, recommend running<br>&nbsp;&nbsp; acs.tables.install()<o:p></o:p></pre>
<pre> <br>&nbsp;# 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 &#43; ownchildren.byfamilytype.vars<br> <br>&nbsp;# 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;)<o:p></o:p></pre>
<pre> Error in if (url.test[&quot;statusMessage&quot;] != &quot;OK&quot;) { : <br>&nbsp;&nbsp;&nbsp;missing value where TRUE/FALSE needed<o:p></o:p></pre>
<pre> <br>&nbsp;# 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;) {<o:p></o:p></pre>
<pre> &#43; myFIPS = paste(geography(children.data)$state, sprintf(&quot;%03d&quot;,geography(children.data)$county), geography(children.data)$tract, sep=&quot;&quot;)<br> &#43; } else if (fileGeo == &quot;County&quot;) {<br> &#43; myFIPS = paste(geography(children.data)$state, sprintf(&quot;%03s&quot;,geography(children.data)$county), sep=&quot;&quot;)<br> &#43; } else if (fileGeo == &quot;Place&quot;) {<br> &#43; myFIPS = paste(geography(children.data)$state, sprintf(&quot;%05s&quot;,geography(children.data)$place), sep=&quot;&quot;)<br> &#43; } else if (fileGeo == &quot;BlockGroup&quot;) {<br> &#43; 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> &#43; } else if (fileGeo == &quot;MSA&quot;) {<br> &#43; myFIPS = geography(children.data)$metropolitanstatisticalareamicropolitanstatisticalarea<br> &#43; }<br> Error in geography(children.data) : object 'children.data' not found<o:p></o:p></pre>
<pre> <br>&nbsp;if (fileGeo != &quot;MSA&quot; &amp;&amp; fileGeo != &quot;Place&quot;) {<o:p></o:p></pre>
<pre> &#43; countyFIPS = paste(geography(children.data)$state, sprintf(&quot;%03s&quot;,geography(children.data)$county), sep=&quot;&quot;)<br> &#43; stateFIPS = geography(children.data)$state<br> &#43; } else if(fileGeo != &quot;MSA&quot;) {<br> &#43; stateFIPS = geography(children.data)$state<br> &#43; }<br> Error in geography(children.data) : object 'children.data' not found<o:p></o:p></pre>
<pre> <br>&nbsp;children.df = data.frame(geography(children.data)$NAME, myFIPS, countyFIPS, countyName, stateFIPS, stateAbbr, year_endyear, year_span, estimate(children.data))<o:p></o:p></pre>
<pre> Error in geography(children.data) : object 'children.data' not found<o:p></o:p></pre>
<pre> <br>&nbsp;# 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<o:p></o:p></pre>
<pre> Error in colnames(children.df) = cols_children : <br>&nbsp;&nbsp;&nbsp;object 'children.df' not found<o:p></o:p></pre>
<pre> <br>&nbsp;# Set rownames to NULL, so it defaults to a sequential numeric output<br> rownames(children.df) &lt;- NULL<o:p></o:p></pre>
<pre> Error in rownames(children.df) &lt;- NULL : object 'children.df' not found<o:p></o:p></pre>
<pre> <br>&nbsp;#Clean up unneeded variables<br> rm(ownChildren.byFamilytype, ownchildren.byfamilytype.vars, population.under18, population.under18.vars, children.vars, children.data, children.df)<o:p></o:p></pre>
<pre> Warning messages:<br> 1: In rm(ownChildren.byFamilytype, ownchildren.byfamilytype.vars, population.under18,&nbsp; :<br>&nbsp;&nbsp; object 'ownChildren.byFamilytype' not found<br> 2: In rm(ownChildren.byFamilytype, ownchildren.byfamilytype.vars, population.under18,&nbsp; :<br>&nbsp;&nbsp; object 'children.data' not found<br> 3: In rm(ownChildren.byFamilytype, ownchildren.byfamilytype.vars, population.under18,&nbsp; :<br>&nbsp;&nbsp; object 'children.df' not found<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>&nbsp;[4&nbsp; &lt;text/plain; us-ascii (7bit)&gt;]<o:p></o:p></pre>
<pre style="text-align:center"><hr size="2" width="100%" align="center"></pre>
<pre><br> acs-r mailing list<br> <a href="mailto:acs-r@mit.edu">acs-r@mit.edu</a><br> <a href="http://mailman.mit.edu/mailman/listinfo/acs-r">http://mailman.mit.edu/mailman/listinfo/acs-r</a><o:p></o:p></pre>
<pre style="margin-bottom:12.0pt"><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><a href="mailto:eglenn@mit.edu">eglenn@mit.edu</a> <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)<o:p></o:p></pre>
<pre style="text-align:center"><hr size="2" width="100%" align="center"></pre>
<pre><br>acs-r mailing list<br><a href="mailto:acs-r@mit.edu">acs-r@mit.edu</a><br><a href="http://mailman.mit.edu/mailman/listinfo/acs-r">http://mailman.mit.edu/mailman/listinfo/acs-r</a><o:p></o:p></pre>
</div>
<p class="MsoNormal"><br>
--<br>
Ezra Haber Glenn<br>
Department of Urban Studies and Planning<br>
Massachusetts Institute of Technology<br>
<a href="mailto:eglenn@mit.edu">eglenn@mit.edu</a> / 617.721.7131<o:p></o:p></p>
</div>
</body>
</html>