Closed rdrr1990 closed 6 years ago
Hi,
First, sorry for the delay of my answer, and thanks for your pull request.
Your function could be a useful addition, but there is one small problem for me : the result is a table with character values. I would have prefer Xtab() to work the same way as rprop
and cprop
for example : return a table of numbers of class proptab
and use the format.proptab
and print.proptab
functions to handle printing in console. Note that there's no need to affect a proptab
class when the results are counts.
I hope I'm clear enough. Do you think you could take a look into this ?
Thanks !
Good to hear from you! That sounds very doable. I will look into those printing / formatting methods and be in touch.
Thanks ! And sorry not to have answered sooner.
No problem!
On Tue, Nov 28, 2017 at 1:02 PM, Julien Barnier notifications@github.com wrote:
Thanks ! And sorry not to have answered sooner.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/juba/questionr/pull/96#issuecomment-347662405, or mute the thread https://github.com/notifications/unsubscribe-auth/ASWlXO0KHwloY0ZbzFNCfkcQtvj5r_eZks5s7HTkgaJpZM4QSrHB .
-- Pete Mohanty, PhD Science, Engineering & Education Fellow Stanford University Department of Statistics https://sites.google.com/site/petemohanty/
Hi,
I just merged a slightly changed version of your pull request.
The two main changes are :
percent
is FALSE
by defaulty
Otherwise it is mainly a bit of code cleaning.
I'll let you take a look at it and tell me if it is ok to you.
Anyway, thanks a lot for your suggestion and your pull request !
Glad to hear it! Those changes make sense too. Cheers
Adds
Xtabs()
, which is a wrapper function forwtd.table
.Xtabs
returns a table formatted in a style popular in the polling world. The first column is the overall result. Additional column(s) are then given for each factor level for one or more y variables.By default, returns a percentage but the user may also request proportion or counts. Overall, I've done my best to keep the style similar to
wtd.table
except that it seemed best to have the user pass adata.frame
. (And I called itXtabs
to avoid confusion withstats::xtabs
which, though similar in spirit, does not return the desired format).roxygen2
documentation provided. PassesR CMD check --as-cran
without error, warning, or note (other than maintainer name).