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

Function assign

inst/include/Rcpp/Environment.h:185–190  ·  view source on GitHub ↗

* Attempts to assign x to name in this environment * * @param name name of the object to assign * @param x object to assign * * @return true if the assign was successfull * see ?bindingIsLocked * * @throw binding_is_locked if the binding is locked */

Source from the content-addressed store, hash-verified

183 * @throw binding_is_locked if the binding is locked
184 */
185 bool assign( const std::string& name, SEXP x ) const{
186 if( exists( name) && bindingIsLocked(name) ) throw binding_is_locked(name) ;
187 SEXP nameSym = Rf_install(name.c_str());
188 Rf_defineVar( nameSym, x, Storage::get__() );
189 return true ;
190 }
191
192 bool assign(const std::string& name, const Shield<SEXP>& x) const {
193 return assign(name, (SEXP) x);

Callers 3

DimNameProxyClass · 0.85
VectorMethod · 0.85
assignMethod · 0.85

Calls 2

existsFunction · 0.85
bindingIsLockedFunction · 0.85

Tested by

no test coverage detected