Re: [Rd] suggestion to fix packageDescription() for Windows users

2017-06-23 Thread Rich Calaway via R-devel
The following patch is not the most elegant, but it restores the Authors when 
"LC_CTYPE" is set to either "Chinese" or "Arabic":

> Sys.setlocale("LC_CTYPE", "Chinese")
[1] "Chinese (Simplified)_China.936"
> citation("readr")

To cite package ‘readr’ in publications use:

  (2016). readr: Read Tabular Data. R package version 1.0.0.
  https://CRAN.R-project.org/package=readr

A BibTeX entry for LaTeX users is

  @Manual{,
title = {readr: Read Tabular Data},
year = {2016},
note = {R package version 1.0.0},
url = {https://CRAN.R-project.org/package=readr},
  }

ATTENTION: This citation information has been auto-generated from the
package DESCRIPTION file and may need manual editing, see
‘help("citation")’.

> Sys.setlocale("LC_CTYPE", "Arabic")
[1] "Arabic_Saudi Arabia.1256"
> citation("readr")

To cite package ‘readr’ in publications use:

  (2016). readr: Read Tabular Data. R package version 1.0.0.
  https://CRAN.R-project.org/package=readr

A BibTeX entry for LaTeX users is

  @Manual{,
title = {readr: Read Tabular Data},
year = {2016},
note = {R package version 1.0.0},
url = {https://CRAN.R-project.org/package=readr},
  }

ATTENTION: This citation information has been auto-generated from the
package DESCRIPTION file and may need manual editing, see
‘help("citation")’.

> citation <- newCitation
> citation("readr")

To cite package ‘readr’ in publications use:

  Hadley Wickham, Jim Hester and Romain Francois (2016). readr: Read
  Tabular Data. R package version 1.0.0.
  https://CRAN.R-project.org/package=readr

A BibTeX entry for LaTeX users is

  @Manual{,
title = {readr: Read Tabular Data},
author = {Hadley Wickham and Jim Hester and Romain Francois},
year = {2016},
note = {R package version 1.0.0},
url = {https://CRAN.R-project.org/package=readr},
  }



The patch is:

Index: citation.R
===
--- citation.R  (revision 72852)
+++ citation.R  (working copy)
@@ -1162,8 +1162,11 @@
 if(dir == "")
 stop(gettextf("package %s not found", sQuote(package)),
  domain = NA)
-meta <- packageDescription(pkg = package,
-   lib.loc = dirname(dir))
+   args <- list(pkg = package, lib.loc = dirname(dir))
+   if (!is.na(enc <- packageDescription(pkg = package, 
lib.loc=dirname(dir), field="Encoding")))
+   args$enc <- enc
+meta <- do.call("packageDescription", args=args)
+
 ## if(is.null(auto)): Use default auto-citation if no CITATION
 ## available.
 citfile <- file.path(dir, "CITATION")


Nathan says he can look into this further next week...

Cheers,

Rich Calaway
Microsoft R Product Team
24/1341
+1 (425) 4219919 X19919

-Original Message-
From: R-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of Nathan 
Sosnovske via R-devel
Sent: Friday, June 23, 2017 7:36 AM
To: Duncan Murdoch ; Andrie de Vries 

Cc: r-devel@r-project.org; Ben Marwick 
Subject: Re: [Rd] suggestion to fix packageDescription() for Windows users

Hi Duncan,

I'm guessing I'll be able to look at this over the weekend/next week (probably 
closer to next week). It is on my list of things to do and I've just had a few 
other prior commitments that I have to finish first.

Sorry for the delay. I'll chime in with a status update next week.

Nathan

-Original Message-
From: R-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of Duncan Murdoch
Sent: Friday, June 23, 2017 5:16 AM
To: Andrie de Vries 
Cc: r-devel@r-project.org; Ben Marwick 
Subject: Re: [Rd] suggestion to fix packageDescription() for Windows users

On 18/06/2017 5:57 AM, Andrie de Vries wrote:
> Hi, Duncan
>
> i have forwarded this thread to Nathan, who promised to look into it.

Any progress on this?

Duncan Murdoch

>
> Andrie
>
> On 17 Jun 2017 17:26, "Duncan Murdoch"  > wrote:
>
> On 17/06/2017 9:13 AM, Ben Marwick wrote:
>
> Hi Duncan,
>
> Thanks for your reply. Yes, it does seem to be specific to the CTYPE
> setting to Chinese on Windows. If I set it to English using
> Sys.setlocale() there is no problem, then back to Chinese and the
> authors disappear:
>
> Sys.setlocale("LC_ALL","English")
> citation("readr")
>
>
> Thanks, that makes the problem reproducible.  I'll submit it as a
> bug report.  Maybe someone from Microsoft will fix it.
>
> Duncan Murdoch
>
>
> #' To cite package ‘readr’ in publications use:
> #'
> #'   Hadley Wickham, Jim Hester and Romain Francois (2017).
> readr: Read
> #' Rectangular Text Data. R package version 1.1.1.
> #' 
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2FCRAN.R-project.org%2Fpackage%3Dreadr&data=02%7C01%7Cnsosnov%40microsoft.com%7Ccf07101e770643227da008d4ba31aa85%7C72f988bf86f141af91ab2d7cd011db47%7C1

Re: [Rd] texi2pdf doesn't find the correct MikTex installation due to erroneous Sys.which()

2017-06-27 Thread Rich Calaway via R-devel
Ah, but I bet you do have that path...try 

> Sys.which("texify")
 texify 
"C:\\PROGRA~2\\MIKTEX~1.9\\miktex\\bin\\texify.exe" 
> normalizePath(Sys.which("texify"))
[1] "C:\\Program Files (x86)\\MiKTeX 2.9\\miktex\\bin\\texify.exe"

Cheers,

Rich Calaway
Microsoft R Product Team
24/1341
+1 (425) 4219919 X19919

-Original Message-
From: R-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of Joris Meys
Sent: Tuesday, June 27, 2017 10:43 AM
To: r-devel@r-project.org
Subject: [Rd] texi2pdf doesn't find the correct MikTex installation due to 
erroneous Sys.which()

I checked after this question popped up on Stackoverflow:

https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F44785961%2Fcompile-pdf-in-rstudio-works-but-knit2pdf-does-not-work-in-r-or-rstudio&data=02%7C01%7Crichcala%40microsoft.com%7C109c2b63c17443c51ecc08d4bd83fb68%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636341821947377257&sdata=NwIyGCJSQQjf1HY6r1X9a6V9Z1XI%2F74UTEe9ritYYys%3D&reserved=0

On Windows, texi2pdf looks for the texify.exe of Miktex, but looks in a very 
wrong place:

> Sys.which("texify")
  texify 
"C:\\PROGRA~1\\MIKTEX~1.9\\miktex\\bin\\x64\\texify.exe"

That folder is not on my computer (I have 2.9 installed), not in my path, not 
in my system path and I couldn't find it in my register. So it appears as if 
Sys.which() is looking in the wrong place.

What could cause this?

Kind regards
Joris

--
Joris Meys
Statistical consultant

Ghent University
Faculty of Bioscience Engineering
Department of Mathematical Modelling, Statistics and Bio-Informatics

tel :  +32 (0)9 264 61 79
joris.m...@ugent.be
---
Disclaimer : 
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fhelpdesk.ugent.be%2Fe-maildisclaimer.php&data=02%7C01%7Crichcala%40microsoft.com%7C109c2b63c17443c51ecc08d4bd83fb68%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636341821947377257&sdata=bCbpfOJqYi2M8U7YVbh4DG1oIdQHzxVboCRTkTwXzjI%3D&reserved=0

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-devel&data=02%7C01%7Crichcala%40microsoft.com%7C109c2b63c17443c51ecc08d4bd83fb68%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636341821947377257&sdata=5Gy480YnsDT2qgmIfIPPARL8sEmYmg%2BcetIApASA%2FR0%3D&reserved=0

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


[Rd] Default repositories in WIndows

2017-09-08 Thread Rich Calaway via R-devel
In the NEWS for R 3.1.0, there is this item:

  The CRANextra repository is no longer a default repository on Windows: 
all the binary versions of packages from CRAN are now on CRAN, although 
CRANextra contains packages from Omegahat and elsewhere used by CRAN packages.

However, the .onLoad function in package utils still appends CRANextra to the 
Windows repos list and sets the repos option, so that CRANextra does indeed 
still appear as a default repository on Windows. This patch should make the 
reality agree with the NEWS...

Index: zzz.R
===
--- zzz.R   (revision 73224)
+++ zzz.R   (working copy)
@@ -39,8 +39,7 @@
 if(.Platform$OS.type == "windows") {
 list(unzip = "internal",
  editor = if(length(grep("Rgui", commandArgs(), TRUE))) 
"internal" else "notepad",
- repos = c(CRAN = "@CRAN@",
-   CRANextra = "http://www.stats.ox.ac.uk/pub/RWin";)
+ repos = c(CRAN = "@CRAN@")
  )
 } else
 list(unzip = Sys.getenv("R_UNZIPCMD"),

(This patch was against R-patched; the same change needs to be made to R-devel 
as well...)

Cheers,

Rich Calaway
Microsoft R Product Team
24/1341
+1 (425) 4219919 X19919

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