Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to document RcppExports.R linking functions?

Tags:

r

roxygen2

rcpp

In my RcppExports.R, things look like this:

# This file was generated by Rcpp::compileAttributes
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

rcppeigen_ftrans <- function(A) {
    .Call('mypkg_rcppeigen_ftrans', PACKAGE = 'mypkg', A)
}

I try to document my code like this:

# This file was generated by Rcpp::compileAttributes
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
# 
#' Fast Matrix Transpose
#' 
#' (description)
#' @param ...
#'

rcppeigen_ftrans <- function(A) {
    .Call('mypkg_rcppeigen_ftrans', PACKAGE = 'mypkg', A)
}

Whenever I hit the document button, roxygen2 automatically runs Rcpp::compileAttributes() and then this file gets regenerated without documentation. I also tried to manually write the .Rd documentation files, but again when I hit document, the .Rd file gets deleted. I want to document these linking functions, but don't know how to.

like image 529
Andy Yao Avatar asked Aug 10 '15 12:08

Andy Yao


1 Answers

i.e. to be precise, in your code.cpp file:

//' Fast Matrix Transpose
//' 
//' Description
//' @param m
//' ... etc
IntegerMatrix fasttr(IntegerMatrix m) {
like image 195
Jack Wasey Avatar answered Oct 18 '22 07:10

Jack Wasey