ben519 / mltools

Exploratory and diagnostic machine learning tools for R
Other
72 stars 26 forks source link

All NA factor column in dt breaks sparsify(dt, sparsifyNAs = F) sometimes... #16

Closed ben519 closed 5 years ago

ben519 commented 5 years ago

Example:

dt <- data.table(ufCol = factor(c(NA, NA, NA), levels = c("a", "b"), ordered = FALSE))
mltools::sparsify(dt, sparsifyNAs = FALSE)

Error in vecseq(f__, len__, if (allow.cartesian || notjoin || !anyDuplicated(f__,  : 
  Join results in 6 rows; more than 5 = nrow(x)+nrow(i). Check for duplicate key values in i each of which join to the same group in x over and over again. If that's ok, try by=.EACHI to run j for each group to avoid the large allocation. If you are sure you wish to proceed, rerun with allow.cartesian=TRUE. Otherwise, please search for this error message in the FAQ, Wiki, Stack Overflow and data.table issue tracker for advice.