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

Adding cor_df method for fashion #50

Closed
cimentadaj opened this issue Feb 6, 2018 · 4 comments
Closed

Adding cor_df method for fashion #50

cimentadaj opened this issue Feb 6, 2018 · 4 comments

Comments

@cimentadaj
Copy link
Contributor

cimentadaj commented Feb 6, 2018

After reading the docs of fashion I understand that it's not entirely made to work with a cor_df object and that's nice because you don't depend on it. However, there's no actual method for cor_df.

Perhaps it would be more consistent to add also fashion.cor_df that performs the same thing but preserves the cor_df and tbl classes for nicer printing and consistency within the pipeline.

library(corrr)
#> Loading required package: dplyr
#> Warning: package 'dplyr' was built under R version 3.4.2
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
d <- correlate(mtcars)
#> 
#> Correlation method: 'pearson'
#> Missing treated using: 'pairwise.complete.obs'

class(d)
#> [1] "cor_df"     "tbl_df"     "tbl"        "data.frame"

d %>% fashion() %>% class()
#> [1] "data.frame" "noquote"
@cimentadaj cimentadaj changed the title cor_df inconsistency with fashion Adding cor_df method for fashion Feb 6, 2018
@cimentadaj
Copy link
Contributor Author

If it makes sense I could add it and issue a pull request.

@cimentadaj
Copy link
Contributor Author

Aha, I've thought it through and found a reason why this might not make much sense. If fashion is the last step within a pipeline and it's purpose is simply for printing (usually for a paper or the like) then creating frashion_cor_df would just be for pure consistency but it doesn't really matter if it's a data frame or a tibble -- there's not further processing going on.

If that's the case then this shouldn't be priority at all.

@drsimonj
Copy link
Collaborator

drsimonj commented Feb 7, 2018

Yes, you have come to the same answer I was going to give! Once you use fashion, the values are characters and it's not meaningful to operate on them anymore.

@drsimonj drsimonj closed this as completed Feb 7, 2018
@github-actions
Copy link

github-actions bot commented Mar 7, 2021

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants