nealrichardson commented on a change in pull request #7441: URL: https://github.com/apache/arrow/pull/7441#discussion_r441074458
########## File path: r/vignettes/arrow.Rmd ########## @@ -86,7 +88,73 @@ to other applications and services that use Arrow. One example is Spark: the move data to and from Spark, yielding [significant performance gains](http://arrow.apache.org/blog/2019/01/25/r-spark-improvements/). -# Class structure and package conventions +# Internals + +## Mapping of R <--> Arrow types + +Arrow has a rich data type system that includes direct parallels with R's data types and much more. + +In the tables, entries with a `-` are not currently implemented. + +### R to Arrow + +| R type | Arrow type | +|--------------------------|------------| +| logical | boolean | +| integer | int32 | +| double ("numeric") | float64 | +| character | utf8 | +| factor | dictionary | +| raw | uint8 | +| Date | date32 | +| POSIXct | timestamp | +| POSIXlt | - | +| data.frame | struct | +| list^+^ | list | +| bit64::integer64 | int64 | +| difftime | time32 | +| vctrs::vctrs_unspecified | null | + +^+^: Only lists where all elements are the same type are able to be translated to Arrow list type (which is a "list of" some type). + +### Arrow to R + +| Arrow type | R type | +|-------------------|--------------------------| +| boolean | logical | +| int8 | integer | +| int16 | integer | +| int32 | integer | +| int64 | bit64::integer64 | +| uint8 | integer | +| uint16 | integer | +| uint32 | double | Review comment: Expanded https://jira.apache.org/jira/browse/ARROW-9083 to cover uint{32,64}. I'm going to proceed with this PR as is and will happily revise the docs if we change the implementation. Thanks for the discussion--shining a light on things like this is a big reason I picked up the documentation task. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
