* Indicates if an object called name exists in the * environment * * @param name name of the object * * @return true if the object exists in the environment */
| 161 | * @return true if the object exists in the environment |
| 162 | */ |
| 163 | bool exists( const std::string& name ) const { |
| 164 | SEXP nameSym = Rf_install(name.c_str()); |
| 165 | #if R_VERSION < R_Version(4,5,0) |
| 166 | SEXP res = Rf_findVarInFrame( Storage::get__() , nameSym ) ; |
| 167 | return res != R_UnboundValue; |
| 168 | #else |
| 169 | SEXP res = R_getVarEx(nameSym, Storage::get__(), FALSE, NULL); |
| 170 | return res != NULL; |
| 171 | #endif |
| 172 | } |
| 173 | |
| 174 | /** |
| 175 | * Attempts to assign x to name in this environment |
no outgoing calls
no test coverage detected