|
7 | 7 | #'
|
8 | 8 | #' @rdname stat_sf_coordinates
|
9 | 9 | #' @details
|
10 |
| -#' coordinates of an `sf` object can be retrieved by [sf::st_coordinates()]. |
| 10 | +#' coordinates of an 'sf' object can be retrieved by `sf::st_coordinates()`. |
11 | 11 | #' But, we cannot simply use `sf::st_coordinates()` because, whereas texts and
|
12 | 12 | #' labels require exactly one coordinate per geometry, it returns multiple ones
|
13 | 13 | #' for a polygon or a line. Thus, these two steps are needed:
|
|
17 | 17 | #' 2. Retrieve coordinates from the points by `sf::st_coordinates()`.
|
18 | 18 | #'
|
19 | 19 | #' For the first step, you can use an arbitrary function via `fun.geometry`.
|
20 |
| -#' By default, [sf::st_point_on_surface()] is used; This seems more appropriate |
21 |
| -#' than [sf::st_centroid()] since lables and texts usually are intended to be |
| 20 | +#' By default, `sf::st_point_on_surface()` is used; This seems more appropriate |
| 21 | +#' than `sf::st_centroid()` since lables and texts usually are intended to be |
22 | 22 | #' put within the polygon or the line.
|
23 | 23 | #'
|
24 | 24 | #' @section Computed variables:
|
|
32 | 32 | #' Note that, while Z and M dimensions are theoretically available, you may
|
33 | 33 | #' face errors because sf functions don't always support Z and M. In such cases,
|
34 | 34 | #' you can drop these dimensions either beforehand or in a custom `fun.geometry`
|
35 |
| -#' by [sf::st_zm()]. |
| 35 | +#' by `sf::st_zm()`. |
36 | 36 | #'
|
37 | 37 | #' @examples
|
38 | 38 | #' if (requireNamespace("sf", quietly = TRUE)) {
|
|
50 | 50 | #' @inheritParams geom_point
|
51 | 51 | #' @param fun.geometry
|
52 | 52 | #' A function that takes a `sfc` object and returns a `sfc_POINT` with the
|
53 |
| -#' same length as the input. If `NULL`, [sf::st_point_on_surface()]) will be |
| 53 | +#' same length as the input. If `NULL`, `sf::st_point_on_surface()` will be |
54 | 54 | #' used. Note that the function may warn about the incorrectness of the result
|
55 | 55 | #' if the data is not projected, but you can ignore this except when you
|
56 | 56 | #' really care about the exact locations.
|
|
0 commit comments