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

fix a rowCounts bug #31

Merged
merged 1 commit into from
May 26, 2015

Conversation

Dongcan-Jiang
Copy link
Contributor

The function rowCounts() seems to have a bug.
Here is a case:

x <- matrix(0, nrow=2, ncol=2)
x[1,] <- NA_integer_
r0 <- rowCounts(x, value=0)
r1 <- rowCounts_R(x, value=0)
print(r0)
[1] NA NA
print(r1)
[1] NA 2

Signed-off-by: Dongcan Jiang <dongcan.jiang@gmail.com>
HenrikBengtsson added a commit that referenced this pull request May 26, 2015
rowCounts() resulted in garbage if a previous column had NAs
(because forgot to update index kk in such cases)
@HenrikBengtsson HenrikBengtsson merged commit 6128eda into HenrikBengtsson:develop May 26, 2015
@HenrikBengtsson
Copy link
Owner

Thanks. /Henrik

HenrikBengtsson added a commit that referenced this pull request May 26, 2015
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

Successfully merging this pull request may close these issues.

None yet

2 participants