Re: [rounding (ceil in matlab)] (was: calculating quartils, tercils (or percentiles) Using R?)

2022-07-14 Thread Rudolf Adamkovič
Uwe Brauer  writes:

> […] the matlab command `ceil' for example does this, I can't find
> anything similar in the documentation.

How about the 'ceiling' function?  See '?ceiling'.  For example:

ceiling(quantile(c(1, 2, 3), c(1 / 3, 2 / 3, 1)))

Rudy
-- 
"One can begin to reason only when a clear picture has been formed in
the imagination."
-- Walter Warwick Sawyer, Mathematician's Delight, 1943

Rudolf Adamkovič  [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



[rounding (ceil in matlab)] (was: calculating quartils, tercils (or percentiles) Using R?)

2022-07-13 Thread Uwe Brauer
>>> "JJ" == Jeremie Juste  writes:

> Hello Uwe,

>> On Sunday, 22 May 2022 at 08:40, Uwe Brauer wrote:

>> but I can't not find a way to calculate other percentiles, like
>> terciles or so. Does anybody know about this, or a org-function doing
>> it?


> I would recommend checking the R documentation. 

>  #+begin_src R :colnames t :var t1=TC :results output
>   ?quantile
>  #+end_src

>  #+tblname: TC
>  | Data |

>  |--|
>  |5 |
>  |   10 |
>  |   12 |
>  |   15 |
>  |   20 |
>  |   24 |
>  |   27 |
>  |   30 |
>  |   35 |

> Consider also the R mailing list r-h...@r-project.org. The community is
> quite active. 

> I believe that you might be looking for the following.

>  #+begin_src R :colnames t :var t1=TC 
>   quantile(t1$Data,c(1/3,2/3,1))
>  #+end_src

As I said that works nicely, however it turns out that I need to round
the result in a specific way, always round toward positive infinity, 
the matlab command `ceil' for example does this, I can't find anything
similar in the documentation. You recommend to use the R mailing list,
which I will do, but maybe you know it by heart?

Thanks and regards

Uwe 


smime.p7s
Description: S/MIME cryptographic signature