Commits


Dewey Dunnington authored and Jonathan Keane committed cf8d81d9fcb
ARROW-14941 [R] Implement Duration R6 class and bindings for lubridate::duration() This PR implements the Duration type in the R bindings, mapped to "difftime", which is the equivalent base R type. Currently a draft PR because I'm unsure how to implement the `Extend()` method of the converter: https://github.com/apache/arrow/blob/7240420a38d4b12317d54fc5195ddcaa5f35cf61/r/src/r_to_arrow.cpp#L824-L826 I've also copy-and-pasted the converter for the TIME32/hms object conversion because I was unsure how to subclass it to avoid the repetition in the moment. The gist of the PR is to allow this (which currently fails): ``` r library(arrow, warn.conflicts = FALSE) Array$create(as.difftime(123, units = "secs")) #> Error: NotImplemented: Extend ``` <sup>Created on 2021-12-03 by the [reprex package](https://reprex.tidyverse.org) (v2.0.1)</sup> Closes #11850 from paleolimbot/r-duration-type Lead-authored-by: Dewey Dunnington <dewey@fishandwhistle.net> Co-authored-by: Romain Francois <romain@rstudio.com> Signed-off-by: Jonathan Keane <jkeane@gmail.com>