Re: [Rd] (PR#9577) bug and patch: strptime first-of-month error in (possibly unsupported use of) "%j" format
The aim was to fix up some unsupported cases in glibc and related implementations, and clearly we only managed to do so partially. Thank you: I've applied the change (and a regression test) to 2.5.0-to-be. On Wed, 21 Mar 2007, [EMAIL PROTECTED] wrote: > Full_Name: John Brzustowski > Version: R-devel-trunk > OS: linux (problem under Windows too) > Submission from: (NULL) (74.101.124.238) > > > (This bug was discovered by Phil Taylor, Acadia University.) > I'm not sure from reading the documentation whether strptime(x, "%j") is meant > to be supported, but if so, there is a bug which prevents it from working on > the > first day of months after January: > >> strptime(31:33, "%j") > [1] "2007-01-31" NA "2007-02-02" > > # the full extent of R's taunting > strptime(1 + cumsum(c(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30)), "%j") > [1] NA NA NA NA NA NA NA NA NA NA NA >> > > The problem is an edge-case comparison in datetime.c:glibc_fix(). This > generates a date like "Jan 32", which validate_tm() catches and NAs. > (Values of field tm->tm_yday start at 0, not 1.) > = > PATCH: > > --- R/src/main/datetime.c (revision 40860) > +++ R/src/main/datetime.c (working copy) > @@ -796,7 +796,7 @@ > if(tm->tm_yday != NA_INTEGER) { > /* since we have yday, let that take precedence over mon/mday */ > int yday = tm->tm_yday, mon = 0; > - while(yday > (tmp = days_in_month[mon] + > + while(yday >= (tmp = days_in_month[mon] + > ((mon==1 && isleap(1900+tm->tm_year))? 1 : 0))) { > yday -= tmp; > mon++; > > __ > 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
[Rd] Shared lib locations (was Re: [R] problem with RCurl install on Unix0
[moved to R-devel] As a package author, how can I let R know of a non-standard location for shared libs, e.g., because my configure script went to extra effort to find a shared library, or my package has more than one shared library? Maybe another question is, in a package, where should I place my shared libs (and how should they be named) so that R will find them (I realize library libs/X.so is created for package X; it seems that a library Y.so that X.so uses is not found when named libs/Y.so or libs/libY.so). Thanks, (another) Martin Prof Brian Ripley <[EMAIL PROTECTED]> writes: > On Thu, 22 Mar 2007, Martin Maechler wrote: > >>> "Steven" == Steven McKinney <[EMAIL PROTECTED]> >>> on Wed, 21 Mar 2007 19:29:43 -0700 writes: >> >>Steven> I get the same problem, and haven't >>Steven> figured it out yet. >> >>Steven> Is it a 32bit/64bit clash? >> >> Well, I can install and run RCurl on both 32bit and 64bit >> (Redhat / FC6 Linux; with own compilers, extra libs, ...). >> >>Steven> (Similarly, I don't have RMySQL up and running cleanly.) >> >> >> >> >>>> library(RCurl) >>Steven> Error in dyn.load(x, as.logical(local), as.logical(now)) : >>Steven> unable to load shared library >> '/share/apps/R/R-2.4.1/library/RCurl/libs/RCurl.so': >>Steven> libcurl.so.4: cannot open shared object file: No such file or >> directory >>Steven> Error: package/namespace load failed for 'RCurl' >> >> You might need to set LD_LIBRARY_PATH correctly >> before starting R -- typically it would be set the same as it >> was when RCurl was installed (which includes a 'configure' !) on >> your system? Or RCurl's configure is not quite robust enough >> and did not check for the presence of a libcurl.so.4 >> >> I assume >> >> ldd /share/apps/R/R-2.4.1/library/RCurl/libs/RCurl.so > > You may well need > > R CMD ldd /share/apps/R/R-2.4.1/library/RCurl/libs/RCurl.so > > as the R front end sets LD_LIBRARY_PATH. > >> also tells about the missing libcurl.so.4 ? >> Make sure you find that (in /usr/lib; /usr/local/lib, ... ?) >> and then set your LD_LIBRARY_PATH >> or even 'ldconfig' as root to make sure that libcurl.so.4 ``is >> found''. >> IMO the latter {correct ldconfig call / /etc/ld.so.conf setup} >> should have happened as part of the installation of the curl >> library. > > I find it very common for software packages to install into > /usr/local/lib (not lib64) and not to think about the ldconfig paths. > Both are things that RPMs tend to correct. > >> On the 64-bit architecture, note that >> >> > system(paste("ldd", dir(system.file("libs", package = "RCurl"), >> > full=TRUE))) >> >> finds all libraries in /lib64 and /usr/lib64 . > > I think you mean on Redhat-based AMD64 Linux. This is something that > differs by 64-bit architecture (ia64 uses /lib) and also Linux distro (at > least in the past). > > RMySQL does not install out of the box on any of our 64-bit systems > (another lib vs lib64 issue), and I've sent patches to the maintainer. > > -- > 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-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. -- Martin Morgan Bioconductor / Computational Biology http://bioconductor.org __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] [R] Can I scale the labels in a 'persp' graph?
[Moved to R-devel to ask a policy question.] On Fri, 16 Mar 2007, Duncan Murdoch wrote: > On 3/16/2007 8:02 AM, [EMAIL PROTECTED] wrote: >> Hi all: >> >> I'm using 'persp' for 3D graphics. >> >> I need the axis's labels smaller than by defect. >> >> I see in 'help()', the information about 'par()'. >> >> I have wrote: >> >>> par(.,cex.axis=0.5,cex.lab=0.5) >> perspc(.) >> >> and the result don't change. >> >> The question is: Can I change the size of labels in the perps graph?? >> >> Thank you in advance: >> >> /salva >> >> 'cex.axis' The magnification to be used for axis annotation >>relative to the current setting of 'cex'. (Some functions >>such as 'points' accept a vector of values which are >>recycled. Other uses will take just the first value if a >>vector of length greater than one is supplied.) >> >> 'cex.lab' The magnification to be used for x and y labels relative >>to the current setting of 'cex'. > > Those don't appear to be supported by persp, but cex is: e.g. > > x <- 1:10 > y <- 1:10 > z <- outer(x,y,function(x,y) sin((x+y)/10)) > persp(x,y,z, cex=0.5) I've added this to ?persp and ?par, but I wondered if people thought we should change this to be like 2D plots. Especially Ross I., who I believe is the author here? Brian -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] how to use debug.mypkg
Dear all, The package "affy" has the following statement in file "AffyBatch.R": if (debug.affy123) cat("-->initAffyBatch\n") This is great and I would also like to use it. However, when I run my package I get the following error: Error in .local(object, ...) : object "debug.mypkg" not found Since I am not able to find the position where "affy" defines "debug.affy123" my question is: where do I need to define "debug.mypkg"? Thank you in advance Best regards Christian _._._._._._._._._._._._._._._._ C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a V.i.e.n.n.a A.u.s.t.r.i.a _._._._._._._._._._._._._._._._ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] how to use debug.mypkg
debug.affy123 is not a function... it's just a logical flag set in ProgressBarText.R. b On Mar 22, 2007, at 6:22 PM, cstrato wrote: > Dear all, > > The package "affy" has the following statement in file "AffyBatch.R": > if (debug.affy123) cat("-->initAffyBatch\n") > > This is great and I would also like to use it. However, when I run my > package > I get the following error: > Error in .local(object, ...) : object "debug.mypkg" not found > > Since I am not able to find the position where "affy" defines > "debug.affy123" > my question is: where do I need to define "debug.mypkg"? > > Thank you in advance > Best regards > Christian > _._._._._._._._._._._._._._._._ > C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a > V.i.e.n.n.a A.u.s.t.r.i.a > _._._._._._._._._._._._._._._._ > > __ > 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] how to use debug.mypkg
Yes, I know, but somewhere in my package I need to define this flag. When I set the flag "debug.mypkg<-T" in the R session, everything works, but the problem is that if I do not set it, it is undefined. So I need to set it initially in my package, but where? Christian Benilton Carvalho wrote: > debug.affy123 is not a function... it's just a logical flag set in > ProgressBarText.R. > > b > > On Mar 22, 2007, at 6:22 PM, cstrato wrote: > >> Dear all, >> >> The package "affy" has the following statement in file "AffyBatch.R": >> if (debug.affy123) cat("-->initAffyBatch\n") >> >> This is great and I would also like to use it. However, when I run my >> package >> I get the following error: >> Error in .local(object, ...) : object "debug.mypkg" not found >> >> Since I am not able to find the position where "affy" defines >> "debug.affy123" >> my question is: where do I need to define "debug.mypkg"? >> >> Thank you in advance >> Best regards >> Christian >> _._._._._._._._._._._._._._._._ >> C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a >> V.i.e.n.n.a A.u.s.t.r.i.a >> _._._._._._._._._._._._._._._._ >> >> __ >> 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] how to use debug.mypkg
it doesn't matter where.. just pick one of your files and set it... of course, your file should be listed in the Collate field (in case you changed your mind and are now using it). b On Mar 22, 2007, at 6:52 PM, cstrato wrote: > Yes, I know, but somewhere in my package I need to define this flag. > When I set the flag "debug.mypkg<-T" in the R session, everything > works, > but the problem is that if I do not set it, it is undefined. So I > need to set it > initially in my package, but where? > > Christian > > Benilton Carvalho wrote: >> debug.affy123 is not a function... it's just a logical flag set in >> ProgressBarText.R. >> >> b >> >> On Mar 22, 2007, at 6:22 PM, cstrato wrote: >> >>> Dear all, >>> >>> The package "affy" has the following statement in file >>> "AffyBatch.R": >>> if (debug.affy123) cat("-->initAffyBatch\n") >>> >>> This is great and I would also like to use it. However, when I >>> run my >>> package >>> I get the following error: >>> Error in .local(object, ...) : object "debug.mypkg" not found >>> >>> Since I am not able to find the position where "affy" defines >>> "debug.affy123" >>> my question is: where do I need to define "debug.mypkg"? >>> >>> Thank you in advance >>> Best regards >>> Christian >>> _._._._._._._._._._._._._._._._ >>> C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a >>> V.i.e.n.n.a A.u.s.t.r.i.a >>> _._._._._._._._._._._._._._._._ >>> >>> __ >>> 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] how to use debug.mypkg
Benilton Carvalho <[EMAIL PROTECTED]> writes: > it doesn't matter where.. > > just pick one of your files and set it... > > of course, your file should be listed in the Collate field (in case > you changed your mind and are now using it). One useful trick is to create an environment object in your package's namespace. It is probably best to put this early in the Collate order so all your code can assume it is there: OPTIONS <- new.env(hash=TRUE, parent=emptyenv()) Then you could have, for example, a debug flag that gets a default value of FALSE, but can be interactively toggled. In your package code you would have: OPTIONS$debug <- FALSE Then you could either export this object from your namespace or, more conservatively, export a function to toggle. Then an end user (or developer) can do: R> toggleDebug() Obviously, for this to be useful, you need to have package code that checks if(OPTIONS$debug) and does something different. + 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] how to use debug.mypkg
Great tip Seth... thanks a bunch... b On Mar 22, 2007, at 9:54 PM, Seth Falcon wrote: > Benilton Carvalho <[EMAIL PROTECTED]> writes: > >> it doesn't matter where.. >> >> just pick one of your files and set it... >> >> of course, your file should be listed in the Collate field (in case >> you changed your mind and are now using it). > > One useful trick is to create an environment object in your package's > namespace. It is probably best to put this early in the Collate order > so all your code can assume it is there: > >OPTIONS <- new.env(hash=TRUE, parent=emptyenv()) > > Then you could have, for example, a debug flag that gets a default > value of FALSE, but can be interactively toggled. In your package > code you would have: > >OPTIONS$debug <- FALSE > > Then you could either export this object from your namespace or, more > conservatively, export a function to toggle. Then an end user (or > developer) can do: > > R> toggleDebug() > > Obviously, for this to be useful, you need to have package code that > checks if(OPTIONS$debug) and does something different. > > + 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 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] can't load just saved R object "ReadItem: unknown type 65"
I have run into a problem loading a just saved R object using R-devel. I have been saving and loading this particular type of R object for a long while and never ran into this problem. I save, then immediately reload (to test save) and get "ReadItem: unnknown type 65". This error is reproducible after logout from server and restart of emacs and R. Below is my output and sessionInfo(). Thanks, Mark > setwd("~/Genomics/Experiments.Genomic/BB01/acb.shell") > local(save(affy.object.preprocessed, file ="affy.object.preprocessed.R" )) > load("affy.object.preprocessed.R") Error in load("affy.object.preprocessed.R") : ReadItem: unknown type 65, perhaps written by later version of R > sessionInfo() R version 2.5.0 Under development (unstable) (2007-03-11 r40824) powerpc64-unknown-linux-gnu locale: LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C attached base packages: [1] "splines" "stats" "graphics" "grDevices" "datasets" "utils" [7] "tools" "methods" "base" other attached packages: multtestrat2302cdf affycoretools annaffyxtable "1.13.1" "1.15.0" "1.7.8" "1.7.3" "1.4-3" gcrma matchprobes biomaRt RCurl XML "2.7.3" "1.7.4" "1.9.21" "0.8-0" "1.6-0" GOstats CategoryMatrix latticegenefilter "2.1.13" "2.1.20" "0.9975-11" "0.14-16" "1.13.8" survival KEGG RBGL annotateGO "2.31" "1.15.12" "1.11.4" "1.13.6" "1.15.12" graph limma affyaffyio Biobase "1.13.6" "2.9.13" "1.13.14" "1.3.3" "1.13.39" -- Mark W. Kimpel MD Neuroinformatics Department of Psychiatry Indiana University School of Medicine __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel