# Dataframe example
df1 <- SSTdatashort[1:100, ]
df2 <- SSTdatashort[401:500, ]
ccor <- canonical_correlation(df1, df2)
autoplot(ccor)
# stars example
library(stars)
tif = system.file("tif/olinda_dem_utm25s.tif", package = "stars")
x <- read_stars(tif)
x1 <- x[[1]][1:50, 1:50]
x2 <- x[[1]][51:100, 1:50]
stx1 <- st_as_stars(x1)
stx2 <- st_as_stars(x2)
canonical_correlation(stx1, stx2)
Run the code above in your browser using DataLab