Re: [R] Printout and saved results

2024-03-26 Thread Ben Bolker
it in time, you can call your function and let the REPL display it (or not) and yet save the value. -Original Message- From: R-help On Behalf Of Jeff Newmiller via R-help Sent: Tuesday, March 26, 2024 1:03 AM To: r-help@r-project.org Subject: Re: [R] Printout and saved results Your desir

Re: [R] Printout and saved results

2024-03-26 Thread avi.e.gross
: Tuesday, March 26, 2024 1:03 AM To: r-help@r-project.org Subject: Re: [R] Printout and saved results Your desire is not unusual among novices... but it is really not a good idea for your function to be making those decisions. Look at how R does things: The lm function prints nothing... it retur

Re: [R] Printout and saved results

2024-03-25 Thread Jeff Newmiller via R-help
Your desire is not unusual among novices... but it is really not a good idea for your function to be making those decisions. Look at how R does things: The lm function prints nothing... it returns an object containing the result of a linear regression. If you happen to call it directly from the

Re: [R] Printout and saved results

2024-03-25 Thread Steven Yen
I just like the subroutine to spit out results (Mean, Std.dev, etc.) and also be able to access the results for further processing, i.e., v$Mean v$Std.dev On 3/26/2024 11:24 AM, Richard O'Keefe wrote: Not clear what you mean by "saved". If you call a function and the result is printed, the re

Re: [R] Printout and saved results

2024-03-25 Thread Richard O'Keefe
Not clear what you mean by "saved". If you call a function and the result is printed, the result is remembered for a wee while in the variable .Last.value, so you can do > function.with.interesting.result(...) > retained.interesting.result <- .Last.value or even > .Last.value -> retained.intere

[R] Printout and saved results

2024-03-25 Thread Steven Yen
How can I have both printout and saved results at the same time. The subroutine first return "out" and the printout gets printed, but not saved. I then run the "invisible" line. Results got saved and accessible but no printout. How can I have both printout and also have the results saved? T