Hi all, I have a main file main.R in which I include some other R files. For example, in main.R I have: source("functions.R"). When I modify the file "functions.R", I'd like R to take into account the changes and to reload the file functions.R when I run main.R Is it possible? Thanks, Arnaud [[alternative HTML version deleted]]
Hello, arnaud chozo wrote:> Hi all, > > I have a main file main.R in which I include some other R files. For > example, in main.R I have: source("functions.R"). > When I modify the file "functions.R", I'd like R to take into account the > changes and to reload the file functions.R when I run main.R > Is it possible? >I don't understand. You source a functions.R file from main.R. When you "run" main.R, whatever is in the functions.R file will be sourced. What is happening that is different than you expect? --Erik
Hi, I'm afraid I really don't have time to enter into a dialogue :-{ but this fragment from a function of mine might help... ---------------------- outfile <- sub("Rd$", "html", hfile, ignore.case=TRUE) # name of corresponding html out.mod <- file.info(outfile)[,"mtime"] # if html absent or needs updating if (is.na(out.mod)||file.info(hfile)[,"mtime"] > out.mod) tools::Rd2HTML(hfile, outfile, .Package) # do it ----------------------- The third line (inter alia) checks the modification time of the 'target' file and decides whether to process it. Hope that helps, Keith J --------------- "arnaud chozo" <arnaud.chozo at gmail.com> wrote in message news:caebefd51003290824m67bebf96wd61315359ae972e4 at mail.gmail.com...> Hi all, > > I have a main file main.R in which I include some other R files. For > example, in main.R I have: source("functions.R"). > When I modify the file "functions.R", I'd like R to take into account the > changes and to reload the file functions.R when I run main.R > Is it possible? > > Thanks, > Arnaud > > [[alternative HTML version deleted]] >
arnaud chozo wrote:> > When I modify the file "functions.R", I'd like R to take into account the > changes and to reload the file functions.R when I run main.R >source again, and you old definitions will be overwritten. Dieter -- View this message in context: http://n4.nabble.com/how-to-update-R-files-included-as-source-tp1695230p1695350.html Sent from the R help mailing list archive at Nabble.com.