Skip to content

Commit

Permalink
Update data.table.R
Browse files Browse the repository at this point in the history
  • Loading branch information
ColeMiller1 authored May 27, 2020
1 parent cacdc92 commit 7463633
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/data.table.R
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,11 @@ replace_dot_alias = function(e) {

if (is.data.table(jval)) {
setattr(jval, 'class', class(x)) # fix for #64
if (haskey(x) && all(key(x) %chin% names(jval)) && suppressWarnings(is.sorted(jval, by=key(x)))) # TO DO: perhaps this usage of is.sorted should be allowed internally then (tidy up and make efficient)
if (haskey(x) &&
all(key(x) == names(jval)) && ## order of names should matter for the key; %chin% wouldn't care about order!
((is.null(irows) && jsub %iscall% "list" && all(vapply_1b(as.list(jsub)[-1L], is.name))) || ##fix for #4498
suppressWarnings(is.sorted(jval, by=key(x))))
) # TO DO: perhaps this usage of is.sorted should be allowed internally then (tidy up and make efficient)
setattr(jval, 'sorted', key(x))
if (any(sapply(jval, is.null))) stop("Internal error: j has created a data.table result containing a NULL column") # nocov
}
Expand Down

0 comments on commit 7463633

Please sign in to comment.