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

Method FinishDataFrame

r/src/array_to_vector.cpp:882–893  ·  view source on GitHub ↗

set the names, row names and class of a list of columns

Source from the content-addressed store, hash-verified

880
881 // set the names, row names and class of a list of columns
882 SEXP FinishDataFrame(cpp11::writable::list& out, R_xlen_t n) const {
883 auto type =
884 checked_cast<const arrow::StructType*>(this->chunked_array_->type().get());
885 auto colnames = arrow::r::to_r_strings(
886 type->fields(),
887 [](const std::shared_ptr<Field>& field) { return field->name(); });
888 out.attr(symbols::row_names) = arrow::r::short_row_names(static_cast<int>(n));
889 out.attr(R_NamesSymbol) = colnames;
890 out.attr(R_ClassSymbol) = arrow::r::data::classes_tbl_df;
891
892 return out;
893 }
894};
895
896double ms_to_seconds(int64_t ms) { return static_cast<double>(ms) / 1000; }

Callers

nothing calls this directly

Calls 6

to_r_stringsFunction · 0.85
short_row_namesFunction · 0.85
getMethod · 0.45
typeMethod · 0.45
fieldsMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected