==3797559== Memcheck, a memory error detector ==3797559== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al. ==3797559== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info ==3797559== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R --vanilla ==3797559== R Under development (unstable) (2026-04-21 r89927) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "vectra" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('vectra') Attaching package: ‘vectra’ The following object is masked from ‘package:stats’: filter > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("across") > ### * across > > flush(stderr()); flush(stdout()) > > ### Name: across > ### Title: Apply a function across multiple columns > ### Aliases: across > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > # In summarise (conceptual; across is expanded to individual expressions) > unlink(f) > > > > > cleanEx() > nameEx("append_vtr") > ### * append_vtr > > flush(stderr()); flush(stdout()) > > ### Name: append_vtr > ### Title: Append rows to an existing .vtr file > ### Aliases: append_vtr > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars[1:10, ], f) > append_vtr(mtcars[11:20, ], f) ==3797559== Invalid read of size 16 ==3797559== at 0x1B6315EC: _mm_loadu_si128 (/usr/lib/gcc/x86_64-redhat-linux/14/include/emmintrin.h:706) ==3797559== by 0x1B6315EC: tdc_copy16 (packages/tests-vg/vectra/src/tdc/src/entropy/../core/simd.h:54) ==3797559== by 0x1B6315EC: lz_decode_fast (packages/tests-vg/vectra/src/tdc/src/entropy/lz.c:821) ==3797559== by 0x1B6315EC: lz_decode_core (packages/tests-vg/vectra/src/tdc/src/entropy/lz.c:960) ==3797559== by 0x1B6315EC: lz_decode (packages/tests-vg/vectra/src/tdc/src/entropy/lz.c:996) ==3797559== by 0x1B6315EC: lz_decode (packages/tests-vg/vectra/src/tdc/src/entropy/lz.c:991) ==3797559== by 0x1B628090: driver_decode_block_impl (packages/tests-vg/vectra/src/tdc/src/api/decode_impl.c:252) ==3797559== by 0x1B628502: tdc_decode_block_into (packages/tests-vg/vectra/src/tdc/src/api/decode_into.c:102) ==3797559== by 0x1B61F4F8: vtr_decode_column_tdc_into (packages/tests-vg/vectra/src/vtr_codec_tdc.c:345) ==3797559== by 0x1B61F4F8: vtr_decode_column_tdc_into (packages/tests-vg/vectra/src/vtr_codec_tdc.c:310) ==3797559== by 0x1B61A9F1: read_rg_tdc_with_fp (packages/tests-vg/vectra/src/vtr1_tdc.c:845) ==3797559== by 0x1B61CC61: vtr1_read_rowgroup_tdc_ex (packages/tests-vg/vectra/src/vtr1_tdc.c:885) ==3797559== by 0x1B61E9DC: vtr_append_node (packages/tests-vg/vectra/src/vtr_append.c:86) ==3797559== by 0x1B61EB72: C_append_vtr (packages/tests-vg/vectra/src/vtr_append.c:122) ==3797559== by 0x4A9169: R_doDotCall (svn/R-devel/src/main/dotcode.c:757) ==3797559== by 0x4E40C3: bcEval_loop (svn/R-devel/src/main/eval.c:8678) ==3797559== by 0x4F40B7: bcEval (svn/R-devel/src/main/eval.c:7511) ==3797559== by 0x4F40B7: bcEval (svn/R-devel/src/main/eval.c:7496) ==3797559== by 0x4F43EA: Rf_eval (svn/R-devel/src/main/eval.c:1167) ==3797559== Address 0x172229ca is 122 bytes inside a block of size 137 alloc'd ==3797559== at 0x484B347: realloc (/builddir/build/BUILD/valgrind-3.24.0/coregrind/m_replacemalloc/vg_replace_malloc.c:1801) ==3797559== by 0x1B61A8FD: read_rg_tdc_with_fp (packages/tests-vg/vectra/src/vtr1_tdc.c:810) ==3797559== by 0x1B61CC61: vtr1_read_rowgroup_tdc_ex (packages/tests-vg/vectra/src/vtr1_tdc.c:885) ==3797559== by 0x1B61E9DC: vtr_append_node (packages/tests-vg/vectra/src/vtr_append.c:86) ==3797559== by 0x1B61EB72: C_append_vtr (packages/tests-vg/vectra/src/vtr_append.c:122) ==3797559== by 0x4A9169: R_doDotCall (svn/R-devel/src/main/dotcode.c:757) ==3797559== by 0x4E40C3: bcEval_loop (svn/R-devel/src/main/eval.c:8678) ==3797559== by 0x4F40B7: bcEval (svn/R-devel/src/main/eval.c:7511) ==3797559== by 0x4F40B7: bcEval (svn/R-devel/src/main/eval.c:7496) ==3797559== by 0x4F43EA: Rf_eval (svn/R-devel/src/main/eval.c:1167) ==3797559== by 0x4F637D: R_execClosure (svn/R-devel/src/main/eval.c:2387) ==3797559== by 0x4F7046: applyClosure_core (svn/R-devel/src/main/eval.c:2300) ==3797559== by 0x4F7A38: Rf_applyClosure (svn/R-devel/src/main/eval.c:2322) ==3797559== > result <- tbl(f) |> collect() > stopifnot(nrow(result) == 20L) > unlink(f) > > > > > cleanEx() > nameEx("arrange") > ### * arrange > > flush(stderr()); flush(stdout()) > > ### Name: arrange > ### Title: Sort rows by column values > ### Aliases: arrange > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> arrange(desc(mpg)) |> collect() |> head() mpg cyl disp hp drat wt qsec vs am gear carb 1 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 2 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 3 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 4 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 5 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 6 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 > unlink(f) > > > > > cleanEx() > nameEx("bind_rows") > ### * bind_rows > > flush(stderr()); flush(stdout()) > > ### Name: bind_rows > ### Title: Bind rows or columns from multiple vectra tables > ### Aliases: bind_rows bind_cols > > ### ** Examples > > f1 <- tempfile(fileext = ".vtr") > f2 <- tempfile(fileext = ".vtr") > write_vtr(data.frame(x = 1:3, y = 4:6), f1) > write_vtr(data.frame(x = 7:9, y = 10:12), f2) > bind_rows(tbl(f1), tbl(f2)) |> collect() x y 1 1 4 2 2 5 3 3 6 4 7 10 5 8 11 6 9 12 > bind_cols(tbl(f1), tbl(f2)) x y x y 1 1 4 7 10 2 2 5 8 11 3 3 6 9 12 > unlink(c(f1, f2)) > > > > > cleanEx() > nameEx("block_lookup") > ### * block_lookup > > flush(stderr()); flush(stdout()) > > ### Name: block_lookup > ### Title: Probe a materialized block by column value > ### Aliases: block_lookup > > ### ** Examples > > > > > > cleanEx() > nameEx("collect") > ### * collect > > flush(stderr()); flush(stdout()) > > ### Name: collect > ### Title: Execute a lazy query and return a data.frame > ### Aliases: collect > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > result <- tbl(f) |> collect() > head(result) mpg cyl disp hp drat wt qsec vs am gear carb 1 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 2 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 3 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1 4 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1 5 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2 6 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1 > unlink(f) > > > > > cleanEx() > nameEx("count") > ### * count > > flush(stderr()); flush(stdout()) > > ### Name: count > ### Title: Count observations by group > ### Aliases: count tally > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> count(cyl) |> collect() cyl n 1 4 11 2 6 7 3 8 14 > unlink(f) > > > > > cleanEx() > nameEx("create_index") > ### * create_index > > flush(stderr()); flush(stdout()) > > ### Name: create_index > ### Title: Create a hash index on a .vtr file column > ### Aliases: create_index > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(data.frame(id = letters, val = 1:26, stringsAsFactors = FALSE), f) > create_index(f, "id") > tbl(f) |> filter(id == "m") |> collect() id val 1 m 13 > unlink(c(f, paste0(f, ".id.vtri"))) > > > > > cleanEx() > nameEx("cross_join") > ### * cross_join > > flush(stderr()); flush(stdout()) > > ### Name: cross_join > ### Title: Cross join two vectra tables > ### Aliases: cross_join > > ### ** Examples > > f1 <- tempfile(fileext = ".vtr") > f2 <- tempfile(fileext = ".vtr") > write_vtr(data.frame(a = 1:2), f1) > write_vtr(data.frame(b = c("x", "y", "z"), stringsAsFactors = FALSE), f2) > cross_join(tbl(f1), tbl(f2)) a b 1 1 x 2 1 y 3 1 z 4 2 x 5 2 y 6 2 z > unlink(c(f1, f2)) > > > > > cleanEx() > nameEx("delete_vtr") > ### * delete_vtr > > flush(stderr()); flush(stdout()) > > ### Name: delete_vtr > ### Title: Logically delete rows from a .vtr file > ### Aliases: delete_vtr > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > > # Delete the first and third rows (0-based indices 0 and 2) > delete_vtr(f, c(0, 2)) > > result <- tbl(f) |> collect() > stopifnot(nrow(result) == nrow(mtcars) - 2L) > > unlink(c(f, paste0(f, ".del"))) > > > > > cleanEx() > nameEx("desc") > ### * desc > > flush(stderr()); flush(stdout()) > > ### Name: desc > ### Title: Mark a column for descending sort order > ### Aliases: desc > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> arrange(desc(mpg)) |> collect() |> head() mpg cyl disp hp drat wt qsec vs am gear carb 1 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 2 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 3 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 4 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 5 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 6 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 > unlink(f) > > > > > cleanEx() > nameEx("diff_vtr") > ### * diff_vtr > > flush(stderr()); flush(stdout()) > > ### Name: diff_vtr > ### Title: Compute the logical diff between two .vtr files > ### Aliases: diff_vtr > > ### ** Examples > > f1 <- tempfile(fileext = ".vtr") > f2 <- tempfile(fileext = ".vtr") > df1 <- data.frame(id = 1:5, val = letters[1:5], stringsAsFactors = FALSE) > df2 <- data.frame(id = c(3L, 4L, 5L, 6L, 7L), + val = c("C", "d", "e", "f", "g"), + stringsAsFactors = FALSE) > write_vtr(df1, f1) > write_vtr(df2, f2) > > d <- diff_vtr(f1, f2, "id") > # Rows 1 and 2 deleted; rows 6 and 7 added > stopifnot(all(d$deleted %in% c(1, 2))) > stopifnot(all(collect(d$added)$id %in% c(6, 7))) > > unlink(c(f1, f2)) > > > > > cleanEx() > nameEx("distinct") > ### * distinct > > flush(stderr()); flush(stdout()) > > ### Name: distinct > ### Title: Keep distinct/unique rows > ### Aliases: distinct > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> distinct(cyl) |> collect() cyl 1 4 2 6 3 8 > unlink(f) > > > > > cleanEx() > nameEx("explain") > ### * explain > > flush(stderr()); flush(stdout()) > > ### Name: explain > ### Title: Print the execution plan for a vectra query > ### Aliases: explain > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> filter(cyl > 4) |> select(mpg, cyl) |> explain() vectra execution plan ProjectNode [streaming] FilterNode [streaming] ScanNode [streaming, 2/11 cols (pruned), predicate pushdown, tdc stats] Output columns (2): mpg cyl > unlink(f) > > > > > cleanEx() > nameEx("filter") > ### * filter > > flush(stderr()); flush(stdout()) > > ### Name: filter > ### Title: Filter rows of a vectra query > ### Aliases: filter > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> filter(cyl > 4) |> collect() |> head() mpg cyl disp hp drat wt qsec vs am gear carb 1 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 2 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 3 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1 4 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2 5 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1 6 14.3 8 360 245 3.21 3.570 15.84 0 0 3 4 > unlink(f) > > > > > cleanEx() > nameEx("glimpse") > ### * glimpse > > flush(stderr()); flush(stdout()) > > ### Name: glimpse > ### Title: Get a glimpse of a vectra table > ### Aliases: glimpse > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> glimpse() vectra lazy table [? x 11] $ mpg 21.0, 21.0, 22.8, 21.4, 18.7 $ cyl 6, 6, 4, 6, 8 $ disp 160, 160, 108, 258, 360 $ hp 110, 110, 93, 110, 175 $ drat 3.90, 3.90, 3.85, 3.08, 3.15 $ wt 2.620, 2.875, 2.320, 3.215, 3.440 $ qsec 16.46, 17.02, 18.61, 19.44, 17.02 $ vs 0, 0, 1, 1, 0 $ am 1, 1, 1, 0, 0 $ gear 4, 4, 4, 3, 3 $ carb 4, 4, 1, 1, 2 > unlink(f) > > > > > cleanEx() > nameEx("group_by") > ### * group_by > > flush(stderr()); flush(stdout()) > > ### Name: group_by > ### Title: Group a vectra query by columns > ### Aliases: group_by > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> group_by(cyl) |> summarise(avg = mean(mpg)) |> collect() cyl avg 1 4 26.66364 2 6 19.74286 3 8 15.10000 > unlink(f) > > > > > cleanEx() > nameEx("has_index") > ### * has_index > > flush(stderr()); flush(stdout()) > > ### Name: has_index > ### Title: Check if a hash index exists for a .vtr column > ### Aliases: has_index > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(data.frame(id = letters, val = 1:26, stringsAsFactors = FALSE), f) > has_index(f, "id") # FALSE [1] FALSE > create_index(f, "id") > has_index(f, "id") # TRUE [1] TRUE > unlink(c(f, paste0(f, ".id.vtri"))) > > > > > cleanEx() > nameEx("left_join") > ### * left_join > > flush(stderr()); flush(stdout()) > > ### Name: left_join > ### Title: Join two vectra tables > ### Aliases: left_join inner_join right_join full_join semi_join anti_join > > ### ** Examples > > f1 <- tempfile(fileext = ".vtr") > f2 <- tempfile(fileext = ".vtr") > write_vtr(data.frame(id = c(1, 2, 3), x = c(10, 20, 30)), f1) > write_vtr(data.frame(id = c(1, 2, 4), y = c(100, 200, 400)), f2) > left_join(tbl(f1), tbl(f2), by = "id") |> collect() id x y 1 1 10 100 2 2 20 200 3 3 30 NA > unlink(c(f1, f2)) > > > > > cleanEx() > nameEx("link") > ### * link > > flush(stderr()); flush(stdout()) > > ### Name: link > ### Title: Define a link between a fact table and a dimension table > ### Aliases: link > > ### ** Examples > > > > > > cleanEx() > nameEx("lookup") > ### * lookup > > flush(stderr()); flush(stdout()) > > ### Name: lookup > ### Title: Look up columns from linked dimension tables > ### Aliases: lookup > > ### ** Examples > > > > > > cleanEx() > nameEx("materialize") > ### * materialize > > flush(stderr()); flush(stdout()) > > ### Name: materialize > ### Title: Materialize a vectra node into a reusable in-memory block > ### Aliases: materialize > > ### ** Examples > > > > > > cleanEx() > nameEx("mutate") > ### * mutate > > flush(stderr()); flush(stdout()) > > ### Name: mutate > ### Title: Add or transform columns > ### Aliases: mutate > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> mutate(kpl = mpg * 0.425144) |> collect() |> head() mpg cyl disp hp drat wt qsec vs am gear carb kpl 1 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 8.928024 2 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 8.928024 3 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1 9.693283 4 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1 9.098082 5 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2 7.950193 6 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1 7.695106 > unlink(f) > > > > > cleanEx() > nameEx("pull") > ### * pull > > flush(stderr()); flush(stdout()) > > ### Name: pull > ### Title: Extract a single column as a vector > ### Aliases: pull > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> pull(mpg) |> head() [1] 21.0 21.0 22.8 21.4 18.7 18.1 > unlink(f) > > > > > cleanEx() > nameEx("reframe") > ### * reframe > > flush(stderr()); flush(stdout()) > > ### Name: reframe > ### Title: Summarise with variable-length output per group > ### Aliases: reframe > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(data.frame(g = c("a", "a", "b"), x = c(1, 2, 3)), f) > tbl(f) |> group_by(g) |> reframe(range_x = range(x)) g range_x 1 a 1 2 a 2 3 b 3 4 b 3 > unlink(f) > > > > > cleanEx() > nameEx("relocate") > ### * relocate > > flush(stderr()); flush(stdout()) > > ### Name: relocate > ### Title: Relocate columns > ### Aliases: relocate > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> relocate(hp, wt, .before = cyl) |> collect() |> head() mpg hp wt cyl disp drat qsec vs am gear carb 1 21.0 110 2.620 6 160 3.90 16.46 0 1 4 4 2 21.0 110 2.875 6 160 3.90 17.02 0 1 4 4 3 22.8 93 2.320 4 108 3.85 18.61 1 1 4 1 4 21.4 110 3.215 6 258 3.08 19.44 1 0 3 1 5 18.7 175 3.440 8 360 3.15 17.02 0 0 3 2 6 18.1 105 3.460 6 225 2.76 20.22 1 0 3 1 > unlink(f) > > > > > cleanEx() > nameEx("rename") > ### * rename > > flush(stderr()); flush(stdout()) > > ### Name: rename > ### Title: Rename columns > ### Aliases: rename > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> rename(miles_per_gallon = mpg) |> collect() |> head() miles_per_gallon cyl disp hp drat wt qsec vs am gear carb 1 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 2 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 3 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1 4 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1 5 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2 6 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1 > unlink(f) > > > > > cleanEx() > nameEx("select") > ### * select > > flush(stderr()); flush(stdout()) > > ### Name: select > ### Title: Select columns from a vectra query > ### Aliases: select > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> select(mpg, cyl) |> collect() |> head() mpg cyl 1 21.0 6 2 21.0 6 3 22.8 4 4 21.4 6 5 18.7 8 6 18.1 6 > unlink(f) > > > > > cleanEx() > nameEx("slice") > ### * slice > > flush(stderr()); flush(stdout()) > > ### Name: slice > ### Title: Select rows by position > ### Aliases: slice > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> slice(1, 3, 5) mpg cyl disp hp drat wt qsec vs am gear carb 1 21.0 6 160 110 3.90 2.62 16.46 0 1 4 4 3 22.8 4 108 93 3.85 2.32 18.61 1 1 4 1 5 18.7 8 360 175 3.15 3.44 17.02 0 0 3 2 > unlink(f) > > > > > cleanEx() > nameEx("slice_head") > ### * slice_head > > flush(stderr()); flush(stdout()) > > ### Name: slice_head > ### Title: Select first or last rows > ### Aliases: slice_head slice_tail slice_min slice_max > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> slice_head(n = 3) |> collect() mpg cyl disp hp drat wt qsec vs am gear carb 1 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 2 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 3 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1 > tbl(f) |> slice_min(order_by = mpg, n = 3) |> collect() mpg cyl disp hp drat wt qsec vs am gear carb 15 10.4 8 472 205 2.93 5.250 17.98 0 0 3 4 16 10.4 8 460 215 3.00 5.424 17.82 0 0 3 4 24 13.3 8 350 245 3.73 3.840 15.41 0 0 3 4 > tbl(f) |> slice_max(order_by = mpg, n = 3) |> collect() mpg cyl disp hp drat wt qsec vs am gear carb 20 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 18 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 19 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 28 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 > unlink(f) > > > > > cleanEx() > nameEx("summarise") > ### * summarise > > flush(stderr()); flush(stdout()) > > ### Name: summarise > ### Title: Summarise grouped data > ### Aliases: summarise summarize > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> group_by(cyl) |> summarise(avg_mpg = mean(mpg)) |> collect() cyl avg_mpg 1 4 26.66364 2 6 19.74286 3 8 15.10000 > unlink(f) > > > > > cleanEx() > nameEx("tbl") > ### * tbl > > flush(stderr()); flush(stdout()) > > ### Name: tbl > ### Title: Create a lazy table reference from a .vtr file > ### Aliases: tbl > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > node <- tbl(f) > print(node) vectra query node Columns (11): mpg cyl disp hp drat wt qsec vs am gear carb > unlink(f) > > > > > cleanEx() > nameEx("tbl_csv") > ### * tbl_csv > > flush(stderr()); flush(stdout()) > > ### Name: tbl_csv > ### Title: Create a lazy table reference from a CSV file > ### Aliases: tbl_csv > > ### ** Examples > > f <- tempfile(fileext = ".csv") > write.csv(mtcars, f, row.names = FALSE) > node <- tbl_csv(f) > print(node) vectra query node Columns (11): mpg cyl disp hp drat wt qsec vs am gear carb > unlink(f) > > > > > cleanEx() > nameEx("tbl_sqlite") > ### * tbl_sqlite > > flush(stderr()); flush(stdout()) > > ### Name: tbl_sqlite > ### Title: Create a lazy table reference from a SQLite database > ### Aliases: tbl_sqlite > > ### ** Examples > > > > > > cleanEx() > nameEx("tbl_tiff") > ### * tbl_tiff > > flush(stderr()); flush(stdout()) > > ### Name: tbl_tiff > ### Title: Create a lazy table reference from a GeoTIFF raster > ### Aliases: tbl_tiff > > ### ** Examples > > > > > > cleanEx() > nameEx("tbl_xlsx") > ### * tbl_xlsx > > flush(stderr()); flush(stdout()) > > ### Name: tbl_xlsx > ### Title: Create a lazy table reference from an Excel (.xlsx) file > ### Aliases: tbl_xlsx > > ### ** Examples > > > > > > cleanEx() > nameEx("tiff_extract_points") > ### * tiff_extract_points > > flush(stderr()); flush(stdout()) > > ### Name: tiff_extract_points > ### Title: Extract raster values at point coordinates > ### Aliases: tiff_extract_points > > ### ** Examples > > > > > > cleanEx() > nameEx("tiff_metadata") > ### * tiff_metadata > > flush(stderr()); flush(stdout()) > > ### Name: tiff_metadata > ### Title: Read GDAL_METADATA from a GeoTIFF > ### Aliases: tiff_metadata > > ### ** Examples > > > > > > cleanEx() > nameEx("transmute") > ### * transmute > > flush(stderr()); flush(stdout()) > > ### Name: transmute > ### Title: Keep only columns from mutate expressions > ### Aliases: transmute > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> transmute(kpl = mpg * 0.425) |> collect() |> head() kpl 1 8.9250 2 8.9250 3 9.6900 4 9.0950 5 7.9475 6 7.6925 > unlink(f) > > > > > cleanEx() > nameEx("ungroup") > ### * ungroup > > flush(stderr()); flush(stdout()) > > ### Name: ungroup > ### Title: Remove grouping from a vectra query > ### Aliases: ungroup > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > tbl(f) |> group_by(cyl) |> ungroup() vectra query node Columns (11): mpg cyl disp hp drat wt qsec vs am gear carb > unlink(f) > > > > > cleanEx() > nameEx("vtr_schema") > ### * vtr_schema > > flush(stderr()); flush(stdout()) > > ### Name: vtr_schema > ### Title: Create a star schema over linked vectra tables > ### Aliases: vtr_schema > > ### ** Examples > > > > > > cleanEx() > nameEx("write_csv") > ### * write_csv > > flush(stderr()); flush(stdout()) > > ### Name: write_csv > ### Title: Write query results or a data.frame to a CSV file > ### Aliases: write_csv > > ### ** Examples > > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars[1:5, ], f) > csv <- tempfile(fileext = ".csv") > tbl(f) |> write_csv(csv) > unlink(c(f, csv)) > > > > > cleanEx() > nameEx("write_sqlite") > ### * write_sqlite > > flush(stderr()); flush(stdout()) > > ### Name: write_sqlite > ### Title: Write query results or a data.frame to a SQLite table > ### Aliases: write_sqlite > > ### ** Examples > > db <- tempfile(fileext = ".sqlite") > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars[1:5, ], f) > tbl(f) |> write_sqlite(db, "cars") > unlink(c(f, db)) > > > > > cleanEx() > nameEx("write_tiff") > ### * write_tiff > > flush(stderr()); flush(stdout()) > > ### Name: write_tiff > ### Title: Write query results to a GeoTIFF file > ### Aliases: write_tiff > > ### ** Examples > > > > > > cleanEx() > nameEx("write_vtr") > ### * write_vtr > > flush(stderr()); flush(stdout()) > > ### Name: write_vtr > ### Title: Write data to a .vtr file > ### Aliases: write_vtr > > ### ** Examples > > # From a data.frame > f <- tempfile(fileext = ".vtr") > write_vtr(mtcars, f) > > # Streaming format conversion (CSV -> VTR) > csv <- tempfile(fileext = ".csv") > write.csv(mtcars, csv, row.names = FALSE) > f2 <- tempfile(fileext = ".vtr") > tbl_csv(csv) |> write_vtr(f2) > > unlink(c(f, f2, csv)) > > > > > ### *