Invalid keys can arise by going 'under the hood'; e.g., attr(DT,"sorted")="z", or somehow ending up with unordered factor levels. A warning is issued so the root cause can be fixed. Thanks to Timothee Carayol for highlighting. * A new copy() function has been added, FR#1501. ...