synchronize(database=<<see below>>)
When database is given, these (and only these) databases will be detached and re-attached, so that their dictionaries reflect any changes made to the external directory or whatever defines the database. If database is not provided, all databases are flushed, so that pending assignments, etc. are committed, but the dictionaries are not revised.
To be precise, the second use is only required either to tell the evaluator that the names of the objects have changed or to update an object, like a function definition, that will have been saved in the database. But if you are in doubt and some other process has changed something on database n, it's wise to call synchronize(n).
# select datasets to remove, do it now remove.now <- function(now=TRUE) { cat("Type in some datasets to remove:\n") name <- scan(what="") remove(name, where=1) if(now) synchronize() }