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

stri_subset should silently drop missings #122

Closed
hadley opened this Issue Nov 27, 2014 · 6 comments

Comments

Projects
None yet
2 participants
@hadley

hadley commented Nov 27, 2014

This is the usual behaviour for subset wrappers:

grep("blah", NA, value = TRUE)
df <- data.frame(x = c(1, NA))
subset(df, x ==1)
@gagolews

This comment has been minimized.

Show comment
Hide comment
@gagolews

gagolews Nov 27, 2014

Owner
> x <- 1:6
> x[c(TRUE,NA,FALSE)]
[1]  1 NA  4 NA
> x[c(1,NA)]
[1]  1 NA

I like the interpretation "I don't know what's that" ==> "I don't know what's the result"

As a compromise: an omit_na arg will be added.

Owner

gagolews commented Nov 27, 2014

> x <- 1:6
> x[c(TRUE,NA,FALSE)]
[1]  1 NA  4 NA
> x[c(1,NA)]
[1]  1 NA

I like the interpretation "I don't know what's that" ==> "I don't know what's the result"

As a compromise: an omit_na arg will be added.

@gagolews

This comment has been minimized.

Show comment
Hide comment
@gagolews

gagolews Nov 27, 2014

Owner

BTW, do we like the name: stri?_subset? Or we change it to stri?_select?

Owner

gagolews commented Nov 27, 2014

BTW, do we like the name: stri?_subset? Or we change it to stri?_select?

@hadley

This comment has been minimized.

Show comment
Hide comment
@hadley

hadley Nov 27, 2014

I like calling it stri_subset.

I think the distinction between [ and subset functions is how they handle missings.

I wonder if we should also have stri_subset<-

hadley commented Nov 27, 2014

I like calling it stri_subset.

I think the distinction between [ and subset functions is how they handle missings.

I wonder if we should also have stri_subset<-

@gagolews

This comment has been minimized.

Show comment
Hide comment
@gagolews

gagolews Nov 27, 2014

Owner

That's a nice idea, but as the task list is already huge, let's leave that for stringi_0.5 (?)

Owner

gagolews commented Nov 27, 2014

That's a nice idea, but as the task list is already huge, let's leave that for stringi_0.5 (?)

@hadley

This comment has been minimized.

Show comment
Hide comment
@hadley

hadley Nov 27, 2014

Sure, makes sense.

hadley commented Nov 27, 2014

Sure, makes sense.

@gagolews gagolews referenced this issue Nov 28, 2014

Closed

stri_subset<- #124

@gagolews gagolews closed this in 4b81b0a Dec 4, 2014

@hadley

This comment has been minimized.

Show comment
Hide comment
@hadley

hadley commented Dec 5, 2014

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment