Skip to content
Snippets Groups Projects
Commit f17f2846 authored by Nicolas Saby's avatar Nicolas Saby :bicyclist_tone1:
Browse files

tidy things

parent d410c8c7
No related branches found
No related tags found
No related merge requests found
Pipeline #170449 failed
library(sf)
library(terra)
library(ggplot2)
library(dplyr)
library(tidyr)
library(clhs)
library(viridis)
library(tmap)
# 1 Data preparation -----
setwd("~/serena/data/sml/europe/")
stacka <- rast(c("FR_OC.tif", "FR_pH.tif" , "FR_TXT.tif","FR_N.tif","FR_P.tif",
"FR_CEC.tif","FR_BD010.tif") )
stackb <- rast(c("FR_CLC.tif", "FR_NUTS2.tif","FR_NUTS1.tif"))
stack = c(stacka,stackb)
change = FALSE # set true to resample rasters
if(change) {
# Change resolution
stac500a <- terra::aggregate(stacka, 5, fun=mean)
stac500b <- terra::aggregate(stackb, 5, fun=modal)
stack500 = c(stac500a,stac500b)
terra::writeRaster(stack500,filename = "~/serena/data/sml/europe/stack500.tiff",
overwrite = TRUE)
} else {
stack500 = rast("~/serena/data/sml/europe/stack500.tiff")
}
File moved
......@@ -4,7 +4,8 @@ this project to share the statistical work on sampling exercise
# code
use smltest.R to run the optimisation algorithm
use 2-SMLFilltableJRCTests.R to run different tests required.
use 1-DataPreparationJRC.R to prepare the rasters from JRC sharepoint
# Questions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment