? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110419/d7309058/attachment.pl>
Entire part of number
6 messages · Barbara.Rogo at uniroma1.it, Gerrit Eichner, Rolf Turner +2 more
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.eichner at math.uni-giessen.de Justus-Liebig-University Giessen Tel: +49-(0)641-99-32104 Arndtstr. 2, 35392 Giessen, Germany Fax: +49-(0)641-99-32109 http://www.uni-giessen.de/cms/eichner
On 19/04/11 21:30, Barbara.Rogo at 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
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 at 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
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 Le 4/19/2011 11:46, Rolf Turner a ?crit :
On 19/04/11 21:30, Barbara.Rogo at 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.
-------------------------------------------------------------------- E-Mail: (Ted Harding) <ted.harding at wlandres.net> Fax-to-email: +44 (0)870 094 0861 Date: 19-Apr-11 Time: 11:17:26 ------------------------------ XFMail ------------------------------
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.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 at 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.
-------------------------------------------------------------------- E-Mail: (Ted Harding)<ted.harding at wlandres.net> Fax-to-email: +44 (0)870 094 0861 Date: 19-Apr-11 Time: 11:17:26 ------------------------------ XFMail ------------------------------
______________________________________________ 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