Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error on correlate of two table with different colsize #177

Open
zenfey opened this issue Apr 22, 2024 · 0 comments
Open

error on correlate of two table with different colsize #177

zenfey opened this issue Apr 22, 2024 · 0 comments

Comments

@zenfey
Copy link

zenfey commented Apr 22, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant