Code Monkey home page Code Monkey logo

Comments (6)

krlmlr avatar krlmlr commented on June 12, 2024

Is this related to Hmisc::label() and the "labelled" class?

from tibble.

joelgombin avatar joelgombin commented on June 12, 2024

Yeah, I guess it's the same idea. It's also implemented in the memisc package (see annotations) and possibly in other packages, too.

from tibble.

krlmlr avatar krlmlr commented on June 12, 2024

Then I don't understand the question. If there are solutions in other packages, what is missing in tibble?

from tibble.

joelgombin avatar joelgombin commented on June 12, 2024

That's right, but:

  • the Hmisc::label solution is not very pratical because you can't set labels for a whole dataframe at once, you have to do it variable by variable (have a look at Label, it's actually quite funny...)
  • the memisc::annotations have the same problem, except for a class data.set which isn't directly inheriting from data.frame, so I guess we'd need to write new S4 methods for tbl_df objects. @melff, what do you think?

from tibble.

krlmlr avatar krlmlr commented on June 12, 2024

For data.set, see #67. Hmisc::label() and Hmisc::label<-() are both generics, you may easily override them or suggest a data.frame implementation to Frank Harrell.

One thing we might want to fix about labelled columns is the output:

> a <- 1:3
> Hmisc::label(a) <- "label"
> tibble::data_frame(a)
                       a
  <S3: labelled/integer>
1                      1
2                      2
3                      3

from tibble.

github-actions avatar github-actions commented on June 12, 2024

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

from tibble.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.