MCPcopy Create free account
hub / github.com/apache/arrow / get_difftime_unit_multiplier

Function get_difftime_unit_multiplier

r/src/r_to_arrow.cpp:635–650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

633}
634
635Result<int> get_difftime_unit_multiplier(SEXP x) {
636 std::string unit(CHAR(STRING_ELT(Rf_getAttrib(x, symbols::units), 0)));
637 if (unit == "secs") {
638 return 1;
639 } else if (unit == "mins") {
640 return 60;
641 } else if (unit == "hours") {
642 return 3600;
643 } else if (unit == "days") {
644 return 86400;
645 } else if (unit == "weeks") {
646 return 604800;
647 } else {
648 return Status::Invalid("unknown difftime unit");
649 }
650}
651
652template <typename T>
653class RPrimitiveConverter<T, enable_if_t<is_time_type<T>::value>>

Callers

nothing calls this directly

Calls 1

InvalidClass · 0.50

Tested by

no test coverage detected