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

as.data.frame(ds, force = TRUE) returns many columns of NA #662

Open
rossellhayes opened this issue Feb 8, 2025 · 2 comments
Open

as.data.frame(ds, force = TRUE) returns many columns of NA #662

rossellhayes opened this issue Feb 8, 2025 · 2 comments

Comments

@rossellhayes
Copy link
Contributor

rossellhayes commented Feb 8, 2025

Starting with the recent update to the crunch package, running as.data.frame(ds, force = TRUE) now returns a data frame with many (sometimes 100s or even 1000s of) columns with NA names.

It appears that each of these NA columns come after an array variable. Where they occur, the array variable column has a length of 1, instead of the expected number of rows. Each of the NA columns also has length 1, and there is 1 NA column for each row of the dataset (minus the one named column). As a result, it seems that certain columns are ending up in the data horizontally rather than vertically, like so:

 a  b  c NA NA NA  d
 1  1  1  2  3  4  1
 2  2              2
 3  3              3
 4  4              4

This problem may be related to the recent addition of the array_strategy argument, but it seems to happen regardless of what array_strategy is set to.

gergness added a commit that referenced this issue Feb 10, 2025
@gergness
Copy link
Contributor

gergness commented Feb 10, 2025

Sorry, I believe this only happened when there was an array variable with a single subvariable, and then it was put horizontally (describing why there were so many columns).

Can you make sure that remotes::install_github("#663") remotes::install_github("Crunch-io/rcrunch#664") fixes for you too?

@rossellhayes
Copy link
Contributor Author

Yes, that PR fixes the issue. Thanks!

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