Skip to content

Commit

Permalink
change how getCensus joins dfs with large numbers of variables manual…
Browse files Browse the repository at this point in the history
…ly specified, re #82
  • Loading branch information
hrecht committed Jul 27, 2022
1 parent 335515e commit 76bd30e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/getcensus_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ getCensus <-
vars <- split(vars, ceiling(seq_along(vars)/50))
get <- lapply(vars, function(x) paste(x, sep='', collapse=","))
data <- lapply(get, function(x) getFunction(apiurl, name, key, x, region, regionin, time, year, date, period, monthly, show_call, category_code, data_type_code, naics, pscode, naics2012, naics2007, naics2002, naics1997, sic, ...))
colnames <- unlist(lapply(data, names))
data <- do.call(cbind,data)
names(data) <- colnames

data <- Reduce(function(x, y) merge(x, y, all = TRUE, sort = FALSE), data)

} else {
get <- paste(vars, sep='', collapse=',')
data <- getFunction(apiurl, name, key, get, region, regionin, time, year, date, period, monthly, show_call, category_code, data_type_code, naics, pscode, naics2012, naics2007, naics2002, naics1997, sic, ...)
Expand Down

0 comments on commit 76bd30e

Please sign in to comment.