[R] Path to R script

Johannes W. Dietrich j.w.dietrich at medizinische-kybernetik.de
Thu May 13 18:28:34 CEST 2010


At 19:29 Uhr -0400 12.05.2010, Gabor Grothendieck wrote:
>If you are running the file via source("myfile.R") then just put this
>in the file:
>
>this.dir <- dirname(sys.frame(1)$ofile)
>
>This is a bit fragile since changes to the internals of source could
>break it but it does currently work.

Great, this is the solution. It works if the script has been saved 
before running.

Thank you,

J. W. D.
-- 
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- Dr. Johannes W. Dietrich, M.D.
-- Laboratory XU 44, Endocrine Research
-- Medical Hospital I, Bergmannsheil University Hospitals
-- Ruhr University of Bochum
-- Buerkle-de-la-Camp-Platz 1, D-44789 Bochum, NRW, Germany
-- Phone: +49:234:302-6400, Fax: +49:234:302-6403
-- eMail: "j.w.dietrich at medical-cybernetics.de"
-- WWW: http://medical-cybernetics.de
-- WWW: http://www.bergmannsheil.de
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --



More information about the R-help mailing list