Re: [R] Entire part of number

From: Ivan Calandra <ivan.calandra_at_uni-hamburg.de>
Date: Tue, 19 Apr 2011 11:57:43 +0200

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.Rogo@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
>
> ______________________________________________
> R-help_at_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-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
ivan.calandra_at_uni-hamburg.de

**********
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/1525_8_1.php

______________________________________________
R-help_at_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-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 19 Apr 2011 - 09:59:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 19 Apr 2011 - 10:40:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive