HenrikBengtsson / future.apply

:rocket: R package: future.apply - Apply Function to Elements in Parallel using Futures
https://future.apply.futureverse.org
208 stars 16 forks source link

ROBUSTNESS: Add explicit 'stringsAsFactors' arguments [data.frame] #57

Closed HenrikBengtsson closed 4 years ago

HenrikBengtsson commented 4 years ago
$ for pkg in $pkgs; do echo "$pkg:"; (cd "$pkg"; grep -E "^[ \t]*[^#].*data[.]frame" -- */*.R | grep -vF stringsAsFactors;); echo; read -r -p "Press ENTER to continue ..."; done

future.apply:
R/future_by.R:  data <- as.data.frame(data)
R/future_by.R:future_by.data.frame <- function(data, INDICES, FUN, ..., simplify = TRUE) {
tests/fold.R:  E = data.frame(a = 1:3),
tests/fold.R:  F = data.frame(a = 1:3, b = letters[1:3])
tests/fold.R:make_table <- function(n) data.frame(key = sample(n), value = sample(n))
tests/future_lapply,globals.R:  obj <- data.frame(a = 1:2)
tests/future_mapply,globals.R:  obj <- data.frame(a = 1:2)
tests/future_tapply.R:  ## contingency table from data.frame : array with named dimnames
tests/future_vapply.R:  df <- data.frame(x = 1:10, y = letters[1:10])
HenrikBengtsson commented 4 years ago

Added a section to ?future_by to clarify that future_by() follows base::by() strictly and therefore uses data <- as.data.frame(data) internally which may or may not be affected by the change in behavior of stringsAsFactors depending on class(data).