Re: [R] Entire part of number

2011-04-19 Thread Ivan Calandra
Nice example, I forgot about negative numbers... Thanks Ivan Le 4/19/2011 12:17, (Ted Harding) a écrit : trunc(-1.5) # [1] -1 floor(-1.5) # [1] -2 Ted. On 19-Apr-11 09:57:43, Ivan Calandra wrote: By the way, is there any difference between trunc() and floor()? x<- c(1.05, 1.95, 2

Re: [R] Entire part of number

2011-04-19 Thread Ted Harding
trunc(-1.5) # [1] -1 floor(-1.5) # [1] -2 Ted. On 19-Apr-11 09:57:43, Ivan Calandra wrote: > By the way, is there any difference between trunc() and floor()? > > x <- c(1.05, 1.95, 2.5, 3.51) > trunc(x) > [1] 1 1 2 3 > floor(x) > [1] 1 1 2 3 > identical(trunc(x), floor(x)) > > Ivan > >

Re: [R] Entire part of number

2011-04-19 Thread Ivan Calandra
By the way, is there any difference between trunc() and floor()? x <- c(1.05, 1.95, 2.5, 3.51) trunc(x) [1] 1 1 2 3 floor(x) [1] 1 1 2 3 identical(trunc(x), floor(x)) Ivan Le 4/19/2011 11:46, Rolf Turner a écrit : On 19/04/11 21:30, barbara.r...@uniroma1.it wrote: What is the function to ha

Re: [R] Entire part of number

2011-04-19 Thread Rolf Turner
On 19/04/11 21:30, barbara.r...@uniroma1.it wrote: What is the function to have the entire part of a number? [[alternative HTML version deleted]] I'm not quite sure what you mean, but perhaps you want "floor()". cheers, Rolf Turner

Re: [R] Entire part of number

2011-04-19 Thread Gerrit Eichner
What is the function to have the entire part of a number? If "entire" refers to "integer" take a look at ?trunc Hth -- Gerrit - Dr. Gerrit Eichner Mathematical Institute, Room 212 gerrit.eich...@math.uni

[R] Entire part of number

2011-04-19 Thread Barbara . Rogo
What is the function to have the entire part of a number? [[alternative HTML version deleted]] __ 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/posting-gu