[R] extract printed value from a function

2011-02-24 Thread Duarte Viana
Let me first thank you all for the replies. Actually I also tried the print() function, and indeed it did not work. The function capture.output() Peter said did the job. Thank you for sending the proposition for the new code to the maintainer. Duarte On Thu, Feb 24, 2011 at 4:51 PM, Martin Ma

Re: [R] extract printed value from a function

2011-02-24 Thread Martin Maechler
> "PE" == Peter Ehlers > on Thu, 24 Feb 2011 07:07:29 -0800 writes: PE> On 2011-02-24 06:32, David Winsemius wrote: >> >> On Feb 24, 2011, at 7:22 AM, Peter Ehlers wrote: >> >>> On 2011-02-24 03:26, Duarte Viana wrote: Hello all, This

Re: [R] extract printed value from a function

2011-02-24 Thread David Winsemius
On Feb 24, 2011, at 10:07 AM, Peter Ehlers wrote: On 2011-02-24 06:32, David Winsemius wrote: On Feb 24, 2011, at 7:22 AM, Peter Ehlers wrote: On 2011-02-24 03:26, Duarte Viana wrote: Hello all, This shouldn't be difficult, but I am not able to extract a printed value from a function and

Re: [R] extract printed value from a function

2011-02-24 Thread Keith Jewell
I don't think that third suggestion actually works: > x <- print( twotPermutation(c(2,3,4),c(3,6,5),plotit=F) ) [1] 0.289 NULL > x NULL twotPermutation returns the value of invisible() which is NULL: x <- print(invisible()) x This conflicts with the documented behaviour of twotPermutation which

Re: [R] extract printed value from a function

2011-02-24 Thread Peter Ehlers
On 2011-02-24 06:32, David Winsemius wrote: On Feb 24, 2011, at 7:22 AM, Peter Ehlers wrote: On 2011-02-24 03:26, Duarte Viana wrote: Hello all, This shouldn't be difficult, but I am not able to extract a printed value from a function and assign it to an object. In my case, library(DAAG)

Re: [R] extract printed value from a function

2011-02-24 Thread David Winsemius
On Feb 24, 2011, at 7:22 AM, Peter Ehlers wrote: On 2011-02-24 03:26, Duarte Viana wrote: Hello all, This shouldn't be difficult, but I am not able to extract a printed value from a function and assign it to an object. In my case, library(DAAG) twotPermutation(c(2,3,4),c(3,6,5),plotit=F)

Re: [R] extract printed value from a function

2011-02-24 Thread Peter Ehlers
On 2011-02-24 03:26, Duarte Viana wrote: Hello all, This shouldn't be difficult, but I am not able to extract a printed value from a function and assign it to an object. In my case, library(DAAG) twotPermutation(c(2,3,4),c(3,6,5),plotit=F) [1] 0.298 I would like to assign this result to an

[R] extract printed value from a function

2011-02-24 Thread Duarte Viana
Hello all, This shouldn't be difficult, but I am not able to extract a printed value from a function and assign it to an object. In my case, > library(DAAG) > twotPermutation(c(2,3,4),c(3,6,5),plotit=F) [1] 0.298 I would like to assign this result to an object. Thanks, Duarte ___