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

Neal Richardson commented on ARROW-6337:
----------------------------------------

It is slightly more nuanced than that. It is a tibble, per the object class, 
but if you don't load the tibble package, those methods won't be available, so 
it will just behave like a plain data.frame:
{code:java}
> example(read_parquet)

rd_prq> ## No test: 
rd_prq> try({
rd_prq+   df <- read_parquet(system.file("v0.7.1.parquet", package="arrow"))
rd_prq+ })

rd_prq> ## End(No test)
rd_prq> 
rd_prq> 
rd_prq> 
> df
   carat       cut color clarity depth table price    x    y    z
1   0.23     Ideal     E     SI2  61.5    55   326 3.95 3.98 2.43
2   0.21   Premium     E     SI1  59.8    61   326 3.89 3.84 2.31
3   0.23      Good     E     VS1  56.9    65   327 4.05 4.07 2.31
4   0.29   Premium     I     VS2  62.4    58   334 4.20 4.23 2.63
5   0.31      Good     J     SI2  63.3    58   335 4.34 4.35 2.75
6   0.24 Very Good     J    VVS2  62.8    57   336 3.94 3.96 2.48
7   0.24 Very Good     I    VVS1  62.3    57   336 3.95 3.98 2.47
8   0.26 Very Good     H     SI1  61.9    55   337 4.07 4.11 2.53
9   0.22      Fair     E     VS2  65.1    61   337 3.87 3.78 2.49
10  0.23 Very Good     H     VS1  59.4    61   338 4.00 4.05 2.39
   __index_level_0__
1                  0
2                  1
3                  2
4                  3
5                  4
6                  5
7                  6
8                  7
9                  8
10                 9
> library(tibble)
> df
# A tibble: 10 x 11
   carat cut   color clarity depth table price     x     y     z
   <dbl> <chr> <chr> <chr>   <dbl> <dbl> <int> <dbl> <dbl> <dbl>
 1 0.23  Ideal E     SI2      61.5    55 326    3.95  3.98  2.43
 2 0.21  Prem… E     SI1      59.8    61 326    3.89  3.84  2.31
 3 0.23  Good  E     VS1      56.9    65 327    4.05  4.07  2.31
 4 0.290 Prem… I     VS2      62.4    58 334    4.2   4.23  2.63
 5 0.31  Good  J     SI2      63.3    58 335    4.34  4.35  2.75
 6 0.24  Very… J     VVS2     62.8    57 336    3.94  3.96  2.48
 7 0.24  Very… I     VVS1     62.3    57 336    3.95  3.98  2.47
 8 0.26  Very… H     SI1      61.9    55 337    4.07  4.11  2.53
 9 0.22  Fair  E     VS2      65.1    61 337    3.87  3.78  2.49
10 0.23  Very… H     VS1      59.4    61 338    4     4.05  2.39
# … with 1 more variable: `__index_level_0__` <integr64>
> class(df)
[1] "tbl_df"     "tbl"        "data.frame"
{code}

Stay tuned for some upcoming features that will help sort out this interface 
more naturally. 

> [R] as_tibble in R API is a misnomer
> ------------------------------------
>
>                 Key: ARROW-6337
>                 URL: https://issues.apache.org/jira/browse/ARROW-6337
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: R
>            Reporter: James Lamb
>            Priority: Minor
>
> As of ARROW-5190, the R package's dependency on *tibble* has been moved from 
> *Imports* to *Suggests*. However, this signature of *read_parquet(), 
> read_delim_arrow(), read_json_arrow(),* and *read_feather()* all still have 
> an argument called "as_tibble".
> Per [this 
> comment|[https://github.com/apache/arrow/pull/4454#issuecomment-500563214],] 
> the argument "as_tibble" is a misnomer. If that argument is given a TRUE, 
> those functions will return a data.frame, not a tibble. I agree with Neal's 
> comment...I think that instead of changing return type based on a boolean, it 
> would be better for all the *read_** functions to return a data.frame and for 
> other types of operations to get their own functions.
> I think it's important to consider this type of user-facing breaking change 
> _now_ while the R package's version is still 0.x.
> As always, thanks for hearing me out!



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to