| block_lookup | R Documentation |
Performs a hash lookup on a string column of a materialized block. Returns all rows where the column value matches one of the query keys. Hash indices are built lazily on first use and cached for subsequent calls.
block_lookup(block, column, keys, ci = FALSE)
block |
A |
column |
Character scalar. Name of the string column to match against. |
keys |
Character vector. Query values to look up. |
ci |
Logical. Case-insensitive matching (default |
A data.frame with column query_idx (1-based position in keys)
plus all columns from the block, for each (query, block_row) match pair.
f <- tempfile(fileext = ".vtr")
df <- data.frame(taxonID = 1:2,
canonicalName = c("Quercus robur", "Pinus sylvestris"))
write_vtr(df, f)
blk <- materialize(tbl(f))
hits <- block_lookup(blk, "canonicalName", c("Quercus robur"))
ci_hits <- block_lookup(blk, "canonicalName", c("quercus robur"), ci = TRUE)
unlink(f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.