View source: R/canonical_correlation.R
canonical_correlation | R Documentation |
Computes Canonical Correlation Analysis (CCA) using 2 datasets. The autoplot function plots the output.
canonical_correlation(x1, x2, ...) ## S3 method for class 'data.frame' canonical_correlation(x1, x2, ...) ## S3 method for class 'stars' canonical_correlation(x1, x2, ...) ## S3 method for class 'cancor' autoplot(object, xlab = "Time", ...)
x1 |
The first dataframe or stars object. |
x2 |
The second dataframe or stars objext. The dimensions of both datasets need to be the same. |
... |
Other arguments currently ignored. |
object |
For autoplot: the output of the function ‘cannonical_correlation’. |
xlab |
For autoplot: the xlabel to appear on CCA plot. |
A canonical correlation object.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.