-
Notifications
You must be signed in to change notification settings - Fork 133
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
missing column names after crosstab? #77
Comments
by looking at the documentation, it seems this is the expected behavior of In my opinion, there is room for improvement here. In essence, by not showing the What do you think? Example output in
|
I agree that the ideal result would contain information about both variables used in the crosstab and have actually put considerable thought into this. I'm open to other ideas, but I haven't found a good way to do that without compromising the For interactive use, something like that Stata result is nice, to have the full info. But then the result can't be written to .csv, passed to
But I don't like that
and I don't see where the var2 name could go in a data.frame. I tried printing it for interactive use like this:
But in interactive use, you already have your command right above it the console output, so it's not as much of an issue - and then if the printed statement doesn't stay with the resulting data.frame, it doesn't solve the underlying problem. Here's an Excel screenshot from trying to conceptualize this: I don't think the var2 name can be included without creating a blank column. |
thanks for your detailed and nice answers.
|
I see the upside of this, but am stuck on two problems:
My solutions are (a) for interactive use, you have the syntax immediately before the result so can look there; (b) for scripted use you can add a title in Markdown or tweak the first column name with |
@sfirke !!! I wrote this in October!!!!! :D |
I'm hoping to get faster at responding :) Cleaning up some issues now before a minor CRAN submission. That approach sounds like a good compromise. I'm going to redo the whole crosstab() function later this year, and I'll look at that as a possible option for crosstab() to take. |
A year later and I'm struck by an idea. To recap, this looks pretty nice with "cyl" on top:
But it's not a data.frame. This is a data.frame:
It's no longer any good for manipulating, since the column names are put in the 1st row of the data.frame - feels so wrong. BUT, it looks good for printing in a report. I think I could implement this as an I think it's at least worth a shot. Anyone want to implement this? The attribute stuff is not hard if you look at I wonder if it would throw off any bolding of column names that might occur in RMarkdown or another output format like a .docx template; would it bold only that single name in the row by itself? |
Note to self: allow it to take optional text argument to put on top. Default is to get it from the |
Hi @sfirke sorry for my late andwer. Yes, I think this is a very good idea, and actually the only possible one when you think about it
at the end of the day? for printing, nobody cares whether this is a dataframe or a duck |
I agree that
I'm tinkering with this and it should be doable. |
Might consider |
This feature is now live on the master branch! Try out |
thanks that is great! sorry for getting back to you so late |
Hi, Thanks for adding this feature, I am using version 0.3.1 of janitor package and don't see adorn_title() in it. Thanks |
@vishalugle I plan to submit version 1.0 to CRAN tomorrow at which point this will be a moot question 😄 But in the meantime and for installing other package development versions from GitHub, try:
See if that gives you that function? |
Thanks for your quick response , I got the latest version using devtools.
…On Thu, Mar 8, 2018 at 12:19 PM, Sam Firke ***@***.***> wrote:
@vishalugle <https://github.com/vishalugle> I plan to submit version 1.0
to CRAN tomorrow at which point this will be a moot question 😄 But in
the meantime and for installing other package development versions from
GitHub, try:
install.package(devtools)
devtools::install_github("sfirke/janitor")
See if that gives you that function?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#77 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AOZTR7i5yf7Qf7nUKNmL-3fY9aMgWeBsks5tcWgQgaJpZM4KhajE>
.
|
Hello there,
First of all, congrats for this package. Coming from
stata
andpandas
, this is EXACLY whatdplyr
needed. A robust, easy to use package that excels at computing tabulations and cross-tabulations!I have a quick question. Consider this simple example
Now I compute a simple cross-tabulation
I dont get why I only see the variable name
var1
above and notvar1
andvar3
. Given the table above, how could you possibly know that this is a cross-tabulation betweenvar1
andvar3
?Am I missing something?
Thanks!
The text was updated successfully, but these errors were encountered: