Displaying 20 results from an estimated 4000 matches similar to: "access an element with empty name"
2018 May 14
0
access an element with empty name
>>>>> Serguei Sokol writes:
> Hi,
> I came across a case where I cannot access a list element by its empty name.
> Minimal example can be constructed as
> ??? x=list("A", 1)
> ??? names(x)=c("a", "")
> ??? x[["a"]]
> ??? #[1]? "A"
> ??? x[[""]]
> ??? #NULL
> ??? x$`a`
> ??? #[1]?
2020 Feb 19
3
dimnames incoherence?
Hi,
I was bitten by a little incoherence in dimnames assignment or may be I
missed some point.
Here is the case. If I assign row names via dimnames(a)[[1]], when
nrow(a)=1 then an error is thrown. But if I do the same when nrow(a) > 1
it's OK. Is one of this case works unexpectedly? Both? Neither?
a=as.matrix(1)
dimnames(a)[[1]]="a" # error: 'dimnames' must be a list
2020 Feb 19
2
dimnames incoherence?
>>>>> Martin Maechler
>>>>> on Wed, 19 Feb 2020 18:06:57 +0100 writes:
>>>>> Serguei Sokol
>>>>> on Wed, 19 Feb 2020 15:21:21 +0100 writes:
>> Hi,
>> I was bitten by a little incoherence in dimnames assignment or may be I
>> missed some point.
>> Here is the case. If I assign row names
2020 Feb 19
0
dimnames incoherence?
>>>>> Serguei Sokol
>>>>> on Wed, 19 Feb 2020 15:21:21 +0100 writes:
> Hi,
> I was bitten by a little incoherence in dimnames assignment or may be I
> missed some point.
> Here is the case. If I assign row names via dimnames(a)[[1]], when
> nrow(a)=1 then an error is thrown. But if I do the same when nrow(a) > 1
>
2018 Jan 22
3
Inconsistent rank in qr()
Le 22/01/2018 ? 17:40, Keith O'Hara a ?crit?:
> This behavior is noted in the qr documentation, no?
>
> rank - the rank of x as computed by the decomposition(*): always full rank in the LAPACK case.
For a me a "full rank matrix" is a matrix the rank of which is indeed min(nrow(A), ncol(A))
but here the meaning of "always is full rank" is somewhat confusing. Does it
2020 Apr 16
6
suggestion: "." in [lsv]apply()
Hi,
I would like to make a suggestion for a small syntactic modification of
FUN argument in the family of functions [lsv]apply(). The idea is to
allow one-liner expressions without typing "function(item) {...}" to
surround them. The argument to the anonymous function is simply referred
as ".". Let take an example. With this new feature, the following call
2017 Jul 07
2
[New Patch] Fix disk corruption when writing
Le 07/07/2017 ? 01:09, Duncan Murdoch a ?crit :
> On 06/07/2017 6:44 PM, Sokol Serguei wrote:
>> Duncan Murdoch has written at Thu, 6 Jul 2017 13:58:10 -0400
>>> On 06/07/2017 5:21 AM, Serguei Sokol wrote:
>>>> I propose the following patch against the current
>>>> R-devel/src/main/connection.c (cf. attached file).
>>>> It gives (on my linux
2020 Apr 17
2
suggestion: "." in [lsv]apply()
Thanks Simon,
Now, I see better your argument.
Le 16/04/2020 ? 22:48, Simon Urbanek a ?crit?:
> ... I'm not arguing against the principle, I'm arguing about your
> particular proposal as it is inconsistent and not general.
This sounds promising for me. May be in a (new?) future, R core will
come with a correct proposal for this principle?
Meanwhile, to avoid substitute(),
2018 Jan 23
1
Inconsistent rank in qr()
Le 23/01/2018 ? 08:47, Martin Maechler a ?crit?:
>>>>>> Serguei Sokol <sokol at insa-toulouse.fr>
>>>>>> on Mon, 22 Jan 2018 17:57:47 +0100 writes:
> > Le 22/01/2018 ? 17:40, Keith O'Hara a ?crit?:
> >> This behavior is noted in the qr documentation, no?
> >>
> >> rank - the rank of x as
2017 Jul 07
1
[New Patch] Fix disk corruption when writing
Le 07/07/2017 ? 16:52, Duncan Murdoch a ?crit :
> On 07/07/2017 9:54 AM, Serguei Sokol wrote:
>> Le 07/07/2017 ? 01:09, Duncan Murdoch a ?crit :
>>> On 06/07/2017 6:44 PM, Sokol Serguei wrote:
>>>> Duncan Murdoch has written at Thu, 6 Jul 2017 13:58:10 -0400
>>>>> On 06/07/2017 5:21 AM, Serguei Sokol wrote:
>>>>>> I propose the
2020 Apr 16
2
suggestion: "." in [lsv]apply()
Simon,
Thanks for replying. In what follows I won't try to argue (I understood
that you find this a bad idea) but I would like to make clearer some of
your point for me (and may be for others).
Le 16/04/2020 ? 16:48, Simon Urbanek a ?crit?:
> Serguei,
>> On 17/04/2020, at 2:24 AM, Sokol Serguei <sokol at insa-toulouse.fr>
>> wrote: Hi, I would like to make a
2020 Apr 16
2
suggestion: "." in [lsv]apply()
I'm sure this exists elsewhere, but, as a trade-off, could you achieve
what you want with a separate helper function F(expr) that constructs
the function you want to pass to [lsv]apply()? Something that would
allow you to write:
sapply(split(mtcars, mtcars$cyl), F(summary(lm(mpg ~ wt,.))$r.squared))
Such an F() function would apply elsewhere too.
/Henrik
On Thu, Apr 16, 2020 at 9:30 AM
2017 Jul 07
2
[New Patch] Fix disk corruption when writing
Duncan Murdoch has written at Thu, 6 Jul 2017 13:58:10 -0400
> On 06/07/2017 5:21 AM, Serguei Sokol wrote:
>> I propose the following patch against the current
>> R-devel/src/main/connection.c (cf. attached file).
>> It gives (on my linux box):
>> > fc=file("/dev/full", "w")
>> > write.csv("a", file=fc)
>> Error in
2020 Apr 20
1
suggestion: "." in [lsv]apply()
Le 19/04/2020 ? 20:46, Gabor Grothendieck a ?crit?:
> You can get pretty close to that already using fn$ in the gsubfn package:
>> library(gsubfn) fn$sapply(split(mtcars, mtcars$cyl), x ~
>> summary(lm(mpg ~ wt, x))$r.squared)
> 4 6 8 0.5086326 0.4645102 0.4229655
Right, I thought about similar syntax but this implementation has
similar flaws pointed by Simon, i.e. it reduces
2018 Jan 22
2
Inconsistent rank in qr()
Hi,
I have noticed different rank values calculated by qr() depending on
LAPACK parameter. When it is FALSE (default) a true rank is estimated and returned.
Unfortunately, when LAPACK is set to TRUE, the min(nrow(A), ncol(A)) is returned
which is only occasionally a true rank.
Would not it be more consistent to replace the rank in the latter case by something
based on the following pseudo code ?
2017 May 15
3
stopifnot() does not stop at first non-TRUE argument
Le 15/05/2017 ? 15:37, Martin Maechler a ?crit :
>>>>>> Serguei Sokol <sokol at insa-toulouse.fr>
>>>>>> on Mon, 15 May 2017 13:14:34 +0200 writes:
> > I see in the archives that the attachment cannot pass.
> > So, here is the code:
>
> [....... MM: I needed to reformat etc to match closely to
> the current
2017 May 29
3
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
Here is an attached patch.
Best,
Serguei.
Le 29/05/2017 ? 12:21, Serguei Sokol a ?crit :
> The problem or actual R implementation relies on an assumption
> that median(x[i] | x[i] <= quantile(x, 1/3)) == quantile(x, 1/6)
> which reveals not to be true despite very trustful appearance.
>
> If we continue with the example of x=y=1:9
> then quantile(x, 1/6)=2.5 (here quantile()
2017 Jul 05
2
[New Patch] Fix disk corruption when writing
Le 05/07/2017 ? 13:09, Duncan Murdoch a ?crit :
> On 05/07/2017 5:26 AM, January W. wrote:
>> I tried the newest patch, but it does not seem to work for me (on
>> Linux). Despite the check in Rconn_printf, the write.csv happily writes
>> to /dev/full and does not report an error. When I added a printf("%d\n",
>> res); to the Rconn_printf() definition, I see
2017 Jul 06
2
[New Patch] Fix disk corruption when writing
I propose the following patch against the current R-devel/src/main/connection.c (cf. attached file).
It gives (on my linux box):
> fc=file("/dev/full", "w")
> write.csv("a", file=fc)
Error in writeLines(paste(col.names, collapse = sep), file, sep = eol) :
system call failure on writing
> close(fc)
Serguei.
Le 05/07/2017 ? 15:33, Serguei Sokol a ?crit
2017 May 15
4
stopifnot() does not stop at first non-TRUE argument
This is getting pretty convoluted.
The current behavior is consistent with the description at the top of
the help page -- it does not promise to stop evaluation once the first
non-TRUE is found. That seems OK to me -- if you want sequencing you
can use
stopifnot(A)
stopifnot(B)
or
stopifnot(A && B)
I could see an argument for a change that in the multiple argumetn
case reports _all_