Re: [R] [External] R rounding problem?

2020-09-03 Thread array chip via R-help
Thanks Richard. Got it now... On Thursday, September 3, 2020, 10:12:36 PM PDT, Richard M. Heiberger wrote: FAQ 7.31 On Fri, Sep 4, 2020 at 12:47 AM array chip via R-help wrote: > > Hello, > > I made a mistake today on simple counting in R, that almost got me into > trouble. After trying m

Re: [R] [External] R rounding problem?

2020-09-03 Thread Richard M. Heiberger
FAQ 7.31 On Fri, Sep 4, 2020 at 12:47 AM array chip via R-help wrote: > > Hello, > > I made a mistake today on simple counting in R, that almost got me into > trouble. After trying multiple times, I finally figured out it's rounding > issue in R. > > For exmaple, when I just simply type: > > >

Re: [R] R rounding problem?

2020-09-03 Thread JRG via R-help
On 2020-09-04 00:46, array chip via R-help wrote: > Hello, > > I made a mistake today on simple counting in R, that almost got me into > trouble. After trying multiple times, I finally figured out it's rounding > issue in R. > > For exmaple, when I just simply type: > >> (6.9-6.3) > 0.6 > [1] TRU

[R] R rounding problem?

2020-09-03 Thread array chip via R-help
Hello, I made a mistake today on simple counting in R, that almost got me into trouble. After trying multiple times, I finally figured out it's rounding issue in R. For exmaple, when I just simply type: > (6.9-6.3) > 0.6 [1] TRUE 6.9-6.3 should be 0.6 exactly, but R thinks that it's greater t

Re: [R] rounding problem

2009-04-28 Thread Uwe Ligges
-help-boun...@r- project.org] On Behalf Of Prof Brian Ripley Sent: Monday, March 02, 2009 12:38 AM To: tedzzx Cc: r-help@r-project.org Subject: Re: [R] rounding problem I nominate the following for the fortunes package: R is Open Source and so you can modify it to emulate the bugs in other

Re: [R] rounding problem

2009-04-27 Thread Emmanuel Charpentier
> Sent: Monday, March 02, 2009 12:38 AM > > To: tedzzx > > Cc: r-help@r-project.org > > Subject: Re: [R] rounding problem > > > > I nominate the following for the fortunes package: > > > R is Open Source and so you can modify it to emulate the bugs in &g

Re: [R] rounding problem + sprintf

2009-04-24 Thread Wacek Kusnierczyk
Prof Brian Ripley wrote: > I think your subject line should read 'Excel bug'. From the R help > for round() > > Note that for rounding off a 5, the IEC 60559 standard is expected > to be used, '_go to the even digit_'. > > In case you did not recognize it, IEC 60559 is an international >

Re: [R] rounding problem

2009-03-02 Thread Greg Snow
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Prof Brian Ripley > Sent: Monday, March 02, 2009 12:38 AM > To: tedzzx > Cc: r-help@r-project.org > Subject: Re: [R] rounding problem > I nomina

Re: [R] rounding problem

2009-03-02 Thread Wacek Kusnierczyk
> >>>> -Original Message- >>>> From: r-help-boun...@r-project.org >>>> [mailto:r-help-boun...@r-project.org] On Behalf Of tedzzx >>>> Sent: Saturday, February 28, 2009 4:58 AM >>>> To: r-help@r-project.org >&g

Re: [R] rounding problem

2009-03-02 Thread Bernardo Rangel Tura
On Sun, 2009-03-01 at 17:51 -0800, tedzzx wrote: > Yes, round(1.5)=2. but round(2.5)=2. I want round(2.5)=3 just like the what > the excel do. Can we change the setting or do some trick so that the > computer will work like what we usually do with respect to rounding. > My system is R 2.8.1, winX

Re: [R] rounding problem

2009-03-01 Thread Prof Brian Ripley
alf Of tedzzx Sent: Saturday, February 28, 2009 4:58 AM To: r-help@r-project.org Subject: [R] rounding problem Hi all, According to the help page on round(), round(1.5) could be either 1 or 2. But I want to the answere to be 2 for sure just what we usually do. How can I do that? Thanks advance. Che

Re: [R] rounding problem

2009-03-01 Thread tedzzx
wrote: > >> -Original Message- >> From: r-help-boun...@r-project.org >> [mailto:r-help-boun...@r-project.org] On Behalf Of tedzzx >> Sent: Saturday, February 28, 2009 4:58 AM >> To: r-help@r-project.org >> Subject: [R] rounding problem >> >&g

Re: [R] rounding problem

2009-03-01 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of tedzzx > Sent: Saturday, February 28, 2009 4:58 AM > To: r-help@r-project.org > Subject: [R] rounding problem > > > Hi all, > > According t

Re: [R] rounding problem

2009-03-01 Thread Dimitris Rizopoulos
it the on-line help file of ?round, you can also find the functions: ceiling() floor() trunc() I hope it helps. Best, Dimitris tedzzx wrote: Hi all, According to the help page on round(), round(1.5) could be either 1 or 2. But I want to the answere to be 2 for sure just what we usually do.

[R] rounding problem

2009-03-01 Thread tedzzx
Hi all, According to the help page on round(), round(1.5) could be either 1 or 2. But I want to the answere to be 2 for sure just what we usually do. How can I do that? Thanks advance. Cheers Ted -- View this message in context: http://www.nabble.com/rounding-problem-tp22261852p22261852.html

Re: [R] rounding problem

2009-02-27 Thread Peterko
all.equal is what i need, many thanks to help me baptiste auguie-2 wrote: > > Hi, > > you probably want to use ?all.equal instead of "==" > > I couldn't run your example, though > > Hope this helps, > > baptiste > > On 27 Feb 2009, at 10:32, Peterko wrote: > >> >> hi i am creating some var

Re: [R] rounding problem

2009-02-27 Thread baptiste auguie
Hi, you probably want to use ?all.equal instead of "==" I couldn't run your example, though Hope this helps, baptiste On 27 Feb 2009, at 10:32, Peterko wrote: hi i am creating some variables from same data, but somewhere is different rouding. look: P = abs(fft(d.zlato)/480)^2 hladane= s

[R] rounding problem

2009-02-27 Thread Peterko
hi i am creating some variables from same data, but somewhere is different rouding. look: P = abs(fft(d.zlato)/480)^2 hladane= sort(P,decreasing=T)[1:10]/480 pozicia=c(0,0,0,0,0) for (j in 1:5){ for (i in 2:239){ if (P[i]/480==hladane[2*j-1]){pozicia[j]=i-1}}} period=479/pozicia >