Skip to content

[Rcpp-devel] Question for the Rcpp

4 messages · Yi Zhao, Douglas Bates, Steve Lianoglou +1 more

#
Dear,

I have written a package with Rcpp. Now I need to test how fast is the
function that I wrote.

I am wondering to know is there any function or tools to show the time that
it cost?

And also is there any instruction to write a help file for R function?

Thanks for your help!

Yi Zhao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20110804/d7fcadce/attachment-0001.htm>
#
On Thu, Aug 4, 2011 at 10:00 PM, Yi Zhao <zhaoyitj2010 at gmail.com> wrote:
The basic function to time the evaluation of an function call or other
type of R expression is system.time().  See the manual page for it.

We often use the benchmark function in the rbenchmark package to
perform multiple repetitions of timings of different expressions and
compare the results.
The "Writing R Extensions" manual.
#
Hi,
On Thu, Aug 4, 2011 at 4:00 PM, Yi Zhao <zhaoyitj2010 at gmail.com> wrote:
Doug has already mentioned rbenchmark, which is handy:
http://cran.r-project.org/web/packages/rbenchmark/index.html
you might consider using roxygen (or the upcoming roxygen2) for R docs.

http://roxygen.org/
https://github.com/klutometis/roxygen

-steve
#
On 4 August 2011 at 19:18, Steve Lianoglou wrote:
| On Thu, Aug 4, 2011 at 4:00 PM, Yi Zhao <zhaoyitj2010 at gmail.com> wrote:
| > I am wondering to know is there any function or tools to show the time that
| > it cost?
| 
| Doug has already mentioned rbenchmark, which is handy:
| http://cran.r-project.org/web/packages/rbenchmark/index.html

And we almost constantly post examples using it here on the list so the list
archives should have plenty of working samples.
 
| > And also is there any instruction to write a help file for R function?

Besides the official manual ("Writing R Extensions") mentioned by Doug, there
are also 3000+ packages on CRAN you can study.  Pick one you know and like
and see how it does it. Read the Manual for background too.

Dirk