@@ -33,7 +33,7 @@ setorderv(x, cols = colnames(x), order=1L, na.last=FALSE)
3333# optimised to use data.table' s internal fast order
3434# x[order(., na.last=TRUE)]
3535# x[order(., decreasing=TRUE)]
36- # sort_by(x, ., na.last=TRUE, decreasing=FALSE)
36+ # sort_by(x, ., na.last=TRUE, decreasing=FALSE) # R >= 4.4.0
3737}
3838\arguments {
3939\item {x }{ A \code {data.table }. }
@@ -48,7 +48,7 @@ when \code{b} is of type \code{character} as well. }
4848\code {order } must be either \code {1 } or equal to that of \code {cols }. If
4949\code {length(order ) == 1 }, it is recycled to \code {length(cols )}. }
5050\item {na.last }{ \code {logical }. If \code {TRUE }, missing values in the data are placed last ; if \code {FALSE }, they are placed first ; if \code {NA } they are removed.
51- \code {na.last = NA } is valid only for \code {x [order(. , na.last )]} and related \code {sort_by(x , . )} and its
51+ \code {na.last = NA } is valid only for \code {x [order(. , na.last )]} and related \code {sort_by(x , . )} (\ eqn {\ R \ ge 4.4.0 }) and its
5252default is \code {TRUE }. \code {setorder } and \code {setorderv } only accept
5353\code {TRUE }/ \code {FALSE } with default \code {FALSE }. }
5454}
@@ -73,7 +73,7 @@ sets the \code{sorted} attribute.
7373
7474\code {na.last } argument , by default , is \code {FALSE } for \code {setorder } and
7575\code {setorderv } to be consistent with \code {data.table }' s \c ode{setkey} and
76- is \c ode{TRUE} for \c ode{x[order(.)]} and \c ode{sort_by(x, .)} to be consistent with \c ode{base::order}.
76+ is \c ode{TRUE} for \c ode{x[order(.)]} and \c ode{sort_by(x, .)} ( \e qn{ \R \g e 4.4.0}) to be consistent with \c ode{base::order}.
7777Only \c ode{x[order(.)]} (and related \c ode{sort_by(x, .)}) can have \c ode{na.last = NA} as it is a subset operation
7878as opposed to \c ode{setorder} or \c ode{setorderv} which reorders the data.table
7979by reference.
@@ -99,7 +99,7 @@ was started in. By contrast, \code{"america" < "BRAZIL"} is always \code{FALSE}
9999If \c ode{setorder} results in reordering of the rows of a keyed \c ode{data.table},
100100then its key will be set to \c ode{NULL}.
101101
102- \c ode{sort_by(x, y, \d ots)} is the S3 method for the generic \c ode{sort_by} for \c ode{data.table}' s.
102+ Starting from \R 4.4.0, \c ode{sort_by(x, y, \d ots)} is the S3 method for the generic \c ode{sort_by} for \c ode{data.table}' s.
103103It uses the same formula or list interfaces as data.frame ' s \c ode{sort_by} but internally uses \c ode{data.table}' s fast ordering ,
104104hence it behaves the same as \code {x [order(. )]} and takes the same optional named arguments and their defaults.
105105
0 commit comments