Jiří,
For your first question, the NA names make sense if you think of indexing with
a character vector as the same as menu[match(select, names(menu))]. You're not
indexing with "beans"; rather, "beans" becomes NA because it's not in the names
of menu. (This is how it's documented in ?`[`:
Henrik,
I was able to reproduce this both with Rscript and interactively using the same
version of R you're using (fresh install) and Windows 10.0.22621.2715. It took
about a dozen tries.
Steve
Original Message
On Jan 6, 2024, 12:38, Henrik Bengtsson wrote:
> ISSUE: On MS
general
than I initially thought.
On Tue, 19 Dec 2023 at 11:25, Martin Maechler
wrote:
>
> >>>>> Steve Martin
> >>>>> on Mon, 18 Dec 2023 07:56:46 -0500 writes:
>
> > Does mFUN() really need to be a function of x and the NA values of x? I
>
scuss the above,
> > but it seems a good time to do so now.
> >
> > Martin
> >
> >
> >
> > >> barry
> > >>
> > >>
> > >> On Sun, Dec 17, 2023 at 2:17 PM Duncan Murdoch <
> murdoch.dun...@
osal wouldn't zap it to zero, and I don't
>> see why summary() would if it was using your proposal.
>>
>> Duncan Murdoch
>>
>> On 17/12/2023 8:43 a.m., Gregory R. Warnes wrote:
>> > Isn’t that the correct outcome? The user can change the number of digits
Zapping a vector of small numbers to zero would cause problems when
printing the results of summary(). For example, if
zapsmall(c(2.220446e-16, ..., 2.220446e-16)) == c(0, ..., 0) then
print(summary(2.220446e-16), digits = 7) would print
Min. 1st Qu. MedianMean 3rd Qu.Max.
0
This is due to `[` dropping dimensions by default. In your first
example, think of a[1, , ] as having dimension c(1, 3, 2), but,
because drop = TRUE, all dimensions of extent 1 (the first dimension)
are dropped and the result has dimension c(3, 2). In your second
example, b[1, , ] would have
That's an interesting example, as it's conceptually similar to what
Pavel is proposing, but structurally different. gsubfn() is more
complicated than a simple switch in the body of the function, and
wouldn't work well as an anonymous function.
Multiple dispatch can nicely encompass both of these
Hello,
Unsplitting a named vector that's been split sets all the names as missing.
x <- 1:12
names(x) <- letters[x]
f <- gl(2, 6)
unsplit(split(x, f), f)
123456789 10 11 12
The unsplit() function correctly deals with row names when
I don't think this is a bug in the documentation. The help page for
`?[.data.frame` has the following in the last paragraph of the
details:
Both [ and [[ extraction methods partially match row names. By default
neither partially match column names, but [[ will if exact = FALSE
(and with a warning
Hello,
All of the funprog functions except Position() use match.fun() early
in the body of the function. (Filter() seems to rely on lapply() for
this, but the effect is the same.) In most cases this isn't a problem,
but I can't see why Position() shouldn't look something like
Position2 <-
11 matches
Mail list logo