Skip to contents

Data sources

Open files for lazy query execution

tbl()
Create a lazy table reference from a .vtr file
tbl_csv()
Create a lazy table reference from a delimited text file
tbl_sqlite()
Create a lazy table reference from a SQLite database
tbl_tiff()
Create a lazy table reference from a GeoTIFF raster
tbl_xlsx()
Create a lazy table reference from an Excel (.xlsx) file
tbl_fasta()
Create a lazy table reference from a FASTA file
tbl_fastq()
Create a lazy table reference from a FASTQ file
tbl_bed()
Create a lazy table reference from a BED file

Data sinks

Write query results or data.frames to disk

write_vtr()
Write data to a .vtr file
write_csv()
Write query results or a data.frame to a CSV file
write_sqlite()
Write query results or a data.frame to a SQLite table
write_tiff()
Write query results to a GeoTIFF file
st_write(<vectra_node>)
Stream a vectra node's geometry to a vector file

Single-table verbs

Transform, filter, and reshape

filter()
Filter rows of a vectra query
select()
Select columns from a vectra query
mutate()
Add or transform columns
transmute()
Keep only columns from mutate expressions
rename()
Rename columns
relocate()
Relocate columns
arrange()
Sort rows by column values
desc()
Mark a column for descending sort order
distinct()
Keep distinct/unique rows
slice_head() slice_tail() slice_min() slice_max()
Select first or last rows
slice()
Select rows by position
pull()
Extract a single column as a vector
head(<vectra_node>)
Limit results to first n rows

Grouping and aggregation

group_by()
Group a vectra query by columns
summarise() summarize()
Summarise grouped data
ungroup()
Remove grouping from a vectra query
count() tally()
Count observations by group
reframe()
Summarise with variable-length output per group
across()
Apply a function across multiple columns

Time series

Snap datetimes to a calendar grid and aggregate over time windows

floor_time()
Floor a datetime column to a calendar grid
resample()
Resample a time series to a calendar grid
roll_sum() roll_mean() roll_min() roll_max() roll_n()
Time-based rolling aggregates

Biological sequences

k-mer spectra and per-row sequence functions

kmer()
k-mer spectrum of a sequence column
seq_expressions
Biological-sequence functions inside mutate(), filter(), and summarise()

Joins

left_join() inner_join() right_join() full_join() semi_join() anti_join()
Join two vectra tables
cross_join()
Cross join two vectra tables
fuzzy_join()
Fuzzy join two vectra tables by string distance
interval_join()
Interval (range overlap) join of two vectra tables

Star schema

Define linked dimension tables and look up columns without explicit joins

vtr_schema()
Create a star schema over linked vectra tables
link()
Define a link between a fact table and a dimension table
lookup()
Look up columns from linked dimension tables

Combining tables

bind_rows() bind_cols()
Bind rows or columns from multiple vectra tables

Block operations

In-memory materialization and lookup

materialize()
Materialize a vectra node into a reusable in-memory block
block_lookup()
Probe a materialized block by column value
block_fuzzy_lookup()
Fuzzy-match query keys against a materialized block

Streaming consumption

Reduce or feed a query one batch at a time, for larger-than-RAM results

collect_chunked()
Fold a function over a query, one batch at a time
chunk_feeder()
Turn a query into a resettable chunk generator

Offloading

Spill a query to disk and stream it back, for out-of-core fits

offload()
Spill a query to disk and stream it back (the offload functor)
group_map() group_modify()
Apply a function to each shard of a partition

File operations

Incremental updates to .vtr files

append_vtr()
Append rows or columns to an existing .vtr file
delete_vtr()
Logically delete rows from a .vtr file
diff_vtr()
Compute the logical diff between two .vtr files
create_index()
Create a hash index on a .vtr file column
has_index()
Check whether a .vtr column has a usable hash index

Diagnostics

explain()
Print the execution plan for a vectra query
collect()
Execute a lazy query and return a data.frame
glimpse()
Get a glimpse of a vectra table
dim(<vectra_node>)
Dimensions of a lazy query
print(<vectra_node>)
Print a vectra query node
vectra_mem()
Resolve the vectra memory budget

Raster data cubes

Read and write .vec rasters and time cubes out of core

vec_open_raster()
Open a .vec raster
vec_close_raster()
Close a .vec raster handle
vec_raster_layout()
Tile layout of an open .vec raster
vec_raster_times()
Distinct time stamps stored in a .vec time cube
vec_read_window()
Read a window of pixels from a .vec raster
vec_read_time_slice()
Read a single time slice from a .vec time cube
vec_read_pixel_series()
Read the full time series at a single pixel from a .vec time cube
vec_extract_points()
Extract band values at (x, y) points from a .vec raster
vec_build_overviews()
Build overview pyramids for a .vec raster
vec_write_raster()
Write a raster matrix or 3D array to a .vec raster file
vec_write_time_cube()
Write a 4D time-cube raster to .vec
vec_to_tiff()
Export a .vec raster to GeoTIFF

GeoTIFF helpers

Metadata and point-sampling for GeoTIFF rasters

tiff_extract_points()
Extract raster values at point coordinates
tiff_metadata()
Read GDAL_METADATA from a GeoTIFF
tiff_band_names()
Read per-band names from a GeoTIFF
tiff_crs()
Read CRS metadata from a GeoTIFF

Spatial operations

Stream sf vector operations one batch at a time, for vector data larger than RAM

spatial_map()
Stream a query through an sf transform
spatial_join()
Spatial join a streamed query against a resident sf object
grid()
Define a uniform grid for a partitioned spatial join
spatial_filter()
Keep streamed rows by their spatial relation to a resident layer
spatial_clip()
Clip or erase a streamed layer against a resident mask
spatial_dissolve()
Dissolve geometries by group
spatial_overlay()
Self-overlay a polygon layer into disjoint pieces (QGIS-style Union)
rasterize()
Rasterize a streamed point layer onto a fixed grid
polygonize()
Vectorise a raster into polygons
contours()
Extract contour iso-lines from a streamed raster
zonal()
Summarise raster values within zones
focal()
Moving-window (focal) statistics over a streamed raster
terrain()
Terrain derivatives from a streamed elevation raster
warp()
Resample or reproject a streamed raster onto a target grid
mask()
Mask a streamed raster to a polygon layer
mosaic()
Merge aligned rasters onto a common grid
rast_calc()
Cellwise calculation over aligned rasters (map algebra)
proximity()
Euclidean distance to the nearest feature (proximity)
collect_sf()
Materialize a spatial query as an sf object
geom_expressions
Geometry functions inside mutate(), filter(), and summarise()

Geometry construction and cleaning

Reshape, repair, simplify, and snap streamed vector geometry

spatial_construct()
Build a set-wise geometry construction, optionally per group
spatial_explode()
Explode multipart geometries into single-part features
spatial_line_merge()
Merge contiguous line segments into maximal lines
spatial_simplify()
Simplify a polygon coverage without tearing shared edges
spatial_smooth()
Smooth streamed line and polygon geometry
spatial_snap()
Snap a streamed layer toward a resident reference layer
spatial_snap_grid()
Snap a streamed layer's coordinates to a fixed grid
spatial_eliminate()
Merge sliver polygons into a neighbour
spatial_split()
Split a streamed layer by a resident blade, or return its crossing points
spatial_centerline()
Trace the centerline (medial axis) of streamed polygons

Coverage and topology

Shared-edge topology and polygonal faces of polygon coverages

spatial_topology()
Build the shared-edge topology of a polygon coverage
spatial_polygonize()
Build polygonal faces from a line network

Spatial networks

Build routable graphs and solve shortest paths over line layers

spatial_network()
Build a routable network graph from a line layer
spatial_route()
Shortest paths and origin-destination costs over a network
spatial_service_area()
Service areas and isochrones over a network

Spatial queries

Nearest neighbours and linear referencing

spatial_knn()
k nearest neighbours of a streamed layer, with distances
spatial_locate()
Locate streamed points along a resident line layer

Feature space

Embedding columns and nearest neighbours in predictor space

as_embedding()
Encode vectors as an embedding column
cosine() l2() dot()
Embedding distance functions
feature_knn()
Nearest neighbours of a streamed layer in predictor space
rast_feature_distance()
Predictor-space nearest-neighbour distance surface over a raster