rearrange_ldk: Rearrange, (select and reorder) landmarks to retain

View source: R/coo-ldk-utilities.R

rearrange_ldkR Documentation

Rearrange, (select and reorder) landmarks to retain

Description

Helps reorder and retain landmarks by simply changing the order in which they are recorded in the Coo objects. Note that for Out and Opn objects, this rearranges the $ldk component. For Ldk, it rearranges the $coo directly.

Usage

rearrange_ldk(Coo, new_ldk_ids)

Arguments

Coo

any appropriate Coo object (typically an Ldk) with landmarks inside

new_ldk_ids

a vector of numeric with the ldk to retain and in the right order (see below)

Value

a Momocs object of same class

See Also

Other ldk/slidings methods: add_ldk(), def_ldk(), def_slidings(), get_ldk(), get_slidings(), slidings_scheme()

Examples

# Out example
hearts %>% slice(1) %T>% stack %$% ldk
hearts %>% rearrange_ldk(c(4, 1)) %>%
       slice(1) %T>%stack %$% ldk

# Ldk example
wings %>% slice(1) %T>% stack %$% coo
wings %>% rearrange_ldk(c(1, 3, 12:15)) %>%
      slice(1) %T>% stack %$% coo

vbonhomme/Momocs documentation built on Nov. 13, 2023, 8:54 p.m.