Hmm looks like something like this solves the problem:

#' @name WKNND-class
#' @exportClass WKNND
#' @export WKNND
WKNND <- setRcppClass("WKNND")

i.e. the -class suffix for the name of the documented item seems to do the trick. I'm not sure if there is a place somewhere in the Rcpp modules documentation for this.

Best,

Greg.

On 29 Aug 2014, at 16:21, Dr Gregory Jefferis wrote:

Hello,

I just wondered if someone could give me some pointers for how to document classes exposed by Rcpp Modules / setRcppClass. I am a little hazy on what setRcppClass is doing and how I should be documenting it and reading

        http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf

has not yet enlightened me. I am using roxygen2 for documentation and have something like this:

#' @name WKNND
#' @rdname WKNN
#' @exportClass WKNND
#' @export WKNND
WKNND <- setRcppClass("WKNND")

(The full code is here https://github.com/jefferis/nabo/blob/master/R/WKNNClasses.R)

which produces this in namespace:

export(WKNND)
exportClasses(WKNND)

along with a sensible looking WKNN.Rd file (here https://github.com/jefferis/nabo/blob/master/man/WKNN.Rd )

but check gives:

* checking for missing documentation entries ... WARNING
Undocumented S4 classes:
'WKNND' 'WKNNF'
All user-level objects in a package (including S4 classes and methods)
should have documentation entries.

I have tried using library(Rcpp);prompt( WKNNF, "man/WKNNF-module.Rd" ) but that produces documentation appropriate to a generic module but not specifically a class.

Many thanks for any suggestions, pointers to packages that might do this etc!

Greg.

--
Gregory Jefferis, PhD                   Tel: 01223 267048
Division of Neurobiology
MRC Laboratory of Molecular Biology
Francis Crick Avenue
Cambridge Biomedical Campus
Cambridge, CB2 OQH, UK

http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis
http://jefferislab.org
http://flybrain.stanford.edu
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


--
Gregory Jefferis, PhD                   Tel: 01223 267048
Division of Neurobiology
MRC Laboratory of Molecular Biology
Francis Crick Avenue
Cambridge Biomedical Campus
Cambridge, CB2 OQH, UK

http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis
http://jefferislab.org
http://flybrain.stanford.edu
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to