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

Function InferArrowTypeFromFactor

r/src/type_infer.cpp:38–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38std::shared_ptr<arrow::DataType> InferArrowTypeFromFactor(SEXP factor) {
39 SEXP factors = Rf_getAttrib(factor, R_LevelsSymbol);
40 auto index_type = IndexTypeForFactors(Rf_length(factors));
41 bool is_ordered = Rf_inherits(factor, "ordered");
42 return dictionary(index_type, arrow::utf8(), is_ordered);
43}
44
45template <int VectorType>
46std::shared_ptr<arrow::DataType> InferArrowTypeFromVector(SEXP x) {

Callers 1

Calls 2

IndexTypeForFactorsFunction · 0.85
dictionaryFunction · 0.50

Tested by

no test coverage detected