BennMacdonald / AGM_RPackage

1 stars 0 forks source link

gptk is out of date on devel version of R #23

Open FrankD opened 4 years ago

FrankD commented 4 years ago

We use the gptk package to produce the initialization fit of GP to the data. The latest R devel version has made a change to how the class() function works. Since gptk uses class(), and we use gptk, this led to the following issue as reported by the CRAN maintainers:

Specifically, see the problems shown for the r-devel Debian checks.

These can be reproduced by checking with --as-cran using current r-devel, which for now sets

_R_CLASS_MATRIXARRAY=true

in the check environment, to the effect that

R> class(matrix(1 : 4, 2, 2)) [1] "matrix" "array"

(and no longer just "matrix" as before).

According to the R NEWS file,

For now only active when environment variable _R_CLASS_MATRIXARRAY is set to something true, but planned to be the new unconditional behavior when R 4.0.0 is released:

matrix objects now also inherit from class "array", namely, e.g., class(diag(1)) is c("matrix", "array") which invalidates code assuming that length(class(obj)) == 1, an incorrect assumption that is less frequently fulfilled now.

S3 methods for "array", i.e., .array(), are now also dispatched for matrix objects.

Apparently your package no longer works correctly when class(matrix(...)) gives a vector of length two: please fix as necessary.

For now this only produces a warning, so I have worked around it by disabling the unit tests that checked that we were getting no warnings, but we need a longer-term solution. Is there another GP fitting package that we could use instead?