| DYN.UNLOAD | R Documentation |
R's dyn.unload is ridiculously hard to use in practice, because it requires complete paths. These can be extracted from getLoadedDLLs, but only with ridiculous amounts of effort and tricks that I always forget. Use DYN.UNLOAD instead with just the basename of the DLL(s) you actually want to unload.
Note that there can be multiple versions of a DLL loaded at the same time, with the same "name" (according to getLoadedDLLs) but different paths. This will unload the first one (only), so you may need to call it repeatedly.
DYN.UNLOAD( dllnames, warn_if_not_loaded=TRUE)
dllnames |
Usually one string, eg "my_dodgy_C_code", but you can do several at once (in a character vector, obvs). |
warn_if_not_loaded |
Pretty self-explanatory. |
The satisfaction of actually having cleared the bloody thing out of memory, eg so that you can delete the file.
## Not run:
if( FALSE && is_very_annoying( CRAN)){ # otherwise CMD CHECK --as-cran tries to run this :/
DYN.UNLOAD( "offending_C_code")
} # if F
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.