R-help, specifying the places to decimal

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

R-help, specifying the places to decimal

Subhabrata
Hello - R-experts,


Is there any way with which we can specify the number after
decimal point to take. Like I have a situation where
the values are comming 0.160325923 but I only want
4 place to decimal say 0.1603. Is there any way for that.

I am no expert in R- and this may sound simple to many.sorry


Thanks for any help.

With Regards

Subhabrata

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: R-help, specifying the places to decimal

Dimitris Rizopoulos
have a look at ?round()

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://www.med.kuleuven.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


----- Original Message -----
From: "Subhabrata" <[hidden email]>
To: "r-help" <[hidden email]>
Sent: Monday, February 13, 2006 9:33 AM
Subject: [R] R-help, specifying the places to decimal


> Hello - R-experts,
>
>
> Is there any way with which we can specify the number after
> decimal point to take. Like I have a situation where
> the values are comming 0.160325923 but I only want
> 4 place to decimal say 0.1603. Is there any way for that.
>
> I am no expert in R- and this may sound simple to many.sorry
>
>
> Thanks for any help.
>
> With Regards
>
> Subhabrata
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: R-help, specifying the places to decimal

Vivek Satsangi
In reply to this post by Subhabrata
In addition to round() mentioned earlier, if you are merely looking to
*display* your results differently, you may want to check out the
digits option, e.g. in summary():

(This is the method signature for data.frame 's):

     summary(object, maxsum = 7,
            digits = max(3, getOption("digits")-3), ...)


(Begin quoted message)
>Date: Mon, 13 Feb 2006 14:03:55 +0530
>From: "Subhabrata" <[hidden email]>
>Subject: [R] R-help, specifying the places to decimal
>To: "r-help" <[hidden email]>
>Message-ID: <022f01c63078$3c09c5c0$f608a8c0@srai37>
>Content-Type: text/plain;       charset="iso-8859-1"

>Hello - R-experts,


>Is there any way with which we can specify the number after
>decimal point to take. Like I have a situation where
>the values are comming 0.160325923 but I only want
>4 place to decimal say 0.1603. Is there any way for that.

>I am no expert in R- and this may sound simple to many.sorry


>Thanks for any help.

>With Regards

>Subhabrata

--
-- Vivek Satsangi
Student, Rochester, NY USA

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html