Skip to content

Commit bc7ca5f

Browse files
author
jannes
committed
replace grey by gray
1 parent 2ee5807 commit bc7ca5f

23 files changed

+64
-64
lines changed

02-spatial-data.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,14 +821,14 @@ library(tmap)
821821
tm1 = tm_shape(india_buffer_with_s2) +
822822
tm_fill(fill = hcl.colors(4, palette = "purple green")[2], lwd = 0.01) +
823823
tm_shape(india) +
824-
tm_fill(fill = "grey95") +
824+
tm_fill(fill = "gray95") +
825825
tm_title("st_buffer() with dist = 1") +
826826
tm_title("s2 switched on (default)", position = tm_pos_in("right", "bottom"), size = 1)
827827
828828
tm2 = tm_shape(india_buffer_without_s2) +
829829
tm_fill(fill = hcl.colors(4, palette = "purple green")[3], lwd = 0.01) +
830830
tm_shape(india) +
831-
tm_fill(fill = "grey95") +
831+
tm_fill(fill = "gray95") +
832832
tm_title(" ") +
833833
tm_title("s2 switched off", position = tm_pos_in("right", "bottom"), size = 1)
834834

04-spatial-operations.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ tm_shape(grid_sf) +
552552
tm_fill(fill = c("queens", "rooks"),
553553
fill.scale = tm_scale(values = c("white", "black"))) +
554554
tm_shape(grid_sf) +
555-
tm_borders(col = "grey", lwd = 2) +
555+
tm_borders(col = "gray", lwd = 2) +
556556
tm_layout(frame = FALSE, legend.show = FALSE,
557557
panel.labels = c("queen", "rook"))
558558
```

10-gis.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,11 @@ aggzone_wgs = st_transform(aggregating_zones, "EPSG:4326")
212212
#| results: hide
213213
library(tmap)
214214
tm_shape(incongr_wgs) +
215-
tm_polygons(col = "grey5") +
215+
tm_polygons(col = "gray5") +
216216
tm_shape(aggzone_wgs) +
217217
tm_borders(col_alpha = 0.5, col = "red") +
218218
tm_add_legend(type = "lines", labels = c("incongr_wgs", "aggzone_wgs"),
219-
col = c("grey5", "red"), lwd = 3, position = tm_pos_in("right", "top")) +
219+
col = c("gray5", "red"), lwd = 3, position = tm_pos_in("right", "top")) +
220220
tm_scalebar(position = c("left", "bottom"), breaks = c(0, 0.5, 1)) +
221221
tm_layout(frame = FALSE, legend.text.size = 1,
222222
inner.margins = c(0.02, 0.02, 0.03, 0.02))

_02-ex.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ text(world_coords, world$iso_a2)
6868
# Alternative answer:
6969
nigeria = world[world$name_long == "Nigeria", ]
7070
africa = world[world$continent == "Africa", ]
71-
plot(st_geometry(nigeria), col = "white", lwd = 3, main = "Nigeria in context", border = "lightgrey", expandBB = c(0.5, 0.2, 0.5, 0.2))
72-
plot(st_geometry(world), lty = 3, add = TRUE, border = "grey")
73-
plot(st_geometry(nigeria), col = "yellow", add = TRUE, border = "darkgrey")
71+
plot(st_geometry(nigeria), col = "white", lwd = 3, main = "Nigeria in context", border = "lightgray", expandBB = c(0.5, 0.2, 0.5, 0.2))
72+
plot(st_geometry(world), lty = 3, add = TRUE, border = "gray")
73+
plot(st_geometry(nigeria), col = "yellow", add = TRUE, border = "darkgray")
7474
a = africa[grepl("Niger", africa$name_long), ]
7575
ncentre = st_centroid(a)
7676
ncentre_num = st_coordinates(ncentre)

_04-ex.Rmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ The starting point of this exercise is to create an object representing Colorado
7474
```{r 04-ex-4-1}
7575
colorado = us_states[us_states$NAME == "Colorado", ]
7676
plot(us_states$geometry)
77-
plot(colorado$geometry, col = "grey", add = TRUE)
77+
plot(colorado$geometry, col = "gray", add = TRUE)
7878
```
7979

8080
```{r 04-ex-4-2}
8181
intersects_with_colorado = us_states[colorado, , op = st_intersects]
8282
plot(us_states$geometry, main = "States that intersect with Colorado")
83-
plot(intersects_with_colorado$geometry, col = "grey", add = TRUE)
83+
plot(intersects_with_colorado$geometry, col = "gray", add = TRUE)
8484
```
8585

8686
```{r 04-ex-4-3}
@@ -103,7 +103,7 @@ us_states |>
103103
```{r 04-ex-4-4}
104104
touches_colorado = us_states[colorado, , op = st_touches]
105105
plot(us_states$geometry, main = "States that touch Colorado")
106-
plot(touches_colorado$geometry, col = "grey", add = TRUE)
106+
plot(touches_colorado$geometry, col = "gray", add = TRUE)
107107
```
108108

109109

@@ -116,7 +116,7 @@ washington_to_cali = us_states |>
116116
states_crossed = us_states[washington_to_cali, , op = st_crosses]
117117
states_crossed$NAME
118118
plot(us_states$geometry, main = "States crossed by a straight line\n from the District of Columbia to central California")
119-
plot(states_crossed$geometry, col = "grey", add = TRUE)
119+
plot(states_crossed$geometry, col = "gray", add = TRUE)
120120
plot(washington_to_cali, add = TRUE)
121121
```
122122

_09-ex.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ tmap_animation(tma1, filename = "tma2.gif", width = 1000, height = 1000)
178178
browseURL("tma1.gif")
179179
180180
tma2 = tm_shape(africa) +
181-
tm_polygons(fill = "lightgrey") +
181+
tm_polygons(fill = "lightgray") +
182182
tm_shape(ea) +
183-
tm_polygons(fill = "darkgrey") +
183+
tm_polygons(fill = "darkgray") +
184184
tm_shape(ea) +
185185
tm_polygons(fill = "HDI") +
186186
tm_facets(by = "name", nrow = 1, ncol = 1)

_404.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ null_island = st_point(c(0, 0))
77
null_island = st_sfc(null_island, crs = 4326)
88
null_island = st_sf(name = "Null Island", geom = null_island)
99
tm_shape(null_island) +
10-
tm_graticules(labels.col = "grey40") +
10+
tm_graticules(labels.col = "gray40") +
1111
tm_text("name", size = 5, fontface = "italic") +
1212
tm_layout(bg.color = "lightblue") +
13-
tm_title("You are here:", color = "grey40")
13+
tm_title("You are here:", color = "gray40")
1414
```
1515

apps/coffeeApp/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@
10731073
"URL": "http://ggplot2.tidyverse.org, https://github.com/tidyverse/ggplot2",
10741074
"BugReports": "https://github.com/tidyverse/ggplot2/issues",
10751075
"LazyData": "true",
1076-
"Collate": "'ggproto.r' 'ggplot-global.R' 'aaa-.r'\n'aes-colour-fill-alpha.r' 'aes-evaluation.r'\n'aes-group-order.r' 'aes-linetype-size-shape.r'\n'aes-position.r' 'compat-plyr.R' 'utilities.r' 'aes.r'\n'legend-draw.r' 'geom-.r' 'annotation-custom.r'\n'annotation-logticks.r' 'geom-polygon.r' 'geom-map.r'\n'annotation-map.r' 'geom-raster.r' 'annotation-raster.r'\n'annotation.r' 'autolayer.r' 'autoplot.r' 'axis-secondary.R'\n'backports.R' 'bench.r' 'bin.R' 'coord-.r' 'coord-cartesian-.r'\n'coord-fixed.r' 'coord-flip.r' 'coord-map.r' 'coord-munch.r'\n'coord-polar.r' 'coord-quickmap.R' 'coord-sf.R'\n'coord-transform.r' 'data.R' 'facet-.r' 'facet-grid-.r'\n'facet-null.r' 'facet-wrap.r' 'fortify-lm.r' 'fortify-map.r'\n'fortify-multcomp.r' 'fortify-spatial.r' 'fortify.r' 'stat-.r'\n'geom-abline.r' 'geom-rect.r' 'geom-bar.r' 'geom-bin2d.r'\n'geom-blank.r' 'geom-boxplot.r' 'geom-col.r' 'geom-path.r'\n'geom-contour.r' 'geom-count.r' 'geom-crossbar.r'\n'geom-segment.r' 'geom-curve.r' 'geom-defaults.r'\n'geom-ribbon.r' 'geom-density.r' 'geom-density2d.r'\n'geom-dotplot.r' 'geom-errorbar.r' 'geom-errorbarh.r'\n'geom-freqpoly.r' 'geom-function.R' 'geom-hex.r'\n'geom-histogram.r' 'geom-hline.r' 'geom-jitter.r'\n'geom-label.R' 'geom-linerange.r' 'geom-point.r'\n'geom-pointrange.r' 'geom-quantile.r' 'geom-rug.r' 'geom-sf.R'\n'geom-smooth.r' 'geom-spoke.r' 'geom-text.r' 'geom-tile.r'\n'geom-violin.r' 'geom-vline.r' 'ggplot2.r' 'grob-absolute.r'\n'grob-dotstack.r' 'grob-null.r' 'grouping.r' 'guide-bins.R'\n'guide-colorbar.r' 'guide-colorsteps.R' 'guide-legend.r'\n'guides-.r' 'guides-axis.r' 'guides-grid.r' 'guides-none.r'\n'hexbin.R' 'labeller.r' 'labels.r' 'layer.r' 'layer-sf.R'\n'layout.R' 'limits.r' 'margins.R' 'performance.R'\n'plot-build.r' 'plot-construction.r' 'plot-last.r' 'plot.r'\n'position-.r' 'position-collide.r' 'position-dodge.r'\n'position-dodge2.r' 'position-identity.r' 'position-jitter.r'\n'position-jitterdodge.R' 'position-nudge.R' 'position-stack.r'\n'quick-plot.r' 'range.r' 'reshape-add-margins.R' 'save.r'\n'scale-.r' 'scale-alpha.r' 'scale-binned.R' 'scale-brewer.r'\n'scale-colour.r' 'scale-continuous.r' 'scale-date.r'\n'scale-discrete-.r' 'scale-expansion.r' 'scale-gradient.r'\n'scale-grey.r' 'scale-hue.r' 'scale-identity.r'\n'scale-linetype.r' 'scale-manual.r' 'scale-shape.r'\n'scale-size.r' 'scale-steps.R' 'scale-type.R' 'scale-view.r'\n'scale-viridis.r' 'scales-.r' 'stat-bin.r' 'stat-bin2d.r'\n'stat-bindot.r' 'stat-binhex.r' 'stat-boxplot.r'\n'stat-contour.r' 'stat-count.r' 'stat-density-2d.r'\n'stat-density.r' 'stat-ecdf.r' 'stat-ellipse.R'\n'stat-function.r' 'stat-identity.r' 'stat-qq-line.R'\n'stat-qq.r' 'stat-quantile.r' 'stat-sf-coordinates.R'\n'stat-sf.R' 'stat-smooth-methods.r' 'stat-smooth.r'\n'stat-sum.r' 'stat-summary-2d.r' 'stat-summary-bin.R'\n'stat-summary-hex.r' 'stat-summary.r' 'stat-unique.r'\n'stat-ydensity.r' 'summarise-plot.R' 'summary.r'\n'theme-elements.r' 'theme.r' 'theme-defaults.r'\n'theme-current.R' 'translate-qplot-ggplot.r'\n'translate-qplot-lattice.r' 'utilities-break.r'\n'utilities-grid.r' 'utilities-help.r' 'utilities-matrix.r'\n'utilities-resolution.r' 'utilities-table.r'\n'utilities-tidy-eval.R' 'zxx.r' 'zzz.r'",
1076+
"Collate": "'ggproto.r' 'ggplot-global.R' 'aaa-.r'\n'aes-colour-fill-alpha.r' 'aes-evaluation.r'\n'aes-group-order.r' 'aes-linetype-size-shape.r'\n'aes-position.r' 'compat-plyr.R' 'utilities.r' 'aes.r'\n'legend-draw.r' 'geom-.r' 'annotation-custom.r'\n'annotation-logticks.r' 'geom-polygon.r' 'geom-map.r'\n'annotation-map.r' 'geom-raster.r' 'annotation-raster.r'\n'annotation.r' 'autolayer.r' 'autoplot.r' 'axis-secondary.R'\n'backports.R' 'bench.r' 'bin.R' 'coord-.r' 'coord-cartesian-.r'\n'coord-fixed.r' 'coord-flip.r' 'coord-map.r' 'coord-munch.r'\n'coord-polar.r' 'coord-quickmap.R' 'coord-sf.R'\n'coord-transform.r' 'data.R' 'facet-.r' 'facet-grid-.r'\n'facet-null.r' 'facet-wrap.r' 'fortify-lm.r' 'fortify-map.r'\n'fortify-multcomp.r' 'fortify-spatial.r' 'fortify.r' 'stat-.r'\n'geom-abline.r' 'geom-rect.r' 'geom-bar.r' 'geom-bin2d.r'\n'geom-blank.r' 'geom-boxplot.r' 'geom-col.r' 'geom-path.r'\n'geom-contour.r' 'geom-count.r' 'geom-crossbar.r'\n'geom-segment.r' 'geom-curve.r' 'geom-defaults.r'\n'geom-ribbon.r' 'geom-density.r' 'geom-density2d.r'\n'geom-dotplot.r' 'geom-errorbar.r' 'geom-errorbarh.r'\n'geom-freqpoly.r' 'geom-function.R' 'geom-hex.r'\n'geom-histogram.r' 'geom-hline.r' 'geom-jitter.r'\n'geom-label.R' 'geom-linerange.r' 'geom-point.r'\n'geom-pointrange.r' 'geom-quantile.r' 'geom-rug.r' 'geom-sf.R'\n'geom-smooth.r' 'geom-spoke.r' 'geom-text.r' 'geom-tile.r'\n'geom-violin.r' 'geom-vline.r' 'ggplot2.r' 'grob-absolute.r'\n'grob-dotstack.r' 'grob-null.r' 'grouping.r' 'guide-bins.R'\n'guide-colorbar.r' 'guide-colorsteps.R' 'guide-legend.r'\n'guides-.r' 'guides-axis.r' 'guides-grid.r' 'guides-none.r'\n'hexbin.R' 'labeller.r' 'labels.r' 'layer.r' 'layer-sf.R'\n'layout.R' 'limits.r' 'margins.R' 'performance.R'\n'plot-build.r' 'plot-construction.r' 'plot-last.r' 'plot.r'\n'position-.r' 'position-collide.r' 'position-dodge.r'\n'position-dodge2.r' 'position-identity.r' 'position-jitter.r'\n'position-jitterdodge.R' 'position-nudge.R' 'position-stack.r'\n'quick-plot.r' 'range.r' 'reshape-add-margins.R' 'save.r'\n'scale-.r' 'scale-alpha.r' 'scale-binned.R' 'scale-brewer.r'\n'scale-colour.r' 'scale-continuous.r' 'scale-date.r'\n'scale-discrete-.r' 'scale-expansion.r' 'scale-gradient.r'\n'scale-gray.r' 'scale-hue.r' 'scale-identity.r'\n'scale-linetype.r' 'scale-manual.r' 'scale-shape.r'\n'scale-size.r' 'scale-steps.R' 'scale-type.R' 'scale-view.r'\n'scale-viridis.r' 'scales-.r' 'stat-bin.r' 'stat-bin2d.r'\n'stat-bindot.r' 'stat-binhex.r' 'stat-boxplot.r'\n'stat-contour.r' 'stat-count.r' 'stat-density-2d.r'\n'stat-density.r' 'stat-ecdf.r' 'stat-ellipse.R'\n'stat-function.r' 'stat-identity.r' 'stat-qq-line.R'\n'stat-qq.r' 'stat-quantile.r' 'stat-sf-coordinates.R'\n'stat-sf.R' 'stat-smooth-methods.r' 'stat-smooth.r'\n'stat-sum.r' 'stat-summary-2d.r' 'stat-summary-bin.R'\n'stat-summary-hex.r' 'stat-summary.r' 'stat-unique.r'\n'stat-ydensity.r' 'summarise-plot.R' 'summary.r'\n'theme-elements.r' 'theme.r' 'theme-defaults.r'\n'theme-current.R' 'translate-qplot-ggplot.r'\n'translate-qplot-lattice.r' 'utilities-break.r'\n'utilities-grid.r' 'utilities-help.r' 'utilities-matrix.r'\n'utilities-resolution.r' 'utilities-table.r'\n'utilities-tidy-eval.R' 'zxx.r' 'zzz.r'",
10771077
"VignetteBuilder": "knitr",
10781078
"RoxygenNote": "7.1.0.9000",
10791079
"Encoding": "UTF-8",

code/02-contpop.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ par(mar = c(0, 0, 0, 0))
66
plot(world_proj["continent"], reset = FALSE, main = "", key.pos = NULL)
77
g = st_graticule()
88
g = st_transform(g, crs = "+proj=eck4")
9-
plot(g$geometry, add = TRUE, col = "lightgrey")
9+
plot(g$geometry, add = TRUE, col = "lightgray")
1010
cex = sqrt(world$pop) / 10000
1111
plot(st_geometry(world_cents), add = TRUE, cex = cex, lwd = 2, graticule = TRUE)

code/02-vectorplots.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ london_orign = rbind(london_osgb, origin_osgb)
1414
png("images/vector_lonlat.png")
1515
globe::globeearth(eye = c(0, 0))
1616
gratmat = st_coordinates(st_graticule())[, 1:2]
17-
globe::globelines(loc = gratmat, col = "grey", lty = 3)
17+
globe::globelines(loc = gratmat, col = "gray", lty = 3)
1818
globe::globelines(loc = matrix(c(-90, 90, 0, 0), ncol = 2))
1919
globe::globelines(loc = matrix(c(0, 0, -90, 90), ncol = 2))
2020
globe::globepoints(loc = c(-0.1, 51.5), pch = 4, cex = 2, lwd = 3, col = "red")
@@ -28,6 +28,6 @@ uk = rnaturalearth::ne_countries(scale = 50) %>%
2828
plot(uk$geometry)
2929
plot(london_orign$geometry[1], add = TRUE, pch = 4, cex = 2, lwd = 3, col = "red")
3030
plot(london_orign$geometry[2], add = TRUE, pch = 1, cex = 2, lwd = 3, col = "blue")
31-
abline(h = seq(0, 9e5, length.out = 10), col = "grey", lty = 3)
32-
abline(v = seq(0, 9e5, length.out = 10), col = "grey", lty = 3)
31+
abline(h = seq(0, 9e5, length.out = 10), col = "gray", lty = 3)
32+
abline(v = seq(0, 9e5, length.out = 10), col = "gray", lty = 3)
3333
dev.off()

code/05-venn-clip.R

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,33 @@ if (!exists("b")) {
99
}
1010

1111
old_par = par(mfrow = c(2, 3), mai = c(0.1, 0.1, 0.1, 0.1))
12-
plot(b, border = "grey")
13-
plot(x, add = TRUE, col = "lightgrey", border = "grey")
12+
plot(b, border = "gray")
13+
plot(x, add = TRUE, col = "lightgray", border = "gray")
1414
text(cex = 1.8, x = 0.5, y = 1, "x")
15-
plot(b, add = TRUE, border = "grey")
15+
plot(b, add = TRUE, border = "gray")
1616
x_not_y = st_difference(x, y)
17-
plot(b, border = "grey")
18-
plot(x_not_y, col = "lightgrey", add = TRUE, border = "grey")
17+
plot(b, border = "gray")
18+
plot(x_not_y, col = "lightgray", add = TRUE, border = "gray")
1919
text(cex = 1.8, x = 0.5, y = 1, "st_difference(x, y)")
2020

2121
y_not_x = st_difference(y, x)
22-
plot(b, border = "grey")
23-
plot(y_not_x, col = "lightgrey", add = TRUE, border = "grey")
22+
plot(b, border = "gray")
23+
plot(y_not_x, col = "lightgray", add = TRUE, border = "gray")
2424
text(cex = 1.8, x = 0.5, y = 1, "st_difference(y, x)")
2525
x_or_y = st_union(x, y)
26-
plot(x_or_y, col = "lightgrey", border = "grey")
26+
plot(x_or_y, col = "lightgray", border = "gray")
2727
text(cex = 1.8, x = 0.5, y = 1, "st_union(x, y)")
2828
x_and_y = st_intersection(x, y)
29-
plot(b, border = "grey")
30-
plot(x_and_y, col = "lightgrey", add = TRUE, border = "grey")
29+
plot(b, border = "gray")
30+
plot(x_and_y, col = "lightgray", add = TRUE, border = "gray")
3131
text(cex = 1.8, x = 0.5, y = 1, "st_intersection(x, y)")
3232
# x_xor_y = st_difference(x_xor_y, x_and_y) # failing
3333
x_xor_y = st_sym_difference(x, y)
34-
plot(x_xor_y, col = "lightgrey", border = "grey")
34+
plot(x_xor_y, col = "lightgray", border = "gray")
3535
text(cex = 1.8, x = 0.5, y = 1, "st_sym_difference(x, y)")
3636
# plot.new()
37-
# plot(b, border = "grey")
38-
# plot(y, col = "lightgrey", add = TRUE, border = "grey")
39-
# plot(b, add = TRUE, border = "grey")
37+
# plot(b, border = "gray")
38+
# plot(y, col = "lightgray", add = TRUE, border = "gray")
39+
# plot(b, add = TRUE, border = "gray")
4040
# text(cex = 1.2, x = 0.5, y = 1, "y")
4141
par(old_par)

code/13-cycleways.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ bristol_stations_top = bristol_stations[desire_rail, , op = st_is_within_distanc
66
m_leaflet = tm_shape(bristol_ttwa) +
77
tm_borders(col = "darkblue") +
88
tm_shape(bristol_ways) +
9-
tm_lines(col = "highway", lwd = 3, palette = c("lightgreen", "grey", "pink")) +
9+
tm_lines(col = "highway", lwd = 3, palette = c("lightgreen", "gray", "pink")) +
1010
tm_scalebar() +
1111
tm_shape(route_cycleway) +
1212
tm_lines(col = "blue", lwd = "all", scale = 20, alpha = 0.6) +

code/chapters/02-spatial-data.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,14 +419,14 @@ library(tmap)
419419
tm1 = tm_shape(india_buffer_with_s2) +
420420
tm_fill(col = hcl.colors(4, palette = "purple green")[3]) +
421421
tm_shape(india) +
422-
tm_fill(col = "grey95") +
422+
tm_fill(col = "gray95") +
423423
tm_layout(main.title = "st_buffer() with dist = 1",
424424
title = "s2 switched on (default)")
425425

426426
tm2 = tm_shape(india_buffer_without_s2) +
427427
tm_fill(col = hcl.colors(4, palette = "purple green")[3]) +
428428
tm_shape(india) +
429-
tm_fill(col = "grey95") +
429+
tm_fill(col = "gray95") +
430430
tm_layout(main.title = " ",
431431
title = "s2 switched off")
432432

code/chapters/04-spatial-operations.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ plot(grid, col = grid_sf$rooks)
368368
tm_shape(grid_sf) +
369369
tm_fill(col = c("queens", "rooks"), palette = c("white", "black")) +
370370
tm_shape(grid_sf) +
371-
tm_borders(col = "grey", lwd = 2) +
371+
tm_borders(col = "gray", lwd = 2) +
372372
tm_layout(frame = FALSE, legend.show = FALSE,
373373
panel.labels = c("queen", "rook"))
374374

code/chapters/05-geometry-operations.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,16 @@ nz_scale_sf = st_set_geometry(nz, nz_scale)
171171
## ----points, fig.cap="Overlapping circles.", fig.asp=0.4, crop = TRUE-------------------------------
172172
b = st_sfc(st_point(c(0, 1)), st_point(c(1, 1))) # create 2 points
173173
b = st_buffer(b, dist = 1) # convert points to circles
174-
plot(b, border = "grey")
174+
plot(b, border = "gray")
175175
text(x = c(-0.5, 1.5), y = 1, labels = c("x", "y"), cex = 3) # add text
176176

177177

178178
## ----circle-intersection, fig.cap="Overlapping circles with a gray color indicating intersection between them.", fig.asp=0.4, fig.scap="Overlapping circles showing intersection types.", crop = TRUE----
179179
x = b[1]
180180
y = b[2]
181181
x_and_y = st_intersection(x, y)
182-
plot(b, border = "grey")
183-
plot(x_and_y, col = "lightgrey", border = "grey", add = TRUE) # intersecting area
182+
plot(b, border = "gray")
183+
plot(x_and_y, col = "lightgray", border = "gray", add = TRUE) # intersecting area
184184

185185

186186
## ----venn-clip, echo=FALSE, fig.cap="Spatial equivalents of logical operators.", warning=FALSE------
@@ -194,9 +194,9 @@ box = st_as_sfc(bb)
194194
set.seed(2017)
195195
p = st_sample(x = box, size = 10)
196196
p_xy1 = p[x_and_y]
197-
plot(box, border = "grey", lty = 2)
198-
plot(x, add = TRUE, border = "grey")
199-
plot(y, add = TRUE, border = "grey")
197+
plot(box, border = "gray", lty = 2)
198+
plot(x, add = TRUE, border = "gray")
199+
plot(y, add = TRUE, border = "gray")
200200
plot(p, add = TRUE)
201201
plot(p_xy1, cex = 3, col = "red", add = TRUE)
202202
text(x = c(-0.5, 1.5), y = 1, labels = c("x", "y"), cex = 2)

code/chapters/10-gis.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ aggzone_wgs = st_transform(aggregating_zones, "EPSG:4326")
6363
## ----uniondata, echo=FALSE, fig.cap="Illustration of two areal units: incongruent (black lines) and aggregating zones (red borders). "----
6464
library(tmap)
6565
tm_shape(incongr_wgs) +
66-
tm_polygons(border.col = "grey5") +
66+
tm_polygons(border.col = "gray5") +
6767
tm_shape(aggzone_wgs) +
6868
tm_borders(alpha = 0.5, col = "red") +
6969
tm_add_legend(type = "line",
7070
labels = c("incongr_wgs", "aggzone_wgs"),
71-
col = c("grey5", "red"),
71+
col = c("gray5", "red"),
7272
lwd = 3) +
7373
tm_scale_bar(position = c("left", "bottom"),
7474
breaks = c(0, 0.5, 1)) +

code/chapters/_02-ex.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ text(world_coords, world$iso_a2)
4949
# Alternative answer:
5050
nigeria = world[world$name_long == "Nigeria", ]
5151
africa = world[world$continent == "Africa", ]
52-
plot(st_geometry(nigeria), col = "white", lwd = 3, main = "Nigeria in context", border = "lightgrey", expandBB = c(0.5, 0.2, 0.5, 0.2))
53-
plot(st_geometry(world), lty = 3, add = TRUE, border = "grey")
54-
plot(st_geometry(nigeria), col = "yellow", add = TRUE, border = "darkgrey")
52+
plot(st_geometry(nigeria), col = "white", lwd = 3, main = "Nigeria in context", border = "lightgray", expandBB = c(0.5, 0.2, 0.5, 0.2))
53+
plot(st_geometry(world), lty = 3, add = TRUE, border = "gray")
54+
plot(st_geometry(nigeria), col = "yellow", add = TRUE, border = "darkgray")
5555
a = africa[grepl("Niger", africa$name_long), ]
5656
ncentre = st_centroid(a)
5757
ncentre_num = st_coordinates(ncentre)

0 commit comments

Comments
 (0)