[Rd] CRAN task views work only once per session (PR#9330)
Cran task views seems to be a "once-per-session" process -- the first attempt to access views in a (RGui for Windows) session works, but subsequent attempts fail. There is a noticeably long pause before the failing call returns. Example session with two calls to "available.views" follows, but similar effects have been observed with two calls to "install.views" and even a call to "available.views" followed by a call to "install.views". R version 2.4.0 (2006-10-03) Copyright (C) 2006 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > sessionInfo() R version 2.4.0 (2006-10-03) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] "methods" "stats" "graphics" "grDevices" "utils" "datasets" [7] "base" > available.views(repos="http://cran.uk.r-project.org";) Error: could not find function "available.views" > library(ctv) > available.views(repos="http://cran.uk.r-project.org";) CRAN Task Views --- Name: Bayesian Topic: Bayesian Inference Maintainer: Jong Hee Park Repository: http://cran.uk.r-project.org --- Name: Cluster Topic: Cluster Analysis & Finite Mixture Models Maintainer: Friedrich Leisch and Bettina Gruen Repository: http://cran.uk.r-project.org --- Name: Econometrics Topic: Computational Econometrics Maintainer: Achim Zeileis Repository: http://cran.uk.r-project.org --- Name: Environmetrics Topic: Analysis of ecological and environmental data Maintainer: Gavin Simpson Repository: http://cran.uk.r-project.org --- Name: Finance Topic: Empirical Finance Maintainer: Dirk Eddelbuettel Repository: http://cran.uk.r-project.org --- Name: Genetics Topic: Statistical Genetics Maintainer: Giovanni Montana Repository: http://cran.uk.r-project.org --- Name: Graphics Topic: Graphic Displays & Dynamic Graphics & Graphic Devices & Visualization Maintainer: Nicholas Lewin-Koh Repository: http://cran.uk.r-project.org --- Name: MachineLearning Topic: Machine Learning & Statistical Learning Maintainer: Torsten Hothorn Repository: http://cran.uk.r-project.org --- Name: Multivariate Topic: Multivariate Statistics Maintainer: Paul Hewson Repository: http://cran.uk.r-project.org --- Name: SocialSciences Topic: Statistics for the Social Sciences Maintainer: John Fox Repository: http://cran.uk.r-project.org --- Name: Spatial Topic: Analysis of Spatial Data Maintainer: Roger Bivand Repository: http://cran.uk.r-project.org --- Name: gR Topic: gRaphical models in R Maintainer: Claus Dethlefsen Repository: http://cran.uk.r-project.org > available.views(repos="http://cran.uk.r-project.org";) CRAN Task Views no views found > --please do not edit the information below-- Version: platform = i386-pc-mingw32 arch = i386 os = mingw32 system = i386, mingw32 status = major = 2 minor = 4.0 year = 2006 month = 10 day = 03 svn rev = 39566 language = R version.string = R version 2.4.0 (2006-10-03) Windows XP Professional (build 2600) Service Pack 2.0 Locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 Search Path: .GlobalEnv, package:ctv, package:methods, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, Autoloads, package:base __ This email has been scanned by the MessageLabs Email Security System. For more information visit http://www.virtual-email.net/messagelabs.htm __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Formal methods are not loaded from NAMESPACE in reloaded workspace image
Dear R-Devel subscriber, I was hinted to the following problem with package 'urca': If one starts R and executes for instance: > library(urca) > example(ur.df) ## output as expected, but omitted here > class(lc.df) [1] "ur.df" attr(,"package") [1] "urca" > class(summary(lc.df)) [1] "sumurca" attr(,"package") [1] "urca" > everything works fine. Now, save the workspace image and quit R. After starting R again with the previously restored workspace image one has: > ls() [1] "lc.df" "Raotbl3" > class(lc.df) [1] "ur.df" attr(,"package") [1] "urca" lc.df ## now the 'show'-method for objects of class 'ur.df' is not utilised, rather the generic ## displaying all slots > library(urca) > lc.df ## still the same as compared to the above output. ## similarily > class(summary(lc.df)) [1] "table" In the NAMESPACE file export directives for methods and classes are included as: ## Classes exportClasses("urca", "ca.jo", "cajo.test", "ur.kpss", "ca.po", "ur.ers", "ur.pp", "ur.sp", "ur.df", "ur.za", "sumurca") ## Methods exportMethods("show", "plot", "summary") Any help or pointers for solving this problem is much appreciated. Best, Bernhard > sessionInfo() R version 2.5.0 Under development (unstable) (2006-10-10 r39600) i386-pc-mingw32 locale: LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY= German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252 attached base packages: [1] "methods" "stats" "graphics" "grDevices" "datasets" "utils" [7] "base" other attached packages: urca fortunes "1.0-0" "1.3-2" * Confidentiality Note: The information contained in this mess...{{dropped}} __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] CRAN task views work only once per session (PR#9330)
One comment - taken from the FAQ - in advance: Bug reports on contributed packages should be sent first to the package maintainer, and only submitted to the R-bugs repository by package maintainers, mentioning the package in the subject line. In this case, posting to R-devel (but not R-bugs) and Cc to me (as the maintainer of ctv) would also have been ok. As for your problem: On my Linux machine, the code library("ctv") x <- available.views(repos = "http://CRAN.uk.R-project.org";) y <- available.views(repos = "http://CRAN.uk.R-project.org";) runs without any problem, x and y are also identical afterwards. As I haven't got a Windows XP machine, could someone on the list please run the code above and confirm (or disconfirm) that the second call takes longer and finally finds no views. thx in advance, Z __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] CRAN task views work only once per session (PR#9330)
On Thu, 2 Nov 2006, Achim Zeileis wrote: > One comment - taken from the FAQ - in advance: > Bug reports on contributed packages should be sent first to the package > maintainer, and only submitted to the R-bugs repository by package > maintainers, mentioning the package in the subject line. > > In this case, posting to R-devel (but not R-bugs) and Cc to me (as the > maintainer of ctv) would also have been ok. > > As for your problem: On my Linux machine, the code > > library("ctv") > x <- available.views(repos = "http://CRAN.uk.R-project.org";) > y <- available.views(repos = "http://CRAN.uk.R-project.org";) > > runs without any problem, x and y are also identical afterwards. As I > haven't got a Windows XP machine, could someone on the list please run the > code above and confirm (or disconfirm) that the second call takes longer > and finally finds no views. It works correctly on my XP machine. I don't find http://CRAN.uk.R-project.org a particularly reliable source (and it is like me in .ac.uk), so wonder if this might have been a networking or mirror glitch. I would have tried another mirror (the London one is more reliable for me) long before reporting a problem. -- 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] CRAN task views work only once per session (PR#9330)
They run without problem and are identical on my XP machine too: > library(ctv) > x <- available.views(repos = "http://CRAN.uk.R-project.org";) > y <- available.views(repos = "http://CRAN.uk.R-project.org";) > identical(x,y) [1] TRUE > R.version.string # XP [1] "R version 2.4.0 Patched (2006-10-24 r39722)" On 11/2/06, Achim Zeileis <[EMAIL PROTECTED]> wrote: > One comment - taken from the FAQ - in advance: > Bug reports on contributed packages should be sent first to the package > maintainer, and only submitted to the R-bugs repository by package > maintainers, mentioning the package in the subject line. > > In this case, posting to R-devel (but not R-bugs) and Cc to me (as the > maintainer of ctv) would also have been ok. > > As for your problem: On my Linux machine, the code > > library("ctv") > x <- available.views(repos = "http://CRAN.uk.R-project.org";) > y <- available.views(repos = "http://CRAN.uk.R-project.org";) > > runs without any problem, x and y are also identical afterwards. As I > haven't got a Windows XP machine, could someone on the list please run the > code above and confirm (or disconfirm) that the second call takes longer > and finally finds no views. > > thx in advance, > Z > > __ > 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] Cross-compilation
You might be better off using the same g++ as distributed and found on Prof Ripley's web site, rather than the newer 4.x: $ /home/hin-tak/mingw-cross/bin/i586-mingw32-c++ --version i586-mingw32-c++ (GCC) 3.4.5 (mingw special) ... Name-mangling and C++ ABI had changed between gcc 3.x and 4.x, so compiling c++ programs might be different. It had worked out-of-the-box for me when I was using fedora 5 x86_64 (I just upgraded to fedora 6 yesterday, and I haven't tried doing any cross-compiling yet). So fc4 probably should work. HTH, Hin-Tak Leung Tom McCallum wrote: > Thanks for your reply, as an example it appears to have difficulty linking > to even ostream library of the standard C++, as shown below: > > /home/tmccallum/ritzel/RItzel/src/Classifier.cpp:209: undefined reference > to `_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc' > Classifier.o: In function `operator<<': > /usr/lib/gcc/i386-redhat-linux/4.0.2/../../../../include/c++/4.0.2/ostream:218: > > undefined reference to `_ZNSolsEd' > /usr/lib/gcc/i386-redhat-linux/4.0.2/../../../../include/c++/4.0.2/ostream:196: > > undefined reference to `_ZNSolsEl' > > I am currently working R-2.4.0 as downloaded today. > > I know the g++ has gone through some alterations and wondered if you knew > the version of g++ you cross-compiled your package with for comparison - > mine is g++ (GCC) 4.0.2 20051125 (Red Hat 4.0.2-8). > > Many thanks > > Tom > > > On Wed, 25 Oct 2006 18:10:40 +0100, Ramon Diaz-Uriarte <[EMAIL PROTECTED]> > wrote: > >> Dear Tom, >> >> It has worked for me out-of-the box in at least two times, one a while >> ago >> with R-2.2-something and recently with R-2.4.0. In both cases, I was >> running >> Debian (with a mix of testing and unstable) on x86. I never had to do >> anything, just run the script and at least in one case I did >> crosscompile a >> package with C++. >> >> >> R. >> >> On Wednesday 25 October 2006 18:03, Tom McCallum wrote: >>> Hi everyone, >>> >>> I am trying to cross-compile a package I wrote using the Yan and Rossini >>> tutorial "Building Microsoft Windows versions of R and R packages using >>> Intel Linux". I have got reasonably far with this but when doing the >>> linking using the line: >>> >>> i586-mingw32-g++ -shared -s -o mylibrary.dll mylibrary.def mylibrary.o >>> mylibrary_res.o -L/my/path/RCrossBuild/WinR/R-2.4.0/bin -lR >>> >>> I get lots of these type of messages: >>> /my/path/to/mylibrary.cpp:43: undefined reference to >>> `_GLOBAL_OFFSET_TABLE_' >>> >>> and other similar linker errors for virtually every object and command >>> in >>> the program. After some googling I have found that there may be >>> problems >>> with the libgcc.a library and its default -fPIC argument during >>> compilation. >>> >>> Has anyone got this tutorial to work and if so how did they overcome >>> this? >>> >>> I am attempting to do this on Fedora Core 4 on a 32-bit machine, having >>> completed all the previous sections of the tutorial for building a >>> cross-platform version of R. >>> >>> Many thanks >>> >>> Tom > > > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] buglet in plot.lm (PR#9333)
In version 2.2.0, plot.lm() was enhanced with two new plots (thanks, Martin and John). There's a small fix needed for 'which=6' when 'id.n=0'. > plot(lm(rnorm(10) ~ 1), which = 6, id.n = 0) Error in plot.lm(lm(rnorm(10) ~ 1), which = 6, id.n = 0) : could not find function "text.id" Fixed by inserting braces in plot.lm.R: Replace code at line last-8: if (id.n > 0) show.r <- order(-cook)[iid] text.id(g[show.r], cook[show.r], show.r) with if (id.n > 0) { show.r <- order(-cook)[iid] text.id(g[show.r], cook[show.r], show.r) } > version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status Patched major 2 minor 4.0 year 2006 month 10 day29 svn rev39744 language R version.string R version 2.4.0 Patched (2006-10-29 r39744) Peter Ehlers __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Connections patch
I've implemented an R Connections API for packages writers and those embedding R into other systems. The patch is here: http://biostat.mc.vanderbilt.edu/twiki/pub/Main/RApacheProject/Conn-patch-R-devel-r39773.patch and I've started an R wiki for discussion here: http://wiki.r-project.org/rwiki/doku.php?id=developers:r_connections_api Main points: 1) C code can create new connections and pass them back to R. 2) R code can utilize them just like existing connections. 3) C code can also utilize them. 3) stdin, stdout, and stderr connections can be replaced with something else. Comments much appreciated, Jeff -- http://biostat.mc.vanderbilt.edu/JeffreyHorner __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] fields appearing in cran descriptions pages
> Gabor Grothendieck writes: > What determines which fields appear in CRAN descriptions pages. > For example, for doBy there is no Date: but there is a vignette listed: >http://cran.r-project.org/src/contrib/Descriptions/doBy.html > whereas for gsubfn there is a Date: but there is no vignette listed > (even though it has one). > http://cran.r-project.org/src/contrib/Descriptions/gsubfn.html A bug in the script generating the web content. Should be fixed now. -k __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Syntax Error in Rcmd check on Windows
On 10/31/2006 2:07 PM, Duncan Murdoch wrote: > On 10/31/2006 1:50 PM, Michael Hoehle wrote: >>> Thanks for pointing me to the source. I can reproduce the problem, and >>> I'm fairly sure it's an R bug, not a problem in your source. I need to >>> trace through at a low level to confirm this and to work out the fix. >>> >> >> It reassuring to know that the problem appears not to be with my code. >> Thanks for your help so far and hopefully you are able to find the >> bug! Let me know when you know more. >> >> Michael >> >> P.S. When I do a dos2unix on RLadyBug-Ex.R "Rterm --no-save < >> RLadyBug-Ex.R " works fine. > > Yes, the problem has to do with the CR LF line ends in the file. For > some reason R switches from handling those properly to not doing so. > The problem I'm having right now is that I can't do input redirection in > gdb in Windows, so it's really hard to see when the switch happens, or why. I'm now fairly sure this isn't an R bug after all. It goes away if I edit out the requirement in RLadyBug for rJava, which makes me think that rJava is somehow messing up R's input routines. (Rcmd check fails later when it can't find ".jnew", as you'd expect. But there's no spurious syntax error.) Because of the difficulties with the debugger I'm going to quit now; if you find any evidence that suggests it really is R's bug after all, please let me know. Simon, let me know if there are any tests I can do to help track this down. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Syntax Error in Rcmd check on Windows
On Nov 2, 2006, at 4:39 PM, Duncan Murdoch wrote: > On 10/31/2006 2:07 PM, Duncan Murdoch wrote: >> On 10/31/2006 1:50 PM, Michael Hoehle wrote: Thanks for pointing me to the source. I can reproduce the problem, and I'm fairly sure it's an R bug, not a problem in your source. I need to trace through at a low level to confirm this and to work out the fix. >>> It reassuring to know that the problem appears not to be with my >>> code. >>> Thanks for your help so far and hopefully you are able to find the >>> bug! Let me know when you know more. >>> Michael >>> P.S. When I do a dos2unix on RLadyBug-Ex.R "Rterm --no-save < >>> RLadyBug-Ex.R " works fine. >> Yes, the problem has to do with the CR LF line ends in the file. >> For some reason R switches from handling those properly to not >> doing so. The problem I'm having right now is that I can't do >> input redirection in gdb in Windows, so it's really hard to see >> when the switch happens, or why. > > I'm now fairly sure this isn't an R bug after all. It goes away if > I edit out the requirement in RLadyBug for rJava, which makes me > think that rJava is somehow messing up R's input routines. (Rcmd > check fails later when it can't find ".jnew", as you'd expect. > But there's no spurious syntax error.) > > Because of the difficulties with the debugger I'm going to quit > now; if you find any evidence that suggests it really is R's bug > after all, please let me know. > > Simon, let me know if there are any tests I can do to help track > this down. > AFAIR this is the (sort of known) issue of Java changing the newlines behavior of the output under R CMD check. However, so far no one could tell me what the issue really is. Can't just R CMD check ignore the CR/LF issues on Windows? I was assuming that it is not making distinction between \r\n and \n anyway ... Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Syntax Error in Rcmd check on Windows
On 11/2/2006 4:59 PM, Simon Urbanek wrote: > On Nov 2, 2006, at 4:39 PM, Duncan Murdoch wrote: > >> On 10/31/2006 2:07 PM, Duncan Murdoch wrote: >>> On 10/31/2006 1:50 PM, Michael Hoehle wrote: > Thanks for pointing me to the source. I can reproduce the > problem, and > I'm fairly sure it's an R bug, not a problem in your source. I > need to > trace through at a low level to confirm this and to work out the > fix. > It reassuring to know that the problem appears not to be with my code. Thanks for your help so far and hopefully you are able to find the bug! Let me know when you know more. Michael P.S. When I do a dos2unix on RLadyBug-Ex.R "Rterm --no-save < RLadyBug-Ex.R " works fine. >>> Yes, the problem has to do with the CR LF line ends in the file. >>> For some reason R switches from handling those properly to not >>> doing so. The problem I'm having right now is that I can't do >>> input redirection in gdb in Windows, so it's really hard to see >>> when the switch happens, or why. >> I'm now fairly sure this isn't an R bug after all. It goes away if >> I edit out the requirement in RLadyBug for rJava, which makes me >> think that rJava is somehow messing up R's input routines. (Rcmd >> check fails later when it can't find ".jnew", as you'd expect. >> But there's no spurious syntax error.) >> >> Because of the difficulties with the debugger I'm going to quit >> now; if you find any evidence that suggests it really is R's bug >> after all, please let me know. >> >> Simon, let me know if there are any tests I can do to help track >> this down. >> > > AFAIR this is the (sort of known) issue of Java changing the > newlines behavior of the output under R CMD check. However, so far no > one could tell me what the issue really is. > Can't just R CMD check ignore the CR/LF issues on Windows? I was > assuming that it is not making distinction between \r\n and \n > anyway ... I thought the input routines were supposed to be converting \r\n to \n, but that's not happening during the check. I can't see where the change occurs, because I don't know how to reproduce the error other than by Rterm --no-save https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Geschaeftliches Angebot.
ARTHUR BRETON,CHRIS NISSEN & ASSOCIATES SOLICITORS & ADVOCATES GABORONE. BOTSWANA. Lieber Herr, Mein Name ist ARTHUR BRETON, bin ein 50 jähriger Anwalt aus Gaborone, Botswana. Einer meiner 15 Jährigen Klienten ,ein Deutscher Namens Gunter Haymann, welcher über 18 Jahre für eine Diamanten Bergbaufirma ( Debsawna Diamond Company pty Limited) gearbeitet hat, ist leider im November 2003 in einem Autounfall verunglückt. Herr. Haymann ist an den Folgen seiner Verletzungen im Krankenhaus von Botswana verstorben.Aus seiner Tätigkeit als Bergbauunternehmer und Contractor ist ein ansehnliches Vermögen angewachsen und betrug bei seinem Ableben rund 7.5 Mio $. Während der Jahre unserer Zusammenarbeit hat sich ein grosses Vertrauen zu mir gebildet und nach seinem Tode konnte ich sogar seine Prokuristin anstellen. Todtraurig hat sich bis zum heutigen Tag kein Verwandter oder Angehöriger gemeldet um das Vermögen zu übernehmen. Bei uns in Botswana besteht ein Gesetz , dass Vermögen welche nicht innert 3 Jahren in Anspruch genommen werden an die Regierungskasse übergehen. Dies möchte ich mit allen Mitteln verhindern. Aus diesem Grund habe mich bemüht über eine Security Company und einem Sperrkonto ( Safe Deposit Box ) das Vermögen zu sichern damit es nicht an die Regierung zurückfällt. Ich suche ferner aus diesem Grund, einen europäischen Partner mit welchem ich einen Vertrag abschliessen kann und über ihn (Firma,Name,Adresse,Tel,Fax etc,) diese Geldtransaktion abwickeln zu können. Dieser Partner würde für seine Dienste mit 20% Provision belohnt. Gerne würde ich von ihnen erfahren ob sie an so einem Projekt interessiert wären? ich werde mich auf eine Rückantwort freuen. [EMAIL PROTECTED], [EMAIL PROTECTED] Herzlichen Dank ,ich würde mich über ihre Koorperation freuen. Mfg. ARTHUR BRETON. PS: Please do reply in English if you do understand Written as well as spoken English perfectly. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Display problem with named complex vectors
Hi, > z <- (-1:3)+2i > names(z) <- LETTERS[1:5] > z A B C D E -1+2i 0+2i 1+2i 2+2i 3+2i Nice :-) > names(z)[2] <- "long name" > z A long name C D E -1+2i 0+2i 1+2i 2+2i 3+2i Not nice :-( This happens with R-2.4.0 and current R-devel. It also happens with raw vectors as reported one month ago. Cheers, H. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] allocVector bug ?
On Wed, 1 Nov 2006, Vladimir Dergachev wrote: > > Hi all, > > I was looking at the following piece of code in src/main/memory.c, function > allocVector : > >if (size <= NodeClassSize[1]) { > node_class = 1; > alloc_size = NodeClassSize[1]; >} >else { > node_class = LARGE_NODE_CLASS; > alloc_size = size; > for (i = 2; i < NUM_SMALL_NODE_CLASSES; i++) { > if (size <= NodeClassSize[i]) { > node_class = i; > alloc_size = NodeClassSize[i]; > break; > } > } >} > > > It appears that for LARGE_NODE_CLASS the variable alloc_size should not be > size, but something far less as we are not using vector heap, but rather > calling malloc directly in the code below (and from discussions I read on > this mailing list I think that these two are different - please let me know > if I am wrong). > > So when allocate a large vector the garbage collector goes nuts trying to find > all that space which is not going to be needed after all. This is as intended, not a bug. The garbage collector does not "go nuts" -- it is doing a garbage collection that may release memory in advance of making a large allocation. The size of the current allocation request is used as part of the process of deciding when to satisfy an allocation by malloc (of a single large noda or a page) and when to first do a gc. It is essential to do this for large allocations as well to keep the memory footprint down and help reduce fragmentation. The strategy for deciding when to allocate and when to gc is by necessity heuristic. It tries to keep overall memory footprint low but at the same time tries to adapt to usage so that gc happens less oftn once a pattern of using larger amounts of memory emerges. The current strategy seems quite robust across a large range of architactures, memory configurations, and applications. That said, when I wrote the mamager I kept in mind that we might eventually want to try morre sophisticated schemes and/or allow some user control over the schemes used. It may be time to revisit this soon. luke > > I made an experiment and replaced the line alloc_size=size with alloc_size=0. > > R compiled fine (both 2.4.0 and 2.3.1) and passed make check with no issues > (it all printed OK). > > Furthermore, all allocVector calls completed in no time and my test case run > very fast (22 seconds, as opposed to minutes). > > In addition, attach() was instantaneous which was wonderful. > > Could anyone with deeper knowledge of R internals comment on whether this > makes any sense ? > > thank you very much ! > >Vladimir Dergachev > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > -- Luke Tierney Chair, Statistics and Actuarial Science Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone: 319-335-3386 Department of Statistics andFax: 319-335-3017 Actuarial Science 241 Schaeffer Hall email: [EMAIL PROTECTED] Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] man page for as.matrix for data frames outdated?
Hi again, The man page for 'as.matrix' says: 'as.matrix' is a generic function. The method for data frames will convert any non-numeric/complex column into a character vector using 'format' and so return a character matrix, except that all-logical data frames will be coerced to a logical matrix. It's true that "all-logical data frames will be coerced to a logical matrix": > fourLogicals <- 2:5>3 > df1 <- data.frame(a=fourLogicals) > storage.mode(as.matrix(df1)) [1] "logical" Otherwise it's not true that 'as.matrix' will return a character matrix: > fourInts <- 2:-1 > df2 <- data.frame(a=fourLogicals, b=fourInts) > storage.mode(as.matrix(df2)) [1] "integer" > fourDoubles <- rep(pi,4) > df3 <- data.frame(c=fourDoubles, a=fourLogicals, b=fourInts) > storage.mode(as.matrix(df3)) [1] "double" > fourComplexes <- (-1:2)+3i > df4 <- data.frame(a=fourLogicals, d=fourComplexes, b=fourInts, c=fourDoubles) > storage.mode(as.matrix(df4)) [1] "complex" If one column is of mode character, then 'as.matrix' will effectively return a character matrix: > df5 <- data.frame(toto=c("a","bb"), titi=c(9,999)) > storage.mode(as.matrix(df5)) [1] "character" Note that the doc says that "any non-numeric/complex column" will be passed thru 'format' which seems to be exactly the other way around: > as.matrix(df5) toto titi 1 "a" " 9" 2 "bb" "999" Anyway why one would like to have the numeric values passed thru 'format' to start with? This is in R-2.4.0 and recent R-devel. Best, H. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel