Displaying 5 results from an estimated 5 matches for "deparse2".
Did you mean:
deparse
2018 May 01
2
issue with model.frame()
...idth cutoff arg here (around lines 57-58 of model.frame.default) is made larger:
> varnames <- sapply(vars, function(x) paste(deparse(x, width.cutoff = 500),
> collapse = " "))[-1L]
What version of R is that ? In current versions it is
varnames <- vapply(vars, deparse2, " ")[-1L]
and deparse2() is a slightly enhanced version of the above
function, again with 'width.cutoff = 500'
*BUT* if you read help(deparse) you will learn that 500 is the
upper bound allowed currently. (and yes, one could consider
increasing that as it has been unchanged...
2018 May 01
4
issue with model.frame()
A user sent me an example where coxph fails, and the root of the failure is a case where
names(mf) is not equal to the term.labels attribute of the formula -- the latter has an
extraneous newline. Here is an example that does not use the survival library.
# first create a data set with many long names
n <- 30? # number of rows for the dummy data set
vname <- vector("character",
2012 Nov 22
0
why does do_stop call R_GetTraceback ?
...he extra 41 seconds in R_GetTraceback() NEVER does
anything useful! Is this actually true, or does R_GetTraceback() have
some important side effect that I'm unaware of?
Thanks for your help!
(gdb) bt
#0 vector2buff (s=0xba73ed0, d=0x7fffa18d4a00)
at ../../../src/main/deparse.c:1298
#1 deparse2buff (s=0xba73ed0, d=0x7fffa18d4a00)
at ../../../src/main/deparse.c:1123
#2 0x00007ff28807034f in vec2buff (v=<value optimized out>, d=0x7fffa18d4a00)
at ../../../src/main/deparse.c:1402
#3 0x00007ff28806ea20 in deparse2buff (s=0xba734d0, d=0x7fffa18d4a00)
at ../../../src/main/de...
2018 Mar 08
1
Fwd: Re: [EXTERNAL] Re: backquotes and term.labels
>>>>> Ben Bolker <bbolker at gmail.com>
>>>>> on Thu, 8 Mar 2018 09:42:40 -0500 writes:
> Meant to respond to this but forgot.
> I didn't write a new terms() function -- I added an attribute to the
> terms() (a vector of the names
> of the constructed model matrix), thus preserving the information at
> the point when
2019 Aug 30
3
inconsistent handling of factor, character, and logical predictors in lm()
...--------- snip --------------
I believe that the culprit is .getXlevels(), which makes provision for factor and character predictors but not for logical predictors:
------------ snip --------------
> .getXlevels
function (Terms, m)
{
xvars <- vapply(attr(Terms, "variables"), deparse2,
"")[-1L]
if ((yvar <- attr(Terms, "response")) > 0)
xvars <- xvars[-yvar]
if (length(xvars)) {
xlev <- lapply(m[xvars], function(x) if (is.factor(x))
levels(x)
else if (is.character(x))
levels(as.fa...