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

Function vector_from_r_memory

r/src/r_to_arrow.cpp:1405–1435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1403}
1404
1405bool vector_from_r_memory(SEXP x, const std::shared_ptr<DataType>& type,
1406 std::vector<std::shared_ptr<arrow::ChunkedArray>>& columns,
1407 int j, RTasks& tasks) {
1408 if (ALTREP(x)) return false;
1409
1410 switch (type->id()) {
1411 case Type::INT32:
1412 return TYPEOF(x) == INTSXP && !Rf_isObject(x) &&
1413 vector_from_r_memory_impl<cpp11::integers, Int32Type>(x, type, columns, j,
1414 tasks);
1415
1416 case Type::DOUBLE:
1417 return TYPEOF(x) == REALSXP && !Rf_isObject(x) &&
1418 vector_from_r_memory_impl<cpp11::doubles, DoubleType>(x, type, columns, j,
1419 tasks);
1420
1421 case Type::UINT8:
1422 return TYPEOF(x) == RAWSXP && !Rf_isObject(x) &&
1423 vector_from_r_memory_impl<cpp11::raws, UInt8Type>(x, type, columns, j,
1424 tasks);
1425
1426 case Type::INT64:
1427 return TYPEOF(x) == REALSXP && Rf_inherits(x, "integer64") &&
1428 vector_from_r_memory_impl<cpp11::doubles, Int64Type>(x, type, columns, j,
1429 tasks);
1430 default:
1431 break;
1432 }
1433
1434 return false;
1435}
1436
1437} // namespace r
1438} // namespace arrow

Callers 1

Table__from_dotsFunction · 0.85

Calls 1

idMethod · 0.45

Tested by

no test coverage detected