[Rd] help with install.packages
Greetings, I am trying to use install.packages obtained from here http://stat.ethz.ch/R-manual/R-devel/library/utils/html/install.packages.html My computer has these OS: 64-bit blfs linux R2.15.1 # A) I did the following:- export DIR=/home/stats/R-2.15.0_runTEST190712A export DEST=/home/stats/Rtester cd $DEST ${DIR}/bin/R install.packages(MASS_7.3-17.tar.gz, ${DEST}, repos = getOption("NULL"), contriburl = contrib.url(NULL, type), internal, available = NULL, destdir = ${DEST}, dependencies = NA, type = getOption("pkgType"), configure.args = getOption("configure.args"), configure.vars = getOption("configure.vars"), clean = FALSE, Ncpus = getOption("2", 1L), libs_only = FALSE, INSTALL_opts,--verbose) and this is the result stats [ ~ ]# export DIR=/home/stats/R-2.15.0_runTEST190712A stats [ ~ ]# export DEST=/home/stats/Rtester stats [ ~ ]# cd $DEST stats [ ~/Rtester ]# stats [ ~/Rtester ]# ${DIR}/bin/R install.packages(MASS_7.3-17.tar.gz, ${DEST}, repos = getOption("NULL"), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# contriburl = contrib.url(NULL, type), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# internal, available = NULL, destdir = ${DEST}, bash: internal,: command not found stats [ ~/Rtester ]# dependencies = NA, type = getOption("pkgType"), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# configure.args = getOption("configure.args"), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# configure.vars = getOption("configure.vars"), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# clean = FALSE, Ncpus = getOption("2", 1L), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# libs_only = FALSE, INSTALL_opts,-- verbose) B) I then did it like so export DIR=/home/stats/R-2.15.0_runTEST190712A export DEST=/home/stats/Rtester cd $DEST ${DIR}/bin/R install.packages(MASS_7.3-17.tar.gz, ${DEST}, repos = getOption("NULL"), contriburl = contrib.url(NULL, type), method, available = NULL, destdir = ${DEST, dependencies = NA, type = getOption("source"), clean = FALSE, Ncpus = getOption("2", 1L), libs_only = FALSE, INSTALL_opts, --verbose ) And this results:- stats [ ~/Rtester ]# export DIR=/home/stats/R-2.15.0_runTEST190712A stats [ ~/Rtester ]# export DEST=/home/stats/Rtester stats [ ~/Rtester ]# cd $DEST stats [ ~/Rtester ]# stats [ ~/Rtester ]# ${DIR}/bin/R install.packages(MASS_7.3-17.tar.gz, ${DEST}, repos = getOption("NULL"), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# contriburl = contrib.url(NULL, type), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# method, available = NULL, destdir = ${DEST, > dependencies = NA, type = getOption("source"), > configure.args = getOption("configure.args"), > configure.vars = getOption("configure.vars"), > clean = FALSE, Ncpus = getOption("2", 1L), > libs_only = FALSE, INSTALL_opts, --verbose ) #--- advice would be appreciated sincerely luxInteg __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] INDEX rdb and rdx files
Greetings, My computer has these OS: 64-bit blfs linux R2.15.1 If one has downloaded a tarball for example MASS.tar.ga and unzip it Are there R commands to generate the following?:- a) the INDEX file b) 'R' files such as MASS.rdb and MASS.rdx advice would be appreciated sincerely luxInteg __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] INDEX rdb and rdx files
On Aug 2, 2012, at 10:32 , luxInteg wrote: > Greetings, > > > My computer has these > OS: 64-bit blfs linux R2.15.1 > > If one has downloaded a tarball for example MASS.tar.ga and unzip it > > Are there R commands to generate the following?:- > > a) the INDEX file > b) 'R' files such as MASS.rdb and MASS.rdx > > advice would be appreciated I think you need to read the Installation and Administration manual: http://cran.r-project.org/manuals.html -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] INDEX rdb and rdx files
On Thursday 02 August 2012 09:39:18 peter dalgaard wrote: > I think you need to read the Installation and Administration manual: > > http://cran.r-project.org/manuals.html thanks but if you mean this http://cran.r-project.org/doc/manuals/R-admin.html#Installation I have studied it and I have not seen anything pretaining to using R on the command line to generat INDEX files. nor rdb/rdx files The closest I came was an email to a list in 2006 which discussed the latter https://stat.ethz.ch/pipermail/r-devel/2006-September/042700.html and this from 2003 pretaining to INDEX files https://stat.ethz.ch/pipermail/r-help/2003-October/040862.html So I am still unclear IF one downloads an archived package and UNPACK it; if there are THEN options to pass to R to generate INDEX files and rdb/rdx files. Are there? sincerely luxInteg __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] help with install.packages
On 02.08.2012 10:33, luxInteg wrote: Greetings, I am trying to use install.packages obtained from here http://stat.ethz.ch/R-manual/R-devel/library/utils/html/install.packages.html My computer has these OS: 64-bit blfs linux R2.15.1 # A) I did the following:- export DIR=/home/stats/R-2.15.0_runTEST190712A export DEST=/home/stats/Rtester cd $DEST ${DIR}/bin/R install.packages(MASS_7.3-17.tar.gz, ${DEST}, repos = getOption("NULL"), contriburl = contrib.url(NULL, type), internal, available = NULL, destdir = ${DEST}, dependencies = NA, type = getOption("pkgType"), configure.args = getOption("configure.args"), configure.vars = getOption("configure.vars"), clean = FALSE, Ncpus = getOption("2", 1L), libs_only = FALSE, INSTALL_opts,--verbose) and this is the result stats [ ~ ]# export DIR=/home/stats/R-2.15.0_runTEST190712A stats [ ~ ]# export DEST=/home/stats/Rtester stats [ ~ ]# cd $DEST stats [ ~/Rtester ]# stats [ ~/Rtester ]# ${DIR}/bin/R install.packages(MASS_7.3-17.tar.gz, ${DEST}, repos = getOption("NULL"), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# contriburl = contrib.url(NULL, type), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# internal, available = NULL, destdir = ${DEST}, bash: internal,: command not found stats [ ~/Rtester ]# dependencies = NA, type = getOption("pkgType"), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# configure.args = getOption("configure.args"), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# configure.vars = getOption("configure.vars"), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# clean = FALSE, Ncpus = getOption("2", 1L), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# libs_only = FALSE, INSTALL_opts,-- verbose) B) I then did it like so export DIR=/home/stats/R-2.15.0_runTEST190712A export DEST=/home/stats/Rtester cd $DEST ${DIR}/bin/R install.packages(MASS_7.3-17.tar.gz, ${DEST}, repos = getOption("NULL"), contriburl = contrib.url(NULL, type), method, available = NULL, destdir = ${DEST, dependencies = NA, type = getOption("source"), clean = FALSE, Ncpus = getOption("2", 1L), libs_only = FALSE, INSTALL_opts, --verbose ) And this results:- stats [ ~/Rtester ]# export DIR=/home/stats/R-2.15.0_runTEST190712A stats [ ~/Rtester ]# export DEST=/home/stats/Rtester stats [ ~/Rtester ]# cd $DEST stats [ ~/Rtester ]# stats [ ~/Rtester ]# ${DIR}/bin/R install.packages(MASS_7.3-17.tar.gz, ${DEST}, repos = getOption("NULL"), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# contriburl = contrib.url(NULL, type), bash: syntax error near unexpected token `(' stats [ ~/Rtester ]# method, available = NULL, destdir = ${DEST, dependencies = NA, type = getOption("source"), configure.args = getOption("configure.args"), configure.vars = getOption("configure.vars"), clean = FALSE, Ncpus = getOption("2", 1L), libs_only = FALSE, INSTALL_opts, --verbose ) #--- advice would be appreciated Please ask basic questions on R-help and do not misuse R-devel. And following the posting guide of R-help, you had probably read the documentation and found that install.packages() is to be called in R rather than on the shell of your operating system. Best, Uwe Ligges sincerely luxInteg __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Numerics behind splineDesign
Inline... On Wed, Aug 1, 2012 at 8:36 AM, Nathaniel Smith wrote: > Thanks everyone for the suggestions. > > On Wed, Aug 1, 2012 at 2:39 PM, peter dalgaard wrote: >> >> On Jul 31, 2012, at 15:46 , Bert Gunter wrote: >> >>> Well, I would first check the references given in the Help file!. >>> That's what they're for, no? Hastie's book is likely to more complete >>> on the algebra, I think. > > How embarrassing... the help files do cite the white book (only), and > I did check it of course, but it has no more details on how the basis > functions are computed than does the help file itself, and so I must > have forgotten about it when writing my email. Still, my apologies for > the confusion. > > I'm not sure what you mean by "Hastie's book", though? Ummm... The following appears in the ?bs man page. Why do you not see it? Are you perhaps being too "hasty" in your reading (heh-heh)? References Hastie, T. J. (1992) Generalized additive models. Chapter 7 of Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth & Brooks/Cole. -- Bert > >>> You might also be interested in the relevant chapters of Friedman, >>> Hastie, et. al "The Elements of Statistical Learning Theory," which >>> might be a gentler exposition of the math. >>> >>> Of course, the code (or a suitable exposition of it, which may not >>> exist) is the ultimate reference. >> >> Also check out the various web resources (Google for basis spline or >> B-spline). I don't recall the white book chapter, but it might be a little >> short on the algebraic details. Another Google point is "de Boor". > > And indeed, it looks like the appendix to chapter 5 of Hastie, > Tibshirani, and Friedman (2008) has a short description of the de Boor > algorithm. Excellent. For the archives, this seems to be enough to > exactly implement spline.des/splineDesign, and if anyone else is > working in Python then it turns out that there is a more-or-less > undocumented implementation of this algorithm in > scipy.interpolate.splev. > > Now I just have to grovel over the R code in ns() and bs() to figure > out how exactly they pick knots and handle boundary conditions, plus > there is some code that I don't understand in ns() that uses qr() to > postprocess the output from spline.des. I assume this is involved > somehow in imposing the boundary conditions... > > Thanks again everyone for your help, > -- Nathaniel -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Numerics behind splineDesign
Thanks Peter. So it was I who was being too "hasty." (heh-heh).* -- Bert *Yes, it was bad once. So twice makes it ... what, pathetic? On Wed, Aug 1, 2012 at 9:17 AM, peter dalgaard wrote: > > On Aug 1, 2012, at 18:03 , Bert Gunter wrote: > >> Inline... >> >> On Wed, Aug 1, 2012 at 8:36 AM, Nathaniel Smith wrote: >>> Thanks everyone for the suggestions. >>> >>> On Wed, Aug 1, 2012 at 2:39 PM, peter dalgaard wrote: On Jul 31, 2012, at 15:46 , Bert Gunter wrote: > Well, I would first check the references given in the Help file!. > That's what they're for, no? Hastie's book is likely to more complete > on the algebra, I think. >>> >>> How embarrassing... the help files do cite the white book (only), and >>> I did check it of course, but it has no more details on how the basis >>> functions are computed than does the help file itself, and so I must >>> have forgotten about it when writing my email. Still, my apologies for >>> the confusion. >>> >>> I'm not sure what you mean by "Hastie's book", though? >> >> Ummm... The following appears in the ?bs man page. Why do you not >> see it? Are you perhaps being too "hasty" in your reading (heh-heh)? >> >> References >> >> Hastie, T. J. (1992) Generalized additive models. Chapter 7 of >> Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth >> & Brooks/Cole. > > It's not Hastie's book, though It's his chapter in a book edited by > Chambers and Hastie. > > > -- > Peter Dalgaard, Professor, > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Email: pd@cbs.dk Priv: pda...@gmail.com > > > > > > > > -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] INDEX rdb and rdx files
On Aug 2, 2012, at 11:22 , luxInteg wrote: > On Thursday 02 August 2012 09:39:18 peter dalgaard wrote: > >> I think you need to read the Installation and Administration manual: >> >> http://cran.r-project.org/manuals.html > > thanks > but if you mean this > http://cran.r-project.org/doc/manuals/R-admin.html#Installation Yes, chapter 6. Do pay attention to the difference between R command-line usage and shell commands, though. -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Rd] Numerics behind splineDesign
On 08/02/2012 05:00 AM, r-devel-requ...@r-project.org wrote: Now I just have to grovel over the R code in ns() and bs() to figure out how exactly they pick knots and handle boundary conditions, plus there is some code that I don't understand in ns() that uses qr() to postprocess the output from spline.des. I assume this is involved somehow in imposing the boundary conditions... Thanks again everyone for your help, -- Nathaniel The ns and bs function post-process the spline bases to get an orthagonal basis matrix, this is the use of qr. I think this causes much more grief than it is worth, for the sake of a small increase in numeric stability. For instance when you plot the spline bases, they don't look anything like the basis functions one would expect. (Perhaps my background in numerical analysis was a hindrance here, since I know something about splines and thus have an expectation). Terry Therneau __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Rd] Numerics behind splineDesign
On Thu, Aug 2, 2012 at 2:09 PM, Terry Therneau wrote: > > > On 08/02/2012 05:00 AM, r-devel-requ...@r-project.org wrote: >> >> Now I just have to grovel over the R code in ns() and bs() to figure >> out how exactly they pick knots and handle boundary conditions, plus >> there is some code that I don't understand in ns() that uses qr() to >> postprocess the output from spline.des. I assume this is involved >> somehow in imposing the boundary conditions... >> >> Thanks again everyone for your help, >> -- Nathaniel > > The ns and bs function post-process the spline bases to get an orthagonal > basis matrix, this is the use of qr. I think this causes much more grief > than it is worth, for the sake of a small increase in numeric stability. > For instance when you plot the spline bases, they don't look anything like > the basis functions one would expect. (Perhaps my background in numerical > analysis was a hindrance here, since I know something about splines and thus > have an expectation). You know, the white book does claim that S orthogonalizes the spline basis functions, but R doesn't seem to actually do that: > crossprod(bs(1:10, 4, intercept=TRUE)) 1 2 3 4 1 1.84104162 0.6154211 0.2570069 0.06430817 2 0.61542109 0.7710207 0.5787736 0.25700689 3 0.25700689 0.5787736 0.7710207 0.61542109 4 0.06430817 0.2570069 0.6154211 1.84104162 > crossprod(ns(1:10, 4, intercept=TRUE)) 1 2 3 4 1 1.0659929 0.5314089 0.37125505 -0.17838443 2 0.5314089 1.0681360 0.23122018 0.14422236 3 0.3712550 0.2312202 1.30226657 -0.03809082 4 -0.1783844 0.1442224 -0.03809082 1.10144173 and they look quite reasonable when plotted to me. ns is doing something more complicated; I think it's computing the second derivatives of each basis function at the position of the boundary knots, and then using that to somehow transform the original basis. Since the key feature of ns is that the returned basis has a zero second derivative at the boundary knots, I'm sure this makes sense if one stares at it for long enough. -n __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Rd] Numerics behind splineDesign
If R's bs() and ns() are like S+'s (they do give very similar results* and S+'s were written by Doug Bates), then bs() does not do any linear algebra (like qr()) on splineDesign's output. bs() needs to come up with a default set of knots (if the user didn't supply them), combine the Boundary.knots (repeated ord times) and knots into one vector to pass to splineDesign, and, if there are any x's outside of range(Boundary.knots), treat them specially. ns() needs to project splineDesign's basis functions onto the subspace of functions whose 2nd derivatives are zero at the endpoints. The projection can be done with qr() and friends (S+ uses qr()). (If you want basis functions for a periodic spline you could use a similar procedure to project to the subspace of functions whose first and second derivatives match at the upper and lower Boundary.knots.) * The only difference between the R and S+ versions of bs() that I've noticed is in how they deal with the x's that are outside of range(Boundary.knots). S+ extrapolates with cubics both above and below that range while R extrapolates with a cubic below the range and with a quadratic above the range. I don't know what the rationale for this is. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On > Behalf > Of Terry Therneau > Sent: Thursday, August 02, 2012 6:10 AM > To: r-devel@r-project.org; Nathaniel Smith > Subject: Re: [Rd] Rd] Numerics behind splineDesign > > > > On 08/02/2012 05:00 AM, r-devel-requ...@r-project.org wrote: > > Now I just have to grovel over the R code in ns() and bs() to figure > > out how exactly they pick knots and handle boundary conditions, plus > > there is some code that I don't understand in ns() that uses qr() to > > postprocess the output from spline.des. I assume this is involved > > somehow in imposing the boundary conditions... > > > > Thanks again everyone for your help, > > -- Nathaniel > The ns and bs function post-process the spline bases to get an > orthagonal basis matrix, this is the use of qr. I think this causes > much more grief than it is worth, for the sake of a small increase in > numeric stability. For instance when you plot the spline bases, they > don't look anything like the basis functions one would expect. (Perhaps > my background in numerical analysis was a hindrance here, since I know > something about splines and thus have an expectation). > > Terry Therneau > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Rd] Numerics behind splineDesign
Clearly, I got it wrong. Thanks to others for the clearer and correct message. Terry T On 08/02/2012 11:59 AM, William Dunlap wrote: If R's bs() and ns() are like S+'s (they do give very similar results* and S+'s were written by Doug Bates), then bs() does not do any linear algebra (like qr()) on splineDesign's output. bs() needs to come up with a default set of knots (if the user didn't supply them), combine the Boundary.knots (repeated ord times) and knots into one vector to pass to splineDesign, and, if there are any x's outside of range(Boundary.knots), treat them specially. ns() needs to project splineDesign's basis functions onto the subspace of functions whose 2nd derivatives are zero at the endpoints. The projection can be done with qr() and friends (S+ uses qr()). (If you want basis functions for a periodic spline you could use a similar procedure to project to the subspace of functions whose first and second derivatives match at the upper and lower Boundary.knots.) * The only difference between the R and S+ versions of bs() that I've noticed is in how they deal with the x's that are outside of range(Boundary.knots). S+ extrapolates with cubics both above and below that range while R extrapolates with a cubic below the range and with a quadratic above the range. I don't know what the rationale for this is. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of Terry Therneau Sent: Thursday, August 02, 2012 6:10 AM To: r-devel@r-project.org; Nathaniel Smith Subject: Re: [Rd] Rd] Numerics behind splineDesign On 08/02/2012 05:00 AM, r-devel-requ...@r-project.org wrote: Now I just have to grovel over the R code in ns() and bs() to figure out how exactly they pick knots and handle boundary conditions, plus there is some code that I don't understand in ns() that uses qr() to postprocess the output from spline.des. I assume this is involved somehow in imposing the boundary conditions... Thanks again everyone for your help, -- Nathaniel The ns and bs function post-process the spline bases to get an orthagonal basis matrix, this is the use of qr. I think this causes much more grief than it is worth, for the sake of a small increase in numeric stability. For instance when you plot the spline bases, they don't look anything like the basis functions one would expect. (Perhaps my background in numerical analysis was a hindrance here, since I know something about splines and thus have an expectation). Terry Therneau __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel