...
Code Block | ||
---|---|---|
| ||
library(ForestForesight)# this will load the FF library and the variables in the config.yml file # Make sure you have DATA_FOLDER in config.yml in your working directory download_folder <- Sys.getenv("DATA_FOLDER") print(download_folder) #if the previous line returns empty it means your system environment variables were not set. You can then create a folder #somewhere in your file explorer and use the following line to select that folder: download_folder <- dir.choose() # Choose an identifier (country code, tile ID, or SpatVector). # ONLY RUN 1 OF THE FOLLOWING TWO LINES identifier <- "LAO" # Example: Laos identifier <- vect(file.choose()) # Make sure this is a valid SpatVector object. # Part 1: Download only predictions ff_sync( ff_folder = download_folder, identifier = identifier, download_data = FALSE, # Don't download input data download_groundtruth = FALSE, # Don't download ground truth download_predictions = TRUE, # Only download predictions date_start = "2023-01-01" # Only download data since 2023 ) # check the folder in your file explorer to see that in your download_folder there is now a download folder called predictions # which contains tif files for predictions for every month since the start date for the selected country or the countries # within the selected area # Part 2: Download complete dataset ff_sync( ff_folder = download_folder, identifier = identifier, features = "Model", # Download model-related features download_data = TRUE, # Download input data download_groundtruth = TRUE, # Download ground truth download_predictions = FALSE, # Download predictions download_model = TRUE, # Download the model date_start = "2023-01-01" # Only download data since 2023 ) # check that now also a folder called preprocessed and a folder called models has been created. These contain # groundtruth data, preprocessed model input data and a pretrained model. # check all the other available options of ff_sync ?ff_sync |
...