Dear list,

I'm facing an issue with the automated documentation of a function using
roxygen2. The function has a complex-valued default argument, which is
picked up by roxygen2 using formals() to generate the corresponding Usage
section of the Rd file. Unfortunately, it appears that formals() reformats
complex numbers. Consider the example below,

test <- function(a = 1+2i){}

> args(test)
function (a = 1 + (0+2i))
  NULL
> formals(test)
$a
1 + (0+2i)

As a result, R CMD check issues a warning that my Rd file is inconsistent
between Code and Docs. Redefining the function with this syntax (a = 1 +
(0+2i)) doesn't help, as a new 0 gets added to become 1 + (0 + (0+2i)).

Is this reformatting necessary?

Regards,

baptiste

sessionInfo()
R Under development (unstable) (2013-11-25 r64299)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_NZ.UTF-8/en_NZ.UTF-8/en_NZ.UTF-8/C/en_NZ.UTF-8/en_NZ.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_3.1.0

        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to