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