...
Code Block | ||
---|---|---|
| ||
library(ForestForesight) prepared_data <- ff_prep( datafolder = "/path/to/your/data", country = "BRAPER", dates = ForestForesight::daterange("2022-01-01", "2022-12-31"), sample_size = 0.2 ) print(names(prepared_data)) print(head(prepared_data$data_matrix$features)) |
...
Code Block | ||
---|---|---|
| ||
library(terra) # Create a simple polygon custom_shape <- vect("POLYGON((-60 -1072.8 2.5, -55 -1072.3 2.5, -55 -572.3 2.8, -60 -572.8 2.8, -60 -1072.8 2.5))", crs="EPSG:4326") prepared_data <- ff_prep( datafolder = "/path/to/your/data", shape = custom_shape, dates = "2023-01-01", fltr_features = "initialforestcover", fltr_condition = ">0" ) print(prepared_data$features) |
...
Code Block | ||
---|---|---|
| ||
prepared_data <- ff_prep( datafolder = "/path/to/your/data", country = "COLPER", dates = ForestForesight::daterange("2023-01-01", "2023-12-31"), sample_size = 0.5, validation_sample = 0.2 ) print(dim(prepared_data$data_matrix$features)) print(dim(prepared_data$validation_matrix$features)) |
...
Code Block | ||
---|---|---|
| ||
prepared_data <- ff_prep( datafolder = "/path/to/your/data", country = "IDNPER", dates = "2023-01-01", fltr_features = c("elevation", "slope"), fltr_condition = c(">100", "<30") ) print(nrow(prepared_data$data_matrix$features)) |
...