Giter Club home page Giter Club logo

Comments (8)

sjPlot avatar sjPlot commented on June 5, 2024

For the first issue, see sjmisc::flat_table().

from sjmisc.

cschwem2er avatar cschwem2er commented on June 5, 2024

Thanks, but I already tried that earlier without success. Could it be that flat_table() only shows values for which there exists a label and omits all other values from the output?

from sjmisc.

sjPlot avatar sjPlot commented on June 5, 2024

Yes, you're right. You have to wrap the data frame in fill_labels():

x <- sample(1:4, 20, T)
y <- sample(1:4, 20, T)
set_labels(x) <- c(`first` = 1, `third` = 3, `fourth` = 4)
set_labels(y) <- c(`second` = 2, `fourth` = 4)
tib <- tibble::tibble(x, y)
flat_table(fill_labels(tib), x, y)

else, use to_label():

tib <- to_label(tib, add.non.labelled = T)
ftable(tib$x, tib$y)

from sjmisc.

sjPlot avatar sjPlot commented on June 5, 2024

I think it doesn't make sense to exclude non-labelled values, so I fixed this.

from sjmisc.

cschwem2er avatar cschwem2er commented on June 5, 2024

Thank you for the update! What do you think about showing variable labels for frq() and fill_table()? In my opinion this would make them basically "swiss army knives" so that one can have a brief look at all important information about variables with one single (non-html) command. If you want I can also open another issue for this.

By the way: I am just in the process of converting a Data Analysis course for Social Scientists from Stata to R and thanks to your package this works out incredibly well! :)

from sjmisc.

sjPlot avatar sjPlot commented on June 5, 2024

For frq(), variable labels are already shown (in the current GitHub-build). For flat_table(), I have no good idea where to show the labels, because you can have a table with 2, 3, 4 or more variables. And the object itself is an ftable(), so I can't easily format/manipulate the console-output.

By the way: I am just in the process of converting a Data Analysis course for Social Scientists from Stata to R and thanks to your package this works out incredibly well! :)

Glad to hear that, and thanks for the feedbacks you provide - this helps me improving the package not only for other users, but also for my purposes.

from sjmisc.

cschwem2er avatar cschwem2er commented on June 5, 2024

I see, thanks for the frq() update. There is one more thing I would like to suggest: I think frq() should either not display value labels for which no observations are occurent at all, or have a parameter which would enable this behavior. The background is the following: In several datasets I work with there are much more value labels assigned than actually observed later on. Using frq() on such variables spams the screen with a lot of unnecessary information. I am not sure whether this change is relevant for SPSS datasets, but it definitely is for Stata.

Edit: This would be equivalent to skip.zero from sjt.frq() right?

from sjmisc.

sjPlot avatar sjPlot commented on June 5, 2024

As a First workaround you could wrap the variable in drop_labels().

from sjmisc.

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.