Skip to contents

Subset or trim shapes by row index or position.

Usage

coo_extract(x, ..., .cols = NULL, .ldk_col = NULL)

coo_head(x, ..., .cols = NULL, .ldk_col = NULL)

coo_tail(x, ..., .cols = NULL, .ldk_col = NULL)

Arguments

x

A matrix (nx2), list of matrices, or tibble with coo columns.

...

Additional arguments (reserved for future use).

.cols

Column name(s) to process when x is a tibble. If NULL, automatically detects columns containing coo objects.

.ldk_col

Character. Name of landmark column. If NULL, uses colname_ldk.

id

Integer vector of row indices to extract (for coo_extract()).

n

Integer. Number of points to keep or remove.

Value

  • If x is a single matrix: returns a matrix with selected/trimmed rows

  • If x is a list: returns a list of matrices

  • If x is a tibble: returns the tibble with specified coo columns subsetted

Details

  • coo_extract(): extract specific rows by index

  • coo_head(): keep first n points

  • coo_tail(): keep all but the last n points

If n equals nrow(x), the shape is returned unchanged.

These functions are landmark-aware: invalid landmark indices are automatically filtered out after subsetting.

See also

coo_sample() for resampling to different point counts, coo_trim_head() for trimming from start

Examples

# Extract specific points
coo_extract(shapes$cat, c(1, 10, 50))
#> <xy [3 x 2]>
#>      [,1] [,2]
#> [1,] 200   62 
#> [2,] 182   42 
#> [3,] 136   69 
coo_extract(bot$coo, c(1, 6))
#> $brahma
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  37  561 
#> [2,]  48  477 
#> 
#> $caney
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  53  535 
#> [2,]  54  464 
#> 
#> $chimay
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  49  333 
#> [2,]  50  295 
#> 
#> $corona
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  91  426 
#> [2,]  91  354 
#> 
#> $deusventrue
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  74  481 
#> [2,]  49  417 
#> 
#> $duvel
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  61  315 
#> [2,]  59  272 
#> 
#> $franziskaner
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  54  439 
#> [2,]  54  358 
#> 
#> $grimbergen
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  42  404 
#> [2,]  40  331 
#> 
#> $guiness
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  69  385 
#> [2,]  69  336 
#> 
#> $hoegardeen
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  42  544 
#> [2,]  40  481 
#> 
#> $jupiler
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  55  515 
#> [2,]  54  447 
#> 
#> $kingfisher
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  71  384 
#> [2,]  71  335 
#> 
#> $latrappe
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  26  389 
#> [2,]  26  327 
#> 
#> $lindemanskriek
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  60  427 
#> [2,]  54  378 
#> 
#> $nicechouffe
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  82  361 
#> [2,]  75  311 
#> 
#> $pecheresse
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  63  495 
#> [2,]  58  418 
#> 
#> $sierranevada
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  61  345 
#> [2,]  61  296 
#> 
#> $tanglefoot
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  48  367 
#> [2,]  49  319 
#> 
#> $tauro
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  56  515 
#> [2,]  54  454 
#> 
#> $westmalle
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  70  394 
#> [2,]  66  335 
#> 
#> $amrut
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  57  441 
#> [2,]  57  391 
#> 
#> $ballantines
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  38  357 
#> [2,]  38  294 
#> 
#> $bushmills
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  72  456 
#> [2,]  72  394 
#> 
#> $chivas
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  33  437 
#> [2,]  29  379 
#> 
#> $dalmore
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  52  371 
#> [2,]  42  322 
#> 
#> $famousgrouse
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  99  313 
#> [2,]  99  275 
#> 
#> $glendronach
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  73  435 
#> [2,]  74  387 
#> 
#> $glenmorangie
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  53  518 
#> [2,]  57  451 
#> 
#> $highlandpark
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  42  371 
#> [2,]  42  315 
#> 
#> $jackdaniels
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  63  414 
#> [2,]  63  349 
#> 
#> $jb
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  43  531 
#> [2,]  43  467 
#> 
#> $johnniewalker
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,] 133  175 
#> [2,] 134  151 
#> 
#> $magallan
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  78  397 
#> [2,]  81  339 
#> 
#> $makersmark
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  31  432 
#> [2,]  10  381 
#> 
#> $oban
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  74  457 
#> [2,]  74  406 
#> 
#> $oldpotrero
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  83  307 
#> [2,]  58  256 
#> 
#> $redbreast
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,] 105  233 
#> [2,]  97  205 
#> 
#> $tamdhu
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  49  552 
#> [2,]  50  490 
#> 
#> $wildturkey
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  18  569 
#> [2,]  18  499 
#> 
#> $yoichi
#> <xy [2 x 2]>
#>      [,1] [,2]
#> [1,]  69  384 
#> [2,]  70  318 
#> 
#> attr(,"class")
#> [1] "out"  "coo"  "list"
coo_extract(bot, c(1, 5, 10))
#> # A tibble: 40 × 3
#>    coo     type   dummy
#>    <out>   <fct>  <fct>
#>  1 (3 x 2) whisky a    
#>  2 (3 x 2) whisky a    
#>  3 (3 x 2) whisky a    
#>  4 (3 x 2) whisky a    
#>  5 (3 x 2) whisky a    
#>  6 (3 x 2) whisky a    
#>  7 (3 x 2) whisky a    
#>  8 (3 x 2) whisky a    
#>  9 (3 x 2) whisky a    
#> 10 (3 x 2) whisky a    
#> # ℹ 30 more rows

# Keep first n points
coo_head(shapes$cat, 10)
#> <xy [10 x 2]>
#>       [,1] [,2]
#>  [1,] 200   62 
#>  [2,] 196   56 
#>  [3,] 200   56 
#>  [4,] 206   54 
#>  [5,] 209   48 
#>  [6,] 205   43 
#>  [7,] 200   43 
#>  [8,] 194   42 
#>  [9,] 188   42 
#> [10,] 182   42 
coo_head(bot$coo, 20)
#> $brahma
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  37  561 
#>  [2,]  40  540 
#>  [3,]  40  529 
#>  [4,]  43  508 
#>  [5,]  46  487 
#>  [6,] ...  ... 
#>  [7,]  64  298 
#>  [8,]  62  277 
#>  [9,]  60  256 
#> [10,]  58  245 
#> [11,]  54  224 
#> 
#> $caney
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  53  535 
#>  [2,]  53  525 
#>  [3,]  54  505 
#>  [4,]  53  495 
#>  [5,]  54  485 
#>  [6,] ...  ... 
#>  [7,]  54  333 
#>  [8,]  53  323 
#>  [9,]  53  313 
#> [10,]  54  293 
#> [11,]  54  283 
#> 
#> $chimay
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  49  333 
#>  [2,]  49  325 
#>  [3,]  49  318 
#>  [4,]  50  310 
#>  [5,]  50  302 
#>  [6,] ...  ... 
#>  [7,]  52  210 
#>  [8,]  52  202 
#>  [9,]  53  194 
#> [10,]  54  187 
#> [11,]  54  179 
#> 
#> $corona
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  91  426 
#>  [2,]  91  416 
#>  [3,]  90  395 
#>  [4,]  91  385 
#>  [5,]  91  374 
#>  [6,] ...  ... 
#>  [7,]  91  209 
#>  [8,]  91  198 
#>  [9,]  91  188 
#> [10,]  91  167 
#> [11,]  94  158 
#> 
#> $deusventrue
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  74  481 
#>  [2,]  70  472 
#>  [3,]  62  454 
#>  [4,]  59  445 
#>  [5,]  52  425 
#>  [6,] ...  ... 
#>  [7,]  36  281 
#>  [8,]  36  271 
#>  [9,]  38  253 
#> [10,]  40  243 
#> [11,]  40  233 
#> 
#> $duvel
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  61  315 
#>  [2,]  61  304 
#>  [3,]  61  293 
#>  [4,]  61  293 
#>  [5,]  61  282 
#>  [6,] ...  ... 
#>  [7,]  59  185 
#>  [8,]  59  174 
#>  [9,]  59  163 
#> [10,]  59  152 
#> [11,]  59  141 
#> 
#> $franziskaner
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  54  439 
#>  [2,]  54  418 
#>  [3,]  54  408 
#>  [4,]  54  389 
#>  [5,]  54  379 
#>  [6,] ...  ... 
#>  [7,]  56  205 
#>  [8,]  56  184 
#>  [9,]  56  174 
#> [10,]  56  153 
#> [11,]  56  143 
#> 
#> $grimbergen
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  42  404 
#>  [2,]  40  394 
#>  [3,]  40  373 
#>  [4,]  40  362 
#>  [5,]  40  352 
#>  [6,] ...  ... 
#>  [7,]  42  195 
#>  [8,]  42  174 
#>  [9,]  42  164 
#> [10,]  42  143 
#> [11,]  42  132 
#> 
#> $guiness
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  69  385 
#>  [2,]  69  377 
#>  [3,]  69  369 
#>  [4,]  69  360 
#>  [5,]  69  344 
#>  [6,] ...  ... 
#>  [7,]  70  245 
#>  [8,]  70  237 
#>  [9,]  70  220 
#> [10,]  70  212 
#> [11,]  70  204 
#> 
#> $hoegardeen
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  42  544 
#>  [2,]  40  531 
#>  [3,]  40  519 
#>  [4,]  40  506 
#>  [5,]  40  493 
#>  [6,] ...  ... 
#>  [7,]  40  354 
#>  [8,]  40  341 
#>  [9,]  40  329 
#> [10,]  40  316 
#> [11,]  40  303 
#> 
#> $jupiler
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  55  515 
#>  [2,]  54  501 
#>  [3,]  54  488 
#>  [4,]  54  474 
#>  [5,]  54  460 
#>  [6,] ...  ... 
#>  [7,]  52  310 
#>  [8,]  51  296 
#>  [9,]  51  283 
#> [10,]  50  269 
#> [11,]  50  255 
#> 
#> $kingfisher
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  71  384 
#>  [2,]  71  374 
#>  [3,]  71  365 
#>  [4,]  71  355 
#>  [5,]  71  345 
#>  [6,] ...  ... 
#>  [7,]  73  249 
#>  [8,]  73  239 
#>  [9,]  73  239 
#> [10,]  73  229 
#> [11,]  73  220 
#> 
#> $latrappe
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  26  389 
#>  [2,]  25  377 
#>  [3,]  25  364 
#>  [4,]  25  352 
#>  [5,]  25  339 
#>  [6,] ...  ... 
#>  [7,]  26  189 
#>  [8,]  26  177 
#>  [9,]  26  164 
#> [10,]  27  152 
#> [11,]  27  139 
#> 
#> $lindemanskriek
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  60  427 
#>  [2,]  60  419 
#>  [3,]  55  404 
#>  [4,]  54  395 
#>  [5,]  54  387 
#>  [6,] ...  ... 
#>  [7,]  54  269 
#>  [8,]  54  260 
#>  [9,]  54  252 
#> [10,]  54  235 
#> [11,]  54  227 
#> 
#> $nicechouffe
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  82  361 
#>  [2,]  81  353 
#>  [3,]  77  336 
#>  [4,]  77  327 
#>  [5,]  76  319 
#>  [6,] ...  ... 
#>  [7,]  75  202 
#>  [8,]  75  193 
#>  [9,]  75  176 
#> [10,]  75  168 
#> [11,]  75  159 
#> 
#> $pecheresse
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  63  495 
#>  [2,]  61  476 
#>  [3,]  61  467 
#>  [4,]  60  447 
#>  [5,]  58  428 
#>  [6,] ...  ... 
#>  [7,]  56  252 
#>  [8,]  56  232 
#>  [9,]  56  212 
#> [10,]  56  203 
#> [11,]  56  183 
#> 
#> $sierranevada
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  61  345 
#>  [2,]  61  333 
#>  [3,]  61  333 
#>  [4,]  61  320 
#>  [5,]  61  308 
#>  [6,] ...  ... 
#>  [7,]  61  209 
#>  [8,]  61  209 
#>  [9,]  61  197 
#> [10,]  61  185 
#> [11,]  61  185 
#> 
#> $tanglefoot
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  48  367 
#>  [2,]  48  359 
#>  [3,]  48  351 
#>  [4,]  48  335 
#>  [5,]  49  327 
#>  [6,] ...  ... 
#>  [7,]  49  223 
#>  [8,]  49  215 
#>  [9,]  49  199 
#> [10,]  49  191 
#> [11,]  49  183 
#> 
#> $tauro
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  56  515 
#>  [2,]  54  503 
#>  [3,]  54  491 
#>  [4,]  54  478 
#>  [5,]  54  466 
#>  [6,] ...  ... 
#>  [7,]  52  320 
#>  [8,]  52  308 
#>  [9,]  50  296 
#> [10,]  50  284 
#> [11,]  50  271 
#> 
#> $westmalle
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  70  394 
#>  [2,]  70  386 
#>  [3,]  67  369 
#>  [4,]  67  361 
#>  [5,]  66  344 
#>  [6,] ...  ... 
#>  [7,]  67  211 
#>  [8,]  67  195 
#>  [9,]  67  187 
#> [10,]  67  170 
#> [11,]  67  162 
#> 
#> $amrut
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  57  441 
#>  [2,]  57  431 
#>  [3,]  57  421 
#>  [4,]  57  411 
#>  [5,]  57  401 
#>  [6,] ...  ... 
#>  [7,]  57  291 
#>  [8,]  57  281 
#>  [9,]  57  272 
#> [10,]  57  262 
#> [11,]  57  252 
#> 
#> $ballantines
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  38  357 
#>  [2,]  38  341 
#>  [3,]  38  333 
#>  [4,]  38  318 
#>  [5,]  38  310 
#>  [6,] ...  ... 
#>  [7,]  38  176 
#>  [8,]  38  168 
#>  [9,]  38  152 
#> [10,]  38  145 
#> [11,]  37  129 
#> 
#> $bushmills
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  72  456 
#>  [2,]  72  441 
#>  [3,]  72  425 
#>  [4,]  72  425 
#>  [5,]  72  410 
#>  [6,] ...  ... 
#>  [7,]  75  271 
#>  [8,]  75  256 
#>  [9,]  75  256 
#> [10,]  76  240 
#> [11,]  75  225 
#> 
#> $chivas
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  33  437 
#>  [2,]  31  429 
#>  [3,]  29  412 
#>  [4,]  29  404 
#>  [5,]  29  388 
#>  [6,] ...  ... 
#>  [7,]  33  264 
#>  [8,]  33  248 
#>  [9,]  33  240 
#> [10,]  33  223 
#> [11,]  33  215 
#> 
#> $dalmore
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  52  371 
#>  [2,]  47  359 
#>  [3,]  44  346 
#>  [4,]  42  334 
#>  [5,]  42  322 
#>  [6,] ...  ... 
#>  [7,]  43  211 
#>  [8,]  43  198 
#>  [9,]  43  186 
#> [10,]  43  174 
#> [11,]  43  161 
#> 
#> $famousgrouse
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  99  313 
#>  [2,]  99  303 
#>  [3,]  99  294 
#>  [4,]  99  284 
#>  [5,]  99  284 
#>  [6,] ...  ... 
#>  [7,]  99  189 
#>  [8,]  99  179 
#>  [9,]  99  170 
#> [10,]  99  160 
#> [11,]  99  151 
#> 
#> $glendronach
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  73  435 
#>  [2,]  73  423 
#>  [3,]  74  411 
#>  [4,]  74  411 
#>  [5,]  74  399 
#>  [6,] ...  ... 
#>  [7,]  74  290 
#>  [8,]  74  290 
#>  [9,]  74  278 
#> [10,]  74  266 
#> [11,]  74  254 
#> 
#> $glenmorangie
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  53  518 
#>  [2,]  54  501 
#>  [3,]  54  501 
#>  [4,]  54  485 
#>  [5,]  55  468 
#>  [6,] ...  ... 
#>  [7,]  61  335 
#>  [8,]  61  318 
#>  [9,]  62  301 
#> [10,]  62  301 
#> [11,]  64  284 
#> 
#> $highlandpark
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  42  371 
#>  [2,]  42  357 
#>  [3,]  42  357 
#>  [4,]  42  343 
#>  [5,]  42  329 
#>  [6,] ...  ... 
#>  [7,]  42  218 
#>  [8,]  42  204 
#>  [9,]  42  204 
#> [10,]  42  190 
#> [11,]  42  176 
#> 
#> $jackdaniels
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  63  414 
#>  [2,]  63  401 
#>  [3,]  63  388 
#>  [4,]  63  375 
#>  [5,]  63  362 
#>  [6,] ...  ... 
#>  [7,]  63  218 
#>  [8,]  63  218 
#>  [9,]  63  205 
#> [10,]  63  191 
#> [11,]  63  178 
#> 
#> $jb
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  43  531 
#>  [2,]  43  520 
#>  [3,]  42  510 
#>  [4,]  42  488 
#>  [5,]  43  477 
#>  [6,] ...  ... 
#>  [7,]  44  327 
#>  [8,]  44  316 
#>  [9,]  44  305 
#> [10,]  44  295 
#> [11,]  44  273 
#> 
#> $johnniewalker
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,] 133  175 
#>  [2,] 133  171 
#>  [3,] 133  167 
#>  [4,] 133  163 
#>  [5,] 134  155 
#>  [6,] ...  ... 
#>  [7,] 135  107 
#>  [8,] 135  103 
#>  [9,] 135   95 
#> [10,] 135   91 
#> [11,] 135   87 
#> 
#> $magallan
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  78  397 
#>  [2,]  78  382 
#>  [3,]  80  375 
#>  [4,]  80  361 
#>  [5,]  81  346 
#>  [6,] ...  ... 
#>  [7,]  88  215 
#>  [8,]  88  208 
#>  [9,]  90  194 
#> [10,]  90  186 
#> [11,]  91  172 
#> 
#> $makersmark
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  31  432 
#>  [2,]  23  420 
#>  [3,]  16  408 
#>  [4,]  16  408 
#>  [5,]  13  394 
#>  [6,] ...  ... 
#>  [7,]  13  267 
#>  [8,]  16  254 
#>  [9,]  17  240 
#> [10,]  18  226 
#> [11,]  21  211 
#> 
#> $oban
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  74  457 
#>  [2,]  74  448 
#>  [3,]  74  431 
#>  [4,]  74  423 
#>  [5,]  74  414 
#>  [6,] ...  ... 
#>  [7,]  76  295 
#>  [8,]  76  286 
#>  [9,]  76  278 
#> [10,]  76  261 
#> [11,]  76  252 
#> 
#> $oldpotrero
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  83  307 
#>  [2,]  77  299 
#>  [3,]  71  291 
#>  [4,]  63  274 
#>  [5,]  60  265 
#>  [6,] ...  ... 
#>  [7,]  61  145 
#>  [8,]  61  136 
#>  [9,]  61  127 
#> [10,]  61  119 
#> [11,]  62  102 
#> 
#> $redbreast
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,] 105  233 
#>  [2,] 103  228 
#>  [3,] 101  224 
#>  [4,]  98  214 
#>  [5,]  98  210 
#>  [6,] ...  ... 
#>  [7,]  98  149 
#>  [8,]  98  139 
#>  [9,]  98  135 
#> [10,]  98  130 
#> [11,]  98  125 
#> 
#> $tamdhu
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  49  552 
#>  [2,]  49  540 
#>  [3,]  49  527 
#>  [4,]  49  515 
#>  [5,]  49  503 
#>  [6,] ...  ... 
#>  [7,]  52  354 
#>  [8,]  52  342 
#>  [9,]  54  329 
#> [10,]  54  317 
#> [11,]  54  305 
#> 
#> $wildturkey
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  18  569 
#>  [2,]  18  555 
#>  [3,]  18  541 
#>  [4,]  18  527 
#>  [5,]  18  513 
#>  [6,] ...  ... 
#>  [7,]  21  359 
#>  [8,]  21  345 
#>  [9,]  21  331 
#> [10,]  21  317 
#> [11,]  21  303 
#> 
#> $yoichi
#> <xy [20 x 2]>
#>       [,1] [,2]
#>  [1,]  69  384 
#>  [2,]  69  369 
#>  [3,]  69  355 
#>  [4,]  69  340 
#>  [5,]  69  325 
#>  [6,] ...  ... 
#>  [7,]  70  179 
#>  [8,]  70  164 
#>  [9,]  70  149 
#> [10,]  70  134 
#> [11,]  69  120 
#> 
#> attr(,"class")
#> [1] "out"  "coo"  "list"
coo_head(bot, 30)
#> # A tibble: 40 × 3
#>    coo      type   dummy
#>    <out>    <fct>  <fct>
#>  1 (30 x 2) whisky a    
#>  2 (30 x 2) whisky a    
#>  3 (30 x 2) whisky a    
#>  4 (30 x 2) whisky a    
#>  5 (30 x 2) whisky a    
#>  6 (30 x 2) whisky a    
#>  7 (30 x 2) whisky a    
#>  8 (30 x 2) whisky a    
#>  9 (30 x 2) whisky a    
#> 10 (30 x 2) whisky a    
#> # ℹ 30 more rows

# Remove last n points
coo_tail(shapes$cat, 5)
#> <xy [115 x 2]>
#>       [,1] [,2]
#>  [1,] 200   62 
#>  [2,] 196   56 
#>  [3,] 200   56 
#>  [4,] 206   54 
#>  [5,] 209   48 
#>  [6,] ...  ... 
#>  [7,] 224   62 
#>  [8,] 230   60 
#>  [9,] 232   55 
#> [10,] 230   49 
#> [11,] 224   45 
coo_tail(bot, 10)
#> # A tibble: 40 × 3
#>    coo       type   dummy
#>    <out>     <fct>  <fct>
#>  1 (128 x 2) whisky a    
#>  2 (158 x 2) whisky a    
#>  3 (179 x 2) whisky a    
#>  4 (119 x 2) whisky a    
#>  5 (142 x 2) whisky a    
#>  6 (151 x 2) whisky a    
#>  7 (114 x 2) whisky a    
#>  8 (116 x 2) whisky a    
#>  9 (173 x 2) whisky a    
#> 10 (183 x 2) whisky a    
#> # ℹ 30 more rows