Displaying 19 results from an estimated 19 matches for "deparse1".
Did you mean:
deparse
2020 Apr 11
1
Long model specification causes aov() to abort with error
...of bug 15377: aov() calls deparse() on
the model specification. If the resulting string is too long, e.g. due
to long column names, deparse() performs line breaking and returns a
vector of strings, which aov() does not handle correctly.
The attached patch fixes this problem by making aov() call deparse1().
It also corrects an error in the documentation of deparse1().
Please CC me on replies as I am not subscribed to the mailing list.
With best regards,
Jan Hauffa
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: aov.diff
URL: <https://...
2008 Aug 07
1
dput function (PR#12112)
Full_Name: Juan Gea
Version: R version 2.6.2
OS: Fedora Core 6
Submission from: (NULL) (79.153.48.49)
Abort:
objeS <- matrix("AAA",1000000)
class(objeS)
outTxt <- textConnection("vaClob", open = "w", local = FALSE)
dput(objeS,outTxt)
close(outTxt)
R version 2.6.2 (2008-02-08)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN
2019 Jul 12
4
Unexpected behaviour when comparing (==) long quoted expressions
...d calls are deparsed to character
strings before comparison.
and in the source code that does the comparison [1] shows that It
deparses each language object and then only extracts the first element
from the resulting character vector:
|SET_STRING_ELT(tmp, 0, (iS) ? PRINTNAME(x) : STRING_ELT(deparse1(x, 0,
DEFAULTDEPARSE), 0)); |
Is this a fix that needs to happen within the |==| documentation? or an
actual bug with the operator?
For more context the original issue we had is here:
https://github.com/rstudio-education/grader/issues/28
Workaround:
You can get around this issue by using |al...
2001 Feb 17
4
Comments on R-1.2.1 builds (PR#851)
...--------------------------------------------------------
c89 -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -OPT:IEEE_NaN_inf=ON -g -c edit.c -o edit.o
cc-1185 c89: WARNING File = edit.c, Line = 109
An enumerated type is mixed with another type.
t = deparse1(x, 0);
^
------------------------------------------------------------------------
c89 -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -OPT:IEEE_NaN_inf=ON -g -c system.c -o system.o
cc-1185 c89: WARNING File = system.c, Line = 196
An...
2024 Feb 20
1
Bug in comparison of language objects?
I noticed the following odd behaviour today:
exprs <- expression( mean(a), mean(b), { a }, { b } )
exprs[[1]] == exprs[[2]]
#> [1] FALSE
exprs[[3]] == exprs[[4]]
#> [1] TRUE
Does it make sense to anyone that the argument passed to `mean` matters,
but the expression contained in braces doesn't?
Duncan Murdoch
1997 Sep 08
0
R-alpha: deparse bug
...ource code ($RHOME/src/main/deparse.c), I see that the
width.cutoff argument sets the static variable "cutoff". Although the
function do_deparse behaves correctly - overwriting cutoff with the
default value if not given a second argument - other R functions (such
as print and edit) call deparse1 which doesn't do this. Hence they use
the modified cutoff value.
A quick fix would be to get do_deparse to reset cutoff to the default
value after calling deparse1 but before returning.
Martyn
> #Use function trunc as an example
> #This normally prints on two lines
> trunc
function...
2002 Jun 12
1
identical calls are not equal !?
Can please someone familiar with the R internals enlighten me on the
following strange observation:
# this is IDENTICAL as expected
identical(substitute(substitute()), substitute(substitute()))
# but NOT EQUAL !????
substitute(substitute()) == substitute(substitute())
# I originally found it on
t2 <- function(e){
substitute(e)
}
t2(substitute(x==y, list(y=y)))[1]
# I would expect all
2024 Mar 14
1
Spurious warning in as.data.frame.factor()
...<factor>)`.
But there is no need to overwrite the generic, because S7 classes
should work with existing S3 generics:
foo <- new_class('foo', parent = class_double)
method(as.data.frame, foo) <- function(x) structure(
# this is probably not generally correct
list(x),
names = deparse1(substitute(x)),
row.names = seq_len(length(x)),
class = 'data.frame'
)
str(as.data.frame(foo(pi)))
# 'data.frame': 1 obs. of 1 variable:
# $ x: <foo> num 3.14
So I think that is nothing to break because S7 methods for
as.data.frame will rely on S3 for dispatch.
> &g...
2024 Mar 15
2
Spurious warning in as.data.frame.factor()
...generic, because S7 classes
> should work with existing S3 generics:
> foo <- new_class('foo', parent = class_double)
> method(as.data.frame, foo) <- function(x) structure(
> # this is probably not generally correct
> list(x),
> names = deparse1(substitute(x)),
> row.names = seq_len(length(x)),
> class = 'data.frame'
> )
> str(as.data.frame(foo(pi)))
> # 'data.frame': 1 obs. of 1 variable:
> # $ x: <foo> num 3.14
> So I think that is nothing to break because S7...
2024 Mar 15
1
Spurious warning in as.data.frame.factor()
...7 classes
>> should work with existing S3 generics:
>> foo <- new_class('foo', parent = class_double)
>> method(as.data.frame, foo) <- function(x) structure(
>> # this is probably not generally correct
>> list(x),
>> names = deparse1(substitute(x)),
>> row.names = seq_len(length(x)),
>> class = 'data.frame'
>> )
>> str(as.data.frame(foo(pi)))
>> # 'data.frame': 1 obs. of 1 variable:
>> # $ x: <foo> num 3.14
>> So I think that is not...
2023 Mar 01
1
tab-complete for non-syntactic names could attempt backtick-wrapping
Consider:
x <- list(`a b` = 1)
x$a<tab>
(i.e., press the 'tab' key after typing 'x$a')
The auto-complete mechanism will fill the buffer like so:
x$a b
This is not particularly helpful because this is now a syntax error.
It seems to me there's a simple fix -- in
utils:::specialCompletions(), we can wrap the result of
utils:::specialOpCompletionsHelper() with
2023 Mar 01
1
tab-complete for non-syntactic names could attempt backtick-wrapping
...d). Thankfully, \uXXXX-style Unicode escape
> sequences are not currently supported inside backticks, and "escape the
> backslash" rule already takes care of them.
>
> The deparse() function already knows these rules:
>
> name <- 'hello world ` \\uFF'
> cat(deparse1(as.name(name), backtick=TRUE), '\n')
> # `hello world \` \\uFF`
> `hello world \` \\uFF` <- 'hello'
> `hello world \` \\uFF`
> # [1] "hello"
>
> --
> Best regards,
> Ivan
2019 Jul 16
0
Unexpected behaviour when comparing (==) long quoted expressions
...; strings before comparison.
> and in the source code that does the comparison [1] shows that It
> deparses each language object and then only extracts the first element
> from the resulting character vector:
> |SET_STRING_ELT(tmp, 0, (iS) ? PRINTNAME(x) : STRING_ELT(deparse1(x, 0,
> DEFAULTDEPARSE), 0)); |
> Is this a fix that needs to happen within the |==| documentation? or an
> actual bug with the operator?
This a good question.
Thank you, Daniel, for providing the link to the source code in
<R>/src/main/relop.c .
Looking at that and...
2024 Mar 14
1
Spurious warning in as.data.frame.factor()
> ? Tue, 12 Mar 2024 12:33:17 -0700
> Herv? Pag?s <hpages.on.github at gmail.com> ?????:
> > The acrobatics that as.data.frame.factor() is going thru in order to
> > recognize a direct call don't play nice if as.data.frame() is an S4
> > generic:
> > ??? df <- as.data.frame(factor(11:12))
> >
> > ???
2023 Jul 06
0
Warning 'as.data.frame.POSIXct()' is deprecated
...39;:
>>
>> ## as.data.frame.POSIXlt
>> function (x, row.names = NULL, optional = FALSE, ...)
>> {
>> value <- as.data.frame.POSIXct(as.POSIXct(x), row.names,
>> optional, ...)
>> if (!optional)
>> names(value) <- deparse1(substitute(x))
>> value
>> }
>> <environment: namespace:base>
>>
>> Kind regards
>> Enrico
Indeed, thank you, Enrico!
That's another such case, that my "hack" (see above) overlooked;
somewhat embarrassingly, but also...
2023 Jun 02
2
bug in utils:::format.person
Dear all,
I think I found a bug in utils::format.person when using style = "R" with a
vector of comments. The comment section is not parsed properly. Please find
below the mwe and the session info.
Best regards,
Thierry
maintainer <- person(
given = "Thierry", family = "Onkelinx", role = c("aut", "cre"),
email = "thierry.onkelinx at
2020 Apr 24
0
R 4.0.0 is released
...ch.
* Printing methods(..) now uses a new format() method.
* sort.list(x) now works for non-atomic objects x and method =
"auto" (the default) or "radix" in cases order(x) works.
* Where they are available, writeBin() allows long vectors.
* New function deparse1() produces one string, wrapping deparse(),
to be used typically in deparse1(substitute(*)), e.g., to fix
PR#17671.
* wilcox.test() enhancements: In the (non-paired) two-sample case,
Inf values are treated as very large for robustness consistency.
If exact computations a...
2020 Apr 24
0
R 4.0.0 is released
...ch.
* Printing methods(..) now uses a new format() method.
* sort.list(x) now works for non-atomic objects x and method =
"auto" (the default) or "radix" in cases order(x) works.
* Where they are available, writeBin() allows long vectors.
* New function deparse1() produces one string, wrapping deparse(),
to be used typically in deparse1(substitute(*)), e.g., to fix
PR#17671.
* wilcox.test() enhancements: In the (non-paired) two-sample case,
Inf values are treated as very large for robustness consistency.
If exact computations a...
2020 Apr 24
0
R 4.0.0 is released
...ch.
* Printing methods(..) now uses a new format() method.
* sort.list(x) now works for non-atomic objects x and method =
"auto" (the default) or "radix" in cases order(x) works.
* Where they are available, writeBin() allows long vectors.
* New function deparse1() produces one string, wrapping deparse(),
to be used typically in deparse1(substitute(*)), e.g., to fix
PR#17671.
* wilcox.test() enhancements: In the (non-paired) two-sample case,
Inf values are treated as very large for robustness consistency.
If exact computations a...