#load two long-term temperature time series
#local scaling to focus in shape rather than values
#polynomial detrending to make them stationary
tsl <- tsl_init(
x = cities_temperature[
cities_temperature$name %in% c("London", "Kinshasa"),
],
name = "name",
time = "time"
) |>
tsl_transform(
f = f_scale_local
) |>
tsl_transform(
f = f_detrend_poly,
degree = 35 #data years
)
if(interactive()){
tsl_plot(
tsl = tsl,
guide = FALSE
)
}
#compute shifts
df_shift <- distantia_time_delay(
tsl = tsl,
two_way = TRUE
)
df_shift
#positive shift values indicate
#that the samples in Kinshasa
#are aligned with older samples in London.
Run the code above in your browser using DataLab