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

Consider using *labelled* as backend #19

Open
3 tasks
thibautjombart opened this issue Apr 26, 2022 · 4 comments
Open
3 tasks

Consider using *labelled* as backend #19

thibautjombart opened this issue Apr 26, 2022 · 4 comments
Labels
discussion General conversation.

Comments

@thibautjombart
Copy link
Contributor

It seems the package {labelled} is doing something very similar to our tagging system. We should consider using it as a backend. Some considerations:

  • check it can actually replace current functionalities
  • check if it adds useful functionalities
  • check how many deps would be pulled in
@thibautjombart thibautjombart added the discussion General conversation. label May 3, 2022
@Bisaloo
Copy link
Member

Bisaloo commented Jan 30, 2023

I learned today through @noamross that {labelled} is well-integrated with RStudio.

image

Digging through the code, it looks like it's not an integration specifically for {labelled}, but a generic feature for attr(, "label").

I think this looks quite nice so we should either switch to {labelled}, or for a base approach, replace attr(, "tag") by attr(, "label") in {linelist}.

@Bisaloo
Copy link
Member

Bisaloo commented Mar 20, 2023

I've been doing a little bit more digging. The two approaches are actually much more different than what I said in my previous message:

  • {labelled} set tags to the specific columns
  • {linelist} set tags to the data.frame

There are benefits to both approaches. In particular:

  • {labelled}:
    • it is harder to drop the attr() by accident
    • names<-(), rename() work out of the box without the need for a specific method
    • internal code can be greatly simplified in many cases
    • integrates well with RStudio UI
  • {linelist}:
    • it is possible to retain tags even after columns are dropped but I don't believe this functionality is exposed to users
    • internal code can be greatly simplified in many cases (e.g., selecting specific tags can be done more easily, without having to loop through columns to extract their label)

Overall, it may be visible from my message that I prefer the attr() by column approach. However, I think it would require a major rewrite of the package and possibly cause some breaking changes, which is much more than what I had in mind when I started looking at this issue.

@Bisaloo
Copy link
Member

Bisaloo commented May 15, 2023

Another alternative to mention in the README: https://github.com/karoliskoncevicius/annmatrix

@Bisaloo
Copy link
Member

Bisaloo commented May 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion General conversation.
Projects
None yet
Development

No branches or pull requests

2 participants