Skip to content

Commit

Permalink
Deploy commit: Update _redirects ba2b10d
Browse files Browse the repository at this point in the history
  • Loading branch information
Nowosad committed Apr 13, 2024
1 parent 7bc69c8 commit 9b6a39e
Show file tree
Hide file tree
Showing 92 changed files with 662 additions and 517 deletions.
8 changes: 3 additions & 5 deletions 02-spatial-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,9 @@ world_mini
#> Dimension: XY
#> Bounding box: xmin: -180 ymin: -18.3 xmax: 180 ymax: -0.95
#> Geodetic CRS: WGS 84
#> # A tibble: 2 × 4
#> iso_a2 name_long continent geom
#> <chr> <chr> <chr> <MULTIPOLYGON [°]>
#> 1 FJ Fiji Oceania (((-180 -16.6, -180 -16.5, -180 -16, -180 -16.1, -…
#> 2 TZ Tanzania Africa (((33.9 -0.95, 31.9 -1.03, 30.8 -1.01, 30.4 -1.13,…
#> iso_a2 name_long continent geom
#> 1 FJ Fiji Oceania MULTIPOLYGON (((-180 -16.6,...
#> 2 TZ Tanzania Africa MULTIPOLYGON (((33.9 -0.95,...
```

All this may seem rather complex, especially for a class system that is supposed to be 'simple'!
Expand Down
5 changes: 5 additions & 0 deletions 06-raster-vector.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,11 @@ grain_poly = as.polygons(grain) |>
st_as_sf()
```


```
#> Some legend items or map compoments do not fit well (e.g. due to the specified font size). They are rescaled Set the tmap option component.autoscale to FALSE to disable this.FALSE
```

<div class="figure" style="text-align: center">
<img src="figures/06-raster-vector-40-1.png" alt="Illustration of vectorization of raster (left) into polygons (dissolve = FALSE; center) and aggregated polygons (dissolve = TRUE; right)." width="100%" />
<p class="caption">(\#fig:06-raster-vector-40)Illustration of vectorization of raster (left) into polygons (dissolve = FALSE; center) and aggregated polygons (dissolve = TRUE; right).</p>
Expand Down
14 changes: 7 additions & 7 deletions 12-spatial-cv.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,25 +310,25 @@ Third, the **resampling** approach assesses the predictive performance of the mo

To use a GLM\index{GLM} in **mlr3**\index{mlr3 (package)}, we must create a **task** containing the landslide data.
Since the response is binary (two-category variable) and has a spatial dimension, we create a classification\index{classification} task with `as_task_classif_st()` of the **mlr3spatiotempcv** package [@schratz_mlr3spatiotempcv_2021, for non-spatial tasks, use `mlr3::as_task_classif()` or `mlr3::as_task_regr()` for regression\index{regression} tasks, see `?Task` for other task types].^[The **mlr3** ecosystem makes heavily use of **data.table** and **R6** classes. And though you might use **mlr3** without knowing the specifics of **data.table** or **R6**, it might be rather helpful. To learn more about **data.table**, please refer to https://rdatatable.gitlab.io/data.table/. To learn more about **R6**, we recommend [Chapter 14](https://adv-r.hadley.nz/fp.html) of the Advanced R book [@wickham_advanced_2019].]
The first essential argument of these `as_task_` functions is `backend`.
`backend` expects that the input data includes the response and predictor variables.
The first essential argument of these `as_task_` functions is `x`.
`x` expects that the input data includes the response and predictor variables.
The `target` argument indicates the name of a response variable (in our case this is `lslpts`) and `positive` determines which of the two factor levels of the response variable indicate the landslide initiation point (in our case this is `TRUE`).
All other variables of the `lsl` dataset will serve as predictors.
For spatial CV, we need to provide a few extra arguments.
The `coordinate_names` argument expects the names of the coordinate columns (see Section \@ref(intro-cv) and Figure \@ref(fig:partitioning)).
Additionally, we should decide if we want to use the coordinates as predictors in the modeling (`coords_as_features`) and indicate the used CRS (`crs`).
Additionally, we should indicate the used CRS (`crs`) and decide if we want to use the coordinates as predictors in the modeling (`coords_as_features`).


```r
# 1. create task
task = mlr3spatiotempcv::as_task_classif_st(
id = "ecuador_lsl",
backend = mlr3::as_data_backend(lsl),
mlr3::as_data_backend(lsl),
target = "lslpts",
id = "ecuador_lsl",
positive = "TRUE",
coordinate_names = c("x", "y"),
coords_as_features = FALSE,
crs = "EPSG:32717"
crs = "EPSG:32717",
coords_as_features = FALSE
)
```

Expand Down
2 changes: 1 addition & 1 deletion 13-transport.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ routes_short_scenario = routes_short |>
mutate(bicycle = bicycle + car_driver * uptake,
car_driver = car_driver * (1 - uptake))
sum(routes_short_scenario$bicycle) - sum(routes_short$bicycle)
#> [1] 3832
#> [1] 3828
```

Having created a scenario in which approximately 4000 trips have switched from driving to cycling, we can now model where this updated modeled cycling activity will take place.
Expand Down
2 changes: 1 addition & 1 deletion 14-location.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ For instance, a score greater than 9 might be a suitable threshold indicating ra

```{=html}
<div class="leaflet html-widget html-fill-item" id="htmlwidget-841de324d41155df19a0" style="width:100%;height:389.34px;"></div>
<script type="application/json" data-for="htmlwidget-841de324d41155df19a0">{"x":{"options":{"crs":{"crsClass":"L.CRS.EPSG3857","code":null,"proj4def":null,"projectedBounds":null,"options":{}}},"calls":[{"method":"addTiles","args":["https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",null,null,{"minZoom":0,"maxZoom":18,"tileSize":256,"subdomains":"abc","errorTileUrl":"","tms":false,"noWrap":false,"zoomOffset":0,"zoomReverse":false,"opacity":1,"zIndex":1,"detectRetina":false,"attribution":"&copy; <a href=\"https://openstreetmap.org/copyright/\">OpenStreetMap<\/a>, <a href=\"https://opendatacommons.org/licenses/odbl/\">ODbL<\/a>"}]},{"method":"addRasterImage","args":["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAM0lEQVRYhe3SMQ0AMAwEsQcb/hTSuQSaVLIR3HAJAADfqfR0wm1dEC9VevcCq+MAAIBhB20vBvBK3JZrAAAAAElFTkSuQmCC",[[52.69660085729197,13.08200261479863],[52.32107408861835,13.69815913809763]],0.8,null,null,null]},{"method":"addLegend","args":[{"colors":["darkgreen"],"labels":["potential locations"],"na_color":null,"na_label":"NA","opacity":0.5,"position":"bottomright","type":"unknown","title":"Legend","extra":null,"layerId":null,"className":"info legend","group":null}]}],"limits":{"lat":[52.32107408861835,52.69660085729197],"lng":[13.08200261479863,13.69815913809763]}},"evals":[],"jsHooks":[]}</script>
<script type="application/json" data-for="htmlwidget-841de324d41155df19a0">{"x":{"options":{"crs":{"crsClass":"L.CRS.EPSG3857","code":null,"proj4def":null,"projectedBounds":null,"options":{}}},"calls":[{"method":"addTiles","args":["https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",null,null,{"minZoom":0,"maxZoom":18,"tileSize":256,"subdomains":"abc","errorTileUrl":"","tms":false,"noWrap":false,"zoomOffset":0,"zoomReverse":false,"opacity":1,"zIndex":1,"detectRetina":false,"attribution":"&copy; <a href=\"https://openstreetmap.org/copyright/\">OpenStreetMap<\/a>, <a href=\"https://opendatacommons.org/licenses/odbl/\">ODbL<\/a>"}]},{"method":"addRasterImage","args":["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAM0lEQVRYhe3SMQ0AMAwEsQcb/hTSuQSaVLIR3HAJAADfqfR0wm1dEC9VevcCq+MAAIBhB20vBvBK3JZrAAAAAElFTkSuQmCC",[[52.69660085729197,13.08200261479863],[52.32107408861835,13.69815913809763]],null,null,{"tileSize":256,"zIndex":1,"minZoom":0,"opacity":0.8}]},{"method":"addLegend","args":[{"colors":["darkgreen"],"labels":["potential locations"],"na_color":null,"na_label":"NA","opacity":0.5,"position":"bottomright","type":"unknown","title":"Legend","extra":null,"layerId":null,"className":"info legend","group":null}]}],"limits":{"lat":[52.32107408861835,52.69660085729197],"lng":[13.08200261479863,13.69815913809763]}},"evals":[],"jsHooks":[]}</script>
```

<p class="caption">(\#fig:bikeshop-berlin)Suitable areas (i.e., raster cells with a score > 9) in accordance with our hypothetical survey for bike stores in Berlin.</p>
Expand Down
7 changes: 5 additions & 2 deletions 15-eco.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,11 @@ For specifying a spatial task, we use again the **mlr3spatiotempcv** package [@s

```r
# create task
task = mlr3spatiotempcv::as_task_regr_st(select(rp, -id, -spri),
id = "mongon", target = "sc")
task = mlr3spatiotempcv::as_task_regr_st(
select(rp, -id, -spri),
target = "sc",
id = "mongon"
)
```

Using an `sf` object as the backend automatically provides the geometry information needed for the spatial partitioning later on.
Expand Down
17 changes: 9 additions & 8 deletions 404.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _redirects
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
http://geocompr.robinlovelace.net/* http://r.geocompx.org/:splat 301!
https://geocompr.robinlovelace.net/* https://r.geocompx.org/:splat 301!

/solutions/* https://r-geocomp-solutions.netlify.app/:splat 200
/solutions/* https://geocompx.github.io/solutions/:splat 200
/es/* https://r-geocomp-es.netlify.app/:splat 200
/fr/* https://r-geocomp-fr.netlify.app/:splat 200

0 comments on commit 9b6a39e

Please sign in to comment.