Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nitish jha authored and nitish jha committed Aug 8, 2024
1 parent 5d4bc63 commit 9fc2774
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion man/data.table.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ DT[, m:=mean(v), by=x][] # add new column by reference by group
# Injecting function into env parameter
DT <- data.table(a = rep(1:2, each = 5), b = 1:10)

DT[, .(f=f(b), gval=g(b)), by = a, env = list(f = "sum", g=mean), verbose=TRUE]\
DT[, .(f=f(b), gval=g(b)), by = a, env = list(f = "sum", g=mean), verbose=TRUE]

# advanced usage
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)
Expand Down

0 comments on commit 9fc2774

Please sign in to comment.