corrr
corrr copied to clipboard
error on correlate of two table with different colsize
The problem
correlate seems do not support two input dataframe with same rowsize and different colsize, which works in base cor function.
Reproducible example
## copy your code to the clipboard and run:
library(tidyverse)
library(corrr)
iris.sub1 <- iris %>% select (Sepal.Length)
iris.sub2 <- iris %>% select (Sepal.Width, Petal.Length, Petal.Width)
correlate (iris.sub1, iris.sub2)
#> Correlation computed with
#> • Method: 'pearson'
#> • Missing treated using: 'pairwise.complete.obs'
#> Error in `as_cordf()`:
#> ! Input object x is not a square.
cor (iris.sub1, iris.sub2)
#> Sepal.Width Petal.Length Petal.Width
#> Sepal.Length -0.1175698 0.8717538 0.8179411
Still true. Any likelihood of this being taken up. Sadly, I'm not enough of a programmer to offer.