Skip to content
Prev 53752 / 63424 Next

suggestion to fix packageDescription() for Windows users

The following patch is not the most elegant, but it restores the Authors when "LC_CTYPE" is set to either "Chinese" or "Arabic":
[1] "Chinese (Simplified)_China.936"
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")?.
[1] "Arabic_Saudi Arabia.1256"
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")?.
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-bounces at r-project.org] On Behalf Of Nathan Sosnovske via R-devel
Sent: Friday, June 23, 2017 7:36 AM
To: Duncan Murdoch <murdoch.duncan at gmail.com>; Andrie de Vries <apdevries at gmail.com>
Cc: r-devel at r-project.org; Ben Marwick <bmarwick at uw.edu>
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-bounces at r-project.org] On Behalf Of Duncan Murdoch
Sent: Friday, June 23, 2017 5:16 AM
To: Andrie de Vries <apdevries at gmail.com>
Cc: r-devel at r-project.org; Ben Marwick <bmarwick at uw.edu>
Subject: Re: [Rd] suggestion to fix packageDescription() for Windows users
On 18/06/2017 5:57 AM, Andrie de Vries wrote:
Any progress on this?

Duncan Murdoch
______________________________________________
R-devel at 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%7Cnsosnov%40microsoft.com%7Ccf07101e770643227da008d4ba31aa85%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636338169899157582&sdata=8o%2FDxEx7SSzw9rTkmz0h5ztEUZ8f7wasDh9RQ7p2DK8%3D&reserved=0
______________________________________________
R-devel at 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%7Cb22a180ce5364536e2fb08d4ba452c57%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636338253654457398&sdata=8lLgE%2FbFCc3YImfDsYBuNSLhHB15giroe7rJwe%2F66UE%3D&reserved=0
Message-ID: <CY4PR21MB04713D49F2DB7C9BFC2E2A56DED90@CY4PR21MB0471.namprd21.prod.outlook.com>
In-Reply-To: <SN1PR21MB0061EB36C510723541CC25B7B7D80@SN1PR21MB0061.namprd21.prod.outlook.com>