Closed nico202 closed 4 years ago
That already works AFAICT:
julia> using FreqTables
julia> x = repeat(["a", "b", "c", "d"], outer=[100]);
julia> y = repeat(["A", "B", "C", "D"], inner=[10], outer=[10]);
julia> z = repeat(["A", "B", "C", "D"], inner=[5], outer=[20]);
julia> freqtable(x, y, z)
4×4×4 Named Array{Int64,3}
[:, :, Dim3=A] =
Dim1 ╲ Dim2 │ A B C D
────────────┼───────────────
a │ 20 0 20 0
⋮ ⋮ ⋮ ⋮ ⋮
d │ 10 0 10 0
[:, :, Dim3=B] =
Dim1 ╲ Dim2 │ A B C D
────────────┼───────────────
a │ 10 0 10 0
⋮ ⋮ ⋮ ⋮ ⋮
d │ 10 0 10 0
[:, :, Dim3=C] =
Dim1 ╲ Dim2 │ A B C D
────────────┼───────────────
a │ 0 10 0 10
⋮ ⋮ ⋮ ⋮ ⋮
d │ 0 10 0 10
⋮
Yes. For some reason (maybe I was using an outdated package) it was not working. I'm sorry, closing
in the spirit of what R does (returns an "Array" of tables)
(it supports any number of columns, like table(dat$id, dat$B, dat$A, dat$C))
This is not something super-easy with FreqTables.jl, it would be nice if support can be added.