Søren Højsgaard
2006-Sep-29 07:06 UTC
[R] Automatical download of needed packages from CRAN
I write a package foo which requires a package bar (from CRAN) to work. So in the DESCRIPTION file I write Depends: bar. I would like it to be so that when one installs foo, then it is automatically checked whether bar is installed, and if not then bar is also installed at the same time. I remember having seen packages which do so, but I can not figure out the mechanism 'Depends: bar' in the DESCRIPTION file does not solve the problem. Can anyone help? A related question: How to check programmatically that a specific package is loaded? Best regards Søren [[alternative HTML version deleted]]
Antonio, Fabio Di Narzo
2006-Sep-29 07:46 UTC
[R] Automatical download of needed packages from CRAN
install.packages("foo", dep="Depends") See online help. I think that the GUI version of install.packages automatically does that. Antonio. 2006/9/29, S?ren H?jsgaard <Soren.Hojsgaard a agrsci.dk>:> I write a package foo which requires a package bar (from CRAN) to work. So in the DESCRIPTION file I write Depends: bar. I would like it to be so that when one installs foo, then it is automatically checked whether bar is installed, and if not then bar is also installed at the same time. I remember having seen packages which do so, but I can not figure out the mechanism > 'Depends: bar' in the DESCRIPTION file does not solve the problem. Can anyone help? > > A related question: How to check programmatically that a specific package is loaded? > > Best regards > S?ren > > [[alternative HTML version deleted]] > > > > ______________________________________________ > R-help a stat.math.ethz.ch mailing list > 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. > > >
Prof Brian Ripley
2006-Sep-29 07:59 UTC
[R] Automatical download of needed packages from CRAN
On Fri, 29 Sep 2006, S?ren H?jsgaard wrote:> I write a package foo which requires a package bar (from CRAN) to work. > So in the DESCRIPTION file I write Depends: bar. I would like it to be > so that when one installs foo, then it is automatically checked whether > bar is installed, and if not then bar is also installed at the same > time. I remember having seen packages which do so, but I can not figure > out the mechanism 'Depends: bar' in the DESCRIPTION file does not solve > the problem. Can anyone help?It does if you use install.packages(dependencies=TRUE), the default from the Windows GUI menu.> A related question: How to check programmatically that a specific > package is loaded?Via search(): there are lots of examples in the R help files. ?termplot is one.> > Best regards > S?ren > > [[alternative HTML version deleted]] > >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Maybe Matching Threads
- Evaluating f(x(2,3)) on a function f<- function(a,b){a+b}
- Calling substitute(expr, list(a=1)) when expr <- expression(a+b+c)
- Fwd: How to sample from a linear mixed model
- Drawing a graph with vertices and edges using tcl/tk
- Computer algebra in R - would that be an idea??