Skip to content

[R-pkg-devel] R package development

4 messages · SOUVIK NATH, Duncan Murdoch, Steven Scott +1 more

#
Dear CRAN maintainers and R package developers,

Respected Sirs,



I am interested in submitting a package which I created in RStudio,  that
contains functions to compute the PDF,CDF and critical region of the
distribution of sample correlation coeffecient :r. While running a R CMD
check , it shows a warning() as follows :



Bad \usage lines found in documentation object 'Rcor':

    Spdf(r,rho,n),Fpdf(r,rho,n),Hpdf(r,rho,n),Fcdf(a,rho,n),Hcdf(r,rho,n)



Functions with \usage entries need to have the appropriate \alias

  entries, and all their arguments documented.

  The \usage entries must correspond to syntactically valid R code.



 Where the documentation for one of the R functions is given as follows :-



#' PDF using Simulation

#'

#' @description used for computing the probability density functional value
for the bivariate normal sample correlation coeffecient

#' @usage Spdf(r,rho,n)

#' @param r  sample correlation coeffecient of the bivariate normal
distribution sample

#' @param rho  population correlation coefficient of the bivariate normal
distribution

#' @param n  sample size of the required Bivariate Normal Distribution

#' @details uses Simulation to compute the PDF

#' @return PDF of the sample correlation coeffecient distribution

#' @author  Souvik Nath <souvique at gmail.com> ,Rituparna Sen

#' @references Anderson,T.W.,(2003) An Introduction to Multivariate
Statistical Analysis.Third Edition ,Chapter 4, Page No 125. A JOHN WILEY
AND SONS,INC.,PUBLICATION

#' @references DAVID,F.N.,(1954) TABLES OF THE ORDINATES AND THE
PROBABILITY INTEGRAL OF THE CORRELATION COEFFECIENT IN SMALL SAMPLES.
ISSUED BY THE BIOMETRIKA OFFICE,UNIVERSITY COLLEGE,LONDON

#' @seealso Fpdf,Hpdf,Fcdf,Hcdf,FQcdf,HQcdf,Scdf,cconfint

#' @examples ## If we want to calculate the pdf for "r=0.1,rho=0.1,n=3"

#' @examples ## Spdf(0.1,0.1,3) # 0.306

#' @import mvtnorm

#' @export



Please let me know what can be done in this case, regarding the
documentation. I have once submitted a copy of this package in CRAN few
weeks ago. I realize that the files may have been removed and I need to
resubmit them if required.



Kind Regards,

Souvik
#
On 01/01/2019 5:39 a.m., SOUVIK NATH wrote:
CRAN doesn't look at the Roxygen inputs, it looks at the .Rd files in 
the man directory.  From what you've posted, it is probably man/Rcor.Rd 
that you need to look at.  It will be up to you to make sure it follows 
the specification in Writing R Extensions to be a valid Rd file.  From 
the message, it appears you have a line


Spdf(r,rho,n),Fpdf(r,rho,n),Hpdf(r,rho,n),Fcdf(a,rho,n),Hcdf(r,rho,n)


in the file, and that is not valid in an Rd file.  It should perhaps be 
five lines,

Spdf(r,rho,n)
Fpdf(r,rho,n)
Hpdf(r,rho,n)
Fcdf(a,rho,n)
Hcdf(r,rho,n)

but without seeing the whole file we can't say for sure.

Duncan Murdoch
#
Also, consider different names.  The convention in R is for a probability
distribution foo to have dfoo, pfoo, qfoo, and rfoo.  I'm not sure what S,
F and H stand for in your notation, so maybe consider giving them more
descriptive names?  If F is for Fisher then dFisherCor or something like
that.

On Tue, Jan 1, 2019 at 8:10 AM Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:

  
  
#
Normally you do not need to specify @usage in roxygen source files.

As Duncan noted, without seeing everything, we are only guessing, but I 
suspect that you have tried to combine manual @usage directives with 
@alias or @Rdfile directives in the roxygen for the other functions.

If my guesses are correct, I would put all of your descriptive text in 
one place, and simply use @Rdfile for the other functions.  Roxygen can 
generate the usage automatically.

If either Duncan's hints or mine leave you still wondering what to do, 
please post a link to the source repository, and I will take a look.

Regards,

Brian
On 01/01/2019 04:39 AM, SOUVIK NATH wrote: