|
1 |
| -#' Map projections. |
| 1 | +#' Map projections |
2 | 2 | #'
|
3 |
| -#' The representation of a portion of the earth, which is approximately spherical, |
4 |
| -#' onto a flat 2D plane requires a projection. This is what |
5 |
| -#' \code{\link{coord_map}} does. These projections account for the fact that the |
6 |
| -#' actual length (in km) of one degree of longitude varies between the equator |
7 |
| -#' and the pole. Near the equator, the ratio between the lengths of one degree |
8 |
| -#' of latitude and one degree of longitude is approximately 1. Near the pole, it |
9 |
| -#' is tends towards infinity because the length of one degree of longitude tends |
10 |
| -#' towards 0. For regions that span only a few degrees and are not too close to |
11 |
| -#' the poles, setting the aspect ratio of the plot to the appropriate lat/lon |
12 |
| -#' ratio approximates the usual mercator projection. This is what |
13 |
| -#' \code{coord_quickmap} does. With \code{\link{coord_map}} all elements of the |
14 |
| -#' graphic have to be projected which is not the case here. So |
15 |
| -#' \code{\link{coord_quickmap}} has the advantage of being much faster, in |
16 |
| -#' particular for complex plots such as those using with |
17 |
| -#' \code{\link{geom_tile}}, at the expense of correctness in the projection. |
18 |
| -#' This coordinate system provides the full range of map projections available |
19 |
| -#' in the mapproj package. |
| 3 | +#' \code{coord_map} projects a portion of the earth, which is approximately |
| 4 | +#' spherical, onto a flat 2D plane using any projection defined by the |
| 5 | +#' \code{mapproj} package. Map projections do not, in general, preserve straight |
| 6 | +#' lines, so this requires considerable computation. \code{coord_quickmap} is a |
| 7 | +#' quick approximation that does preserve straight lines. It works best for |
| 8 | +#' smaller areas closer to the equator. |
| 9 | +#' |
| 10 | +#' In general, map projections must account for the fact that the actual length |
| 11 | +#' (in km) of one degree of longitude varies between the equator and the pole. |
| 12 | +#' Near the equator, the ratio between the lengths of one degree of latitude and |
| 13 | +#' one degree of longitude is approximately 1. Near the pole, it is tends |
| 14 | +#' towards infinity because the length of one degree of longitude tends towards |
| 15 | +#' 0. For regions that span only a few degrees and are not too close to the |
| 16 | +#' poles, setting the aspect ratio of the plot to the appropriate lat/lon ratio |
| 17 | +#' approximates the usual mercator projection. This is what |
| 18 | +#' \code{coord_quickmap} does, and is much faster (particularly for complex |
| 19 | +#' plots like \code{\link{geom_tile}}) at the expense of correctness. |
20 | 20 | #'
|
21 |
| -#' @export |
22 | 21 | #' @param projection projection to use, see
|
23 | 22 | #' \code{\link[mapproj]{mapproject}} for list
|
24 |
| -#' @param ... other arguments passed on to \code{\link[mapproj]{mapproject}}. |
25 |
| -#' Ignored if the \code{parameters} argument is present. |
26 |
| -#' @param parameters optional numeric vector of parameters for use |
27 |
| -#' with the projection argument. This argument is optional only in |
28 |
| -#' the sense that certain projections do not require additional |
29 |
| -#' parameters. Passed to \code{\link[mapproj]{mapproject}}. |
| 23 | +#' @param ...,parameters Other arguments passed on to |
| 24 | +#' \code{\link[mapproj]{mapproject}}. Use \code{...} for named parameters to |
| 25 | +#' the projection, and \code{parameters} for unnamed parameters. |
| 26 | +#' \code{...} is ignored if the \code{parameters} argument is present. |
30 | 27 | #' @param orientation projection orientation, which defaults to
|
31 |
| -#' \code{c(90, 0, mean(range(x)))}. This is not optimal for many |
32 |
| -#' projections, so you will have to supply your own. See |
33 |
| -#' \code{\link[mapproj]{mapproject}} for more information. |
34 |
| -#' @param xlim manually specific x limits (in degrees of longitude) |
35 |
| -#' @param ylim manually specific y limits (in degrees of latitude) |
| 28 | +#' \code{c(90, 0, mean(range(x)))}. This is not optimal for many |
| 29 | +#' projections, so you will have to supply your own. See |
| 30 | +#' \code{\link[mapproj]{mapproject}} for more information. |
| 31 | +#' @param xlim,ylim Manually specific x/y limits (in degrees of |
| 32 | +#' longitude/latitude) |
36 | 33 | #' @export
|
37 | 34 | #' @examples
|
38 | 35 | #' if (require("maps")) {
|
|
0 commit comments