R/helpers.R
centre.Rd
Return the median value or the modal value of a vector, depending on whether the vector is numeric or a factor.
centre(x, ...) # S3 method for numeric centre(x, na.rm = TRUE, ...) # S3 method for factor centre(x, na.rm = TRUE, ...)
x | an object for which a method has been defined, or a numeric vector containing the values whose median is to be computed. |
---|---|
... | potentially further arguments for methods; not used in the default method. |
na.rm | a logical value indicating whether |
the median value for objects of the class integer or double. The modal value for objects of class factor.
#> [1] 0.5#> [1] 1 #> Levels: -3 -2 0 1 3dados <- st_drop_geometry(centro_2015)#> Error in st_drop_geometry(centro_2015): could not find function "st_drop_geometry"centre(dados$padrao)#> Error in centre(dados$padrao): object 'dados' not found