Re: [Rd] section needed in FAQ - Using R (PR#9698)
[EMAIL PROTECTED] wrote: > By the way, the R program itself is really badly in need of an "appropos()" to > go alongside "help()". Perhaps "help()" can be renamed to "hunt()" or > "huntAndPeck()". > > help.search("appropos") -- 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 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] setIs-relation does not entail automatic coercion in S4 method dispatch --- should it?
Hi R-devels, I am a bit puzzled about when/if "setIs-conditional" coercion is performed in S4 method dispatch. Setup: Myclass1 setIs()-conditionally is inheriting from Myclass2. My first guess would have been: If the corresponding test clause in setIs() is TRUE and there is no Myclass1-method foo() but a Myclass2-method foo(), a call to foo() with a corresponding Myclass1 instance as argument automatically coerce this instance to Myclass2 using the coerce function in setIs(). It does not; (consider the example below). I am pretty sure that there are good reasons for this behaviour, but could you give me arguments why this automatic coercion should not be a good idea? ### ## Begin of example ### setClass("Myclass1",representation(a="numeric")) setClass("Myclass2",representation(b="numeric")) ### conditional inheritance by setIs setIs("Myclass1", "Myclass2", test = function(obj) [EMAIL PROTECTED]>0, coerce = function(obj) {cat("setIs coercion used\n")## does not seem to be used for new("Myclass2", [EMAIL PROTECTED]) }, ## automatic coercion replace = function(obj, value) {cat("setIs replacement used\n") ## does not seem to be used... new("Myclass2", [EMAIL PROTECTED]) }) ### accessor to slot b if(!isGeneric("b")) setGeneric("b", function(object) standardGeneric("b")) setMethod("b","Myclass2", function(object) [EMAIL PROTECTED]) ### a method for Myclass2 if(!isGeneric("foo")) setGeneric("foo", function(object) standardGeneric("foo")) setMethod("foo","Myclass2",function(object)cat("Myclass2-fct:",b(object),"\n")) ### selectMethod("foo","Myclass2") ### does find foo-method for class Myclass2 as expected selectMethod("foo","Myclass1") ### does find foo-method for class Myclass2 as expected ## an instance of Myclass1 MyC1 <- new("Myclass1",a=2) MyC1.0 <- new("Myclass1",a=-2) ### implicit coercion using setIs coerce function does not work as I would have expected: foo(MyC1) ### does not coerce MyC1 to Myclass2 although possible foo(MyC1.0) ### as expected: does not coerce as not possible ### explicit coercion: foo(as(MyC1,"Myclass2")) ### works as expected: uses foo-method for class Myclass2 foo(as(MyC1.0,"Myclass2")) ### works as expected: error as not coercable ### way out? setMethod("b","Myclass1", function(object) if ([EMAIL PROTECTED]>0) [EMAIL PROTECTED] else stop("not coercable to class Myclass2") ) foo(MyC1) ### works as expected: uses foo-method for class Myclass2 foo(MyC1.0) ### works as expected: error as not coercable ### ## End of example ### Any suggestion appreciated thanks already Peter __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] bug? in first plot
Started as -vanilla R version 2.6.0 Under development (unstable) (2007-04-30 r41390) Copyright (C) 2007 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. 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. > search() [1] ".GlobalEnv""package:stats" "package:graphics" "package:grDevices" "package:utils" "package:datasets" "package:methods" [8] "Autoloads" "package:base" > plot(1:10, 1:10) plots only left upper corner of a plot at a first attempt. When I issue a second command, the plot is OK. I wonder if it is system or machine specific or if it is really a bug in R. No problem but should be fixed before it will go out as a new version. Sys.info() sysname releaseversion nodename machine "Windows" "NT 5.1" "(build 2600) Service Pack 2" Regards Petr Pikal [EMAIL PROTECTED] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] bug? in first plot
Please, that is a serious old version of R-devel and we are now on r41655. I don't see it on a recent version (and actually I have never seen it). On Mon, 21 May 2007, Petr PIKAL wrote: > Started as -vanilla > > R version 2.6.0 Under development (unstable) (2007-04-30 r41390) > Copyright (C) 2007 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. > > 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. > >> search() > [1] ".GlobalEnv""package:stats" "package:graphics" > "package:grDevices" "package:utils" "package:datasets" > "package:methods" > [8] "Autoloads" "package:base" >> plot(1:10, 1:10) > > plots only left upper corner of a plot at a first attempt. When I issue a > second command, the plot is OK. I wonder if it is system or machine > specific or if it is really a bug in R. No problem but should be fixed > before it will go out as a new version. > > Sys.info() > sysname releaseversion > nodename machine >"Windows" "NT 5.1" "(build 2600) > Service Pack 2" > > > Regards > > Petr Pikal > [EMAIL PROTECTED] > > __ > 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] section needed in FAQ - Using R (PR#9698)
There are also R reference cards and other quick- and kick-starting manuals, mentioned in the documentation. Ray Kiddy-2 wrote: > > There is no section in the FAQ equivalent to "Using R". The "R Basics" is > too > basic. I would say it addresses "meta-R" questions, such as installing. > > I had a FAQ that I would think would be a basic "Using R" question, > namely: "How > does one generate random numbers?". It is actually non-trivial to answer > this if > one is new to R, as there are too many hits for "Random" and they dive too > deeply. > > My answer to this FAQ would be: > > In order to generate random numbers, there are "r" methods for every > distribution. Distributions include Uniform (runif), Binomial (rbinom), > Normal > (rnorm), Cauchy (rcauchy), Chi Square (rchisq), Exponential (rexp), Gamma > (rgamma), and many more. > > By the way, the R program itself is really badly in need of an > "appropos()" to > go alongside "help()". Perhaps "help()" can be renamed to "hunt()" or > "huntAndPeck()". > -- View this message in context: http://www.nabble.com/section-needed-in-FAQ---Using-R-%28PR-9698%29-tf3788564.html#a10717487 Sent from the R devel mailing list archive at Nabble.com. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] section needed in FAQ - Using R (PR#9698)
Dear Peter and Ray, I think that Ray's problem finding apropos is that "apropos" has one "p." Interestingly, help.search("appropos") (as suggested by Peter) is able to accommodate the spelling error. Regards, John John Fox, Professor Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Peter Dalgaard > Sent: Monday, May 21, 2007 3:15 AM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [Rd] section needed in FAQ - Using R (PR#9698) > > [EMAIL PROTECTED] wrote: > > By the way, the R program itself is really badly in need of an > > "appropos()" to go alongside "help()". Perhaps "help()" can > be renamed > > to "hunt()" or "huntAndPeck()". > > > > > help.search("appropos") > > -- >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 > ~~ - ([EMAIL PROTECTED]) 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
[Rd] Passing R CMD Check without data
I have a package which passes R CMD check with the --no-vignettes option. However, it does not pass the check without that, as the vignette relies on some data files that I cannot distribute. However, I would like the package to pass the check so that I can put it on CRAN, so that other people with access to the dataset can put the data into the package, and then rebuild the vignettes themselves. One solution that was suggested to me on r-help was to have the vignette read off tex from a pre-built file which can be compiled with Sweave previously. However, this isnt really a graceful solution to handle the problem. Is it possible to put something in the Rnw file which would make it pass R CMD check even without the data? (I.E. it checks for the data, if it is present then it rebuilds the vignette, if not, then R CMD check leaves it alone) Sincerely, Arjun Ravi Narayan [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] readLines needs some extra bit of documentation.
I have a need to use readLines to read just the first line of a file and do some processing on that, and read and re-read ?readLines and did not see any mention of whether the actual end-of-line character (LF, CR/LF or CR) is included as part of the returned character vector or not. I just tried it and and it seems that it strips the EOL characters - so it is obvious as soon as one tries it, but I was hoping that it should be mentioned ?readLines (e.g. "The actual EOL character(s) are striped and not included as part of the returned character vector"). The reason why I was specifically looking for that information is that, in perl, the line-input operator, , returns character vectors with the EOL included, and is opposite to that of R. I know I cannot compare apple with orange, and R's readLines() behavior is obvious as soon as one tries it, but an explicit sentence in the help page would be nice... HTL __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] AIX testers needed
Thank you for responding. I should have added -a on my ulimit command. Here are its results; which I believe are not the limiting factor. %/ > ulimit -a core file size(blocks, -c) 1048575 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max memory size (kbytes, -m) 32768 open files(-n) 2000 pipe size (512 bytes, -p) 64 stack size(kbytes, -s) hard cpu time (seconds, -t) unlimited max user processes(-u) 128 virtual memory(kbytes, -v) unlimited Here are my gcc-v results. They are very similiar. %/ > gcc -v Using built-in specs. Target: powerpc-ibm-aix5.3.0.0 Configured with: ../gcc-4.1.2/configure --prefix=/opt/sas/msd/home/barnharj/usr/local --program-suffix=-4.1.2 --enable-threads=aix --enable-languages=c,c++,fortran --disable-nls --with-mpfr=/opt/sas/msd/home/barnharj/usr/local --with-gmp=/opt/sas/msd/home/barnharj/usr/local Thread model: aix gcc version 4.1.2 My results for gcc -print-multi-lib are indentical to yours. It should be noted that I did not attempt a 64 bit build. My system is not configured properly for that just yet. Via private correspondence someone also suggested the following system("ulimit -d unlimited") during an R session. That failed as did issuing the command before launching R. I'll keep investigating. My call to configure is listed below. /configure --prefix=$HOME/usr/local --program-suffix=rc --with-readline=no --with-x=no --enable-memory-profiling - Original Message - From: "Ei-ji Nakama" <[EMAIL PROTECTED]> To: "Jason Barnhart" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, May 19, 2007 6:53 PM Subject: Re: [Rd] AIX testers needed > Hi. > > system("ulimit") of AIX gives back file block size. > A limit of memory is `ulimit -m'. > > I made gcc-4.1.2 and made R-2.5.0+patched, but the problem did not > happen. > > $ gcc-4.1 -v > Using built-in specs. > Target: powerpc-ibm-aix5.2.0.0 > Configured with: ../configure --with-as=/usr/bin/as > --with-ld=/usr/bin/ld --disable-nls --prefix=/usr/local1/gcc-4.1.2 > --enable-threads --host=powerpc-ibm-aix5.2.0.0 --program-suffix=-4.1 > --with-gmp=/usr/local1 --with-mpfr=/usr/local1 > --enable-languages=c,c++,f95 > Thread model: aix > gcc version 4.1.2 > > $ gcc-4.1 -print-multi-lib > .; > pthread;@pthread > ppc64;@maix64 > pthread/ppc64;@[EMAIL PROTECTED] > > $ export OBJECT_MODE=64 > $ ./configure CC="gcc-4.1 -maix64" \ > F77="gfortran-4.1 -maix64" \ > CXX="g++-4.1 -maix64" \ > --enable-BLAS-shlib --without-iconv > > > 2007/5/19, Jason Barnhart <[EMAIL PROTECTED]>: >> Per the request to test the latest tarball referenced below, I have >> built R on AIX 5.3. There is a memory issue, please see 3) below. >> >> 1) Build with --enable-BLAS-shlib option. Builds and >> passes "make check". >> >> 2) GNU libiconv was installed; R configured *without* >> the --without- >> iconv option. Builds and passes "make check." >> >> 3) Memory issue: >> a) Although the server possesses 8GB of RAM and >> system("ulimit") returns "unlimited" as its value, R does >> not >> "have enough memory." >> >> b) This code works on R-2.4.0 on WinXP with 2GB of RAM, but >> fails on the AIX build. Example code: >> >> > xx <- matrix(rep(1e+10,1e7),nrow=1e4,ncol=1e3) >> > tmp.df <- as.data.frame(cbind(xx,xx,xx)) >> Error: cannot allocate vector of size 228.9 Mb >> > gc() >>used (Mb) gc trigger (Mb) max used (Mb) >> Ncells 233035 6.3 467875 12.5 35 9.4 >> Vcells 10104141 77.1 31854441 243.1 30104289 229.7 >> >> 4) Used gcc-4.1.2; I have not tried the native compiler. >> >> Questions: >> >> 1) Are there suggestions on how to diagnose and resolve the >> memory >> issue? I'm still building my tool chain and I am in the midst >> of >> installing gdb. >> >> 2) Regarding the build process itself, is there more >> documentation >> or results that I should forward? >> >> Thanks, >> -jason >> >> >> > version _ >> platform powerpc-ibm-aix5.3.0.0 >> arch powerpc >> os aix5.3.0.0 >> system powerpc, aix5.3.0.0 >> status RC >> major 2 >> minor 5.0 >> year 2007 >> month 04 >> day22 >> svn rev41276 >> language R >> version.string R version 2.5.0 RC (2007-04-22 r41276) >> >> >> - Original Message - >> From: "Prof Brian Ripley" <[EMAIL PROTECTED]> >> To: >> Cc: "Sheth, Jagat K" <[EMAIL PROTECTED]>; "kamil >> Marcinkowski" <[EMAIL PROTECTED]>; "Tiong Lim" >> <[EMAIL PROTECTED]>; >> "Eric Harley" <[EMAIL PROTECTED]>; "Matthew Beason" >> <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> >> Sent: Wednesday, March 28, 2007 11:27 PM >> Subject: [Rd] AIX t
Re: [Rd] AIX testers needed
Jason Barnhart wrote: > Thank you for responding. > > I should have added -a on my ulimit command. Here are its results; > which I believe are not the limiting factor. > > %/ > ulimit -a > core file size(blocks, -c) 1048575 > data seg size (kbytes, -d) unlimited > file size (blocks, -f) unlimited > max memory size (kbytes, -m) 32768 > open files(-n) 2000 > pipe size (512 bytes, -p) 64 > stack size(kbytes, -s) hard > cpu time (seconds, -t) unlimited > max user processes(-u) 128 > virtual memory(kbytes, -v) unlimited you think max memory = 32768k (or 32MB) is not limiting? Please think again... HTL __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] section needed in FAQ - Using R (PR#9698)
Dear, My spelling correction was poorly phrased, since there are actually two p's in "apropos," but there aren't two adjacent p's. I agree that a reference to apropos on the help page for help is a good idea. Regards, John John Fox, Professor Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox > -Original Message- > From: Ray Kiddy [mailto:[EMAIL PROTECTED] > Sent: Monday, May 21, 2007 1:57 PM > To: John Fox > Cc: 'Peter Dalgaard'; [EMAIL PROTECTED] > Subject: Re: [Rd] section needed in FAQ - Using R (PR#9698) > > > On May 21, 2007, at 5:59 AM, John Fox wrote: > > > Dear Peter and Ray, > > > > I think that Ray's problem finding apropos is that > "apropos" has one > > "p." > > Interestingly, help.search("appropos") (as suggested by > Peter) is able > > to accommodate the spelling error. > > > > Regards, > > John > > > > > > John Fox, Professor > > Thanks for your information. I see I was spelling it wrong. > > Can I make the suggestion that if one does "help(help)", > which I tried, that the page should mention "apropos". > Perhaps in the "See Also" section. > > This was a mistake on my part, but documentation can be > helpful in response to user mistakes, rather than fragile. > > thanx - ray > > > > >> -Original Message- > >> From: [EMAIL PROTECTED] > >> [mailto:[EMAIL PROTECTED] On Behalf Of Peter Dalgaard > >> Sent: Monday, May 21, 2007 3:15 AM > >> To: [EMAIL PROTECTED] > >> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] > >> Subject: Re: [Rd] section needed in FAQ - Using R (PR#9698) > >> > >> [EMAIL PROTECTED] wrote: > >>> By the way, the R program itself is really badly in need of an > >>> "appropos()" to go alongside "help()". Perhaps "help()" can > >> be renamed > >>> to "hunt()" or "huntAndPeck()". > >>> > >>> > >> help.search("appropos") > >> > >> -- > >>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 > >> ~~ - ([EMAIL PROTECTED]) 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] AIX testers needed
Thanks for responding. I don't think it's that simple. That's a soft limit, the hard limit is "unlimited." The results of gc() in the original post indicated that R could utililize more than 32MB of RAM. My sysadmin had already increased my memory limits prior to my posting. Just to confirm here are the results with ulimit -m set to unlimited prior to calling R. > xx <- matrix(rep(1e+10,1e7),nrow=1e4,ncol=1e3) > object.size(xx)/1024^2 [1] 76.29405 > system("ulimit -m") unlimited > tmp.df <- as.data.frame(cbind(xx,xx,xx)) Error: cannot allocate vector of size 228.9 Mb - Original Message - From: "Hin-Tak Leung" <[EMAIL PROTECTED]> To: "Jason Barnhart" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, May 21, 2007 11:02 AM Subject: Re: [Rd] AIX testers needed > Jason Barnhart wrote: >> Thank you for responding. >> >> I should have added -a on my ulimit command. Here are its results; >> which I believe are not the limiting factor. >> >> %/ > ulimit -a >> core file size(blocks, -c) 1048575 >> data seg size (kbytes, -d) unlimited >> file size (blocks, -f) unlimited >> max memory size (kbytes, -m) 32768 >> open files(-n) 2000 >> pipe size (512 bytes, -p) 64 >> stack size(kbytes, -s) hard >> cpu time (seconds, -t) unlimited >> max user processes(-u) 128 >> virtual memory(kbytes, -v) unlimited > > you think max memory = 32768k (or 32MB) is not limiting? > Please think again... > > HTL > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] section needed in FAQ - Using R (PR#9698)
John Fox wrote: > Dear, > > My spelling correction was poorly phrased, since there are actually two p's > in "apropos," but there aren't two adjacent p's. > > I agree that a reference to apropos on the help page for help is a good > idea. > > Of course, except that it is unclear that the original post wasn't actually looking for help.search, which is already in the See Also of help(help) (and of help(), for that matter). __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] dev.interactive() changes
On 5/5/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: [...] > You meam as in > > o dev.interactive() regards devices with the displaylist enabled > as interactive, and packages can register the names of their > devices as interactive via deviceIsInteractive(). > > ? Quick follow up: the displaylist based detection is working well, but deviceIsInteractive() gives me an error: > deviceIsInteractive("QT") Error in deviceIsInteractive("QT") : cannot change value of locked binding for '.known_interactive.devices' > sessionInfo() R version 2.6.0 Under development (unstable) (2007-05-21 r41658) i686-pc-linux-gnu This happens interactively as well as in package loading code. -Deepayan __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] section needed in FAQ - Using R (PR#9698)
>> >> By the way, the R program itself is really badly in need of an >> "appropos()" to >> I don't normally pick on spelling errors and my reply is out of sequence because I deleted the Peter's message replying on this. ?appropos will give a not found reply ?apropos will give some useful information David Scott _ David Scott Department of Statistics, Tamaki Campus The University of Auckland, PB 92019 Auckland 1142,NEW ZEALAND Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000 Email: [EMAIL PROTECTED] Graduate Officer, Department of Statistics Director of Consulting, Department of Statistics __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Passing R CMD Check without data
"Arjun Ravi Narayan" <[EMAIL PROTECTED]> writes: > I have a package which passes R CMD check with the --no-vignettes option. > However, it does not pass the check without that, as the vignette relies on > some data files that I cannot distribute. However, I would like the package > to pass the check so that I can put it on CRAN, so that other people with > access to the dataset can put the data into the package, and then rebuild > the vignettes themselves. I would recommend having a separate vignette that uses toy data, if that is all that is available, that demonstrates the basic use of the package. A consider part of the value of a package vignette, IMHO, is having something that (i) the user can run interactively on their own, and (ii) can be automatically checked. Your current vignette can be included as pdf (the Rnw could live in another place under inst/). You might also look at the vsn package in Bioconductor which uses a Makefile to avoid R CMD check from building its vignette because it is too time consuming... + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] relist, an inverse operator to unlist
Hi Andrew, Andrew Clausen <[EMAIL PROTECTED]> writes: > For reasons I can't explain, the code I posted worked in my session, but > didn't > work when I started a fresh one. standardGeneric() seems to get confused > by defaults for missing arguments. It looks for a "missing" method with > this code: > > relist <- function(flesh, skeleton=attr(flesh, "skeleton")) > { > standardGeneric("relist") > } This looks very odd to me. If you are creating an S4 generic function, why are you not calling setGeneric? Or has that part of the code simply been omitted from your post? I will also add that the notion of a default argument on a generic function seems a bit odd to me. If an argument is available for dispatch, I just don't see what sense it makes to have a default. In those cases, the default should be handled by the method that has a signature with said argument matching the "missing" class. What often does make sense is to define a generic function where some argument are not available for dispatch. For example: setGeneric("foo", signature="flesh", function(flesh, skeleton=attr(flesh, "skeleton") standardGeneric("foo"))) + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] AIX testers needed
Hi. I was not careful to 32bit very much. You can expand memory for data to 2G by LDR_CNTRL. It is as follows. LDR_CNTRL="MAXDATA=0x1000" 1 256 MB LDR_CNTRL="MAXDATA=0x2000" 2 512 MB LDR_CNTRL="MAXDATA=0x3000" 3 768 MB LDR_CNTRL="MAXDATA=0x4000" 4 1024 MB LDR_CNTRL="MAXDATA=0x5000" 5 1280 MB LDR_CNTRL="MAXDATA=0x6000" 6 1536 MB LDR_CNTRL="MAXDATA=0x7000" 7 1792 MB LDR_CNTRL="MAXDATA=0x8000" 8 2048 MB try. $ export LDR_CNTRL="MAXDATA=0x8000" $ R -q > xx <- matrix(rep(1e+10,1e7),nrow=1e4,ncol=1e3) > tmp.df <- as.data.frame(cbind(xx,xx,xx)) > 2007/5/22, Jason Barnhart <[EMAIL PROTECTED]>: > Thank you for responding. > > I should have added -a on my ulimit command. Here are its results; > which I believe are not the limiting factor. > > %/ > ulimit -a > core file size(blocks, -c) 1048575 > data seg size (kbytes, -d) unlimited > file size (blocks, -f) unlimited > max memory size (kbytes, -m) 32768 > open files(-n) 2000 > pipe size (512 bytes, -p) 64 > stack size(kbytes, -s) hard > cpu time (seconds, -t) unlimited > max user processes(-u) 128 > virtual memory(kbytes, -v) unlimited > > Here are my gcc-v results. They are very similiar. > > %/ > gcc -v > Using built-in specs. > Target: powerpc-ibm-aix5.3.0.0 > Configured with: ../gcc-4.1.2/configure > --prefix=/opt/sas/msd/home/barnharj/usr/local > --program-suffix=-4.1.2 > --enable-threads=aix > --enable-languages=c,c++,fortran > --disable-nls > --with-mpfr=/opt/sas/msd/home/barnharj/usr/local > --with-gmp=/opt/sas/msd/home/barnharj/usr/local > Thread model: aix > gcc version 4.1.2 > > My results for gcc -print-multi-lib are indentical to yours. > > It should be noted that I did not attempt a 64 bit build. My system > is not configured properly for that just yet. > > Via private correspondence someone also suggested the following > system("ulimit -d unlimited") during an R session. That failed as did > issuing the command before launching R. > > I'll keep investigating. > > My call to configure is listed below. > > /configure --prefix=$HOME/usr/local --program-suffix=rc --with-readline=no > --with-x=no --enable-memory-profiling > > > - Original Message - > From: "Ei-ji Nakama" <[EMAIL PROTECTED]> > To: "Jason Barnhart" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Saturday, May 19, 2007 6:53 PM > Subject: Re: [Rd] AIX testers needed > > > > Hi. > > > > system("ulimit") of AIX gives back file block size. > > A limit of memory is `ulimit -m'. > > > > I made gcc-4.1.2 and made R-2.5.0+patched, but the problem did not > > happen. > > > > $ gcc-4.1 -v > > Using built-in specs. > > Target: powerpc-ibm-aix5.2.0.0 > > Configured with: ../configure --with-as=/usr/bin/as > > --with-ld=/usr/bin/ld --disable-nls --prefix=/usr/local1/gcc-4.1.2 > > --enable-threads --host=powerpc-ibm-aix5.2.0.0 --program-suffix=-4.1 > > --with-gmp=/usr/local1 --with-mpfr=/usr/local1 > > --enable-languages=c,c++,f95 > > Thread model: aix > > gcc version 4.1.2 > > > > $ gcc-4.1 -print-multi-lib > > .; > > pthread;@pthread > > ppc64;@maix64 > > pthread/ppc64;@[EMAIL PROTECTED] > > > > $ export OBJECT_MODE=64 > > $ ./configure CC="gcc-4.1 -maix64" \ > > F77="gfortran-4.1 -maix64" \ > > CXX="g++-4.1 -maix64" \ > > --enable-BLAS-shlib --without-iconv > > > > > > 2007/5/19, Jason Barnhart <[EMAIL PROTECTED]>: > >> Per the request to test the latest tarball referenced below, I have > >> built R on AIX 5.3. There is a memory issue, please see 3) below. > >> > >> 1) Build with --enable-BLAS-shlib option. Builds and > >> passes "make check". > >> > >> 2) GNU libiconv was installed; R configured *without* > >> the --without- > >> iconv option. Builds and passes "make check." > >> > >> 3) Memory issue: > >> a) Although the server possesses 8GB of RAM and > >> system("ulimit") returns "unlimited" as its value, R does > >> not > >> "have enough memory." > >> > >> b) This code works on R-2.4.0 on WinXP with 2GB of RAM, but > >> fails on the AIX build. Example code: > >> > >> > xx <- matrix(rep(1e+10,1e7),nrow=1e4,ncol=1e3) > >> > tmp.df <- as.data.frame(cbind(xx,xx,xx)) > >> Error: cannot allocate vector of size 228.9 Mb > >> > gc() > >>used (Mb) gc trigger (Mb) max used (Mb) > >> Ncells 233035 6.3 467875 12.5 35 9.4 > >> Vcells 10104141 77.1 31854441 243.1 30104289 229.7 > >> > >> 4) Used gcc-4.1.2; I have not tried the native compiler. > >> > >> Questions: > >> > >> 1) Are there suggestions on how to diagnose and resolve the > >> memory > >> issue? I'm still building my tool chain and I am in the midst > >> of > >> installing gdb. > >
Re: [Rd] dev.interactive() changes
Thanks, it should work now. On Mon, 21 May 2007, Deepayan Sarkar wrote: > On 5/5/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > > [...] > >> You meam as in >> >> o dev.interactive() regards devices with the displaylist enabled >> as interactive, and packages can register the names of their >> devices as interactive via deviceIsInteractive(). >> >> ? > > Quick follow up: the displaylist based detection is working well, but > deviceIsInteractive() gives me an error: > >> deviceIsInteractive("QT") > Error in deviceIsInteractive("QT") : cannot change value of locked > binding for '.known_interactive.devices' >> sessionInfo() > R version 2.6.0 Under development (unstable) (2007-05-21 r41658) > i686-pc-linux-gnu > > This happens interactively as well as in package loading code. > > -Deepayan > > __ > 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] section needed in FAQ - Using R (PR#9698)
On May 21, 2007, at 5:59 AM, John Fox wrote: > Dear Peter and Ray, > > I think that Ray's problem finding apropos is that "apropos" has > one "p." > Interestingly, help.search("appropos") (as suggested by Peter) is > able to > accommodate the spelling error. > > Regards, > John > > > John Fox, Professor Thanks for your information. I see I was spelling it wrong. Can I make the suggestion that if one does "help(help)", which I tried, that the page should mention "apropos". Perhaps in the "See Also" section. This was a mistake on my part, but documentation can be helpful in response to user mistakes, rather than fragile. thanx - ray > >> -Original Message- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of Peter Dalgaard >> Sent: Monday, May 21, 2007 3:15 AM >> To: [EMAIL PROTECTED] >> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] >> Subject: Re: [Rd] section needed in FAQ - Using R (PR#9698) >> >> [EMAIL PROTECTED] wrote: >>> By the way, the R program itself is really badly in need of an >>> "appropos()" to go alongside "help()". Perhaps "help()" can >> be renamed >>> to "hunt()" or "huntAndPeck()". >>> >>> >> help.search("appropos") >> >> -- >>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 >> ~~ - ([EMAIL PROTECTED]) 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
[Rd] list element names in S4 class extending list
can list names attributes be preserved through S4 class containment? seems to be so but only if the containment relationship is direct ... see below. > setClass("c1", contains="list") [1] "c1" > l1 = list(a=1, b=2) > o1 = new("c1", l1) > names(o1) # pleasant surprise [1] "a" "b" > setClass("c2", contains="c1") [1] "c2" > o2 = new("c2", l1) > names(o2) # sad NULL > sessionInfo() R version 2.6.0 Under development (unstable) (2007-05-11 r41535) powerpc-apple-darwin8.9.0 locale: C attached base packages: [1] "stats" "graphics" "grDevices" "utils" "datasets" "methods" [7] "base" __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel