generate Rd file from R file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

generate Rd file from R file

Romain François
Hi,

Is there something similar to javadoc or doxygen for R, ie ability to
create a first draft of an Rd file reading the comments that are in a
script file?

For example, for the weighted.mean function in base, one could write the
source as :

weighted.mean <- function(
x,             #@ a numeric vector containing the values whose mean is to be computed.
w,             #@ a vector of weights the same length as |x| giving the weights to use for each element of |x|.
na.rm = FALSE  #@ a logical value indicating whether |NA |values in |x| should be stripped before the computation proceeds.
)
#e wt <- c(5,  5,  4,  1)/15
#e x <- c(3.7,3.3,3.5,2.8)
#e xm <- weighted.mean(x,wt)


and get a draft file more full than what may be created with prompt.
Of course, I do not ask for a way to not write all the information in
one file ... but some can be shared between R and Rd

Romain



--
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php
+---------------------------------------------------------------+
| Romain FRANCOIS - http://francoisromain.free.fr               |
| Doctorant INRIA Futurs / EDF                                  |
+---------------------------------------------------------------+

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: generate Rd file from R file

Philippe Grosjean
Hi,
There is something like that (not so sophiscticated) defined in the
green book, but it is not implemented in R. You should look at the
mvbutils package, ?dochelp, ?flatdoc, ?doc3Rd, to get such features.
Best,

Philippe Grosjean


Romain Francois wrote:

> Hi,
>
> Is there something similar to javadoc or doxygen for R, ie ability to
> create a first draft of an Rd file reading the comments that are in a
> script file?
>
> For example, for the weighted.mean function in base, one could write the
> source as :
>
> weighted.mean <- function(
> x,             #@ a numeric vector containing the values whose mean is to be computed.
> w,             #@ a vector of weights the same length as |x| giving the weights to use for each element of |x|.
> na.rm = FALSE  #@ a logical value indicating whether |NA |values in |x| should be stripped before the computation proceeds.
> )
> #e wt <- c(5,  5,  4,  1)/15
> #e x <- c(3.7,3.3,3.5,2.8)
> #e xm <- weighted.mean(x,wt)
>
>
> and get a draft file more full than what may be created with prompt.
> Of course, I do not ask for a way to not write all the information in
> one file ... but some can be shared between R and Rd
>
> Romain
>
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel