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

Pretty print tables with more than 2 dimensions #7

Closed
diegozea opened this issue Jun 14, 2016 · 1 comment
Closed

Pretty print tables with more than 2 dimensions #7

diegozea opened this issue Jun 14, 2016 · 1 comment

Comments

@diegozea
Copy link

Right now, 3 dimensional contingency tables are difficult to read:

julia> tbl = dataset("MASS","survey");

julia> freqtable(tbl, :Sex, :Exer, :Smoke)
2x3x4 NamedArray{Int64,3}:
 Sex: ASCIIString["Female" "Male"] Exer: ASCIIString["Freq" "None" "Some"] Smoke: ASCIIString["Heavy" "Never" "Occas" "Regul"][3 0 2
 4 1 1]

[39 10 50
 47 8 34]

[5 1 3
 7 2 1]

[2 0 3
 7 1 4]

julia> R"table($tbl$Sex, $tbl$Exer, $tbl$Smoke)"
WARNING: RCall.jl Warning in bin + pd * (as.integer(cat) - 1L) :
  longitud de objeto mayor no es múltiplo de la longitud de uno menor
Warning in bin + pd * (as.integer(cat) - 1L) :
  longitud de objeto mayor no es múltiplo de la longitud de uno menor
RCall.RObject{RCall.IntSxp}
, ,  = Heavy


         Freq None Some
  Female    3    0    6
  Male      2    0    0

, ,  = Never


         Freq None Some
  Female   45   10   39
  Male     49    9   38

, ,  = Occas


         Freq None Some
  Female    2    1    6
  Male      6    1    3

, ,  = Regul


         Freq None Some
  Female    4    0    3
  Male      4    3    3
@nalimilan
Copy link
Owner

Yeah, I've noticed that too. But that's nothing to do with FreqTables, it's a NamedArray issue. Please file an issue there, if possible with a reproducer which doesn't use FreqTables for simplicity.

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