Calculate length along the major inertia axis.
Value
If
xis a single matrix: returns a numeric scalarIf
xis a list: returns a numeric vectorIf
xis a tibble: returns a numeric vector extracted from coo column
Examples
get_length(shapes$cat)
#> [1] 229.9564
# Use in measure()
bot %>% measure("length")
#> # A tibble: 40 × 6
#> id coo type fake price coo_length
#> <chr> <out> <fct> <fct> <dbl> <dbl>
#> 1 brahma (138 x 2) whisky a 3 1088.
#> 2 caney (168 x 2) whisky a 1.2 994.
#> 3 chimay (189 x 2) whisky a 3.8 644.
#> 4 corona (129 x 2) whisky a 2.6 806.
#> 5 deusventrue (152 x 2) whisky a 1.1 886.
#> 6 duvel (161 x 2) whisky a 3.1 606.
#> 7 franziskaner (124 x 2) whisky a 2.6 865.
#> 8 grimbergen (126 x 2) whisky a 2.9 765.
#> 9 guiness (183 x 2) whisky a 1.2 742.
#> 10 hoegardeen (193 x 2) whisky a 3.6 1048.
#> # ℹ 30 more rows
