Re: [Rd] backquotes and term.labels

2018-03-05 Thread William Dunlap via R-devel
I believe this has to do terms() making "term.labels" (hence the dimnames of "factors") with deparse(), so that the backquotes are included for non-syntactic names. The backquotes are not in the column names of the input data.frame (nor model frame) so you get a mismatch when subscripting the data

[Rd] backquotes and term.labels

2018-03-05 Thread Therneau, Terry M., Ph.D. via R-devel
A user reported a problem with the survdiff function and the use of variables that contain a space.  Here is a simple example.  The same issue occurs in survfit for the same reason. lung2 <- lung names(lung2)[1] <- "in st"   # old name is inst survdiff(Surv(time, status) ~ `in st`, data=lung2) E

Re: [Rd] Unclosed parenthesis in grep.Rd

2018-03-05 Thread Duncan Murdoch
On 05/03/2018 11:48 AM, Etienne Sanchez wrote: 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",

Re: [Rd] model.frame strips class as promised, but fails to strip OBJECT in C

2018-03-05 Thread Joris Meys
Given the documentation in ?is.object and the info in R Internals section 1.1.2, I'd argue that this indeed a bug. Looking at https://github.com/wch/r-source/blob/trunk/src/library/stats/src/model.c (line 220 and following) the function copyMostAttribNoTs is called to copy the attributes lost afte

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$",

[Rd] model.frame strips class as promised, but fails to strip OBJECT in C

2018-03-05 Thread Michael Chirico
Full thread here: https://github.com/tidyverse/broom/issues/287 Reproducible example: is.object(freeny$y) # [1] TRUE attr(freeny$y, 'class') # [1] "ts" class(freeny$y) # [1] "ts" # ts attribute wiped by model.frame class(model.frame(y ~ ., data = freeny)$y) # [1] "numeric" attr(model.frame(y ~

Re: [Rd] Unclosed parenthesis in grep.Rd

2018-03-05 Thread 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