From e4b0bbbbe1e276fc25167fcaf448432c4e34dc0c Mon Sep 17 00:00:00 2001 From: vinit1204 Date: Sat, 21 Dec 2024 06:49:38 +0530 Subject: [PATCH] Add example of cols= to ?setindexv (#6678) * fixed#6665 * simplify --------- Co-authored-by: Michael Chirico --- man/setkey.Rd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/man/setkey.Rd b/man/setkey.Rd index 378f1a106..b8c9b1ce8 100644 --- a/man/setkey.Rd +++ b/man/setkey.Rd @@ -142,6 +142,11 @@ setindex(DT, B) indices(DT) # get indices single vector indices(DT, vectors = TRUE) # get indices list +# Setting multiple indices at once +DT = data.table(A = 5:1, B = letters[5:1], C = 10:6) +setindexv(DT, list(c("A", "B"), c("B", "C"))) +print(DT, show.indices=TRUE) + # Use the dot .(subset_value) syntax with integer keys: DT = data.table(id = 2:1) setkey(DT, id)