Skip to content

Commit f64ed7e

Browse files
committed
Fix coding style and spelling for new coord_quickmap
1 parent 4f6373c commit f64ed7e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

R/coord-quickmap.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Cartesian coordinates with an aspect ratio approximating mercator projection.
1+
#' Cartesian coordinates with an aspect ratio approximating Mercator projection.
22
#'
33
#' The represenation of a portion of the earth, wich is approximately spherical,
44
#' onto a flat 2D plane requires a projection. This is what
@@ -26,8 +26,8 @@
2626
#' # Create a lat-long dataframe from the maps package
2727
#' nz <- map_data("nz")
2828
#' # Prepare a plot of the map
29-
#' nzmap <- ggplot(nz, aes(x=long, y=lat, group=group)) +
30-
#' geom_polygon(fill="white", colour="black")
29+
#' nzmap <- ggplot(nz, aes(x = long, y = lat, group = group)) +
30+
#' geom_polygon(fill = "white", colour = "black")
3131
#'
3232
#' # Plot it in cartesian coordinates
3333
#' nzmap
@@ -51,8 +51,8 @@ coord_aspect.quickmap <- function(coord, ranges) {
5151

5252
# compute distance corresponding to 1 degree in either direction
5353
# from the center
54-
x.dist <- dist_central_angle(x.center+c(-0.5,0.5), rep(y.center,2))
55-
y.dist <- dist_central_angle(rep(x.center,2), y.center+c(-0.5,0.5))
54+
x.dist <- dist_central_angle(x.center + c(-0.5, 0.5), rep(y.center, 2))
55+
y.dist <- dist_central_angle(rep(x.center, 2), y.center+c(-0.5, 0.5))
5656
# NB: this makes the projection correct in the center of the plot and
5757
# increasingly less correct towards the edges. For regions of reasonnable
5858
# size, this seems to give better results than computing this ratio from

man/coord_quickmap.Rd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% Generated by roxygen2 (4.0.0): do not edit by hand
22
\name{coord_quickmap}
33
\alias{coord_quickmap}
4-
\title{Cartesian coordinates with an aspect ratio approximating mercator projection.}
4+
\title{Cartesian coordinates with an aspect ratio approximating Mercator projection.}
55
\usage{
66
coord_quickmap(xlim = NULL, ylim = NULL)
77
}
@@ -35,8 +35,8 @@ if (require("maps")) {
3535
# Create a lat-long dataframe from the maps package
3636
nz <- map_data("nz")
3737
# Prepare a plot of the map
38-
nzmap <- ggplot(nz, aes(x=long, y=lat, group=group)) +
39-
geom_polygon(fill="white", colour="black")
38+
nzmap <- ggplot(nz, aes(x = long, y = lat, group = group)) +
39+
geom_polygon(fill = "white", colour = "black")
4040

4141
# Plot it in cartesian coordinates
4242
nzmap

0 commit comments

Comments
 (0)