Re: [Rd] documentation source diff...
Dan Bolser wrote: Hi, I forgot the name of the function 'colSums', and expected to be able to find it through the 'see also' section of the documentation for the 'sum' function. Good idea, I think it might be worth to be added to ?apply as well. Here is the diff I made of the altered documentation to facilitate this action... (p.s. I made the diff on the R-2.1.0 source). diff sum.Rd src/library/base/man/sum.Rd --context=2 *** sum.Rd 2005-06-03 20:24:22.468224056 +0100 --- src/library/base/man/sum.Rd 2005-04-18 22:30:27.0 +0100 *** *** 33,38 Wadsworth \ Brooks/Cole. } - \seealso{ - \code{\code{\link{colSums}}. You don't want \code twice... Some suggestions for further contributions: - you want to use diff with option -u - you want to use the original file as first argument and the changed file as second argument to diff. Uwe Ligges - } \keyword{arith} --- 33,35 __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Re: [R] p-value 1 in fisher.test()
(Ted Harding) wrote: On 03-Jun-05 Ted Harding wrote: And on mine (A: PII, Red Had 9, R-1.8.0): ff - c(0,10,250,5000); dim(ff) - c(2,2); 1-fisher.test(ff)$p.value [1] 1.268219e-11 (B: PIII, SuSE 7.2, R-2.1.0beta): ff - c(0,10,250,5000); dim(ff) - c(2,2); 1-fisher.test(ff)$p.value [1] -1.384892e-12 I have a suggestion (maybe it should also go to R-devel). There are many functions in R whose designated purpose is to return the value of a probability (or a probability density). This designated purpose is in the mind of the person who has coded the function, and is implicit in its usage. Therefore I suggest that every such function should have a built-in internal check that no probability should be less than 0 (and if the primary computation yields such a value then the function should set it exactly to zero), and should not exceed 1 (in which case the function should set it exactly to 1). [And, in view of recent echanges, I would suggest exactly +0, not -0!] Similar for any attempts to return a negative probability density; while of course a positive value can be allowed to be anything. All probabilities would then be guaranteed to be clean and issues like the Fisher exact test above would no longer be even a tiny problem. Implementing this in the possibly many cases where it is not already present is no doubt a long-term (and tedious) project. Meanwhile, people who encounter problems due to its absence can carry out their own checks and adjustments! [moved to R-devel] Ted, my (naive?) objection: Many errors in the underlying code have been detected by a function returning a nonsensical value, but if the probability is silently set to 0 or 1 ... Hence I would agree to do so in special cases where it makes sense because of numerical issues, but please not globally. Uwe Ligges Best wishes to all, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 04-Jun-05 Time: 00:02:32 -- XFMail -- __ 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 __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Problem with fPortfolio
Yes, looks like a bug in package fPortfolio. Please report bugs in conztributed packages to the package maintainer (look at e.g. library(help=fPortfolio)) rather than to an R list. Thank you. Uwe Ligges Neuro LeSuperHéros wrote: Hello, I hesitate to call this a bug, because I could have forgotten something important, but the MarkowitzPortfolio example in fPortfolio does not work for me. Here's my code: library(fPortfolio) xmpPortfolio(\nStart: Load monthly data set of returns ) data(berndtInvest) # Exclude Date, Market and Interest Rate columns from data frame, # then multiply by 100 for percentual returns ... berndtAssets = berndtInvest[, -c(1, 11, 18)] rownames(berndtAssets) = berndtInvest[, 1] head(berndtAssets) CITCRP CONED CONTIL DATGENDEC DELTA GENMIL GERBERIBM MOBIL PANAM PSNH TANDY TEXACO 1-Jan-78 -0.115 -0.079 -0.129 -0.084 -0.100 -0.028 -0.099 -0.048 -0.029 -0.046 0.025 -0.008 -0.075 -0.054 1-Feb-78 -0.019 -0.003 0.037 -0.097 -0.063 -0.033 0.018 0.160 -0.043 -0.017 -0.073 -0.025 -0.004 -0.010 1-Mar-78 0.059 0.022 0.003 0.063 0.010 0.070 -0.023 -0.036 -0.063 0.049 0.184 0.026 0.124 0.015 1-Apr-78 0.127 -0.005 0.180 0.179 0.165 0.150 0.046 0.004 0.130 0.077 0.089 -0.008 0.055 0.000 1-May-78 0.005 -0.014 0.061 0.052 0.038 -0.031 0.063 0.046 -0.018 -0.011 0.082 0.019 0.176 -0.029 1-Jun-78 0.007 0.034 -0.059 -0.023 -0.021 0.023 0.008 0.028 -0.004 -0.043 0.019 0.032 -0.014 -0.025 WEYER 1-Jan-78 -0.116 1-Feb-78 -0.135 1-Mar-78 0.084 1-Apr-78 0.144 1-May-78 -0.031 1-Jun-78 0.005 ## Markowitz Portfolios: myPortfolio = portfolioMarkowitz(berndtAssets, targetReturn = 20/100/12) Error in portfolioMarkowitz(berndtAssets, targetReturn = 20/100/12) : Object pfolio not found version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status Patched major2 minor1.0 year 2005 month05 day 09 language R __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] minus: operator and sign (PR#7908)
[EMAIL PROTECTED] wrote: Full_Name: Allan Sims Version: 2.1.0 OS: WinXP Submission from: (NULL) (193.40.25.254) This should not be correct. It seams that first power is applied and then sign. -2^2 [1] -4 __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel So you are telling us in a *bug* report that R works as expected??? The current R Language Definition manual tells us in Section Parser - Expressions - Infox and prefix operators (which is 10.4.2 in the current version) the details on the order of precendence (^ before unary -!). Please read the docs before submitting bug reports! Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] minus: operator and sign (PR#7908)
Uwe Ligges wrote: [EMAIL PROTECTED] wrote: Full_Name: Allan Sims Version: 2.1.0 OS: WinXP Submission from: (NULL) (193.40.25.254) This should not be correct. It seams that first power is applied and then sign. -2^2 [1] -4 __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel So you are telling us in a *bug* report that R works as expected??? The current R Language Definition manual tells us in Section Parser - Expressions - Infox and prefix operators (which is 10.4.2 in the current version) the details on the order of precendence (^ before unary -!). Please read the docs before submitting bug reports! Uwe Ligges BTW: ?Syntax should have told you as well. Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: looking for RMySQL Windows binary; was: [Rd] (no subject)
Annika Wetzko wrote: Hi all, I have a problem installing RMySQL under WinXP. I can not find the ZIP-file or what have I to do? It#180;s really busy bacause I am a student and have to make DBConnection soon...at this weekend! Please answer as quick as possible! ... so I am answering as quick as possible. You know, all those other students, faculty members, business people, and professors reading your mail do feel completely boring and are just waiting to answer questions of a student who is busy and requesting quick answers ... or in other words, people already do answer as quick as possible, even if you do not arrogate... Your message is not appropriate for R-devel. It is not even appropriate for R-help, for which you should really read the posting guide. http://www.R-project.org/posting-guide.html Please use a sensible subject line. Please do not put people under pressure to answer your question. Please tell us the version of R you are using. Now, answering your question, please read the ReadMe at CRAN/bin/windows/contrib/2.1/ReadMe (assuming you are using the most recent version of R, but you have not told us...). It tells us: RMySQL is available at http://stat.bell-labs.com/RS-DBI/download, provided by its maintainer, David A. James. Uwe Ligges Thanks for help Annika __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] (PR#7899) seek(con, 0, end, rw=r) does not always work
Tony Plate wrote: [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I've noticed that seek(con, 0, end, rw=r) on a file connection does not always work correctly after a write (R 2.1.0 on Windows). [Is a call to fflush() needed inside file_seek() in main/connections.c?] If you have an idea where to fflush() precisely and your patch works, please tell it! I'll happily run some test cases where seeking matters. I couldn't see why the current code was returning a bad value under some conditions. (That's why didn't offer anything more than a suggestion). My suggestion to use an fflush() was a guess (hence the question mark, but evidence for the guess being correct was that doing a flush at the R command line made the whole thing work correctly.) To be safe, I would try to put a flush() right at the beginning of file_seek(), before the call to f_tell(). I tried this, and with the modification the test case I gave produced correct output. Here's how the beginning of my modified file_seek() function (in main/connections.c) looks: static double file_seek(Rconnection con, double where, int origin, int rw) { Rfileconn this = con-private; FILE *fp = this-fp; #if defined(HAVE_OFF_T) defined(__USE_LARGEFILE) off_t pos; #else #ifdef Win32 off64_t pos; #else long pos; #endif #endif int whence = SEEK_SET; fflush(fp); pos = f_tell(fp); /* make sure both positions are set */ Works for your example, but I found another one where it introduces a worse bug when using origin=current. Hence it's not that easy. After reviewing this issue more closely, I think writeLines() into a binary connection might be the real problem and a misuse in this case. See the last paragrpah in the Details Section of ?writeLines. Hence, this might also be an issue related to the text mode connection problem on Windows. Using simple writeChar and readChar statements works as expected for me (at least, I was not able to produce anything unexpected). I'm no longer convinced that this is a bug in R. Note that ?seek currently tells us The value returned by seek(where=NA) appears to be unreliable on Windows systems, at least for text files. It would be nice if this comment could be removed, of course May the explanation could be given that this happens with text files because Windows inserts extra characters at end-of-lines when reading text mode files (but with binary files, things should be fine.) This particular issue is documented in Microsoft Windows documentation (e.g., at http://msdn2.microsoft.com/library/75yw9bf3(en-us,vs.80).aspx, found by searching on Google using the terms fseek windows documentation). Are there any known issues using seek with binary files under Windows? If there are not, then the caveat could be made specific to text files and all vagueness removed. Hmm, all I find (including your link) is Windows CE related ... Uwe Ligges -- Tony Plate Uwe Ligges Example (see the lines with the ***WRONG*** comment) # seek(, rw=r) on a file does not always work correctly after a write f - file(tmp3.txt, w+b) # Write something earlier in the file seek(f, 10, rw=w) [1] 0 writeLines(c(ghi, jkl), f) seek(f, 20, rw=w) [1] 18 writeLines(c(abc), f) seek(f, 0, end, rw=w) [1] 24 # Try to read at the end of the file seek(f, 0, end, rw=r) [1] 0 readLines(f, -1) character(0) seek(f, 0, end, rw=w) [1] 18 # write something at the end of the file writeLines(c(def), f) # Try to read at the end of the file # flush(f) # flushing here makes the seek work correctly seek(f, 0, end, rw=r) [1] 24 seek(f, NA, rw=r) # ***WRONG*** (should return 28) [1] 24 readLines(f, -1) # ***WRONG*** (should return character(0)) [1] def seek(f, 20, rw=r) [1] 28 readLines(f, -1) [1] abc def seek(f, 0, end, rw=r) # now it works correctly [1] 28 seek(f, NA, rw=r) [1] 28 readLines(f, -1) character(0) close(f) version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major2 minor1.0 year 2005 month04 day 18 language R -- Tony Plate __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Reversing axis in a log plot (PR#7894)
Yes, this one is a bug in CreateAtVector, plot.c. It already has the lines: /* Debugging: When does the following happen... ? */ if (umin umax) warning(CreateAtVector \log\(from axis()): usr[0] = %g %g = usr[1] !, umin, umax); And now we know that it happens if (and only if?) the logarithmic scale is not very small (i.e. axp[2] 0, this is equal to R's par(yaxp)[3] in your example) and the axis are reversed (umin umax). I'll try to provide a fix which should be possible by reversing arguments axp and usr in this case and returning a reversed at ... Uwe Ligges [EMAIL PROTECTED] wrote: Full_Name: Christian Marquardt Version: 2.1.0 OS: Linux (Redhat 9) Submission from: (NULL) (151.170.240.10) Following the advice of a reader of R-help, I would now like to submit this as a bug report: Say we have x = seq(1,3, by = 0.01) y = exp(x) Plotting and reversing linear axis is fine plot(x,y) plot(x,y, ylim = c(30,1)) as is a usual log-plot: plot(x,y, log = y, ylim = c(1,30)) However, plot(x,y, log = y, ylim = c(30,1)) fails with Error in axis(2, ...) : log - axis(), 'at' creation, _SMALL_ range: invalid {xy}axp or par; axp[0]= 10, usr[0:1]=(34.3721,0.872801) In addition: Warning message: CreateAtVector log(from axis()): usr[0] = 34.3721 0.872801 = usr[1] ! According to Petr Pikal petr.pikal -at- precheza.cz, replacing the ylim argument by ylim = c(30,1.2) helps in the above example; but in my real world applications, it's actually difficult to find a working value for ylim. I hope this is useful, Christian. __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] seek(con, 0, end, rw=r) does not always work correctly (PR#7899)
[EMAIL PROTECTED] wrote: I've noticed that seek(con, 0, end, rw=r) on a file connection does not always work correctly after a write (R 2.1.0 on Windows). [Is a call to fflush() needed inside file_seek() in main/connections.c?] If you have an idea where to fflush() precisely and your patch works, please tell it! I'll happily run some test cases where seeking matters. Note that ?seek currently tells us The value returned by seek(where=NA) appears to be unreliable on Windows systems, at least for text files. It would be nice if this comment could be removed, of course Uwe Ligges Example (see the lines with the ***WRONG*** comment) # seek(, rw=r) on a file does not always work correctly after a write f - file(tmp3.txt, w+b) # Write something earlier in the file seek(f, 10, rw=w) [1] 0 writeLines(c(ghi, jkl), f) seek(f, 20, rw=w) [1] 18 writeLines(c(abc), f) seek(f, 0, end, rw=w) [1] 24 # Try to read at the end of the file seek(f, 0, end, rw=r) [1] 0 readLines(f, -1) character(0) seek(f, 0, end, rw=w) [1] 18 # write something at the end of the file writeLines(c(def), f) # Try to read at the end of the file # flush(f) # flushing here makes the seek work correctly seek(f, 0, end, rw=r) [1] 24 seek(f, NA, rw=r) # ***WRONG*** (should return 28) [1] 24 readLines(f, -1) # ***WRONG*** (should return character(0)) [1] def seek(f, 20, rw=r) [1] 28 readLines(f, -1) [1] abc def seek(f, 0, end, rw=r) # now it works correctly [1] 28 seek(f, NA, rw=r) [1] 28 readLines(f, -1) character(0) close(f) version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major2 minor1.0 year 2005 month04 day 18 language R -- Tony Plate __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Rout for library/base/R-ex/Extract.data.frame.R
Vadim Ogranovich wrote: Hi, I am writing a light-weight data frame class and want to borrow the test cases from the standard data frame. I found the test cases in library/base/R-ex/Extract.data.frame.R, but surprisingly no corresponding .Rout files. In fact there is no *.Rout file in the entire tarball. Not that I cann't generate them, but I am just curious why they are not there? How does the base package get tested? Thanks, Vadim [[alternative HTML version deleted]] __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel The base packages have their test cases in ...R/tests rather than R/src/library/packagename Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Internationalizing the Rcmdr package?
For sure you have already read the write ups at http://developer.r-project.org/Translations.html as well as the corresponding sections in Writing R Extesnsions? There is also an article in the recent R News. I have tried out a toy example some time before the docs were that complete (February-March?), and it already worked very well. Rcmdr is a much bigger task, of course! Peters point (Accept/Break/Cancel translates to Accepter/Afbryd/Annuller) is a very important one. A similar problem with translations of RGui broke my workarounds for RWinEdt Uwe Peter Dalgaard wrote: John Fox [EMAIL PROTECTED] writes: Dear R-devel list members, I'm considering adding support for other languages than English to the Rcmdr package. I understand that the use of Tcl/Tk by the Rcmdr package means I won't be able to make full use of the internationalization facilities in R 2.1.0. I'm interested, therefore, in whether the following, more limited, strategy (which bears some similarity to the internationalization facilities in R) seems reasonable or whether there's a better approach. As well, I'm interested in whether the proposed approach is sufficiently flexible to be worthwhile -- does it cover enough languages? It would be simple for me to provide a file of messages, labels, and other text used by the Rcmdr, organizing this file with one message per line. A copy of the file, named, e.g., messages.francais, could contain translations into another language (e.g, French). Setting options(Rcmdr=list(language=francais)) would then activate translation when the Rcmdr starts up, reading the messages file into a data frame, treating the English text as row names. The messages could be handled by a function, say Text(), which would return English or translated text, as appropriate. Some experimentation shows that message retrieval by this scheme is essentially instantaneous even when there are several thousand relatively long messages in the data frame. Offhand, I think you're better off latching on to an existing mechanism. Tcl has something known as msgcat, which appears to be similar to GNU gettext (and there are conversion tools), or perhaps you could interface to gettext itself (we do have the gettext() function at the R level). Two tricky bits: (A) shortcut keys, which need to be coordinated to menu items (Accept/Break/Cancel translates to Accepter/Afbryd/Annuller in Danish - if you're a little malicious, anyway) (B) What is the general mechanism for extending message catalogs by an R package? Brian may well have thought of this stuff already. __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Specifying dependency on a specific patched version
Gabor Grothendieck wrote: Is there a way to specify a package dependency in the Depends: field of the DESCRIPTION file for a specific patched version of a specific OS? For example, today's Windows patched release (2005-05-14) has the capability of changing the time zone within R on Windows via Sys.putenv(TZ=GMT) but prior patched versions do not have this. Is there some way of ensuring that the 2005-05-14 or later release is used if on Windows only? No. Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] bug, feature of mistery?
Giuseppe Ragusa wrote: Uwe, - Where is *lexical* scoping involved? Abuse of notation. I intended to say scoping. - Are you really calling you code from a clean workspace? Yes it is clean. - Why don't use pass g through optim() to f? Please do so, because it might be a scoping problem. Tried that. Still no luck. z- does not get assigned even if i pass g through optim - The .C call in psi() should not matter unless you are doing strange things in the part you omitted (...). I do not think is the call to C. And I did not omit, psi() is the last call. And again, same code works fine on the other machine. Can you send me a reproducible example (off list), please (inlcuding example data)? Uwe On Wed, 11 May 2005, Uwe Ligges wrote: Giuseppe Ragusa wrote: I have two machines a linux_amd64_x86 (gentoo_amd64) and a linux_x86. Both run R-2.1.0. I have a very long program (hopefully will become a package) that works perfectly on the linux_amd_x64. Great means no error, no problems and results that, where the analytic solution exists, coincide with it. I have problem making the code run on the x64 machine. I am baffled. The same code on the same version of R, different arch, is behaving differently. After hour of debugging, I traced down what is triggering the error on the x86 machine. the code snippet is the following similar to: R g - h(d) f - function( lambda ) { z - g %*% lambda sum( psi(z) ) ... } optim( init.value, f ) R The function f() is using lexical scoping to get obtain g. The function psi() is a call to a wrapper function that call a (.C) C function doing some simple calculation on z. - Where is *lexical* scoping involved? - Are you really calling you code from a clean workspace? - Why don't use pass g through optim() to f? Please do so, because it might be a scoping problem. - The .C call in psi() should not matter unless you are doing strange things in the part you omitted (...). Uwe Ligges What's the problem? When f() is called, g is there, lambda is there, but the assignment z - g %*% lambda results in a matrix of NaN. This happens from the second time f() is called, i.e. the first time f() is called from optim() after the C call has been made. The error is then that passing a NaN vector to .C results in halted execution. If I debug f() during the call to optim, I can without problem assign z the correct value, but during the execution z is matrix(NaN, nr, 1). At this point I can think of the following: 1) the external C code has errors It is not a programming error, because when called from console it returns the right results. Also, remember, the program work on my other machine (the 64 bit); 2) R error (I do not think so) 3) Compiling error Can be the gcc is messing thing around? on the 32bit machine gcc version 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) on the 64-bit machine gcc version 3.4.3 20041125 (Gentoo Linux 3.4.3-r1, ssp-3.4.3-0, pie-8.7.7) Any help, suggestions, thoughts? Thank you. Giuseppe Ragusa __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] segfault on large number of open brackets (PR#7859)
Liaw, Andy wrote: I believe that's been fixed in R-2.1.0. Please check. I got the same segfault with R-2.0.1 on SuSE Linux x86_64, but on both that machine and my WinXP latop, I get syntax error. E.g., R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.0 Patched (2005-05-12), 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 a HTML browser interface to help. Type 'q()' to quit R. ((( + ((( Error: syntax error With R-2.1.0 (release!) I get syntax error on Windows, no error (at least not after the first couple of hundred openings) on Linux, but the described *segfault* on Solaris 5.7 (UltraSparc). [I am too lazy to try out R-patched on the slowish Solaris machine yet] Uwe Ligges Andy From: [EMAIL PROTECTED] Full_Name: Max Version: R 2.0.1 (2004-11-15) OS: Gentoo Linux Submission from: (NULL) (158.143.49.181) I leaned on the ( key by accident, and it looks as if R segfaults on a large number (88 or more in my case) open brackets: Script started on Thu May 12 15:18:04 2005 $ R R : Copyright 2004, The R Foundation for Statistical Computing Version 2.0.1 (2004-11-15), 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 a HTML browser interface to help. Type 'q()' to quit R. (( ( + ( Segmentation fault $ uname -a Linux max 2.6.11-gentoo-r6 #2 Sat May 7 19:24:52 GMT 2005 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz GenuineIntel GNU/Linux $ exit Script done on Thu May 12 15:18:16 2005 Regards, Max R compiled with gcc 3.3.5 glibc-2.3.4 __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] bug, feature of mistery?
Giuseppe Ragusa wrote: I have two machines a linux_amd64_x86 (gentoo_amd64) and a linux_x86. Both run R-2.1.0. I have a very long program (hopefully will become a package) that works perfectly on the linux_amd_x64. Great means no error, no problems and results that, where the analytic solution exists, coincide with it. I have problem making the code run on the x64 machine. I am baffled. The same code on the same version of R, different arch, is behaving differently. After hour of debugging, I traced down what is triggering the error on the x86 machine. the code snippet is the following similar to: R g - h(d) f - function( lambda ) { z - g %*% lambda sum( psi(z) ) ... } optim( init.value, f ) R The function f() is using lexical scoping to get obtain g. The function psi() is a call to a wrapper function that call a (.C) C function doing some simple calculation on z. - Where is *lexical* scoping involved? - Are you really calling you code from a clean workspace? - Why don't use pass g through optim() to f? Please do so, because it might be a scoping problem. - The .C call in psi() should not matter unless you are doing strange things in the part you omitted (...). Uwe Ligges What's the problem? When f() is called, g is there, lambda is there, but the assignment z - g %*% lambda results in a matrix of NaN. This happens from the second time f() is called, i.e. the first time f() is called from optim() after the C call has been made. The error is then that passing a NaN vector to .C results in halted execution. If I debug f() during the call to optim, I can without problem assign z the correct value, but during the execution z is matrix(NaN, nr, 1). At this point I can think of the following: 1) the external C code has errors It is not a programming error, because when called from console it returns the right results. Also, remember, the program work on my other machine (the 64 bit); 2) R error (I do not think so) 3) Compiling error Can be the gcc is messing thing around? on the 32bit machine gcc version 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) on the 64-bit machine gcc version 3.4.3 20041125 (Gentoo Linux 3.4.3-r1, ssp-3.4.3-0, pie-8.7.7) Any help, suggestions, thoughts? Thank you. Giuseppe Ragusa __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Implementing R on IBM p690 cluster Jump
Ralf Seppelt wrote: Dear All, we're trying to implement R on the IBM p690 cluster Jump at the research centre in Jülich, Germany (c.f. http://www.fz-juelich.de/nic/Supercomputer/computer-e.html) using the most recent version of R (2.1.0) and precisly following the installation instructions. How much cpu time for further R development do we get on that machine if we can help? ;-) Uwe Ligges After ./configure we get the final message: R is now configured for powerpc-ibm-aix5.2.0.0 Source directory: . Installation directory:/usr/local C compiler:gcc -mno-fp-in-toc -g -O2 C++ compiler: g++ -g -O2 Fortran compiler: f77 -g Interfaces supported: X11, tcltk External libraries:readline, BLAS(ESSL) Additional capabilities: PNG, JPEG, MBCS, NLS Options enabled: R profiling Recommended packages: yes configure: WARNING: you cannot build info or html versions of the R manuals configure: WARNING: I could not determine a browser -- After make we get [EMAIL PROTECTED]: [EMAIL PROTECTED]: make ... gcc -Wl,-bM:SRE -Wl,-H512 -Wl,-T512 -Wl,-bnoentry -Wl,-bexpall -Wl,-bI:../../../etc/R.exp -L/usr/local/lib -o R_X11.so dataentry.lo devX11.lo rotated.lo rbitmap.lo -lSM -lICE -lX11 -ljpeg -lpng -lz ld: 0711-317 ERROR: Undefined symbol: .log10 ld: 0711-317 ERROR: Undefined symbol: .floor ld: 0711-317 ERROR: Undefined symbol: .libintl_gettext ld: 0711-317 ERROR: Undefined symbol: .pow ld: 0711-317 ERROR: Undefined symbol: .sin ld: 0711-317 ERROR: Undefined symbol: .cos ld: 0711-317 ERROR: Undefined symbol: .tan ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. collect2: ld returned 8 exit status make: 1254-004 The error code from the last command is 1. Stop. make: 1254-004 The error code from the last command is 2. Stop. make: 1254-004 The error code from the last command is 1. Stop. make: 1254-004 The error code from the last command is 1. Stop. make: 1254-004 The error code from the last command is 1. --- Before bugging the administiors in Jülich, we would like to ask the R consortium: Are there any related experiences from people who worked on the implementation of R on different platforms? Thanks for help Ralf Seppelt Carsten Dormann PS: the configure log-file is attached to this mail. ./configure checking build system type... powerpc-ibm-aix5.2.0.0 checking host system type... powerpc-ibm-aix5.2.0.0 loading site script './config.site' loading build specific script './config.site' checking for pwd... /usr/bin/pwd checking whether builddir is srcdir... yes checking for working aclocal... missing checking for working autoconf... missing checking for working automake... missing checking for working autoheader... missing checking for working makeinfo... found checking for gawk... no checking for mawk... no checking for nawk... nawk checking for egrep... grep -E checking whether ln -s works... yes checking for ranlib... ranlib checking for bison... bison -y checking for ar... ar checking for a BSD-compatible install... /usr/opt/freeware/bin/install -c checking for javac... /usr/java14/bin/javac checking for sed... /usr/bin/sed checking for less... /usr/bin/less checking for perl... /usr/bin/perl checking whether perl version is at least 5.004... yes checking for dvips... /usr/local/bin/dvips checking for tex... /usr/local/bin/tex checking for latex... /usr/local/bin/latex checking for makeindex... /usr/local/bin/makeindex checking for pdftex... /usr/local/bin/pdftex checking for pdflatex... /usr/local/bin/pdflatex checking for makeinfo... /usr/local/bin/makeinfo checking for unzip... /usr/local/bin/unzip checking for zip... no checking for gzip... /usr/bin/gzip checking for firefox... no checking for mozilla... no checking for netscape... no checking for galeon... no checking for kfmclient... no checking for opera... no checking for gnome-moz-remote... no checking for open... no configure: WARNING: I could not determine a browser checking for acroread... /usr/local/bin/acroread checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking how to run the C preprocessor... gcc -E checking whether gcc needs -traditional... no checking how to run the C preprocessor... gcc -E checking for g77... no checking for f77... f77 checking whether we are using the GNU Fortran 77 compiler... no checking whether f77 accepts -g... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g
Re: [Rd] can't build packages anymore...
Jeff D. Hamann wrote: R developers, I've been happily building packages, under windows, for some time now and upgraded to R 2.1.0 and now when I attempt to build a package, I get the following errors... C:\conifersrcmd build Rconifers * checking for file 'Rconifers/DESCRIPTION' ... OK * preparing 'Rconifers': * checking DESCRIPTION meta-information ... OK * cleaning src * checking whether 'INDEX' is up-to-date ... OK * removing junk files /cygdrive/C/conifers/Rconifers_0.0-3.tar tar: /cygdrive/C/conifers/Rconifers_0.0-3.tar: Cannot open: No such file or directory tar: Error is not recoverable: exiting now tar: /cygdrive/C/conifers/Rconifers_0.0-3.tar: Cannot open: No such file or directory tar: Error is not recoverable: exiting now Error: cannot open file 'Rconifers/DESCRIPTION' for reading C:\conifers When I attempt to create a tar archive by hand, it seems to work just fine (the creation of the tar file that is). So I thought I check out the build script to see where the problem was (not that I knew how to change it.. but it never hurts to look). I found the following lines: my $filename = ${pkgname}_ . $description-{Version} . .tar; my $filepath = file_path($startdir, $filename); ## under Windows, need separate Cygwin and Windows versions of path. my $origfilepath = $filepath; if($WINDOWS) { ## workaround for paths in Cygwin tar $filepath =~ s+^([A-Za-x]):+/cygdrive/\1+; } Jeff, is this the recent version of MinGW, Perl and the tools? And I'm not sure why that's in there. Aren't packages that are built under Windows using the Mingw and MSYS tools exclusively? Should they? Could they? Yes, MinGW, and the tools which are based on some cygwin sources, AFAIK. But you must not have any other cygwin directory in your path. As you can see from the Windows binary package section on CRAN, building packages works perfectly well for us. If it still does not work for you, you might want to start from scratch by cleaning up your path and following the instructions given in the R Installation and Administration manual. Uwe I'm not sure how to fix this and for now, I'll have to revert back to the older version of R (Mongo not happy) so I can continue my work, but I'd like to know either how to fix this, or if it's a problem with my machine's configuration or the package build process under newer versions of R. I see there's a new verion on the horizon and I want to get my building working under it as soon as possible. I do have all the required tools (mingw, cygwin, etc.) in the correct place to build packages under the older version... what's changed? Thanks, Jeff. --- Jeff D. Hamann Forest Informatics, Inc. PO Box 1421 Corvallis, Oregon USA 97339-1421 541-754-1428 [EMAIL PROTECTED] www.forestinformatics.com __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Different package versions on CRAN?
Prof Brian Ripley wrote: On Sun, 8 May 2005, Philippe Grosjean wrote: I am making changes to some of my packages that are exposed in CRAN. Some changes make them incompatible with previous R versions [and I use Depends: R (= 2.1.0)]. I suspect that, as soon as I will upload this new version to CRAN, it will replace the old one _everywhere_? No. It would not be offered as an update to systems running R 2.1.0. However, the previous version of these packages remains perfectly usable with R 1.9.X or 2.0.X. So, will this break the binaries in /windows/contrib/1.9|2.0, or will the latest valid binaries of my packages remain there, not updated? To put it another way, for We do not update binary versions for obselete versions of R. Just look at the dates on the directories: 2.0 was last updated on April 19. And even if we did (the 1.9 directory was AFAIR updated for a bit after 2.0.0 came out) the version depending on R = 2.1.0 would not build and Yes, you are perfectly right. There is also documentation that is even more specific in CRAN/bin/windows/contrib/1.9/ReadMe which tells us: *** This collection is for rw1090/1 only. It is no longer being updated: please update to rw2001. Last update: 15.12.2004. *** I planned to update R-2.0.x also for a while. In fact, too many packages had versions out that depended on R=2.1.0 very quickly (even if not mentioned in the DESCRIPTION file), and it's a whole mess to let the autobuilder decide which package to update, which not, and which to mark to be erroneous. So I decided not to update anything in order not to disarrange the whole repository. so the last good version would be left. Yes, and accordingly CRAN/bin/windows/contrib/ReadMe tells us: ./1.9 Binaries for R-1.9.x - no longer updated ./2.0 Binaries for R-2.0.x - no longer updated ./2.1 Binaries for R-2.1.x - release (AKA r-release) Uwe __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R2HTML bug? shell bug? (PR#7832)
[EMAIL PROTECTED] wrote: Full_Name: Juan José Goyeneche Version: 2.0.1 OS: debian Submission from: (NULL) (164.73.246.102) When I call the R2HTML library I get (most of the time) the following message. library(R2HTML) sh: line 1: -oq: command not found In any case, the R2HTML functions seem to be working fine after that. Should I ignore the sh message? Thanks in advance Juan José Q: What has a question releated to a contributed packages in common with the R bug tracking system? A: NOTHING! This is a point for the package maintainer, not for any R mailing list, and in particular not for the bug tracking system. Please read the FAQs, they are telling you what a bug is and how to report bugs! Please try on a recent version of R (yours is not even the latest official relase), and with a recent version of R2HTML - you have not told us which version you are using. Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Problems compiling C code on windows
Victor Trevino wrote: Hi all, I can't get my C routines running on a windows box. I have no problems at all in Linux. On windows, I have installed cygwin and the compilation works well but once I execute dyn.load(.) it hangs whatever I use C/C++ interfaces. cygwin is not supported. Please read the manuals on how to set upo a working environment under Windows. Uwe Ligges In Linux it works wonderful but I need to get this code running on windows boxes. I know that the problem should be something with the dll generation/linkage in windows but I can't figure out. As a matter of test I did the following C code: #include R.h #include Rinternals.h SEXP thisisatest(SEXP); SEXP thisisatest(SEXP a) { long int i; if (!isReal(a)) printf(Vector should be double.\n); for (i=LENGTH(a)-1; i =0; i--) { REAL(a)[i] = REAL(a)[i] + 1; } return (a); } Linux output: R CMD SHLIB thisisthetest.c gcc -I/usr/lib/R/include -I/usr/local/include -D__NO_MATH_INLINES -mieee-fp -fPIC -O2 -g -pipe -march=i386 -mcpu=i686 -c thisisthetest.c -o thisisthetest.o g++ -shared -L/usr/local/lib -o thisisthetest.so thisisthetest.o In R: dyn.load(thisisthetest.so) .Call(thisisatest,5) [1] 6 [[ WONDERFUL ]] Windows output: L:\RRcmd SHLIB thisisthetest.c making thisisthetest.d from thisisthetest.c gcc -IC:/PROGRA~1/R/rw2001/include -Wall -O2 -c thisisthetest.c -o thisisthetest.o ar cr thisisthetest.a thisisthetest.o ranlib thisisthetest.a gcc --shared -s -o thisisthetest.dll thisisthetest.def thisisthetest.a -LC:/PROGRA~1/R/rw2001/src/gnuwin32 -lg2c -lR In R: dyn.load(thisisthetest.dll) [[ IT HANGS ]] I have tried different combinations in paths (for library search) and compiling inside cygwin. no success. Any comments are very very very welcome. Thanks ! [[alternative HTML version deleted]] __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Speeding up library loading
Ali - wrote: (1) When R tries to load a library, does it load 'everything' in the library at once? No, see ?lazyLoad (2) Is there any options to 'load as you go'? Well, this is the way R does it Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Speeding up library loading
Ali - wrote: UweL Ali - wrote: (1) When R tries to load a library, does it load 'everything' in the library at once? UweL No, see ?lazyLoad are you sure Ali is talking about *package*s. He did use the word library though, and most of us (including Uwe!) know the difference... (2) Is there any options to 'load as you go'? UweL Well, this is the way R does it for packages yes, because of lazyloading, as Uwe mentioned above. For libraries, (you know: the things you get from compiling and linking C code ..), it may be a bit different. What do you really mean, packages or libraries, Ali? Well, the terminology used here is a bit confusing. ?library shows something like 'library(package)' and that's why I used the term 'library' for loading packages. The package does load some dll's but what I meant by library was actually package. The package I am working on currently has one big R file (~ 4 Mb) and this causes at least 2 troubles: (1) Things are slow: (a) Installation with (LazyLoad = Yes) is slow. Then when the library is loaded into R, the loading is slow too. So LazyLoad is of not big help. (b) Installation with (SaveImage = Yes) is -extremely- slow. To give you some idea, compiling the associated C++ code takes around 10 mins while saving the R images takes more than 40 mins (the package is a wrapper for some C++ libraries. All the R functions do is to call .Call). this doesn't improve the loading speed as well. (c) Installation with (LazyLoad = Yes) AND (SaveImage = Yes) causes this error: preparing package package_name for lazy loading make: *** [lazyload] Error 1 *** Installation of package_name failed *** It is likely that this happens because of some memory problems. (2) After all, when the package is loaded, not surprisingly, loads of memory is taken. It seems that the whole (huge) file is loaded into R at once and turning LazyLoad on or off doesn't make a difference when the package is big. __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel 4Mb R file just containing .Call()s? Never seen something like that. If these are all very small functions, lazy load won't be of that advantage, because you have to load the index file anyway. You know, R including all base and recommended packages has just ~ 6Mb of R code. Are you really sure about your code? Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Bug in Version 2010 (PR#7807)
Duncan Murdoch wrote: [EMAIL PROTECTED] wrote: Dr. Michael Breuer 22.04.05 Ökologiezentrum der Universität Kiel Olshausenstraße 75 24118 Kiel Dear Ladies and Sirs, After updating the R-Windows-program (binary) by the latest version (2010), the R-Scripts that I want to execute are not shown in the File-Window anymore. In the former version it worked correct. However, if I call a script by command line, it will be found and intepreted. I tried it on two PCs wirh Windows XP Home and Windows XP Professional SP2. This is not enough information to allow us to try to duplicate your error. Tell us where you keep your scripts, how you start R (the starting directory is likely important), and the exact steps you take to try to show your scripts. Without that information your report is too vague to act on. Duncan Murdoch Looks like it happens with the german (and maybe also other?) translation. I'll take a closer look later. Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Bug in Version 2010 (PR#7807)
[EMAIL PROTECTED] wrote: Duncan Murdoch wrote: [EMAIL PROTECTED] wrote: Dr. Michael Breuer 22.04.05 Ökologiezentrum der Universität Kiel Olshausenstraße 75 24118 Kiel Dear Ladies and Sirs, After updating the R-Windows-program (binary) by the latest version (2010), the R-Scripts that I want to execute are not shown in the File-Window anymore. In the former version it worked correct. However, if I call a script by command line, it will be found and intepreted. I tried it on two PCs wirh Windows XP Home and Windows XP Professional SP2. This is not enough information to allow us to try to duplicate your error. Tell us where you keep your scripts, how you start R (the starting directory is likely important), and the exact steps you take to try to show your scripts. Without that information your report is too vague to act on. Duncan Murdoch Looks like it happens with the german (and maybe also other?) translation. I'll take a closer look later. Uwe Ligges Indeed, if you set LANGUAGE=de using the RGui-de.po as shipped with R-2.1.0, you won't see any files in that dialog. If you copy the english version to the translation, you see ALL files (not only R files as expected), and if you leave the translation blank (i.e. the english version will be displayed), you get the expected behaviour. I guess lines such as setuserfilter(G_(R files (*.R)\0*.R\0S files (*.q)\0*.q\0All files (*.*)\0*.*\0\0)); in rui.c are casuing the trouble. S files (*.q) never appears in the *.po(t) file, so it's probably a gettext related problem, but I really don't know how to fix this ... Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] building recommended packages on Windows
Hiroyuki Kawakatsu wrote: Hi, I am building 2.1.0 (re-release version, if that matters) on a Windows XP machine. Following the instructions 3.1 Building from source in R-admin.html, I managed to get up to 3.1.6. But when I try to build the recommended packages, I get C:\hiro\codes\proj\R-2.1.0\src\gnuwin32make recommended --- Unpacking recommended packages VR make[1]: *** No rule to make target `../library/boot/DESCRIPTION'. Stop. make: *** [unpack-recommended] Error 1 What did I do wrong? In /library/Recommended I do see boot_1.2-22.tar.gz but I don't see the /boot subdirectory in /library. Thanks for any help, Maybe you forgot to unpack with the correct tools? tar xfz R-2.1.0.tar.gz should do the trick using tar from the tools provided un Duncan Murdoch's page, but many other (un)compress tools under Windows cannot deal with the links (e.g. boot.tgz) provided in the Recommended packages' subdirectory. Uwe Ligges h. -- Hiroyuki Kawakatsu School of Management and Economics 25 University Square Queen's University, Belfast Belfast BT7 1NN Northern Ireland United Kingdom Tel +44 (0)28 9097 3290 Fax +44 (0)28 9033 5156 __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] IAB (PR#7788)
[EMAIL PROTECTED] wrote: Full_Name: Doris Söhnlein Version: 1.8.1 OS: XP Submission from: (NULL) (212.204.77.23) It is not possible to save workspace image and the following error messages appear: help.start() updating HTML package listing updating HTML search index Error in file(f.tg, open = w) : unable to open connection In addition: Warning messages: 1: cannot update HTML package index in: make.packages.html(.libPaths()) 2: cannot open file `C:\Programme\R_rw1081/doc/html/search/index.txt' If nothing happens, you should open ` C:\Programme\R_rw1081\doc\html\rwin.html ' yourself q() Error in file(file, wb) : unable to open connection In addition: Warning message: cannot open file `.RDataTmp' Was the installation not correct? a) This is a question. Please ask questions on R-help instead of reporting a bug. And please ask the questions after having read the posting guide. b) R-1.8.1 is OUTDATED (4 versions have been released in the meantime)! R-2.0.1 is recent and R-2.1.0 will be released next week (beta releases are available). Please read what a bug is and how to report bugs but do NOT report bugs of outdated versions of R. To answer your question: We do not know what happened, maybe permission issue, maybe disc-space is running low, or maybe a bug in R. Please check again with a recent version. The directory name R_rw1081 (underscore) seems to be strange, BTW. Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] orphaning CRAN packages
(Ted Harding) wrote: On 09-Apr-05 Uwe Ligges wrote: [EMAIL PROTECTED] wrote: Dear R Developers, the following CRAN packages do not cleanly pass R CMD check for quite some time now and did not have any updates since the time given. Several attempts by the CRAN admins to contact the package maintainers had no success. norm, 1.0-9, 2002-05-07, WARN It would be serious if 'norm' were to lapse, since it is part of the 'norm+cat+mix+pan' family, and people using any of these are likely to have occasion to use the others. I'd offer to try to clean up 'norm' myself if only I were up-to-date on R itself (I'm waiting for 2.1.0 to come out, which I understand is scheduled to happen soon, yes?). Ted, that's great! R-2.1.0 is scheduled to be released on April 18 (see http://developer.r-project.org/). It would be even better if you could try out the recent beta release of R-2.1.0 right now in order to spot some possible bugs before release. So it is the perfect occasion to clean up norm on R-2.1.0 beta this weekend. ;-) Best, Uwe Best wishes, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 09-Apr-05 Time: 13:02:22 -- XFMail -- __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] orphaning CRAN packages
(Ted Harding) wrote: On 09-Apr-05 Uwe Ligges wrote: (Ted Harding) wrote: It would be serious if 'norm' were to lapse, since it is part of the 'norm+cat+mix+pan' family, and people using any of these are likely to have occasion to use the others. I'd offer to try to clean up 'norm' myself if only I were up-to-date on R itself (I'm waiting for 2.1.0 to come out, which I understand is scheduled to happen soon, yes?). Ted, that's great! R-2.1.0 is scheduled to be released on April 18 (see http://developer.r-project.org/). It would be even better if you could try out the recent beta release of R-2.1.0 right now in order to spot some possible bugs before release. So it is the perfect occasion to clean up norm on R-2.1.0 beta this weekend. ;-) Well, I'll see what I can do ... though this weekend may not offer a lot of free time! No need to apologise, I just tried to take advantage of the current enthusiasm on your side. ;-) Bearing in mind Martin's and Dirk's comments, going for 2.1.0-beta right now seems unlikely to lead to any grief compared with waiting for the final release. So at any rate I could start looking at it over the next week sometime. However, there's a question or two. 1. Simply for the sake of having a look at 'norm', I think this may depend only on things which are part of R-base, so I should not need to download any recommended packages. Or are there things in recommended which are likely to be presumed? (I've always taken such things for granted since they have been installed by default when I've installed from RPMs; I've not done a full R compilation before, at least not for several years). 2. Is there a way to get, off CRAN say, a listing of which packages are recommended? I suffer from slow connection (5min/MB if I'm lucky, and lucky to stay fully connected for more than an hour or two -- even R-base is going to take at least an hour), so I don't want to just connect and do tools/rsync-recommended as suggested on CRAN since this may silently drop into a black hole at some point. I'd sooner do it all piecemeal, knowing what's supposed to be on the way and able to start again at that point if there are problems. But this means knowing which are the recommended ones. (This, by the way, is why I'd been waiting for 2.1.0, since it then becomes worth while making an expedition to a fast connection or negotiating with someone to do me a CD; but with the above assurances I suppose I can go ahead now anyway!) Two questions, one answer: The beta versions available from CRAN/src/base-prerelease already contain recommended packages. ./configure make make install should be sufficient, in principle. make check would be nice in order to spot errors on your platform. Uwe Best wishes, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 09-Apr-05 Time: 16:16:35 -- XFMail -- __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: Pacakge norm (was Re: [Rd] orphaning CRAN packages)
(Ted Harding) wrote: On 09-Apr-05 Prof Brian Ripley wrote: The known problems are in the file http://www.r-project.org/nocvs/R.check/r-devel/norm-00check.txt No showstoppers, so given the saga of Ted's connectivity, I would suggest waiting for the release on April 18. There are no declared dependencies, nor did I find any searching the code. Thanks for the pointer. Yes, they look innocuous enough. On the precautionary principle, however, it would be worth dealing with the .Fortran warnings, since this would safeguard against the possibility of name clash if some other package used the same names. Question 1: I take it that all that's needed here is to search for all such calls, e.g. .Fortran(tobsn, ...) and make sure that it one becomes .Fortran(tobsn, ... ,PACKAGE=norm) and so on? Yes, but PACKAGE=norm (quotes!) This could be done without installing any new R (though being able to check against the latest would be added assurance), as also could be possible amendements related to the Rd warnings (which, however, only affect help and other documentation issues). None the less, Question 2. It would still be interesting to test out the compilability of the latest R on the machine I would be installing the new one on anyway (SuSE Linux 7.2 from 2001), since this would have oldish math libs ... I think I have sussed out how to keep different versions of R on the same machine, namely: a) Edit /usr/bin/R and change R_HOME_DIR=/usr/lib/R to R_HOME_DIR=/usr/lib/R-x.y.z as appropriate. b) Rename the directory /usr/lib/R to /usr/lib/R-x.y.z c) Rename /usr/bin/R to /usr/bin/R-x.y.z d) (pro tem) Make a symbolic link ln -s /usr/bin/R-x.y.z /usr/bin/R No, it is much simpler (and cleaner) to specify the installation directory using ./configure --prefix=/the/path/to/R-2.0.1 After make, make install, you can start R-2.0.1 by /the/path/to/R-2.0.1/bin/R Uwe Then one can install a new R without thinking about it, provided one remembers to delete the symbolic link before starting (or will the new installation do this all by itself?). Have I missed anything? Thanks, and best wishes, Ted. __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] new R package BRugs
OK, here we go (since we forgot to address the the Linux folks' problems explicitly - apologies!). *In principle*, you need the 1.5 version of the BlackBox Compiler from http://www.oberon.ch/blackbox.html Details and documentation how to compile are available from the developer manual: http://mathstat.helsinki.fi/openbugs/data/Docu/Developer%20Manual.html *BUT*: - We (Sibylle and Uwe) have not managed to compile OpenBUGS ourselves. - In particular, we have not managed to get the .dll/.so compiled, and Andrew Thomas writes in the developer manual: Please note I am the only person who has the ELF linker at present. That's why we do ship the .so/.dll for now (and later?). Andrew Thomas told us that the .so is supposed to work under some Linux versions (I have never managed to get it to work up to now, but this is high level on the ToDo list). The .dll has been tested on WinNT, WinXP and WinServer2003. Best, Uwe (Ted Harding) wrote: On 08-Apr-05 A.J. Rossini wrote: where does one find a Component Pascal compiler? Does anyone know which one the OpenBUGS project is using? I hesitate to suggest that Tony Rossini might be confused, but I think I am (though I feel a bit confused about that too)! One piece of information which may be helpful (though it hasn't cleared things up for me) is from http://www.math.helsinki.fi/openbugs/ Software A combined version of the OpenBUGS programme for Windows and Linux personel computers can be downloaded as a .zip file from here. There are some instructions for installation on this page. The Windows version of OpenBUGS contains three seperate exectutable files: winbugs.exe for running the GUI Windows version, the shortcut BackBUGS for running a non interative script in WinBUGS and ClassicBUGS, a non Windows command line version of BUGS. BRugs, a set of R functions which reproduce the functionality of the GUI interface, is also avaliable to Windows users. The Linux version of OpenBUGS consists of a single shell script, LinBUGS, which provides the ClassicBUGS interface. At present the BRugs R functions do not work under Linux. The binary distribution of the programme comes with documentation in two formats: *.odc the native WinBUGS format, and *.html which can also be read on Linux personal computers using a web browser. The documentation can also be read online here. The full source code for OpenBUGS is available. The source code for the most recent verion (OpenBUGS 2.1.0) can be downloaded as a .zip file from here The Component Pascal source code consists of a large number of modules of which only a subset are required for the Linux personel computer platform. As to Component Pascal, this seems from my searches to be a outgrowth of Oberon, and apparently at one time was called Garden Point Component Pascal. Garden Point originally produced a version of Modula 2, which was required to compile the old orignal version of BUGS (pre-WinBUGS) on Linux (which I once did, about 10 years ago). So it all seems to be tangled up together, with no clear indication of what you need, nor how to do it, if you want to get BRugs up on Linux. As to getting hold of Component Pascal, while there is documentation on the Oberon Website http://www.oberon.ch there is no indication of how to get the software. It looks as though (though this is not clear either) it may be a commercial product. Hoping this helps, if not to clarify, at least to assist others in their searches! Best wishes to all, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 08-Apr-05 Time: 14:16:00 -- XFMail -- __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] plotCI error when trying to omit upper or lower bars (PR#7764)
[EMAIL PROTECTED] wrote: Full_Name: Volker Franz Version: 2.0.1 (2004-11-15) OS: Mac OSX / Debian Submission from: (NULL) (84.58.8.232) Hi there, the new version of plotCI (Version: 2.0.3 of gplots) produces errors So this is not a bug in R! Please report bugs (if this is really a bug) to the package maintainer. Uwe Ligges if the upper or lower error bars should be omitted by passing NULL as an argument. Older versions of plotCI had no problem with this. Here is an example: library(gplots) means - c(1,2,3,4,5) upperw - c(1,1,1,1,1) lowerw - c(1,1,1,1,1) upper - means+upperw lower - means-lowerw plotCI(x=means,uiw=upperw,liw=lowerw) #Works fine plotCI(x=means,ui=upper,li=lower) #Works fine ##Error with uiw and liw: plotCI(x=means,uiw=NULL,liw=lowerw) #Error: subscript out of bounds plotCI(x=means,uiw=upperw,liw=NULL) #Error: subscript out of bounds ##Error with ui and li: plotCI(x=means,ui=NULL ,li=lower) #Error: Argument uiw is missing, with no default plotCI(x=means,ui=upper,li=NULL) #Error: Argument uiw is missing, with no default ##These are errors, because the plotCI-help says: ## uiw: width of the upper or right error bar. Set to 'NULL' omit ## upper bars. ## liw: width of the lower or left error bar. Defaults to same value ## as 'uiw'. Set to 'NULL' to omit lower bars. ## ui: upper end of error bars. Defaults to 'y + uiw' or 'x + uiw' ## depeding on 'err'. Set to 'NULL' omit upper bars. ## li: lower end of error bars. Defaults to 'y - liw' or 'x - liw' ## depedning on 'err'. Set to 'NULL' to omit lower bars. Best Volker __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] rw2010alpha
Gabor Grothendieck wrote: Until recently R 2.1.0 was called rw2010dev. I just visited http://cran.r-project.org/bin/windows/base/rdevel.html and noticed its now called rw2010alpha, not rw2010dev. I would like to use it without downloading all the libraries over again. Can I - just rename my rw2010dev folder (Windows XP) to rw2010alpha and then install rw2010alpha to that? or yes - install it in a separate rw2010alpha folder, distinct from the rw2010dev folder and then somehow copy the libraries from one to the other? or yes You can also install packages to a separate library and specify that one to be used by both versions. - do I have to download the libraries all over again? or no - some other solution? You can use the packages compiled for R-devel also for R-2.1.0 alpha. Copying/renaming either way should work in this case. Uwe Ligges Thanks. __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] trouble building r-devel
Duncan Murdoch wrote: On Tue, 22 Mar 2005 08:32:33 +0100, Uwe Ligges [EMAIL PROTECTED] wrote : [EMAIL PROTECTED] wrote: Thanks Seth (and Duncan)-- the murdoch-sutherland page seems to fix everything. The slimmed-down INSTALL file in R-devel src gnuwin32 doesn't refer to the page-- it might be good to add a reference. Mark, I disagree. This slimmed-down file points you to the thorough Chapter Installing R under Windows in the `R Installation and Administration' manual in the doc/manual directory. Quite at the top of Section Building from source there is the Subsection Getting the tools. I think we do NOT want to point people to Duncan's page at first, or they would not read the more comprehensive manual any more. This is a problem that is hopefully temporary. Once 2.1.0 is out, it will be reasonable to expect most Windows users to have installed the binary version and have the manual available, the manual will be available online, etc. However, right now a source download only gets the Texinfo source for the manual. The R-devel manual is online availabe at http://stat.ethz.ch/R-manual/ so even this is not a big problem. Uwe But as you say, the manual is the authority on how to do installs. The web page will only have better information if the manual is out of date, and that shouldn't happen before the release. Duncan Murdoch __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] trouble building r-devel
[EMAIL PROTECTED] wrote: Thanks Seth (and Duncan)-- the murdoch-sutherland page seems to fix everything. The slimmed-down INSTALL file in R-devel src gnuwin32 doesn't refer to the page-- it might be good to add a reference. Mark, I disagree. This slimmed-down file points you to the thorough Chapter Installing R under Windows in the `R Installation and Administration' manual in the doc/manual directory. Quite at the top of Section Building from source there is the Subsection Getting the tools. I think we do NOT want to point people to Duncan's page at first, or they would not read the more comprehensive manual any more. Uwe Mark Mark Bravington CSIRO Mathematical Information Sciences Marine Laboratory Castray Esplanade Hobart 7001 TAS ph (+61) 3 6232 5118 fax (+61) 3 6232 5012 mob (+61) 438 315 623 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Seth Falcon Sent: Tuesday, 22 March 2005 3:32 PM To: r-devel@stat.math.ethz.ch Subject: Re: [Rd] trouble building r-devel [EMAIL PROTECTED] writes: cp unicode/iconv.dll ../../modules/ cp: cannot stat `unicode/iconv.dll': No such file or directory make[2]: *** [rmodules] Error 1 make[1]: *** [rbuild] Error 2 make: *** [all] Error 2 See the section Unicode support here: http://www.murdoch-sutherland.com/Rtools/ Basically, you just need to download and then copy the iconv.dll to the right spot and you should be on your way. + seth __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Writing R documentation
Suzette Blanchard wrote: Greetings, I used latex type code in my Rd files. The pdf version using R CMD Rd2dvi --output=PKtools.pdf --pdf --title=PKtools PKtools man came out quite nice. However, my current HTML version does not tex the latex so there is latex code in the files and looks bad. Sorry, I don't understand HTML version does not tex the latex? example problem code: AIC$_c$ or \begin{itemize} \item NLME: \begin{itemize} \item population level: identify(MM\$mm\$fitted[,1], MM\$pkdata\$conc) \item individual level: identify(MM\$mm\$fitted[,2], MM\$pkdata\$conc) \end{itemize} \item NONMEM: \begin{itemize} \item population level: identify(NM\$pred\$PRED, NM\$pred\$CONC) \item individual level: identify(NM\$pred\$IPRE, NM\$pred\$CONC) \end{itemize} \item WinBUGS: \begin{itemize} \item population level: identify(WB\$pred\$ppred, WB\$pred\$conc) \item individual level: identify(WB\$pred\$ipred, WB\$pred\$conc) \end{itemize} Is there a way to fix this? .Rd is not .tex. Please read the manual Writing R Extensions. You cannot use mathematical environments that way. There are \eqn{} environments, if you really need it. Uwe Ligges I tried Rdconv using --type=HTML but that did not work. Any help you can send would be appreciated. Thank you, Suzette = Suzette Blanchard, Ph.D. UCSD-PPRU __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] package.skeleton
James MacDonald wrote: R.version.string [1] R version 2.1.0, 2005-03-17 I don't see anything in either https://svn.r-project.org/R/trunk/NEWS or in the Changes file for R-2.1.0 about changes in package.skeleton() (nor in the help page), but when I run this function, all the .Rd files produced are of the data format even if all I have in my .GlobalEnv are functions. A trivial example is to run the examples from the package.skeleton() help page. I believe there should be two data type and two function type .Rd files, but instead they are all of the data type. Yes, I think package.skeleton() needs the follwing simple fix (since we do not get() each object in prompt() any more - alternatively, reverting some changes in prompt() fixes it as well): @@ -140,7 +140,7 @@ sink(outConn, type = output) yy - try(sapply(list, function(item) { - prompt(item, + prompt(name = item, filename = file.path(path, name, man, paste(list0[item], Rd, sep=.))) })) Uwe Ligges Best, Jim James W. MacDonald Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623 ** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues. __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Package Installation in RGui (PR#7262)
Under Windows, you cannot update / install a package, if the package has been loaded, because Windows locks the dll. This is a FAQ. Uwe Ligges Gorjanc Gregor wrote: Hello! I have just encountered the same situation as Heather and also Paul Gilbert at http://tolstoy.newcastle.edu.au/R/devel/05/02/2095.html I went into install.packages() in current release as well as in R-devel and there is really no problem with \ or /. However, I also had the same warning install.packages(RODBC) [... snip ...] Delete downloaded files (y/N)? y updating HTML package descriptions Warning message: unable to move temp installation 'N:/Ovce/Programi/R/rw2001/library\file27583/RODBC' to 'N:/Ovce/Programi/R/rw2001/library/RODBC' The warning is issued from this part of install.packages() if (ret == 0) { ## Move the new package to the install lib and ## remove our temp dir ret - file.rename(file.path(tmpDir, curPkg), instPath) if(!ret) warning(unable to move temp installation , sQuote(file.path(tmpDir, curPkg)), to , sQuote(instPath), call. = FALSE) } else { ## !! Can't revert to old 'zip.unpack' as it would ## !! potentially leave cruft from a bundle in there stop(Can not remove prior installation of package , sQuote(curPkg), call. = FALSE) } Problem lies in ret - file.rename(file.path(tmpDir, curPkg), instPath) I went through the whole function by hand and at first the above line didn't moved tmpDir to instPath. I tried several times and after a while it was successfull. It is strange that it happens only with some packages i.e. in my case with RODBC and car. I also noted that line above takes quite a lot of time to accomplish its work. It actually causes R to freeze for a moment. If I launched file.rename(file.path(tmpDir, curPkg), instPath) move was done in a moment. I know, that this comment is not the answer to the problem. However, someone might come with that. One more thing. I have R installed on networked disk. I assume that Heather does also, since disk letter is H. On the other hand, Paul reported problems with C disk. Windows XP SP1 R 2.0.1 On Tue, 5 Oct 2004 [EMAIL PROTECTED] wrote: Full_Name: Heather Turner Version: 2.0.0 OS: Windows NT Submission from: (NULL) (137.205.8.2) I tried using the Packages menu to install the gam package and get the following output: local({a - CRAN.packages() + install.packages(select.list(a[,1],,TRUE), .libPaths()[1], available=a, dependencies=TRUE)}) trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/PACKAGES' Content type `text/plain; charset=iso-8859-1' length 21246 bytes opened URL downloaded 20Kb trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/gam_0.92.zip' Content type `application/zip' length 224167 bytes opened URL downloaded 218Kb package 'gam' successfully unpacked and MD5 sums checked Delete downloaded files (y/N)? y Warning message: unable to move temp installation 'H:/rw2000/library\file15762/gam' to 'H:/rw2000/library/gam' I get the same message if I opt to delete the downloaded files and the same problem if I try to install from a downloaded .zip file instead - not really surprising as seems to unpack file okay, but loses the temporary file. As the syntax of the file path for the temporary file is incorrect, I'm assuming this is a bug in install.packages or one of the functions it calls... Since you _incorrectly_ assume that the syntax is incorrect, the rest of your assumption is incorrect. As the FAQ asks, please don't speculate about things you are not expert about, but stick to facts. Also as the FAQ asks, don't misuse R-bugs for things you do not know _for sure_ are bugs in R. FYI, Windows accepts both /and \ in file paths, including a mixture. If your speculation was correct install.packages() would work for no one, and do you seriously think that such a bug would go unreported and unfixed. We have seen this once before, and it was a Windows bug solved by updating Windows to the latest set of patches. Since you have not reported a precise version of Windows, it is hard for us to know what you were using, but if you mean NT4.0, that is rather old (last Service Pack five years ago I read yesterday). __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] spatstat on Win98 (PR#7715)
[EMAIL PROTECTED] wrote: Full_Name: Georg Roth Version: R.2.0.1.for Windows OS: Win98 Submission from: (NULL) (134.95.43.165) You have submitted two bug reports with two different PR#. Please don't do that! Using libraries spatstat and sm on R.2.0.1. under Windows 98 You are talking about *packages*. bug 1) the libraries spatstat and sm are not properly identified by the library() command on R.2.0.1. (R for Windows98). the libraryname is shown in upper case (SPATSTAT) although the original name is in lower case (spatstat) So the *package* name is shown in uppercase? and no good commentary is available - instead the returned commentary in both cases reads **No title available (pre-2.0.0.install?). Are these the most recent version of the packages? Version numbers? Are these compiled for R-2.0.1? Did you download the binary versions from CRAN for R-2.0.x? Or do you use self-compiled ones? Please be more precise when submitting bug reports! i suppose the following problem to be connected with the first bug: bug 2) it is impossible to load the two the libraries spatstat and sm with the command library(libraryname). using different versions like library(SPATSTAT), library(spatstat), or library(spatstat) and the like. And what does the error message (that one for library(spaatstat)) tell you? Please be more precise when submitting bug reports! the same copies of the two libraries work fine in R.2.0.1. on a Windows2000 PC Are you really sure? I guess that the copies are NOT identical, maybe same version number, but at least one (the Win98 one) compiled for R 2.0.0. I do not have any DOS based Windows version around to test, so we need the details. Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Graphics devices file[name] argument
Paul Roebuck wrote: Just got trapped by inconsistency of name of first argument for file-based graphics devices. Both 'file' and 'filename' are currently in use depending on the device. I ran on a machine without PNG support which my code used postscript as the backup device and choked here. Specifying file = . should work because of partial matching. Uwe Ligges do.call(device, list(filename = pathname, height = height, width = width)) --- Method and first argument --- postscript(file, pdf(file, pictex(file, xfig(file, bitmap(file, jpeg(filename, png(filename, bmp(filename, version _ platform sparc-sun-solaris2.9 arch sparc os solaris2.9 system sparc, solaris2.9 status major1 minor9.0 year 2004 month04 day 12 language R Also verified against R 2.0.1 on Windows -- SIGSIG -- signature too long (core dumped) __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Wishlist: simple legend options (PR#7400)
Gregor GORJANC wrote: Hello Uwe. Thanks for the response. I was searching in bug repository for something else and found that wish. Hoewever I tried to do a search for that, so I would not bother R-devel team. I was not successfull in finding any meaningfull comments on legend in http://developer.r-project.org/R.svnlog.2005 Right, because it was done last year: http://developer.r-project.org/R.svnlog.2004 has (among other legend related entries): r32089 | murdoch | 2004-12-02 17:17:43 -0500 (Thu, 02 Dec 2004) | 1 line Changed paths: M /trunk/NEWS M /trunk/src/library/graphics/R/legend.R M /trunk/src/library/graphics/man/legend.Rd legend() enhancements from PR#7400 You are right with NEWS file in R-devel. It really documents this improvement. Very nice. You guys really do an excellent job. I did not looked in NEWS file since it is kind of hidden i.e. one needs to download the R-devel and look in that file. But I confes, it is my blame, not of R-devel folk. However I think, that it would be nice that link to NEWS file would be accessible directly from R websites. I wrote few lines of HTML code that could be added to CRAN webpages for this. I hope r-team or CRAN maintainers will find this usefull. The file is much more easily available via SVN: https://svn.r-project.org/R/trunk/NEWS Uwe Ligges Look files: * A replacement for http://cran.at.r-project.org/sources.html. I added link to last R-devel and R-patched archives and to corresponding NEWS files. However there are now no NEWS files at ftp://ftp.stat.math.ethz.ch/Software/R. I suggest that NEWS files for last R-devel and R-patched should be there, but since there are two, they could be named NEWS-devel and NEWS-patched or something alike. Maybe one could even divide directories ro R-devel and R-pacthed. File is available at: http://www.bfro.uni-lj.si/MR/ggorjan/sources.html * A replacement for http://cran.at.r-project.org/banner.shtml. I added the same as above. File is available at: http://www.bfro.uni-lj.si/MR/ggorjan/banner.shtml Uwe Ligges wrote: Gorjanc Gregor wrote: Hello! I was loooking in R-bugs and found under wishlist-fullfilled wish for smart placement of a legend. This has already been done in package gplots in function smartlegend. One question. This bug-report is under wishlist-fullfilled. Is it really fullfilled? Yes, in the current developer release (AKA R-devel, to be R-2.1.0), as you can easily see in the correpsonding NEWS file and the svn logs. Why do you follow up into the bug repository? Uwe Ligges Mail from Elizabeth --- It would be nice if legend had the option of some default locations you could choose instead of entering specific coordinates, like topleft, topright,topcenter, etc. based on par(usr) coordinates. I know I've wanted it so often I've made my own simple non-robust wrap-around, so I don't have to remember or parse the xjust and yjust options necessary to make it work. Of course there should be the option of entering in your own coordinates. Also it would be nice to be able to put a optional title inside your legend. Currently I just make my title the first value in my legend vector, and then fix the other options so no symbols plot next to it. But this isn't always a pretty result and can be a pain if your symbols are complicated. Thanks, Elizabeth Response to Elizabeth by Duncan Murdoch --- -- Lep pozdrav / With regards, Gregor GORJANC --- University of Ljubljana Biotechnical Faculty URI: http://www.bfro.uni-lj.si Zootechnical Departmentemail: gregor.gorjanc at bfro.uni-lj.si Groblje 3 tel: +386 (0)1 72 17 861 SI-1230 Domzalefax: +386 (0)1 72 17 888 Slovenia __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Wishlist: simple legend options (PR#7400)
Gorjanc Gregor wrote: Hello! I was loooking in R-bugs and found under wishlist-fullfilled wish for smart placement of a legend. This has already been done in package gplots in function smartlegend. One question. This bug-report is under wishlist-fullfilled. Is it really fullfilled? Yes, in the current developer release (AKA R-devel, to be R-2.1.0), as you can easily see in the correpsonding NEWS file and the svn logs. Why do you follow up into the bug repository? Uwe Ligges Mail from Elizabeth --- It would be nice if legend had the option of some default locations you could choose instead of entering specific coordinates, like topleft, topright,topcenter, etc. based on par(usr) coordinates. I know I've wanted it so often I've made my own simple non-robust wrap-around, so I don't have to remember or parse the xjust and yjust options necessary to make it work. Of course there should be the option of entering in your own coordinates. Also it would be nice to be able to put a optional title inside your legend. Currently I just make my title the first value in my legend vector, and then fix the other options so no symbols plot next to it. But this isn't always a pretty result and can be a pain if your symbols are complicated. Thanks, Elizabeth Response to Elizabeth by Duncan Murdoch --- -- Lep pozdrav / With regards, Gregor GORJANC --- University of Ljubljana Biotechnical Faculty URI: http://www.bfro.uni-lj.si Zootechnical Departmentemail: gregor.gorjanc at bfro.uni-lj.si Groblje 3 tel: +386 (0)1 72 17 861 SI-1230 Domzalefax: +386 (0)1 72 17 888 Slovenia __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] getAnywhere and functions starting with . (PR#7684)
[EMAIL PROTECTED] wrote: Full_Name: Mark Bravington Version: 2.0.1 OS: Windows XP Submission from: (NULL) (140.79.22.104) 'getAnywhere' crashes when its argument starts with a period: getAnywhere( '.onLoad') Error in exists(x, envir, mode, inherits) : invalid first argument One fix might be to replace the line if ( !is.null(f - getS3method(gen, cl, TRUE))) { with if ( nchar( gen) !is.null(f - getS3method(gen, cl, TRUE))) { Mark __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel Has already been fixed, as you can easily see, e.g., from R-devels NEWS file, section BUG FIXES: o getAnywhere() was confused by names with leading or trailing dots (spotted by Robert McGehee) Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] barplot: space makes beside=F (PR#7668)
[EMAIL PROTECTED] wrote: Full_Name: Ondrej Medek Version: 2.0.1 OS: Linux/Debian Sarge Submission from: (NULL) (147.32.127.204) Hi, I had a R version 1.5.1 and I used a 'barplot' with 'beside=T' and 'space' has been vector of 8 numbers 'space=c(1,0.5,rep(c(0.5,-0.5),3))'. Then I upgraded to the R 2.0.1 and my graphs are broken. If I use any vector of more than 2 elements for 'space' then the graph is drawn as 'beside=F' even if I specify 'beside=T'. In the previous version my graph was a graph of groups of eight bars separated by a big spaces. Every group consisted of 4 pairs of bars separated by a small space. It's impossible now. This is not a bug. See ?barplot which tells us: space: [...] If height is a matrix and beside is TRUE, space may be specified by two numbers, where the first is the space between bars in the same group, and the second the space between the groups. [...] and it works as described: barplot(matrix(1:10, 2), beside = TRUE, space = c(1, 7)) Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] the incredible lightness of crossprod
Patrick Burns wrote: On my machine the versions are all precompiled R, and I would be very surprised if the same were not the case on the client's machine. That is, no specially compiled BLAS. Hmmm. I always install using some advanced BLAS: On Windows, e.g., simply using the Rblas.dll provided by Brian Ripley, on Linux it's really no effort to compile it yourself. For huge matrices you can use your some-years-old-desktop machine (with some advanced BLAS) to outperform expensive multi-CPU machines (without advanced BLAS). Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] compiling and making R-2.0.1 for windows XP
John Marsland wrote: I am having no luck compiling R-2.0.1 on a Windows XP platform. I have not had these problems when compliling previous versions of R. I've installed all the recommended software and tools. But I cannot get round this error message: make make[1]: `Rpwd.exe' is up to date. make -f Makefile.docfiles make[3]: Nothing to be done for `docfiles'. Building ../../../library/base/R/Rprofile from ../../library/profile/Common.R ../../library/profile/Rprofile.windows mkdir -p ../../../library/base/R cat: not found cat should be among the tools, looks like Duncan's latest release of tools.zip is missing cat (and I have tested the new release by overwriting older files, so I haven't noticed at least one file is missing this time). Uwe make[3]: *** [../../../library/base/R/Rprofile] Error 127 make[2]: *** [fixfiles] Error 2 make[1]: *** [rbuild] Error 2 make: *** [all] Error 2 Can anybody suggest a solution? Thanks, John __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Very Long Expressions
McGehee, Robert wrote: Greetings, I'm having some difficulties with evaluating very long expressions (Windows/Linux 2.0.1), as seen below, and would greatly appreciate any help, thoughts or work arounds. Let's say that I wanted to see what I would get if I added 1 to itself 498 times. One way of doing this would be to evaluate the expression 1+1+1+... eval(parse(text = paste(rep(1, 498), collapse = +))) [1] 498 However, if we try this with 499+ items we get no answer: a - eval(parse(text = paste(rep(1, 499), collapse = +))) a See ?options and set: options(expressions = 1000) eval(parse(text = paste(rep(1, 499), collapse = +))) Uwe Ligges Error: Object a not found And if this eval is passed to any other function, that function exits without error and without returning and object. So it seems that we've reached some upper limit of evaluation terms. While the parser is able to correctly create the long expression, eval does not successfully evaluate it. My problem is that since the evaluator does not return an object, error, or warning, I'm not able to easily code around this problem. Also, I've thought of no easy way to count the terms in the expression to see whether we've breached the upper limit or not. If I were able to see if the eval would work on a particular expression, one thing I had considered was to make an eval.long wrapper that peels terms off the right hand side of an overly-long expression until every sub-expression is legal. Thus, to count to 600 I could just add the first 497 terms with the next 103 terms. eval(parse(text = paste(rep(1, 497), collapse = +))) + eval(parse(text = paste(rep(1, 103), collapse = +))) [1] 600 But without an error or way of figuring out if the expression would even be evaluated, I'm not sure how to know when to start or stop the peeling process. It also may become more complicated when parentheses are introduced. Any help would be greatly appreciated. Thanks, Robert platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major2 minor0.1 year 2004 month11 day 15 language R Robert McGehee Geode Capital Management, LLC 53 State Street, 5th Floor | Boston, MA | 02109 Tel: 617/392-8396Fax:617/476-6389 mailto:[EMAIL PROTECTED] This e-mail, and any attachments hereto, are intended for use by the addressee(s) only and may contain information that is (i) confidential information of Geode Capital Management, LLC and/or its affiliates, and/or (ii) proprietary information of Geode Capital Management, LLC and/or its affiliates. If you are not the intended recipient of this e-mail, or if you have otherwise received this e-mail in error, please immediately notify me by telephone (you may call collect), or by e-mail, and please permanently delete the original, any print outs and any copies of the foregoing. Any dissemination, distribution or copying of this e-mail is strictly prohibited. __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] * creating vignettes ... ERROR
Achim Zeileis wrote: On Fri, 21 Jan 2005 17:33:25 +0100 Philippe Hupé wrote: Dear R developers, I had some problem when building package: for exemple when building the package e1071 available from CRAN, I get the following message error: * checking for file 'e1071/DESCRIPTION' ... OK * preparing 'e1071': * cleaning src * running cleanup * creating vignettes ... ERROR /usr/lib/R/bin/texi2dvi: pdflatex exited with bad status, quitting. /usr/lib/R/bin/texi2dvi: see svmdoc.log for errors. Error in texi2dvi(file = bft, pdf = TRUE, clean = FALSE, quiet = quiet) : running texi2dvi on svmdoc.tex failed Execution halted works for me The system I use is: R2.0.1 under Debian Linux (testing) with kernel 2.6.9-1-686 The pdflatex version is: pdfeTeX (Web2C 7.4.5) 3.14159-1.10b-2.1 kpathsea version 3.4.5 Copyright (C) 1997-2003 The NTS Team (eTeX)/Han The Thanh (pdfTeX). Kpathsea is copyright (C) 1997-2003 Free Software Foundation, Inc. There is NO warranty. Redistribution of this software is covered by the terms of both the pdfeTeX copyright and the GNU General Public License. For more information about these matters, see the files named COPYING and the pdfeTeX source. Primary author of pdfeTeX: The NTS Team (eTeX)/Han The Thanh (pdfTeX). Kpathsea written by Karl Berry and others. I attached the log file svmdoc.log. That did not come true. But my guess is that running LaTeX is what fails (and that the problem is neither in R nor in the Per script). From looking briefly at svmdoc.Rnw, it has a \usepackage{Sweave} so it expects that Sweave.sty is somewhere in your search path. Is that the case? Furthermore, the R code in vignettes should always run, but compiling the resulting .tex file just has to work at build time. So there are vignettes (at least in my packages) that depend on local sty/bib/bst files not included in the package and thus cannot be (easily) compiled by other people. Z Philippe is right. I have seen the log file and it causes the problem. It was me who suggested to write to r-devel. The relevant lines in the log file were: This is pdfeTeXk, Version 3.14159-1.10b-2.1 (Web2C 7.4.5) (format=pdflatex 2005.1.5) 19 JAN 2005 17:37 entering extended mode file:line:error style messages enabled. **\nonstopmode \input /home/phupe/tmp/e1071/inst/doc/svmdoc.tex [SNIP] Output written on svmdoc.pdf (7 pages, 186335 bytes). Note, this is a very modern version of pdf*e*TeX! I don't know whether R is supposed to support it. If so, this is a bug. Uwe Ligges I have a quick look on the perl script build and it seem there is a grep for error. In the log file there is a line with the following: file:line:error style messages enabled it is just the summary of the option used when running pdflatex and then an error is systematically reported. If you have any idea where the problem comes from? Thanks, Philippe -- Philippe Hupé UMR 144 - Service Bioinformatique Institut Curie Laboratoire de Transfert (4ème étage) 26 rue d'Ulm 75005 Paris - France Email : [EMAIL PROTECTED] Tél :+33 (0)1 44 32 42 75 Fax :+33 (0)1 42 34 65 28 __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] running Sweave from Windows XP Explorer
Gordon K Smyth wrote: I'd like to create a suitable batch file or shortcut so that I can run Sweave on a .Rnw or .Rtex file simply by clicking on the file from Windows Explorer in Windows XP (as I do with latex, bibtex etc). This looks tantalisingly possible using R CMD BATCH or Rterm possibly in combination with a .bat file. Has anyone succeeded is setting it up and would give me a pointer? Thanks Gordon __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel As a very simple starting *idea*, a batch file could look like, e.g., R CMD BATCH --no-save c:/myscripts/MakeSweave.R texi2dvi --pdf %1.tex gsview32 %1.pdf with MakeSweave.R: library(tools) for(i in list.files(pattern = \\.Rnw$)) Sweave(i) __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] is there String concating function in R?
Saurin Jani wrote: Hi All, I prob. missed it but I would like to make string concating. Is there any string concating function in R? A - abc; B - .jpeg C - c(A,B); it does not do abc.jpeg in string format..? can anyone guide me ? ?paste Uwe Ligges Thank you, Saurin __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] install.packages and bundles
Warnes, Gregory R wrote: Hi All, Since I changed the gregmisc package into a bundle, I almost daily questions asking how to get the individual packages contained in the bundle. The standard example arises when someone attempts to install and then use my 'genetics' package which depends on the 'gdata' package contained within the 'gregmisc' bundle. The install succedes, but when the user does library(genetics) they get the error message: library(genetics) Loading required package: gdata Error: package 'gdata' could not be loaded The user then attempts to install the package 'gdata' not realizing that it is part of the (e.g.) gregmisc bundle, and can't find it. For example install.packages(gdata) trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/PACKAGES' Content type `text/plain; charset=iso-8859-1' length 24149 bytes opened URL downloaded 23Kb Warning message: No package gdata on CRAN. in: download.packages(pkgs, destdir = tmpd, available = available, Now the user is in trouble and sends me an error message asking how to get the 'gdata' package. A couple of minor changes to the package installation/listing tools would help alleviate this and some related problems. 1) Modify install.packages() so that the by default dependencies=TRUE, since this knows how to find dependencies within bundles. (Why is this FALSE by default anyway? In normal circumstances, is there any reason to install a package without installing its dependencies?) 2) Modify install.packages() to check if a requested package is contained in a bundle, and install the bundle if so. This is already done, at least in R-2.0.1 if dependencies is set to TRUE. 3) Modify CRAN.packages() to list packages contained within bundles as well as independent packages, so that the windows install packages from CRAN menu item will properly show bundled packages. You already get the packages in bundles in the Contains column with CRAN.packages()[,Contains] Uwe Comments? Gregory R. Warnes Associate Director, Non-Clinical Statistics Pfizer Global Research and Development LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}} __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Plot elements echo NULL (PR#7466)
[EMAIL PROTECTED] wrote: Full_Name: Andrew Robinson Version: 2.0.1 OS: FreeBSD Submission from: (NULL) (211.28.168.242) Certain plot elements echo NULL when they are set. For example, plot(1:10,1:10) axis(1) NULL mtext(test) NULL In previous versions the functions were silent. __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel This has been reported by Peter Dalgaard in PR#7397. Please check whether a bug has already been reported before submitting a new report. Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] error in software calculation (PR#7444)
[EMAIL PROTECTED] wrote: Full_Name: ismaele ciani Version: R 2.0.1 OS: windows xp Submission from: (NULL) (80.104.165.254) When creating the histogram, the first cell of the first column and row always renders a value twice that of the true value. Please specify a reproducible example! I guess you have a made the error to plot discrete data with hist() (where barplot is much more appropriate!) and you have only observations on the margins. This is not bug! Please read ?hist. Uwe Ligges __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R, fptex, MikTex
Gabor Grothendieck wrote: According to the following Windows package building info: http://www.murdoch-sutherland.com/Rtools/ fptex is easier to install with the R package building tools than MikTex. I have been using MikTex but was thinking of switching over to fptex to simplify my setup. My concern is that I have other latex files not related to R that use MikTex. I am considering two situations: 1. Both. Has anyone installed both on their system? Are there problems that I should know about if I do that? If it causes me problems will I be able to easily back out of them and get back to my current setup? 2. Convert to fptex. What about converting everything over from MikTex to fptex? What sort of problems can I expect if I switch? Any advice on this? Thanks. __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel I think MikTeX is well maintained these days and can be easily configured to work with R, so no reason to change (at least for me) ... Duncan has put the required information for setting up MikTex together, see his page http://www.murdoch-sutherland.com/Rtools/miktex.html Uwe __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Bug on log.p argument with all stat function (PR#7420)
[EMAIL PROTECTED] wrote: Dear R Developers: I have been playing with R, release 2.0.1 for a week now and have detected = that all stat functions related to distribution probabilities have the same= problem: 1.- The log.p parameter of all distribution functions, when set to TRUE, re= turns a extrange value. Accoding to the manual, when set to true, it should return log(p) probabili= ty. So to my understanding, setting to true this parameters is the same as = getting the LOG of the same function with this parameter set to false. pt (1.1, 5, F, T) [1] 0.8392746 pt (1.1, 5, T, T) [1] 0.5168608 log(pt (1.1, 5, F, T)) [1] -0.1752173 1.- The first line is the lower tail cumulative probability of a 1.1 on a S= tudent T distribution with 5 degrees of freedom. 2.- The second line is the lower tail cumulative probability of a 1.1 on a = Student T distribution with 5 degrees of freedom on a log scale 3.- The third line is the same as the second, but calculated mannually inst= ead of using the log.p parameters Why line 2 and 3 do not return the same result? Please NEVER submit bug reports twice, in particular not an unsensible one! One time ncp = 1, one time ncp = 0, so what's that surprising? Uwe Ligges Reciba un cordial saludo, =0D Jos=E9 Luis Casado Mart=EDnez -- European Computing Consultants C/ Hermanos Garc=EDa Noblejas, N=BA 39, 5=AA, N 1 28037 Madrid Telf.: 34-91-406 19 15. Fax: 34-91-406 19 16 Movil: 34-607-750 316 -- _ Mensaje analizado y protegido, tecnologia antivirus www.trendmicro.es [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Suggestions for packages / help / index (long mail)
Adaikalavan Ramasamy wrote: I am coming a bit late to the thread, so apologies if I am missing something. I believe that it would be more useful to index functions to particular keywords than a package itself. I think we may have over-looked Prof. Harrell's suggestion (https://stat.ethz.ch/pipermail/r-sig-gui/2004-November/000410.html) during the Hidden costs of GPL software thread. His site (http://biostat.mc.vanderbilt.edu/s/finder/finder.html) is quite useful. If this was turned into a wiki or something similar, perhaps it could have much more benefit. Regards, Adai I'd rather support John Fox idea to encourage the use of \concept{} entries much stronger. Uwe Ligges On Wed, 2004-11-24 at 14:15, Eric Lecoutre wrote: At 15:06 24/11/2004, Gabor Grothendieck wrote: Eric Lecoutre lecoutre at stat.ucl.ac.be writes: : 6. Final point has already been discussed in the past. It is about misc : packages and pieces of code. I propose the creation of 5 packages: : - miscGraphics (keywords: misc, Graphics) : - miscStatistics (keywords: misc, Statistics) : - miscMathematics (keywords: misc, Mathematics) : - miscBasics (keywords: misc, Basics) : - miscProgramming (keywords: misc, Programming) Rather than preset the categories perhaps evolving them would be better, just starting out with a single Misc package and then decomposing it into multiple packages as the categories become clear. Those categories are taken from KEYWORDS (master entries). I guess it wouldn't be difficult to still have substancial entries for those packages, if some misc package maintainer would make the job to break their package into pieces. BTW, I have to admit this choice is not easy to make for several reasons, the main one beeing to keep the ability to modify one's own contributions. For those packages, a collaborative plattform such as SourceForge and so on, with Sync-ability, could be a good choice. Eric Eric Lecoutre UCL / Institut de Statistique Voie du Roman Pays, 20 1348 Louvain-la-Neuve Belgium tel: (+32)(0)10473050 [EMAIL PROTECTED] http://www.stat.ucl.ac.be/ISpersonnel/lecoutre If the statistics are boring, then you've got the wrong numbers. -Edward Tufte __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] data() in data/*.R files
Robin Hankin wrote: Hi I'm having difficulty making a package pass R CMD check. I need to read in a dataset from another package, modify it, and have the modified object available in the first package. help(require) says: The source code for a package that requires one or more other packages should have a call to 'require', preferably near the beginning of the source, and of course before any code that uses functions, classes or methods from the other package. and 200update.txt points out that the data/*.R files must be self sufficient, suggesting require(pkg, quietly=TRUE, save=FALSE) if needed. My .R file in the data subdirectory looks like this: require(calibrator, quietly=TRUE, save=FALSE) data(expert.estimates, package=calibrator) paraphrase expert.estimates.modified - some.function(expert.estimates) /paraphrase But if I do this, R CMD check says Error in eval(expr, envir, enclos) : couldn't find function data Execution halted ERROR: installing package indices failed ERROR Installation failed. [the package passes R CMD check if I cut-and-paste a dput and assign expert.estimates.modified directly, and dispense with the data() statement]. How do I load a dataset from another package in a .R file, and use it? You need to require(utils) (the package data() is in), as well as a corresponsing entry in the DESCRIPTION file. Also, for Windows, you may need to add the line ZipData: no to your DESCRIPTION file, but I am not sure about the latter (and haven't tested yet). Uwe __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] [BUG?] xyplot in loop does not work
Valery Khamenya wrote: Hi, the following code produces no graphic output: # library(lattice) library(car) data(Robey) for (i in 1:1) xyplot(tfr~contraceptors, data=Robey) # Yes, because you need to print()! See the FAQs. Uwe Ligges However if line with for is out-commented then one gets graph output. The following versions were tested: - platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major1 minor9.1 year 2004 month06 day 21 language R - platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major2 minor0.0 year 2004 month10 day 04 language R - (Version 2.0.1 were tested too) best regards -- Valery. __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] whishlist: legend - changing color of the boxes-border
Wolski wrote: Hi, Drawing a legend I would like to be able to specify the color of boxes which are drawn if fill or density is specified. eg. legend(0,4,c(raw,LR/PR-TPS),fill=c(1,2),col=c(1,2),density=c(20,20),angle=c(-20,45),bty=n) Currently the color of the boxes -- border is always black and can *not* be changed. To get this option only a *minimal* change is required. Please consider the following code snipped copied from the function legend (package graphics). The sensible line is marked by ###- if (mfill) { if (plot) { fill - rep(fill, length.out = n.leg) rect2(left = xt, top = yt + ybox/2, dx = xbox, dy = ybox, col = fill, density = density, angle = angle, border = black) -- } xt - xt + dx.fill } Changing this line from border=black to border=col. Will enable to specify the color of the boxes borders. If specifying the colors by param _fill_ the parameter _col_ is not used anyway but still available and set already to black in the parameter declaration. Therefore why not use it to specify colors to borders of boxes? No! You want to specify col rather than fill in the following example: plot(1:10) legend(3,3, c(Hello, World), pch=1:2, fill=c(red, black)) But what you can easily do to change the box color is: plot(1:10) opar - par(fg=blue) legend(3, 3, Hello World, pch=20, col=red, text.col=green) par(opar) Uwe Ligges Yours /E Dipl. bio-chem. Eryk Witold Wolski @MPI-Moleculare Genetic Ihnestrasse 63-73 14195 Berlin'v' tel: 0049-30-83875219/ \ mail: [EMAIL PROTECTED]---W-W http://r4proteomics.sourceforg.net __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] bug in methods' 'initialize' (or the functions called in turn) ?
Laurent Gautier wrote: Hi, I experience a very strange behaviour when trying to instanciate a S4 class. A call like 'r - new(MyClass, foo=bar)' returns apparently cleanly, but in fact a subsequent use of 'r' results in a 'r does not exist error message'. After a bit of hunting with 'debug', it seems that the bug is in 'initialize' (or one of the functions it calls in turn). All this while using R-devel from Nov. 16th (R-2.0.1-devel). I did manage to make a simple example to reproduce the bug, but to do so one needs few packages from the bioconductor project. If this is not yet know and one shows interest, I can provide the few lines of code needed to reproduce it. Two points: a) yes, please alsways specify a simple reproducible example when talking about a bug; b) if this bug does not appear in R-2.0.1 but only in the current R-devel, it might be worth to wait a couple of days. Perhaps someone is including some new functionality and has not yet finished the updates. Uwe Ligges L. __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Questions on package creation
Gabor Grothendieck wrote: I have some questions about 1. nomenclature, 2. recommended file locations and 3. overall procedure related to creating packages. To the extent that it matters, examples here relate to Windows XP R 2.0.1 beta. The questions are interspersed and prefaced with ***. My understanding is that there are actually 6 forms of a package that one should use in package development: 1. original package. This refers to the original source files, documentation and other files that the author develops. If source control, e.g. svn, is used then these are the files that are under source control. They are kept in some arbitrary location on one's disk. Let us say \usr\mypackage, for example. *** Is there some standard name for this form of the package? 2. source archive. This is created from the original package like this: cd \Program Files\rw2001beta bin\R CMD build /usr/mypackage You won't need to cd to anything. which creates, say \Program Files\rw2001beta\mypackage_1.0-1.tar.gz The source archive is distinct from the original archive since it is specific to a version of R and excludes the files referenced in \usr\mypackage\.Rbuildignore and others, e.g., .cvs files. *** Is \Program Files\rw2001beta the correct place to put this .tar.gz file? It's arbitrary where to save it, I would not save it in the R directory, though. 3. source tree. This is created from the gzipped tar archive in #2 like this: cd \Program Files\rw2001beta gzip -d mypackage_1.0-1.tar.gz cd src\library tar xvf ..\..\mypackage_1.0-1.tar and is checked like this: cd \Program Files\rw2001beta bin\R CMD check mypackage 4. binary archive. This is created from the source archive in #2 or the source tree in #3: cd \Program Files\rw2001beta bin\R CMD build mypackage --binary or join this with step 5 using R CMD INSTALL --build mypackage which creates \Program Files\rw2001beta\myhpackage_1.0-1.zip *** Is \Program Files\rw2001beta the correct place to put this? ... also arbitrary (as above) ... 5. installed package. This installed by: cd \Program Files\rw2001beta bin\R CMD install mypackage which results in the source package being installed in: \Program Files\rw2001beta\library\mypackage This can alternately be done with the R GUI menu: Packages | Install package(s) from local zip files 6. loaded package. In R using the command: library(mypackage) loads the package into R. This can alternately be done using the R GUI menu: Packages | Load package One might initially skip #3 and #4 and just test the package out in R after #6 and once one is satisfied that it is in good shape repeat the sequence. *** Is all the above the correct and recommended sequence? As always: It depends. Nothing of the above is completely wrong. *** Someone mentioned that --force is important. How does that fit into all this? I still have not used it and am not sure about it. It is used to overwrite the INDEX file. Uwe Ligges __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Questions on package creation
Witold Eryk Wolski wrote: Hi, I mentioned --force R CMD build --force is creating the INDEX file automatically. I use it normally. And in my view in your sequence the point 2. is superfluous in your sequence. You do not need a build neither before check nor INSTALL. No. It might be a good idea to build before (at least when you want to do the final checks before publishing the package), because some files might be excluded from the package during the build process! Uwe Ligges /E Gabor Grothendieck wrote: I have some questions about 1. nomenclature, 2. recommended file locations and 3. overall procedure related to creating packages. To the extent that it matters, examples here relate to Windows XP R 2.0.1 beta. The questions are interspersed and prefaced with ***. My understanding is that there are actually 6 forms of a package that one should use in package development: 1. original package. This refers to the original source files, documentation and other files that the author develops.If source control, e.g. svn, is used then these are the files that are under source control. They are kept in some arbitrary location on one's disk. Let us say \usr\mypackage, for example. *** Is there some standard name for this form of the package? 2. source archive. This is created from the original package like this: cd \Program Files\rw2001beta bin\R CMD build /usr/mypackage which creates, say \Program Files\rw2001beta\mypackage_1.0-1.tar.gz The source archive is distinct from the original archive since it is specific to a version of R and excludes the files referenced in \usr\mypackage\.Rbuildignore *** Is \Program Files\rw2001beta the correct place to put this .tar.gz file? 3. source tree. This is created from the gzipped tar archive in #2 like this: cd \Program Files\rw2001beta gzip -d mypackage_1.0-1.tar.gz cd src\library tar xvf ..\..\mypackage_1.0-1.tar and is checked like this: cd \Program Files\rw2001beta bin\R CMD check mypackage 4. binary archive. This is created from the source archive in #2 or the source tree in #3: cd \Program Files\rw2001beta bin\R CMD build mypackage --binary which creates \Program Files\rw2001beta\myhpackage_1.0-1.zip *** Is \Program Files\rw2001beta the correct place to put this? 5. installed package. This installed by: cd \Program Files\rw2001beta bin\R CMD install mypackage which results in the source package being installed in: \Program Files\rw2001beta\library\mypackage This can alternately be done with the R GUI menu: Packages | Install package(s) from local zip files 6. loaded package. In R using the command: library(mypackage) loads the package into R. This can alternately be done using the R GUI menu: Packages | Load package One might initially skip #3 and #4 and just test the package out in R after #6 and once one is satisfied that it is in good shape repeat the sequence. *** Is all the above the correct and recommended sequence? *** Someone mentioned that --force is important. How does thatfit into all this? I still have not used it and am not sure about it. __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Row labels are skewed in 'heatmap' (PR#7358)
[EMAIL PROTECTED] wrote: Full_Name: Peter Fischer Hallin Version: Version 1.8.1 OS: Irix64 Submission from: (NULL) (130.225.67.236) I've made a script look like this: exp - read.table(graph/1933672048.cluster.data) exp - as.matrix(exp) postscript(graph/1933672048.cluster.data.ps) heatmap(exp,scale=none,cexCol=0.4,cexRow=0.2,col=custom,margins=c(5,5)) The row labels on the output PostScript file are skewed vertically downwards - in fact more than the height of 2 rows! I have roughly 200 rows and 4 columns in my dataset. It is therefor very difficult to see which label goes to which row Please read how to report bugs. In particular, please don't report bugs of outdated R versions! I guess the bug has been fixed by a couple of changes how text in margins is drawn. Please try R-2.0.1 beta and tell us whether the bug is still persistent. In that case, please provide a simple reproducible example (we cannot reproduce the example above!). Uwe Ligges __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] wishlist: better error message in R CMD check
Prof Brian Ripley wrote: On Sat, 6 Nov 2004, Uwe Ligges wrote: Liaw, Andy wrote: Gabor, I guess is that you did not try to run R CMD INSTALL before R CMD check. R CMD check will try to install the package first (in pkg.Rcheck), and only if that's successful would checks be done. The installation process will concatenate all R files in R/ to a single file and essentially source() that in upon package loading. That's where you would see the syntax error. I believe the recommended way is to install the package and play with that a bit first, before doing R CMD check. You'd find some problems are much easier to find that way (e.g., errors in NAMESPACE). Indeed, that is the advice: you often get much more informative error messages that R CMD check hides. To be explicit, install and then load the package and check its basic functionality before R CMD check. However, if you get a syntax error it is either in the NAMESPACE file or one of the *.R files, and sourcing all of them will rapidly find which. From: Gabor Grothendieck I was running R CMD check on Windows XP 2.0.1beta and got this: Error in parse(file, n, text, prompt) : syntax error on 602 I found that syntax errors quite frequently are caused by missing newlines at the end of files. What about changing the build scipts so that a newline is inserted after each of those files? Time to get a better editor, Uwe! Those I use do not allow you to save a .R file without a final NL. (I would have thought you would have learned not to leave an incomplete last line after being bitten a few times. In Emacs, set `Require Final Newline', and it's the default in vi.) Well, you already know I'm using WinEdt which also saves .R files without final newline, but, e.g., Windows' native notepad.exe leaves the final line as is ... However, this is not done by the `build scipts' (or even scripts) but by tools:::.install_package_code_files() at if(!all(file.append(outFile, codeFiles))) stop(unable to write code files) So that is the place to alter this. There would be a small overhead both at INSTALL time and load time (but the latter only for packages which are not save-imaged or lazy-loaded), I suspect a negligible one. In any case file.append could be written more efficiently for this case (outFile is opened for each of the codeFiles) with making sure each file ended in LF made an option. Have not looked that closely - I will put it on my ToDo list, but with a minor priority, i.e. it won't be done this year, if nobody else (like those bitten by the problem) is going to contribute. Uwe __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] wishlist: better error message in R CMD check
Prof Brian Ripley wrote: On Sun, 7 Nov 2004, Uwe Ligges wrote: Prof Brian Ripley wrote: On Sat, 6 Nov 2004, Uwe Ligges wrote: Liaw, Andy wrote: Gabor, I guess is that you did not try to run R CMD INSTALL before R CMD check. R CMD check will try to install the package first (in pkg.Rcheck), and only if that's successful would checks be done. The installation process will concatenate all R files in R/ to a single file and essentially source() that in upon package loading. That's where you would see the syntax error. I believe the recommended way is to install the package and play with that a bit first, before doing R CMD check. You'd find some problems are much easier to find that way (e.g., errors in NAMESPACE). Indeed, that is the advice: you often get much more informative error messages that R CMD check hides. To be explicit, install and then load the package and check its basic functionality before R CMD check. However, if you get a syntax error it is either in the NAMESPACE file or one of the *.R files, and sourcing all of them will rapidly find which. From: Gabor Grothendieck I was running R CMD check on Windows XP 2.0.1beta and got this: Error in parse(file, n, text, prompt) : syntax error on 602 I found that syntax errors quite frequently are caused by missing newlines at the end of files. What about changing the build scipts so that a newline is inserted after each of those files? Time to get a better editor, Uwe! Those I use do not allow you to save a .R file without a final NL. (I would have thought you would have learned not to leave an incomplete last line after being bitten a few times. In Emacs, set `Require Final Newline', and it's the default in vi.) Well, you already know I'm using WinEdt which also saves .R files without final newline, but, e.g., Windows' native notepad.exe leaves the final line as is ... Yes, well, notepad.exe is most programmer's idea of the worst possible editor. Is it not possible to get WinEdt to make sure the final line is complete? Arrgh, sorry, I meant which also saves .R files *with* final newline!!! However, this is not done by the `build scipts' (or even scripts) but by tools:::.install_package_code_files() at if(!all(file.append(outFile, codeFiles))) stop(unable to write code files) So that is the place to alter this. There would be a small overhead both at INSTALL time and load time (but the latter only for packages which are not save-imaged or lazy-loaded), I suspect a negligible one. In any case file.append could be written more efficiently for this case (outFile is opened for each of the codeFiles) with making sure each file ended in LF made an option. Have not looked that closely - I will put it on my ToDo list, but with a minor priority, i.e. it won't be done this year, if nobody else (like those bitten by the problem) is going to contribute. It is already done in R-devel, but I had to work quite hard to make a test example (I used WordPad, in the end). Great, thanks! Uwe __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Re: [R] Building a package under WIN2000 / rw2.0
BXC (Bendix Carstensen) wrote: I have an odd problem in building a package with only R-code in it. I have a package mainly used by myself which I last build under R 1.9.0. The operation system is Win2000 5.00.2195, Service Pack 3 When I do: c:\stat\r\rw2000\bin\Rcmd install --docs=normal --build --library=c:\stat\R\bxc\library c:\stat\R\bxc\library.sources\xx [moved to R-devel] Works with forward slashes as follows: c:\stat\r\rw2000\bin\Rcmd install --docs=normal --build --library=c:\stat\R\bxc\library c:/stat/R/bxc/library.sources/xx The seems to be related with the more recent threads Re: [Rd] wishlist: better error message in R CMD check [Rd] creating a package without lazy loading on R-devel. I'll try to debug. Uwe Ligges then after updating help pages I get: preparing package xx for lazy loading Error in tools:::.read_description(file) : file '/DESCRIPTION' does not exist Execution halted make: *** [lazyload] Error 1 *** Installation of xx failed *** (Yes, I have a DESCRIPTION file). Having made a few changes here and there in some of the functions I transferred them one at a time to a new folder and tried to build it there. The probelm seems to be that once I exceed 5 functions in the package the above error appears, with 5 or fewer functions it works OK. Any ideas? Bendix Carstensen -- Bendix Carstensen Senior Statistician Steno Diabetes Center Niels Steensens Vej 2 DK-2820 Gentofte Denmark tel: +45 44 43 87 38 mob: +45 30 75 87 38 fax: +45 44 43 07 06 [EMAIL PROTECTED] www.biostat.ku.dk/~bxc __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] wishlist: better error message in R CMD check
Liaw, Andy wrote: Gabor, I guess is that you did not try to run R CMD INSTALL before R CMD check. R CMD check will try to install the package first (in pkg.Rcheck), and only if that's successful would checks be done. The installation process will concatenate all R files in R/ to a single file and essentially source() that in upon package loading. That's where you would see the syntax error. I believe the recommended way is to install the package and play with that a bit first, before doing R CMD check. You'd find some problems are much easier to find that way (e.g., errors in NAMESPACE). Cheers, Andy From: Gabor Grothendieck I was running R CMD check on Windows XP 2.0.1beta and got this: Error in parse(file, n, text, prompt) : syntax error on 602 I found that syntax errors quite frequently are caused by missing newlines at the end of files. What about changing the build scipts so that a newline is inserted after each of those files? Uwe Ligges After a lot of aggravation I finally discovered that if I did this: copy *.R allofthem.R and checked line 602 in allofthem.R that I could find the error. I noticed that there are repeated references in the help archives to this sort of error and how hard it is to locate it. It certainly would be nice to tell the user which file the error is in and to point to the original files, not some intermediate file or if one must do it in terms of intermediate files to keep the file around and tell the user which and where it is. __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Code/doc inconsistancy in constrOptim (PR#7346)
Code in constrOptim() (R-2.0.0, package stats): if (any(ui %*% theta - ci = 0)) stop(initial value not feasible) but the help page tells us in Section Details: The feasible region is defined by ui %*% theta - ci = 0. Uwe Ligges --please do not edit the information below-- Version: platform = i386-pc-mingw32 arch = i386 os = mingw32 system = i386, mingw32 status = major = 2 minor = 0.0 year = 2004 month = 10 day = 04 language = R Windows NT 4.0 (build 1381) Service Pack 6 Search Path: .GlobalEnv, package:methods, package:stats, package:graphics, package:grDevices, package:datasets, package:utils, package:fortunes, Autoloads, package:base __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] idea (PR#7345)
[EMAIL PROTECTED] wrote: Full_Name: Dan B Version: 2 OS: Fedora 2 Submission from: (NULL) (80.6.127.185) It would be great if something like currentPlot - edit(par) allowed dynamic changes to the 'currentPlot', which I am using as some kind of 'magic' keyword in the above context. i.e. the value of 'currentPlot' is actually an alias for whatever the current graphical object is. calling the above command would open the edit pannel for the par options relevant to whatever the currentPlot object was. The changes made to par would trigger an automatic redraw of the plot, to allow dynamic editing. After the changes were made and edit closed, a copy of the edited par could be taken to allow the settings to be automatically applied in the future. Dynamic editing of all object variables could be supported through this mechanism to allow a very flexible overall control of graphical objects. __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel Nice idea. Do you have any schedule for which R release R-core can include your contribution? Do you get it ready for R-2.1.0? In particlular, I'm very interested in the way you are going to include this feature for non-screen devices such as postscript()... Uwe Ligges __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] error in chron object library
[EMAIL PROTECTED] wrote: Times series of rain and discharge in hydrologic - stations has above 95 years of daily records. In the temporal series over serie dataframe, using chron's object: library(chron) # load chron library length(serie$data) [1] 27182 serie$data[length(serie$data)] [1] (85-12-31 00:00:00) # 1985-dez-31 00:00:00hs serie$data[1] [1] (11-08-01 00:00:00) # 1911-aug-01 00:00:00hs serie$data[length(serie$data)] -serie$data[1] # error, correct value is: 27181 I guess you get something negative,because the year you have coded is 2011 rather than 1911! But I cannot be sure because you have not specified any reproducible example. Also, you have not said what the error message is. Which version of R, chron and the OS? Please read the posting guide! Uwe Ligges which are the solution? Juan S. Ramseyer __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] error in chron object library
[EMAIL PROTECTED] wrote: I guess you get something negative,because the year you have coded is 2011 rather than 1911! yes, you are correct! I'm using a routine for file format transform output_file - leSRHchron(input_file) So you know how to solve it now? If not, what is leSRHchron()??? Uwe Ligges and other routine for save output_file, but, in the output_file, year is save in short format. thank you, Juan. Em Qui, 2004-11-04 s 10:43, Uwe Ligges escreveu: [EMAIL PROTECTED] wrote: Times series of rain and discharge in hydrologic - stations has above 95 years of daily records. In the temporal series over serie dataframe, using chron's object: library(chron) # load chron library length(serie$data) [1] 27182 serie$data[length(serie$data)] [1] (85-12-31 00:00:00) # 1985-dez-31 00:00:00hs serie$data[1] [1] (11-08-01 00:00:00) # 1911-aug-01 00:00:00hs serie$data[length(serie$data)] -serie$data[1] # error, correct value is: 27181 I guess you get something negative,because the year you have coded is 2011 rather than 1911! But I cannot be sure because you have not specified any reproducible example. Also, you have not said what the error message is. Which version of R, chron and the OS? Please read the posting guide! Uwe Ligges which are the solution? Juan S. Ramseyer __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Re: [R] case-insensitive ZIP
Primer, Jeremy (FID) wrote: Uwe and Brian, Thanks for your attention to this one. We currently have the following array of atypical situations in our corporate installation: (1) Central install directory, where I neither have nor can reasonably want Administrator priviledges; (2) IT staff willing to maintain R officially but wants to leave *contributed* packages to user groups if at all possible; (3) Direct access from R to the CRAN not working through any of the methods owing to the proxy server. So I downloaded some 40 contributed package *.ZIP files directly from CRAN using Internet Explorer, then ran install.packages() in R on these local zipfiles with parameter CRAN=NULL. Except for the case-sensitivity of the *.zip extension in install.packages(), which I amended myself, this appears to have worked fine, passed checksums, etc. Since I installed the packages with install.packages() and they passed checksum, I don't see why they would not work. Some simple tests worked, and setting libPaths() and running installed.packages() suggests that R knows what it has. No, I mean that some self zipped .ZIP files won't work generally. Those on CRAN are build with R CMD INSTALL --build, and they do have the extension .zip rather than .ZIP. So it looks like your web browser does strange things with the extension. Uwe Ligges I can continue on fine as is, so the remaining question is whether install.packages() should be amended for other users. I felt it did not fulfill its contract in a basic way. However, I did enjoy learning about R debug facilities, something I'll need to know Regards, Jeremy Primer -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 02, 2004 3:45 AM To: Uwe Ligges Cc: Primer, Jeremy (FID); R-devel Subject: Re: [Rd] Re: [R] case-insensitive ZIP On Tue, 2 Nov 2004, Uwe Ligges wrote: Primer, Jeremy (FID) wrote: A development note: In the function install.packages, it would be helpful to those of us who have atypical installations and install manually from ZIP files to Perhaps you could tell us why you do this? Where do you get `contributed zipfiles' that are actually `ZIPfiles', especially as CRAN has .zip files you could get instead? Or is the problem in the way you get them? have pkgnames - sub(\\.zip$, , pkgnames) replaced with pkgnames - sub(\\.zip$, , pkgnames, ignore.case = TRUE) because the contributed zipfiles are ZIPfiles. The routine did not work for me out of the box. [moved to R-devel] Hmmm. Recent versions of R require correctly installed versions (using R CMD INSTALL) of the packages. It is hard work to get a file called *.ZIP (rather than *.zip) that contains a valid binary package for Windows. I'd vote against such a change, since the recent behaviour suggests perfectly well that the file probably won't work. Nothing stops people with `atypical installations' amending functions to suit their atypicality, but it is usually better to fix your local problems that expect your tools to workaround them. [Analogously, R CMD INSTALL will not install .tgz files on Unix, even though some people distribute them: they are (equally) not a supported format.] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R-2.0.0/lib/R/bin/INSTALL (PR#7329)
Martin MOKREJ wrote: Dear all, I tried to follow http://www.bioconductor.org/faq.html#getBioC to install it, and that's why I got to the problem. Using getBioC to obtain Bioconductor packages 1. From your R session, type: source(http://www.bioconductor.org/getBioC.R;) [SNIP] Maybe, there are items 3-5 lost. The document doesnt even say how to close R. I doubt thise section is NOT for newbies, this describes how to get the things installed, right? ;-) So, typing quit at the prompt doesn't help, btw. ^d is better, the only problem is I've no idea if I should say y or n tot he question if I want to save my temporary image To the INSTALL script actually I got via this problem: Loading required package: tools Welcome to Bioconductor [SNIP] Two points: a) Please read the manual An Introduction to R, among many other things, it tells you how to close R and how to answer the question whether to save the workspace or not - it also tells you what the workspace is. b) Please ask questions related to the Bioconductor project on its own mailing list. At the moment, package management of Bioconductor is a bit different from R's native package management. Uwe Ligges __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] NextMethod ignoring changed argument
Gabor Grothendieck wrote: Is this a bug? We define the [ operator for class test. All it does is force drop to be FALSE and then calls the NextMethod. If we specify drop= in the call then it works as expected (### 2 and ### 3) but if we do not specify drop (### 1) then it acts as if drop=TRUE even though we have set it to FALSE within [.test . [.test - function(x, i, j, drop = TRUE) { + drop - FALSE + NextMethod([) + } x - structure(matrix(1:12, 4, 3), class = test) x[1,] ### 1 - why does it ignore drop=FALSE in [.test [1] 1 5 9 x[1,,drop = TRUE] ### 2 - ok [,1] [,2] [,3] [1,]159 x[1,,drop = FALSE] ### 3 - ok [,1] [,2] [,3] [1,]159 R.version.string # windows XP [1] R version 2.0.0, 2004-10-04 Well, the *arguments* of the encolsing function are taken, but not the objects defined therein. What you can do is: [.test - function(x, i, j, drop = TRUE) { NextMethod([, drop = FALSE) } Uwe Ligges __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Re: [R] persp(), scatterplot3d(), ... argument
Jari Oksanen wrote: On Wed, 2004-10-27 at 11:11, Uwe Ligges wrote: Jari Oksanen wrote: On Wed, 2004-10-27 at 10:04, Uwe Ligges wrote: This is a larger problem if 1. one of the underlying functions does not have ... 2. you want to relay arguments to two or more underlying functions, and 3. you don't want to list all possible arguments in your function definition, since it is long enough already. The solution is still there, but it is (black) magic. For instance, 'arrows' does not have ..., so you must add them with this magical mystery string: formals(arrows) - c(formals(arrows), alist(... = )) You don't need it for simple things like: foo - function(...){ plot(1:10) arrows(1,1,7,7,...) } foo(lwd=5) # works! That's why I had point 2 above: it really would work with simpler things. However, the following may fail: parrow - function (x, y, ...) { plot(x, y, ...) arrows(0, 0, x, y, ...) invisible() } parrow(runif(10), runif(10), col=red) # works parrow(runif(10), runif(10), col=red, pch=16) Error in arrows(0, 0, x, y, ...) : unused argument(s) (pch ...) Adding formals would help. As always, useful patches are welcome. I don't know if this counts as a useful patch, but it is patch anyway: diff -u2r old/arrows.R new/arrows.R --- old/arrows.R2004-10-27 11:32:25.0 +0300 +++ new/arrows.R2004-10-27 11:32:53.0 +0300 @@ -1,5 +1,5 @@ arrows - function (x0, y0, x1, y1, length = 0.25, angle = 30, code = 2, -col = par(fg), lty = NULL, lwd = par(lwd), xpd = NULL) +col = par(fg), lty = NULL, lwd = par(lwd), xpd = NULL, ...) { .Internal(arrows(x0, y0, x1, y1, length = length, angle = angle, [moved to r-devel!] At least a patch for the docs is missing (pointing out that passing args through ... won't have any effect) - and depending on what R-core thinks about this issue. Uwe Ligges cheers, jari oksanen __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] install.packages question / suggestion
Prof Brian Ripley wrote: On Fri, 22 Oct 2004, Thomas Stabla wrote: when trying to write an R-file, which automatically installs and updates a given list of packages, Many of us already have scripts of that sort. I had two problems with install.packages() 1) install.packages(package) will install package, no matter if package has already been installed. 2) the readline() at the end of install.packages, which asks the user, if the downloaded files should be deleted, makes it difficult to delete packages automatically after installation (I must admit, I'm not quite familiar with R CMD BATCH) Question/Request: Is the behaviour in 1) intended? Most definitely. I might want to install it in another library, or to reinstall it under the current version of R. It is very easy to tailor the input to meet your needs, as update.packages() does. There is install.packages() to help you here. 2) I'd like to have another bool argument, which determines, if the downloaded files should be deleted. What do you think 'destdir' is there for? If set, this check is skipped. You can set it to tempdir() if you like, which is wiped at the end of the session. Arrgh, ignore my former message. Brian is right, of course. Uwe __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] pnorm problem (PR#7302)
[EMAIL PROTECTED] wrote: Full_Name: Morten Welinder Version: 2 OS: Solaris(sparc) Submission from: (NULL) (65.213.85.208) Works for me with R-2.0.0, Solaris 5.7 (UltraSparc), gcc-3.2.3, 32-bit. So you have to specify compiler version, OS version, R version etc. much more precisely. Uwe Ligges (gdb) p pnorm(-10.1, 0.0, 1.0, 0, 1) $42 = NaN(0xf) Expected: -0 (gdb) p pnorm(-10.0, 0.0, 1.0, 0, 1) $43 = -0 Good. (I know this is not a typical usage.) __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] plotmath in underlined style; was: Re: [R] Underline in expression(). (PR#7286)
This is a multi-part message in MIME format. --060203010607060006000807 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit In order not to forget it (I have not got any answer so far) ... Uwe Ligges Original Message Subject: plotmath in underlined style; was: Re: [R] Underline in expression(). Date: Sun, 26 Sep 2004 18:50:02 +0200 From: Uwe Ligges [EMAIL PROTECTED] Organization: Fachbereich Statistik, Universitaet Dortmund To: John Janmaat [EMAIL PROTECTED], [EMAIL PROTECTED] CC: [EMAIL PROTECTED] References: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Please find attach a patch to include the feature to draw underlined mathematical annotation. Here is an example according to the feature request given below: plot(0:1, 0:1, type=n) text(0.5, 0.5, expression(underline(widehat(x %*% y Since I am too late for R-2.0.0, should I send this one to r-bugs so that we do not forget? Uwe John Janmaat wrote: Sundar, Thanks. Unfortunately, I am looking for something that also works in the margins of the plot. John. Sundar Dorai-Raj wrote: John Janmaat wrote: Hello All, Is there an analogue to \underbar or the AMS math \underline in graphical math expressions? Thanks, John. Uwe Ligges posted a solution a couple of years ago. I don't know if there is anything built in yet. ?plotmath does not seem to say anything about underlining. http://finzi.psych.upenn.edu/R/Rhelp01/archive/7191.html plot(0:1, 0:1, type=n) underlined(0.5, 0.5, expression(widehat(x %*% y))) --sundar __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html --060203010607060006000807 Content-Type: text/plain; name=plotmath.Rd.diff Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=plotmath.Rd.diff --- y:\recent\R\src\library\grDevices\man\plotmath.Rd 2004-09-26 18:34:28.0 +0200 +++ plotmath.Rd 2004-09-26 18:25:22.0 +0200 @@ -91,6 +91,7 @@ \code{textstyle(x)} \tab draw x in normal size \cr \code{scriptstyle(x)} \tab draw x in small size \cr \code{scriptscriptstyle(x)} \tab draw x in very small size \cr +\code{underline(x)} \tab draw x underlined\cr \code{x ~~ y}\tab put extra space between x and y \cr \code{x + phantom(0) + y} \tab leave gap for 0, but don't draw it \cr \code{x + over(1, phantom(0))} \tab leave vertical gap for 0 (don't draw) \cr --060203010607060006000807 Content-Type: text/plain; name=plotmath.c.diff Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=plotmath.c.diff --- y:\recent\R\src\main\plotmath.c 2004-09-26 18:31:11.0 +0200 +++ plotmath.c 2004-09-26 18:48:17.0 +0200 @@ -1806,6 +1806,46 @@ return CombineAlignedBBoxes(numBBox, denomBBox); } +static BBOX RenderUnderline(SEXP expr, int draw, mathContext *mc, R_GE_gcontext *gc, GEDevDesc *dd) +{ +SEXP body = CADR(expr); +BBOX BBox; +double width, adepth, depth, x[2], y[2]; +double savedX = mc-CurrentX; +double savedY = mc-CurrentY; + +BBox = RenderItalicCorr(RenderElement(body, 0, mc, gc, dd), 0, mc, gc, dd); +width = bboxWidth(BBox); + +mc-CurrentX = savedX; +mc-CurrentY = savedY; +BBox = RenderElement(body, draw, mc, gc, dd); +adepth = 0.1 * XHeight(gc, dd); +depth = bboxDepth(BBox) + adepth; + +if (draw) { +int savedlty = gc-lty; +double savedlwd = gc-lwd; +mc-CurrentX = savedX; +mc-CurrentY = savedY; +PMoveUp(-depth, mc); +x[0] = ConvertedX(mc, dd); +y[0] = ConvertedY(mc, dd); +PMoveAcross(width, mc); +x[1] = ConvertedX(mc, dd); +y[1] = ConvertedY(mc, dd); +gc-lty = LTY_SOLID; +gc-lwd = 1; +GEPolyline(2, x, y, gc, dd); +PMoveUp(depth, mc); +gc-lty = savedlty; +gc-lwd = savedlwd; +PMoveTo(savedX + width, savedY, mc); +} +return EnlargeBBox(BBox, 0.0, adepth, 0.0); +} + + static int OverAtom(SEXP expr) { return NameAtom(expr) @@ -1817,6 +1857,17 @@ return RenderFraction(expr, 1, draw, mc, gc, dd); } +static int UnderlAtom(SEXP expr) +{ +return NameAtom(expr) NameMatch(expr, underline); +} + +static BBOX RenderUnderl(SEXP expr, int draw, mathContext *mc, R_GE_gcontext *gc, GEDevDesc *dd) +{ +return RenderUnderline(expr, draw, mc, gc, dd); +} + + static int AtopAtom(SEXP expr) { return NameAtom(expr) NameMatch(expr, atop); @@ -2809,6 +2860,8 @@ return RenderAccent(expr, draw, mc, gc, dd); else if (OverAtom(head)) return RenderOver(expr, draw, mc, gc, dd); +else if (UnderlAtom(head)) +return RenderUnderl(expr, draw, mc, gc, dd); else if (AtopAtom(head
Re: [Rd] is.vector() gives error (PR#7288)
[EMAIL PROTECTED] wrote: Full_Name: Jelle Goeman Version: 2.0.0 OS: windows Submission from: (NULL) (145.88.209.33) I get a strange error: is.vector(1:10) Error: recursive default argument reference Works for me. Looks like your installation is broken, or do you have loaded some strange packages? Uwe Ligges What's recursive about is.vector? Kind regards, Jelle Goeman My R: platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major2 minor0.0 year 2004 month10 day 04 language R __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] inst directory
Bob Wheeler wrote: R CMD check on a Windows system, halts with the following; installing inst files FIND: Parameter format not correct Ahh! You have to add the tools set in the path before the Windows system directory, because this way Windows' find was found rather than the one from the tools set. Uwe Ligges make[2]: *** [C:/AlgDesign/AlgDesign.Rcheck/AlgDesign/inst]Error 2 make[1] *** [all] Error 2 make: *** [pkg-AlgDesign] Error2 *** Installation of AlgDesign failed The inst directory contains the sub directory doc with a pdf and dvi file. Any sub directory in inst seems to cause this problem. The check was OK prior to 1.9.0. What has changed? If it is in the R documentation, I have missed it. __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] LazyLoad Depends
Paul Gilbert wrote: I have added LazyLoad and LazyData to the DESCRIPTION files for my packages. This does not seem to cause problems with R-1.9.1 (although, if I understand correctly, it does not do anything). Should I be specifying Depends: R (= 1.9.1) or Depends: R (= 2.0.0)? What about older versions? If your package still works for older versions of R (and you do know it), why do you want to exclude them? Uwe Paul Gilbert __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] two help problems in R-2.0.0 for Windows (PR#7269)
Prof Brian Ripley wrote: On Thu, 7 Oct 2004 [EMAIL PROTECTED] wrote: Well, for htmlhelp, there is another error. The browser (e.g. Mozilla 1.7.3) tries to open T:\R\library\stats\html/Normal.html and has problems with different kinds of slashes (/ vs. \). I can't reproduce that. I get forward slashes only. Can you track down where the \ are coming from? Brian, you are right, in the object file, there are only forward slashes. Looks like Mozilla (1.7.3) cannot interpret T:/R/library/stats/html/Normal.html and it changes the string in its navigation bar to: T:\R\library\stats\html/Normal.html Specifying file:///T:/R/library/stats/html/Normal.html works, but the file:/// part seems to be required if using forward slashes. Note that the fix to use chartr(/, \\, file) is also used in help.start(). I guess there was a reason to include it. options(chmhelp=FALSE, htmlhelp=TRUE) ?dnorm # does not work! This can be fixed by changing line 4 in .../src/library/utils/R/windows/help.R as follows: -browseURL(file) +browseURL(chartr(/, \\, file)) AArgh, I've never used non-text help pages in the developer releases ... and obviously nobody else ... Well, I have and Firefox works properly, for example. I've not used Mozilla recently as Firefox seems rather better. I also checked, and IE6 works too. Do you have a browser set (options(browser=)), or are you relying on file associations? The latter. Since this is to be a file:// URL, I believe forward slashes are correct, but we are at the mercy of Windows browser providers. See above. The line browseURL(paste(file://, file, sep=/)) works for me. Uwe Brian __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] two help problems in R-2.0.0 for Windows (PR#7269)
R-2.0.0, WinNT / WinXP: options(chmhelp=TRUE) ?dnorm # does not work! ?Normal # works! Looks like calling compiled html help does not work for aliases, but only for the title of help pages... And a quick fix without changing the design is to change lines 136-137 in .../src/library/utils/R/help.R as follows: -err - .C(Rchtml, hlpfile, topic, -err = integer(1), PACKAGE = )$err +err - .C(Rchtml, hlpfile, rev(strsplit(file, /)[[1]])[1], +err = integer(1), PACKAGE = )$err but I think it is a problem by design and the name of the help pages should be returned by help() as well (not only implicitly). Well, for htmlhelp, there is another error. The browser (e.g. Mozilla 1.7.3) tries to open T:\R\library\stats\html/Normal.html and has problems with different kinds of slashes (/ vs. \). options(chmhelp=FALSE, htmlhelp=TRUE) ?dnorm # does not work! This can be fixed by changing line 4 in .../src/library/utils/R/windows/help.R as follows: -browseURL(file) +browseURL(chartr(/, \\, file)) AArgh, I've never used non-text help pages in the developer releases ... and obviously nobody else ... Uwe Ligges __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Favor
Gustavo Corral wrote: Hello: I want to write my thesis about the design and implementation of R, Great! What kind of contributions to R's implementation can we expect? If you are not yet certain, there are many proposals on the page http://developer.r-project.org/ , some of those untackled yet... Uwe Ligges but I have not enough information and that's why I'm looking for the article Lexical Scope and Statistical Computing from Gentleman, but I don't want for the moment subscribe me to the American Statistical Association to download the article. Could anyone of you send me that article?? Thanks Gustavo Corral __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Package Installation in RGui (PR#7262)
[EMAIL PROTECTED] wrote: Full_Name: Heather Turner Version: 2.0.0 OS: Windows NT Submission from: (NULL) (137.205.8.2) Works for me. Do you have the right permissions? Is there free space on drive H:? Uwe Ligges I tried using the Packages menu to install the gam package and get the following output: local({a - CRAN.packages() + install.packages(select.list(a[,1],,TRUE), .libPaths()[1], available=a, dependencies=TRUE)}) trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/PACKAGES' Content type `text/plain; charset=iso-8859-1' length 21246 bytes opened URL downloaded 20Kb trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/gam_0.92.zip' Content type `application/zip' length 224167 bytes opened URL downloaded 218Kb package 'gam' successfully unpacked and MD5 sums checked Delete downloaded files (y/N)? y Warning message: unable to move temp installation 'H:/rw2000/library\file15762/gam' to 'H:/rw2000/library/gam' I get the same message if I opt to delete the downloaded files and the same problem if I try to install from a downloaded .zip file instead - not really surprising as seems to unpack file okay, but loses the temporary file. As the syntax of the file path for the temporary file is incorrect, I'm assuming this is a bug in install.packages or one of the functions it calls... Heather __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] bug in power.t.test( ) (PR#7245)
Martin Maechler wrote: UweL == Uwe Ligges [EMAIL PROTECTED] on Fri, 24 Sep 2004 08:43:56 +0200 (CEST) writes: UweL [EMAIL PROTECTED] wrote: Full_Name: Mai Zhou Version: 1.9.1 OS: Win XP Professional Submission from: (NULL) (12.222.227.93) power.t.test(n=25, delta=0.1, sig.level=1.1, strict=TRUE, type=one.sample) One-sample t test power calculation n = 25 delta = 0.1 sd = 1 sig.level = 1.1 power = 1.088311 alternative = two.sided ### power can never be over one! Of course, sig.level should not take value 1 ### either. ### Possible solution: A check in the input to truncate sig.level into [0, 1]?? UweL Well, an error (or at least warning) message seems to UweL be more appropriate rather than silently changing some UweL values, e.g. somehwere at the top of the functions UweL body: UweL if(any(sig.level 0 | sig.level 1)) UweL stop(sig.level must be in [0,1]) yes, in principle; thank you, Uwe! Since sig.level can also be NULL Yes. (which works with the way you constructed the test - on purpose?), I'd use the test a bit differently. BTW, did you know that e.g., sig.level or delta can be *vectors* Yes, hence the | rather than ||. Uwe giving vectorized results - at least in some cases... That will hopefully leed to more documentation / code updates, but not for 2.0.0 I presume. Martin Maechler __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] rw2000dev: problems with library(foreign)
Kjetil Brinchmann Halvorsen wrote: Martin Maechler wrote: Kjetil == Kjetil Brinchmann Halvorsen [EMAIL PROTECTED] on Fri, 24 Sep 2004 10:10:39 -0400 writes: Kjetil I get the following library(foreign) Kjetil Error in namespaceExport(ns, exports) : undefined Kjetil exports: write.foreign Error in library(foreign) : Kjetil package/namespace load failed for 'foreign' Kjetil with rw2000dev as of (2004-09-17 Does system.file(package=foreign) give the same initial path as system.file(package=base) ? If yes, I cannot help further; if no, this explains the problem: you're picking up a wrong version of the foreign package. system.file(package=foreign) [1] C:/R/rw2000dev/library/foreign system.file(package=base) [1] C:/R/rw2000dev/library/base Works for me with the recent beta (both with my own as well as with Duncan's build). Kjetil, can you please try out the recent build? Thanks! Uwe Kjetil Regards, Martin __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Re: R-devel Digest, Vol 19, Issue 20
Shaogang Qu wrote: I met several problems in using R, and I can not find the exact answer after reading some r-docs and searching the web, maybe I use them in a wrong way. So, I hope you may offer me some guide on it if possible. The problems are as follows: 1 I see the example source for creating an R package, but indeed, the package submitted to CRAN is nod this simple, so I wonder how I can create an R package like this. Have you read Writing R Extensions? Your question is too unspecific to get any other useful help. And what does a package like this mean? 2 And when a package like this is generated, how can I do some modification? For example, add some new function into it or do some modifications for certain function? I try to do this on an existed package, but it does not work, the new package can not be found. see 1 3 Could you offer me some e-documents for R apart from the R-help docs? see 1 4 Could you offer me some advise on R learning if I am only interested in R package management not R language programming now? see 1 5 I used the Tools to create a package in windows, but it seems in the last step, zip command does not work? Is there any good reference about the way creating a package using RGui? If you are under Windows, please also read .../src/gnuwin32/README.packages Uwe Ligges Thanks a lot!! Jimmy __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Bug in merge() in R-2.0.0 alpha
In some cases, merge() has a problem in R-2.0.0 alpha (2004-09-14): x - structure(c(a, b, 2, 0.2-26, O, O), .Dim = c(2, 3), .Dimnames = list(c(1, 2), c(P, V, 2))) y - structure(c(a, b, 2, 0.2-25, O, O), .Dim = c(2, 3), .Dimnames = list(c(1, 2), c(P, V, 1))) merge(x, y, all.y=TRUE) Error in [-(`*tmp*`, ri, value = NULL) : incompatible types Looks like the NA handling has changed anywhere. Uwe Ligges __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Wishlist: axis() and line widths (PR#7223)
[EMAIL PROTECTED] wrote: Full_Name: Tom Short Version: 1.9.1 OS: Win2000 Debian Submission from: (NULL) (64.65.255.41) WISHLIST: axis() has a default parameter of lwd = 1. I want skinnier lines as the default. If I change the default lty, it doesn't change what axis uses. Looks like you are confusing lty and lwd??? Anyway, both lty and lwd work fine: plot(1:10) axis(1, lty=2, col=red) axis(2, lwd=2) The following code produces a graph with a box around it, but the axis lines are twice as thick as the box around the plot, so it looks funny. I can manually add axes and explicitly set line widths, but that's a pain. The box() function does not set lty, so it uses the default par()$lwd. par(lty = 0.5) plot(c(1,2,3)) For sure you mean par(lwd=0.5) plot(1:3) But that won't work on arbitrary devices (AFAIR), because 0.5 is smaller than 1 - and it's hard to draw things that are smaller than one point. RECOMMENDATION: In axis(), change the default for lwd from 1 to par()$lwd. No. If you want to change line widths of stuff within your plot, you don't want to change it for your axes as well. Uwe Ligges __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Run up to R 2.0.0 for package maintainers
Prof Brian Ripley wrote: The major changes for R 2.0.0 are now in place, and we have provided a set of notes for package maintainers at http://developer.r-project.org/200update.txt on both changes needed and new opportunities. The main thing which needs to be done is to revise the DESCRIPTION file, in particular to ensure the Depends: field is accurate. We do run daily checks over all the CRAN packages. See http://cran.r-project.org/src/contrib/checkSummary.html (Unfortunately although the checks have been run last week, the summary has not been updated since Aug 29.) Additionally, package maintainers might want to look at the checks under Windows: http://cran.r-project.org/bin/windows/contrib/checkSummaryWin.html Uwe Ligges __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] argument srt for mtext(); was: [R] using text on the x axis ticks rather than numbers
Prof Brian Ripley wrote: On Tue, 7 Sep 2004, Adaikalavan Ramasamy wrote: Out of curiosity, why is srt not respected in mtext ? See examples below It doesn't make a lot of sense. mtext is about putting text on margin lines, and even the ability to have text perpendicular to the axis (via las) is rather awkward to interpret (and the interpretation will be changed in 2.0.0). If you are going to rotate text you need to able to specify a point of rotation and that's much easier via text. It would be nice to have 'srt' as an argument in mtext in future. You haven't been listening to the discussions pre-2.0.0 on the semantics of `adj' (and now padj as well) in mtext. Experts seem to find it hard to keep even the two current cases (parallel and perpendicular) clear in their minds. [moved to R-devel] The discussions took place on R-devel, hence some people might not have noticed them. Indeed, I think it is possible to provide an srt command (e.g. in half a year for something like R-2.1.0). What is expected for srt = 0? a) the current behaviour, i.e. srt=0 in respect to the las setting *and* the margin side to plot the text in, or b) always horizontally drawn text? I'd vote for b). Uwe BTW, if you want to use srt with mtext(at=) you can always use S __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Re: argument srt for mtext(); was: [R] using text on the x axis ticks rather than numbers
Prof Brian Ripley wrote: On Wed, 8 Sep 2004, Prof Brian Ripley wrote: On Wed, 8 Sep 2004, Uwe Ligges wrote: [...] Indeed, I think it is possible to provide an srt command (e.g. in half a year for something like R-2.1.0). What is expected for srt = 0? a) the current behaviour, i.e. srt=0 in respect to the las setting *and* the margin side to plot the text in, or b) always horizontally drawn text? I'd vote for b). That's easy, see the precedent in BTW, if you want to use srt with mtext(at=) you can always use S S ignores las if at= is set, so srt=0 is the current default behaviour. Sorry, I garbled that. In S, srt=0 is horizontal whatever side=, and las is always ignored. Not that that is documented AFAICS, and it is hard to remember [...] Since S is different for mtext() anyway: We can say that adjustment is determined automatically by las + side, as it already is, and has to be adapted by the user if required. Uwe __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Re: argument srt for mtext(); was: [R] using text on the x axis ticks rather than numbers
Marc Schwartz wrote: On Wed, 2004-09-08 at 03:13, Uwe Ligges wrote: Prof Brian Ripley wrote: On Wed, 8 Sep 2004, Prof Brian Ripley wrote: On Wed, 8 Sep 2004, Uwe Ligges wrote: [...] Indeed, I think it is possible to provide an srt command (e.g. in half a year for something like R-2.1.0). What is expected for srt = 0? a) the current behaviour, i.e. srt=0 in respect to the las setting *and* the margin side to plot the text in, or b) always horizontally drawn text? I'd vote for b). That's easy, see the precedent in BTW, if you want to use srt with mtext(at=) you can always use S S ignores las if at= is set, so srt=0 is the current default behaviour. Sorry, I garbled that. In S, srt=0 is horizontal whatever side=, and las is always ignored. Not that that is documented AFAICS, and it is hard to remember [...] Since S is different for mtext() anyway: We can say that adjustment is determined automatically by las + side, as it already is, and has to be adapted by the user if required. Uwe Perhaps this is because I have only had one cup of coffee so far this morning, but is the bias at this point towards making the change or not making the change? I'm a little confuzzled... As Brian already pointed out, you are not the only confuzzled one ... at least one of the other confuzzled people here has not decided anything yet. ;-) If someone is going to force a decision and convinces me, I'll probably try to provide a patch. The most problematic point (mentioned by Brian Ripley) is the automatic settings of the adj and padj values (related to reading direction, as of R-2.0.0 alpha). Both have good defaults for parallel and perpendicular text (related to axis) now, but what happens if srt is set, and in particluar what happens if (srt %% 90) != 0 My suggestion is to use the default settings for *adjustment* (adj and padj) derived from las and side as usual - even if *rotation* is no longer derived from las and side. Uwe If it is towards making the change, I would vote for an explicit 'srt' to override 'las' as per Uwe's option b and Prof. Ripley's last comment. That would seem to me to be quite logical at first glance. In either case, as a possible option, I could draft some text for a FAQ on this issue of rotated axis labels, since it seems to get asked often, and send it to Kurt. Let me know. Marc __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Re: argument srt for mtext(); was: [R] using text on the x axis ticks rather than numbers
Marc Schwartz wrote: On Wed, 2004-09-08 at 08:02, Uwe Ligges wrote: Marc Schwartz wrote: On Wed, 2004-09-08 at 03:13, Uwe Ligges wrote: Prof Brian Ripley wrote: On Wed, 8 Sep 2004, Prof Brian Ripley wrote: On Wed, 8 Sep 2004, Uwe Ligges wrote: [...] Indeed, I think it is possible to provide an srt command (e.g. in half a year for something like R-2.1.0). What is expected for srt = 0? a) the current behaviour, i.e. srt=0 in respect to the las setting *and* the margin side to plot the text in, or b) always horizontally drawn text? I'd vote for b). That's easy, see the precedent in BTW, if you want to use srt with mtext(at=) you can always use S S ignores las if at= is set, so srt=0 is the current default behaviour. Sorry, I garbled that. In S, srt=0 is horizontal whatever side=, and las is always ignored. Not that that is documented AFAICS, and it is hard to remember [...] Since S is different for mtext() anyway: We can say that adjustment is determined automatically by las + side, as it already is, and has to be adapted by the user if required. Uwe Perhaps this is because I have only had one cup of coffee so far this morning, but is the bias at this point towards making the change or not making the change? I'm a little confuzzled... As Brian already pointed out, you are not the only confuzzled one ... at least one of the other confuzzled people here has not decided anything yet. ;-) If someone is going to force a decision and convinces me, I'll probably try to provide a patch. The most problematic point (mentioned by Brian Ripley) is the automatic settings of the adj and padj values (related to reading direction, as of R-2.0.0 alpha). Both have good defaults for parallel and perpendicular text (related to axis) now, but what happens if srt is set, and in particluar what happens if (srt %% 90) != 0 My suggestion is to use the default settings for *adjustment* (adj and padj) derived from las and side as usual - even if *rotation* is no longer derived from las and side. Uwe OK...well, let me think outside the polygon for a moment. Notice that I did not say box, as the shape is not quite fixed yet ;-) First, I would not twist your arm on this. There is an option already that solves the problem and provides a great deal of flexibility, as I described in my initial reply in the r-help thread and as others have referenced in prior posts. A new FAQ on this might not be a bad idea however. Second, in scanning do_axis() in plot.c, I wonder if (in any body's mind) it might be easier in some fashion to modify axis() by adding a 'srt' argument? The comments in the relevant sections of the switch() code are: /* The order of processing is important here. */ /* We must ensure that the labels are drawn left-to-right. */ /* The logic here is getting way too convoluted. */ /* This needs a serious rewrite. */ If a rewrite is to occur at some point (perhaps as a better use of time), one could feasibly add a check such that if 'srt' is specified in the call to axis (or perhaps the higher level plots as part of the '...' argument), do_text() is used (with sensible defaults for 'x,' y', 'xpd', 'mar', etc.) instead of GMMathText() and/or GMtext() as it is at present? a) This needs a serious rewrite means that it needs a serious rewrite. ;-) b) if do_text is used, you have to deal with the clipping stuff again. c) It is very easy to do it in GMText, since angle is used anyway to rotate the text. As an example, replace in GMtext (graphics.c) all lines containing angle = ... by, e.g., angle = 45 and play around. Just the wrappers have to be modified a little bit. It's work of half a day, if nobody expects that something very fuzzy happens ... Uwe Being a firm believer in Pareto's 80/20 Rule, if some sensible defaults would help with the typical cases, one could still use the manually coded approach with text() as per my example, where greater flexibility is required, as is always the case with R. On the other hand, under the 80/20 Rule, is this even worth spending a lot of time on? Does this make any sense? Marc __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Problem with Rcmdr Help menu under devel version of R 2.0.0
John, due to some Server modifications on my side and quite a lot of changes in R-2.0.0 (in devel) there might be an inconsistancy on CRAN. I'll check it this afternoon (MEST). Uwe Ligges John Fox wrote: Dear list members, I've encountered the following problem with the Rcmdr Help menu in the development version of R 2.0.0 under Windows XP (Version 2.0.0 Under development (unstable) (2004-08-20), ISBN 3-900051-00-3): The main Commander window has a (tcltk) Help menu with three items, Commander help, About Rcmdr, and Introduction to the R Commander, which, in the development version of the Rcmdr package, call the following three functions: helpCommander - function() help(Commander) helpAboutCommander - function() help(aboutRcmdr) browseManual - function() { browseURL(paste(file.path(.path.package(package=Rcmdr)[1], doc), /Getting-Started-with-the-Rcmdr.pdf, sep=)) } (Of course, there are help pages for Commander and aboutRcmdr in the Rcmdr package). These functions are not exported by the Rcmdr package, but as near as I can tell, that doesn't seem to be the source of the problem. The third menu item works fine, but the other two [which contain calls to help()] appear to do nothing. I've tried several variations, including specifying the package argument to help() and using ? in place of help(), but to no avail. Curiously, calling, e.g., Rcmdr:::helpCommander() directly from the R command prompt works just fine. Unrelated to the above, I've also encountered some MD5 checksum problems with R 2.0.0 binary packages for Windows installed from CRAN: - output files R/car have the wrong MD5 checksums files R/effects have the wrong MD5 checksums files R/multcomp have the wrong MD5 checksums files R/relimp have the wrong MD5 checksums - end - Finally, there seems to be a dependency problem with the lmtest package Windows binary installed via the Packages - Install package(s) from CRAN menu in the R Console: - output local({a - CRAN.packages() + install.packages(select.list(a[,1],,TRUE), .libPaths()[1], available=a, dependencies=TRUE)}) trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/PACKAGES' Content type `text/plain; charset=iso-8859-1' length 18348 bytes opened URL downloaded 17Kb also installing the dependencies 'sandwich', 'zoo', 'strucchange' trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/sandwich_0.1-3.zip' Content type `application/zip' length 75982 bytes opened URL downloaded 74Kb trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/zoo_0.2-0.zip' Content type `application/zip' length 53003 bytes opened URL downloaded 51Kb trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/strucchange_1.2-4.zip' Error in download.file(url, destfile, method, mode = wb) : cannot open URL `http://cran.r-project.org/bin/windows/contrib/2.0/strucchange_1.2-4.zip' In addition: Warning message: cannot open: HTTP status was `404 Not Found' - end - Any help would be appreciated, particularly with the problem I'm experiencing with the Rcmdr Help menu. Thanks, John __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R-2.0.0 (devel) binary Windows package problems; was: Problem with Rcmdr Help menu under devel version of R 2.0.0
John Fox wrote: Dear Uwe, Brian has solved my help problem. I assume that you're responding to my report of problems with some R 2.0.0 Windows binary packages on CRAN. John, you are right (I was in hurry this morning, hence the too short answer). Thanks for reporting your problems. The problem with package dependencies was my fault and will be fixed tomorrow. I was not careful enough during the last complete update of the binary packages (the scipts should have removed strucchange for R-2.0.0 also from the PACKAGES file, since it gives an error - Achim might want to fix it). Wrong MD5 checksums are also reported by the machine I'm compiling the packages on. Look's like something has been chenged - but I do not know what ... Just ignore the warnings and trust your updated virus scanner in the meantime. ;-) Uwe Thanks for your help. John -Original Message- From: Uwe Ligges [mailto:[EMAIL PROTECTED] Sent: Sunday, August 29, 2004 5:24 AM To: John Fox Cc: [EMAIL PROTECTED] Subject: Re: [Rd] Problem with Rcmdr Help menu under devel version of R 2.0.0 John, due to some Server modifications on my side and quite a lot of changes in R-2.0.0 (in devel) there might be an inconsistancy on CRAN. I'll check it this afternoon (MEST). Uwe Ligges John Fox wrote: Dear list members, I've encountered the following problem with the Rcmdr Help menu in the development version of R 2.0.0 under Windows XP (Version 2.0.0 Under development (unstable) (2004-08-20), ISBN 3-900051-00-3): The main Commander window has a (tcltk) Help menu with three items, Commander help, About Rcmdr, and Introduction to the R Commander, which, in the development version of the Rcmdr package, call the following three functions: helpCommander - function() help(Commander) helpAboutCommander - function() help(aboutRcmdr) browseManual - function() { browseURL(paste(file.path(.path.package(package=Rcmdr)[1], doc), /Getting-Started-with-the-Rcmdr.pdf, sep=)) } (Of course, there are help pages for Commander and aboutRcmdr in the Rcmdr package). These functions are not exported by the Rcmdr package, but as near as I can tell, that doesn't seem to be the source of the problem. The third menu item works fine, but the other two [which contain calls to help()] appear to do nothing. I've tried several variations, including specifying the package argument to help() and using ? in place of help(), but to no avail. Curiously, calling, e.g., Rcmdr:::helpCommander() directly from the R command prompt works just fine. Unrelated to the above, I've also encountered some MD5 checksum problems with R 2.0.0 binary packages for Windows installed from CRAN: - output files R/car have the wrong MD5 checksums files R/effects have the wrong MD5 checksums files R/multcomp have the wrong MD5 checksums files R/relimp have the wrong MD5 checksums - end - Finally, there seems to be a dependency problem with the lmtest package Windows binary installed via the Packages - Install package(s) from CRAN menu in the R Console: - output local({a - CRAN.packages() + install.packages(select.list(a[,1],,TRUE), .libPaths()[1], + available=a, dependencies=TRUE)}) trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/PACKAGES' Content type `text/plain; charset=iso-8859-1' length 18348 bytes opened URL downloaded 17Kb also installing the dependencies 'sandwich', 'zoo', 'strucchange' trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/sandwich_0.1-3.zip' Content type `application/zip' length 75982 bytes opened URL downloaded 74Kb trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/zoo_0.2-0.zip' Content type `application/zip' length 53003 bytes opened URL downloaded 51Kb trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/strucchange _1.2-4.zip' Error in download.file(url, destfile, method, mode = wb) : cannot open URL `http://cran.r-project.org/bin/windows/contrib/2.0/strucchange _1.2-4.zip' In addition: Warning message: cannot open: HTTP status was `404 Not Found' - end - Any help would be appreciated, particularly with the problem I'm experiencing with the Rcmdr Help menu. Thanks, John __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] mtext adj= wrong with several las= (PR#7188)
Jens Oehlschlägel wrote: No, adj moves not always along the axis: No, not yet. But mtext logically is oriented relative to its axis. And it should behave consistently relative to its axis. Whichever solution is choosen finally, I think it is important, that the default parametrisation will handle multi-line labels such that they are centered around at= and aligned at line=, whatever side= and las= are choosen. Beeing forced to tweak with adj= / padj= depending on side= / las= would be very impractical. This requirement is easily fullfilled with default adj=0.5 if we have mtext's adj= always move along the axis. With a adj= / padj= solution, different defaults would be needed for the different combinations of side= and las=. Might be nice, but I don't think we can easily change that much in mtext()'s behaviour. It is widely used in graphic functions and changing the defaults too much will break an incredible amount of code (if someone changes mtext() in that manner, I'll unsubsribe from R-help for half a year ;-)). How does it S+? The outdated S-PLUS 4.5 behaves like R does, but the logic is different since you have to specify srt rather than las. Uwe Ligges Best Jens # Thats my problem txt - This are\nfour lines\nof some\nrubish y - barplot(x, axes=FALSE, axisnames=FALSE, horiz=TRUE) # axis doesn't align it properly axis(2, label=rep(txt, 5), at=y, las=2, adj=0) # and no mtext parameters give vertically centered and right adjusted text mtext(rep(txt, 5), side=2, line=1, at=y, las=2, adj=0) __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] about passing parameter to '.R' script file (PR#7201)
[EMAIL PROTECTED] wrote: *** Please send questions to R-help, not to r-bugs! *** Expecting your ...[apologies] on this. Hi, I am trying the 'R' application for generating the data for the uploaded '.gpr' file. I have written script file named 'test.R'. Currently i have hardcoded the path of uploaded '.gpr' file in the script itself. I would like to know how to pass a command line parameter to the 'test.R' script file, so that i dont have to hardcode the path and filename of the '.gpr' files. Also, need to access these parameters inside the script file to use the path of the uploaded file. I am using below command to invoke the 'R' application by using the 'test.R' script file. e.g. c:\\R\\rw1091\\bin\\R.exe CMD BATCH c:\\R\\rw1091\\bin\\test.R Expecting your suggestion on this. What about using environment variables? Uwe Ligges Thanks in advance. Regards, Kishore __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] mtext adj= wrong with several las= (PR#7188)
[EMAIL PROTECTED] wrote: Hi Uwe, Thanks for your mail. I see it different: yes, Left / right adjustemnt seems to be perfectly OK. But at axis 1 with las=1, it's not Left / right adjustement what is needed here. Here the text needs to be right adjusted, and the (one) adj= par should determine the vertical alignment. I don't think so. Things are perfectly clear for the user if adj controls adjustment in reading direction independently from the las setting - and a second value specifying perpendicular adjustment. It is a bit confusing, but for mtext, the distance to the axis is done via line= and adj= moves ALONG the axis, whatever las= says. No, adj moves not always along the axis: plot(1:10) mtext(Hello, 3, at=5, adj=0, col=red) mtext(Hello, 3, at=5, adj=1, col=green) mtext(Hello, 3, at=5, adj=0, col=red, las = 2) mtext(Hello, 3, at=5, adj=1, col=green, las = 2) I agree that it would be more flexible and logical to also have the 2 element form of adj=c(horizontal, vertical) here, but I fear that this creates a lot of incompatibilities with existing code and with S+. My suggestion was different: using a new argument padj to be more flexible. Uwe Ligges Best Jens Left / right adjustemnt seems to be perfectly OK. The thing that matters is centering several lines to the specified (at=) location. In fact, mtext() is not centering but bottom-aligning by adding a negative distance that looks OK for one line in the default font size, but not in most other cases. Hence this is the same as Paul Murrell's PR#1659 (mtext() alignment of perpendicular text). Fixing this, and/or improving mtext()'s adj argument to accept 2 dimensions is desirable, but might be not that easy... I'll take a look during the next days, but nothing promised. -- __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] mtext adj= wrong with several las= (PR#7188)
Paul Murrell wrote: Hi Uwe Ligges wrote: [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Dear all, Our quite basic function mtext() does wrong adjustments in some parameter configurations. This gets obvious when using multi line texts: There is no way to properly adjust text perpendicular to axis 2, for example. Best Jens Oehlschlägel m - matrix(1:9, 3) colnames(m) - c(several\nlines, several\nlines, several\nlines) par(mfrow=c(2,2)) barplot(m, horiz=TRUE, axes=FALSE, axisnames=FALSE, main=las=0 adj=0.5 is fine) mtext(colnames(m), 2, at=seq(0.5+0.2, by=1+0.2, length=3), las=0, adj=0.5) barplot(m, horiz=TRUE, axes=FALSE, axisnames=FALSE, main=las=0 adj=1 is different) mtext(colnames(m), 2, at=seq(0.5+0.2, by=1+0.2, length=3), las=0, adj=1) barplot(m, horiz=TRUE, axes=FALSE, axisnames=FALSE, main=las=1 adj=0.5 is NOT fine) mtext(colnames(m), 2, at=seq(0.5+0.2, by=1+0.2, length=3), las=1, adj=0.5) barplot(m, horiz=TRUE, axes=FALSE, axisnames=FALSE, main=at las=1, adj=1 works the wrong direction, sub=no way to get adj=c(1, 0.5) with las=1 (or 2)) mtext(colnames(m), 2, at=seq(0.5+0.2, by=1+0.2, length=3), las=1, adj=1) par(mfrow=c(1,1)) Left / right adjustemnt seems to be perfectly OK. The thing that matters is centering several lines to the specified (at=) location. In fact, mtext() is not centering but bottom-aligning by adding a negative distance that looks OK for one line in the default font size, but not in most other cases. Hence this is the same as Paul Murrell's PR#1659 (mtext() alignment of perpendicular text). Fixing this, and/or improving mtext()'s adj argument to accept 2 dimensions is desirable, but might be not that easy... I'll take a look during the next days, but nothing promised. Uwe Ligges Having looked into the code, there are three possible solution (all with some drawbacks) I can see. Well, the current argument adj becomes xadj in the C sources (graphics.c, GMtext), and yadj is set to 0. Hence the ugly hard coded LineBias of 0.3. Solutions = 1: Hardcode yadj to 0.5 and remove all those 0.3 biases. Looks good for axes, but it might break some code -- bad. On the other hand, GMMathText has hardcoded yadj=0.5. Is there a problem with some special devices? Or any other reason not to center stuff using adj=0.5? 2: Allow the typical 2-value adj, take the first as xadj, the second one as yadj. This might break some code, because currently adj of arbitrary length (!=0) is allowed and recycled. 3: Invent an argument padj for mtext() that represents adjustment *p*erpendicular to the text direction and gets mapped to yadj in GMtext. In that case the hardcoded 0.3 bias mentioned above can be removed. The question is whether to set the default to 0.5 (will still break code, but easily to fix by setting padj to 0). I'd like to propose the third solution and would be happy to provide a patch of GMText, including corresponding patches to GMMathText, as well as mtext(), title() and axis() (and their inderlying do_* components). Are there any objections? Any reasons not to do it? It hurts my head to think about this stuff. There are so many combinations to worry about: (i) The las setting (ii) The axis (bottom, left, top, right) (iii) Whether adj has been specified (iv) Whether the text is multi-line I think mtext() does ok as long as adj is not specified and the text is single-line. Unfortunately it does *not* (using axis() here for simplicity): plot(1:10) axis(3, cex.axis=5, las=2) I would suggest addressing the multi-line problem for unspecified adj as a first step. And I will definitely not mourn the passing of the 0.3 constant. Setting yadj to 0.5 is not enough though because that doesn't make sense for multi-line text that is parallel to an axis (in that case, yadj should probably be 0 for axis 2 and 3 and 1 for axis 1 and 4; did I mention that there are lots of combinations to worry about?). I think most of the stuff is already quite pretty. The point is whether we are going to distinguish cases for (p)adj={0,0.5,1} automatically or not. If the latter, we can omit several of the cases mentioned above in (i)-(iv). I think - as the first step - we should set the default to center (note that text() does so as well), and let the user change padj for multi-line text as required. I'll try to provide a collection of patches as a proposal within, say, two weeks. Uwe For user-specified adj, I agree that a 2-value adj is not a good solution (adj is assumed to be horizontal adjustment) so maybe a padj would be best to allow user control of vertical alignment. Paul __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel