Skip to content

Commit 7b84533

Browse files
committed
lintr
1 parent 87b375f commit 7b84533

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

R/data.table.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -741,8 +741,9 @@ replace_dot_alias = function(e) {
741741
if (is.character(j)) {
742742
if (!missingby) {
743743
warning(
744-
"`by` or `keyby` is ignored when `j` is a character vector used for column selection. ",
745-
"Perhaps you intended to use `.SD`? For example: DT[, .SD[, ", deparse(jsub), "], by = ...]"
744+
"`by` or `keyby` is ignored when `j` is a character vector used for column selection. ",
745+
"Perhaps you intended to use `.SD`? For example: DT[, .SD[, ", deparse(jsub), "], by = ...]",
746+
call. = FALSE
746747
)
747748
}
748749
if (notj) {
@@ -770,8 +771,8 @@ replace_dot_alias = function(e) {
770771
} else if (is.numeric(j)) {
771772
if (!missingby) {
772773
warning(
773-
"`by` or `keyby` is ignored when `j` is a numeric vector used for column selection. ",
774-
"Perhaps you intended to use `.SD`? For example: DT[, .SD[, ", deparse(jsub), "], by = ...]"
774+
"`by` or `keyby` is ignored when `j` is a numeric vector used for column selection. ", "Perhaps you intended to use `.SD`? For example: DT[, .SD[, ", deparse(jsub), "], by = ...]",
775+
call. = FALSE
775776
)
776777
}
777778
j = as.integer(j)

man/data.table.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ data.table(\dots, keep.rownames=FALSE, check.names=FALSE, key=NULL, stringsAsFac
9797
9898
See \href{../doc/datatable-intro.html}{\code{vignette("datatable-intro")}} and \code{example(data.table)}.}
9999
100-
\item{by}{ Column names are seen as if they are variables (as in \code{j} when \code{with=TRUE}). \emph{Note that \code{by} and \code{keyby} are ignored when \code{j} is a character or numeric vector used for selecting columns (i.e., when the internal \code{with=FALSE} is triggered).} The \code{data.table} is then grouped by the \code{by} and \code{j} is evaluated within each group. ...}
101-
100+
\item{by}{ Column names are seen as if they are variables (as in \code{j} when \code{with=TRUE}). \emph{Note that \code{by} and \code{keyby} are ignored when \code{j} is a character or numeric vector used for selecting columns (i.e., when the internal \code{with=FALSE} is triggered).} The \code{data.table} is then grouped by the \code{by} and \code{j} is evaluated within each group. The order of the rows within each group is preserved, as is the order of the groups. \code{by} accepts:
101+
102102
\itemize{
103103
\item A single unquoted column name: e.g., \code{DT[, .(sa=sum(a)), by=x]}
104104

0 commit comments

Comments
 (0)