Skip to content

Commit

Permalink
Deploy commit: 8c85dea
Browse files Browse the repository at this point in the history
  • Loading branch information
Nowosad committed May 5, 2024
1 parent f5268fc commit 53ef32b
Show file tree
Hide file tree
Showing 27 changed files with 62 additions and 62 deletions.
4 changes: 2 additions & 2 deletions 02-spatial-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ cat(crs(nlcd)) # CRS
#> LENGTHUNIT["metre",1]],
#> USAGE[
#> SCOPE["Engineering survey, topographic mapping."],
#> AREA["North America - between 114°W and 108°W - onshore and offshore. Canada - Alberta; Northwest Territories; Nunavut; Saskatchewan. United States (USA) - Arizona; Colorado; Idaho; Montana; New Mexico; Utah; Wyoming."],
#> AREA["North America - between 114<c2><b0>W and 108<c2><b0>W - onshore and offshore. Canada - Alberta; Northwest Territories; Nunavut; Saskatchewan. United States (USA) - Arizona; Colorado; Idaho; Montana; New Mexico; Utah; Wyoming."],
#> BBOX[31.33,-114,84,-108]],
#> ID["EPSG",26912]]
```
Expand Down Expand Up @@ -219,7 +219,7 @@ cat(crs(nlcd))
#> LENGTHUNIT["metre",1]],
#> USAGE[
#> SCOPE["Engineering survey, topographic mapping."],
#> AREA["North America - between 114°W and 108°W - onshore and offshore. Canada - Alberta; Northwest Territories; Nunavut; Saskatchewan. United States (USA) - Arizona; Colorado; Idaho; Montana; New Mexico; Utah; Wyoming."],
#> AREA["North America - between 114<c2><b0>W and 108<c2><b0>W - onshore and offshore. Canada - Alberta; Northwest Territories; Nunavut; Saskatchewan. United States (USA) - Arizona; Colorado; Idaho; Montana; New Mexico; Utah; Wyoming."],
#> BBOX[31.33,-114,84,-108]],
#> ID["EPSG",26912]]
```
Expand Down
26 changes: 13 additions & 13 deletions 03-attribute-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,13 @@ us_states |>
#> Dimension: XY
#> Bounding box: xmin: -125 ymin: 24.6 xmax: -67 ymax: 49.4
#> Geodetic CRS: NAD83
#> # A tibble: 4 × 3
#> # A tibble: 4 x 3
#> REGION nr_of_states geometry
#> <fct> <int> <MULTIPOLYGON [°]>
#> 1 Norteast 9 (((-70.8 42.9, -70.7 43.1, -70.6 43.1, -70.5 43.3, -70.
#> 2 Midwest 12 (((-85.5 45.6, -85.5 45.8, -85.6 45.8, -85.6 45.6, -85.
#> 3 South 17 (((-81.4 30.7, -81.4 30.8, -81.4 30.9, -81.4 31, -81.3
#> 4 West 11 (((-118 33.4, -118 33.3, -118 33.3, -118 33.4, -119 33.
#> <fct> <int> <MULTIPOLYGON [arc_degree]>
#> 1 Norteast 9 (((-70.8 42.9, -70.7 43.1, -70.6 43.1, -70.5 43.3, -70.~
#> 2 Midwest 12 (((-85.5 45.6, -85.5 45.8, -85.6 45.8, -85.6 45.6, -85.~
#> 3 South 17 (((-81.4 30.7, -81.4 30.8, -81.4 30.9, -81.4 31, -81.3 ~
#> 4 West 11 (((-118 33.4, -118 33.3, -118 33.3, -118 33.4, -119 33.~
```

E6. What was the minimum and maximum total population in 2015 in each region?
Expand All @@ -305,13 +305,13 @@ us_states |>
#> Dimension: XY
#> Bounding box: xmin: -125 ymin: 24.6 xmax: -67 ymax: 49.4
#> Geodetic CRS: NAD83
#> # A tibble: 4 × 5
#> # A tibble: 4 x 5
#> REGION min_pop max_pop tot_pop geometry
#> <fct> <dbl> <dbl> <dbl> <MULTIPOLYGON [°]>
#> 1 Norteast 626604 19673174 55989520 (((-70.8 42.9, -70.7 43.1, -70.6 43.1, -7
#> 2 Midwest 721640 12873761 67546398 (((-85.5 45.6, -85.5 45.8, -85.6 45.8, -8
#> 3 South 647484 26538614 118575377 (((-81.4 30.7, -81.4 30.8, -81.4 30.9, -8
#> 4 West 579679 38421464 72264052 (((-118 33.4, -118 33.3, -118 33.3, -118
#> <fct> <dbl> <dbl> <dbl> <MULTIPOLYGON [arc_degree]>
#> 1 Norteast 626604 19673174 55989520 (((-70.8 42.9, -70.7 43.1, -70.6 43.1, -7~
#> 2 Midwest 721640 12873761 67546398 (((-85.5 45.6, -85.5 45.8, -85.6 45.8, -8~
#> 3 South 647484 26538614 118575377 (((-81.4 30.7, -81.4 30.8, -81.4 30.9, -8~
#> 4 West 579679 38421464 72264052 (((-118 33.4, -118 33.3, -118 33.3, -118 ~
```

E7. Add variables from `us_states_df` to `us_states`, and create a new object called `us_states_stats`.
Expand All @@ -332,7 +332,7 @@ How can you find them? (hint: try to use the `dplyr::anti_join()` function)
```r
us_states_df |>
anti_join(st_drop_geometry(us_states), by = c("state" = "NAME"))
#> # A tibble: 2 × 5
#> # A tibble: 2 x 5
#> state median_income_10 median_income_15 poverty_level_10 poverty_level_15
#> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 Alaska 29509 31455 64245 72957
Expand Down
2 changes: 1 addition & 1 deletion 08-read-write-plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ read_sf
#> st_read(..., quiet = quiet, stringsAsFactors = stringsAsFactors,
#> as_tibble = as_tibble)
#> }
#> <bytecode: 0x56207aeadc68>
#> <bytecode: 0x5633b3f81738>
#> <environment: namespace:sf>
nc = st_read(system.file("shape/nc.shp", package="sf"))
#> Reading layer `nc' from data source
Expand Down
4 changes: 2 additions & 2 deletions 09-mapping.md

Large diffs are not rendered by default.

Binary file modified 09-mapping_files/figure-html/unnamed-chunk-9-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 09-mapping_files/figure-html/unnamed-chunk-9-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion 10-gis.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ plot(st_geometry(ca_highways))
```

<!-- stac+gdalcubes 1 -->
E8. The `ndvi.tif` raster (`system.file("raster/ndvi.tif", package = "spDataLarge")`) contains NDVI calculated for the Mongón study area based on Landsat data from September 22nd, 2000.
E8. The `ndvi.tif` raster (`system.file("raster/ndvi.tif", package = "spDataLarge")`) contains NDVI calculated for the Mong<U+00F3>n study area based on Landsat data from September 22nd, 2000.
Use **rstac**, **gdalcubes**, and **terra** to download Sentinel-2 images for the same area from
2020-08-01 to 2020-10-31, calculate its NDVI, and then compare it with the results from `ndvi.tif`.

Expand Down
4 changes: 2 additions & 2 deletions 14-location.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ names(reclass) = names(input_ras)
#************************************
metro_names = dplyr::pull(metro_names, city) |>
as.character() |>
{\(x) ifelse(x == "Velbert", "Düsseldorf", x)}() |>
{\(x) gsub("ü", "ue", x)}()
{\(x) ifelse(x == "Velbert", "D<U+00FC>sseldorf", x)}() |>
{\(x) gsub("<U+00FC>", "ue", x)}()

pop_agg = terra::aggregate(reclass$pop, fact = 20, fun = sum, na.rm = TRUE)
pop_agg = pop_agg[pop_agg > 500000, drop = FALSE]
Expand Down
4 changes: 2 additions & 2 deletions 404.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions adv-map.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion algorithms.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h2>Note: Second Edition is under construction 🏗</h2>
<footer class="bg-primary text-light mt-5"><div class="container"><div class="row">

<div class="col-12 col-md-6 mt-3">
<p>"<strong>Geocomputation with R: Solutions</strong>" was written by Robin Lovelace, Jakub Nowosad, Jannes Muenchow. It was last built on 2024-04-28.</p>
<p>"<strong>Geocomputation with R: Solutions</strong>" was written by Robin Lovelace, Jakub Nowosad, Jannes Muenchow. It was last built on 2024-05-05.</p>
</div>

<div class="col-12 col-md-6 mt-3">
Expand Down
28 changes: 14 additions & 14 deletions attr.html
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,13 @@ <h1>
<span><span class="co">#&gt; Dimension: XY</span></span>
<span><span class="co">#&gt; Bounding box: xmin: -125 ymin: 24.6 xmax: -67 ymax: 49.4</span></span>
<span><span class="co">#&gt; Geodetic CRS: NAD83</span></span>
<span><span class="co">#&gt; # A tibble: 4 × 3</span></span>
<span><span class="co">#&gt; # A tibble: 4 x 3</span></span>
<span><span class="co">#&gt; REGION nr_of_states geometry</span></span>
<span><span class="co">#&gt; &lt;fct&gt; &lt;int&gt; &lt;MULTIPOLYGON [°]&gt;</span></span>
<span><span class="co">#&gt; 1 Norteast 9 (((-70.8 42.9, -70.7 43.1, -70.6 43.1, -70.5 43.3, -70.</span></span>
<span><span class="co">#&gt; 2 Midwest 12 (((-85.5 45.6, -85.5 45.8, -85.6 45.8, -85.6 45.6, -85.</span></span>
<span><span class="co">#&gt; 3 South 17 (((-81.4 30.7, -81.4 30.8, -81.4 30.9, -81.4 31, -81.3 </span></span>
<span><span class="co">#&gt; 4 West 11 (((-118 33.4, -118 33.3, -118 33.3, -118 33.4, -119 33.</span></span></code></pre></div>
<span><span class="co">#&gt; &lt;fct&gt; &lt;int&gt; &lt;MULTIPOLYGON [arc_degree]&gt;</span></span>
<span><span class="co">#&gt; 1 Norteast 9 (((-70.8 42.9, -70.7 43.1, -70.6 43.1, -70.5 43.3, -70.~</span></span>
<span><span class="co">#&gt; 2 Midwest 12 (((-85.5 45.6, -85.5 45.8, -85.6 45.8, -85.6 45.6, -85.~</span></span>
<span><span class="co">#&gt; 3 South 17 (((-81.4 30.7, -81.4 30.8, -81.4 30.9, -81.4 31, -81.3 ~</span></span>
<span><span class="co">#&gt; 4 West 11 (((-118 33.4, -118 33.3, -118 33.3, -118 33.4, -119 33.~</span></span></code></pre></div>
<p>E6. What was the minimum and maximum total population in 2015 in each region?
What was the total population in 2015 in each region?</p>
<div class="sourceCode" id="cb14"><pre class="downlit sourceCode r">
Expand All @@ -363,13 +363,13 @@ <h1>
<span><span class="co">#&gt; Dimension: XY</span></span>
<span><span class="co">#&gt; Bounding box: xmin: -125 ymin: 24.6 xmax: -67 ymax: 49.4</span></span>
<span><span class="co">#&gt; Geodetic CRS: NAD83</span></span>
<span><span class="co">#&gt; # A tibble: 4 × 5</span></span>
<span><span class="co">#&gt; # A tibble: 4 x 5</span></span>
<span><span class="co">#&gt; REGION min_pop max_pop tot_pop geometry</span></span>
<span><span class="co">#&gt; &lt;fct&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;MULTIPOLYGON [°]&gt;</span></span>
<span><span class="co">#&gt; 1 Norteast 626604 19673174 55989520 (((-70.8 42.9, -70.7 43.1, -70.6 43.1, -7</span></span>
<span><span class="co">#&gt; 2 Midwest 721640 12873761 67546398 (((-85.5 45.6, -85.5 45.8, -85.6 45.8, -8</span></span>
<span><span class="co">#&gt; 3 South 647484 26538614 118575377 (((-81.4 30.7, -81.4 30.8, -81.4 30.9, -8</span></span>
<span><span class="co">#&gt; 4 West 579679 38421464 72264052 (((-118 33.4, -118 33.3, -118 33.3, -118 </span></span></code></pre></div>
<span><span class="co">#&gt; &lt;fct&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;MULTIPOLYGON [arc_degree]&gt;</span></span>
<span><span class="co">#&gt; 1 Norteast 626604 19673174 55989520 (((-70.8 42.9, -70.7 43.1, -70.6 43.1, -7~</span></span>
<span><span class="co">#&gt; 2 Midwest 721640 12873761 67546398 (((-85.5 45.6, -85.5 45.8, -85.6 45.8, -8~</span></span>
<span><span class="co">#&gt; 3 South 647484 26538614 118575377 (((-81.4 30.7, -81.4 30.8, -81.4 30.9, -8~</span></span>
<span><span class="co">#&gt; 4 West 579679 38421464 72264052 (((-118 33.4, -118 33.3, -118 33.3, -118 ~</span></span></code></pre></div>
<p>E7. Add variables from <code>us_states_df</code> to <code>us_states</code>, and create a new object called <code>us_states_stats</code>.
What function did you use and why?
Which variable is the key in both datasets?
Expand All @@ -384,7 +384,7 @@ <h1>
<div class="sourceCode" id="cb16"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">us_states_df</span> <span class="op">|&gt;</span></span>
<span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter-joins.html">anti_join</a></span><span class="op">(</span><span class="fu"><a href="https://r-spatial.github.io/sf/reference/st_geometry.html">st_drop_geometry</a></span><span class="op">(</span><span class="va">us_states</span><span class="op">)</span>, by <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"state"</span> <span class="op">=</span> <span class="st">"NAME"</span><span class="op">)</span><span class="op">)</span></span>
<span><span class="co">#&gt; # A tibble: 2 × 5</span></span>
<span><span class="co">#&gt; # A tibble: 2 x 5</span></span>
<span><span class="co">#&gt; state median_income_10 median_income_15 poverty_level_10 poverty_level_15</span></span>
<span><span class="co">#&gt; &lt;chr&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt;</span></span>
<span><span class="co">#&gt; 1 Alaska 29509 31455 64245 72957</span></span>
Expand Down Expand Up @@ -546,7 +546,7 @@ <h2>Note: Second Edition is under construction 🏗</h2>
<footer class="bg-primary text-light mt-5"><div class="container"><div class="row">

<div class="col-12 col-md-6 mt-3">
<p>"<strong>Geocomputation with R: Solutions</strong>" was written by Robin Lovelace, Jakub Nowosad, Jannes Muenchow. It was last built on 2024-04-28.</p>
<p>"<strong>Geocomputation with R: Solutions</strong>" was written by Robin Lovelace, Jakub Nowosad, Jannes Muenchow. It was last built on 2024-05-05.</p>
</div>

<div class="col-12 col-md-6 mt-3">
Expand Down
2 changes: 1 addition & 1 deletion eco.html
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ <h2>Note: Second Edition is under construction 🏗</h2>
<footer class="bg-primary text-light mt-5"><div class="container"><div class="row">

<div class="col-12 col-md-6 mt-3">
<p>"<strong>Geocomputation with R: Solutions</strong>" was written by Robin Lovelace, Jakub Nowosad, Jannes Muenchow. It was last built on 2024-04-28.</p>
<p>"<strong>Geocomputation with R: Solutions</strong>" was written by Robin Lovelace, Jakub Nowosad, Jannes Muenchow. It was last built on 2024-05-05.</p>
</div>

<div class="col-12 col-md-6 mt-3">
Expand Down
2 changes: 1 addition & 1 deletion geometric-operations.html
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ <h2>Note: Second Edition is under construction 🏗</h2>
<footer class="bg-primary text-light mt-5"><div class="container"><div class="row">

<div class="col-12 col-md-6 mt-3">
<p>"<strong>Geocomputation with R: Solutions</strong>" was written by Robin Lovelace, Jakub Nowosad, Jannes Muenchow. It was last built on 2024-04-28.</p>
<p>"<strong>Geocomputation with R: Solutions</strong>" was written by Robin Lovelace, Jakub Nowosad, Jannes Muenchow. It was last built on 2024-05-05.</p>
</div>

<div class="col-12 col-md-6 mt-3">
Expand Down
4 changes: 2 additions & 2 deletions gis.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ <h1>
<span><span class="va">ca_highways</span> <span class="op">=</span> <span class="fu"><a href="https://r-spatial.github.io/sf/reference/st_read.html">read_sf</a></span><span class="op">(</span><span class="va">conn</span>, query <span class="op">=</span> <span class="va">query</span>, geom <span class="op">=</span> <span class="st">"wkb_geometry"</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://rspatial.github.io/terra/reference/plot.html">plot</a></span><span class="op">(</span><span class="fu"><a href="https://r-spatial.github.io/sf/reference/st_geometry.html">st_geometry</a></span><span class="op">(</span><span class="va">ca_highways</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
<!-- stac+gdalcubes 1 -->
<p>E8. The <code>ndvi.tif</code> raster (<code>system.file("raster/ndvi.tif", package = "spDataLarge")</code>) contains NDVI calculated for the Mongón study area based on Landsat data from September 22nd, 2000.
<p>E8. The <code>ndvi.tif</code> raster (<code>system.file("raster/ndvi.tif", package = "spDataLarge")</code>) contains NDVI calculated for the Mong&lt;U+00F3&gt;n study area based on Landsat data from September 22nd, 2000.
Use <strong>rstac</strong>, <strong>gdalcubes</strong>, and <strong>terra</strong> to download Sentinel-2 images for the same area from
2020-08-01 to 2020-10-31, calculate its NDVI, and then compare it with the results from <code>ndvi.tif</code>.</p>
<div class="sourceCode" id="cb88"><pre class="downlit sourceCode r">
Expand Down Expand Up @@ -311,7 +311,7 @@ <h2>Note: Second Edition is under construction 🏗</h2>
<footer class="bg-primary text-light mt-5"><div class="container"><div class="row">

<div class="col-12 col-md-6 mt-3">
<p>"<strong>Geocomputation with R: Solutions</strong>" was written by Robin Lovelace, Jakub Nowosad, Jannes Muenchow. It was last built on 2024-04-28.</p>
<p>"<strong>Geocomputation with R: Solutions</strong>" was written by Robin Lovelace, Jakub Nowosad, Jannes Muenchow. It was last built on 2024-05-05.</p>
</div>

<div class="col-12 col-md-6 mt-3">
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ <h2>Note: Second Edition is under construction 🏗</h2>
<footer class="bg-primary text-light mt-5"><div class="container"><div class="row">

<div class="col-12 col-md-6 mt-3">
<p>"<strong>Geocomputation with R: Solutions</strong>" was written by Robin Lovelace, Jakub Nowosad, Jannes Muenchow. It was last built on 2024-04-28.</p>
<p>"<strong>Geocomputation with R: Solutions</strong>" was written by Robin Lovelace, Jakub Nowosad, Jannes Muenchow. It was last built on 2024-05-05.</p>
</div>

<div class="col-12 col-md-6 mt-3">
Expand Down
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 'Geocomputation with R: Solutions'
author: 'Robin Lovelace, Jakub Nowosad, Jannes Muenchow'
date: '2024-04-28'
date: '2024-05-05'
site: bookdown::bookdown_site
output: bookdown::bs4_book
biblio-style: apalike
Expand Down
2 changes: 1 addition & 1 deletion intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ <h2>Note: Second Edition is under construction 🏗</h2>
<footer class="bg-primary text-light mt-5"><div class="container"><div class="row">

<div class="col-12 col-md-6 mt-3">
<p>"<strong>Geocomputation with R: Solutions</strong>" was written by Robin Lovelace, Jakub Nowosad, Jannes Muenchow. It was last built on 2024-04-28.</p>
<p>"<strong>Geocomputation with R: Solutions</strong>" was written by Robin Lovelace, Jakub Nowosad, Jannes Muenchow. It was last built on 2024-05-05.</p>
</div>

<div class="col-12 col-md-6 mt-3">
Expand Down
Loading

0 comments on commit 53ef32b

Please sign in to comment.