Re: [Rd] corruption of data with serialize(ascii=TRUE)

2006-02-08 Thread Prof Brian Ripley
It is known (happens with save() too and did in earlier save formats). Nothing particularly clever is done (the format is "%.16g\n") and similarly as.character/parse are not inverses. Perhaps more relevant is > b/x -1 [1] 0.00e+00 -1.110223e-16 2.220446e-16 0.00e+00 0.00e+00

[Rd] corruption of data with serialize(ascii=TRUE)

2006-02-08 Thread Roger D. Peng
I noticed the following peculiarity with `serialize()' when `ascii = TRUE' is used. In today's (svn r37299) R-devel, I get > set.seed(10) > x <- rnorm(10) > > a <- serialize(x, con = NULL, ascii = TRUE) > b <- unserialize(a) > > identical(x, b) ## FALSE [1] FALSE > x - b [1] -3.469447

[Rd] invalid graphics state using dev.print (fwd)

2006-02-08 Thread Paul Roebuck
On Mon, 6 Feb 2006 18:12, Simon Urbanek wrote: > On Feb 6, 2006, at 5:24 PM, Paul Roebuck wrote: > >> Tried on R-Sig-Mac with no responses, but I need some kind >> of answer. >> [...] >> Does the following work on your system? > > Interesting, no, it doesn't either. For png and pdf I use > Quartz

[Rd] Another NAMESPACE question, imports and S4

2006-02-08 Thread Seth Falcon
One more namespaces thread and then I will be quiet for a while ;-) Should S4 methods be attached to the appropriate generic when a package is loaded, but not attached? For example, suppose package 'hello' defines an S4 class Speaker and a defines a method for the show generic defined in the meth

Re: [Rd] Rf_protect in Rinternals.h

2006-02-08 Thread Prof Brian Ripley
On Wed, 8 Feb 2006, Hans-Peter wrote: > Hello! > > I'd like to ask you a question about c (macros): > > In Rinternals.h are defined: > a) SEXP Rf_protect(SEXP); > b) #define protect Rf_protect > c) #define PROTECT(s) protect(s) > > As far as I understand the calls Rf_protect( x ), prot

Re: [Rd] How to change names when importing with a NAMESPACE (was: NAMESPACE Q: does import as exist?)

2006-02-08 Thread Prof Brian Ripley
This is indeed described in http://www.stat.uiowa.edu/~luke/R/namespaces/morenames.html linked from developer.r-project.org. with the comment The purpose of baz is to import some of the exports of foo and bar and re-export them, using renaming in one case: bar's export g is imported un

Re: [Rd] Using .onUnload() to unload compiled code

2006-02-08 Thread Prof Brian Ripley
On Wed, 8 Feb 2006, James MacDonald wrote: > If one wants to unload compiled code for a package containing a > namespace, my understanding is that .onUnload() should be used, with a > call to library.dynam.unload(). This is used in e.g., the stats and > methods packages, but it appears to me th

Re: [Rd] Using .onUnload() to unload compiled code

2006-02-08 Thread Seth Falcon
Hi Jim, On 8 Feb 2006, [EMAIL PROTECTED] wrote: > If one wants to unload compiled code for a package containing a > namespace, my understanding is that .onUnload() should be used, with > a call to library.dynam.unload(). This is used in e.g., the stats > and methods packages, but it appears to me

Re: [Rd] NAMESPACE Q: does import as exist?

2006-02-08 Thread Luke Tierney
We anticipated this issue when the name space mechanism was designed, and the design allows for this, but we deliberately did not formally document this at the time. As with most things like this there are trade-offs. Allowing for renaming complicates the code; it also may prevent, or at least si

[Rd] Rf_protect in Rinternals.h

2006-02-08 Thread Hans-Peter
Hello! I'd like to ask you a question about c (macros): In Rinternals.h are defined: a) SEXP Rf_protect(SEXP); b) #define protect Rf_protect c) #define PROTECT(s) protect(s) As far as I understand the calls Rf_protect( x ), protect( x ) and PROTECT( x ) are all equalent. So whats the reas

[Rd] How to change names when importing with a NAMESPACE (was: NAMESPACE Q: does import as exist?)

2006-02-08 Thread Seth Falcon
Well, it seems that the following does what I want. In the NAMESPACE file, one can do: importFrom("pkgA", foo=bar) Which will allow you to use the symbol 'foo' to refer to pkgA::bar. This is exactly what I wanted. Despite the lack of documentation, this seems an intentional feature. Is there

[Rd] Using .onUnload() to unload compiled code

2006-02-08 Thread James MacDonald
If one wants to unload compiled code for a package containing a namespace, my understanding is that .onUnload() should be used, with a call to library.dynam.unload(). This is used in e.g., the stats and methods packages, but it appears to me that the compiled code is not being unloaded when the

Re: [Rd] NAMESPACE Q: does import as exist?

2006-02-08 Thread Duncan Murdoch
On 2/8/2006 10:18 AM, Seth Falcon wrote: > On 8 Feb 2006, [EMAIL PROTECTED] wrote: in a NAMESPACE file. Useful-- yes. Possible-- I don't know! >>> Yes, this is along the lines of what I was thinking. An unpleasant >>> work around would be to create a translation package >>> that does somethi

Re: [Rd] NAMESPACE Q: does import as exist?

2006-02-08 Thread Seth Falcon
On 8 Feb 2006, [EMAIL PROTECTED] wrote: >>> in a NAMESPACE file. Useful-- yes. Possible-- I don't know! >> Yes, this is along the lines of what I was thinking. An unpleasant >> work around would be to create a translation package >> that does something along the lines of Duncan M.'s suggestion, >

Re: [Rd] NAMESPACE Q: does import as exist?

2006-02-08 Thread Seth Falcon
On 8 Feb 2006, [EMAIL PROTECTED] wrote: > What about : > > bar <- pack::foo > kok <- otherpack::foo This is a solution, thanks for the suggestion. The downside is that it doesn't let one be particularly specific about what one is using in the NAMESPACE file. In fact, if one only wanted to use p

Re: [Rd] R 2.2.1 installation trouble on SGI/Sun (PR#8575)

2006-02-08 Thread Prof Brian Ripley
On Wed, 8 Feb 2006, Atro Tossavainen wrote: > Dear Prof Ripley, > > > Thank you for the reply. Setting these variables explicitly on the make > > install line should help. > > I just fixed them in Makeconf explicitly and it's OK now. > > > I have a guess at the shell problem. Configure contains

Re: [Rd] R 2.2.1 installation trouble on SGI/Sun (PR#8575)

2006-02-08 Thread Atro Tossavainen
Dear Prof Ripley, > Thank you for the reply. Setting these variables explicitly on the make > install line should help. I just fixed them in Makeconf explicitly and it's OK now. > I have a guess at the shell problem. Configure contains > > if test -z ${rdocdir}; then > rdocdir='${rhome}/doc

Re: [Rd] NAMESPACE Q: does import as exist?

2006-02-08 Thread Duncan Murdoch
On 2/7/2006 10:26 PM, Seth Falcon wrote: > On 7 Feb 2006, [EMAIL PROTECTED] wrote: > >>> On 2/7/2006 8:48 PM, Seth Falcon wrote: Is there a way to rename a function when importing it? I >>> want to say, "import yourFunc from Foo as myFunc" in the NAMESPACE file. >> I don't think Seth

Re: [Rd] NAMESPACE Q: does import as exist?

2006-02-08 Thread Duncan Murdoch
On 2/7/2006 9:10 PM, Duncan Murdoch wrote: > On 2/7/2006 8:48 PM, Seth Falcon wrote: >> Is there a way to rename a function when importing it? I want to say, >> "import yourFunc from Foo as myFunc" in the NAMESPACE file. >> >> Does this exist and I've missed it? If it doesn't exist, would other

Re: [Rd] identify() bug (PR#8576)

2006-02-08 Thread ripley
Please do not use R-bugs to ask questions. Well under half the traffic on R-bugs is related to actual bug reports. On Wed, 8 Feb 2006 [EMAIL PROTECTED] wrote: > Full_Name: Vladan Arsenijevic > Version: 2.2.1 > OS: linux/gentoo > Submission from: (NULL) (193.136.128.14) > > > I have a vector of f

[Rd] identify() bug (PR#8576)

2006-02-08 Thread arsenije
Full_Name: Vladan Arsenijevic Version: 2.2.1 OS: linux/gentoo Submission from: (NULL) (193.136.128.14) I have a vector of floats that I want to assign to a set of the points in the plot with identify(). When I print the vector, it appears with a certain precision (let's say 2 decimal places), whi

Re: [Rd] R 2.2.1 installation trouble on SGI/Sun (PR#8575)

2006-02-08 Thread Brian D Ripley
Thank you for the reply. Setting these variables explicitly on the make install line should help. I have a guess at the shell problem. Configure contains if test -z ${rdocdir}; then rdocdir='${rhome}/doc' fi and maybe test -z is broken. Does it help to add quotes as in if test -z "${rdocdi

Re: [Rd] chron library: format.times, parse.format and h:m (PR#8507)

2006-02-08 Thread Kurt Hornik
> spector writes: > Due to the following lines in parse.format: > else if (nf == 3) { > sep <- "" > fmt <- substring(format, first = 1:3, last = 1:3) > } > If a format code has 3 characters, it will not use a separator: >> library(chron) >> mytime = times('7:15:00') >> f

Re: [Rd] R 2.2.1 installation trouble on SGI/Sun (PR#8575)

2006-02-08 Thread Atro Tossavainen
Dear Prof Ripley, Thank you for your quick response! > Please do not send questions to R-bugs (especially as well as to R-devel). Sorry. I took the addresses from a response to an older question that I had received from Kurt Hornik. That message had been cc'd to both. > The thing you are gett

Re: [Rd] R 2.2.1 installation trouble on SGI/Sun (PR#8575)

2006-02-08 Thread ripley
Please do not send questions to R-bugs (especially as well as to R-devel). The thing you are getting as "" is from (see doc/Makefile) $(INSTALL_DATA) $(srcdir)/$${f} "$(rdocdir)"; \ What is rdocdir set to in Makeconf? It (and related quantities) should be rhome = ${libdir}/R rsharedi

[Rd] R 2.2.1 installation trouble on SGI/Sun (PR#8575)

2006-02-08 Thread Atro . Tossavainen
Hi, I'm upgrading to R 2.2.1 and have bumped into some problems. I have been successful with installing on x86 and PPC Linux, but am unable to install R on Solaris 7 and on IRIX 6.5. Configuration and compilation go through just fine, but "make install" fails: gmake[1]: Entering directory `/scr

[Rd] R 2.2.1 installation trouble on SGI/Sun

2006-02-08 Thread Atro Tossavainen
Hi, I'm upgrading to R 2.2.1 and have bumped into some problems. I have been successful with installing on x86 and PPC Linux, but am unable to install R on Solaris 7 and on IRIX 6.5. Configuration and compilation go through just fine, but "make install" fails: gmake[1]: Entering directory `/scr

Re: [Rd] NAMESPACE Q: does import as exist?

2006-02-08 Thread Romain Francois
Le 08.02.2006 04:26, Seth Falcon a écrit : >On 7 Feb 2006, [EMAIL PROTECTED] wrote: > > > >>>On 2/7/2006 8:48 PM, Seth Falcon wrote: >>> >>> Is there a way to rename a function when importing it? I >>>want to say, >>> >>> "import yourFunc from Foo as myF