Skip to content

Commit 49f8bf8

Browse files
shrink diff, use s/inject/substitute
1 parent 71c874e commit 49f8bf8

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

man/data.table.Rd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ data.table(\dots, keep.rownames=FALSE, check.names=FALSE, key=NULL, stringsAsFac
177177
See examples as well as \href{../doc/datatable-secondary-indices-and-auto-indexing.html}{\code{vignette("datatable-secondary-indices-and-auto-indexing")}}.
178178
}
179179
180-
\item{env}{ List or an environment, passed to \code{\link{substitute2}} for substitution of parameters in \code{i}, \code{j} and \code{by} (or \code{keyby}). For function names, you can use them as strings (e.g., \code{"sum"}) or pass function objects directly (e.g., \code{sum}). Use \code{verbose} to preview constructed expressions. For more details, see \href{../doc/datatable-programming.html}{\code{vignette("datatable-programming")}}.}
180+
\item{env}{ List or an environment, passed to \code{\link{substitute2}} for substitution of parameters in \code{i}, \code{j} and \code{by} (or \code{keyby}). Use \code{verbose} to preview constructed expressions. For more details see \href{../doc/datatable-programming.html}{\code{vignette("datatable-programming")}}. }
181181
182182
\item{showProgress}{ \code{TRUE} shows progress indicator with estimated time to completion for lengthy "by" operations. }
183183
}
@@ -403,7 +403,6 @@ print(DT["b", v2:=84L, on="x"]) # subassign to new column by reference (NA
403403

404404
DT[, m:=mean(v), by=x][] # add new column by reference by group
405405
# NB: postfix [] is shortcut to print()
406-
407406
# advanced usage
408407
DT = data.table(x=rep(c("b","a","c"),each=3), v=c(1,1,1,2,2,1,1,2,2), y=c(1,3,6), a=1:9, b=9:1)
409408

vignettes/datatable-programming.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ print(j)
373373
DT[, j, env = list(j = j)]
374374
```
375375

376-
### Injecting functions using strings in `env`
376+
### Substituting functions using strings in `env`
377377

378378
In `data.table`, you can inject functions into your expressions by passing their names as strings in the `env` parameter. This method allows you to use function names directly as strings, and `data.table` will automatically interpret these strings as the corresponding functions. This approach simplifies the process and makes it easier to work with function names dynamically.
379379

0 commit comments

Comments
 (0)