mrdwab / splitstackshape

R functions to split concatenated data, conveniently stack columns of data.frames, and conveniently reshape data.frames.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lower data.table version dependency level?

mrdwab opened this issue · comments

Instead of 1.10.5, can lower to 1.10.4 and maybe use hasArg(logical10) (or packageVersion("data.table") < "1.10.5" or something) to decide whether to include the argument or not in fread.

Not sure if that's a good idea or not....

Done with two versions of f_split. See

temp <- if (packageVersion("data.table") < "1.10.5") {
fread(VEC, sep = sep, fill = TRUE,
blank.lines.skip = FALSE, header = FALSE,
colClasses = if (!type.convert) "character" else NULL,
strip.white = stripWhite)[, lapply(
.SD, function(x) replace(x, x == "", NA))]
} else {
fread(VEC, sep = sep, fill = TRUE,
blank.lines.skip = FALSE, header = FALSE,
colClasses = if (!type.convert) "character" else NULL,
strip.white = stripWhite, logical01 = FALSE)[, lapply(
.SD, function(x) replace(x, x == "", NA))]
}