🚀 Tasks

Follow the instructions in Submission via GitHub Pages to create a new repo in the existing organization. As you did in the previous weeks, solve the next task in a file named index.qmd.

Task 1

  1. Redo Task 1 from Vector Deepdive (calculate the percentage of forest per canton). However, this time use the R package terra to to the processing.
  2. Again, use the R package tictoc to measure the execute time of each step in the process.

Task 2

  1. Redo Task 1 from Vector Deepdive. However, this time use gdal from the command line to the processing. Note that you can use bash commands in quarto, you just have to
    • set the language to {bash} in the code chunk and
    • the engine to knitr in the YAML header
  2. Again, use the R package tictoc to measure the execute time of each step in the process. To measure the execution time of bash commands, you can use the approach shown below (which is a bit of a workaround since tictoc was made for R, not Bash commands)
  3. Compare the execution times of all approaches (sf, duckdb, terra, gdal). How do they differ?

```{r}
# starts the measurement
tictoc::tic(msg = "Step 1: Transform the data")
```

```{bash}
# gdal command
gdal raster convert input.tif output.tif
```

```{r}
# ends the measurement
tictoc::toc(log = TRUE)
```


```{r}
# Finally (to get a full log:)
tictoc::tic.log()
```