[R-pkg-devel] Matrix and Mac OS

Mikael Jagan j@g@nmn2 @end|ng |rom gm@||@com
Wed Nov 1 20:38:16 CET 2023




On 2023-11-01 12:59 pm, Mikael Jagan wrote:
> A hack that seems to work is (whitespace added for readability):
> 
>       \newcommand{\Seqn}{
>         \ifelse{latex}{
>           \Sexpr[results=rd]{if (getRversion() < "4.2.2") "\\\\\\\\eqn{#1}" else
> "\\\\\\\\eqn{#2}"}
>         }{
>           \ifelse{html}{
>             \Sexpr[results=rd]{if (getRversion() < "4.2.0") "\\\\\\\\eqn{#1}"
> else "\\\\\\\\eqn{#2}"}
>           }{
>             \Sexpr[results=rd]{"\\\\\\\\eqn{#2}"}
>           }
>         }
>       }

Er, the above is wrong, because '<' should be '>=' and because '#2' (which
is conceptually verbatim text) should use \verb{} for PDF and HTML output,
not \eqn{}.  For Matrix 1.6-2 I have created man/macros/local.Rd and added:

\newcommand{\Seqn}{\ifelse{latex}{\Sexpr[results=rd]{if (getRversion() >= 
"4.2.2") "\\\\\\\\eqn{#1}" else 
"\\\\\\\\verb{#2}"}}{\ifelse{html}{\Sexpr[results=rd]{if (getRversion() >= 
"4.2.0") "\\\\\\\\eqn{#1}" else 
"\\\\\\\\verb{#2}"}}{\Sexpr[results=rd]{"\\\\\\\\eqn{#2}"}}}}

\newcommand{\Sdeqn}{\ifelse{latex}{\Sexpr[results=rd]{if (getRversion() >= 
"4.2.2") "\\\\\\\\deqn{#1}" else 
"\\\\\\\\preformatted{#2}"}}{\ifelse{html}{\Sexpr[results=rd]{if (getRversion() 
 >= "4.2.0") "\\\\\\\\deqn{#1}" else 
"\\\\\\\\preformatted{#2}"}}{\Sexpr[results=rd]{"\\\\\\\\deqn{#2}"}}}}

Now Matrix 1.6-2 passes its Rd checks under my checkout of R-3-5-branch.
Some examples and tests fail for unrelated reasons.  I'll fix those, too ...

Mikael

> 
> as amsmath support for PDF output and KaTeX support for HTML output
> were introduced in R 4.2.2 and 4.2.0, respectively.
> 
> Sadly I really do seem to need 8 escapes:
> 
>       \Seqn{\\\\\\\\text{min}(m,n) \\\\\\\\times n}{min(m,n)-by-n}
> 
> Maybe one of the Rd experts here can suggest an improvement ...
> 
> Mikael
> 
> On 2023-11-01 5:06 am, Martin Maechler wrote:
>>>>>>> Uwe Ligges
>>>>>>>       on Wed, 1 Nov 2023 06:26:23 +0100 writes:
>>
>>       > On 01.11.2023 03:51, Mikael Jagan wrote:
>>       >> Thanks.  It seems that we were mistaken in our feeling (IIRC) that it would
>>       >> be "OK" to implicitly require '--no-manual' on versions of R from 3.5.0 to
>>       >> 4.2.1, not changing our Depends.
>>       >>
>>       >> We will fix this in Matrix 1.6-2, probably by conditionalizing or otherwise
>>       >> replacing the amsmath commands and probably _not_ by changing to depend on
>>       >> R >= 4.2.2.  Martin may have more to say in "the morning".
>>
>> I agree (*not* to raise Matrix pkg's R version dependency).
>>
>>       > Note that dependin on R >= 4.2.2 does not work. We need dependencies of
>>       > the form R >= x.y.0. This is also part of the checks.
>>
>> Yes, indeed.
>> And as we learned, R >= 4.2.0 would not help for r-oldrel-macos
>>
>> I (am unhappy but) agree to take the responsibility for our
>> decision to go ahead and use much nicer LaTeX formula for
>> matrices etc, in our help pages {thinking that indeed people who'd
>> install Matrix on an old R version would always be able to read
>> Matrix manual pages via web search (as it seems to me 95% of
>> people do nowadays) ... or then have someone in their
>> organization to figure out how to use a newer amsmath (latex) package if
>>    they really really want the Matrix pdf manual offline}.
>>
>> Martin
>>
>>       > Reason is that we have only one binary repository for one R-x.y.?
>>       > series. On WIndows, where we check with R-4.2.3, a binary would be
>>       > created and hence R-4.2.[0-1] would not see any valid Matrix binaries.
>>
>>       > So please either make this work on R >= 4.2.0 or require R >= 4.3.0. If
>>       > the latter, ideally with an interim version that works for R >= 4.2.0,
>>       > so that we valid binaries with correct dependency declarations again.
>>
>>       > Best,
>>       > Uwe
>>
>>       >> In the mean time (i.e., while we are stuck with Matrix 1.6-1.1), it may
>>       >> help
>>       >> to update to R 4.2.3 on r-oldrel-macos-* and/or to have EdSurvey revert its
>>       >> strict version requirement, unless there are clear examples justifying one.
>>       >>
>>       >> Mikael
>>       >>
>>       >>
>>       >> On 2023-10-31 8:17 pm, Simon Urbanek wrote:
>>       >>> Mikael,
>>       >>>
>>       >>> in that case I think your requirements are wrong - Matrix says R >=
>>       >>> 3.5.0 which is apparently incorrect - from what you say it should be
>>       >>> 4.2.2?. I can certainly update to 4.2.3 if necessary.
>>       >>>
>>       >>> Cheers,
>>       >>> Simon
>>       >>>
>>       >>>
>>       >>>
>>       >>>> On 1/11/2023, at 9:19 AM, Mikael Jagan <jaganmn2 using gmail.com> wrote:
>>       >>>>
>>       >>>> Thanks.  We did see those ERRORs, stemming from use (since Matrix 1.6-0)
>>       >>>> of amsmath commands in Rd files.  These have been supported since R
>>       >>>> 4.2.2,
>>       >>>> but r-oldrel-macos-* (unlike r-oldrel-windows-*) continues to run R
>>       >>>> 4.2.0.
>>       >>>> My expectation was that those machines would begin running R >= 4.2.2
>>       >>>> well
>>       >>>> before the R 4.4.0 release, but apparently that was wrong.
>>       >>>>
>>       >>>> I am hesitant to complicate our Rd files with conditions on R versions
>>       >>>> only to support PDF output for R < 4.2.2, but maybe we can consider it
>>       >>>> for the Matrix 1.6-2 release if it is really a barrier for others ...
>>       >>>>
>>       >>>> Mikael
>>       >>>>
>>       >>>> On 2023-10-31 3:33 pm, Simon Urbanek wrote:
>>       >>>>> Mikael,
>>       >>>>> current Matrix fails checks on R-oldrel so that's why only the last
>>       >>>>> working version is installed:
>>       >>>>> https://cran.r-project.org/web/checks/check_results_Matrix.html
>>       >>>>> Cheers,
>>       >>>>> Simon
>>>>>>> On 1/11/2023, at 4:05 AM, Mikael Jagan <jaganmn2 using gmail.com> wrote:
>>       >>>>>>
>>>>>>> I am guessing that they mean EdSurvey:
>>       >>>>>>
>>>>>>>       https://cran.r-project.org/web/checks/check_results_EdSurvey.html
>>       >>>>>>
>>>>>>> Probably Matrix 1.6-1.1 is not installed on r-oldrel-macos-arm64,
>>>>>>> even though it can be, because it was not released until R 4.3-z.
>>       >>>>>>
>>>>>>> AFAIK, methods for 'qr' have not been touched since Matrix 1.6-0, and
>>>>>>> even those changes should have been backwards compatible, modulo
>>>>>>> handling
>>>>>>> of dimnames (class sparseQR gained a Dimnames slot in 1.6-0).
>>       >>>>>>
>>>>>>> So I don't see a clear reason for requiring 1.6-1.1.  Requiring 1.6-0
>>>>>>> might make sense, if somehow EdSurvey depends on how class sparseQR
>>>>>>> preserves dimnames.  But IIRC our rev. dep. checks at that time did
>>>>>>> not
>>>>>>> reveal problems with EdSurvey.
>>       >>>>>>
>>>>>>> Mikael
>>       >>>>>>
>>>>>>> On 2023-10-31 7:00 am, r-package-devel-request using r-project.org wrote:
>>       >>>>>>> Paul,
>>       >>>>>>> can you give us a bit more detail? Which package, which build and
>>       >>>>>>> where you got the errors? Older builds may not have the latest
>>       >>>>>>> Matrix.
>>       >>>>>>> Cheers,
>>       >>>>>>> Simon
>>       >>>>>>>> On 31/10/2023, at 11:26 AM, Bailey, Paul via
>>       >>>>>>>> R-package-devel<r-package-devel using r-project.org>  wrote:
>>       >>>>>>>>
>>       >>>>>>>> Hi,
>>       >>>>>>>>
>>       >>>>>>>> I'm the maintainer for a few packages, one of which is currently
>>       >>>>>>>> failing CRAN checks on Mac OS because Matrix is not available in
>>       >>>>>>>> my required version (the latest). I had to fix a few things due
>>       >>>>>>>> to changes in the latest Matrix package because of how qr works
>>       >>>>>>>> and I thought, given the apparent API change, I should then
>>       >>>>>>>> require the latest version. My error is, "Package required and
>>       >>>>>>>> available but unsuitable version: 'Matrix'"
>>       >>>>>>>>
>>       >>>>>>>> When I look at the NEWS in Matrix there is no mention of Mac OS
>>       >>>>>>>> issues, what the latest stable version of Matrix is, nor when a
>>       >>>>>>>> fix is expected. What version do MacOS version test Matrix with
>>       >>>>>>>> by default? Where is this documented? I assumes it always tested
>>       >>>>>>>> with the latest version on CRAN, so I'm a bit surprised. Or will
>>       >>>>>>>> this be resolved soon and I shouldn't bother CRAN maintainers
>>       >>>>>>>> with a new version of my package?
>>       >>>>>>>>
>>       >>>>>>>> Best,
>>       >>>>>>>> Paul
>>       >>>>>>>>
>>       >>>>>>>>     [[alternative HTML version deleted]]
>>       >>>>>>
>>       >>>>
>>       >>>
>>       >>
>>       >> ______________________________________________
>>       >> R-package-devel using r-project.org mailing list
>>       >> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>
>>       > ______________________________________________
>>       > R-package-devel using r-project.org mailing list
>>       > https://stat.ethz.ch/mailman/listinfo/r-package-devel




More information about the R-package-devel mailing list