MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / findName

Method findName

inst/include/Rcpp/vector/Vector.h:594–607  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

592 }
593
594 R_xlen_t findName(const std::string& name) const {
595 SEXP names = RCPP_GET_NAMES(Storage::get__());
596 if (Rf_isNull(names)) stop("'names' attribute is null");
597 R_xlen_t n = Rf_xlength(names);
598 for (R_xlen_t i=0; i < n; ++i) {
599 if (strcmp(name.c_str(), CHAR(STRING_ELT(names, i))) == 0) {
600 return i;
601 }
602 }
603 std::stringstream ss;
604 ss << "no name '" << name << "' found";
605 stop(ss.str());
606 return -1;
607 }
608
609protected:
610 inline int* dims() const {

Callers 1

operator[]Method · 0.80

Calls 1

stopFunction · 0.85

Tested by

no test coverage detected