Dear List, What I am seeking advice for is how to best package an R installation with all the packages required? Scenario: I need to deliver an R script which will have quite a bit of package dependencies, to packages which are not necessarily stable, are not on cran and might dissapear in the near future. It should be possible to execute the R-script without any changes during the next 3 years. What I did look into is packrat. But if I am correct it pulls the r-packages from cran so if a package was from somewhere else or isn't available anymore it will fail. what I have also found is R on an USB stick: http://personal.bgsu.edu/~mrizzo/Rmisc/usbR.htm Would this work? Or is there anything on the lines of pyinstaller (http://www.pyinstaller.org/) for R? Thank you -- Witold Eryk Wolski
This sounds like more of an operating system task than an R task. But within R, you can come close, I would think, by copying all of the packages' directories to the same directory as the script. Then write another script that will install all of the packages. In the future, run that script before running your script. When you deliver the script, deliver the whole directory that contains it, since that will then include the package sources. If you're lucky, all of the packages are source packages. Of course, R itself will change over the next three years. Hopefully, none of the improvements will break your script or the packages it depends on. There was a long discussion on the topic of "enabling reproducible research & R package management & install.package.version & BiocLite" in March of 2013 on R-devel that you might want to look at. And something similar not too long ago in either R-devel or R-package-devel, if I remember correctly. I've never used any of the three options you mention. -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 12/23/15, 1:29 PM, "R-help on behalf of Witold E Wolski" <r-help-bounces at r-project.org on behalf of wewolski at gmail.com> wrote:>Dear List, > > >What I am seeking advice for is how to best package an R installation >with all the packages required? > >Scenario: >I need to deliver an R script which will have quite a bit of package >dependencies, to packages which are not necessarily stable, are not on >cran and might dissapear in the near future. It should be possible to >execute the R-script without any changes during the next 3 years. > > >What I did look into is packrat. But if I am correct it pulls the >r-packages from cran so if a package was from somewhere else or isn't >available anymore it will fail. > >what I have also found is R on an USB stick: >http://personal.bgsu.edu/~mrizzo/Rmisc/usbR.htm > >Would this work? > >Or is there anything on the lines of pyinstaller >(http://www.pyinstaller.org/) for R? > > >Thank you > >-- >Witold Eryk Wolski > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.
On 23/12/2015 1:29 PM, Witold E Wolski wrote:> Dear List, > > > What I am seeking advice for is how to best package an R installation > with all the packages required? > > Scenario: > I need to deliver an R script which will have quite a bit of package > dependencies, to packages which are not necessarily stable, are not on > cran and might dissapear in the near future. It should be possible to > execute the R-script without any changes during the next 3 years. > > > What I did look into is packrat. But if I am correct it pulls the > r-packages from cran so if a package was from somewhere else or isn't > available anymore it will fail. > > what I have also found is R on an USB stick: > http://personal.bgsu.edu/~mrizzo/Rmisc/usbR.htm > > Would this work? > > Or is there anything on the lines of pyinstaller > (http://www.pyinstaller.org/) for R?What OS are you targetting? If it's for Windows, there are instructions in the R Installation and Administration manual for building a custom installer. Duncan Murdoch
It sounds like it could be the sort of issue that Docker/Rocker is trying to address. Someone called Dirk might chime in on this. -pd> On 23 Dec 2015, at 22:29 , Witold E Wolski <wewolski at gmail.com> wrote: > > Dear List, > > > What I am seeking advice for is how to best package an R installation > with all the packages required? > > Scenario: > I need to deliver an R script which will have quite a bit of package > dependencies, to packages which are not necessarily stable, are not on > cran and might dissapear in the near future. It should be possible to > execute the R-script without any changes during the next 3 years. > > > What I did look into is packrat. But if I am correct it pulls the > r-packages from cran so if a package was from somewhere else or isn't > available anymore it will fail. > > what I have also found is R on an USB stick: > http://personal.bgsu.edu/~mrizzo/Rmisc/usbR.htm > > Would this work? > > Or is there anything on the lines of pyinstaller > (http://www.pyinstaller.org/) for R? > > > Thank you > > -- > Witold Eryk Wolski > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Office: A 4.23 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com