Calculate the normalized centroid size (centroid size divided by perimeter).
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
Details
For tibbles, this function extracts values without modifying the tibble.
Use within mutate() to add as a column: mutate(df, cs_norm = get_centroid_size_norm(coo))
Examples
get_centroid_size_norm(shapes$cat)
#> [1] 77.4076
get_centroid_size_norm(shapes)
#> $cat
#> [1] 77.4076
#>
#> $dog
#> [1] 86.78916
#>
#> $heart
#> [1] 89.2805
#>
#> $leaf2
#> [1] 74.38899
#>
# Extract from tibble
sizes_norm <- get_centroid_size_norm(bot)
# Add to tibble
bot$cs_norm <- get_centroid_size_norm(bot)
