gsucarrat / gets

R Package for General-to-Specific (GETS) modelling and Indicator Saturation (ISAT) methods
8 stars 5 forks source link

escaped characters in output from CRAN package #2

Closed farlies closed 4 years ago

farlies commented 4 years ago

If I install this package (on Linux) from CRAN, v0.23, the printed output from models includes the literal escape sequences for newlines (\n) instead of the desired newlines. If I install per README.md directions directly from this GitHub repo, I get the desired lovely output with newlines (it sure makes the tables easier to read!) Possibly this issue belongs in a different repo...

gsucarrat commented 4 years ago

Hi, sorry for the late reply. We have not been able to identify the exact source of this problem, but we think it is related to which version of R that is used to compile the tarball. Hopefully, the upload of a new version should solve the issue. All the best, Genaro

moritzpschwarz commented 4 years ago

I think I've found the error:

in the version that is on CRAN, the print.arxand print.gets etc. functions use cat("\\n") rather than cat("\n"). See here: https://github.com/cran/gets/blob/fbb9e90754344e068095e4e1dc908a60bdc6e994/R/print.arx.R#L10

From what I can judge, the new version deals with the issue already: https://github.com/gsucarrat/gets/blob/d654339dbd2ad062ad00be54a095e3a99d9d8193/gets-base-source.R#L3110

So unless this error is introduced when you upload the package to CRAN, this should be resolved in the next update.

gsucarrat commented 4 years ago

Moritz, the problem is that I/we never introduced the double backslashes in the code. My theory is that it is either R version 4, or its development version, which introduces the double backslash when building the tarball. The current tarball on Github has been built with R 3.5.3 64bit under Windows 10, and does not introduce the issue. So, yes, a new upload - checking that the double backslashes are not introduced by the version used to build the tarball - will probably solve the issue.

moritzpschwarz commented 4 years ago

The error should be resolved. The new CRAN Version does not show this problem. I will therefore close this issue.