| CentroidFunctions | R Documentation |
This function takes a vector of x and y values
and returns the x and/or y position of the centroid of mass of the
area under the curve
centroid(
x,
y,
return,
xlim = NULL,
blank = 0,
subset = NULL,
na.rm = TRUE,
neg.rm = FALSE,
warn_xlim_out_of_range = TRUE,
warn_negative_y = TRUE
)
centroid_x(x, y, return = "x", ...)
centroid_y(x, y, return = "y", ...)
centroid_both(x, y, return = "both", ...)
x |
|
y |
|
return |
One of |
xlim |
|
blank |
Value to be subtracted from |
subset |
A |
na.rm |
a |
neg.rm |
a |
warn_xlim_out_of_range |
|
warn_negative_y |
|
... |
Other arguments to pass to |
This function uses st_centroid to calculate the centroid of mass
A scalar for the x value (if return = 'x') or
y value (if return = 'y') of the centroid of the data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.