[R-pkg-devel] Load data inside .Rd documentation file inside the item-field?

2022-05-03 Thread Vincent van Hees
Dear list,

Is it possible in .Rd documentation to load and use data inside an
item-field like we can integrate R data in text in R markdown files?

Something along the lines of:
\item{max}{
  Numeric, default value = `R max`, controls the upper limit of the plot.
}
where `R max` resolves into the actual default value.

I am guessing this is not possible, but it would be great if someone could
either confirm or point me to the actual way to do this.

Full story with clarification for why I am trying to do this:
The R package I maintain has a function that acts as a data processing
pipeline with over a hundred configuration arguments. Given that it is bad
practice to write a function with this number of input arguments, I use
parameter objects that hold sets of arguments. These objects are then
passed on to the pipeline function. The default values for the parameter
objects are stored in a separate function load_params() that aids in
loading the defaults. Although it makes the code a lot easier to navigate,
it also means that the user will no longer find default argument values in
the standard package documentation.

As a solution I can write a package vignette that loads and displays all
the default argument values. However, for those more oriented towards using
the ? command to get help about the function, it would be nice if the same
default arguments values are also shown in the package documentation, being
the .Rd files accessed via .pdf or with ? in R.

Thanks, Vincent

[[alternative HTML version deleted]]

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


Re: [R-pkg-devel] HTML5 errors in win-builder R-release check

2022-05-03 Thread Henrik Bengtsson
Looks like a mistake in R that was fixed in R-devel (rev 82308) less
than a day ago, cf.

https://github.com/wch/r-source/commit/60cc6ebd762d4199aa8e5addf08282e336138a4a

/Henrik

On Tue, May 3, 2022 at 10:54 AM J C Nash  wrote:
>
> I've been asked to "fix" some NOTEs in two of my packages.
>
> The local (Linux Mint) R CMD check --as-cran gives no errors. Nor does 
> win-builder for R-devel,
> but R-release gives many errors of the form
>
> Found the following problems:
> Rcgmin.Rd:17:1: Warning:  attribute "width" not allowed for HTML5
>
> Rcgmin.Rd:46:1: Warning:  attribute "valign" not allowed for HTML5
>
> Rcgmin.Rd:50:1: Warning:  attribute "valign" not allowed for HTML5
>
> Rcgmin.Rd:56:1: Warning:  attribute "valign" not allowed for HTML5
>
>
> In some cases the lines pointed to are beyond the end of my Rd file.
>
> Does anyone know the source, and hopefully the solution, to these?
>
> It's really difficult to fix something that does not appear to be an error
> in the systems I can dig into.
>
> John Nash
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

On Tue, May 3, 2022 at 10:54 AM J C Nash  wrote:
>
> I've been asked to "fix" some NOTEs in two of my packages.
>
> The local (Linux Mint) R CMD check --as-cran gives no errors. Nor does 
> win-builder for R-devel,
> but R-release gives many errors of the form
>
> Found the following problems:
> Rcgmin.Rd:17:1: Warning:  attribute "width" not allowed for HTML5
>
> Rcgmin.Rd:46:1: Warning:  attribute "valign" not allowed for HTML5
>
> Rcgmin.Rd:50:1: Warning:  attribute "valign" not allowed for HTML5
>
> Rcgmin.Rd:56:1: Warning:  attribute "valign" not allowed for HTML5
>
>
> In some cases the lines pointed to are beyond the end of my Rd file.
>
> Does anyone know the source, and hopefully the solution, to these?
>
> It's really difficult to fix something that does not appear to be an error
> in the systems I can dig into.
>
> John Nash
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

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