<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:"Calibri","sans-serif";color:#1F497D">When you run
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#1F497D">acs.tables.install()</span><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">,
</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";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:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Michael Laviolette PhD MPH<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Public Health Statistician<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";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:"Calibri","sans-serif";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:"Calibri","sans-serif";color:#1F497D">29 Hazen Drive<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Concord, NH 03301-6504<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Phone: 603-271-5688<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";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:"Calibri","sans-serif";color:#1F497D">"Improving Health, Preventing Disease, Reducing Costs for All"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </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:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> 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> </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 <<a href="mailto:eglenn@mit.edu">eglenn@mit.edu</a>> 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. 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> [1 <multipart/alternative (7bit)>]<br> [1.1 <text/plain; us-ascii (quoted-printable)>]<br> [1.2 <text/html; us-ascii (quoted-printable)>]<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’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 <application/octet-stream (base64)>]<br> [3 ConsoleOutput.txt <text/plain (base64)>]<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> Attaching package: ‘acs’<br> <br> The following object is masked from ‘package:base’:<br> <br> apply<br> <br> Warning message:<br> package ‘acs’ was built under R version 3.3.3 <o:p></o:p></pre>
<pre> <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 = "County"<br> <br> # Additional geography fields for output<br> countyFIPS = ""<br> countyName = ""<br> stateFIPS = ""<br> stateAbbr = ""<br> <br> if (fileGeo == "BlockGroup") {<o:p></o:p></pre>
<pre> + # 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="*", <a href="http://block.group">block.group</a>="*") <br> + ks.geo=geo.make(state=20, county=c(1,5,43,45,59,91,103,107,121,209), tract="*", <a href="http://block.group">block.group</a>="*")<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 == "Tract") {<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="*") <br> + ks.geo=geo.make(state=20, county=c(1,5,43,45,59,91,103,107,121,209), tract="*")<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 == "Place") {<br> + # Place Geographies:<br> + mo.geo=geo.make(state=29, place="*")<br> + ks.geo=geo.make(state=20, place="*")<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 == "County") {<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 == "MSA") {<br> + # MSA Geographies - cannot be pulled by County or State, so getting all<br> + geo <- geo.make(msa="*") <br> + # Set the stateFIPS so that data appends correctly<br> + stateFIPS = 99<br> + }<o:p></o:p></pre>
<pre> <br> # Clean up variables that are no longer needed.<br> if (fileGeo != "MSA") {<o:p></o:p></pre>
<pre> + rm(mo.geo, ks.geo)<br> + }<o:p></o:p></pre>
<pre> <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> = "B09001", 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> Warning message:<br> In acs.lookup(<a href="http://table.name">table.name</a> = "B09001", 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()<o:p></o:p></pre>
<pre> ownChildren.byFamilyType = acs.lookup(<a href="http://table.name">table.name</a>="B09002", 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> Warning message:<br> In acs.lookup(<a href="http://table.name">table.name</a> = "B09002", 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()<o:p></o:p></pre>
<pre> <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="acs")<o:p></o:p></pre>
<pre> Error in if (url.test["statusMessage"] != "OK") { : <br> missing value where TRUE/FALSE needed<o:p></o:p></pre>
<pre> <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 == "Tract") {<o:p></o:p></pre>
<pre> + myFIPS = paste(geography(children.data)$state, sprintf("%03d",geography(children.data)$county), geography(children.data)$tract, sep="")<br> + } else if (fileGeo == "County") {<br> + myFIPS = paste(geography(children.data)$state, sprintf("%03s",geography(children.data)$county), sep="")<br> + } else if (fileGeo == "Place") {<br> + myFIPS = paste(geography(children.data)$state, sprintf("%05s",geography(children.data)$place), sep="")<br> + } else if (fileGeo == "BlockGroup") {<br> + myFIPS = paste(geography(children.data)$state, sprintf("%03d",geography(children.data)$county), sprintf("%06d",geography(children.data)$tract), geography(children.data)$blockgroup, sep="")<br> + } else if (fileGeo == "MSA") {<br> + myFIPS = geography(children.data)$metropolitanstatisticalareamicropolitanstatisticalarea<br> + }<br> Error in geography(children.data) : object 'children.data' not found<o:p></o:p></pre>
<pre> <br> if (fileGeo != "MSA" && fileGeo != "Place") {<o:p></o:p></pre>
<pre> + countyFIPS = paste(geography(children.data)$state, sprintf("%03s",geography(children.data)$county), sep="")<br> + stateFIPS = geography(children.data)$state<br> + } else if(fileGeo != "MSA") {<br> + stateFIPS = geography(children.data)$state<br> + }<br> Error in geography(children.data) : object 'children.data' not found<o:p></o:p></pre>
<pre> <br> 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> # Overwrite default ACS field names with English<br> cols_children = c("GeoStr", "FIPS", "CountyFIPS", "CountyName", "StateFIPS", "StateAbbr", "Period", "Dataset", "PopulationUnder18", "Under18InHouseholds", "AgeUnder3Years", "Age3to4", "Age5", "Age6to8", "Age9to11", "Age12to14", "Age15to17", "Under18InGroupQuarters", "OwnChildrenUnder18", "InMarriedCouples","InMarriedCouples_Under3years","InMarriedCouples_3to4years","InMarriedCouples_5years","InMarriedCouples_6to11years","InMarriedCouples_12to17years","InOtherFamilies","MaleHoH","MaleHoH_Under3years","MaleHoH_3to4years","MaleHoH_5years","MaleHoH_6to11years","MaleHoH_12to17years","FemaleHoH","FemaleHoH_Under3years","FemaleHoH_3to4years","FemaleHoH_5years","FemaleHoH_6to11years","FemaleHoH_12to17years")<br> colnames(children.df)=cols_children<o:p></o:p></pre>
<pre> Error in colnames(children.df) = cols_children : <br> object 'children.df' not found<o:p></o:p></pre>
<pre> <br> # Set rownames to NULL, so it defaults to a sequential numeric output<br> rownames(children.df) <- NULL<o:p></o:p></pre>
<pre> Error in rownames(children.df) <- NULL : object 'children.df' not found<o:p></o:p></pre>
<pre> <br> #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, :<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<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre> [4 <text/plain; us-ascii (7bit)>]<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>