Skip to content
Prev 387154 / 398502 Next

.Rprofile with devtools::install_github() loops

I am sure this must be documented somewhere and that I'm missing something obvious but some searching isn't finding an answer and I'm sure there is one.

I have created a very simple package on GitHub and want my machines (other than the one that built it) to load it when they start R using devtools::install_github()

The install_github() call works fine from the console but when I put it in my .Rprofile it just loops on restarting R.  I _think_ it may be that devtools::install_github()
is restarting the session as I found one thing on the web suggesting that may be the case.  However, I think if it were the case it would be documented and I'd find
far more about that.

OK.  So my .Rprofile is:

print("This is a message from /home/chris/.Renviron: hello Chris!")
.First <- function(){
    devtools::install_github("xxxx/yyyy")
}
print("OK, off you go!")

I have obscured my package to protect my blushes but I get the same behaviour with r-lib/devtools and, as I say, my little package loads OK from the console.

You can see I tried wrapping it in a .First() function but that didn't change anything.

True both on a Linux machine and a Windows machine.

OK.  Anyone save me from more dents in the wall and frontal lobe damage?!

TIA,

Chris