get_-times: Get internal fields from matchr vectors

get_*R Documentation

Get internal fields from matchr vectors

Description

matchr vectors are implemented as "record"-style classes (using vctrs::new_rcrd), which store their data and metadata as a set of lists of equal length, called "fields". Usually these fields do not need to be accessed independently of the vectors they comprise. But, for the cases when they do, matchr has a series of get_* functions which allow convenient access to fields, and which are all straightforward wrappers of vctrs::field. In each case, get_*(x) is equivalent to vctrs::field(x, "*"). New values can be assigned to these fields in the same manner, e.g. get_path(x) <- "new_path".

Usage

get_path(x)

get_path(x) <- value

get_array(x)

get_array(x) <- value

get_hash(x)

get_hash(x) <- value

get_x_sig(x)

get_x_sig(x) <- value

get_y_sig(x)

get_y_sig(x) <- value

get_ar(x)

get_ar(x) <- value

get_x_ar(x)

get_x_ar(x) <- value

get_y_ar(x)

get_y_ar(x) <- value

Arguments

x

For get_path a matchr_image or matchr_signature vector; for get_array a matchr_image or matchr_matrix vector; for get_hash, get_ahash and get_ar a matchr_signature vector; for get_x_sig, get_y_sig, get_x_ar and get_y_ar a matchr_matrix vector.

value

A new vector of the same type as the field it is replacing.

Value

A list, with the same length as the input vector x, containing the field * of the input vector corresponding to the ⁠get_*⁠ function which was called.

Examples

## Not run: 
# Setup
img <- load_image(test_urls)
sig <- create_signature(img)
matches <- match_signatures(sig)

get_path(img)
get_path(sig)
get_array(img)
get_array(matches)
get_hash(sig)
get_ahash(sig)
get_x_sig(matches)
get_y_sig(matches)
get_ar(sig)
get_x_ar(matches)
get_y_ar(matches)

## End(Not run)

UPGo-McGill/matchr documentation built on July 19, 2023, 1:02 p.m.