Re: [Rd] Buidling R on Linux (Itanium) fails (PR#7897)
Thu, 26 May 2005 12:09:23 +0200 Christophe Pouzat <[EMAIL PROTECTED]> wrote. > Hi, > > here is the "configure" command line I used for an Intel PIV processor > with icc, ifort and the intel mkl: (snip) > In my experience using "FPICFLAGS=-shared" is mendatory to get the > compilation working. The other options are mainly there to pass almost > all the tests (except one) of "make check". Is not a cause to fail in a problem of FTZ,DAZ? If there was time because I put http://www.nakama.ne.jp/memo/ia32_linux/ R-2.1.1.iccftzdaz.patch.txt please try to test it. -- http://www.nakama.ne.jp, http://r.nakama.ne.jp e-mail : EIJI Nakama <[EMAIL PROTECTED]> __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] (PR#7976) split() dropping levels (was "boxplot by factor")
> "PD" == Peter Dalgaard <[EMAIL PROTECTED]> > on 28 Jun 2005 14:57:42 +0200 writes: PD> "Liaw, Andy" <[EMAIL PROTECTED]> writes: >> The issue is not with boxplot, but with split. boxplot.formula() >> calls boxplot(split(split(mf[[response]], mf[-response]), ...), >> but look at what split() returns when there are empty levels in >> the factor: >> >> > f <- factor(gl(3, 6), levels=1:5) >> > y <- rnorm(f) >> > split(y, f) >> $"1" >> [1] 0.4832124 1.1924811 0.3657797 1.7400198 0.5577356 0.9889520 >> >> $"2" >> [1] -1.1296642 -0.4808355 -0.2789933 0.1220718 0.1287742 -0.7573801 >> >> $"3" >> [1] 1.2320902 0.5090700 -1.5508074 2.1373780 1.1681297 -0.7151561 >> >> The "culprit" is the following in split.default(): >> >> f <- factor(f) >> >> which drops empty levels in f, if there are any. BTW, ?split doesn't >> mention what it does in such situation. Perhaps it should? >> >> If this is to be "fixed", I suppose an additional argument, e.g., >> drop=TRUE, can be added, and the corresponding line mentioned >> above changed to something like: >> >> if (drop || !is.factor(f)) f <- factor(f) >> >> Then this additional argument can be pass on from boxplot.formula() to >> split(). PD> Alternatively, I suspect that the intention was as.factor() rather PD> than factor(). at first I thought Peter was right; but the real source of split.default contains a comment (!) and that line is f <- factor(f) # drop extraneous levels so it seems, this was done there very much on purpose. OTOH, S(-plus) has implemented it quite a bit differently, and actually does keep the empty levels in the example f <- factor(rep(1:3, each=6), levels=1:5); y <- rnorm(f); split(y, f) PD> It does require a bit of care to fix it that way, PD> though. There could be problems with empty levels popping up in PD> unexpected places. Indeed! Given the new facts, I think we want to go in Andy's direction with a new argument, 'drop' A Peter mentioned, the real question is about its default. "drop = TRUE" would be fully compatible with previous versions of R. "drop = FALSE" would be compatible with S and S-plus. I'm going to implement it, and try to see if 'drop = FALSE' gives changes for R and its standard packages; if 'yes', that would be an indication that such a R-back-compatibility breaking change was not a good idea. If 'no', I could commit it and see if it has an effect on the CRAN packages Of course, since split() and split()<- are S3 generics, and since there's also unsplit(), this entails a whole slew of changes {adding a "drop = FALSE" argument everywhere!} and I presume will break everyone's code who has written own split.foobar methods great... Martin __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] C code in packages with complex arguments/returned value
On Fri, 1 Jul 2005, Kurt Hornik wrote: >> Robin Hankin writes: > >> Professor Ripley >> On Jul 1, 2005, at 02:58 pm, Prof Brian Ripley wrote: > >>> Search for uses of Rcomplex in package source code. The only >>> packages on CRAN which use it are ifs and rimage. > > >> Thank you for this: either is perfect for my purposes. How did you >> search the packages' source code? (my best attempt was downloading a >> random sample of packages and searching locally). > > You mean you don't have a local CRAN mirror on your hard disk? :-) Well, as I do and unpack them regularly for testing proposed code changes, I did grep Rcomplex ~/R/packages/tests/*/src/* However, I was intending that you should search in the packages I had located for you. > > -k > >> RSiteSeearch("Rcomplex") gave me nothing useful. > >> best wishes > > >> rksh > > Does anyone know of a package that includes C code which manipulates and returns complex arguments that I could take a look at? >>> Brian D. Ripley, [EMAIL PROTECTED] >>> 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, UKFax: +44 1865 272595 >>> > >> -- >> Robin Hankin >> Uncertainty Analyst >> National Oceanography Centre, Southampton >> European Way, Southampton SO14 3ZH, UK >> tel 023-8059-7743 > >> __ >> R-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel > > -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] C code in packages with complex arguments/returned value
> Robin Hankin writes: > Professor Ripley > On Jul 1, 2005, at 02:58 pm, Prof Brian Ripley wrote: >> Search for uses of Rcomplex in package source code. The only >> packages on CRAN which use it are ifs and rimage. >>> > Thank you for this: either is perfect for my purposes. How did you > search the packages' source code? (my best attempt was downloading a > random sample of packages and searching locally). You mean you don't have a local CRAN mirror on your hard disk? :-) -k > RSiteSeearch("Rcomplex") gave me nothing useful. > best wishes > rksh >>> Does anyone know of a package that includes C code which manipulates >>> and returns complex arguments that I could take a look at? >>> >>> >> Brian D. Ripley, [EMAIL PROTECTED] >> 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, UKFax: +44 1865 272595 >> > -- > Robin Hankin > Uncertainty Analyst > National Oceanography Centre, Southampton > European Way, Southampton SO14 3ZH, UK > tel 023-8059-7743 > __ > 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] C code in packages with complex arguments/returned value
Professor Ripley On Jul 1, 2005, at 02:58 pm, Prof Brian Ripley wrote: > Search for uses of Rcomplex in package source code. The only > packages on CRAN which use it are ifs and rimage. >> Thank you for this: either is perfect for my purposes. How did you search the packages' source code? (my best attempt was downloading a random sample of packages and searching locally). RSiteSeearch("Rcomplex") gave me nothing useful. best wishes rksh >> Does anyone know of a package that includes C code which manipulates >> and returns complex arguments that I could take a look at? >> >> > Brian D. Ripley, [EMAIL PROTECTED] > 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, UKFax: +44 1865 272595 > -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] C code in packages with complex arguments/returned value
Search for uses of Rcomplex in package source code. The only packages on CRAN which use it are ifs and rimage. On Fri, 1 Jul 2005, Robin Hankin wrote: > Hi > > one of my packages has a severe bottleneck at a particular function > and I > suspect that replacing the R code with C code would speed it up. > The function takes complex arguments and returns a complex value. > > I would like to follow Best Practice here. None of the C code in my > packages includes the ability to handle complex numbers (this is done > by R). > > Does anyone know of a package that includes C code which manipulates > and returns complex arguments that I could take a look at? > > Yes, there is src/main/complex.c, but I would like to see how complex > arithmetic is > done in a package (or how it should be done). > > -- > Robin Hankin > Uncertainty Analyst > National Oceanography Centre, Southampton > European Way, Southampton SO14 3ZH, UK > tel 023-8059-7743 > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > > -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] C/C++ namespaces
On Fri, 1 Jul 2005, Oleg Sklyar wrote: > Dear community, > > this is just a suggestion, but might be useful for the following R > releases. It might be useful for future suggestions if you read the relevant manual before posting. The developers are way ahead of you on this one. > I was programming some C code for R and my compiler constantly showed me > some crazy messages that a stdc++ macro length() was supplied with 4 > arguments whereas only one was required. The problem could be partially > resolved by changing the order of includes. However as soon as the file > was used from another units, the problem reappeared. Finally, it turned > out that length() with one argument was a macro in Rinternals.h along > with LENGTH. So I have to use namespace specifications on the rest of my > code, because R - length() is not protected under a namespace. > > The problem is however that length is a pretty common name and as any > other very common name should be protected by a C namespace to avoid > confusion. There is no such thing as a `C namespace': the word does not appear in the C99 standard. > Therefore, the suggestion/question - wouldn't it be > reasonable just to put the whole R includes into a unique namespace? It > wouldn't require any modifications in the existing libraries because if > the code is not conflicting, namespace can be omitted. > Does it have sense? No, as R is written in C not C++. This issue only occurs if 1) you include Rinternals.h (which was designed for C programmers), and 2) do not take notice of the warning in the `Writing R Extensions' manual and do not define R_NO_REMAP as it suggests. Using C++ namespaces would be of no help for C extensions to R, and we have already provided a solution, in a back-compatible way for both C and C++ programmers. -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] C code in packages with complex arguments/returned value
Hi one of my packages has a severe bottleneck at a particular function and I suspect that replacing the R code with C code would speed it up. The function takes complex arguments and returns a complex value. I would like to follow Best Practice here. None of the C code in my packages includes the ability to handle complex numbers (this is done by R). Does anyone know of a package that includes C code which manipulates and returns complex arguments that I could take a look at? Yes, there is src/main/complex.c, but I would like to see how complex arithmetic is done in a package (or how it should be done). -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] C/C++ namespaces
Dear community, this is just a suggestion, but might be useful for the following R releases. I was programming some C code for R and my compiler constantly showed me some crazy messages that a stdc++ macro length() was supplied with 4 arguments whereas only one was required. The problem could be partially resolved by changing the order of includes. However as soon as the file was used from another units, the problem reappeared. Finally, it turned out that length() with one argument was a macro in Rinternals.h along with LENGTH. So I have to use namespace specifications on the rest of my code, because R - length() is not protected under a namespace. The problem is however that length is a pretty common name and as any other very common name should be protected by a C namespace to avoid confusion. Therefore, the suggestion/question - wouldn't it be reasonable just to put the whole R includes into a unique namespace? It wouldn't require any modifications in the existing libraries because if the code is not conflicting, namespace can be omitted. Does it have sense? Regards Oleg Sklyar -- Dr Oleg Sklyar European Bioinformatics Institute Wellcome Trust Genome Campus Hinxton, Cambridge CB10 1SD United Kingdom tel +44 1223 492537 fax +44 1223 494468 email [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel