Re: [Rd] sweep sanity checking?

2007-08-07 Thread Petr Savicky
Thanks to Martin Maechler for his comments, advice and for pointing out the speed problem. Thanks also to Ben Bolker for tests of speed, which confirm that for small arrays, a slow down by a factor of about 1.2 - 1.5 may occur. Now, I would like to present a new version of sweep, which is simpler a

Re: [Rd] Embedded nuls in strings

2007-08-07 Thread Duncan Murdoch
On 07/08/2007 9:13 PM, Herve Pages wrote: > Duncan Murdoch wrote: >> On 07/08/2007 6:29 PM, Herve Pages wrote: > [...] >>> Same for serialization: >>> save(string0, file="string0.rda") load("string0.rda") string0 >>> [1] "ABCD" >> Of these, I'd say the serialization is the only case

Re: [Rd] Embedded nuls in strings

2007-08-07 Thread Herve Pages
Duncan Murdoch wrote: > On 07/08/2007 6:29 PM, Herve Pages wrote: [...] >> Same for serialization: >> >>> save(string0, file="string0.rda") >>> load("string0.rda") >>> string0 >> [1] "ABCD" > > Of these, I'd say the serialization is the only case where it would be > reasonable to fix the behaviour

Re: [Rd] Embedded nuls in strings

2007-08-07 Thread Duncan Murdoch
On 07/08/2007 6:29 PM, Herve Pages wrote: > Duncan Murdoch wrote: >> On 07/08/2007 5:06 PM, Herve Pages wrote: >>> Hi, >>> >>> ?rawToChar >>> 'rawToChar' converts raw bytes either to a single character string >>> or a character vector of single bytes. (Note that a single >>> charact

Re: [Rd] Embedded nuls in strings

2007-08-07 Thread Herve Pages
Duncan Murdoch wrote: > On 07/08/2007 5:06 PM, Herve Pages wrote: >> Hi, >> >> ?rawToChar >> 'rawToChar' converts raw bytes either to a single character string >> or a character vector of single bytes. (Note that a single >> character string could contain embedded nuls.) >> >> Allow

Re: [Rd] Embedded nuls in strings

2007-08-07 Thread Duncan Murdoch
On 07/08/2007 5:06 PM, Herve Pages wrote: > Hi, > > ?rawToChar > 'rawToChar' converts raw bytes either to a single character string > or a character vector of single bytes. (Note that a single > character string could contain embedded nuls.) > > Allowing embedded nuls in a string

Re: [Rd] Embedded nuls in strings

2007-08-07 Thread Steven McKinney
I get similar results on an Apple Mac G5 running OS X, though nchar() works. > raw0 <- as.raw(c(65:68, 0 , 70)) > string0 <- rawToChar(raw0) > raw0 [1] 41 42 43 44 00 46 > string0 [1] "ABCD\0F" > nchar(string0) [1] 6 > grep("F", string0) integer(0) > strsplit(string0, split=NULL, fixed=TRU

[Rd] Embedded nuls in strings

2007-08-07 Thread Herve Pages
Hi, ?rawToChar 'rawToChar' converts raw bytes either to a single character string or a character vector of single bytes. (Note that a single character string could contain embedded nuls.) Allowing embedded nuls in a string might be an interesting experiment but it seems to cause s

Re: [Rd] Sligthly OT Re: Makefile for embedding OpenBUGS in R package

2007-08-07 Thread Hin-Tak Leung
Prof Brian Ripley wrote: > OpenBUGS is distributed under GPL2, so this seems not to apply. > It is distributed as source and as binaries: the difficulty is that it > is written in Object Pascal for which a compiler is not readily available. Argh, I just thought of a proper technical reason, and I

Re: [Rd] Optimization in R

2007-08-07 Thread hadley wickham
On 8/7/07, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > Those are small parts of the calculation, not the whole thing. The > original point was that optim() is a very thin wrapper around the code > to do the optimization. I just don't see a need to make it more > complicated so it can be used to w

Re: [Rd] Optimization in R

2007-08-07 Thread Duncan Murdoch
Those are small parts of the calculation, not the whole thing. The original point was that optim() is a very thin wrapper around the code to do the optimization. I just don't see a need to make it more complicated so it can be used to wrap other methods. Authors of new optimization methods c

[Rd] Automatic implementation of "trivial" constraints in optimization

2007-08-07 Thread Christophe Pouzat
Hi all, I am wondering if anyone has implemented (or at least tried to) an automatic reparametrization in order to satisfy "trivial" constraints (in the sense of Dennis & Schnabel, 1983) in optimization problems. To be perhaps clearer let us consider a simple bi-exponential model for some recorded