R: change default working dir
changing the default wd in R
this worked for me in R on Win OS:
(thanks to http://faculty.chicagobooth.edu/robert.gramacy/teaching/ara/setcwd.pdf)
locate the file "Rprofile.site" (usually in the program files/R somewhere)
open in text editor - note the extra line open at the end.
add one line after the last text line:
e.g.:
setwd("N:\\Esterhuyse\\R") #remember to use for win \\to get to the next folder
now there should still be an open line at the end of the file.
save the file and open GUI.
# Things you might want to change
# options(papersize="a4")
# options(editor="notepad")
# options(pager="internal")
# set the default help type
# options(help_type="text")
options(help_type="html")
# set a site library
# .Library.site <- chartr="" file.path="" p="" r.home="" site-library="">
# set a CRAN mirror
# local({r <- getoption="" p="" repos=""># r["CRAN"] <- http:="" my.local.cran="" p=""># options(repos=r)})
# Give a fortune cookie, but only to interactive sessions
# (This would need the fortunes package to be installed.)
# if (interactive())
# fortunes::fortune()
setwd("N:\\Esterhuyse\\R")
->->->
this worked for me in R on Win OS:
(thanks to http://faculty.chicagobooth.edu/robert.gramacy/teaching/ara/setcwd.pdf)
locate the file "Rprofile.site" (usually in the program files/R somewhere)
open in text editor - note the extra line open at the end.
add one line after the last text line:
e.g.:
setwd("N:\\Esterhuyse\\R") #remember to use for win \\to get to the next folder
now there should still be an open line at the end of the file.
save the file and open GUI.
# Things you might want to change
# options(papersize="a4")
# options(editor="notepad")
# options(pager="internal")
# set the default help type
# options(help_type="text")
options(help_type="html")
# set a site library
# .Library.site <- chartr="" file.path="" p="" r.home="" site-library="">
# set a CRAN mirror
# local({r <- getoption="" p="" repos=""># r["CRAN"] <- http:="" my.local.cran="" p=""># options(repos=r)})
# Give a fortune cookie, but only to interactive sessions
# (This would need the fortunes package to be installed.)
# if (interactive())
# fortunes::fortune()
setwd("N:\\Esterhuyse\\R")
Comments
Post a Comment