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

Function InferArrowTypeFromDataFrame

r/src/type_infer.cpp:131–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131static inline std::shared_ptr<arrow::DataType> InferArrowTypeFromDataFrame(
132 cpp11::list x) {
133 R_xlen_t n = x.size();
134 cpp11::strings names(x.attr(R_NamesSymbol));
135 std::vector<std::shared_ptr<arrow::Field>> fields(n);
136 for (R_xlen_t i = 0; i < n; i++) {
137 fields[i] = arrow::field(names[i], InferArrowType(x[i]));
138 }
139 return arrow::struct_(std::move(fields));
140}
141
142template <>
143std::shared_ptr<arrow::DataType> InferArrowTypeFromVector<VECSXP>(SEXP x) {

Callers 1

Calls 4

struct_Function · 0.85
InferArrowTypeFunction · 0.70
fieldFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected