You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# split data.frame way, using `f` and not `by` argument
2178
+
if (!missing(f)) {
2179
+
if (!length(f) && nrow(x))
2180
+
stop("group length is 0 but data nrow > 0")
2181
+
if (!missing(by))
2182
+
stop("passing 'f' argument together with 'by' is not allowed, use 'by' when split by column in data.table and 'f' when split by external factor")
2183
+
# same as split.data.frame - handling all exceptions, factor orders etc, in a single stream of processing was a nightmare in factor and drop consistency
if (missing(by)) stop("you must provide 'by' or 'f' arguments")
2187
+
# check reserved column names during processing
2188
+
if (".ll.tech.split"%in% names(x)) stop("column '.ll.tech.split' is reserved for split.data.table processing")
2189
+
if (".nm.tech.split"%in%by) stop("column '.nm.tech.split' is reserved for split.data.table processing")
2190
+
if (!all(by%in% names(x))) stop("argument 'by' must refer to data.table column names")
2191
+
if (!all(by.atomic<- sapply(by, function(.by) is.atomic(x[[.by]])))) stop(sprintf("argument 'by' must refer only to atomic type columns, classes of '%s' columns are not atomic type", paste(by[!by.atomic], collapse=", ")))
2192
+
# list of data.tables (flatten) or list of lists of ... data.tables
2193
+
make.levels=function(x, cols, sorted) {
2194
+
by.order=if (!sorted) x[, funique(.SD), .SDcols=cols] # remember order of data, only when not sorted=FALSE
2195
+
ul= lapply(setNames(nm=cols), function(col) if (!is.factor(x[[col]])) unique(x[[col]]) else levels(x[[col]]))
28. Joins (and binary search based subsets) using `on=` argument now reuses existing (secondary) indices, [#1439](https://github.com/Rdatatable/data.table/issues/1439). Thanks @jangorecki.
74
+
75
+
29. New `split` method for data.table. Faster, more flexible and consistent with data.frame method. Closes [#1389](https://github.com/Rdatatable/data.table/issues/1389).
0 commit comments