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

Provide better examples of Hierarchical tables in the crosstab function #4

Open
mahaalbashir opened this issue Jan 18, 2024 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@mahaalbashir
Copy link
Collaborator

Using more than one (two or more) rows or columns is throwing an error right now saying that

Error in py_call_impl(callable, call_args$unnamed, call_args$named) :
ValueError: Buffer has the wrong number of dimensions (expected 1, got 2)
Run `reticulate::py_last_error()` for details.

Check for other functions as well (acro_pivot_table, acro_table,...)

@mahaalbashir mahaalbashir added the bug Something isn't working label Jan 18, 2024
@mahaalbashir mahaalbashir self-assigned this Jan 18, 2024
@jim-smith
Copy link
Collaborator

jim-smith commented Sep 18, 2024

This is not a bug, just needs an example of what the syntax needs to look like

Need an example to explain that if you want multiple columns or rows you have to pass them as a list then it works properly:

mycols = data[, c("parents")]
myrows =list(data[, c("social")],data[,c("recommend")])

table = acro_crosstab(index=mycols, columns=myrows)

table

Produces:

image

and R output is
image

`

@jim-smith
Copy link
Collaborator

But when you do hierarchies in rows not columns the R output is not as nice:

mycols = data[, c("parents")]
myrows =list(data[, c("social")],data[,c("finance")])

table = acro_crosstab(index=myrows, columns=mycols)

table

produces:

image

but in Rstudio the actual table has no row labels:
image

@jim-smith jim-smith changed the title Hierarchical tables in the crosstab function Provide better examples of Hierarchical tables in the crosstab function Sep 18, 2024
@jim-smith jim-smith added documentation Improvements or additions to documentation and removed bug Something isn't working labels Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants