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

Issues related to subsetting a VectorListSxp, particularly, a StrSxp #86

Open
randy3k opened this issue Jan 26, 2016 · 1 comment
Open

Comments

@randy3k
Copy link
Member

randy3k commented Jan 26, 2016

@simonbyrne
I notice that when I subset a StrSxp object with multiple indexes, it returns a julia array of CharSxp's. I think most users (at least myself) is expecting a StrSxp object with the corresponding indexes.
Is there any reasons for this implementation?

julia> a = RObject(["a", "b", "c"])
RCall.RObject{RCall.StrSxp}
[1] "a" "b" "c"


julia> a[1:2]
2-element Array{Any,1}:
 RCall.RObject{RCall.CharSxp}
<CHARSXP: "a">

 RCall.RObject{RCall.CharSxp}
<CHARSXP: "b">

Also, when only one element is being extracted from the StrSxp, the element of type CharSxp is returned to the user

julia> a[1]
RCall.RObject{RCall.CharSxp}
<CHARSXP: "a">

To mirror the R behavior, should it be wrapped inside a StrSxp object and then returned to the user? This may be less important.

@randy3k randy3k changed the title Issue related to subsetting a VectorListSxp, particularly, a StrSxp Issues related to subsetting a VectorListSxp, particularly, a StrSxp Jan 26, 2016
@simonbyrne
Copy link
Member

This seems like a good idea.

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