similar to: zapsmall(x) for scalar x

Displaying 20 results from an estimated 6000 matches similar to: "zapsmall(x) for scalar x"

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 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 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
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 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 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
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 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)
2003 Oct 13
1
zapsmall with all values small (PR#4554)
Hi If all values are small, zapsmall does not zap. For example ... > zapsmall(1e-24) [1] 1e-24 > zapsmall(1e-24, digits=3) [1] 1e-24 Problem appears to be in calculation of digits ... mx <- max(abs(x[!ina])) digits = if (mx > 0) max(0, digits - log10(mx)) else digits If all values are small, mx is very small, log10(mx) is
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
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
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,
2018 May 29
1
Difficulty in writing R code for one pool dynamic model
Hi everyone, I was trying to mode the following exercise using R. The question: Set up a one pool model using numericintegration. The model will run from time 1 to time 30 using a time step of 1.The pool (A) will be fed by flux "inA" at a rate of 5 units per hour anddrained by flux "outA" at a rate of 20% per hour. At time 0, A has 5units. At time 30, what is the pool size of
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
1997 Jun 02
2
R-beta: Postscript command fails
We are getting the following error: > postscript(file="Rplot.ps") Error in device("postscript", as.character(c(file, paper, family, bg, : unable to start device postscript This is R-0.49 under SunOS 4.1.3 and under Linux (kernel 2.0.0). The command worked fine on R-0.14 under the 2 above operating systems. Any ideas? Ina
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
1998 May 06
1
R-beta: R-0.61.3 "Color Allocation Error"
Running R under Solaris 2.5.1 I get "Color allocation error". the offending line is lines(x,col="green4",lty="dotted") from the "graphics" demo Any suggestions? The same program runs fine under linux, BTW. Ina --------------------- Ina Dau Computer Administrator - Room 101 - Pearson Building - UCL email: i.dau at ucl.ac.uk Phone: +44-171-4193636 snail:
2006 Oct 18
2
Digium on Dell PowerEdge 1850
Does anybody have Digium TE212P interface card on Dell PowerEdge 1850? I'm planning to install * on that configuration so I'm looking for any positive/negative experience. Best regards, -- Tomislav Par?ina Lama Computers Split Stinice 12, 21000 Split Tel.: +385(21)270248 Mob.: +385(91)1212148 SIP: tomo@sip.lama.hr e-mail: tparcina#lama.hr http://www.lama.hr
2010 Jun 15
3
Problem about zero
Hello, everyone, There's a problem about zero in R and I really need your help. I have a vector shown as x=c(0.1819711,0.4811463,0.1935151,0.1433675), The sum of this vector is shown as 1 in R, but when I type 1-sum(x), the value is not zero, but -2.220446e-16. I can accept that this value is quite small and could be seen as zero, but there would be a problem when it's not really