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

'group.starts' returns NULL #631

Closed
JamesThompsonC opened this issue Sep 6, 2024 · 1 comment
Closed

'group.starts' returns NULL #631

JamesThompsonC opened this issue Sep 6, 2024 · 1 comment

Comments

@JamesThompsonC
Copy link

Thank you for the wonderful package.

I think I found a bug:

Returns: NULL, but expected 1

d <- data.frame(x = 1, y = 1)
g <- collapse::GRP(d, "y")
g$group.starts

d <- data.frame(x = 1:2, y = 1:2)
g <- collapse::GRP(d, "y")
g$group.starts

This works as expected

d <- data.frame(x = 1:2, y = 1)
g <- collapse::GRP(d, "y")
g$group.starts

~Jim

@SebKrantz
Copy link
Owner

SebKrantz commented Sep 7, 2024

Thanks. I have fixed this. Basically, the current code said that if there is only one group or the number of groups is equal to the number of observations, the group.starts attribute is redundant. However, I understand that this is somewhat inconsistent and undocumented.

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