search for: round

Displaying 20 results from an estimated 9267 matches for "round".

Did you mean: found
2011 Mar 30
0
Plot an ols() call from Design
...ired package: Hmisc Loading required package: survival Loading required package: splines Attaching package: 'Hmisc' The following object(s) are masked from 'package:survival': untangle.specials The following object(s) are masked from 'package:base': format.pval, round.POSIXt, trunc.POSIXt, units Design library by Frank E Harrell Jr Type library(help='Design'), ?DesignOverview, or ?Design.Overview') to see overall documentation. Attaching package: 'Design' The following object(s) are masked from 'package:Hmisc': strgraphwrap...
2009 May 20
2
round function seems to produce maximum 2 decimals
I am trying to use round()to force R to display a specific number of decimals, but it seems to display <=2 decimals no matter what I specify in the digits argument. As an alternative I tried signif(), but it also produces unexpected results. See example code and results below. Format() works, but then the result no long...
2013 Jan 03
3
Question on Round function
I happened to see these: > round(.5, 0) [1] 0 > round(1.5, 0) [1] 2 > round(2.5, 0) [1] 2 > round(3.5, 0) [1] 4 > round(4.5, 0) [1] 4 What is the rule here? Should not round(.5, 0) = 1, round(2.5, 0) = 3 etc? Thanks and regards,
2007 Jul 06
0
Branch 'as' - 2 commits - libswfdec/swfdec_as_math.c test/trace
libswfdec/swfdec_as_math.c | 10 +++++++++- test/trace/Makefile.am | 9 +++++++++ test/trace/round-direction-5.swf |binary test/trace/round-direction-5.swf.trace | 5 +++++ test/trace/round-direction-6.swf |binary test/trace/round-direction-6.swf.trace | 5 +++++ test/trace/round-direction-7.swf |binary test/trace/round-direction-7.swf.trace | 5 +++++ test/trace/ro...
2024 Feb 08
1
round.Date and trunc.Date not working / implemented
Technically, there is a round() for 'Date' objects, but it doesn't seem very useful, because it basically just fall back to the default round() method, which only takes the 'digits' argument. Here's an example: > date <- Sys.Date() > class(date) [1] "Date" We see that there are only...
2006 Mar 07
13
Active Record - Can''t figure out relationship.
I have the following two tables: create table teams ( id int not null auto_increment, short_name varchar(12) not null, long_name varchar(50) not null, logo varchar(20) not null, primary key (id) ); create table rounds ( id int not null auto_increment, home_team_id int not null, away_team_id int not null, round tinyint(4) not null, home_team_score tinyint(8) not null, away_team_score tinyint(8) not null, constraint fk_home_teams for...
2008 Jun 15
2
round(1.5) = round(2.5) = 2?
Dear R-users with a bit of grief I had to repeat an extensive analysis because I did not suspect (and therefore did not read the documentation) that round was implemented as "for rounding off a 5, the IEC 60559 standard is expected to be used, 'go to the even digit'", resulting in round(1.5) = 2 round (2.5) = 2. As a non-mathematician I am both puzzled and intrigued by this rule as it is against what I have learned in my math c...
2024 Feb 08
1
round.Date and trunc.Date not working / implemented
This is a workaround, and could be the basis for a round.Date improvement: date <- Sys.Date() as.Date(round(as.POSIXct(date), "years")) as.Date(round(as.POSIXct(Sys.Date() + 180), "years")) Duncan Murdoch On 08/02/2024 12:23 p.m., Henrik Bengtsson wrote: > Technically, there is a...
2024 Feb 08
1
round.Date and trunc.Date not working / implemented
...gt;>>>>>> Ji?? Moravec >>>>>>> on Wed, 7 Feb 2024 10:23:15 +1300 writes: >> >>> This is my first time working with dates, so if the answer is "Duh, work >>> with POSIXt", please ignore it. >> >>> Why is not `round.Date` and `trunc.Date` "implemented" for `Date`? >> >>> Is this because `Date` is (mostly) a virtual class setup for a better >>> inheritance or is that something that is just missing? (like >>> `sort.data.frame`). Would R core welcome a patch? >> &g...
2024 Feb 09
1
round.Date and trunc.Date not working / implemented
> This is a workaround, and could be the basis for a round.Date improvement: >?? date <- Sys.Date() >?? as.Date(round(as.POSIXct(date), "years")) >?? as.Date(round(as.POSIXct(Sys.Date() + 180), "years")) > Duncan Murdoch That would work, perhaps structured similarly as `trunc.Date...
2020 Feb 08
1
round(x, dig) [was "Development version of R fails tests .."]
>>>>> Hugh Parsonage >>>>> on Sat, 8 Feb 2020 21:12:43 +1100 writes: > The only observation I can make is that the change to > round() was made in r77727 whereas your R-devel appears to > be r77715 (so would not exhibit the fixed behaviour). My > guess is that there was a perpetual installation failure > after r77715 but that the test folder was still retrieved > and used. > On Sat, 8 Feb 20...
2006 Jun 23
6
float calculation error
Hi I have the following values pActualCost = 33.00 pPaymentCost = 29.99 So this calculation should leave me with 0.01 pPaymentDifference = pActualCost - pPaymentCost however when doing this in rails, it returns 0.00999999999999801 has anyone got any suggestions to whats going wrong and how I can correct this Thanks Scott -- Posted via http://www.ruby-forum.com/.
2007 Aug 02
6
- round() strange behaviour
Hi, I am getting some strange results using round - it seems that it depends if the number before the decimal point is odd or even .... For example: > round(1.5)[1] 2> round(2.5)[1] 2 While i would expect that round(2.5) be 3 and not 2. Do you have any explanation for that? I really appreciate your input, Monica _______________...
2024 Feb 08
2
round.Date and trunc.Date not working / implemented
...thz.ch> wrote: > >>>>>> Ji?? Moravec >>>>>> on Wed, 7 Feb 2024 10:23:15 +1300 writes: > >> This is my first time working with dates, so if the answer is "Duh, work >> with POSIXt", please ignore it. > >> Why is not `round.Date` and `trunc.Date` "implemented" for `Date`? > >> Is this because `Date` is (mostly) a virtual class setup for a better >> inheritance or is that something that is just missing? (like >> `sort.data.frame`). Would R core welcome a patch? > >> I decided...
2020 Sep 04
3
Misleading documentation on FP to integer conversion instructions?
> On Sep 4, 2020, at 2:40 PM, Neil Nelson via llvm-dev <llvm-dev at lists.llvm.org> wrote: > >> If fptosi takes 0.9 -> 0, then that is not 'rounding' in any sense I'm aware of (IEEE754 or otherwise). >> Rounding (in the IEE754 sense) determines how a number is converted when it is halfway between two >> candidate results. (see round(), ceil(), floor()). Rounding in the IEEE 754 sense is simply an algorithm to choose on...
2005 Oct 24
1
Problems with pf() with certain noncentral values/degrees of freedom combinations
...s of freedom came about (PR#138), but I couldn't find the present issue reported anywhere. Might there be a way to make the algorithm more stable? I'm not sure how difficult this issue might be to fix, but hopefully it won't be too bad and can be easily done. Any thoughts on a workaround until then? Thanks, Ken Kelley # <Begin example code> X <- seq(10, 600, 10) # Gets stuck at .99135 ############################ round(pf(X, 10, 1000, 225), 5) round(pf(X, 10, 200, 225), 5) round(pf(X, 5, 1000, 225), 5) round(pf(X, 5, 200, 225), 5) round(pf(X, 1, 1000, 225), 5) round(p...
2011 Dec 01
3
round to specific intervals
Dear R users/helpers, I am wondering is there an existing function in which you can round numbers to a set of values. I know you can use 5 * round(x/5) for rounding to the nearest 5 or so, but what if the interval size is not constant. For example: ## Not run test <- rnorm(100) round(test, c(1, 5, 10, 20, 50)) so that the test is rounded to the closest value in the vector. Than...
2012 Apr 03
1
"Failed to create rounding.h!" during make
...nable to "make" the Makefile. Did some STFW'ing and have found several variations of this problem. Other mentions have included redirecting the output of this part of the code to stdout or a file instead of /dev/null but it looks like my Makefile includes this already: it redirects to rounding.out and cats that file after it fails. That is, this section of Makefile: ---------------- flist.o: rounding.h rounding.h: rounding.c rsync.h @for r in 0 1 3; do \ if $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o rounding -DEXTRA_ROUNDING=$$r -I. $(srcdir)/rounding.c >roundi...
2012 Sep 12
8
Round off method in 1.8.7
Hi all i am trying to use round method if have a value 2.08 i want it as 2.1 and it worked in 1.9.2 but not in 1.8.7 is there any other way of doing it. USING 1.9.2 1.9.2p320 :001 > 2.08.round(1) => 2.1 1.9.2p320 :002 > 2.04.round(1) => 2.0 USING 1.8.7 irb(main):001:0> 2.08.round => 2 irb(main):002:0...
2011 Jul 28
2
Animated gif or something similar in R?
...d to output to a animated gif or some other format that could be used in a powerpoint type presentation? I work with a bunch of 'drama queens'--they'd like it if there was some motion rather than a static display ;-) Thanks in advance, Dale. library(rgl) clusset<-data.frame(x=c(round(abs(rnorm(5,7,1)),1),round(abs(rnorm(5,11,2)),1), round(abs(rnorm(5,16,2)),1),round(abs(rnorm(5,20,1.5)),1),round(abs(rnorm(5,5,2)),1)), y=c(round(abs(rnorm(5,7,2)),1),round(abs(rnorm(5,11,2)),1), round(abs(rnorm(5,16,2)),1),...