Inspired by this answer I am looking for a way to detach several packages at once.
When I load say Hmisc,
# install.packages(\"Hmisc\", dependencies
To answer my own question to Hong's answer:
detlist<-c('Hmisc','survival','splines')
lapply(detlist, function(k) detach( paste('package:', k, sep='', collapse=''), unload=TRUE, char=TRUE))
Works just fine. The sorting function at the top of base::detach
is a bit wonky, but using character.only=TRUE
got me thru just fine.