% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/delete.R
\name{delete_vtr}
\alias{delete_vtr}
\title{Logically delete rows from a .vtr file}
\usage{
delete_vtr(path, row_ids)
}
\arguments{
\item{path}{File path of the \code{.vtr} file to delete rows from.}

\item{row_ids}{A numeric vector of \strong{0-based} physical row indices to
delete. Out-of-range indices are silently ignored on read (they will
never match a real row).}
}
\value{
Invisible \code{NULL}.
}
\description{
Marks the specified 0-based physical row indices as deleted by writing (or
updating) a tombstone side file (\verb{<path>.del}). The original \code{.vtr} file is
never modified. The next call to \code{\link[=tbl]{tbl()}} on the same path will automatically
exclude the deleted rows.
}
\details{
Tombstone files are cumulative: calling \code{delete_vtr()} multiple times on the
same file merges all deletions (union, deduplicated). To undo deletions,
remove the \code{.del} file manually with \code{unlink(paste0(path, ".del"))}.
}
\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")))

}
