|
57 | 57 | #'
|
58 | 58 | #' if (require("maps")) {
|
59 | 59 | #' # Other projections
|
60 |
| -#' nzmap + coord_map("cylindrical") |
61 |
| -#' } |
62 |
| -#' |
63 |
| -#' if (require("maps")) { |
64 | 60 | #' nzmap + coord_map("azequalarea", orientation = c(-36.92, 174.6, 0))
|
65 | 61 | #' }
|
66 | 62 | #'
|
67 | 63 | #' if (require("maps")) {
|
68 |
| -#' nzmap + coord_map("lambert", parameters = c(-37, -44)) |
69 |
| -#' } |
70 |
| -#' |
71 |
| -#' if (require("maps")) { |
72 | 64 | #' states <- map_data("state")
|
73 | 65 | #' usamap <- ggplot(states, aes(long, lat, group = group)) +
|
74 | 66 | #' geom_polygon(fill = "white", colour = "black")
|
|
83 | 75 | #' }
|
84 | 76 | #'
|
85 | 77 | #' if (require("maps")) {
|
86 |
| -#' usamap + coord_quickmap() |
87 |
| -#' } |
88 |
| -#' |
89 |
| -#' if (require("maps")) { |
90 | 78 | #' # See ?mapproject for coordinate systems and their parameters
|
91 | 79 | #' usamap + coord_map("gilbert")
|
92 | 80 | #' }
|
93 | 81 | #'
|
94 | 82 | #' if (require("maps")) {
|
95 |
| -#' usamap + coord_map("lagrange") |
96 |
| -#' } |
97 |
| -#' |
98 |
| -#' if (require("maps")) { |
99 | 83 | #' # For most projections, you'll need to set the orientation yourself
|
100 | 84 | #' # as the automatic selection done by mapproject is not available to
|
101 | 85 | #' # ggplot
|
102 | 86 | #' usamap + coord_map("orthographic")
|
103 | 87 | #' }
|
104 | 88 | #'
|
105 | 89 | #' if (require("maps")) {
|
106 |
| -#' usamap + coord_map("stereographic") |
107 |
| -#' } |
108 |
| -#' |
109 |
| -#' if (require("maps")) { |
110 | 90 | #' usamap + coord_map("conic", lat0 = 30)
|
111 | 91 | #' }
|
112 | 92 | #'
|
113 | 93 | #' if (require("maps")) {
|
114 | 94 | #' usamap + coord_map("bonne", lat0 = 50)
|
115 | 95 | #' }
|
116 | 96 | #'
|
| 97 | +#' \dontrun{ |
117 | 98 | #' if (require("maps")) {
|
118 |
| -#' |
119 | 99 | #' # World map, using geom_path instead of geom_polygon
|
120 | 100 | #' world <- map_data("world")
|
121 | 101 | #' worldmap <- ggplot(world, aes(x = long, y = lat, group = group)) +
|
|
136 | 116 | #' # Centered on New York (currently has issues with closing polygons)
|
137 | 117 | #' worldmap + coord_map("ortho", orientation = c(41, -74, 0))
|
138 | 118 | #' }
|
| 119 | +#' } |
139 | 120 | coord_map <- function(projection="mercator", ..., parameters = NULL, orientation = NULL, xlim = NULL, ylim = NULL, clip = "on") {
|
140 | 121 | if (is.null(parameters)) {
|
141 | 122 | params <- list(...)
|
|
0 commit comments