Re: [Rd] Suggestion for memory optimization and as.double() with friends

2007-03-29 Thread Simon Urbanek
Seth, good point. I think we should be able to do better... On Mar 29, 2007, at 10:57 AM, Seth Falcon wrote: > Prof Brian Ripley <[EMAIL PROTECTED]> writes: >> The usual 'trick' to avoid this copy is >> >> storage.mode(x) <- "double" > > Hmm, this does not appear to avoid the copy for me. Using

Re: [Rd] Suggestion for memory optimization and as.double() with friends

2007-03-29 Thread Seth Falcon
Prof Brian Ripley <[EMAIL PROTECTED]> writes: > The usual 'trick' to avoid this copy is > > storage.mode(x) <- "double" Hmm, this does not appear to avoid the copy for me. Using R 2.5.0 alpha r40916 I get: > x <- 1:10 * 2.3 > names(x)=LETTERS[1:10] > storage.mode(x) [1] "double"

Re: [Rd] Suggestion for memory optimization and as.double() with friends

2007-03-28 Thread Prof Brian Ripley
On Wed, 28 Mar 2007, Duncan Murdoch wrote: > On 3/28/2007 5:25 PM, Henrik Bengtsson wrote: >> Hi, >> >> when doing as.double() on an object that is already a double, the >> object seems to be copied internally, doubling the memory requirement. >> See example below. Same for as.character() etc.

Re: [Rd] Suggestion for memory optimization and as.double() with friends

2007-03-28 Thread Duncan Murdoch
On 3/28/2007 8:17 PM, Henrik Bengtsson wrote: > On 3/28/07, Duncan Murdoch <[EMAIL PROTECTED]> wrote: >> On 3/28/2007 5:25 PM, Henrik Bengtsson wrote: >>> Hi, >>> >>> when doing as.double() on an object that is already a double, the >>> object seems to be copied internally, doubling the memory requ

Re: [Rd] Suggestion for memory optimization and as.double() with friends

2007-03-28 Thread Henrik Bengtsson
On 3/28/07, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 3/28/2007 5:25 PM, Henrik Bengtsson wrote: > > Hi, > > > > when doing as.double() on an object that is already a double, the > > object seems to be copied internally, doubling the memory requirement. > > See example below. Same for as.cha

Re: [Rd] Suggestion for memory optimization and as.double() with friends

2007-03-28 Thread Duncan Murdoch
On 3/28/2007 5:25 PM, Henrik Bengtsson wrote: > Hi, > > when doing as.double() on an object that is already a double, the > object seems to be copied internally, doubling the memory requirement. > See example below. Same for as.character() etc. Is this intended? > > Example: > > % R --vanilla

Re: [Rd] Suggestion for memory optimization and as.double() with friends

2007-03-28 Thread Henrik Bengtsson
On 3/28/07, Henrik Bengtsson <[EMAIL PROTECTED]> wrote: > Hi, > > when doing as.double() on an object that is already a double, the > object seems to be copied internally, doubling the memory requirement. > See example below. Same for as.character() etc. Is this intended? > > Example: > > % R --