Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upHandle spaces in formula variables #80
Closed
Labels
Comments
This comment has been minimized.
This comment has been minimized.
Oops, it's back. > margins::margins(lm(mpg ~ `No of Cylinders`, data = mtcars))
Error in parse(text = x, keep.source = FALSE) :
<text>:1:5: unexpected symbol
1: ~No of
^
> traceback()
17: parse(text = x, keep.source = FALSE)
16: eval(parse(text = x, keep.source = FALSE)[[1L]])
15: formula(eval(parse(text = x, keep.source = FALSE)[[1L]]))
14: formula.character(object, env = baseenv())
13: formula(object, env = baseenv())
12: as.formula(new)
11: update.formula(~., paste0("~", x))
10: update(~., paste0("~", x))
9: all.vars(update(~., paste0("~", x)))
8: FUN(X[[i]], ...)
7: lapply(terms, function(x) all.vars(update(~., paste0("~", x))))
6: unlist(lapply(terms, function(x) all.vars(update(~., paste0("~",
x)))))
5: unique(unlist(lapply(terms, function(x) all.vars(update(~., paste0("~",
x))))))
4: clean_terms(names(classes)[!classes %in% c("factor", "ordered",
"logical")])
3: find_terms_in_model(model, variables = variables)
2: margins.lm(lm(mpg ~ `No of Cylinders`, data = mtcars))
1: margins::margins(lm(mpg ~ `No of Cylinders`, data = mtcars)) |
This comment has been minimized.
This comment has been minimized.
Fixed (?) again by e140fe9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
leeper commentedJan 9, 2018
margins()
chokes on formulae on variable names with spaces in formulae: