Skip to content

[R-pkg-devel] package docu

10 messages · Troels Ring, Duncan Murdoch, Michael Dewey

#
Dear friends - I'm struggling to get the documentation of my package
correct. The working package is now (with your help!) at

devtools::install_github("troelsring/ABCharge")

and in its proto version includes only a single dataset "brom.RData" which
has two components, a data.frame "brom" and a matrix TOTAL. These are
documented in the brom.RD file shown below. 

 

 

\name{brom}

\alias{brom}

\docType{data}

\title{

bromic acid data from Glaser et al 2014

}

\description{

  Data to find optimal pK for bromic acid

}

\usage{data("brom")}

\format{

A workspace.

  \describe{

    \item{brom}{Dataframe of Table S4 in Glaser et al.}

    \item{TOTAL}{Matrix of buffer concentrations.}

  }

}

\source{

Glaser RE et al. Dynamical approach to multiequilibria problems for mixtures
of

acids and their conjugate bases. J Chem Educ 2014; 91: 1009-1016

}

\examples{

data(brom)

----- a long example - works well 

 

Now when running ctrl-shift-E, I get
Undocumented code objects:

    'K3' 'Kc' 'kw'

  Undocumented data sets:

    'TOTAL'

  All user-level objects in a package should have documentation entries.

  See chapter 'Writing R documentation files' in the 'Writing R

  Extensions' manual.

 

0 errors v | 1 warning x | 0 notes v

Fejl: R CMD check found WARNINGs

run stoppet

 

Exited with status 1.

 

I wonder why the specification of TOTAL in the RD file is ignored?

 

Also the three constants kw, Kc, and K3 are not properly documented. They
are declared and exported in the utility_acid.r file and I have tried to
document them as  @params in that file but it seems to be ignored and cause
other problems so I have them at present undocumented since I don't know
where to put the documentation.
#
Dear Troels

What happens if you add \alias{TOTAL}

Michael
On 26/01/2019 08:15, Troels Ring wrote:

  
    
  
#
Dear Michael - fantastic: TOTAL is now acknowledged -- so I only need the constants kw, K3, and Kc from the utility_acid.r file - how for format their documentation - they are available as required inside and outside the package.

All best wishes
Troels

-----Oprindelig meddelelse-----
Fra: Michael Dewey <lists at dewey.myzen.co.uk> 
Sendt: 26. januar 2019 13:17
Til: Troels Ring <tring at gvdnet.dk>; package-develop <r-package-devel at r-project.org>
Emne: Re: [R-pkg-devel] package docu

Dear Troels

What happens if you add \alias{TOTAL}

Michael
On 26/01/2019 08:15, Troels Ring wrote:
--
Michael
http://www.dewey.myzen.co.uk/home.html
#
On 26/01/2019 8:31 a.m., Troels Ring wrote:
Within R, set your working directory to the man directory for your 
package, then run

   prompt(kw)

and it will create kw.Rd in the right format.  You just need to edit it 
to fill in the details.  There will be comments in the file explaining 
what to do.  Don't put quotes on the name; prompt("kw") is wrong.

Duncan Murdoch
#
Thanks a lot - I tried with prompt(kw) and that warning disappeared but instead I got another
Data with usage in documentation object 'kw' but not in code:
    Kw

And the code is really full og kw - 

I'm so sorry to bother
BW
Troels

-----Oprindelig meddelelse-----
Fra: Duncan Murdoch <murdoch.duncan at gmail.com> 
Sendt: 26. januar 2019 14:45
Til: Troels Ring <tring at gvdnet.dk>; 'Michael Dewey' <lists at dewey.myzen.co.uk>; 'package-develop' <r-package-devel at r-project.org>
Emne: Re: [R-pkg-devel] package docu
On 26/01/2019 8:31 a.m., Troels Ring wrote:
Within R, set your working directory to the man directory for your package, then run

   prompt(kw)

and it will create kw.Rd in the right format.  You just need to edit it to fill in the details.  There will be comments in the file explaining what to do.  Don't put quotes on the name; prompt("kw") is wrong.

Duncan Murdoch
#
Well in the usage section it says Kw but elsewhere kw so you need to 
make them match. Probably some "helpful" part of your system is 
capitalising things without you noticing.

Michael
On 26/01/2019 14:04, Troels Ring wrote:

  
    
  
#
Thanks a lot - but it is really kw and not Kw everywhere - according to "find in files" etc - thanks a lot for your patience and interest!
BW
Troels

-----Oprindelig meddelelse-----
Fra: Michael Dewey <lists at dewey.myzen.co.uk> 
Sendt: 26. januar 2019 15:48
Til: Troels Ring <tring at gvdnet.dk>; 'Duncan Murdoch' <murdoch.duncan at gmail.com>; 'package-develop' <r-package-devel at r-project.org>
Emne: Re: SV: [R-pkg-devel] package docu

Well in the usage section it says Kw but elsewhere kw so you need to make them match. Probably some "helpful" part of your system is capitalising things without you noticing.

Michael
On 26/01/2019 14:04, Troels Ring wrote:
--
Michael
http://www.dewey.myzen.co.uk/home.html
#
On 26/01/2019 9:04 a.m., Troels Ring wrote:
That message is about the Rd file, not the code.  Look for Kw in the 
\usage section.

You haven't pushed this file to Github, so I can't offer any more advice.

Duncan Murdoch
#
Thanks a lot - I followed your suggestion, and prompt generated under usage: data(kw) - which is not working as kw is just a single number. So I just removed the usage section and no complaints are left. Thanks for all help!
BW
Troels

-----Oprindelig meddelelse-----
Fra: Duncan Murdoch <murdoch.duncan at gmail.com> 
Sendt: 26. januar 2019 22:08
Til: Troels Ring <tring at gvdnet.dk>; 'Michael Dewey' <lists at dewey.myzen.co.uk>; 'package-develop' <r-package-devel at r-project.org>
Emne: Re: SV: [R-pkg-devel] package docu
On 26/01/2019 9:04 a.m., Troels Ring wrote:
That message is about the Rd file, not the code.  Look for Kw in the \usage section.

You haven't pushed this file to Github, so I can't offer any more advice.

Duncan Murdoch
#
On 27/01/2019 2:49 a.m., Troels Ring wrote:
Sorry, I misread an earlier message and thought that kw was a function, 
not data.  If it is data, use promptData() instead of prompt.

Duncan Murdoch