Re: [R-pkg-devel] [External] Assistance Needed to Resolve CRAN Submission Note

2024-05-19 Thread Richard M. Heiberger
I seem to be later than some other respondents.  But for closure:


The patch you sent produces a msg <- ": 'tidy' is not HTML Tidy"
I would like to have the note tell the user how to update tidy, by giving an 
explicit
reference to https://www.html-tidy.org/



from the *shell* buffer in emacs

rmh@MacBook-Air-5 ~ % which tidy
/usr/bin/tidy
rmh@MacBook-Air-5 ~ % tidy --version
HTML Tidy for Mac OS X released on 31 October 2006 - Apple Inc. build 8018
rmh@MacBook-Air-5 ~ %



from the *R* buffer

> system("which tidy")
/usr/local/bin/tidy

> system("tidy --version")
HTML Tidy for Apple macOS version 5.8.0




> On May 19, 2024, at 01:30, Ivan Krylov  wrote:
>
> On Sat, 18 May 2024 21:10:18 +
> "Richard M. Heiberger"  wrote:
>
>> when checking a package and discovering these messages about html5,
>> can you generate an informational message about tidy with a link to
>> updating tidy?
>
> That's a useful suggestion.
>
> Would you mind testing the patch from
> <https://stat.ethz.ch/pipermail/r-devel/2023-August/082763.html>?
>
> If you or someone else here has a computer running macOS, what exactly
> does it print when running `tidy --version` (1) with an old version of
> Tidy (that comes with macOS) and (2) with a new (>= 5) version of Tidy?
>
> --
> Best regards,
> Ivan

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


Re: [R-pkg-devel] [External] Re: [External] Re: Assistance Needed to Resolve CRAN Submission Note

2024-05-18 Thread Richard M. Heiberger
exactly. when the --as-cran detects the need for that NOTE, it could prefix the 
initial instance of that NOTE with information about
updating the tidy installation on the package writer'smachine.

Sent from my iPhone

> On May 18, 2024, at 20:20, Duncan Murdoch  wrote:
>
> I don't think that will ever happen.  It only happens when a user tries an 
> "--as-cran" check, but doesn't have a current version of tidy installed.  
> CRAN does have the up-to-date versions installed, so they won't see this.
>
> Duncan Murdoch
>
>> On 2024-05-18 5:10 p.m., Richard M. Heiberger wrote:
>> this is a suggestion to CRAN.
>> when checking a package and discovering these messages about html5, can you 
>> generate an informational message about tidy with a link to updating tidy?
>> thank you
>> Rich
>> Sent from my iPhone
>>>> On May 17, 2024, at 15:32, Marc Girondot via R-package-devel 
>>>>  wrote:
>>>
>>> Here is the solution to update tidy to a recent version:
>>> https://www.html-tidy.org/
>>>
>>> Marc
>>>> Le 17/05/2024 à 17:59, Zeinab Mashreghi a écrit :
>>>> Hi,
>>>>
>>>> Thanks for all the suggestions and help.
>>>>
>>>> Yes, I'm using an Apple computer. The tidy version was from 2006. I 
>>>> submitted the package without any issues.
>>>>
>>>> Thanks again!
>>>>
>>>> Zeinab
>>>>
>>>> From: Ivan Krylov 
>>>> Date: Thursday, May 16, 2024 at 12:27 PM
>>>> To: Zeinab Mashreghi 
>>>> Cc: r-package-devel@r-project.org 
>>>> Subject: Re: [R-pkg-devel] Assistance Needed to Resolve CRAN Submission 
>>>> Note
>>>> Notice: This is external email. Verify the sender and use caution with any 
>>>> content.
>>>>
>>>>
>>>> � Thu, 16 May 2024 16:01:45 +
>>>> Zeinab Mashreghi  �:
>>>>
>>>>> checking HTML version of manual ... NOTE
>>>>> Found the following HTML validation problems:
>>>>> All.data.html:4:1 (All.data.Rd:10): Warning:  inserting "type"
>>>>> attribute
>>>>> All.data.html:12:1 (All.data.Rd:10): Warning: 

Re: [R-pkg-devel] [External] Re: Assistance Needed to Resolve CRAN Submission Note

2024-05-18 Thread Richard M. Heiberger
this is a suggestion to CRAN.
when checking a package and discovering these messages about html5, can you 
generate an informational message about tidy with a link to updating tidy?

thank you
Rich

Sent from my iPhone

> On May 17, 2024, at 15:32, Marc Girondot via R-package-devel 
>  wrote:
>
> Here is the solution to update tidy to a recent version:
> https://www.html-tidy.org/
>
> Marc
>> Le 17/05/2024 à 17:59, Zeinab Mashreghi a écrit :
>> Hi,
>>
>> Thanks for all the suggestions and help.
>>
>> Yes, I'm using an Apple computer. The tidy version was from 2006. I 
>> submitted the package without any issues.
>>
>> Thanks again!
>>
>> Zeinab
>>
>> From: Ivan Krylov 
>> Date: Thursday, May 16, 2024 at 12:27 PM
>> To: Zeinab Mashreghi 
>> Cc: r-package-devel@r-project.org 
>> Subject: Re: [R-pkg-devel] Assistance Needed to Resolve CRAN Submission Note
>> Notice: This is external email. Verify the sender and use caution with any 
>> content.
>>
>>
>> � Thu, 16 May 2024 16:01:45 +
>> Zeinab Mashreghi  �:
>>
>>> checking HTML version of manual ... NOTE
>>> Found the following HTML validation problems:
>>> All.data.html:4:1 (All.data.Rd:10): Warning:  inserting "type"
>>> attribute
>>> All.data.html:12:1 (All.data.Rd:10): Warning: 

Re: [R-pkg-devel] [External] Removing import(methods) stops exporting S4 "meta name"

2024-03-14 Thread Richard M. Heiberger
this looks like a relative of the issue I tripped on that is discussed in the 
email threads

https://stat.ethz.ch/pipermail/r-package-devel/2024q1/010531.html

https://stat.ethz.ch/pipermail/r-devel/2024-March/083259.html

At issue is the default export of
exportPattern(".") 

System generated names, which is what ".__xxx__" looks like, seem to be the 
issue.
I can't make any specific recommendations behind connecting this current issue 
to my recent experience.

Rich


> On Mar 14, 2024, at 14:34, Michael Chirico  wrote:
> 
> importFrom(data.table,`.__T__[:base`)

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


Re: [R-pkg-devel] [External] [External] RcmdrPlugin.HH_1.1-48.tar.gz

2024-03-06 Thread Richard M. Heiberger
Thank you, I will do that reversion in a few days.

Before I do, I want to ask if the default export generated by R CMD build 
should be changed.
the default is  exportPattern("."), which seems to be the cause of the problem.
Might the default be changed to exportPattern("^[^\\.]") ?

> On Mar 6, 2024, at 11:57, Joshua Ulrich  wrote:
>
> On Wed, Mar 6, 2024 at 1:03 AM Richard M. Heiberger  wrote:
>>
>> Thank you Duncan, Jeff, Ivan.
>>
>> I did all that Duncan and Jeff suggested, plus a bit more that appeared to 
>> be necessary.
>> All of what I did is documented in the RcmdrPlugin.HH/NEWS file.
>>
>> Ivan's comments were received after I sent 1.1-50 to CRAN and it was 
>> accepted.
>>
> I recommend you revert all the changes you made that are documented in
> the package NEWS, and at minimum follow Ivan's advice to use
> exportPattern("^[^\\.]") instead of exportPattern("."). It would be
> even better to follow the advice in Writing R Extensions and list each
> exported object individually.
>
>> I suggest that my notes in the NEWS file, perhaps augmented with Ivan's 
>> comments,
>> might be added to utils/man/globalVariables.Rd and to the
>> "
>> section ‘Package
>> structure’ in the ‘Writing R Extensions’ manual.
>> "
>>
> That section of Writing R Extensions specifically says not to do what you did.
>
>Beware of patterns which include names starting with a period: some
>of these are internal-only variables and should never be exported,
>e.g. ‘.__S3MethodsTable__.’ (and loading excludes known cases).
>
> Duncan pointed out that '.__global__' is an internal-only variable
> created by globalVariables(), which means it should never be exported
> by a package. Imagine the number of conflicts there would be if every
> package that used globalVariables() exported the '.__global__'
> object... there would probably be thousands, yikes!
>
> It's possible that future versions of 'R CMD check' will error if
> there are any incorrectly exported internal variables (like
> '.__global__'), which would cause your package to fail.
>
> Best,
> Josh
>
>
>>
>>> On Mar 6, 2024, at 01:38, Ivan Krylov  wrote:
>>>
>>> В Tue, 5 Mar 2024 22:41:32 +
>>> "Richard M. Heiberger"  пишет:
>>>
>>>> Undocumented code objects:
>>>>  '.__global__'
>>>> All user-level objects in a package should have documentation
>>>> entries. See chapter 'Writing R documentation files' in the 'Writing R
>>>> Extensions' manual.
>>>
>>> This object is not here for the user of the package. If you don't
>>> export it, there will be no WARNING about it being undocumented. This
>>> variable is exported because of exportPattern(".") in the file
>>> NAMESPACE. The lone dot is a regular expression that matches any name
>>> of an R object.
>>>
>>> If you don't want to manually list your exports in the NAMESPACE file
>>> (which can get tedious) or generate it (which takes additional
>>> dependencies and build steps), you can use exportPattern('^[^\\.]') to
>>> export everything except objects with a name starting with a period:
>>> https://cran.r-project.org/doc/manuals/R-exts.html#Specifying-imports-and-exports
>>>
>>> --
>>> Best regards,
>>> Ivan
>>
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
>
>
> --
> Joshua Ulrich  |  about.me/joshuaulrich
> FOSS Trading  |  http://www.fosstrading.com/


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


Re: [R-pkg-devel] [External] RcmdrPlugin.HH_1.1-48.tar.gz

2024-03-05 Thread Richard M. Heiberger
Thank you Duncan, Jeff, Ivan.

I did all that Duncan and Jeff suggested, plus a bit more that appeared to be 
necessary.
All of what I did is documented in the RcmdrPlugin.HH/NEWS file.

Ivan's comments were received after I sent 1.1-50 to CRAN and it was accepted.

I suggest that my notes in the NEWS file, perhaps augmented with Ivan's 
comments,
might be added to utils/man/globalVariables.Rd and to the
"
section ‘Package
structure’ in the ‘Writing R Extensions’ manual.
"


> On Mar 6, 2024, at 01:38, Ivan Krylov  wrote:
>
> В Tue, 5 Mar 2024 22:41:32 +
> "Richard M. Heiberger"  пишет:
>
>> Undocumented code objects:
>>   '.__global__'
>> All user-level objects in a package should have documentation
>> entries. See chapter 'Writing R documentation files' in the 'Writing R
>> Extensions' manual.
>
> This object is not here for the user of the package. If you don't
> export it, there will be no WARNING about it being undocumented. This
> variable is exported because of exportPattern(".") in the file
> NAMESPACE. The lone dot is a regular expression that matches any name
> of an R object.
>
> If you don't want to manually list your exports in the NAMESPACE file
> (which can get tedious) or generate it (which takes additional
> dependencies and build steps), you can use exportPattern('^[^\\.]') to
> export everything except objects with a name starting with a period:
> https://cran.r-project.org/doc/manuals/R-exts.html#Specifying-imports-and-exports
>
> --
> Best regards,
> Ivan

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


Re: [R-pkg-devel] [External] RcmdrPlugin.HH_1.1-48.tar.gz

2024-03-05 Thread Richard M. Heiberger
Almost.

I used 
prompt(".__global__")
to create file
man/.__global__.Rd

This file does not appear in the tar.gz file, but without a note of rejection.
When I checked my disk directory directly
R CMD check RcmdrPlugin.HH
the file was rejected with

Found the following hidden files and directories:
  .DS_Store
  R/.DS_Store
  man/.__global__.Rd
These were most likely included in error. See section ‘Package
structure’ in the ‘Writing R Extensions’ manual.

I looked there
Section 1.1 says that the acceptable characters are
A-Za-z0-9._!#$%&+,;=@^(){}'[]
and "." and _ are explicitly included.

What should I try next?


> On Mar 5, 2024, at 18:21, Duncan Murdoch  wrote:
> 
> On 05/03/2024 5:41 p.m., Richard M. Heiberger wrote:
>> My package is being rejected by auto-check
>> Flavor: r-devel-linux-x86_64-debian-gcc, r-devel-windows-x86_64
>> Check: for missing documentation entries, Result: WARNING
>>  Undocumented code objects:
>>'.__global__'
>>  All user-level objects in a package should have documentation entries.
>>  See chapter 'Writing R documentation files' in the 'Writing R
>>  Extensions' manual.
>> The problem is that the string'.__global__'  is not in the package.
>> I can't find it and John Fox, the maintainer of Rcmdr, can'f find it.
>> Can someone help me understand why a non-existent string is being detected?
> 
> That's the variable modified by the `globalVariables()` function.  So it may 
> well exist in your package.  I'd guess the problem is that your package 
> exports functions by giving a pattern for the names instead of listing each 
> one separately, and it matches that variable.
> 
> Duncan Murdoch
> 
> 
> 

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


[R-pkg-devel] RcmdrPlugin.HH_1.1-48.tar.gz

2024-03-05 Thread Richard M. Heiberger
My package is being rejected by auto-check

Flavor: r-devel-linux-x86_64-debian-gcc, r-devel-windows-x86_64
Check: for missing documentation entries, Result: WARNING
 Undocumented code objects:
   '.__global__'
 All user-level objects in a package should have documentation entries.
 See chapter 'Writing R documentation files' in the 'Writing R
 Extensions' manual.

The problem is that the string'.__global__'  is not in the package.
I can't find it and John Fox, the maintainer of Rcmdr, can'f find it.

Can someone help me understand why a non-existent string is being detected?

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


Re: [R-pkg-devel] [External] circular suggested packages

2023-11-07 Thread Richard M. Heiberger
Why are these functins in two different packages?
On the surface it looks like qrcode is a transformation function and opencv is 
its inverse.

> On Nov 7, 2023, at 14:55, Thierry Onkelinx  wrote:
>
> Dear all,
>
> The qrcode package converts text into a qrcode image. The opencv package is
> able to convert images with a qrcode into the text. opencv has a unit test
> that uses qrcode to generate a test image. Hence it lists qrcode as a
> suggested package.
>
> Would it be OK to implement the same unit test in qrcode? And thus
> requiring qrcode to list opencv as a suggested package. I know this is not
> allowed when depending or importing packages.
>
> Best regards,
>
> ir. Thierry Onkelinx
> Statisticus / Statistician
>
> Vlaamse Overheid / Government of Flanders
> INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
> FOREST
> Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
> thierry.onkel...@inbo.be
> Havenlaan 88 bus 73, 1000 Brussel
> http://www.inbo.be/
>
> ///
> To call in the statistician after the experiment is done may be no more
> than asking him to perform a post-mortem examination: he may be able to say
> what the experiment died of. ~ Sir Ronald Aylmer Fisher
> The plural of anecdote is not data. ~ Roger Brinner
> The combination of some data and an aching desire for an answer does not
> ensure that a reasonable answer can be extracted from a given body of data.
> ~ John Tukey
> ///
>
> 
>
> [[alternative HTML version deleted]]
>
> __
> 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


[R-pkg-devel] is this expected behavior

2023-09-13 Thread Richard M. Heiberger
I have a demo file that uses a function defined in the package.
when I force the demo to be run with
R CMD check --test-dir=demo findme_1.0.tar.gz
then the function defined in the package is not recognized.

Here is the demo/findme.r file:

findme::findme()
findme()


Here is the result of:

R CMD check --test-dir=demo findme_1.0.tar.gz

* checking tests in ‘demo’ ...
  Running ‘findme.r’
 ERROR
Running the tests in ‘demo/findme.r’ failed.
Complete output:
  > findme::findme()
  [1] "You found me"
  > findme()
  Error in findme() : could not find function "findme"
  Execution halted


The first line with the "::" executed.
The second line, which assumed the function in the current package
would be exported, was not found.

Is this the expected behavior?

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


[R-pkg-devel] escaped latex specials

2022-08-08 Thread Richard M. Heiberger
There is a new NOTE.  This line with \& used to be acceptable.
I am not seeing what the suggested replacement is.

* checking Rd files ... [4s] NOTE
checkRd: (-1) bivariateNormal.Rd:42: Escaped LaTeX specials: \&

The full example is
\note{
  Based on the \code{galaxy} example on pages 204--205 in
  \emph{S \& S-PLUS Trellis Graphics User's Manual},
  Richard A. Becker and William S. Cleveland (1996),
\url{https://www.stat.auckland.ac.nz/~ihaka/courses/120/trellis.user.pdf} %% 
works 19Aug2019
}

Rich

[[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] [External] Formula modeling

2021-10-07 Thread Richard M. Heiberger
I am responding to a subset of what you asked.  There are packages which use 
multiple formulas
in their argument sequence.


What you have as a single formula with | as a separator
q | p | subject | time | rho ~ p + x + y | p + w + y | z + y 
I think would be better as a comma-separated list of formulas

q , p , subject , time , rho ~ p + x + y , p + w + y , z + y 

because in R notation | is usually an operator, not a separator.

lattice uses formulas and the | is used as a conditioning operator.

nlme and lme4 can have multiple formulas in the same calling sequence.

lme4 is newer.  from its ?lme4-package
‘lme4’ covers approximately the same ground as the earlier ‘nlme’
 package.

lme4 should probably be the modelyou are looking for for the package design.

> On Oct 07, 2021, at 17:20, pikappa.de...@gmail.com wrote:
> 
> Dear R-package-devel subscribers,
> 
> 
> 
> My question concerns a package design issue relating to the usage of
> formulas.
> 
> 
> 
> I am interested in describing via formulas systems of the form:
> 
> 
> 
> d = p + x + y 
> 
> s = p + w + y
> 
> p = z + y
> 
> q = min(d,s).
> 
> 
> 
> The context in which I am working is that of market models with, primarily,
> panel data. In the above system, one may think of the first equation as
> demand, the second as supply, and the third as an equation (co-)determining
> prices. The fourth equation is implicitly used by the estimation method, and
> it does not need to be specified when programming the R formula. If you need
> more information bout the system, you may check the package diseq.
> Currently, I am using constructors to build market model objects. In a
> constructor call, I pass [i] the right-hand sides of the first three
> equations as strings, [ii] an argument indicating whether the equations of
> the system have correlated shocks, [iii] the identifiers of the used dataset
> (one for the subjects of the panel and one for time), and [iv] the quantity
> (q) and price (p) variables. These four arguments contain all the necessary
> information for constructing a model.
> 
> 
> 
> I would now like to re-implement model construction using formulas, which
> would be a more regular practice for most R users. I am currently
> considering passing all the above information with a single formula of the
> form:
> 
> 
> 
> q | p | subject | time | rho ~ p + x + y | p + w + y | z + y 
> 
> 
> 
> where subject and time are the identifiers, and rho indicates whether
> correlated or independent shocks should be used.
> 
> 
> 
> I am unaware of other packages that use formulas in this way (for instance,
> passing the identifiers in the formula), and I wonder if this would go
> against any good practices. Would it be better to exclude some of the
> necessary elements for constructing the model? This might make the resuting
> formulas more similar to those of models with multiple responses or multiple
> parts. I am not sure, though, how one would use such model formulas without
> all the relevant information. Is there any suggested design alternative that
> I could check?
> 
> 
> 
> I would appreciate any suggestions and discussion!
> 
> 
> 
> Kind regards,
> 
> Pantelis
> 
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-package-devel@r-project.org mailing list
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-develdata=04%7C01%7Crmh%40temple.edu%7C21a51d63bc6242e5e24908d989d84fce%7C716e81efb52244738e3110bd02ccf6e5%7C0%7C0%7C637692385020500219%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=UKazmoIzXSn8DDQY3diUTPmVIg1cfTI3e1roXyo2DMQ%3Dreserved=0

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


Re: [R-pkg-devel] [External] R package submission fails due to using LaTeX functions that have not been implemented for building pdfs (not due to mathjaxr)

2021-06-25 Thread Richard M. Heiberger
> One more question. If I use mjeqn at the beginning of a paragraph it 
> automatically sets a line break afterwards.
> Any idea what I can do to prevent this?

follow it with
\vspace*{1ex}
to back up one line.

Rich

> On Jun 25, 2021, at 07:51, Marc Scherstjanoi  
> wrote:
> 
> Hi Wolfgang,
> 
> thank you for this information.
> I will try with \mjtdeqn and stick to the intended latex functions for 
> building the pdf.
> Moreover, we will bring up the more complicated equations in a vignette pdf.
> 
> One more question. If I use mjeqn at the beginning of a paragraph it 
> automatically sets a line break afterwards.
> Any idea what I can do to prevent this?
> 
> Best regards,
> Marc
> 
> - Ursprüngliche Mail -
> Von: "Viechtbauer, Wolfgang (SP)" 
> 
> An: "Marc Scherstjanoi" 
> CC: "Tiago Olivoto" , "Max Turgeon" 
> , r-package-devel@r-project.org
> Gesendet: Montag, 21. Juni 2021 10:29:17
> Betreff: RE: R package submission fails due to mathjaxr package
> 
> Hi Marc,
> 
> Thanks for the additional details. 
> 
> As far as I can tell, the problem has nothing to do with mathjaxr, but your 
> use of LaTeX commands that are not supported in creating the pdf manual 
> (which is not done by mathjaxr but R itself). See:
> 
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcran.r-project.org%2Fdoc%2Fmanuals%2Fr-release%2FR-exts.html%23Mathematicsdata=04%7C01%7Crmh%40temple.edu%7C95de1b8bbf3c4528e1ed08d937cfaaf7%7C716e81efb52244738e3110bd02ccf6e5%7C0%7C0%7C637602187342118099%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=kEmrK%2BB%2B9FfqGHu81LW%2BQ7iw0tFVLPCJ0Q2yVPCfvoQ%3Dreserved=0
> 
> You can use AMS extensions for the HTML docs since those are supported by 
> Mathjax, but not for the pdf manual.
> 
> So, for the pdf manual, you will have to write the equation without the use 
> of AMS extensions (and indeed use \mjtdeqn).
> 
> Best,
> Wolfgang
> 
>> -Original Message-
>> From: Marc Scherstjanoi [mailto:marc.scherstja...@thuenen.de]
>> Sent: Sunday, 20 June, 2021 23:16
>> To: Viechtbauer, Wolfgang (SP)
>> Cc: Tiago Olivoto; Max Turgeon; r-package-devel@r-project.org
>> Subject: Re: R package submission fails due to mathjaxr package
>> 
>> Hi Wolfgang, Tiago and Max
>> 
>> thank you for your reply. Let me first apologize. "due to mathjaxr" sounds a 
>> bit
>> harsh after the second reading.
>> I am very thankful for this nice package. It works really well for all of the
>> equations I have, and the HTML it creates is just nice.
>> The only problem is the PDF and I also found out that the align function 
>> (amsmath
>> latex package) is the actual error source. Furthermore, "\cr" is also giving 
>> an
>> error message.
>> 
>> For example, having
>> 
>> \mjdeqn{\begin{align} A_e(t) &= \left(A^T \cdot xi(t) \right)^T \cr &= A 
>> \cdot
>> diag(xi(t)) \end{align}}{Ae(t) = (A^T * xi(t))^T = A * diag(xi(t))}
>> 
>> in the \details section of the .Rd file leads to
>> 
>> "LaTeX errors:
>> ! LaTeX Error: Environment align undefined."
>> 
>> when building with "R CMD build /home/.../package"
>> 
>> but passes with "R CMD build /home/.../package --no-manual".
>> 
>> The aim of the align command is to set several equations in certain 
>> horizontal
>> positions (mostly oriented on the "="s, indicated by the "&"s) one below the
>> other.
>> I read about the possibility to use \mjtdeqn instead of \mjdeqn to specify 
>> LaTeX
>> commands for the PDF and HTML pages differently.
>> However, if the pdf necessarily needs to be created when submitting the 
>> package,
>> it would be better to have the equations aligned there as well.
>> For readability it would be a plus as I don't just have a couple of 
>> equations and
>> equation systems.
>> 
>> We are using the following setup:
>> Added "mathjaxr" to Imports and RdMacros fields of the DESCRIPTION file.
>> Added import(mathjaxr) to the NAMESPACE file.
>> Added "\loadmathjax" to the \description section.
>> 
>> I would be grateful for any idea how to convince the pdfTeX of the align 
>> command
>> or a similar solution.
>> 
>> Marc
>> 
>> - Ursprüngliche Mail -
>> Von: "Viechtbauer, Wolfgang (SP)" 
>> 
>> An: "Marc Scherstjanoi" , r-package-devel@r-
>> project.org
>> Gesendet: Sonntag, 20. Juni 2021 11:08:56
>> Betreff: RE: R package submission fails due to mathjaxr package
>> 
>> Hi Marc,
>> 
>> mathjaxr maintainer here. Can you provide a minimal reproducible example
>> illustrating the problem? If this is another case where the LaTeX command for
>> Mathjax does not work directly for creating the pdf (or vice-versa), then I 
>> would
>> like to document this (and a possible workaround) as was done here:
>> 
>> 

Re: [R-pkg-devel] An invalid URLs

2020-03-12 Thread Richard M. Heiberger
Is it perhaps an https:// address?  You browser will make the
adjustment.  CRAN will give this message.

On Thu, Mar 12, 2020 at 10:08 PM jared_wood  wrote:
>
> I write an URL of MalaCards (a database) in my description, because I need 
> the data in this database. However, there is an error here as followed:
>
>
>
>  Found the following (possibly) invalid URLs:
>
> URL: http://www.malacards.org/
>
>   From: DESCRIPTION
>
>   Status: 403
>
>   Message: Forbidden
>
>
>
> I don’t know why. The URL was picked up in the article of this database and I 
> can open it.
>
>
>
> This is the first time that I develop a package, therefore I am eager for 
> your help.
>
>
>
> Thanks.
>
>
>
> | |
> jared_wood
> |
> |
> jared_w...@163.com
> |
> 签名由网易邮箱大师定制
> [[alternative HTML version deleted]]
>
> __
> 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


Re: [R-pkg-devel] no visible binding for '<<-' assignment note

2020-02-21 Thread Richard M. Heiberger
I would guess that your NAMESPACE file doesn't export dnormfun.

On Fri, Feb 21, 2020 at 1:38 PM Weimin Zhang  wrote:
>
> Thank you Max.
>
> The reason I used the super assignment  "<<-"  is because the "dnormfun" 
> function later called by function kronecker(X, Y, FUN = "*",...) through 
> FUN=" ". If I don't use the super assignment  "<<-"  then the kronecker 
> function cannot find "dnormfun" function. The question now seems that how I 
> can let the kronecker(X, Y, FUN = "*",...) know that "dnormfun" is a "FUN"?
>
> Thanks,
> Weimin
>
>
> 
> From: Max Turgeon 
> Sent: Thursday, February 20, 2020 10:50 AM
> To: Weimin Zhang ; r-package-devel@r-project.org 
> 
> Subject: Re: no visible binding for '<<-' assignment note
>
>
> Hi Weimin,
>
>
> From the R docs, if there is no visible binding for the deep assignment, 
> meaning there is the variable "dnormfun" not already defined in the parent 
> environment, then an assignment is made in the global assignment. Is this 
> really what you want to do, define a function "dnormfun" that is available in 
> the user's global environment? If yes, then you'll need to make a case for it 
> in your CRAN submision comments. If no, then you can probably just change 
> "<<-" to "<-".
>
>
> Best,
>
>
> Max Turgeon
> Assistant Professor
> Department of Statistics
> Department of Computer Science
> University of Manitoba
> maxturgeon.ca
>
>
> 
> From: R-package-devel  on behalf of 
> Weimin Zhang 
> Sent: February 19, 2020 11:48:38 AM
> To: r-package-devel@r-project.org
> Subject: [R-pkg-devel] no visible binding for '<<-' assignment note
>
> Dear all,
> In the last submission of my package the CRAN gave this note: "Check: R code 
> for possible problems, Result: NOTE: no visible binding for '<<-' 
> assignment..."
>
> How can I bypass this note?
>
> This is the local function which cause this note:
>   dnormfun <<- function(muvalue, sigmavalue, aNumber = gridY[i] ){
> force(aNumber)
> ansvalue=dnorm(aNumber,muvalue,sqrt(sigmavalue))
> return(ansvalue)
>   }
>
> The package can run normally at my machine. Any suggestion?
>
> Thanks,
>
> Weimin
>
>
>
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
> [[alternative HTML version deleted]]
>
> __
> 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


Re: [R-pkg-devel] Private S3 Method not Found

2020-02-17 Thread Richard M. Heiberger
latex() probably stopped midway through the compilation because you are
using intermediate routines other than the default.
For pdflatex, for example, you need to run
options(latexcmd='pdflatex', dviExtension='pdf', xdvicmd='open')
before using the latex() function.  See the Details section of ?latex.

To suppress the compilation, and stop with just the .tex file, use
print.default.
> tmp <- array(1:8, c(2,4), list(1:2,3:6))
> print.default(latex(tmp))
$file
[1] "tmp.tex"

$style
character(0)

attr(,"class")
[1] "latex"
>

The explicit result of the latex() function is a file name of class
"latex".  That way the automatic printing
feature of R shows the compiled file for that specific argument (tmp
in the example above).
Again in R terminology, the actual file "tmp.tex" is produced as a
side effect.  The tmp.tex file is designed
to be incorporated into your more comprehensive .tex file.

> tmp <- array(1:8, c(2,4), list(1:2,3:6))
> tmp.latex <- latex(tmp)
> print.default(tmp.latex)
$file
[1] "tmp.tex"

$style
character(0)

attr(,"class")
[1] "latex"


There are latex methods for many classes of objects.  formula is not
one of them.
>From your short initial description, it looks like what you are doing
could be thought of
as the latex.formula method.  I recommend doing it that way to get the
leverage of
all the other things the latex() and related functions do.  Once it is
working I suggest you
send your function to Frank Harrell (I cced him on this email) and
request that it be included as part of Hmisc::latex
You, of course, retain authorship

Rich

On Mon, Feb 17, 2020 at 10:54 AM  wrote:
>
> Hi Rich,
>
>
>
> I’m not doing the same thing as Hmisc::latex().  That generates a .tex file 
> and compiles it (or at least it appears to try to do that on my system, but 
> it stopped partway through for me).
>
>
>
> When I ran
>
>
>
> Hmisc::latex(a~b)
>
>
>
> It generated a .tex file for a table:
>
>
>
> \begin{table}[!tbp]
>
> \begin{center}
>
> \begin{tabular}{l}
>
> \hline\hline
>
> \multicolumn{1}{c}{}\tabularnewline
>
> \hline
>
> ~\tabularnewline
>
> a\tabularnewline
>
> b\tabularnewline
>
> \hline
>
> \end{tabular}\end{center}
>
> \end{table}
>
>
>
> While I’m wanting an equation:
>
>
>
> $$a = b$$
>
>
>
> Thanks,
>
>
>
> Bill
>
>
>
> From: Richard M. Heiberger 
> Sent: Monday, February 17, 2020 10:31 AM
> To: b...@denney.ws
> Cc: r-package-devel@r-project.org
> Subject: Re: [R-pkg-devel] Private S3 Method not Found
>
>
>
> Please be consistent with the latex() function in the Hmisc package.  For 
> example, for an array x, latex (x) produces a complete latex table 
> environment.  See the ?latex helpfile for details.
>
>
>
> Rich
>
>
>
> On Mon, Feb 17, 2020 at 10:07  wrote:
>
> Hello,
>
>
>
> I'm working on a function in a package that will provide an exported
> function that will convert formula to LaTeX equations.  For that, it
> recursively goes through the formula converting objects of class "formula",
> "call", "name", and "(" to LaTeX.
>
>
>
> I have a private S3 generic function that I'm using for the conversion, but
> for some reason, the generic is not detected, and checking the package fails
> for that reason
> (https://travis-ci.org/billdenney/bsd.report/jobs/651510333):
>
>
>
> no applicable method for 'knit_print_helper_formula' applied to an object of
> class "name"
>
> Backtrace:
>
>   1. testthat::expect_equal(...)
>
>   4. bsd.report:::knit_print.formula(a ~ b(c))
>
>   6. bsd.report:::knit_print_helper_formula.formula(x, ..., replacements =
> replacements)
>
>   9. bsd.report:::knit_print_helper_formula.call(x[[3]], ...)
>
> 10. bsd.report:::knit_print_helper_formula.function_call(x, ...)
>
> 11. base::sapply(...)
>
> 12. base::lapply(X = X, FUN = FUN, ...)
>
> 13. bsd.report:::FUN(X[[i]], ...)
>
>
>
> But, there is a knit_print_helper_formula.name function call defined
> (https://github.com/billdenney/bsd.report/blob/master/R/knit_print.formula.R
> #L60-L79):
>
>
>
> knit_print_helper_formula <- function(x, ...) {
>
>   UseMethod("knit_print_helper_formula")
>
> }
>
>
>
> # Some other methods
>
>
>
> knit_print_helper_formula.name <- function(x, ...) {
>
> # Function body
>
> }
>
>
>
> Does anyone know why the S3 method for name class objects is not found when
> checking the package?
>
>
>
> Thanks,
>
>
>
> Bill
>
>
> [[alternative HTML version deleted]]
>
> __
> 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


Re: [R-pkg-devel] Private S3 Method not Found

2020-02-17 Thread Richard M. Heiberger
Please be consistent with the latex() function in the Hmisc package.  For
example, for an array x, latex (x) produces a complete latex table
environment.  See the ?latex helpfile for details.

Rich

On Mon, Feb 17, 2020 at 10:07  wrote:

> Hello,
>
>
>
> I'm working on a function in a package that will provide an exported
> function that will convert formula to LaTeX equations.  For that, it
> recursively goes through the formula converting objects of class "formula",
> "call", "name", and "(" to LaTeX.
>
>
>
> I have a private S3 generic function that I'm using for the conversion, but
> for some reason, the generic is not detected, and checking the package
> fails
> for that reason
> (https://travis-ci.org/billdenney/bsd.report/jobs/651510333):
>
>
>
> no applicable method for 'knit_print_helper_formula' applied to an object
> of
> class "name"
>
> Backtrace:
>
>   1. testthat::expect_equal(...)
>
>   4. bsd.report:::knit_print.formula(a ~ b(c))
>
>   6. bsd.report:::knit_print_helper_formula.formula(x, ..., replacements =
> replacements)
>
>   9. bsd.report:::knit_print_helper_formula.call(x[[3]], ...)
>
> 10. bsd.report:::knit_print_helper_formula.function_call(x, ...)
>
> 11. base::sapply(...)
>
> 12. base::lapply(X = X, FUN = FUN, ...)
>
> 13. bsd.report:::FUN(X[[i]], ...)
>
>
>
> But, there is a knit_print_helper_formula.name function call defined
> (
> https://github.com/billdenney/bsd.report/blob/master/R/knit_print.formula.R
> #L60-L79
> 
> ):
>
>
>
> knit_print_helper_formula <- function(x, ...) {
>
>   UseMethod("knit_print_helper_formula")
>
> }
>
>
>
> # Some other methods
>
>
>
> knit_print_helper_formula.name <- function(x, ...) {
>
> # Function body
>
> }
>
>
>
> Does anyone know why the S3 method for name class objects is not found when
> checking the package?
>
>
>
> Thanks,
>
>
>
> Bill
>
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[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] inconsistent behavior between R CMD check and interactive use

2019-12-10 Thread Richard M. Heiberger
So I am looking.  and it is even worse than what you suggest.
library()
shows that both HH and microplot are in both the system and personal libraries
Packages in library 'C:/Program Files/R/R-devel/library':
HH Version: 3.1-34
microplot Version: 1.0-15
Everything else in the system library belongs there.
Neither of these is the current CRAN version.

Packages in library 'C:/Users/rmh.DESKTOP-60G4CCO/R/win-library/4.0':
HH Version: 3.1-39 ## 3.1-37 is the current CRAN version
microplot Version: 1.0-42  ## this is the current CRAN version

I removed the ancient HH and microplot from c:/Program Files/R/R-devel/library
I left the correct current versions of both in
c:/Users/rmh.DESKTOP-60G4CCO/R/win-library/4.0

Then I ran the R CMD check again.
R CMD check --run-dontrun --as-cran HH_3.1-39.tar.gz

Very strange results:
"
* checking examples ... ERROR
Running examples in 'HH-Ex.R' failed
The error occurred in:


R Under development (unstable) (2019-12-05 r77528) -- "Unsuffered Consequences"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> pkgname <- "HH"
> source(file.path(R.home("share"), "R", "examples-header.R"))
> options(warn = 1)
> options(pager = "console")
> base::assign(".ExTimings", "HH-Ex.timings", pos = 'CheckExEnv')
> base::cat("name\tuser\tsystem\telapsed\n", file=base::get(".ExTimings", pos = 
> 'CheckExEnv'))
> base::assign(".format_ptime",
+ function(x) {
+   if(!is.na(x[4L])) x[1L] <- x[1L] + x[4L]
+   if(!is.na(x[5L])) x[2L] <- x[2L] + x[5L]
+   options(OutDec = '.')
+   format(x[1L:3L], digits = 7L)
+ },
+ pos = 'CheckExEnv')
>
> ### * 
> library('HH')
Error in library("HH") : there is no package called 'HH'
Execution halted
* checking PDF version of manual ... OK
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* DONE

Status: 1 ERROR
See
  'x:/HOME/rmh/HH-R.package/HH.Rcheck/00check.log'
for details.
"

it tested the new version until it got to examples.  Then it wanted to
run the examples
from the system library version.


Next try.
I will copy the current version (3.1-39, the one I am testing) of just
HH to the system library and run the check again.
That works!  It did a proper check of the correct version of the package.

R-devel seems to have a new check.  it is detecting files written not
in the temp directory.
I was doing so in several \dontrun{} examples, but I will fix them
before actually submitting to CRAN.

Thank you Duncan.

Rich


On Tue, Dec 10, 2019 at 2:27 PM Duncan Murdoch  wrote:
>
> (Rich, you've heard this already, this message is for others:)
>
> I think I've found the cause of this, and it might be a bug in the check
> code in R.
>
> Rich's package HH "Suggests" microplot, and microplot "Imports" HH.
> When running checks on the new version 3.1-38 of HH it appears the tests
> from the new version are run but the code being run is from the previous
> version 3.1-37 which is on CRAN.   I installed the old version
> indirectly when I installed microplot before running check.
>
> I've only seen this on Windows in R-devel when running --as-cran.  It
> doesn't happen in R-devel on MacOS with or without --as-cran, and I
> don't think it happens on Windows without --as-cran (but it might just
> be that there are no symptoms of testing the wrong version in that case).
>
> A workaround is to explicitly remove HH, then install the new version
> before running the check code.
>
> Duncan Murdoch
>
>
>
>
>
> On 08/12/2019 10:33 p.m., Richard M. Heiberger wrote:
> > Duncan,
> >
> > Thank you offering to look.
> > I have tried all the obvious things that I could think of.  None helped.
> > Perhaps you will think of something I haven't tried
> >
> > The reproducible example (not minimal) I can suggest is to use the
> > submitted file.
> >
> > ftp://CRAN.R-project.org/incoming/archive/HH_3.1-38.tar.gz
> >
> > On my windows machine
> >
> > R CMD check --as-cran HH_3.1-38.tar.gz
> > halts with
> >> BB <- likert(tmp[2:6,], box.width=unit(.4,"cm"), positiv

Re: [R-pkg-devel] inconsistent behavior between R CMD check and interactive use

2019-12-08 Thread Richard M. Heiberger
Duncan,

Thank you offering to look.
I have tried all the obvious things that I could think of.  None helped.
Perhaps you will think of something I haven't tried

The reproducible example (not minimal) I can suggest is to use the
submitted file.

ftp://CRAN.R-project.org/incoming/archive/HH_3.1-38.tar.gz

On my windows machine

R CMD check --as-cran HH_3.1-38.tar.gz
halts with
> BB <- likert(tmp[2:6,], box.width=unit(.4,"cm"), positive.order=TRUE)
Error in apply(x, 3:ldx, function(x) list(x)) :
  'MARGIN' does not match dim(X)
Calls: likert ... as.MatrixList -> as.MatrixList.array -> lapply -> apply
Execution halted

This is wrong.  That problem was in 3.1-37 and is why I needed a new version.
I repaired that problem. Running interactively, that command succeeds
on my machine.

R CMD check --as-cran --run-dontrun HH_3.1-38.tar.gz
halts with
> tmp.data <- confintervaldata()
Error in confintervaldata() : could not find function "confintervaldata"
Execution halted

That is wrong.  confintervaldata is in the NAMESPACE.
Running interactively, that command succeeds.
I added an ls("package:HH") ## yes I spelled it correctly
and the confinervaldata is missing from the list.  Again, it is in the
NAMESPACE for the generated executable package.


On the CRAN machines, neither of these problems appeared.  Instead
they found a different error
from code analysis, not from an execution failure.  I don't understand
why I didn't get that issue on
my machine when I used --as-cran.  The repair is in 3.1-39, which I
haven't sent in yet.
The repair is to replace
class(xxx) == "try-error"
with
"try-error" %in% class(xxx)

Please let me know if you see these same problems, or if you can think
of something else to try.

Rich


On Sun, Dec 8, 2019 at 4:58 PM Duncan Murdoch  wrote:
>
> On 08/12/2019 3:14 p.m., Richard M. Heiberger wrote:
> > I am seeing this in
> >> version
> > _
> > platform   x86_64-w64-mingw32
> > arch   x86_64
> > os mingw32
> > system x86_64, mingw32
> > status Under development (unstable)
> > major  4
> > minor  0.0
> > year   2019
> > month  12
> > day05
> > svn rev77528
> > language   R
> > version.string R Under development (unstable) (2019-12-05 r77528)
> > nickname   Unsuffered Consequences
> >
> > I also saw this in 2019-12-03 r77513
> >
> >
> > In my interactive use I set
> >> Sys.setenv("_R_CLASS_MATRIX_ARRAY_"="true")
> > to match what --as-cran does for class(matrix(1))
> >
> > There are two problems, unrelated I think.
> >
> > 1. I have an example which works correctly in interactive use and which
> > shows an error under R CMD check.  The error message is the one we now 
> > expect
> > when class(matrix(1)) is just "matrix".  The error should not be
> > triggered when the class
> > is c("matrix","array") >
> >
> > 2. I export many functions.  Several are not handled correctly during
> > R CMD check testing.
> > They appear in the NAMESPACE in the source, and also in both the
> > Rcheck 00_pkg_src and the Rcheck built package.
> > Yet, when those functions are called during the testing of the
> > examples, they aren't visible.
> > An ls() call inserted into the \examples{} section does not include them.
>
> ls() wouldn't normally see functions exported from packages.  You'd need
> ls("package:foo") to see the exports from package foo, and that only
> works after attaching the package.  But examples should be running with
> your package attached during testing, so if that's what you really
> meant, then you do have a problem.
>
> > The functions are visible and work correctly during interactive use.
> >
> >
> > I am running a WIndows 10 system inside a Parallels Virtual Machine on
> > a Macintosh.
> >
> > Has anyone else seen similar misbehavior?
> > Or can suggest a repair?
>
> Not seen this, and can't suggest a repair without seeing a reproducible
> example.
>
> Duncan

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


[R-pkg-devel] inconsistent behavior between R CMD check and interactive use

2019-12-08 Thread Richard M. Heiberger
I am seeing this in
> version
   _
platform   x86_64-w64-mingw32
arch   x86_64
os mingw32
system x86_64, mingw32
status Under development (unstable)
major  4
minor  0.0
year   2019
month  12
day05
svn rev77528
language   R
version.string R Under development (unstable) (2019-12-05 r77528)
nickname   Unsuffered Consequences

I also saw this in 2019-12-03 r77513


In my interactive use I set
> Sys.setenv("_R_CLASS_MATRIX_ARRAY_"="true")
to match what --as-cran does for class(matrix(1))

There are two problems, unrelated I think.

1. I have an example which works correctly in interactive use and which
shows an error under R CMD check.  The error message is the one we now expect
when class(matrix(1)) is just "matrix".  The error should not be
triggered when the class
is c("matrix","array")


2. I export many functions.  Several are not handled correctly during
R CMD check testing.
They appear in the NAMESPACE in the source, and also in both the
Rcheck 00_pkg_src and the Rcheck built package.
Yet, when those functions are called during the testing of the
examples, they aren't visible.
An ls() call inserted into the \examples{} section does not include them.
The functions are visible and work correctly during interactive use.


I am running a WIndows 10 system inside a Parallels Virtual Machine on
a Macintosh.

Has anyone else seen similar misbehavior?
Or can suggest a repair?

Rich

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


Re: [R-pkg-devel] Trying to work around missing functionality

2018-08-27 Thread Richard M. Heiberger
Does this solve the problem?

if (getRversion() >= '2.15.1')
  globalVariables(c('envroot'))

I keep this in file R/globals.R

I learned of this from John Fox's use in Rcmdr.

On Mon, Aug 27, 2018 at 8:28 PM, J C Nash  wrote:
> In order to track progress of a variety of rootfinding or optimization
> routines that don't report some information I want, I'm using the
> following setup (this one for rootfinding).
>
> TraceSetup <- function(ifn=0, igr=0, ftrace=FALSE, fn=NA, gr=NA){
> # JN: Define globals here
>groot<-list(ifn=ifn, igr=igr, ftrace=ftrace, fn=fn, gr=gr, label="none")
>envroot <<- list2env(groot) # Note globals in FnTrace
>## This generates a NOTE that
>## TraceSetup: no visible binding for '<<-' assignment to ‘envroot’
> ##   envroot<-list2env(groot, parent=.GlobalEnv) # Note globals in FnTrace -- 
> this does NOT work
>## utils::globalVariables("envroot") # Try declaring here -- causes errors
> # end globals
>envroot
> }
>
> FnTrace <- function(x,...) {
>   # Substitute function to call when rootfinding
>   # Evaluate fn(x, ...)
> val <- envroot$fn(x, ...)
> envroot$ifn <- envroot$ifn + 1 # probably more efficient ways
> if (envroot$ftrace) {
>cat("f(",x,")=",val," after ",envroot$ifn," ",envroot$label,"\n")
> }
> val
> }
>
>
> Perhaps there are better ways to do this, but this does seem to work quite 
> well.
> It lets me call a rootfinder with FnTrace and get information on evaluations 
> of fn().
> (There's another gr() routine, suppressed here.)
>
> However, R CMD check gives a NOTE for
>
>   TraceSetup: no visible binding for global variable ‘envroot’
>   Undefined global functions or variables:
> envroot
>
> The commented lines in TraceSetup suggest some of the things I've tried. 
> Clearly I don't
> fully comprehend how R is grinding up the code, but searches on the net seem 
> to indicate
> I am far from alone. Does anyone have any suggestion of a clean way to avoid 
> the NOTE?
>
> JN
>
> __
> 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


Re: [R-pkg-devel] Latex error during compilation

2018-03-06 Thread Richard M. Heiberger
Sounds like a missing "}".
Which could mean the brace is inside quotes or following a "%"

On Tue, Mar 6, 2018 at 09:17 michael tsagris via R-package-devel <
r-package-devel@r-project.org> wrote:

>
>
>
> -- Forwarded message --
> From: michael tsagris 
> To: "r-package-devel@r-project.org" 
> Cc:
> Bcc:
> Date: Tue, 6 Mar 2018 04:21:16 + (UTC)
> Subject: Latex error during compilation
> Can somebody please tell me how to fix this error? the only I thing I
> change in my computer is the latex. I updated miktext and texmaker. And
> here I am.
> LaTeX errors when creating PDF version.
> This typically indicates Rd problems.
> LaTeX errors found:
> ! File ended while scanning use of \HeaderA.
> 
> \par
> <*> D:/temp/RtmpA5snrO/Rd2pdf122d81cab6b64/Rd2.tex
>
> ! Emergency stop.
> <*> D:/temp/RtmpA5snrO/Rd2pdf122d81cab6b64/Rd2.tex
>
> *** (job aborted, no legal \end found)
>
> !  ==> Fatal error occurred, no output PDF file produced!
> * checking PDF version of manual without hyperrefs or index ... ERROR
> * DONE
> [[alternative HTML version deleted]]
>
>
>
>
> -- Forwarded message --
> From: michael tsagris via R-package-devel 
> To: "r-package-devel@r-project.org" 
> Cc:
> Bcc:
> Date: Tue, 6 Mar 2018 04:21:16 +
> Subject: [R-pkg-devel] Latex error during compilation
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[alternative HTML version deleted]]

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