You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Neal Richardson (Jira)" <ji...@apache.org> on 2021/05/10 20:07:00 UTC

[jira] [Commented] (ARROW-12729) [R] Fix length method for Table, RecordBatch

    [ https://issues.apache.org/jira/browse/ARROW-12729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17342118#comment-17342118 ] 

Neal Richardson commented on ARROW-12729:
-----------------------------------------

R6 classes inherit from environment, and that's what the default length method does on environment:

{code}
> x <- new.env()
> length(x)
[1] 0
> x$a <- 4
> length(x)
[1] 1
{code}

So in effect it's telling you how many methods the R6 object has.

> [R] Fix length method for Table, RecordBatch
> --------------------------------------------
>
>                 Key: ARROW-12729
>                 URL: https://issues.apache.org/jira/browse/ARROW-12729
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: R
>    Affects Versions: 4.0.0
>            Reporter: Ian Cook
>            Priority: Major
>             Fix For: 5.0.0
>
>
> {{length()}} does something odd on {{RecordBatch}} and {{Table}} objects:
> {code:r}
> length(Table$create(x=1))
> ## [1] 33
> length(RecordBatch$create(x=1))
> ## [1] 31
> {code}
> It should return the number of columns.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)