Learn R Programming

Momocs (version 1.4.1)

rearrange_ldk: 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)

Value

a Momocs object of same class

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)

See Also

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

Examples

Run this code
# 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

Run the code above in your browser using DataLab