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] [External] Printout and saved results

2024-03-25 Thread Richard M. Heiberger
dstat4 <- function(data) { Mean<- apply(data, 2, mean, na.rm=TRUE) Std.dev <- apply(data, 2, sd, na.rm=TRUE) Min <- apply(data, 2, min, na.rm=TRUE) Max <- apply(data, 2, max, na.rm=TRUE) Obs <- dim(data)[1] data.frame(Mean, Std.dev, Min, Max, Obs) } ## don't round inside a functio

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

Re: [R] as.complex()

2024-03-25 Thread Richard O'Keefe
What is your actual problem that you are trying to solve by comparing imaginary numbers? The reals are an ordered field. The complex numbers are a field but cannot support an ordering that is consistent with the field (or even ring) axioms. The imaginary numbers are not a field or even a ring. To q

Re: [R] Double buffering plots on Windows

2024-03-25 Thread Paul Murrell
Hi I would not describe myself as a heavy user of this stuff (either Windows or animation) - are you able to share your examples ? Paul On 26/03/24 04:23, Michael L Friendly wrote: Hi Paul Is there a concrete working example somewhere that shows how to use these to do an animation on Windo

Re: [R] as.complex()

2024-03-25 Thread Ben Bolker
That's hard to define unambiguously at a mathematical level. What definition did you have in mind? Can you provide more context? (Maybe you want to compare Mod(x) to Mod(y) ?) On 2024-03-25 3:23 a.m., Thomas K wrote: Needing a < , > comparison for imaginary numbers __

Re: [R] Double buffering plots on Windows

2024-03-25 Thread Michael L Friendly
Hi Paul Is there a concrete working example somewhere that shows how to use these to do an animation on Windows (R Gui &/or RStudio) using base R plot() and friends? I have several old examples somewhere that used to work (R < ~ 3), but now no longer work as before. Date: Mon, 25 Mar 2024 1

Re: [R] as.complex()

2024-03-25 Thread Jeff Newmiller via R-help
?complex On March 25, 2024 12:23:43 AM PDT, Thomas K wrote: >Needing a < , > comparison for imaginary numbers > >__ >R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the post

Re: [R] as.complex()

2024-03-25 Thread Iris Simmons
Hi Thomas, If you want to compare the imaginary portions, you could do: Im(z1) < Im(z2) If you want to compare the magnitudes, you could do: Mod(z1) < Mod(z2) If you want to compare complex numbers, i.e. z1 < z2, well that just doesn't make sense. On Mon, Mar 25, 2024, 10:17 Thomas K wrote:

[R] as.complex()

2024-03-25 Thread Thomas K
Needing a < , > comparison for imaginary numbers __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide c

Re: [R] an issue about subsetting a vector

2024-03-25 Thread Richard O'Keefe
For questions like this, go to the manual. Visit cran.r-project.org The nav-bar on the left includes "Documentation/Manuals/FAQ/Contributed". Click on Manuals. Look at "An Introduction to R" and click on the HTML link for the current release (this is the first link on the page) Scroll down to see