acs v2.1.1 is now on CRAN

August 14, 2017
By

(This article was first published on R – AriLamstein.com, and kindly contributed to R-bloggers)

A new version of the acs package is now on CRAN. I recommend that all users of choroplethr update to this version. Here is how to do it:

update.packages()

packageVersion('acs')

[1] ‘2.1.1’

As a reminder, after updating the acs package you might need to reinstall your Census API key with ?api.key.install.

New Performance Issue

Internally, choroplethr uses the acs package to fetch demographic data from the Census Bureau’s API. Unfortunately, this version of the acs package introduces a performance issue (and solution) when fetching data. Here is an example of the problem:

library(choroplethr)

time_demographic_get = function()
{
    start.time = Sys.time()
    df = get_state_demographics()
    end.time = Sys.time()
    end.time - start.time
}

time_demographic_get() # 1.9 minutes

Performance Issue Fix

The fix for this performance issue is simply to call the function ?acs.tables.install. You only need to call this function once. Doing so will dramatically speed up the performance of choroplethr’s various “get_*_demographics” functions:

acs.tables.install()

time_demographic_get() # 9.4 seconds

A big thank you to Ezra Haber Glenn, the author of the acs package, for his continued work maintaining the package.

The post acs v2.1.1 is now on CRAN appeared first on AriLamstein.com.

To leave a comment for the author, please follow the link and comment on their blog: R – AriLamstein.com.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)