Re: [R-pkg-devel] "non-ASCII input" and "--data-compress" ignored

2020-07-20 Thread Ivan Krylov
On Fri, 17 Jul 2020 18:08:24 -0500
Spencer Graves  wrote:

>    I tried escaping "%" every time it occurred without success,
> but adding "\encoding{UTF-8}" as the 4th line of
> nuclearWeaponStates.Rd eliminated that problem.

Glad it works for you, but you might want to check that the link still
leads to the correct URL in the PDF output. In particular, the
following .Rd file:

\encoding{UTF-8}
\title{title}\name{name}\description{
\href{https://www.americansecurityproject.org/ASP Reports/Ref 0072 -
North Korea’s Nuclear Program .pdf}{Derek Bolton (2012) North Korea's
Nuclear Program}

\href{https://www.americansecurityproject.org/ASP\%20Reports/Ref\%200072\%20-\%20North\%20Korea\%E2\%80\%99s\%20Nuclear\%20Program\%20.pdf}{Derek
Bolton (2012) North Korea's Nuclear Program}
}

...gives two working links when processed with R CMD Rdconv -t html,
but when I process it using R CMD Rd2pdf, the first link gets a
\T1\textquoteright instead of ’ in its URL, which makes it invalid. This
could be a LaTeX problem on my part, of course.

> I also tried loading and resaving all the files in the data
> directory.

You can also try using tools::resaveRdaFiles with various parameters if
you are interested.

> at least the first of the resulting *.rda files was corrupted

This sounds like trying to load a version-3 *.rda file (implemented in
3.5.0, default since 3.6.0) using an older version of R. Or a possible
indicator of a hardware problem.

-- 
Best regards,
Ivan

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


Re: [R-pkg-devel] "non-ASCII input" and "--data-compress" ignored

2020-07-17 Thread Spencer Graves

Hello, Ivan et al.:


  I tried escaping "%" every time it occurred without success, but 
adding "\encoding{UTF-8}" as the 4th line of nuclearWeaponStates.Rd 
eliminated that problem.



  Sadly, I tried "R CMD build --resave-data=best Ecdat", "R CMD 
build --resave-data Ecdat", "R CMD build Ecdat --resave-data", and "R 
CMD build Ecdat --resave-data=best", all without success.  I also noted 
that .travis.yml contains "r_build_args: --resave-data", which I 
remember adding some time ago to fix this problem.  And Travis reported 
this problem as well.  This suggests to me that a change was introduced 
with R 4.0.0 that disabled this option.



  I also tried loading and resaving all the files in the data 
directory.  This seemed to achieve some additional compression on 
average, but I still got, "Note: significantly better compression could 
be obtained by using "R CMD build --resave-data".  I then tried load and 
saveRDS on each one individually, but at least the first of the 
resulting *.rda files was corrupted, so I restored what I had before.



  Anyway, Ivan's suggestion fixed the UTF-8 problem and Travis 
confirmed that it can't make "--resave-data" work, either ;-)  If a CRAN 
maintainer complains about the compression problem, I can report what I 
tried and see what they suggest.



  Thanks again,
  Spencer Graves


On 2020-07-17 04:10, Ivan Krylov wrote:

On Fri, 17 Jul 2020 02:02:36 -0500
Spencer Graves  wrote:


If I copy this URL into a browser and back out again, I get
the following:


https://www.americansecurityproject.org/ASP%20Reports/Ref%200072%20-%20North%20Korea%E2%80%99s%20Nuclear%20Program%20.pdf


    However, if I use this inside "\href", "R CMD check" doesn't
recognize the close curly bracket because of the presence of the
non-ASCII characters.

WRE section 2.3 [*] provides an example of \href with RFC3986
percent-encoding. Since % is a comment character in Rd, the percent
signs have to be escaped with backslashes:

\href{https://www.americansecurityproject.org/ASP\%20Reports/Ref\%200072\%20-\%20North\%20Korea\%E2\%80\%99s\%20Nuclear\%20Program\%20.pdf}{Derek
Bolton (2012) North Korea's Nuclear Program}

This only works correctly in R >= 3.1.3, but results in correct output
in both HTML and PDF formats.

Alternatively, it should be possible to declare the encoding of the Rd
file using \encoding{UTF-8} (WRE 2.14 [**]), but in my tests (R 3.6.3,
could have been fixed in later versions) it results in a broken link in
Rd2pdf output.


    I'm getting, " Note: significantly better compression could be
obtained by using R CMD build --resave-data".  I get this message
even though I use "R CMD build --data-compress Ecdat".  I also tried
"R CMD build Ecdat --data-compress" and got the same result.

The note offers you to try adding --resave-data to R CMD build, not
--data-compress. What happens if you use --resave-data=best?
--data-compress doesn't seem to be an R CMD build option; at least
it's not mentioned in R CMD build --help.

WRE 1.1.6 [***] provides an example of --data-compress as an option of
R CMD INSTALL (not build).



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


Re: [R-pkg-devel] "non-ASCII input" and "--data-compress" ignored

2020-07-17 Thread Ivan Krylov
On Fri, 17 Jul 2020 02:02:36 -0500
Spencer Graves  wrote:

> If I copy this URL into a browser and back out again, I get 
> the following:
> 
> 
> https://www.americansecurityproject.org/ASP%20Reports/Ref%200072%20-%20North%20Korea%E2%80%99s%20Nuclear%20Program%20.pdf
> 
> 
>    However, if I use this inside "\href", "R CMD check" doesn't 
> recognize the close curly bracket because of the presence of the 
> non-ASCII characters.

WRE section 2.3 [*] provides an example of \href with RFC3986
percent-encoding. Since % is a comment character in Rd, the percent
signs have to be escaped with backslashes:

\href{https://www.americansecurityproject.org/ASP\%20Reports/Ref\%200072\%20-\%20North\%20Korea\%E2\%80\%99s\%20Nuclear\%20Program\%20.pdf}{Derek
Bolton (2012) North Korea's Nuclear Program}

This only works correctly in R >= 3.1.3, but results in correct output
in both HTML and PDF formats.

Alternatively, it should be possible to declare the encoding of the Rd
file using \encoding{UTF-8} (WRE 2.14 [**]), but in my tests (R 3.6.3,
could have been fixed in later versions) it results in a broken link in
Rd2pdf output.

>    I'm getting, " Note: significantly better compression could be 
> obtained by using R CMD build --resave-data".  I get this message
> even though I use "R CMD build --data-compress Ecdat".  I also tried
> "R CMD build Ecdat --data-compress" and got the same result.

The note offers you to try adding --resave-data to R CMD build, not
--data-compress. What happens if you use --resave-data=best?
--data-compress doesn't seem to be an R CMD build option; at least
it's not mentioned in R CMD build --help.

WRE 1.1.6 [***] provides an example of --data-compress as an option of
R CMD INSTALL (not build).

-- 
Best regards,
Ivan

P.S.

>   [[alternative HTML version deleted]]

Please don't post in HTML.

[*]
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Marking-text

[**]
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Encoding

[***]
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Data-in-packages

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


[R-pkg-devel] "non-ASCII input" and "--data-compress" ignored

2020-07-17 Thread Spencer Graves
Hello:


   I'm getting two warnings that I don't know how to fix on both 
4.0.2 under macOS 10.15.5 and 4.0.0 under TRAVIS-CI; the email from 
Travis CI  is copied below.


NON-ASCII INPUT:


* checking Rd files ... WARNING
man/nuclearWeaponStates.Rd: non-ASCII input and no declared encoding
problem found in ‘nuclearWeaponStates.Rd’


   I'm virtually certain this comes from the following:


   \href{https://www.americansecurityproject.org/ASP Reports/Ref 0072 - 
North Korea’s Nuclear Program .pdf}{Derek Bolton (2012) North Korea's 
Nuclear Program} (2012-08, American Security Program, accessed 2020-07-15)


   If you look carefully, you see spaces and a right single quote in 
the URL.  If I copy this URL into a browser and back out again, I get 
the following:


https://www.americansecurityproject.org/ASP%20Reports/Ref%200072%20-%20North%20Korea%E2%80%99s%20Nuclear%20Program%20.pdf


   However, if I use this inside "\href", "R CMD check" doesn't 
recognize the close curly bracket because of the presence of the 
non-ASCII characters.  I could leave out the URL, but that would degrade 
the quality of the documentation.


"--DATA-COMPRESS" IGNORED


   I'm getting, " Note: significantly better compression could be 
obtained by using R CMD build --resave-data".  I get this message even 
though I use "R CMD build --data-compress Ecdat".  I also tried "R CMD 
build Ecdat --data-compress" and got the same result.


   Suggestions?
   Thanks,
   Spencer Graves


sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.5

Matrix products: default
BLAS: 
/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: 
/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics  grDevices utils datasets  methods base

loaded via a namespace (and not attached):
[1] compiler_4.0.2


 Forwarded Message 
Subject:Broken: sbgraves237/Ecdat#33 (master - a049665)
Date:   Fri, 17 Jul 2020 06:05:20 +
From:   Travis CI 
To: spencer.gra...@effectivedefense.org



sbgraves237

/

Ecdat


 


branch iconmaster 

build has failed
Build #33 was broken 

arrow to build time
clock icon5 mins and 5 secs

sbgraves237 avatarsbgraves237

a049665 CHANGESET → 


fix nuclearWeaponStates so it now has all the desired data

Want to know about upcoming build environment updates?

Would you like to stay up-to-date with the upcoming Travis CI build 
environment updates? We set up a mailing list for you!

SIGN UP HERE 

book icon

Documentation  about Travis CI

Have any questions? We're here to help. 
Unsubscribe 

 
from build emails from the sbgraves237/Ecdat repository.
To unsubscribe from *all* build emails, please update your settings 
.
 

black and white travis ci logo 

Travis CI GmbH, Rigaer Str. 8, 10427 Berlin, Germany | GF/CEO: Randy 
Jacops | Contact: cont...@travis-ci.com  | 
Amtsgericht Charlottenburg, Berlin, HRB 140133 B | Umsatzsteuer-ID gemäß 
§27 a Umsatzsteuergesetz: DE282002648


[[alternative HTML version deleted]]

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