Skip to content
Prev 343309 / 398506 Next

require() but for source()d files

On Aug 21, 2014 7:40 AM, "Ivan Calandra" <ivan.calandra at univ-fcomte.fr>
wrote:
files.
(say, 'foo') that depends on the functions from this file.
if it hasn't been done yet, and do nothing if the file has already been
source()d in the session.

R.utils::sourceTo(file, modifiedOnly=TRUE)

should do it. It will always source the file once. Also, contrary to
source() it default is to use local=TRUE.

Henrik
http://www.R-project.org/posting-guide.html