Re: [Rd] Unclosed parenthesis in grep.Rd

2018-03-05 Thread Etienne Sanchez
There are probably more unmatched parentheses around:

detect <- function(file) {
  text <- paste(readLines(file), collapse = "")
  nchar(gsub("[^(]", "", text)) != nchar(gsub("[^)]", "", text))
}

docs <- list.files("r-source-trunk/src/library",
   pattern = "\\.Rd$",
   full.names = TRUE,
   recursive = TRUE)

suspicious <- docs[sapply(docs, detect)]

length(suspicious)
# [1] 114


2018-03-05 9:27 GMT+01:00 Martin Maechler :
>
> > Hugh Parsonage 
> > on Mon, 5 Mar 2018 13:39:24 +1100 writes:
>
> > Lines 129-131: \code{grep(value = FALSE)} returns a vector
> > of the indices of the elements of \code{x} that yielded a
> > match (or not, for \code{invert = TRUE}. This will be an
> > integer vector unless the input
>
> > There should be a closing parenthesis after \code{invert =
> > TRUE}
>
> Thank you, Hugh!  I've added the ')' now.
> Martin
>
> __
> 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


[Rd] str() not displaying names

2017-11-14 Thread Etienne Sanchez
In some cases, str() does not print the "names" attribute of the object:

u <- structure(c(5, 6), names = c("a", "b"), color = "blue")
str(u)
#  atomic [1:2] 5 6
#  - attr(*, "color")= chr "blue"

Is it a bug or a design choice?

Originally asked here:
https://stackoverflow.com/q/47185756/6656269

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


[Rd] Possible bug with a regex pattern

2017-11-04 Thread Etienne Sanchez
Dear list,

The following behaviour looks like a bug:

grepl("ab{,2}c", "abbbc")
# [1] TRUE

I would expect either FALSE or an "invalid regex" error.

More details can be found in the question I originally asked here:
https://stackoverflow.com/q/4664/6656269

I've also opened an issue on the TRE github:
https://github.com/laurikari/tre/issues/62


Best,

Etienne

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