4

Can anyone help with this error? I am trying to download population data. I am not sure what this error is about. Here is my code.

state.IN=geo.make(state="IN")
indiana.total.pop=acs.fetch(geography=state.IN,table.number="B01003")

Error in seq.default(1, (length(in.data) - geo.length), 2) : wrong sign in 'by' argument

4
  • Apparently (length(in.data) - geo.length) leads to a to argument lower than the from = 1 argument. In that case, the by argument must be negative, since you're trying to create a descending sequence. Either you should just change 2 to -2 (if you really want a descending sequence), or you got confused with your to argument calculation.
    – Molx
    Jun 11, 2015 at 21:16
  • 1
    My API key was incorrect. Fixing that resolved my issue. Thanks
    – amccammack
    Jul 1, 2015 at 22:10
  • Having similar issue here acs.lookup(table.number = "S2503") that produces: Error in seq.default(1, length(names), 2) : wrong sign in 'by' argument @Molx Seems to be issue with tables beginning with S
    – Jebediah15
    Dec 28, 2015 at 20:52
  • Had the same problem. The solution was simple for me: make sure you activate your API key via the link sent to your email address. Apr 17, 2016 at 6:44

2 Answers 2

2

Make sure you run acs::api.key.install("YOUR CENSUS KEY") before working with any of the acs functions. I was getting the same error, and once I fixed my api key install, it resolved the issue

0

i changed the endyear from 2011 to 2014 and it fixed it for me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.