-
Notifications
You must be signed in to change notification settings - Fork 21
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
[
fails when the condition contains NAs
#92
Comments
Hi, Right. It seems that row selection of DataFrame objects only supports NAs in numeric or character subscripts at the moment:
but not in logical subscripts:
It looks like when we added support for NA subscripts a few years ago (see commit 85c3a56), the logical case was overlooked. We'll work on this. In the mean time, an easy workaround is to pass the logical subscript thru
Note that this drops the rows corresponding to NAs in the logical subscript so does not behave exactly like If you really want to mimic exactly what
Ouch... ugly! Hopefully this is still somewhat helpful? Best, |
@hpages Thanks, Regards, |
Hi guys, DF <- S4Vectors::DataFrame(a = c(1, NaN))
DF[DF$a == 1, ]
# Error: logical subscript contains NAs
df <- data.frame(a = c(1, NaN))
df[df$a == 1, ]
# [1] 1 NA Thanks for attention, |
@hpages any updates on this? Thanks! |
Hi there,
I have an issue related with the
[
which is not consistent with the base R. Normally, when one pass the condition containing NAs into[
, NAs will be returned for this row.With
S4Vectors
is not the caseDo you have a plan to change this?
Regards,
DK
The text was updated successfully, but these errors were encountered: