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

Function IndexTypeForFactors

r/src/type_infer.cpp:28–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace r {
27
28static inline std::shared_ptr<arrow::DataType> IndexTypeForFactors(int n_factors) {
29 if (n_factors < INT8_MAX) {
30 return arrow::int8();
31 } else if (n_factors < INT16_MAX) {
32 return arrow::int16();
33 } else {
34 return arrow::int32();
35 }
36}
37
38std::shared_ptr<arrow::DataType> InferArrowTypeFromFactor(SEXP factor) {
39 SEXP factors = Rf_getAttrib(factor, R_LevelsSymbol);

Callers 1

InferArrowTypeFromFactorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected