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

Method containsElementNamed

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

* Does this vector have an element with the target name */

Source from the content-addressed store, hash-verified

581 * Does this vector have an element with the target name
582 */
583 bool containsElementNamed( const char* target ) const {
584 SEXP names = RCPP_GET_NAMES(Storage::get__()) ;
585 if( Rf_isNull(names) ) return false ;
586 R_xlen_t n = Rf_xlength(names) ;
587 for( R_xlen_t i=0; i<n; i++){
588 if( !strcmp( target, CHAR(STRING_ELT(names, i)) ) )
589 return true ;
590 }
591 return false ;
592 }
593
594 R_xlen_t findName(const std::string& name) const {
595 SEXP names = RCPP_GET_NAMES(Storage::get__());

Callers 1

containsElementNamedFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected