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

add set_labels to clean_names() #564

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

add set_labels to clean_names() #564

wants to merge 11 commits into from

Conversation

jospueyo
Copy link

@jospueyo jospueyo commented Jan 21, 2024

Implements #563.

I added the set_labels argument ensuring backward compatibility for default (not for dimnames) and sf methods. I'm not confident enough with tidygraph to implement the method for that.

I did not create labels when dimnames is used because I thought when dimnames is used, dat is probably a matrix, which doesn't accept column labels, am I right?

I tested for both methods.

I added the new feature in NEWS and myself as a contributor in the DESCRIPTION (thanks for this).

Also, I fixed a note regarding a bad header in NEWS (line 27).

@jospueyo jospueyo marked this pull request as ready for review January 21, 2024 15:51
Copy link

codecov bot commented Jan 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (709b2ab) to head (4d135fd).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #564   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines         1401      1408    +7     
=========================================
+ Hits          1401      1408    +7     
Files with missing lines Coverage Δ
R/clean_names.R 100.00% <100.00%> (ø)

Copy link
Collaborator

@billdenney billdenney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, overall. I have a few minor comments and one note for @sfirke where I don't know as much about the sf package.

R/clean_names.R Outdated Show resolved Hide resolved
R/clean_names.R Outdated Show resolved Hide resolved
R/clean_names.R Outdated Show resolved Hide resolved
R/clean_names.R Show resolved Hide resolved
tests/testthat/test-clean-names.R Outdated Show resolved Hide resolved
@sfirke sfirke changed the title #563 add set_labels to clean names add set_labels to clean_names() Jan 25, 2024
@billdenney
Copy link
Collaborator

I have two last requests:

  • Please add text like "To convert the labels back to column names, see the sjlabelled::label_to_colnames() function." in the details section of the docs. (See the issues discussion for the rationale.)
  • Please separate the sf package tests into a separate test_that() block with skip_if_not_installed("sf") so that the tests will work even if sf is not installed.

@jospueyo
Copy link
Author

jospueyo commented Feb 2, 2024

I have two last requests:

* Please add text like "To convert the labels back to column names, see the `sjlabelled::label_to_colnames()` function." in the details section of the docs.  (See the issues discussion for the rationale.)

* Please separate the `sf` package tests into a separate `test_that()` block with `skip_if_not_installed("sf")` so that the tests will work even if `sf` is not installed.

Added.

@billdenney
Copy link
Collaborator

Thanks! @sfirke , I think that this is ready to merge (if all the tests that are now running succeed).

@olivroy olivroy mentioned this pull request Jun 27, 2024
@olivroy
Copy link
Contributor

olivroy commented Oct 26, 2024

I think this feature would be great! @sfirke, when you have the chance, could you take a look.

@jospueyo there are some merge conflicts right now. Would help to resolve them to help get the PR merged :)

@jospueyo
Copy link
Author

I think this feature would be great! @sfirke, when you have the chance, could you take a look.

@jospueyo there are some merge conflicts right now. Would help to resolve them to help get the PR merged :)

I updated the PR, there aren't any conflicts now.

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

Successfully merging this pull request may close these issues.

4 participants