Dear Hans,

r-help-requ...@r-project.org wrote on 2020-01-09 12:00:
Date: Wed, 8 Jan 2020 12:09:55 +0100
From: Hans W Borchers <hwborch...@gmail.com>
To: R help project <r-help@r-project.org>
Subject: [R] Which external functions are called in a package?
        [Solved]

NB: `trapz`, ie.
the trapezoidal integration formula, seems to be the numerical
function to be missed the most in R base.

In R base indeed. However available in Frank Harrels Hmisc as the function trap.rule(x, y) for sorted values.
In plain R: function(x, y) sum(diff(x) * (y[-1] + y[-length(y)]))/2

Helmut

--
Ing. Helmut Schütz
BEBAC – Consultancy Services for
Bioequivalence and Bioavailability Studies
Neubaugasse 36/11
1070 Vienna, Austria
W https://bebac.at/
F https://forum.bebac.at/

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to