[R] Decimal number
R. Michael Weylandt
michael.weylandt at gmail.com
Tue Aug 7 22:48:52 CEST 2012
Are you simply looking for c() then?
I'm afraid I simply don't understand your question:
R> b1 <- 64.90614
R> b2 <- 17.7025
R> c(b1, b2)
[1] 64.90614 17.70250
Perhaps you need to adjust
options()$digits
For me (and I believe by default) it is 7, but you can change it
with a command such as
options(digits = 10)
if you want more decimal places.
Also, please continue to cc the R-help list on all correspondance.
Best,
Michael
On Tue, Aug 7, 2012 at 3:40 PM, hafida goual <hafida-06 at hotmail.fr> wrote:
> HI
>
> I try the code
>
>> when i wrote beta
>>I want to get the number of beta and beta with the full part after the
>> comma
>
> thank you
> hafida
>> beta0
> [1] 64.90614
>> beta1
> [1] 17.7025
>> round(beta)
> [1] 17 64
>> floor(beta)
> [1] 17 64
>
>
>> From: michael.weylandt at gmail.com
>> Date: Tue, 7 Aug 2012 14:56:16 -0500
>> Subject: Re: [R] Decimal number
>> To: hafida-06 at hotmail.fr
>> CC: r-help at r-project.org
>>
>> On Tue, Aug 7, 2012 at 11:47 AM, hafida <hafida-06 at hotmail.fr> wrote:
>> > HI
>> >
>> >>i have a little problem please help me to solve it
>> >
>> >>this is the code in R:
>> >
>> >>> beta0
>> > [1] 64.90614
>> >> beta1
>> > [1] 17.7025
>> >> beta
>> > [1] 17 64
>> >
>> >>her beta<- c(beta0, beta1)
>> >
>> > thank you in advance
>> > hafida
>>
>> Are you looking for the round() function? Or, given the results you
>> gave, possibly floor()?
>>
>> Best,
>> Michael
More information about the R-help
mailing list