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
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:
>
> >
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
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
I'm no expert in R internals or floating point computation, however, two things
come to mind.
First, I suspect the exact value is stored. It is just the printing that looks
rounded. That is likely because 0.001 completely dominates the rest. To print
in full precision, you would need over 200 d
"Is there any way ..."
Two quick answers:
1. using base R functions and data types the answer is 'no' - a double
(i.e. numeric) contains about 15 significant digits.
So 5.678e-100 is fine but 0.01 + 5.678e-100 will keep the
.0100 as the significant digits and "drop" the digits 80
I thought it might be a floating issue but didn't see the connection.
Thanks everyone.
On Tue, Oct 9, 2018, 2:00 PM Benoit Vaillant
wrote:
> Hello,
>
> On Tue, Oct 09, 2018 at 01:14:54PM -0400, Ryan Derickson wrote:
> > Apologies if this is a simple misunderstanding.
>
> See for example:
>
> htt
Hello,
On Tue, Oct 09, 2018 at 01:14:54PM -0400, Ryan Derickson wrote:
> Apologies if this is a simple misunderstanding.
See for example:
https://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
> round((.575*100),0) gives 57
> round(57.5,0) gives 58
>
Floating point numbers are approximations in base 2, so any fractions not
representing such numbers may round off in unexpected directions.
sprintf( "%22.20f", 0.5 )
sprintf( "%22.20f", 0.575 )
See R FAQ 7.31.
On October 9, 2018 10:14:54 AM PDT, Ryan Derickson
wrote:
>Hello,
>
>Apologies if t
FAQ 7.31
Open this file in your favorite text editor on your computer
system.file("../../doc/FAQ")
57.5 comes out even in binary, and .575 does not.
> print(.575*100, digits=17)
[1] 57.493
## The fraction is less than .5, hence it gets rounded down to 57
> print(57.5, digits=17)
[1] 5
Hello,
Apologies if this is a simple misunderstanding.
round((.575*100),0) gives 57
round(57.5,0) gives 58
Why?
Ryan Derickson
University of Cincinnati
On Tue, Oct 9, 2018, 10:08 AM PIKAL Petr wrote:
> Hi
>
> You could use brute force approach. Just print out "file.names" and
> estimate orde
Le 22/08/2017 à 16:26, niharika singhal a écrit :
Hello I have a vector
v=c(0.0886,0.1744455,0.1379778,0.1209769,0.1573065,0.1134463,0.2074027)
when i do
sum(v)
or
0.0886+0.1744455+0.1379778+0.1209769+0.1573065+0.1134463+0.2074027
i am getting output as 1
But if i add them manually i get
Try options(digits=12)
sum(v)
BTW I don't get the same value as you did when you calculated manually.
On Tuesday, August 22, 2017, 10:39:26 AM EDT, Bert Gunter
wrote:
... and following up on Spencer's answer, see the "digits" argument of
?options and ?print.default.
Cheers,
Bert
Bert Gunter
... and following up on Spencer's answer, see the "digits" argument of
?options and ?print.default.
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On 2017-08-22 9:26 AM, niharika singhal wrote:
Hello I have a vector
v=c(0.0886,0.1744455,0.1379778,0.1209769,0.1573065,0.1134463,0.2074027)
when i do
sum(v)
or
0.0886+0.1744455+0.1379778+0.1209769+0.1573065+0.1134463+0.2074027
i am getting output as 1
No: That's only the display:
Hello I have a vector
v=c(0.0886,0.1744455,0.1379778,0.1209769,0.1573065,0.1134463,0.2074027)
when i do
sum(v)
or
0.0886+0.1744455+0.1379778+0.1209769+0.1573065+0.1134463+0.2074027
i am getting output as 1
But if i add them manually i get
1.0026
I do not want to round of my value since
On Fri, 2 Jan 2015, Duncan Murdoch wrote:
On 01/01/2015 10:05 PM, Mike Miller wrote:
This is how big those errors are:
512*.Machine$double.eps
[1] 1.136868e-13
Under other conditions you also were seeing errors of twice that, or
1024*.Machine$double.eps. It might not be a coincidence th
On 02 Jan 2015, at 04:05 , Mike Miller wrote:
>
> ...but why are we seeing errors so much bigger than the machine precision?
> Why does it change at 2?
Because relative errors in the one-thousands part are roughly a thousand times
bigger than errors in the number itself? Put differently: th
On 01/01/2015 10:05 PM, Mike Miller wrote:
> On Thu, 1 Jan 2015, Duncan Murdoch wrote:
>
>> On 01/01/2015 1:21 PM, Mike Miller wrote:
>>
>>> I understand that it's all about the problem of representing digital
>>> numbers in binary, but I still find some of the results a little
>>> surprising, l
On Thu, 1 Jan 2015, Duncan Murdoch wrote:
On 01/01/2015 1:21 PM, Mike Miller wrote:
I understand that it's all about the problem of representing digital
numbers in binary, but I still find some of the results a little
surprising, like that list of numbers from the table() output. For
anothe
Yes, Ted, that also works, but it's very slow:
# read in values:
data <- scan( file=RECIP_IN, what=double(), nmax=recip_N*16000)
Read 48013406 items
# convert to integer by adding .5 and rounding down:
ptm <- proc.time() ; ints <- as.integer( 1000 * data + .5 ) ; proc.time()-ptm
user sys
On Thu, 1 Jan 2015, Duncan Murdoch wrote:
On 01/01/2015 1:21 PM, Mike Miller wrote:
On Thu, 1 Jan 2015, Duncan Murdoch wrote:
On 31/12/2014 8:44 PM, David Winsemius wrote:
On Dec 31, 2014, at 3:24 PM, Mike Miller wrote:
This is probably a FAQ, and I don't really have a question about it,
I've been followeing this little tour round the murkier bistros
in the back-streets of R with interest! Then it occurred to me:
What is wrong with [using example data]:
x0 <- c(0,1,2,0.325,1.12,1.9,1.003)
x1 <- as.integer(as.character(1000*x0))
n1 <- c(0,1000,2000,325,1120,1900,1003)
x1 -
On 01/01/2015 2:43 PM, Mike Miller wrote:
> On Thu, 1 Jan 2015, Duncan Murdoch wrote:
>
>> On 01/01/2015 1:21 PM, Mike Miller wrote:
>>> On Thu, 1 Jan 2015, Duncan Murdoch wrote:
>>>
On 31/12/2014 8:44 PM, David Winsemius wrote:
>
> On Dec 31, 2014, at 3:24 PM, Mike Miller wrote:
I'd have to say thanks, but no thanks, to that one! ;-) The problem is
that it will take a long time and it will give the same answer.
The first time I did this kind of thing, a year or two ago, I manipulated
the text data to produce integers before putting the data into R. The
data were a
Interesting. Following someone on this list today the goal is input
the data correctly.
My inclination would be to read the file as text, pad each number to
the right, drop the decimal point,
and then read it as an integer.
0 1 2 0.325 1.12 1.9
0.000 1.000 2.000 0.325 1.120 1.900
1000 2000 03
On 01/01/2015 1:21 PM, Mike Miller wrote:
> On Thu, 1 Jan 2015, Duncan Murdoch wrote:
>
>> On 31/12/2014 8:44 PM, David Winsemius wrote:
>>>
>>> On Dec 31, 2014, at 3:24 PM, Mike Miller wrote:
>>>
This is probably a FAQ, and I don't really have a question about it, but I
just ran across
On Thu, 1 Jan 2015, Duncan Murdoch wrote:
On 31/12/2014 8:44 PM, David Winsemius wrote:
On Dec 31, 2014, at 3:24 PM, Mike Miller wrote:
This is probably a FAQ, and I don't really have a question about it, but I just
ran across this in something I was working on:
as.integer(1000*1.003)
[1
On 31/12/2014 8:44 PM, David Winsemius wrote:
>
> On Dec 31, 2014, at 3:24 PM, Mike Miller wrote:
>
>> This is probably a FAQ, and I don't really have a question about it, but I
>> just ran across this in something I was working on:
>>
>>> as.integer(1000*1.003)
>> [1] 1002
>>
>> I didn't expect
Read the message at the bottom of every message from rhelp.
--
David.
On Dec 31, 2014, at 8:09 PM, Zaid Bhatti wrote:
> How can I unsubscribe to not receive loop e mails?
>
> Sent from my Huawei Mobile
>
> David Winsemius wrote:
>
>
> On Dec 31, 2014, at 3:24 PM, Mike Miller wrote:
>
>> T
How can I unsubscribe to not receive loop e mails?
Sent from my Huawei Mobile
David Winsemius wrote:
On Dec 31, 2014, at 3:24 PM, Mike Miller wrote:
> This is probably a FAQ, and I don't really have a question about it, but I
> just ran across this in something I was working on:
>
>> as.inte
On Dec 31, 2014, at 3:24 PM, Mike Miller wrote:
> This is probably a FAQ, and I don't really have a question about it, but I
> just ran across this in something I was working on:
>
>> as.integer(1000*1.003)
> [1] 1002
>
> I didn't expect it, but maybe I should have. I guess it's about the mac
This is probably a FAQ, and I don't really have a question about it, but I
just ran across this in something I was working on:
as.integer(1000*1.003)
[1] 1002
I didn't expect it, but maybe I should have. I guess it's about the
machine precision added to the fact that as.integer always round
Try ?ceiling
> ceiling(0.4)
[1] 1
B.
On 2014-03-20, at 3:42 PM, Kristi Glover wrote:
> Hi R User,
> I was trying to convert a decimal value into integral (whole number). I used
> round function but some of the cells have the value less than 0.5 and it
> converted into 0. But I wanted th
On 20-Mar-2014 19:42:35 Kristi Glover wrote:
> Hi R User,
> I was trying to convert a decimal value into integral (whole number). I used
> round function but some of the cells have the value less than 0.5 and it
> converted into 0. But I wanted these cell to have 1 instead of 0. Another
> way, I c
What about:
> ceiling(data[,2:3])
A B
1 0 1
2 3 1
3 3 3
4 2 3
Note that ceiling is referenced in ?round
Thanks for the clear reproducible example.
Sarah
On Thu, Mar 20, 2014 at 3:42 PM, Kristi Glover
wrote:
> Hi R User,
> I was trying to convert a decimal value into integral (whole number)
Hi R User,
I was trying to convert a decimal value into integral (whole number). I used
round function but some of the cells have the value less than 0.5 and it
converted into 0. But I wanted these cell to have 1 instead of 0. Another way,
I could multiply by 10. But l did not want it because i
For more details about floating-point:
http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
2013/1/5 peter dalgaard
>
> On Jan 5, 2013, at 20:30 , Rolf Turner wrote:
>
> > On 01/06/2013 07:42 AM, David Arnold wrote:
> >> Hi,
> >>
> >> Can someone explain this:
> >>
> >>> options(digit
On Jan 5, 2013, at 20:30 , Rolf Turner wrote:
> On 01/06/2013 07:42 AM, David Arnold wrote:
>> Hi,
>>
>> Can someone explain this:
>>
>>> options(digits=20)
>>> 1/3
>> [1] 0.1483
>>
>> Why the 1483 at the end?
>
> There are 10 sorts of people; those who understand binary
> ari
On 01/06/2013 07:42 AM, David Arnold wrote:
> Hi,
>
> Can someone explain this:
>
>> options(digits=20)
>> 1/3
> [1] 0.1483
>
> Why the 1483 at the end?
There are 10 sorts of people; those who understand binary
arithmetic and those who don't. See also FAQ 7.31.
cheers,
Rolf
On Sat, Jan 5, 2013 at 6:48 PM, R. Michael Weylandt
wrote:
> To be curt, "it's complicated," but it basically comes down to the
> fact that 1/3 is not expressible by a finite sequence of powers of 2
> so it can't be perfectly represented in binary.
But of course, that in turn leads to gems like t
On Sat, 5 Jan 2013, David Arnold wrote:
Hi,
Can someone explain this:
options(digits=20)
1/3
[1] 0.1483
Why the 1483 at the end?
Due to floating-point arithmetic, see FAQ 7.31.
Thanks,
David.
david-arnolds-macbook-pro-2:~ darnold$ R --version
R version 2.15.2 (2012-10-
On Sat, Jan 5, 2013 at 6:42 PM, David Arnold wrote:
> Hi,
>
> Can someone explain this:
>
>> options(digits=20)
>> 1/3
> [1] 0.1483
>
> Why the 1483 at the end?
To be curt, "it's complicated," but it basically comes down to the
fact that 1/3 is not expressible by a finite sequence
Hi,
Can someone explain this:
> options(digits=20)
> 1/3
[1] 0.1483
Why the 1483 at the end?
Thanks,
David.
david-arnolds-macbook-pro-2:~ darnold$ R --version
R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3
Try
round(1003, digits = -3)
HTH,
Jorge.-
On Mon, Feb 6, 2012 at 1:40 AM, arunkumar <> wrote:
> Hi
>
> I need to round integer
> \
> eg if my value is 1003
>
> i want to make it 1000
>
> Thanks in advance
>
>
>
> -
> Thanks in Advance
>Arun
> --
> View this message in context:
On Feb 6, 2012, at 1:40 AM, arunkumar wrote:
Hi
I need to round integer
\
eg if my value is 1003
i want to make it 1000
?round
--
David Winsemius, MD
West Hartford, CT
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/li
Hi
I need to round integer
\
eg if my value is 1003
i want to make it 1000
Thanks in advance
-
Thanks in Advance
Arun
--
View this message in context:
http://r.789695.n4.nabble.com/rounding-of-integer-tp4360549p4360549.html
Sent from the R help mailing list archive at Nabble.co
Thanks a lot, guys - very helpful!
On Fri, Sep 16, 2011 at 12:52 PM, Bert Gunter wrote:
> This is easy to do (e.g. divide by the appropriate power of 10, use floor,
> multiply the power of 10), but you are going about it in the wrong way.
>
> See the "xaxs" component of the ?par argument list f
This is easy to do (e.g. divide by the appropriate power of 10, use floor,
multiply the power of 10), but you are going about it in the wrong way.
See the "xaxs" component of the ?par argument list for the right way.
-- Bert
On Fri, Sep 16, 2011 at 9:28 AM, Dimitri Liakhovitski <
dimitri.liakh
Just for fun:
roundDown <- function(x, digits = 2)
{
currplaces <- nchar(as.character((floor(x
x <- x * 10 ^ (digits - currplaces)
x <- floor(x)
x <- x / (10 ^ (digits - currplaces))
x
}
> roundDown(1.98, 2)
[1] 1.9
> roundDown(1.98, 1)
[1] 1
> roundDown(1.98, 3)
[1] 1.98
>
>
> roundDown(2
In other words, I am looking for something like floor, but more
flexible - as it should allow me to:
turn 1.98 into 1.9 or
turn 298 into 290,
etc.
Dimitri
On Fri, Sep 16, 2011 at 12:28 PM, Dimitri Liakhovitski
wrote:
> Hello!
>
> What function would allow me to "round" down, rather than up?
> For
Hello!
What function would allow me to "round" down, rather than up?
For example, x<-1.98
I'd like to get 1.9 - rather than 2.0.
Reason - I am creating a minimum for an axis for a plot, and I need it
to be lower than x (which, in turn, is the lowest number already).
Thank you!
--
Dimitri Liakho
On Fri, Jan 14, 2011 at 11:16 PM, Phil Spector
wrote:
> Is sapply really necessary here?
Apparently not, and it is certainly more cumbersome. Because data
frames can contain a mix of classes, I thought that round() did not
have a method for them (in retrospect that does not make much sense).
I h
Bill, Joshua, Phil
Thanks for the suggestions. Very much appreciated.
Kind regards
Pete
--
View this message in context:
http://r.789695.n4.nabble.com/Rounding-variables-in-a-data-frame-tp3218729p3219060.html
Sent from the R help mailing list archive at Nabble.com.
_
Is sapply really necessary here?
exc = !names(d) %in% "d3"
d[,exc] = round(d[,exc])
d
d1 d2 d3 d4
1 10 6 2.3749642 -4
2 11 6 -0.2081097 -2
3 10 4 1.2675955 -4
4 10 8 1.2468859 -2
5 10 6 2.7193027 -4
6 9 6 1.9195531 -5
7 9 6 2.8188036 -6
8 10 7 2.5755148 -4
9
Hi Pete,
Here is one option. The first part of sapply() just serves to get all
names of d except those you excluded in 'exc'. If you were including
fewer variables than you were excluding, just get rid of the logical !
operator.
d <- data.frame(d1 = rnorm(10, 10), d2 = rnorm(10, 6),
d3 = rnor
__
From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of
Pete B [peter.breckn...@bp.com]
Sent: 15 January 2011 14:53
To: r-help@r-project.org
Subject: [R] Rounding variables in a data frame
Hi All
I am trying to use the round function on some columns of a dataframe while
leavi
Hi All
I am trying to use the round function on some columns of a dataframe while
leaving others unchanged. I wish to specify those columns to leave
unchanged.
My attempt is below - here, I would like the column d3 to be left but
columns d1, d2 and d4 to be rounded to 0 decimal places. I would w
why don't you just use 'pretty'
> pretty(c(-1225, 2224))
[1] -1500 -1000 -500 0 500 1000 1500 2000 2500
> pretty(c(-4.28, 6.45))
[1] -6 -4 -2 0 2 4 6 8
>
On Wed, Oct 20, 2010 at 8:38 PM, Dimitri Liakhovitski
wrote:
> Thank you for your help, everyone.
> Actually, I am building a
Thanks a lot, David - I'll try this solution.
Dimitri
On Wed, Oct 20, 2010 at 9:54 PM, David Winsemius wrote:
>
> On Oct 20, 2010, at 8:38 PM, Dimitri Liakhovitski wrote:
>
>> Thank you for your help, everyone.
>> Actually, I am building a lot of graphs (in a loop) but the values on
>> the y axes
On Oct 20, 2010, at 8:38 PM, Dimitri Liakhovitski wrote:
Thank you for your help, everyone.
Actually, I am building a lot of graphs (in a loop) but the values on
the y axes from graph to graph could range from [-5; 5] to [-10,000;
10,000].
So, I am trying to create ylim ranging from ymin to yma
Thank you for your help, everyone.
Actually, I am building a lot of graphs (in a loop) but the values on
the y axes from graph to graph could range from [-5; 5] to [-10,000;
10,000].
So, I am trying to create ylim ranging from ymin to ymax such that
they look appropriate for the range.
For example,
On 20-Oct-10 21:27:46, Duncan Murdoch wrote:
> On 20/10/2010 5:16 PM, Dimitri Liakhovitski wrote:
>> Hello!
>>
>> I am trying to round the number always up - i.e., whatever the
>> positive number is, I would like it to round it to the closest 10 that
>> is higher than this number, the closest 100 t
x<-runif(10,1,10) # generate 10 numbers
as.integer(log(x,10)+1)
--
Clint BowmanINTERNET: cl...@ecy.wa.gov
Air Quality Modeler INTERNET: cl...@math.utah.edu
Department of Ecology VOICE: (360) 407-6815
PO Box 47600
On 20/10/2010 5:16 PM, Dimitri Liakhovitski wrote:
Hello!
I am trying to round the number always up - i.e., whatever the
positive number is, I would like it to round it to the closest 10 that
is higher than this number, the closest 100 that is higher than this
number, etc.
For example:
x<-3241.
Hello!
I am trying to round the number always up - i.e., whatever the
positive number is, I would like it to round it to the closest 10 that
is higher than this number, the closest 100 that is higher than this
number, etc.
For example:
x<-3241.388
signif(x,1) rounds to the closest thousand, i.e.
On 14-Oct-10 09:43:53, Federico Calboli wrote:
> Hi All,
>
> I'm running the now almost-to-be upgraded R 2.11.1 on a Intel Mac, and
> on a Ubuntu machine, but the problem I see is the same. I noticed the
> following behaviour:
>
> 407585.91 * 0.8
> [1] 326068.7 -- the right asnwer is 326068.728
Hi All,
I'm running the now almost-to-be upgraded R 2.11.1 on a Intel Mac, and on a
Ubuntu machine, but the problem I see is the same. I noticed the following
behaviour:
407585.91 * 0.8
[1] 326068.7 -- the right asnwer is 326068.728
round(407585.91 * 0.8, 2)
[1] 326068.7 -- same issue
407585.
a MD
>
> Work: 301-451-8575
> Mobile: 301-204-5642
> Email: zoppo...@mail.nih.gov
>
> From: Raphael Fraser [raphael.fra...@gmail.com]
> Sent: Monday, September 20, 2010 12:21 PM
> To: r-help@r-project.org
> Subject: [R] Rounding
On Sep 20, 2010, at 12:25 PM, Joshua Wiley wrote:
Hi Raphael,
mat <- matrix(rnorm(100), ncol = 2)
round(mat, 2)
for documentation see ?round
Thanks, Josh. I was having trouble a couple of minutes ago remembering
this. Getting old, I guess. In constructing my thanks to Josh I tested:
pr
Hi Raphael,
mat <- matrix(rnorm(100), ncol = 2)
round(mat, 2)
for documentation see ?round
Cheers,
Josh
On Mon, Sep 20, 2010 at 9:21 AM, Raphael Fraser
wrote:
> I have a 2x50 matrix and would like to round all the elements to 2
> decimal places. Can any one help?
>
> Thanks,
> Raphael
>
> ___
I have a 2x50 matrix and would like to round all the elements to 2
decimal places. Can any one help?
Thanks,
Raphael
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Mohan L
> Sent: Monday, May 24, 2010 6:26 PM
> To: r-help@r-project.org
> Subject: [R] rounding up to nearest integer
>
> Dear All,
>
> I hav
?round
On May 24, 2010, at 9:26 PM, Mohan L wrote:
Dear All,
I have a data frame "data" and the below is the str of "data" :
$ Feb : int 1 1195 0 11 28 152 24 2 1 1470 ...
$ Mar : int 0 1212 0 17 27 184 15 1 1 1311 ...
$ Apr : int 2 1244 1 15 23 135 11 0 1 991 ...
$ May : int 2
Dear All,
I have a data frame "data" and the below is the str of "data" :
$ Feb : int 1 1195 0 11 28 152 24 2 1 1470 ...
$ Mar : int 0 1212 0 17 27 184 15 1 1 1311 ...
$ Apr : int 2 1244 1 15 23 135 11 0 1 991 ...
$ May : int 2 1158 2 10 23 111 16 1 1 1237 ...
$ Jun : int 0 84
Duncan Murdoch stats.uwo.ca> writes:
[...]
> MASS (function rational())
> rcdd
> Rmpfr
[...]
OK, I will look for those packages.
Maybe they will help.
Thank you.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEA
On 22/02/2010 9:57 AM, Oliver wrote:
Hello,
which packages are you talking about?
And... are thoise packages using integer-based calculations?
I don't use this, but the ones I'd look in would be:
MASS (function rational())
rcdd
Rmpfr
You can use
RSiteSearch("rational")
to look for more.
Hello,
which packages are you talking about?
And... are thoise packages using integer-based calculations?
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posti
same result with R2.10.1 on Windows...
Le 2/22/2010 15:34, Oliver a écrit :
Oh strange...
round(108.275 , 2)
[1] 108.28
round(208.275 , 2)
[1] 208.28
round(308.275 , 2)
[1] 308.27
looks not like what one should expect...
R version 2.9.2 (2009-0
On 22/02/2010 9:06 AM, Oliver wrote:
Hello,
I need to have a "kaufmaennisches Runden" function.
Is there already something like that?
It means: rounding up the 5, instead of rounding it down.
So, 245.455 would give 245.46
I found no option for this.
Maybe there is a package for it?
This is
Oh strange...
> round(108.275 , 2)
[1] 108.28
> round(208.275 , 2)
[1] 208.28
> round(308.275 , 2)
[1] 308.27
>
looks not like what one should expect...
R version 2.9.2 (2009-08-24)
Ciao,
Oliver
__
R-help@r-project.org mailing list
https://s
round(245.455, 2) ?
On Mon, Feb 22, 2010 at 11:06 AM, Oliver wrote:
> Hello,
>
> I need to have a "kaufmaennisches Runden" function.
>
> Is there already something like that?
>
> It means: rounding up the 5, instead of rounding it down.
>
> So, 245.455 would give 245.46
>
> I found no option for
Hello,
I need to have a "kaufmaennisches Runden" function.
Is there already something like that?
It means: rounding up the 5, instead of rounding it down.
So, 245.455 would give 245.46
I found no option for this.
Maybe there is a package for it?
Oliver
__
Uwe Ligges-3 wrote:
>
>
>
> Tom La Bone wrote:
>> I have a measurement of 8165.666 and an uncertainty of 338.9741 (the
>> units of
>> both are unimportant). I can easily round the uncertainty to two
>> significant
>> digits with signif(338.9741,2), which gives 340. Is there a function in R
>>
Tom La Bone wrote:
I have a measurement of 8165.666 and an uncertainty of 338.9741 (the units of
both are unimportant). I can easily round the uncertainty to two significant
digits with signif(338.9741,2), which gives 340. Is there a function in R
that will take 8165.666 and round it to be cons
I have a measurement of 8165.666 and an uncertainty of 338.9741 (the units of
both are unimportant). I can easily round the uncertainty to two significant
digits with signif(338.9741,2), which gives 340. Is there a function in R
that will take 8165.666 and round it to be consistent with its uncert
On Oct 29, 2009, at 12:29 PM, Alan Cohen wrote:
Hello,
I am trying to print a table with numbers all rounded to the same
number of digits (one after the decimal), but R seems to want to not
print ".0" for integers. I can go in and fix it one number at a
time, but I'd like to understand
On Thu, 29 Oct 2009 12:29:42 -0400 Alan Cohen
wrote:
> I am trying to print a table with numbers all rounded to the same
> number of digits (one after the decimal), but R seems to want to not
> print ".0" for integers.
'round' only rounds numbers; it doesn't format them. Use 'formatC'
instead
Hello,
I am trying to print a table with numbers all rounded to the same number of
digits (one after the decimal), but R seems to want to not print ".0" for
integers. I can go in and fix it one number at a time, but I'd like to
understand the principle. Here's an example of the code. The pro
>> can you explain that a little more detailed?
>> Perhaps I miss the background knowledge - but it seems just absurd
to me.
>>
>> 0.1+0.1+0.1 is 0.3 - there is no rounding involved, is there?
>>
>> why is
>> x <- 0.1 + 0.1 +0.1
>> not equal to
>> y <- 0.3
>
> Remember that this is in BINARY a
> -Original Message-
> From: Peter Dalgaard [mailto:p.dalga...@biostat.ku.dk]
> Sent: Wednesday, September 30, 2009 3:58 PM
> To: Nordlund, Dan (DSHS/RDA)
> Cc: Douglas Bates; r help
> Subject: Re: [R] Rounding error in seq(...)
>
<<>>
> >
> &g
Nordlund, Dan (DSHS/RDA) wrote:
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Douglas Bates
Sent: Wednesday, September 30, 2009 3:06 PM
To: Peter Dalgaard
Cc: r help; Duncan Murdoch
Subject: Re: [R] Rounding error in seq(...)
On
> In an earlier thread on this theme I believe that someone quoted Brian
> Kernighan as saying "10 times 0.1 is hardly ever 1" but I haven't been
> able to track down the quote. Can anyone point us to such a quote?
> It summarizes the situation succinctly,
See FAQ 7.31 :)
___
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of Douglas Bates
> Sent: Wednesday, September 30, 2009 3:06 PM
> To: Peter Dalgaard
> Cc: r help; Duncan Murdoch
> Subject: Re: [R] Rounding error in seq(...
On Sep 30, 2009, at 6:05 PM, Douglas Bates wrote:
On Wed, Sep 30, 2009 at 2:32 PM, Peter Dalgaard> wrote:
Martin Batholdy wrote:
hum,
can you explain that a little more detailed?
Perhaps I miss the background knowledge - but it seems just absurd
to me.
0.1+0.1+0.1 is 0.3 - there is no ro
On Wed, Sep 30, 2009 at 2:32 PM, Peter Dalgaard wrote:
> Martin Batholdy wrote:
>>
>> hum,
>>
>> can you explain that a little more detailed?
>> Perhaps I miss the background knowledge - but it seems just absurd to me.
>>
>> 0.1+0.1+0.1 is 0.3 - there is no rounding involved, is there?
>>
>> why is
On 30-Sep-09 19:32:46, Peter Dalgaard wrote:
> Martin Batholdy wrote:
>> hum,
>>
>> can you explain that a little more detailed?
>> Perhaps I miss the background knowledge - but it seems just absurd to
>> me.
>>
>> 0.1+0.1+0.1 is 0.3 - there is no rounding involved, is there?
>>
>> why is
>> x <
On 9/30/2009 3:59 PM, Ista Zahn wrote:
For my own edification more than anything (I never took computer science): is
a = seq(0.1,0.9,by=0.1)
a <- as.character(a)
a[3] == "0.3"
[1] TRUE
safe?
No. Someone might be in a locale where the comma is used as the decimal
separator. Take a look at
For my own edification more than anything (I never took computer science): is
> a = seq(0.1,0.9,by=0.1)
> a <- as.character(a)
> a[3] == "0.3"
[1] TRUE
safe?
-Ista
On Wed, Sep 30, 2009 at 3:46 PM, cls59 wrote:
>
>
> Martin Batholdy wrote:
>>
>> hum,
>>
>> can you explain that a little more det
Martin Batholdy wrote:
>
> hum,
>
> can you explain that a little more detailed?
> Perhaps I miss the background knowledge - but it seems just absurd to
> me.
>
> 0.1+0.1+0.1 is 0.3 - there is no rounding involved, is there?
>
>
Unfortunately this comes as an utter shock to many people wh
1 - 100 of 149 matches
Mail list logo