Re: [Rd] weighted.mean uses zero when na.rm=TRUE (PR#14032)
Here some redundancy tests that may be useful (I use similar ones for aroma.light::weightedMedian): n <- 10 x <- 1:n # No weights m1 <- mean(x) m2 <- weighted.mean(x) stopifnot(all.equal(m1, m2)) # Equal weights on different scales w1 <- rep(1, n) m1 <- weighted.mean(x, w1) w2 <- rep(100, n) m2 <- weighted.mean(x, w2) stopifnot(all.equal(m1,m2)) # Pull the mean towards first value w1[1] <- 5000 m1 <- weighted.mean(x, w1) w2[1] <- 50 m2 <- weighted.mean(x, w2) stopifnot(all.equal(m1,m2)) # Zero weights x <- 1:n w <- rep(1, n) w[8:n] <- 0 m1 <- weighted.mean(x, w) m2 <- mean(x[1:7]) stopifnot(all.equal(m1,m2)) # All weights set to zero x <- 1:n w <- rep(0, n) m1 <- weighted.mean(x, w) m2 <- mean(x[w > 0]) stopifnot(all.equal(m1,m2)) # Missing values x <- 1:n w <- rep(1, n) x[4:5] <- NA m1 <- weighted.mean(x, w, na.rm=TRUE) m2 <- mean(x, na.rm=TRUE) stopifnot(all.equal(m1,m2)) /Henrik On Fri, Oct 30, 2009 at 8:07 AM, Peter Dalgaard wrote: > arn...@hafro.is wrote: >> >> The weighted.mean() function replaces NA values with 0.0 when the user >> specifies na.rm=TRUE: >> >> x <- c(101, 102, NA) >> mean(x, na.rm=TRUE) # 101.5, correct >> weighted.mean(x, na.rm=TRUE) # 67.7, wrong >> weighted.mean(x, w=c(1,1,1), na.rm=TRUE) # 67.7, wrong >> weighted.mean(x, w=c(1,1,1)/3, na.rm=TRUE) # 67.7, wrong >> >> The weights are normalized w<-w/sum(w) before removing the NA values, >> effectively replacing x[is.na(x)]<-0. This bug was introduced between >> versions 2.9.2 and 2.10.0. > > Yes, > > r48644 on May 27, specifically. > > -- > O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B > c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K > (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 > ~~ - (p.dalga...@biostat.ku.dk) FAX: (+45) 35327907 > > __ > 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] evince pdf viewing
In the interest of full disclosure, I did not provide that particular workaround. It came via a thread on r-help back in January: https://stat.ethz.ch/pipermail/r-help/2009-January/185742.html and was then moved to r-devel: https://stat.ethz.ch/pipermail/r-devel/2009-January/051891.html The workaround was posted by Martin in the r-devel part of the thread, which in turn was retrieved from the bug report here: http://bugs.freedesktop.org/show_bug.cgi?id=18002 See comments #8 and #10 in the above. Thanks! Marc Schwartz On Oct 30, 2009, at 4:15 PM, Prof Brian Ripley wrote: Yes, it is known: it is described with workarounds (thanks to Marc Schwarz, AFAIR) on the ?pdf help page. On Fri, 30 Oct 2009, Roger Koenker wrote: It was pointed out to me that scatter plots made on our rhel5 system (sessionInfo() below, have the curious feature that when made with pdf() and viewed with evince show the points as "q" not "o". Is this a known problem with evince? It is pretty clearly not a problem with R, since if I bring the pdf file back to my mac and open in acrobat it looks normal. So this is a just-in-case- someone-else-runs-into-this kind of post. sessionInfo() R version 2.10.0 alpha (2009-10-09 r50012) x86_64-unknown-linux-gnu locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] splines stats graphics grDevices utils datasets methods [8] base other attached packages: [1] survival_2.35-7 quantreg_4.42 SparseM_0.80 loaded via a namespace (and not attached): [1] tools_2.10.0 url:www.econ.uiuc.edu/~rogerRoger Koenker emailrkoen...@uiuc.eduDepartment of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678Urbana, IL 61801 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Brian D. Ripley, rip...@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, UKFax: +44 1865 272595 __ 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] parse_Rd and/or lazyload problem
On 30/10/2009 10:58 PM, mark.braving...@csiro.au wrote: The errors are generated inside lazyLoadDBfetch; I don't call object.size, so unfortunately that's not the issue (unless o.s. is called somewhere inside the .Primitive for lazyLoadDBfetch). Does this happen in R-patched? I've seen similar errors in 2.10.0, but not in a current build. (Still haven't got to your code, this was in mine. I'm reluctant to spend time on code that is messing with internals, because you might be using things in a way not intended by the author. Now, if you can show me some code that demonstrates the problem without using internals directly, I'll follow up.) Duncan Murdoch I'm encountering problems when making lazy-loadable databases of the output from 'parse_Rd'. The lazy- load database is of seemingly limitless size when I try to reload it... Admittedly I am using functions that I'm not really supposed to use, which is why this isn't a bug report, but there does seem to be something strange going on; my code is very similar to code that lives inside 'tools:::.install_package_Rd_objects'. The problems occur with just-released R2.10.0 on Windows. object.size() has problems when working on Rd objects, because it counts every environment separately, even though they may all be references to the same one. I haven't looked at your code, but that could be a problem. Mark From: Duncan Murdoch [murd...@stats.uwo.ca] Sent: 31 October 2009 08:59 To: Bravington, Mark (CMIS, Hobart) Cc: r-devel@r-project.org Subject: Re: [Rd] parse_Rd and/or lazyload problem On 30/10/2009 12:50 AM, mark.braving...@csiro.au wrote: I'm encountering problems when making lazy-loadable databases of the output from 'parse_Rd'. The lazy-load database is of seemingly limitless size when I try to reload it... Admittedly I am using functions that I'm not really supposed to use, which is why this isn't a bug report, but there does seem to be something strange going on; my code is very similar to code that lives inside 'tools:::.install_package_Rd_objects'. The problems occur with just-released R2.10.0 on Windows. object.size() has problems when working on Rd objects, because it counts every environment separately, even though they may all be references to the same one. I haven't looked at your code, but that could be a problem. Duncan Murdoch The examples below use files which can be found at ftp://ftp.csiro.au/MarkBravington, but you'll obviously need to modify the paths. The file "scrunge.Rd" is just "Rdiff.Rd" from the 'tools' package. The file "fakepack.7z" should unzip to create a fake package with a DESCRIPTION file and a "man" directory that contains two Rd files. Transcript of first example: eglist <- list( scrunge=tools:::prepare_Rd( 'd:/temp/scrunge.Rd', defines=.Platform$OS.type, stages='install', warningCalls=FALSE)) tools:::makeLazyLoadDB( eglist, 'd:/temp/ll', compress=FALSE) tools:::fetchRdDB( 'd:/temp/ll') # Error: cannot allocate vector of size 1.4 Gb The second example triggers an error with 'tools:::.install_package_Rd_objects' itself. It doesn't happen the first time, but frequently does after the Rd files have been changed. Transcript: # Make sure d:/temp/help/ is empty, then test> tools:::.install_package_Rd_objects( 'd:/temp/fakepack', 'd:/temp') test> tools:::fetchRdDB( 'd:/temp/help/temp') # All good. Next, I *removed* one of the two Rd files in "d:/temp/fakepack/man", ... # ...deleted "d:/temp/help/temp*", and tried again test> tools:::.install_package_Rd_objects( 'd:/temp/fakepack', 'd:/temp') test> tools:::fetchRdDB( 'd:/temp/help/temp') Warning: Reached total allocation of 1535Mb: see help(memory.size) Warning: Reached total allocation of 1535Mb: see help(memory.size) Warning: Reached total allocation of 1535Mb: see help(memory.size) Warning: Reached total allocation of 1535Mb: see help(memory.size) Error: cannot allocate vector of size 1.9 Gb # Or on other occasions I get Error: internal error -3 in R_decompress1 Mark Bravington CSIRO CMIS Hobart Australia --please do not edit the information below-- Version: platform = i386-pc-mingw32 arch = i386 os = mingw32 system = i386, mingw32 status = major = 2 minor = 10.0 year = 2009 month = 10 day = 26 svn rev = 50208 language = R version.string = R version 2.10.0 (2009-10-26) Windows XP (build 2600) Service Pack 2 Locale: LC_COLLATE=English_Australia.1252;LC_CTYPE=English_Australia.1252;LC_MONETARY=English_Australia.1252;LC_NUMERIC=C;LC_TIME=English_Australia.1252 Search Path: .GlobalEnv, ROOT, package:grDevices, package:ad, package:chstuff, package:handy2, package:tweedie, package:statmod, package:handy, package:debug, package:mvbutils, mvb.session.info, package:tools, package:tcltk, package:stats, package:graphics, package:utils, package:methods, Autoloads, package:base __ R-devel@r-project.org mailing list https://stat.ethz.ch/m
Re: [Rd] quoted strings in foo.Rd rendered as â
On Sat, 31 Oct 2009, Roger Koenker wrote: On Oct 30, 2009, at 4:11 PM, Prof Brian Ripley wrote: First step to check: update to a released version of R 2.10.0! I see the same behavior with: R version 2.10.0 (2009-10-26) x86_64-unknown-linux-gnu locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.10.0 If that does not help, using options(useFancyQuotes = TRUE) in the released version should (but possibly not as far back as your alpha pre-release). And also with options(useFancyQuotes = TRUE) Oops, you want FALSE to suppress it: TRUE is the default. I suspect that whatever you mean my 'my X11 window' (it is the application running in the window that matters, perhaps an xterm?) it is set to the wrong character set. I simply use a Mac terminal window, and that ought to default to UTF-8 (but it can be changed, so check if you try one). Yes, I did mean xterm, and yes in a mac terminal window I do get correct rendering, so maybe I should just give up on xterm entirely, but old habits die hard. On Fri, 30 Oct 2009, Roger Koenker wrote: Another anomaly from our rhel5 system, again sessionInfo() below. When I'm logged in remotely via ssh from my macpro and view documentation files in my X11 window, strings in single quotes in the files are all abbreviated as â . The same files appear fine when rendered in X11 using the local R, and also appear fine in a terminal window on the linux machine, so this could easily also be some sort of ssh/X11 issue not R at all, but if someone had any suggestion for further checking it would be greatly appreciated. Roger sessionInfo() R version 2.10.0 alpha (2009-10-09 r50012) x86_64-unknown-linux-gnu locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] splines stats graphics grDevices utils datasets methods [8] base other attached packages: [1] survival_2.35-7 quantreg_4.42 SparseM_0.80 loaded via a namespace (and not attached): [1] tools_2.10.0 url:www.econ.uiuc.edu/~rogerRoger Koenker emailrkoen...@uiuc.eduDepartment of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678Urbana, IL 61801 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Brian D. Ripley, rip...@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, UKFax: +44 1865 272595 -- Brian D. Ripley, rip...@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, UKFax: +44 1865 272595__ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] unable to compile mgcv
I have been able to compile mgcv 1.5-6 *successfully* on the AIX box with gcc. I replaced all the TRUE/FALSE in magic.c and gdi.c with mgcvTRUE/mgcvFALSE. Thanks to William Dunlap for his help. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] unable to compile RODBC (R 2.9.2, AIX)
Hello -- I am trying to compile (linker error, not compiler error) RODBC for R 2.9.2 on AIX 5.3 using gcc. I get the following error: gcc -maix64 -pthread -std=gnu99 -shared -Wl,-brtl -Wl,-G -Wl,-bexpall -Wl,-bnoentry -lc -L/usr/lib -L/usr/X 11R6/lib -L/usr/local/lib -L/opt/freeware/lib -L/opt/freeware/lib64 -o RODBC.so RODBC.o -lodbc -lm -L/usr/l ocal/builddir/lib -lR ld: 0711-738 ERROR: Input file /usr/lib/libodbc.so: XCOFF32 object files are not allowed in 64-bit mode. collect2: ld returned 8 exit status gmake: *** [RODBC.so] Error 1 ERROR: compilation failed for package 'RODBC' I would appreciate any help I can get in this regard. Thanks. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] promptMethods() in R-2.10.0
I'm trying to improve my package documentation and tried out promptMethods() in R-2.10.0 (Linux 64-bit Ubuntu). It generates an Rd file with an extra \ before signature, such as: \item{\code{\signature(x = "matrix")}}{ ... } generating warnings upon package check such as the following: prepare_Rd: mwhich-methods.Rd:16: unknown macro '\signature' As expected, deleting this \ creates a perfectly reasonable Rd file. Apologies in advance if this has already been reported and fixed; my google search didn't turn up anything, and I didn't remember seeing anything previously on R-devel. Jay -- John W. Emerson (Jay) Associate Professor of Statistics Department of Statistics Yale University http://www.stat.yale.edu/~jay __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] evince pdf viewing
Thanks to all, the suggested fix has cleared this up. Roger On Oct 31, 2009, at 8:02 AM, Marc Schwartz wrote: In the interest of full disclosure, I did not provide that particular workaround. It came via a thread on r-help back in January: https://stat.ethz.ch/pipermail/r-help/2009-January/185742.html and was then moved to r-devel: https://stat.ethz.ch/pipermail/r-devel/2009-January/051891.html The workaround was posted by Martin in the r-devel part of the thread, which in turn was retrieved from the bug report here: http://bugs.freedesktop.org/show_bug.cgi?id=18002 See comments #8 and #10 in the above. Thanks! Marc Schwartz On Oct 30, 2009, at 4:15 PM, Prof Brian Ripley wrote: Yes, it is known: it is described with workarounds (thanks to Marc Schwarz, AFAIR) on the ?pdf help page. On Fri, 30 Oct 2009, Roger Koenker wrote: It was pointed out to me that scatter plots made on our rhel5 system (sessionInfo() below, have the curious feature that when made with pdf() and viewed with evince show the points as "q" not "o". Is this a known problem with evince? It is pretty clearly not a problem with R, since if I bring the pdf file back to my mac and open in acrobat it looks normal. So this is a just-in-case- someone-else-runs-into-this kind of post. sessionInfo() R version 2.10.0 alpha (2009-10-09 r50012) x86_64-unknown-linux-gnu locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] splines stats graphics grDevices utils datasets methods [8] base other attached packages: [1] survival_2.35-7 quantreg_4.42 SparseM_0.80 loaded via a namespace (and not attached): [1] tools_2.10.0 url:www.econ.uiuc.edu/~rogerRoger Koenker emailrkoen...@uiuc.eduDepartment of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678Urbana, IL 61801 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Brian D. Ripley, rip...@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, UKFax: +44 1865 272595 __ 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] quoted strings in foo.Rd rendered as â
On Oct 30, 2009, at 4:11 PM, Prof Brian Ripley wrote: First step to check: update to a released version of R 2.10.0! I see the same behavior with: R version 2.10.0 (2009-10-26) x86_64-unknown-linux-gnu locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.10.0 If that does not help, using options(useFancyQuotes = TRUE) in the released version should (but possibly not as far back as your alpha pre-release). And also with options(useFancyQuotes = TRUE) I suspect that whatever you mean my 'my X11 window' (it is the application running in the window that matters, perhaps an xterm?) it is set to the wrong character set. I simply use a Mac terminal window, and that ought to default to UTF-8 (but it can be changed, so check if you try one). Yes, I did mean xterm, and yes in a mac terminal window I do get correct rendering, so maybe I should just give up on xterm entirely, but old habits die hard. On Fri, 30 Oct 2009, Roger Koenker wrote: Another anomaly from our rhel5 system, again sessionInfo() below. When I'm logged in remotely via ssh from my macpro and view documentation files in my X11 window, strings in single quotes in the files are all abbreviated as â . The same files appear fine when rendered in X11 using the local R, and also appear fine in a terminal window on the linux machine, so this could easily also be some sort of ssh/X11 issue not R at all, but if someone had any suggestion for further checking it would be greatly appreciated. Roger sessionInfo() R version 2.10.0 alpha (2009-10-09 r50012) x86_64-unknown-linux-gnu locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] splines stats graphics grDevices utils datasets methods [8] base other attached packages: [1] survival_2.35-7 quantreg_4.42 SparseM_0.80 loaded via a namespace (and not attached): [1] tools_2.10.0 url:www.econ.uiuc.edu/~rogerRoger Koenker emailrkoen...@uiuc.eduDepartment of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678Urbana, IL 61801 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Brian D. Ripley, rip...@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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] quoted strings in foo.Rd rendered as â
Thanks again, options(useFancyQuotes = FALSE) works perfectly! Roger On Oct 31, 2009, at 12:05 PM, Prof Brian Ripley wrote: On Sat, 31 Oct 2009, Roger Koenker wrote: On Oct 30, 2009, at 4:11 PM, Prof Brian Ripley wrote: First step to check: update to a released version of R 2.10.0! I see the same behavior with: R version 2.10.0 (2009-10-26) x86_64-unknown-linux-gnu locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.10.0 If that does not help, using options(useFancyQuotes = TRUE) in the released version should (but possibly not as far back as your alpha pre-release). And also with options(useFancyQuotes = TRUE) Oops, you want FALSE to suppress it: TRUE is the default. I suspect that whatever you mean my 'my X11 window' (it is the application running in the window that matters, perhaps an xterm?) it is set to the wrong character set. I simply use a Mac terminal window, and that ought to default to UTF-8 (but it can be changed, so check if you try one). Yes, I did mean xterm, and yes in a mac terminal window I do get correct rendering, so maybe I should just give up on xterm entirely, but old habits die hard. On Fri, 30 Oct 2009, Roger Koenker wrote: Another anomaly from our rhel5 system, again sessionInfo() below. When I'm logged in remotely via ssh from my macpro and view documentation files in my X11 window, strings in single quotes in the files are all abbreviated as â . The same files appear fine when rendered in X11 using the local R, and also appear fine in a terminal window on the linux machine, so this could easily also be some sort of ssh/X11 issue not R at all, but if someone had any suggestion for further checking it would be greatly appreciated. Roger sessionInfo() R version 2.10.0 alpha (2009-10-09 r50012) x86_64-unknown-linux-gnu locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] splines stats graphics grDevices utils datasets methods [8] base other attached packages: [1] survival_2.35-7 quantreg_4.42 SparseM_0.80 loaded via a namespace (and not attached): [1] tools_2.10.0 url:www.econ.uiuc.edu/~rogerRoger Koenker emailrkoen...@uiuc.eduDepartment of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678Urbana, IL 61801 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Brian D. Ripley, rip...@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, UKFax: +44 1865 272595 -- Brian D. Ripley, rip...@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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Makevars, cc files in multiple directories
On 29 October 2009 at 11:47, Saptarshi Guha wrote: | Hello, | In the src folder of my R package I have | | a.cc | b.cc | f/g/x.cc | | my Makevars.in has | | all: $(SHLIB) | | upon installing only, a.o and b.o is build and the final dll is | comprised of a.o and b.o | | How can I instruct $(SHLIB) to pick up its source files from all | subdirectories (or maybe a subset, though here it will be all) | in src ? The Matrix package by D Bates and M Maechler has one of the more complex setups, you could study their example. I include the (short) src/Makevars below, it uses the (appropriate) Make directive SUBDIRS. And similar to Paul's suggestionm it seems like static libraries are used to tie the subdirectories together. Hth, Dirk - # -*- Makefile -*- PKG_CPPFLAGS = -I./UFconfig ## we use the BLAS and the LAPACK library: PKG_LIBS = $(SUBLIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) MkInclude = $(R_HOME)/etc${R_ARCH}/Makeconf include scripts/SOURCES_C.mkf OBJECTS = $(SOURCES_C:.c=.o) SUBDIRS = CHOLMOD COLAMD AMD SUBLIBS = $(SUBDIRS:=.a) all: $(SHLIB) ## making src/*.o and in sublibs can be done simultaneously # for development: #$(SHLIB): $(OBJECTS) # for real: $(SHLIB): $(OBJECTS) sublibs ## We have to clean here, to clean up between architectures: ## INSTALL only cleans src/*.o src/*$(SHLIB_EXT) for each arch sublibs: subclean @for d in $(SUBDIRS); do \ (cd $${d} && CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" MkInclude="$(MkInclude)" $(MAKE) library) || exit 1; \ done clean: subclean @-rm -rf .libs _libs @-rm -f *.o $(SHLIB) subclean: @-rm -f *.a @for d in $(SUBDIRS); do \ (cd $${d} && MkInclude="$(MkInclude)" $(MAKE) clean) || exit 1; \ done include scripts/DEPS.mkf - -- Three out of two people have difficulties with fractions. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] unable to compile RODBC (R 2.9.2, AIX)
On Sat, 31 Oct 2009, Chuck White wrote: Hello -- I am trying to compile (linker error, not compiler error) RODBC for R 2.9.2 on AIX 5.3 using gcc. I get the following error: gcc -maix64 -pthread -std=gnu99 -shared -Wl,-brtl -Wl,-G -Wl,-bexpall -Wl,-bnoentry -lc -L/usr/lib -L/usr/X 11R6/lib -L/usr/local/lib -L/opt/freeware/lib -L/opt/freeware/lib64 -o RODBC.so RODBC.o -lodbc -lm -L/usr/l ocal/builddir/lib -lR ld: 0711-738 ERROR: Input file /usr/lib/libodbc.so: XCOFF32 object files are not allowed in 64-bit mode. collect2: ld returned 8 exit status gmake: *** [RODBC.so] Error 1 ERROR: compilation failed for package 'RODBC' I would appreciate any help I can get in this regard. Thanks. It looks simple: apparently you have a 64-bit R and a 32-bit ODBC library (and that's not an R issue, and we don't have enough to go on -- the posting guide does ask for 'at a minimum' information for good reasons). Surely /opt/freeware/lib64 should precede (and hence have priority over) /opt/freeware/lib? We don't know what linker you built gcc with -- some are clever enough to select libraries of the right architecture on e.g. Solaris, but I believe we've seen this before on (not so recent) versions of AIX. -- Brian D. Ripley, rip...@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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] unable to compile RODBC (R 2.9.2, AIX)
On Oct 31, 2009, at 1:13 PM, Chuck White wrote: Hello -- I am trying to compile (linker error, not compiler error) RODBC for R 2.9.2 on AIX 5.3 using gcc. I get the following error: gcc -maix64 -pthread -std=gnu99 -shared -Wl,-brtl -Wl,-G -Wl,- bexpall -Wl,-bnoentry -lc -L/usr/lib -L/usr/X 11R6/lib -L/usr/local/lib -L/opt/freeware/lib -L/opt/freeware/lib64 - o RODBC.so RODBC.o -lodbc -lm -L/usr/l ocal/builddir/lib -lR ld: 0711-738 ERROR: Input file /usr/lib/libodbc.so: XCOFF32 object files are not allowed in 64-bit mode. collect2: ld returned 8 exit status gmake: *** [RODBC.so] Error 1 ERROR: compilation failed for package 'RODBC' I would appreciate any help I can get in this regard. Thanks. I don't have hands-on experience with AIX, but I am going to guess that you have a 32 bit version of unixODBC installed and that is what is being found on your system, raising the error. If you do have a 64 bit version installed, I believe that the path is /usr/lib64, rather than /usr/lib. So you perhaps need to adjust the library paths for the RODBC package configuration and/or if not yet installed, be sure to install a 64 bit version of unixODBC. Additional information is available in the RODBC package vignette, which is available online: http://cran.r-project.org/web/packages/RODBC/vignettes/RODBC.pdf See Appendix A for Installation information. BTW, for future reference, you might want to post to the R-sig-db list: https://stat.ethz.ch/mailman/listinfo/r-sig-db HTH, Marc Schwartz __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] parse_Rd and/or lazyload problem
> Does this happen in R-patched? I've seen similar errors in 2.10.0, but > not in a current build. Yes, still there in R-patched. (Still haven't got to your code, this was in > mine. I'm reluctant to spend time on code that is messing with > internals, because you might be using things in a way not intended by > the author. Now, if you can show me some code that demonstrates the > problem without using internals directly, I'll follow up.) I did try, but it's not completely possible, because 'makeLazyLoadDB' is internal and there is no public alternative (a pity-- it's useful). However, the problem(s) can be demonstrated without directly calling 'parse_Rd', and with 'lazyLoad' (public) instead of 'fetchRdDB' (private), as per "pointer 1" below. If you have a look at 'tools:::.install_package_Rd_objects', you'll see that my use of 'makeLazyLoadDB' is quite standard. The problem is not easy to reproduce. It took 4-5 hours work to get the 3-line reproducible example that I posted, plus another couple since, so I'm also reluctant to spend more time... The examples in my previous post still apply-- the first one involves just 3 statements-- but here are some more pointers I've unearthed since: 1. Sometimes 'fetchRdDB' or 'lazyLoad' called directly from the prompt doesn't work, but public 'Rd_db' (which directly calls 'fetchRdDB') does. I've experimented with copying the installed 'tools' package into a new library "d:/temp/fakelib", then stuff like this: test> e <- new.env() test> lazyLoad( 'd:/temp/fakelib/tools/help/tools', e) # original files tools.rdx, tools.rdb test> e <- as.list( e) # force evaluation test> tools:::makeLazyLoadDB( e, 'd:/temp/fakelib/tools/help/tools') # modify tools.rd* test> e1 <- new.env() test> lazyLoad( 'd:/temp/fakelib/tools/help/tools', e1) test> as.list( e1) # try to force evaluation... Error in as.list.environment(e1) : cannot allocate memory block of size 2.7 Gb test> test> Rd_db( 'tools', 'd:/temp/fakelib') # no probs !? 2. Sometimes 'fetchRdDB' or 'lazyLoad' will fail in one R session, but will work in a fresh session on exactly the same files. For example, after restarting R, the previous commands involving 'e1' work fine. Mark > > Duncan Murdoch > > >>> I'm encountering problems when making lazy-loadable databases of the output >>> from 'parse_Rd'. The lazy- >>> load database is of seemingly limitless size when I try to reload it... >>> Admittedly I am using functions >>> that I'm not really supposed to use, which is why this isn't a bug report, >>> but there does seem to be >>> something strange going on; my code is very similar to code that lives >>> inside >>> 'tools:::.install_package_Rd_objects'. The problems occur with >>> just-released R2.10.0 on Windows. >> object.size() has problems when working on Rd objects, because it counts >> every environment separately, even though they may all be references to >> the same one. I haven't looked at your code, but that could be a problem. >> >> > > Mark > > > From: Duncan Murdoch [murd...@stats.uwo.ca] > Sent: 31 October 2009 08:59 > To: Bravington, Mark (CMIS, Hobart) > Cc: r-devel@r-project.org > Subject: Re: [Rd] parse_Rd and/or lazyload problem > > On 30/10/2009 12:50 AM, mark.braving...@csiro.au wrote: >> I'm encountering problems when making lazy-loadable databases of the output >> from 'parse_Rd'. The lazy-load database is of seemingly limitless size when >> I try to reload it... Admittedly I am using functions that I'm not really >> supposed to use, which is why this isn't a bug report, but there does seem >> to be something strange going on; my code is very similar to code that lives >> inside 'tools:::.install_package_Rd_objects'. The problems occur with >> just-released R2.10.0 on Windows. > > object.size() has problems when working on Rd objects, because it counts > every environment separately, even though they may all be references to > the same one. I haven't looked at your code, but that could be a problem. > > Duncan Murdoch > >> The examples below use files which can be found at >> ftp://ftp.csiro.au/MarkBravington, but you'll obviously need to modify the >> paths. The file "scrunge.Rd" is just "Rdiff.Rd" from the 'tools' package. >> The file "fakepack.7z" should unzip to create a fake package with a >> DESCRIPTION file and a "man" directory that contains two Rd files. >> >> Transcript of first example: >> eglist <- list( scrunge=tools:::prepare_Rd( 'd:/temp/scrunge.Rd', >> defines=.Platform$OS.type, stages='install', warningCalls=FALSE)) >> tools:::makeLazyLoadDB( eglist, 'd:/temp/ll', compress=FALSE) >> tools:::fetchRdDB( 'd:/temp/ll') >> # Error: cannot allocate vector of size 1.4 Gb >> >> The second example triggers an error with >> 'tools:::.install_package_Rd_objects' itself. It doesn't happen the first >> time, but frequently does after the Rd files have been changed. Transcript: >> >> # Make sure d:/temp/
[Rd] Internal error in 'ls' for pathological environments (PR#14035)
nchar(with(list(2),ls())) gives an internal error. This is of course a peculiar call (no names in the list), but the error is not caught cleanly. It is not clear from the documentation whether with(list(2)...) is allowable; if it is not, it should presumably give an error. If it is, then ls shouldn't have problems with the resulting environment. > qq <- with(list(2),ls()) # An incorrect call (no names in list) > nchar(qq) Error in nchar(qq) : 'getEncChar' must be called on a CHARSXP # ls returned a bad object > qq [1]Error: 'getEncChar' must be called on a CHARSXP > qq[1] [1]Error: 'getEncChar' must be called on a CHARSXP > qq[2] [1] NA Apparently related: > with(list(a=1,2),ls()) Error in ls() : 'getEncChar' must be called on a CHARSXP --please do not edit the information below-- Version: platform = i386-pc-mingw32 arch = i386 os = mingw32 system = i386, mingw32 status = major = 2 minor = 9.2 year = 2009 month = 08 day = 24 svn rev = 49384 language = R version.string = R version 2.9.2 (2009-08-24) Windows Vista x64 (build 6002) Service Pack 2 Locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 Search Path: .GlobalEnv, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, package:methods, Autoloads, package:base [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel