[Rd] Wrong bug ID & URL in Daily News about R-devel/NEWS

2016-01-03 Thread Ben Marwick

I was browsing some recent R news at

http://developer.r-project.org/blosxom.cgi/R-devel/NEWS/2016/01/03#n2016-01-03

And reading this item:

"tapply() has been made considerably more efficient without changing
functionality, thanks to proposals from Peter Haverty and Suharto 
Anggono. (PR#16488)"


But I found that the link in the item goes to a page about the GUI, not 
tapply:


https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16488

It should go to this page for the tapply speed-up:

https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16640

This is probably just a simple typo, since a quick check of other links 
to bugs in the news showed they were all ok.


Anyway, I couldn't see any webmaster contact details on
http://developer.r-project.org/ so hopefully this list message will 
reach the right person.


Ben

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


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

2017-06-17 Thread Ben Marwick

Recently I was trying to cite a package where the authors have ä
and ø in their names. I found that on Windows the citation() function 
did not return the authors' names at all, but on Linux there was no 
problem (sessionInfos at the bottom):


On Windows, no author names are returned:

#---

> citation("readr")

To cite package ‘readr’ in publications use:

  (2017). readr: Read Rectangular Text Data. R package version 1.1.1.
  https://CRAN.R-project.org/package=readr

A BibTeX entry for LaTeX users is

  @Manual{,
title = {readr: Read Rectangular Text Data},
year = {2017},
note = {R package version 1.1.1},
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")’.
#---

On Linux we do see the author names:

#---
> citation("readr")

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://CRAN.R-project.org/package=readr

A BibTeX entry for LaTeX users is

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

This appears to be an OS-dependent encoding issue. The citation function 
does not take an encoding argument, so it's not possible to set the 
encoding at the point where that function is used. The citation function 
working with the packageDescription function, which does have an 
encoding argument, but the default is not useful for Windows when there 
is an encoding set in the DESCRIPTION of the package (in this case UTF-8).


We can set the encoding argument in packageDescription so it works in 
Windows to give the authors as expected, but it is very inconvenient to 
generate citations directly from the output of this function. So I'd 
like to propose a solution this problem by changing one line in the 
packageDescription function, like so, from:


#---
if (missing(encoding) && Sys.getlocale("LC_CTYPE") == "C")
#---

to:

#---
if ((missing(encoding) && Sys.getlocale("LC_CTYPE") == "C") | 
unname(Sys.info()['sysname']) == "Windows")

#---

If I understand correctly, that will force ASCII//TRANSLIT encoding when 
DESCRIPTION files are read by packageDescription() on Windows machines. 
The upside is that Windows users will get the authors in the package 
citation, unlike the current situation. The downside is that the exotic 
symbols in the authors' names are replaced with common ones that are 
similar.


I think getting the citations to easily include the authors' names is 
pretty important, even if their names have exotic characters, so this is 
worth fixing. Is this edit to packageDescription the best way to solve 
this problem of exotic characters preventing the authors' names from 
showing on Windows?


thanks,

Ben




Windows sessionInfo

#---
> sessionInfo()
R version 3.4.0 Patched (2017-05-10 r72670)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_Australia.1252
[2] LC_CTYPE=Chinese (Simplified)_People's Republic of China.936
[3] LC_MONETARY=English_Australia.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252

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

loaded via a namespace (and not attached):
 [1] readr_1.1.1compiler_3.4.0 R6_2.2.1   hms_0.3 
tools_3.4.0
 [6] tibble_1.3.3   yaml_2.1.14Rcpp_0.12.11   knitr_1.16 
rlang_0.1.1

[11] fortunes_1.5-4
#---

Linux sessionInfo:

#---
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.10

locale:
 [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

loaded via a namespace (and not attached):
[1] tools_3.3.1 yaml_2.1.14 knitr_1.16
#---

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

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

2017-06-17 Thread Ben Marwick

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")

#' 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://CRAN.R-project.org/package=readr
#'
#' A BibTeX entry for LaTeX users is
#'
#' @Manual{,
#'   title = {readr: Read Rectangular Text Data},
#'   author = {Hadley Wickham and Jim Hester and Romain Francois},
#'   year = {2017},
#'   note = {R package version 1.1.1},
#'   url = {https://CRAN.R-project.org/package=readr},
#' }


Sys.setlocale("LC_CTYPE", "Chinese")
citation("readr")

#'
#' To cite package ‘readr’ in publications use:
#'
#'   (2017). readr: Read Rectangular Text Data. R package version 1.1.1.
#' https://CRAN.R-project.org/package=readr
#'
#' A BibTeX entry for LaTeX users is
#'
#' @Manual{,
#'   title = {readr: Read Rectangular Text Data},
#'   year = {2017},
#'   note = {R package version 1.1.1},
#'   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")’.

Where do we go from here? I do want to use the Chinese locale with R on 
Windows (and perhaps others do too), so switching the locale isn't a fix.


Thanks,

Ben

On 17/06/2017 10:36 PM, Duncan Murdoch wrote:

On 17/06/2017 7:10 AM, Ben Marwick wrote:

Recently I was trying to cite a package where the authors have ä
and ø in their names. I found that on Windows the citation() function
did not return the authors' names at all, but on Linux there was no
problem (sessionInfos at the bottom):

On Windows, no author names are returned:


I'm not seeing this.  You have fairly strange localization settings; see
comments below.



#---

 > citation("readr")

To cite package ‘readr’ in publications use:

   (2017). readr: Read Rectangular Text Data. R package version 1.1.1.
   https://CRAN.R-project.org/package=readr

A BibTeX entry for LaTeX users is

   @Manual{,
 title = {readr: Read Rectangular Text Data},
 year = {2017},
 note = {R package version 1.1.1},
 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")’.
#---

On Linux we do see the author names:

#---
 > citation("readr")

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://CRAN.R-project.org/package=readr

A BibTeX entry for LaTeX users is

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

This appears to be an OS-dependent encoding issue. The citation function
does not take an encoding argument, so it's not possible to set the
encoding at the point where that function is used. The citation function
working with the packageDescription function, which does have an
encoding argument, but the default is not useful for Windows when there
is an encoding set in the DESCRIPTION of the package (in this case
UTF-8).

We can set the encoding argument in packageDescription so it works in
Windows to give the authors as expected, but it is very inconvenient to
generate citations directly from the output of this function. So I'd
like to propose a solution this problem by changing one line in the
packageDescription function, like so, from:

#---
if (missing(encoding) && Sys.getlocale("LC_CTYPE") == "C")
#---

to:

#---
if ((missing(encoding) && Sys.getlocale("LC_CTYPE") == "C") |
unname(Sys.info()['sysname']) == "Windows")
#---

If I understand correctly, that will force ASCII//TRANSLIT encoding when
DESCRIPTION files are read by packageDescription() on Windows machines.
The upside is that Windows users will get the authors in the package
citation, unlike the current situation. The downside is that the exotic
symbols in the authors' names are replaced with common ones that are
similar.

I think getting the citations to easily i

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

2017-06-17 Thread Ben Marwick

Thanks very much, I see your bug report here:
https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17291

On 18/06/2017 2:26 AM, 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://CRAN.R-project.org/package=readr
#'
#' A BibTeX entry for LaTeX users is
#'
#' @Manual{,
#'   title = {readr: Read Rectangular Text Data},
#'   author = {Hadley Wickham and Jim Hester and Romain Francois},
#'   year = {2017},
#'   note = {R package version 1.1.1},
#'   url = {https://CRAN.R-project.org/package=readr},
#' }


Sys.setlocale("LC_CTYPE", "Chinese")
citation("readr")

#'
#' To cite package ‘readr’ in publications use:
#'
#'   (2017). readr: Read Rectangular Text Data. R package version 1.1.1.
#' https://CRAN.R-project.org/package=readr
#'
#' A BibTeX entry for LaTeX users is
#'
#' @Manual{,
#'   title = {readr: Read Rectangular Text Data},
#'   year = {2017},
#'   note = {R package version 1.1.1},
#'   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")’.

Where do we go from here? I do want to use the Chinese locale with R on
Windows (and perhaps others do too), so switching the locale isn't a fix.

Thanks,

Ben

On 17/06/2017 10:36 PM, Duncan Murdoch wrote:

On 17/06/2017 7:10 AM, Ben Marwick wrote:

Recently I was trying to cite a package where the authors have ä
and ø in their names. I found that on Windows the citation() function
did not return the authors' names at all, but on Linux there was no
problem (sessionInfos at the bottom):

On Windows, no author names are returned:


I'm not seeing this.  You have fairly strange localization settings; see
comments below.



#---

 > citation("readr")

To cite package ‘readr’ in publications use:

   (2017). readr: Read Rectangular Text Data. R package version 1.1.1.
   https://CRAN.R-project.org/package=readr

A BibTeX entry for LaTeX users is

   @Manual{,
 title = {readr: Read Rectangular Text Data},
 year = {2017},
 note = {R package version 1.1.1},
 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")’.
#---

On Linux we do see the author names:

#---
 > citation("readr")

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://CRAN.R-project.org/package=readr

A BibTeX entry for LaTeX users is

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

This appears to be an OS-dependent encoding issue. The citation
function
does not take an encoding argument, so it's not possible to set the
encoding at the point where that function is used. The citation
function
working with the packageDescription function, which does have an
encoding argument, but the default is not useful for Windows when there
is an encoding set in the DESCRIPTION of the package (in this case
UTF-8).

We can set the encoding argument in packageDescription so it works in
Windows to give the authors as expected, but it is very inconvenient to
generate citations directly from the output of this function. So I'd
like to propose a solution this problem by changing one line in the
packageDescription function, like so, from:

#---
if (missing(encoding) && Sys.getlocale("LC_CTYPE") == "C")
#---

to:

#---
if ((missing(encoding) && Sys.getlocale("LC_CTYPE") == "C") |
unname(Sys.info()['sysname']) == "Windows")
#---

If I understand correctly, that will force ASCII//TRANSLIT encoding
when
DESCRIP

[Rd] suggestion: mention how to format DOIs in "Writing R Extensions"

2017-06-29 Thread Ben Marwick

Hi Everyone,

I recently has some problems formatting DOIs correctly in a pkg 
submitted to CRAN. Kurt kindly informed me that in the man pages they 
must be \{doi:XXX} (noted in 
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#User_002ddefined-macros) 
and in the DESCRIPTION they must be  (not specifically noted 
anywhere).


I wondered if others had similar problems getting DOIs correct in pkg 
documentation, and I thought it could save the CRAN maintainers some 
time if the "Writing R Extensions" document was updated to include a 
mention of DOIs in the in DESCRIPTION.


For example, section "1.1.1 The DESCRIPTION file" currently has this text:

"URLs should be enclosed in angle brackets, e.g. 
''"


and I'd like to propose we replace that with this new text that 
specifically mentions DOIs:


""URLs, DOIs and other Uniform Resource Identifiers should be enclosed 
in angle brackets, e.g. ''"


That will help others like me who might be unsure of the proper way to 
format DOIs in the DESCRIPTION file, and save the CRAN maintainers some 
bother.


Making a direct mention of DOIs will also encourage well-formatted and 
visible citations of relevant scholarly work in package DESCRIPTIONs, 
which is a desirable behavior for package authors, and helps to 
strengthen ties between programming and research activities.


What do you think?

best,

Ben

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


[Rd] missing `=` in man page for files2

2017-07-22 Thread Ben Marwick

Hi everyone,

In the example code at the bottom of this page, 
https://stat.ethz.ch/R-manual/R-devel/library/base/html/files2.html, 
there is a missing `=`. That page has:


f <- list.files(".", all.files = TRUE, full.names = TRUE, recursive  TRUE)

but it should be:

f <- list.files(".", all.files = TRUE, full.names = TRUE, recursive = TRUE)

It's also missing from built-in help pages, for example ?Sys.chmod

best,

Ben

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


Re: [Rd] missing `=` in man page for files2

2017-07-22 Thread Ben Marwick

Thanks!

On 22/07/2017 4:08 PM, Duncan Murdoch wrote:

On 22/07/2017 8:19 AM, Ben Marwick wrote:

Hi everyone,

In the example code at the bottom of this page,
https://stat.ethz.ch/R-manual/R-devel/library/base/html/files2.html,
there is a missing `=`. That page has:

f <- list.files(".", all.files = TRUE, full.names = TRUE, recursive
TRUE)


Thanks, I'll fix that.


but it should be:

f <- list.files(".", all.files = TRUE, full.names = TRUE, recursive =
TRUE)

It's also missing from built-in help pages, for example ?Sys.chmod


That's the same page.  Each help page can have multiple "aliases" and
"concepts", which are search terms leading to it.  For files2.Rd, they are:

\alias{dir.create}
\alias{dir.exists}
\alias{Sys.chmod}
\alias{Sys.umask}
\concept{directory}
\concept{mkdir}
\alias{umask} % for links

(Aliases work with ?, concepts only work with ??.)

Duncan Murdoch




best,

Ben

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





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