From 513a2dc6bfc9aa5e871e441e91678252a16b8743 Mon Sep 17 00:00:00 2001 From: jannes Date: Wed, 2 Oct 2024 12:13:23 +0200 Subject: [PATCH 01/22] add comma --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index c0e181f05..4b038ad24 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -27,7 +27,7 @@ This chapter demonstrates how the skills learned in Parts I and II can be applie This is a broad field of research and commercial application. A typical example of geomarketing is where to locate a new shop. The aim here is to attract most visitors and, ultimately, make the most profit. -There are also many non-commercial applications that can use the technique for public benefit, for example where to locate new health services [@tomintz_geography_2008]. +There are also many non-commercial applications that can use the technique for public benefit, for example, where to locate new health services [@tomintz_geography_2008]. People are fundamental to location analysis\index{location analysis}, in particular where they are likely to spend their time and other resources. Interestingly, ecological concepts and models are quite similar to those used for store location analysis. From ae1cbb748b8e12c95f2c71afa28fa1a0c29f9b25 Mon Sep 17 00:00:00 2001 From: jannes Date: Wed, 2 Oct 2024 12:14:31 +0200 Subject: [PATCH 02/22] delete one based on --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index 4b038ad24..00424b50b 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -44,7 +44,7 @@ Typical research questions include: - Do existing services over- or under-utilize the market potential? - What is the market share of a company in a specific area? -This chapter demonstrates how geocomputation can answer such questions based on a hypothetical case study based on real data. +This chapter demonstrates how geocomputation can answer such questions based on a hypothetical case study and real data. ## Case study: bike shops in Germany {#case-study} From 438490e1138ae22b905a403552f45513c8e8ff72 Mon Sep 17 00:00:00 2001 From: jannes Date: Wed, 2 Oct 2024 16:17:45 +0200 Subject: [PATCH 03/22] use inline code notation --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index 00424b50b..b7e5ddb01 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -86,7 +86,7 @@ data("census_de", package = "spDataLarge") The `census_de` object is a data frame containing 13 variables for more than 360,000 grid cells across Germany. For our work, we only need a subset of these: Easting (`x`) and Northing (`y`), number of inhabitants (population; `pop`), mean average age (`mean_age`), proportion of women (`women`) and average household size (`hh_size`). These variables are selected and renamed from German into English in the code chunk below and summarized in Table \@ref(tab:census-desc). -Further, `mutate()` is used to convert values -1 and -9 (meaning "unknown") to `NA`. +Further, `mutate()` is used to convert values `-1` and `-9` (meaning "unknown") to `NA`. ```{r 14-location-4} # pop = population, hh_size = household size From 83faaa538848b895c2d27daeb071d2d826525086 Mon Sep 17 00:00:00 2001 From: jannes Date: Wed, 2 Oct 2024 16:19:21 +0200 Subject: [PATCH 04/22] capitalize table heading --- 14-location.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/14-location.Rmd b/14-location.Rmd index b7e5ddb01..be9965711 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -134,8 +134,8 @@ cap = paste("Categories for each variable in census data from", "located in the downloaded file census.zip (see Figure", "\\@ref(fig:census-stack) for their spatial distribution).") knitr::kable(tab, - col.names = c("Class", "Population", "% female", "Mean age", - "Household size"), + col.names = c("Class", "Population", "% Female", "Mean Age", + "Household Size"), caption = cap, caption.short = "Categories for each variable in census data.", align = "c", booktabs = TRUE) From ce6353fd71bc36d43dcc00d406c5c9ab195b71d7 Mon Sep 17 00:00:00 2001 From: jannes Date: Wed, 2 Oct 2024 16:30:19 +0200 Subject: [PATCH 05/22] use multiplication symbol --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index be9965711..9084b42a0 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -156,7 +156,7 @@ input_ras ``` ```{block2 14-location-7, type='rmdnote'} -Note that we are using an equal-area projection (EPSG:3035; Lambert Equal Area Europe), i.e., a projected CRS\index{CRS!projected} where each grid cell has the same area, here 1000 x 1000 square meters. +Note that we are using an equal-area projection (EPSG:3035; Lambert Equal Area Europe), i.e., a projected CRS\index{CRS!projected} where each grid cell has the same area, here 1000 * 1000 square meters. Since we are using mainly densities such as the number of inhabitants or the portion of women per grid cell, it is of utmost importance that the area of each grid cell is the same to avoid 'comparing apples and oranges'. Be careful with geographic CRS\index{CRS!geographic} where grid cell areas constantly decrease in poleward directions (see also Section \@ref(crs-intro) and Chapter \@ref(reproj-geo-data)). ``` From 40c54d37557a4bdaf38a53bb5874918fbd7702ce Mon Sep 17 00:00:00 2001 From: jannes Date: Wed, 2 Oct 2024 16:35:36 +0200 Subject: [PATCH 06/22] define next section explicitly --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index 9084b42a0..9cde55e9b 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -172,7 +172,7 @@ A cell value of 8000 inhabitants was chosen for 'class 6' because these cells co Of course, these are approximations of the true population, not precise values.^[ The potential error introduced during this reclassification stage will be explored in the exercises. ] -However, the level of detail is sufficient to delineate metropolitan areas (see next section). +However, the level of detail is sufficient to delineate metropolitan areas (see Section \@ref(define-metropolitan-areas)). In contrast to the `pop` variable, representing absolute estimates of the total population, the remaining variables were re-classified as weights corresponding with weights used in the survey. Class 1 in the variable `women`, for instance, represents areas in which 0 to 40% of the population is female; From 9155eff65cc58fd343ba282f392974dea4f3c429 Mon Sep 17 00:00:00 2001 From: jannes Date: Wed, 2 Oct 2024 16:36:18 +0200 Subject: [PATCH 07/22] delete hyphen --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index 9cde55e9b..c2270fcdb 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -174,7 +174,7 @@ The potential error introduced during this reclassification stage will be explor ] However, the level of detail is sufficient to delineate metropolitan areas (see Section \@ref(define-metropolitan-areas)). -In contrast to the `pop` variable, representing absolute estimates of the total population, the remaining variables were re-classified as weights corresponding with weights used in the survey. +In contrast to the `pop` variable, representing absolute estimates of the total population, the remaining variables were reclassified as weights corresponding with weights used in the survey. Class 1 in the variable `women`, for instance, represents areas in which 0 to 40% of the population is female; these are reclassified with a comparatively high weight of 3 because the target demographic is predominantly male. Similarly, the classes containing the youngest people and highest proportion of single households are reclassified to have high weights. From 9316927d3c1687492e20914e07c8549f92d46f0d Mon Sep 17 00:00:00 2001 From: jannes Date: Wed, 2 Oct 2024 16:37:18 +0200 Subject: [PATCH 08/22] use number --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index c2270fcdb..60f65138c 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -216,7 +216,7 @@ reclass # full output not shown We deliberately define metropolitan areas as pixels of 20 km^2^ inhabited by more than 500,000 people. Pixels at this coarse resolution can rapidly be created using `aggregate()`\index{aggregation}, as introduced in Section \@ref(aggregation-and-disaggregation). -The command below uses the argument `fact = 20` to reduce the resolution of the result twenty-fold (recall the original raster resolution was 1 km^2^). +The command below uses the argument `fact = 20` to reduce the resolution of the result 20-fold (recall the original raster resolution was 1 km^2^). ```{r 14-location-11, warning=FALSE, cache=TRUE, cache.lazy=FALSE} pop_agg = aggregate(reclass$pop, fact = 20, fun = sum, na.rm = TRUE) From f843ef3e64591e729b1f649f527fbcaaf3dc0a17 Mon Sep 17 00:00:00 2001 From: jannes Date: Wed, 2 Oct 2024 17:03:59 +0200 Subject: [PATCH 09/22] at least once use the pipe placeholder --- 14-location.Rmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/14-location.Rmd b/14-location.Rmd index 60f65138c..2fe413ea1 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -266,7 +266,7 @@ To make sure that the reader uses the exact same results, we have put them into ```{r metro-names, echo=FALSE} data("metro_names", package = "spDataLarge") -knitr::kable(select(metro_names, city, state), +knitr::kable(select(metro_names, City = city, State = state), caption = "Result of the reverse geocoding.", caption.short = "Result of the reverse geocoding.", booktabs = TRUE) @@ -279,8 +279,8 @@ Umlauts like `ü` might lead to trouble further on, for example when determining ```{r 14-location-19} metro_names = metro_names$city |> as.character() |> - {\(x) ifelse(x == "Velbert", "Düsseldorf", x)}() |> - {\(x) gsub("ü", "ue", x)}() + (\(x) ifelse(x == "Velbert", "Düsseldorf", x))() |> + gsub("ü", "ue", x = _) ``` ## Points of interest From 9a2b7ea641af4378a7ba2bcdbdf8ea86e8a72bb3 Mon Sep 17 00:00:00 2001 From: jannes Date: Wed, 2 Oct 2024 17:10:17 +0200 Subject: [PATCH 10/22] use City in text as well --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index 2fe413ea1..3468235a5 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -272,7 +272,7 @@ knitr::kable(select(metro_names, City = city, State = state), booktabs = TRUE) ``` -Overall, we are satisfied with the `city` column serving as metropolitan names (Table \@ref(tab:metro-names)) apart from one exception, namely Velbert which belongs to the greater region of Düsseldorf. +Overall, we are satisfied with the `City` column serving as metropolitan names (Table \@ref(tab:metro-names)) apart from one exception, namely Velbert which belongs to the greater region of Düsseldorf. Hence, we replace Velbert with Düsseldorf (Figure \@ref(fig:metro-areas)). Umlauts like `ü` might lead to trouble further on, for example when determining the bounding box of a metropolitan area with `opq()` (see further below), which is why we avoid them. From d2c9969731b2e76e726465166607ec98e4161f69 Mon Sep 17 00:00:00 2001 From: jannes Date: Fri, 4 Oct 2024 23:12:56 +0200 Subject: [PATCH 11/22] either write out refs in captions or omit them --- 14-location.Rmd | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/14-location.Rmd b/14-location.Rmd index 3468235a5..0976ae8da 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -131,8 +131,7 @@ tab = dplyr::tribble( # summary(input_factor) cap = paste("Categories for each variable in census data from", "Datensatzbeschreibung...xlsx", - "located in the downloaded file census.zip (see Figure", - "\\@ref(fig:census-stack) for their spatial distribution).") + "located in the downloaded file census.zip.") knitr::kable(tab, col.names = c("Class", "Population", "% Female", "Mean Age", "Household Size"), @@ -158,10 +157,10 @@ input_ras ```{block2 14-location-7, type='rmdnote'} Note that we are using an equal-area projection (EPSG:3035; Lambert Equal Area Europe), i.e., a projected CRS\index{CRS!projected} where each grid cell has the same area, here 1000 * 1000 square meters. Since we are using mainly densities such as the number of inhabitants or the portion of women per grid cell, it is of utmost importance that the area of each grid cell is the same to avoid 'comparing apples and oranges'. -Be careful with geographic CRS\index{CRS!geographic} where grid cell areas constantly decrease in poleward directions (see also Section \@ref(crs-intro) and Chapter \@ref(reproj-geo-data)). +Be careful with geographic CRS\index{CRS!geographic} where grid cell areas constantly decrease in poleward directions (see also Section \@ref(crs-intro) and Chapter \@ref(reproj-geo-data)). ``` -```{r census-stack, echo=FALSE, fig.cap="Gridded German census data of 2011 (see Table \\@ref(tab:census-desc) for a description of the classes).", fig.scap="Gridded German census data."} +```{r census-stack, echo=FALSE, fig.cap="Gridded German census data of 2011 (see Table 14.1 for a description of the classes).", fig.scap="Gridded German census data."} knitr::include_graphics("images/14_census_stack.png") ``` From d32e78d92e21cdfbbbb3511a0a293bb62e87df96 Mon Sep 17 00:00:00 2001 From: jannes Date: Fri, 4 Oct 2024 23:14:06 +0200 Subject: [PATCH 12/22] use comma instead of colon --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index 0976ae8da..453e0d677 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -295,7 +295,7 @@ The subsequent code chunk does this using a number of functions including: - `while()`\index{loop!while}, which tries two more times to download the data if the download failed the first time^[The OSM-download will sometimes fail at the first attempt. ] -Before running this code: please consider it will download almost 2GB of data. +Before running this code, please consider it will download almost 2GB of data. To save time and resources, we have put the output named `shops` into **spDataLarge**. To make it available in your environment run `data("shops", package = "spDataLarge")`. From c0d20ad7fe4434dfeaea08cca849d5112a862350 Mon Sep 17 00:00:00 2001 From: jannes Date: Fri, 4 Oct 2024 23:14:49 +0200 Subject: [PATCH 13/22] write out number --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index 453e0d677..7279f41fe 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -295,7 +295,7 @@ The subsequent code chunk does this using a number of functions including: - `while()`\index{loop!while}, which tries two more times to download the data if the download failed the first time^[The OSM-download will sometimes fail at the first attempt. ] -Before running this code, please consider it will download almost 2GB of data. +Before running this code, please consider it will download almost two GB of data. To save time and resources, we have put the output named `shops` into **spDataLarge**. To make it available in your environment run `data("shops", package = "spDataLarge")`. From 3a35cb7a428a7c7b4390e773c0f612284f8b1bfd Mon Sep 17 00:00:00 2001 From: jannes Date: Fri, 4 Oct 2024 23:15:10 +0200 Subject: [PATCH 14/22] add comma --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index 7279f41fe..a2d545e71 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -297,7 +297,7 @@ The subsequent code chunk does this using a number of functions including: Before running this code, please consider it will download almost two GB of data. To save time and resources, we have put the output named `shops` into **spDataLarge**. -To make it available in your environment run `data("shops", package = "spDataLarge")`. +To make it available in your environment, run `data("shops", package = "spDataLarge")`. ```{r 14-location-20, eval=FALSE, message=FALSE} shops = purrr::map(metro_names, function(x) { From 11c89c541f17a2454226ef9b6eb6b2e8fd4f314c Mon Sep 17 00:00:00 2001 From: jannes Date: Fri, 4 Oct 2024 23:16:45 +0200 Subject: [PATCH 15/22] add comma --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index a2d545e71..fd976d18f 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -331,7 +331,7 @@ if (any(ind)) { } ``` -To make sure that each list element (an `sf`\index{sf} data frame) comes with the same columns^[This is not a given since OSM contributors are not equally meticulous when collecting data.] we only keep the `osm_id` and the `shop` columns with the help of the `map_dfr` loop which additionally combines all shops into one large `sf`\index{sf} object. +To make sure that each list element (an `sf`\index{sf} data frame) comes with the same columns^[This is not a given since OSM contributors are not equally meticulous when collecting data.], we only keep the `osm_id` and the `shop` columns with the help of the `map_dfr` loop which additionally combines all shops into one large `sf`\index{sf} object. ```{r 14-location-22, eval=FALSE} # select only specific columns From 8fd717d10ec33fc349206928a5fc1556aa1acfbc Mon Sep 17 00:00:00 2001 From: jannes Date: Fri, 4 Oct 2024 23:18:08 +0200 Subject: [PATCH 16/22] use identify --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index fd976d18f..384f7bb51 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -380,7 +380,7 @@ poi = classify(poi, rcl = rcl_poi, right = NA) names(poi) = "poi" ``` -## Identifying suitable locations +## Identify suitable locations The only steps that remain before combining all the layers are to add `poi` to the `reclass` raster stack and remove the population layer from it. The reasoning for the latter is twofold. From b2ce8fd55f1c1bf1bbf5e567aa8bc68f8d0caf37 Mon Sep 17 00:00:00 2001 From: jannes Date: Fri, 4 Oct 2024 23:23:59 +0200 Subject: [PATCH 17/22] omit twofold --- 14-location.Rmd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/14-location.Rmd b/14-location.Rmd index 384f7bb51..b7d7a6422 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -383,8 +383,7 @@ names(poi) = "poi" ## Identify suitable locations The only steps that remain before combining all the layers are to add `poi` to the `reclass` raster stack and remove the population layer from it. -The reasoning for the latter is twofold. -First of all, we have already delineated metropolitan areas, that is areas where the population density is above average compared to the rest of Germany. +The reasoning for the latter is: First of all, we have already delineated metropolitan areas, that is areas where the population density is above average compared to the rest of Germany. Second, though it is advantageous to have many potential customers within a specific catchment area\index{catchment area}, the sheer number alone might not actually represent the desired target group. For instance, residential tower blocks are areas with a high population density but not necessarily with a high purchasing power for expensive cycle components. From f3a3af6af22604428749e30e5057f8d18d0076c0 Mon Sep 17 00:00:00 2001 From: jannes Date: Fri, 4 Oct 2024 23:25:00 +0200 Subject: [PATCH 18/22] use hyphen --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index b7d7a6422..cc5af2672 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -428,7 +428,7 @@ if (knitr::is_latex_output()) { The presented approach is a typical example of the normative usage of a GIS\index{GIS} [@longley_geographic_2015]. We combined survey data with expert-based knowledge and assumptions (definition of metropolitan areas, defining class intervals, definition of a final score threshold). -This approach is less suitable for scientific research than applied analysis that provides an evidence based indication of areas suitable for bike shops that should be compared with other sources of information. +This approach is less suitable for scientific research than applied analysis that provides an evidence-based indication of areas suitable for bike shops that should be compared with other sources of information. A number of changes to the approach could improve the analysis: - We used equal weights when calculating the final scores but other factors, such as the household size, could be as important as the portion of women or the mean age From 9f272c5af5920acdff0e9f0c2340971bd89bdadc Mon Sep 17 00:00:00 2001 From: jannes Date: Fri, 4 Oct 2024 23:25:28 +0200 Subject: [PATCH 19/22] use capital E --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index cc5af2672..0505eb8ed 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -433,7 +433,7 @@ A number of changes to the approach could improve the analysis: - We used equal weights when calculating the final scores but other factors, such as the household size, could be as important as the portion of women or the mean age - We used all points of interest\index{point of interest} but only those related to bike shops, such as do-it-yourself, hardware, bicycle, fishing, hunting, motorcycles, outdoor and sports shops (see the range of shop values available on the [OSM Wiki](https://wiki.openstreetmap.org/wiki/Map_Features#Shop)) may have yielded more refined results -- Data at a higher resolution may improve the output (see exercises) +- Data at a higher resolution may improve the output (see Exercises) - We have used only a limited set of variables and data from other sources, such as the [INSPIRE geoportal](https://inspire-geoportal.ec.europa.eu/) or data on cycle paths from OpenStreetMap, may enrich the analysis (see also Section \@ref(retrieving-data)) - Interactions remained unconsidered, such as a possible relationships between the portion of men and single households From d9ca26d3c42c72b05b3dfe8953b761c985332cea Mon Sep 17 00:00:00 2001 From: jannes Date: Fri, 4 Oct 2024 23:26:25 +0200 Subject: [PATCH 20/22] use singular --- 14-location.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14-location.Rmd b/14-location.Rmd index 0505eb8ed..0416386f9 100644 --- a/14-location.Rmd +++ b/14-location.Rmd @@ -435,7 +435,7 @@ A number of changes to the approach could improve the analysis: - We used all points of interest\index{point of interest} but only those related to bike shops, such as do-it-yourself, hardware, bicycle, fishing, hunting, motorcycles, outdoor and sports shops (see the range of shop values available on the [OSM Wiki](https://wiki.openstreetmap.org/wiki/Map_Features#Shop)) may have yielded more refined results - Data at a higher resolution may improve the output (see Exercises) - We have used only a limited set of variables and data from other sources, such as the [INSPIRE geoportal](https://inspire-geoportal.ec.europa.eu/) or data on cycle paths from OpenStreetMap, may enrich the analysis (see also Section \@ref(retrieving-data)) -- Interactions remained unconsidered, such as a possible relationships between the portion of men and single households +- Interactions remained unconsidered, such as a possible relationship between the portion of men and single households In short, the analysis could be extended in multiple directions. Nevertheless, it should have given you a first impression and understanding of how to obtain and deal with spatial data in R\index{R} within a geomarketing\index{geomarketing} context. From 86070a2326709551bd581e8d73ecdcb3d4d46947 Mon Sep 17 00:00:00 2001 From: jannes Date: Fri, 4 Oct 2024 23:27:29 +0200 Subject: [PATCH 21/22] add comma --- _14-ex.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_14-ex.Rmd b/_14-ex.Rmd index aed39aefe..5aac9a907 100644 --- a/_14-ex.Rmd +++ b/_14-ex.Rmd @@ -13,7 +13,7 @@ library(spDataLarge) E1. Download the csv file containing inhabitant information for a 100 m cell resolution (https://www.zensus2011.de/SharedDocs/Downloads/DE/Pressemitteilung/DemografischeGrunddaten/csv_Bevoelkerung_100m_Gitter.zip?__blob=publicationFile&v=3). Please note that the unzipped file has a size of 1.23 GB. -To read it into R you can use `readr::read_csv`. +To read it into R, you can use `readr::read_csv`. This takes 30 seconds on a machine with 16 GB RAM. `data.table::fread()` might be even faster, and returns an object of class `data.table()`. Use `dplyr::as_tibble()` to convert it into a tibble. From dfb0f555eed29279e49abdf56111140ea8403c4f Mon Sep 17 00:00:00 2001 From: jannes Date: Fri, 4 Oct 2024 23:28:00 +0200 Subject: [PATCH 22/22] add hyphen --- _14-ex.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_14-ex.Rmd b/_14-ex.Rmd index 5aac9a907..3b571fb85 100644 --- a/_14-ex.Rmd +++ b/_14-ex.Rmd @@ -14,7 +14,7 @@ library(spDataLarge) E1. Download the csv file containing inhabitant information for a 100 m cell resolution (https://www.zensus2011.de/SharedDocs/Downloads/DE/Pressemitteilung/DemografischeGrunddaten/csv_Bevoelkerung_100m_Gitter.zip?__blob=publicationFile&v=3). Please note that the unzipped file has a size of 1.23 GB. To read it into R, you can use `readr::read_csv`. -This takes 30 seconds on a machine with 16 GB RAM. +This takes 30 seconds on a machine with 16-GB RAM. `data.table::fread()` might be even faster, and returns an object of class `data.table()`. Use `dplyr::as_tibble()` to convert it into a tibble. Build an inhabitant raster, aggregate it to a cell resolution of 1 km, and compare the difference with the inhabitant raster (`inh`) we have created using class mean values.