I would like to know if there is any instruction in R that would allow to clean all the variables initialized and to close all the connections open. Just like some sort of Reset function.
closeAllConnections() rm(list=ls())
I hate that second construction since people sometimes sneak it into example code, and when I miss it and copy-paste into my console, and then my entire workspace is wiped out. The real guRus don't make that mistake since they always have multiple emacs windows and always build packages and run code from editing windows and all of those other "wise things to do".
You can use remove()
to delete variables. E.g.:
remove('variabl1','variable2','etc')
Not sure about connections, but assume you refer to database connections you opened to load data via e.g. ODBC? I would assume that the package that provides the package also has documentation on how to close a connection (if required or good practise - thus not done automatically).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With