Re: [Rd] dput()

2020-03-03 Thread Martin Maechler
> Martin Maechler > on Mon, 2 Mar 2020 15:36:51 +0100 writes: > Duncan Murdoch > on Mon, 2 Mar 2020 04:43:53 -0500 writes: >> On 02/03/2020 3:24 a.m., Martin Maechler wrote: robin hankin on Sun, 1 Mar 2020 09:26:24 +1300 writes: >>>

Re: [Rd] dput()

2020-03-02 Thread Martin Maechler
> Duncan Murdoch > on Mon, 2 Mar 2020 04:43:53 -0500 writes: > On 02/03/2020 3:24 a.m., Martin Maechler wrote: >>> robin hankin >>> on Sun, 1 Mar 2020 09:26:24 +1300 writes: >> >> > Thanks guys, I guess I should have referred to FAQ 7.31 >> > (which I

Re: [Rd] dput()

2020-03-02 Thread Duncan Murdoch
On 02/03/2020 3:24 a.m., Martin Maechler wrote: robin hankin on Sun, 1 Mar 2020 09:26:24 +1300 writes: > Thanks guys, I guess I should have referred to FAQ 7.31 > (which I am indeed very familiar with) to avoid > misunderstanding. I have always used dput() to clarify

Re: [Rd] dput()

2020-03-02 Thread Martin Maechler
> robin hankin > on Sun, 1 Mar 2020 09:26:24 +1300 writes: > Thanks guys, I guess I should have referred to FAQ 7.31 > (which I am indeed very familiar with) to avoid > misunderstanding. I have always used dput() to clarify > 7.31-type issues. > The description

Re: [Rd] dput()

2020-02-29 Thread Steven Dirkse
Ben, I'll edit and split your question just a little. 1) "Is there a way to get an *exact* ASCII representation of a double-precision value?" 2) "Is there a way to get round-trip behavior, i.e. to make sure that the value, when converted back to double, is identical() to the original" The hex

Re: [Rd] dput()

2020-02-29 Thread robin hankin
Thanks guys, I guess I should have referred to FAQ 7.31 (which I am indeed very familiar with) to avoid misunderstanding. I have always used dput() to clarify 7.31-type issues. The description in ?dput implies [to me at any rate] that there will be no floating-point roundoff in its output. I ha

Re: [Rd] dput()

2020-02-29 Thread Duncan Murdoch
On 29/02/2020 4:19 a.m., Ben Bolker wrote: I think Robin knows about FAQ 7.31/floating point (author of 'Brobdingnag', among other numerical packages). I agree that this is surprising (to me). To reframe this question: is there way to get an *exact* ASCII representation of a numeric value

Re: [Rd] dput()

2020-02-29 Thread Ben Bolker
I think Robin knows about FAQ 7.31/floating point (author of 'Brobdingnag', among other numerical packages). I agree that this is surprising (to me). To reframe this question: is there way to get an *exact* ASCII representation of a numeric value (i.e., guaranteeing the restored value is ide

Re: [Rd] dput()

2020-02-29 Thread Gabriel Becker
Hi Robin, In the future, questions like this belong on R-help, not R-devel as it is a basic usage question not a discussion about development of the R language itself or similar. That said, ?dput states a number of times that exact deparsing is not always possible and that dput is not appropriate

Re: [Rd] dput()

2020-02-29 Thread David Winsemius
On 2/28/20 11:42 PM, Rui Barradas wrote: Hello, FAQ 7.31 See also this StackOverflow post: https://stackoverflow.com/questions/9508518/why-are-these-numbers-not-equal That was going to be my initial response, but then I realized that the question might be why the dput representation of

Re: [Rd] dput()

2020-02-28 Thread Rui Barradas
Hello, FAQ 7.31 See also this StackOverflow post: https://stackoverflow.com/questions/9508518/why-are-these-numbers-not-equal Hope this helps, Rui Barradas Às 00:08 de 29/02/20, robin hankin escreveu: My interpretation of dput.Rd is that dput() gives an exact ASCII form of the internal repr

[Rd] dput()

2020-02-28 Thread robin hankin
My interpretation of dput.Rd is that dput() gives an exact ASCII form of the internal representation of an R object. But: rhankin@cuttlefish:~ $ R --version R version 3.6.2 (2019-12-12) -- "Dark and Stormy Night" Copyright (C) 2019 The R Foundation for Statistical Computing Platform: x86_64-pc-l

Re: [Rd] dput line width

2014-05-27 Thread Greg Snow
Looking at the help file and code for dput does not show any simple way to do what you want. But the help page makes reference to the deparse function and deparse does have a width.cutoff argument. So you could use deparse instead of dput (the use cat or other functions to display the results sim

[Rd] dput line width

2014-05-27 Thread Σταῦρος Μακράκης
Is there some way to control the line width that dput uses? options(width=...) does not affect dput. For example, currently > dput(1:30*2) c(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, *line break here* 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60) but on a wider displa

Re: [Rd] dput(as.list(function...)...) bug

2009-03-24 Thread Duncan Murdoch
On 3/24/2009 10:02 AM, Stavros Macrakis wrote: Peter, Duncan, I understand that the missing value indicator is special and will not behave like an ordinary value in evaluation. I was only discussing its handling in the text representation functions dput and dump. Duncan, You are absolutely rig

Re: [Rd] dput(as.list(function...)...) bug

2009-03-24 Thread Stavros Macrakis
Peter, Duncan, I understand that the missing value indicator is special and will not behave like an ordinary value in evaluation. I was only discussing its handling in the text representation functions dput and dump. Duncan, You are absolutely right that "list(x=)" is parseable (though not evalu

Re: [Rd] dput(as.list(function...)...) bug

2009-03-24 Thread Peter Dalgaard
Duncan Murdoch wrote: On 23/03/2009 7:37 PM, Stavros Macrakis wrote: It appears to be the zero-length name: is.name(ff$x) => TRUE as.character(ff$x) => "" This may give you a hint: > y <- ff$x > y Error: argument "y" is missing, with no default It's a special internal thing th

Re: [Rd] dput(as.list(function...)...) bug

2009-03-23 Thread William Dunlap
> -Original Message- > From: r-devel-boun...@r-project.org > [mailto:r-devel-boun...@r-project.org] On Behalf Of Duncan Murdoch > Sent: Monday, March 23, 2009 5:28 PM > To: Stavros Macrakis > Cc: r-devel@r-project.org > Subject: Re: [Rd] dput(as.list(function...).

Re: [Rd] dput(as.list(function...)...) bug

2009-03-23 Thread Duncan Murdoch
On 23/03/2009 7:37 PM, Stavros Macrakis wrote: Tested in R 2.8.1 Windows ff <- formals(function(x)1) ff1 <- as.list(function(x)1)[1] # ff1 acts the same as ff in the examples below, but is a list rather than a pairlist dput( ff , control=c("warnIncomplete")) list(x = ) This string is not p

Re: [Rd] dput(as.list(function...)...) bug

2009-03-23 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: > Tested in R 2.8.1 Windows > > >> ff <- formals(function(x)1) >> ff1 <- as.list(function(x)1)[1] >> > # ff1 acts the same as ff in the examples below, but is a list rather > than a pairlist > > >> dput( ff , control=c("warnIncomplete")) >> > list(x = ) > > T

[Rd] dput(as.list(function...)...) bug

2009-03-23 Thread Stavros Macrakis
Tested in R 2.8.1 Windows > ff <- formals(function(x)1) > ff1 <- as.list(function(x)1)[1] # ff1 acts the same as ff in the examples below, but is a list rather than a pairlist > dput( ff , control=c("warnIncomplete")) list(x = ) This string is not parsable, but dput does not give a warning as sp

Re: [Rd] dput function (PR#12112)

2008-08-07 Thread Bill Dunlap
By the way, valgrind finally finished checking this example and found no problems after adding the PROTECT(tval). Nor did valgrindless R crash as it did before on this example. -Bill On Thu, 7 Aug 2008, Prof Brian Ripley wrote: > Bill, > > Thanks. Whether or not it is the cause here it should c

Re: [Rd] dput function (PR#12112)

2008-08-07 Thread Prof Brian Ripley
Bill, Thanks. Whether or not it is the cause here it should clearly be PROTECT-ed (I suspect the original version didn't need to be, but leaving PROTECTs off is prejudicial to future maintenance), so I've incorporated this in R-devel/R-patched. Brian On Thu, 7 Aug 2008, Bill Dunlap wrote:

Re: [Rd] dput function (PR#12112)

2008-08-07 Thread Bill Dunlap
On Thu, 7 Aug 2008 [EMAIL PROTECTED] wrote: > Full_Name: Juan Gea > Version: R version 2.6.2 > OS: Fedora Core 6 > Submission from: (NULL) (79.153.48.49) > > Abort: > > objeS <- matrix("AAA",100) > class(objeS) > outTxt <- textConnection("vaClob", open = "w", local = FALSE) > dput(objeS,outTx

[Rd] dput function (PR#12112)

2008-08-07 Thread juangea
Full_Name: Juan Gea Version: R version 2.6.2 OS: Fedora Core 6 Submission from: (NULL) (79.153.48.49) Abort: objeS <- matrix("AAA",100) class(objeS) outTxt <- textConnection("vaClob", open = "w", local = FALSE) dput(objeS,outTxt) close(outTxt) R version 2.6.2 (2008-02-08) Copyright (C)

Re: [Rd] dput/dget when a data frame has 2 rows (PR#9627)

2007-04-23 Thread ripley
It is right. The problem is that dput() does not give a faithful representation, as its help says. R 2.5.0 does a better job, since the defaults for dput() have been changed, enough so that your example works there. On Sun, 22 Apr 2007, [EMAIL PROTECTED] wrote: > This doesn't seem right; I'm

[Rd] dput/dget when a data frame has 2 rows (PR#9627)

2007-04-22 Thread pdmmac
This doesn't seem right; I'm using R version 2.4.1 (2006-12-18) on Mac OS and Win XP and find the same issue: > mydataframe <- data.frame(ppi=c(.5,.5),mmu=c(5,10)) > dput(mydataframe,"mydataframe.txt") > dget("mydataframe.txt") Error in attributes(.Data) <- c(attributes(.Data), attrib) : row n