Skip to content

Commit 4d6bfe3

Browse files
committed
minor
1 parent 7c6b9c8 commit 4d6bfe3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

man/data.table.Rd

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -351,22 +351,22 @@ haskey(kDT) # TRUE
351351
key(kDT) # "x"
352352

353353
# Keyed subsetting (no 'on' needed)
354-
setkey(kDT, x) # Set a key on column 'x'
355-
kDT[.("a")] # Returns all rows where x = "a"
354+
setkey(DT, x) # Set a key on column 'x'
355+
DT[.("a")] # Returns all rows where x = "a"
356356

357357
# Indexed subsetting (requires 'on')
358-
setindex(kDT, x) # Set an index on column 'x'
359-
kDT[.("b"), on = "x"] # Works, returns all rows where x = "b" (for detailed explanation visit setkey.rd)
360-
# kDT[.("b")] # this will throw error
358+
setindex(DT, x) # Set an index on column 'x'
359+
DT[.("b"), on = "x"] # Works, returns all rows where x = "b" (for detailed explanation visit setkey.rd)
360+
# DT[.("b")] # this will throw error
361361

362362
# single and multiple indices
363363
# index on a single column ('y')
364-
setindex(kDT, y)
365-
indices(kDT)
364+
setindex(DT, y)
365+
indices(DT)
366366

367367
# multi-column index
368-
setindexv(kDT, list("x", c("x", "y")))
369-
indices(kDT) # Shows an index on 'x' and a composite index on '(x,y)'
368+
setindexv(DT, list("x", c("x", "y")))
369+
indices(DT) # Shows an index on 'x' and a composite index on '(x,y)'
370370

371371
# fast *keyed* subsets
372372
kDT["a"] # subset-as-join on *key* column 'x'

0 commit comments

Comments
 (0)