coo_trim_head removes the first n coordinates from shape, coo_trim_tail removes the last n coordinates, coo_trim does both.

coo_trim(x, n, from_col, to_col, ...)

coo_trim_head(x, n, from_col, to_col, ...)

coo_trim_tail(x, n, from_col, to_col, ...)

Arguments

x

coo_single, coo_list or mom_tbl

n

integer how many coordinates shall we trim

from_col

colnames from where to get the coo_list and how to name the resulting one (only for mom_tbl method)

to_col

colnames from where to get the coo_list and how to name the resulting one (only for mom_tbl method)

...

useless here

Value

a coo_single, coo_list or mom_tbl

Functions

  • coo_trim_head: Trims head of shape

  • coo_trim_tail: Trims tail of shape

See also

Examples

x <- bot %>% pick(1) %>% coo_sample(12) coo_trim(x, 5)
#> # A tibble: 2 x 2 #> x y #> <dbl> <dbl> #> 1 305 302 #> 2 295 523 #> ❯coo_single with 2 coordinates
coo_trim_head(x, 5)
#> # A tibble: 7 x 2 #> x y #> <dbl> <dbl> #> 1 305 302 #> 2 295 523 #> 3 296 713 #> 4 240 912 #> 5 205 1101 #> 6 110 1002 #> 7 82 781 #> ❯coo_single with 7 coordinates
coo_trim_tail(x, 5)
#> # A tibble: 7 x 2 #> x y #> <dbl> <dbl> #> 1 305 302 #> 2 295 523 #> 3 296 713 #> 4 240 912 #> 5 205 1101 #> 6 110 1002 #> 7 82 781 #> ❯coo_single with 7 coordinates