[Rd] Rd parser throws error for user macros invoked with empty argument

2018-05-14 Thread Georgi Boshnakov
Bug or feature? I get the following error from parse_Rd() when a user Rd macro (including system ones) is invoked with empty argument {}, eg \mymacro{}: Error in tools::parse_Rd(fn) : Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'NULL' A full example is further below with the system ma

Re: [Rd] readLines() behaves differently for gzfile connection

2018-05-14 Thread Michael Lawrence
I haven't been able to reproduce the empty lines issue on my Mac or Linux laptop, but I have yet to try that container. The warning is because of a SEEK_SET to -1, which apparently is unsupported by zlib. Maybe the zlib version in that container is getting confused. I'm not sure why readLines() wa

Re: [Rd] access an element with empty name

2018-05-14 Thread Serguei Sokol
Le 14/05/2018 à 15:55, Kurt Hornik a écrit : Serguei Sokol writes: Hi, I came across a case where I cannot access a list element by its empty name. Minimal example can be constructed as     x=list("A", 1)     names(x)=c("a", "")     x[["a"]]     #[1]  "A"     x[[""]]     #NULL    

Re: [Rd] access an element with empty name

2018-05-14 Thread Kurt Hornik
> Serguei Sokol writes: > Hi, > I came across a case where I cannot access a list element by its empty name. > Minimal example can be constructed as >     x=list("A", 1) >     names(x)=c("a", "") >     x[["a"]] >     #[1]  "A" >     x[[""]] >     #NULL >     x$`a` >     #[1]  "A" >  

[Rd] access an element with empty name

2018-05-14 Thread Serguei Sokol
Hi, I came across a case where I cannot access a list element by its empty name. Minimal example can be constructed as     x=list("A", 1)     names(x)=c("a", "")     x[["a"]]     #[1]  "A"     x[[""]]     #NULL     x$`a`     #[1]  "A"     x$``     # Error: attempt to use zero-length variable nam