similar to: zapsmall with all values small (PR#4554)

Displaying 20 results from an estimated 7000 matches similar to: "zapsmall with all values small (PR#4554)"

2023 Dec 16
1
zapsmall(x) for scalar x
I was quite suprised to discover that applying `zapsmall` to a scalar value has no apparent effect. For example: > y <- 2.220446e-16 > zapsmall(y,) [1] 2.2204e-16 I was expecting zapsmall(x)` to act like > round(y, digits=getOption('digits')) [1] 0 Looking at the current source code, indicates that `zapsmall` is expecting a vector: zapsmall <- function (x, digits =
2023 Dec 17
1
zapsmall(x) for scalar x
Zapping a vector of small numbers to zero would cause problems when printing the results of summary(). For example, if zapsmall(c(2.220446e-16, ..., 2.220446e-16)) == c(0, ..., 0) then print(summary(2.220446e-16), digits = 7) would print Min. 1st Qu. Median Mean 3rd Qu. Max. 0 0 0 0 0 0 The same problem can also appear when
2023 Dec 18
1
[External] Re: zapsmall(x) for scalar x
Does mFUN() really need to be a function of x and the NA values of x? I can't think of a case where it would be used on anything but the non-NA values of x. I think it would be easier to specify a different mFUN() (and document this new argument) if the function has one argument and is applied to the non-NA values of x. zapsmall <- function(x, digits = getOption("digits"),
2023 Dec 17
1
zapsmall(x) for scalar x
Isn?t that the correct outcome? The user can change the number of digits if they want to see small values? -- Change your thoughts and you change the world. --Dr. Norman Vincent Peale > On Dec 17, 2023, at 12:11?AM, Steve Martin <stevemartin041 at gmail.com> wrote: > > ?Zapping a vector of small numbers to zero would cause problems when > printing the results of summary().
2023 Dec 18
1
[External] Re: zapsmall(x) for scalar x
Le 18/12/2023 ? 11:24, Martin Maechler a ?crit?: >>>>>> Serguei Sokol via R-devel >>>>>> on Mon, 18 Dec 2023 10:29:02 +0100 writes: > > Le 17/12/2023 ? 18:26, Barry Rowlingson a ?crit?: > >> I think what's been missed is that zapsmall works relative to the absolute > >> largest value in the vector. Hence if
2023 Dec 18
1
[External] Re: zapsmall(x) for scalar x
>>>>> Serguei Sokol via R-devel >>>>> on Mon, 18 Dec 2023 10:29:02 +0100 writes: > Le 17/12/2023 ? 18:26, Barry Rowlingson a ?crit?: >> I think what's been missed is that zapsmall works relative to the absolute >> largest value in the vector. Hence if there's only one >> item in the vector, it is the largest, so its
2023 Dec 19
1
[External] Re: zapsmall(x) for scalar x
>>>>> Steve Martin >>>>> on Mon, 18 Dec 2023 07:56:46 -0500 writes: > Does mFUN() really need to be a function of x and the NA values of x? I > can't think of a case where it would be used on anything but the non-NA > values of x. > I think it would be easier to specify a different mFUN() (and document this > new argument)
2023 Dec 18
1
[External] Re: zapsmall(x) for scalar x
Le 17/12/2023 ? 18:26, Barry Rowlingson a ?crit?: > I think what's been missed is that zapsmall works relative to the absolute > largest value in the vector. Hence if there's only one > item in the vector, it is the largest, so its not zapped. The function's > raison d'etre isn't to replace absolutely small values, > but small values relative to the largest.
2023 Dec 17
2
[External] Re: zapsmall(x) for scalar x
I think what's been missed is that zapsmall works relative to the absolute largest value in the vector. Hence if there's only one item in the vector, it is the largest, so its not zapped. The function's raison d'etre isn't to replace absolutely small values, but small values relative to the largest. Hence a vector of similar tiny values doesn't get zapped. Maybe the line
2005 Mar 29
1
zapsmall (PR#7755)
Full_Name: Paul Vos Version: 2.0.1 OS: windows XP Submission from: (NULL) (150.216.148.20) > zapsmall(.3-.2-.1,digits=7) [1] -2.775558e-17 This should be zero. By changing the condition if (mx > 0) in zapsmall to if (mx > 1) we get > zapsmall(.3-.2-.1,digits=7) [1] 0
2003 Apr 03
2
Printing zero as dot
I'm pretty sure I've seen some examples of a function printing zero entries in a matrix as dots, but I'm not able to find it now... Any suggestions...? Thanks in advance. (Of course, I might have dreamt of such a function...) Best, Giovanni -- __________________________________________________ [ ] [ Giovanni Petris
2023 Jul 07
1
printCoefmat() and zap.ind
>>>>> Shu Fai Cheung >>>>> on Thu, 6 Jul 2023 17:14:27 +0800 writes: > Hi All, > I would like to ask two questions about printCoefmat(). Good... this function, originally named print.coefmat(), is 25 years old (in R) now: -------------------------------------------------------------------- r1902 | maechler | 1998-08-14 19:19:05 +0200 (Fri,
2008 Aug 18
1
trying to mimic page 70 of Software for Data Analysis
I was trying to do what is on page 70 of John Chambers' new book namely using trace to invoke the browser by doing trace(zapsmall, edit = TRUE) but , typing above at an R prompt, I get trace(zapsmall, edit=TRUE) sh: EMACS: command not found Error in edit(name, file, title, editor) : problem with running editor EMACS I looked in the archives but maybe it's a problem with the
2008 Aug 04
1
simulate data based on partial correlation matrix
Given four known and fixed vectors, x1,x2,x3,x4, I am trying to generate a fifth vector,z, with specified known and fixed partial correlations. How can I do this? In the past I have used the following (thanks to Greg Snow) to generate a fifth vector based on zero order correlations---however I'd like to modify it so that it can generate a fifth vector with specific partial
2002 Oct 14
4
log10(), floor() combo issue?
Hi all, in my search for a nice binary2decimal method, I received this nice code (thanx to Uwe Ligges): bindec <- function(b) sum(as.integer(unlist(strsplit(b, ""))) * 2^(floor(log10(b)):0)) It fails, however, with: > bindec(1000) [1] 4 Warning message: longer object length is not a multiple of shorter object length in: as.integer(unlist(strsplit(b, "")))
2011 Jun 30
2
volcano plot.r
Hello. My name is Akashah. i work at metabolic laboratory. From my study, i found that volcano plot can help a lot in my section.  i already studied about the volcano plot and get the coding to run in R software, unfortunately, there is may be something wrong with the coding. This is because  no graph appear, but no error (blue color text) was shown on the R console. Below is the coding for
2004 Nov 22
2
optimize in very small values
I hope you will forgive me this simple question on titration. I'm trying to find very small values from the algorithm below, which I believe is correctly formatted, and the constants are also correct. When SID goes over ATOT, fitted vales are much too low compared to the literature. I guess I must be using optimize in a wrong way but cannot find out how to improve it. I'm on windows, R
2010 Mar 25
2
print(big+small*1i) -> big + 0i
Should both parts of a complex number be printed to the same precision? The imaginary part of 0 looks a bit odd when log10(real/imag) >=~ getOption("digits"), but I'm not sure it is awful. Some people might expect the same number of significant digits in the two parts. > 1e7+4i [1] 10000000+0i > 1e7+5i [1] 10000000+0i > 1e10 + 1000i [1] 1e+10+0e+00i >
2011 Jun 20
2
(no subject)
HELLO, anybody... could you help me to check the below coding for volcano. what is the mistake? what the plot could not display? # volcano_plot.r # # Author: Amsha Nahid, Jairus Bowne, Gerard Murray # Purpose: Produces a volcano plot # # Input: Data matrix as specified in Data-matrix-format.pdf # Output: Plots log2(fold change) vs log10(t-test P-value) # #
2003 May 14
1
Multiple comparison and lme (again, sorry)
Dear list, As a reply to my recent mail: > simint and TukeyHSD work for aov objects. > Can someone point me to similar functions for lme objects? Douglas Bates wrote There aren't multiple comparison methods for lme objects because it is not clear how to do multiple comparisons for these. I don't think the theory of multiple comparisons extends easily to lme models. One could