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

Would you accept a pull request for a table replacement? #330

Closed
jlegewie opened this issue May 16, 2018 · 2 comments
Closed

Would you accept a pull request for a table replacement? #330

jlegewie opened this issue May 16, 2018 · 2 comments

Comments

@jlegewie
Copy link

Hi,
would you be interested in adding a table replacement to skimr? Seems like a good place. table is so limited. Here is the example output from a function I currently use (compared to the base::table).

> table(df$offense)
 Violent Felony          Murder Property Felony       Sex Crime      Drug Crime    Other Felony    Misdemeanors    Prostitution 
        1112936            5348          911628           68025          392992           66308         2555705            1025 
     Violations           Other         Weapons 
         624734            1565          143460 
> tab(df$offense)
                  x    Freq Percent CumSum
 1:  Violent Felony 1112936   18.92  18.92
 2:          Murder    5348    0.09  19.01
 3: Property Felony  911628   15.49  34.50
 4:       Sex Crime   68025    1.16  35.66
 5:      Drug Crime  392992    6.68  42.34
 6:    Other Felony   66308    1.13  43.47
 7:    Misdemeanors 2555705   43.44  86.91
 8:    Prostitution    1025    0.02  86.93
 9:      Violations  624734   10.62  97.55
10:           Other    1565    0.03  97.58
11:         Weapons  143460    2.44 100.02
12:              NA  165070    2.81     NA
@elinw
Copy link
Collaborator

elinw commented Jun 3, 2018

Oh this is interesting, actually I have something similar in my lehmansociology::frequency() function https://github.com/lehmansociology/lehmansociology/blob/master/R/frequency.R.
We are re-looking at how we handle factors as we think about 2.0 because of issues that come up with the skimr object and also what to do when there are many categories.
I actually have been thinking it would be good to make a separate package for more advanced tables like what you're showing here.

PS sorry it took so long to reply, we were at the unconf2018 and then I was traveling.

@elinw
Copy link
Collaborator

elinw commented Nov 9, 2019

I'm going to close this but I still believe that creating a table replacement is an important priority. I've been thinking about how to reimplement some of this in a way that really fits into the same kind of pattern as skimr (coping with different types of data differently) and that maybe could cleanly handle labelled data.

@elinw elinw closed this as completed Nov 9, 2019
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

No branches or pull requests

2 participants