% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RMVL.R
\name{mvl_extent_index_lapply}
\alias{mvl_extent_index_lapply}
\title{Apply function to indices of rows with matching hashes}
\usage{
mvl_extent_index_lapply(extent_index, data_list, fn)
}
\arguments{
\item{extent_index}{MVL_OBJECT computed by \code{mvl_write_extent_index()}}

\item{data_list}{a list of vectors of equal length. They can be MVL_OBJECTs or R vectors. If missing, scan the entire table one hash at a time.}

\item{fn}{a function of two arguments - and index into \code{data_list} and a corresponding list of indices}
}
\value{
a list of results of function \code{fn}
}
\description{
Please use generic function \code{mvl_index_lapply()} instead.
}
\details{
This function is passed the index computed by \code{mvl_write_extent_index()} and a list of vectors, which rows are used to compute 64-bit hashes.
For each row, we call the function \code{fn(i, idx)}, where \code{i} gives the index of query row, and \code{idx} gives the indices of with matching hashes.

64-bit hashes have very few collisions, nevertheless the user is advised to double check that the values actually match.

The hash computation is type dependent, so \code{1} stored as an integer will produce a different hash than when stored as floating point. This function accounts for this by internally converting to types the index was generated with.
}
\examples{
\dontrun{
Mtmp<-mvl_open("tmp_a.mvl", append=TRUE, create=TRUE)
mvl_write_object(Mtmp, data.frame(x=runif(100), y=(1:100) \%\% 10), "df1")
Mtmp<-mvl_remap(Mtmp)
mvl_write_extent_index(Mtmp, list(Mtmp$df1[,"y",ref=TRUE]), "df1_extent_index_y")
Mtmp<-mvl_remap(Mtmp)
mvl_extent_index_lapply(Mtmp["df1_extent_index_y", ref=TRUE], list(c(2, 3)),
                                           function(i, idx) { return(list(i, idx))})
# Example of full scan
mvl_extent_index_lapply(Mtmp["df1_extent_index_y", ref=TRUE], ,
                                           function(i, idx) { return(list(i, idx))})
}
}
\seealso{
\code{\link{mvl_index_lapply}}, \code{\link{mvl_group}}
}
