Re: [Rd] R CMD Rd2pdf and macros

2017-10-04 Thread Kurt Hornik
> Kasper Daniel Hansen writes:

Interesting.  When I take e.g. zTree as the last CRAN package using the
\packageTitle macro,

   R CMD Rd2pdf zTree

seems to work fine, but

   R CMD Rd2pdf zTree/man

gives

Converting Rd files to LaTeX Warning in parse_Rd("zTree/man/zTree-package.Rd", 
encoding = "unknown",  :
  zTree/man/zTree-package.Rd:6: unknown macro '\packageTitle'
Warning in parse_Rd("zTree/man/zTree-package.Rd", encoding = "unknown",  :
  zTree/man/zTree-package.Rd:9: unknown macro '\packageDescription'
Warning in parse_Rd("zTree/man/zTree-package.Rd", encoding = "unknown",  :
  zTree/man/zTree-package.Rd:13: unknown macro '\packageDESCRIPTION'
Warning in parse_Rd("zTree/man/zTree-package.Rd", encoding = "unknown",  :
  zTree/man/zTree-package.Rd:14: unknown macro '\packageIndices'
Warning in parse_Rd("zTree/man/zTree-package.Rd", encoding = "unknown",  :
  zTree/man/zTree-package.Rd:17: unknown macro '\packageAuthor'
Warning in parse_Rd("zTree/man/zTree-package.Rd", encoding = "unknown",  :
  zTree/man/zTree-package.Rd:18: unknown macro '\packageMaintainer'

Same in your case?

Best
-k


> When I run R CMD Rd2pdf on the man pages of a package, ie
>   R CMD Rd2pdf man

> I get

> Converting Rd files to LaTeX Warning in parse_Rd("man/mpra-package.Rd",
> encoding = "unknown", fragment = FALSE,  :
>   man/mpra-package.Rd:6: unknown macro '\packageTitle'
> Warning in parse_Rd("man/mpra-package.Rd", encoding = "unknown", fragment =
> FALSE,  :
>   man/mpra-package.Rd:9: unknown macro '\packageDescription'
> Warning in parse_Rd("man/mpra-package.Rd", encoding = "unknown", fragment =
> FALSE,  :
>   man/mpra-package.Rd:15: unknown macro '\packageAuthor'
> Warning in parse_Rd("man/mpra-package.Rd", encoding = "unknown", fragment =
> FALSE,  :
>   man/mpra-package.Rd:17: unknown macro '\packageMaintainer'
> Warning in parse_Rd("man/mpra-package.Rd", encoding = "unknown", fragment =
> FALSE,  :
>   man/mpra-package.Rd:24: unknown macro '\doi'

> It would appear that installed, system level macros are not read and used?

> Best,
> Kasper

>   [[alternative HTML version deleted]]

> __
> 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


Re: [Rd] R CMD Rd2pdf and macros

2017-10-04 Thread Kasper Daniel Hansen
No, I do not get the same as you.

I have tested with R-devel and R-patched compiled today.  When I do

R CMD Rd2pdf mpra

I get (as reported a few days ago)
  Hmm ... looks like a package
  Converting Rd files to LaTeX Error : mpra/man/mpra-package.Rd:6: file
'./DESCRIPTION' does not exist
whereas you (Kurt) reports that this works on zTree.

When I do
R CMD Rd2pdf mpra/man

I get
  - a pdf produced
  - warnings about missing macros

This is for a package with a
  PKGNAME-package.Rd
man page containing \packageDescription, \packageAuthor, \packageTitle,
\packageMaintainer, \doi

R-versions:

R version 3.4.2 Patched (2017-10-04 r73462) -- "Short Summer"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin16.7.0 (64-bit)

R Under development (unstable) (2017-10-04 r73461) -- "Unsuffered
Consequences"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin16.7.0 (64-bit)


On Wed, Oct 4, 2017 at 3:56 AM, Kurt Hornik  wrote:

> > Kasper Daniel Hansen writes:
>
> Interesting.  When I take e.g. zTree as the last CRAN package using the
> \packageTitle macro,
>
>R CMD Rd2pdf zTree
>
> seems to work fine, but
>
>R CMD Rd2pdf zTree/man
>
> gives
>
> Converting Rd files to LaTeX Warning in parse_Rd("zTree/man/zTree-package.Rd",
> encoding = "unknown",  :
>   zTree/man/zTree-package.Rd:6: unknown macro '\packageTitle'
> Warning in parse_Rd("zTree/man/zTree-package.Rd", encoding = "unknown",  :
>   zTree/man/zTree-package.Rd:9: unknown macro '\packageDescription'
> Warning in parse_Rd("zTree/man/zTree-package.Rd", encoding = "unknown",  :
>   zTree/man/zTree-package.Rd:13: unknown macro '\packageDESCRIPTION'
> Warning in parse_Rd("zTree/man/zTree-package.Rd", encoding = "unknown",  :
>   zTree/man/zTree-package.Rd:14: unknown macro '\packageIndices'
> Warning in parse_Rd("zTree/man/zTree-package.Rd", encoding = "unknown",  :
>   zTree/man/zTree-package.Rd:17: unknown macro '\packageAuthor'
> Warning in parse_Rd("zTree/man/zTree-package.Rd", encoding = "unknown",  :
>   zTree/man/zTree-package.Rd:18: unknown macro '\packageMaintainer'
>
> Same in your case?
>
> Best
> -k
>
>
> > When I run R CMD Rd2pdf on the man pages of a package, ie
> >   R CMD Rd2pdf man
>
> > I get
>
> > Converting Rd files to LaTeX Warning in parse_Rd("man/mpra-package.Rd",
> > encoding = "unknown", fragment = FALSE,  :
> >   man/mpra-package.Rd:6: unknown macro '\packageTitle'
> > Warning in parse_Rd("man/mpra-package.Rd", encoding = "unknown",
> fragment =
> > FALSE,  :
> >   man/mpra-package.Rd:9: unknown macro '\packageDescription'
> > Warning in parse_Rd("man/mpra-package.Rd", encoding = "unknown",
> fragment =
> > FALSE,  :
> >   man/mpra-package.Rd:15: unknown macro '\packageAuthor'
> > Warning in parse_Rd("man/mpra-package.Rd", encoding = "unknown",
> fragment =
> > FALSE,  :
> >   man/mpra-package.Rd:17: unknown macro '\packageMaintainer'
> > Warning in parse_Rd("man/mpra-package.Rd", encoding = "unknown",
> fragment =
> > FALSE,  :
> >   man/mpra-package.Rd:24: unknown macro '\doi'
>
> > It would appear that installed, system level macros are not read and
> used?
>
> > Best,
> > Kasper
>
> >   [[alternative HTML version deleted]]
>
> > __
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
>

[[alternative HTML version deleted]]

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


[Rd] packages: Examples with CPU or elapsed time > 10s

2017-10-04 Thread Michael Friendly
I am perplexed about NOTEs I get from Win Builder on my genridge 
package, https://github.com/friendly/genridge.

It shows, e.g.,

Examples with CPU or elapsed time > 10s
  user system elapsed
plot3d.ridge 12.4   0.05   12.45

However, if I run *exactly the same code* in my console with 
system.time(), I get

user system elapsed
0.95 0.16 1.17

What could be the explanation for this?

Second, the .log file from Win Builder shows only the *first example* 
with > 10s time.
I have been able to reduce the time by wrapping part of the example in 
\donttest{}.
I run Win Builder again, and the NOTE appears for another file. Very 
annoying.

It would be far more helpful to see these all together, rather than 
having to do this incrementally.
-Michael

-- Michael Friendly Email: friendly AT yorku DOT ca Professor, 
Psychology Dept. & Chair, Quantitative Methods York University Voice: 
416 736-2100 x66249 Fax: 416 736-5814 4700 Keele Street 
Web:http://www.datavis.ca Toronto, ONT M3J 1P3 CANADA

[[alternative HTML version deleted]]

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


Re: [Rd] socketSelect(..., timeout): non-integer timeouts in (0, 2) (?) equal infinite timeout on Linux - weird

2017-10-04 Thread Henrik Bengtsson
I'd like to follow up/bump the attention to this bug causing the
timeout to fail for socketSelect() on Unix.  It is still there in R
3.4.2 and R-devel.  I've identified the bug in the R source code - the
bug is due to floating-point precisions and comparison using >=.  See
PR17203 (https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17203)
for details and a patch.  I've just reverified that the patch still
solves the problem on trunk (SVN r73463).

Thanks,

/Henrik

On Sat, Oct 1, 2016 at 1:11 PM, Henrik Bengtsson
 wrote:
> There's something weird going on for certain non-integer values of
> argument 'timeout' to base::socketSelect().  For such values, there is
> no timeout and you effectively end up with an infinite timeout.   I
> can reproduce this on R 3.3.1 on Ubuntu 16.04 and RedHat 6.6, but not
> on Windows (via Linux Wine).
>
> # 1. In R master session
>> con <- socketConnection('localhost', port = 11001, server = TRUE, blocking = 
>> TRUE, open = 'a+b')
>
> # 2. In R servant session (connect to the above master socket)
>> con <- socketConnection('localhost', port = 11001, server = FALSE, blocking 
>> = TRUE, open = 'a+b')
>
> # 3. In R master session (check if there's something available on connection)
> # Wait at most 0 seconds
>> t <- system.time(r <- socketSelect(list(con), write = FALSE, timeout = 0)); 
>> print(t); print(r)
>user  system elapsed
>   0   0   0
> [1] FALSE
>
> # Wait at most 1 seconds
>> t <- system.time(r <- socketSelect(list(con), write = FALSE, timeout = 1)); 
>> print(t); print(r)
>user  system elapsed
>   0.000   0.000   1.002
> [1] FALSE
>
> # Wait at most 2 seconds
>> t <- system.time(r <- socketSelect(list(con), write = FALSE, timeout = 2)); 
>> print(t); print(r)
>user  system elapsed
>   0.000   0.000   2.002
> [1] FALSE
>
> # Wait at most 2.5 seconds
>> t <- system.time(r <- socketSelect(list(con), write = FALSE, timeout = 
>> 2.5)); print(t); print(r)
>user  system elapsed
>   0.000   0.000   2.502
> [1] FALSE
>
> # Wait at most 2.1 seconds
>> t <- system.time(r <- socketSelect(list(con), write = FALSE, timeout = 
>> 2.1)); print(t); print(r)
>user  system elapsed
>   0.000   0.000   2.101
> [1] FALSE
>
> However, here are some weird cases where the value of the 'timeout'
> argument is ignored:
>
> # Wait at most 1.9 seconds
>> t <- system.time(r <- socketSelect(list(con), write = FALSE, timeout = 
>> 1.9)); print(t); print(r)
> ^C   user  system elapsed
>   3.780  14.888  20.594
>
>> t <- system.time(r <- socketSelect(list(con), write = FALSE, timeout = 
>> 0.1)); print(t); print(r)
> ^C   user  system elapsed
>   2.596  11.208  13.907
> [1] FALSE
>
> Note how I had to signal a user interrupt (Ctrl-C) to exit
> socketSelect().  Also, not that it still works with the timeout values
> chosen above, e.g.
>
>> t <- system.time(r <- socketSelect(list(con), write = FALSE, timeout = 0)); 
>> print(t); print(r)
>user  system elapsed
>   0   0   0
> [1] FALSE
>> t <- system.time(r <- socketSelect(list(con), write = FALSE, timeout = 1)); 
>> print(t); print(r)
>user  system elapsed
>   0.000   0.000   1.001
> [1] FALSE
>
>> t <- system.time(r <- socketSelect(list(con), write = FALSE, timeout = 
>> 2.1)); print(t); print(r)
>user  system elapsed
>   0.000   0.000   2.103
> [1] FALSE
>
> It's almost as if there is something special with non-integer values
> in (0,2).  Not saying these are the only cases, but that's what I've
> observed by trial and error.  Weird.  The fact that it works on
> Windows, may suggest it is a Unix specific.  Anyway with macOS that
> wanna confirm?
>
> /Henrik
>
> Session information details:
>
> # Ubuntu 16.04
>> sessionInfo()
> R version 3.3.1 (2016-06-21)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 16.04.1 LTS
>
> 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
>
> # RedHat 6.6:
>> sessionInfo()
> R version 3.3.1 (2016-06-21)
> Platform: x86_64-pc-linux-gnu (64-bit)
>
> locale:
> [1] C
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] tools_3.3.1
>
> # Windows via Wine on Linux
>> sessionInfo()
> R version 3.3.1 (2016-06-21)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows XP x64 (build 2600) Service Pack 3
>
> locale:
> [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
> [3] LC_MONETARY=C LC_NUMERIC=C
> [5] LC_TIME=C
>
> attached base packages:
> [1] stats graphics  grDev