<div dir="ltr"><div>Hi All</div><div><br></div><div>Could you please guide how we can edit the .Rd files generated by roxygen2 for better formatting? I get the function and its input arguments into multiple lines in the PDF file. Also, I do not get \usage{} line in .Rd file for an Rcpp functions. <br></div><div><br></div><div>An example of an .Rd file and its corresponding R file are as follows: <br></div><div></div><div>____________________<br></div><div>% Generated by roxygen2: do not edit by hand<br>% Please edit documentation in R/sumEx.R<br>\name{SumEx}<br>\alias{SumEx}<br>\alias{sumEx}<br>\title{sum of objects}<br>\usage{<br>SumEx(<br>  FirstVector,<br>  SecondVector,<br>  ThirdVector,<br>  FourthVector,<br>  FifthVector,<br>  SixthVector<br>)<br>}<br>\arguments{<br>\item{FirstVector}{is a vector of length \eqn{n}.}<br><br>\item{SecondVector}{is a vector of length \eqn{n}.}<br><br>\item{ThirdVector}{is a vector of length \eqn{n}.}<br><br>\item{FourthVector}{is a vector of length \eqn{n}.}<br><br>\item{FifthVector}{is a vector of length \eqn{n}.}<br><br>\item{SixthVector}{is a vector of length \eqn{n}.}<br>}<br>\description{<br>COmputes the sum of objects<br>}</div><br><div>#' sum of objects<br>#'<br>#' COmputes the sum of objects<br>#' @aliases sumEx<br>#' @param FirstVector is a vector of length \eqn{n}.<br>#' @param SecondVector is a vector of length \eqn{n}.<br>#' @param ThirdVector is a vector of length \eqn{n}.<br>#' @param FourthVector is a vector of length \eqn{n}.<br>#' @param FifthVector is a vector of length \eqn{n}.<br>#' @param SixthVector is a vector of length \eqn{n}.<br>#' @import stats Rcpp<br>#' @importFrom Rcpp sourceCpp<br>#' @export<br>#'<br>SumEx <- function(FirstVector, SecondVector, ThirdVector, FourthVector, FifthVector, SixthVector)<br>{<br>  sumall <- sum(FirstVector, SecondVector, ThirdVector, FourthVector, FifthVector, SixthVector)<br>  return(sumall)<br>}</div><div>---------------------------------------------------------</div><div>An example of an .cpp() function and its corresponding .Rd() file are as follows:</div><div><br></div><div>//' Probability density function of gamma distribution<br>//'<br>//' Calculates the PDF of gamma distribution<br>//' @name dgammaC<br>//' @aliases dgammaC<br>//' @param x is the observed data.<br>//' @param alpha is the shape parameter of gamma distribution.<br>//' @param beta is the scale parameter of gamma distribution.<br>//' @param give_log is an integer for logirthm. If 0, then no logrithm of PDF is considered.<br>//' @return PDF of gamma distribution<br>//' @export<br>//'<br>#include <Rcpp.h><br>using namespace Rcpp;<br>//[[Rcpp::export]]<br><br>NumericVector  dgammaC(NumericVector x, double alpha, double beta, int give_log)<br>{<br>        int T = x.size();<br>        NumericVector f(T);<br>        for(int t=0;t<T; t++)<br>                {<br>                f(t) = R::dgamma(x(t), alpha, beta, give_log);<br>                }<br>        return f;<br>}</div><div><br></div><div><br></div><div>% Generated by roxygen2: do not edit by hand<br>% Please edit documentation in R/RcppExports.R<br>\name{dgammaC}<br>\alias{dgammaC}<br>\title{Probability density function of gamma distribution}<br>\arguments{<br>\item{x}{is the observed data.}<br><br>\item{alpha}{is the shape parameter of a gamma distribution.}<br><br>\item{beta}{is the scale parameter of a gamma distribution.}<br><br>\item{give_log}{is an integer for logarithm. If 0, then no logarithm of PDF is considered.}<br>}<br>\value{<br>PDF of gamma distribution<br>}<br>\description{<br>Calculates the PDF of gamma distribution<br>}</div><div><br></div><div>Thank you</div><div><br></div><div>Regards<br></div></div>