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

Function InferArrowTypeFromDataFrame

r/src/type_infer.cpp:127–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127static inline std::shared_ptr<arrow::DataType> InferArrowTypeFromDataFrame(
128 cpp11::list x) {
129 R_xlen_t n = x.size();
130 cpp11::strings names(x.attr(R_NamesSymbol));
131 std::vector<std::shared_ptr<arrow::Field>> fields(n);
132 for (R_xlen_t i = 0; i < n; i++) {
133 fields[i] = arrow::field(names[i], InferArrowType(x[i]));
134 }
135 return arrow::struct_(std::move(fields));
136}
137
138template <>
139std::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