Skip to content

Commit

Permalink
Check vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
vwmaus committed Sep 21, 2023
1 parent eab9180 commit 6336a71
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vignettes/landuse-mapping.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ tif_files <- system.file("mato_grosso_brazil", package = "dtwSat") |>
acquisition_date <- regmatches(tif_files, regexpr("[0-9]{8}", tif_files)) |>
as.Date(format = "%Y%m%d")
print(acquisition_date)
```

*Side note:* The date in the file name is not the true acquisition date for each pixel.
Expand All @@ -63,6 +65,8 @@ dc <- read_stars(tif_files,
RasterIO = list(bands = 1:6)) |>
st_set_dimensions(3, c("EVI", "NDVI", "RED", "BLUE", "NIR", "MIR")) |>
split(c("band"))
print(dc)
```

Note that it's important to set the date for each observation using the parameter `along`.
Expand All @@ -72,7 +76,7 @@ the 'band' dimension into attributes. This prepares the data for training the TW
## Create TWDTW-KNN1 model

```{r , echo = TRUE, eval = TRUE, warning = FALSE, message = FALSE}
twdtw_model <- twdtw_knn1(x = dc,
twdtw_model <- twdtw_knn1(x = dc,
y = samples,
cycle_length = 'year',
time_scale = 'day',
Expand Down

0 comments on commit 6336a71

Please sign in to comment.