mvl_indexed_copy: Index copy vector

View source: R/RMVL.R

mvl_indexed_copyR Documentation

Index copy vector

Description

This function creates new MVL vectors and data frames by copying only rows or values specified by given indices. The vector indices can be an R integer or numeric vector, a logical vector of the size matching to the object being copied, or a suitable vector stored in MVL file.

Usage

mvl_indexed_copy(MVLHANDLE, x, indices, name = NULL, only.columns = NULL)

Arguments

MVLHANDLE

a handle to MVL file produced by mvl_open()

x

a vector-like MVL_OBJECT or a data.frame stored in MVL file

indices

a vector of indices into x

name

if specified add a named entry to MVL file directory

only.columns

if x is MVL_OBJECT with class data.frame copy only columns specified in this character or integer vector

Value

an object of class MVL_OFFSET that describes an offset into this MVL file. MVL offsets are vectors and can be concatenated. They can be written to MVL file directly, or as part of another object such as list.

See Also

mvl_hash_vectors, mvl_find_matches, mvl_group, mvl_find_matches, mvl_order_vectors, mvl_merge, mvl_write_object, mvl_fused_write_objects

Examples

## Not run: 
Mtmp<-mvl_open("tmp_a.mvl", append=TRUE, create=TRUE)
mvl_write_object(Mtmp, runif(100), "vec1")
Mtmp<-mvl_remap(Mtmp)
permutation1<-mvl_order_vectors(list(Mtmp["vec1", ref=TRUE]))
mvl_indexed_copy(Mtmp, Mtmp["vec1", ref=TRUE], permutation1, name="vec1_sorted")
Mtmp<-mvl_remap(Mtmp)
print(Mtmp$vec1_sorted)

## End(Not run)

RMVL documentation built on Nov. 2, 2023, 6:09 p.m.

Related to mvl_indexed_copy in RMVL...