Skip to content

error on correlate of two table with different colsize #177

@zenfey

Description

@zenfey

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions