re, the first part of the
>'Subject' of this mailing list thread, "Possible Improvement",
>*has* become true after all --
>
>-- thanks to Henrik !
>
>Martin Maechler
>ETH Zurich
>
>
>
>> On Tue, Mar 13, 2018 at 9:21 AM, Doran, Harold <hdo...@air.org> wr
ork I was doing,
> > however, I wonder if there is a way such that sapply could avoid the
> > overhead of having to call the identical function to determine the
> > conditional path.
> >
> >
> >
> > From: William Dunlap [mailto:wdun...@tibco.com]
> > Se
m]
> Sent: Tuesday, March 13, 2018 12:14 PM
> To: Doran, Harold <hdo...@air.org>
> Cc: Martin Morgan <martin.mor...@roswellpark.org>; r-help@r-project.org
> Subject: Re: [R] Possible Improvement to sapply
>
> Could your code use vapply instead of sapply? vapply forces you
:martin.mor...@roswellpark.org]
> Sent: Tuesday, March 13, 2018 9:43 AM
> To: Doran, Harold <hdo...@air.org>; 'r-help@r-project.org' <
> r-help@r-project.org>
> Subject: Re: [R] Possible Improvement to sapply
>
>
>
> On 03/13/2018 09:23 AM, Doran, Harold wrote:
>
sday, March 13, 2018 12:11 PM
> To: Doran, Harold <hdo...@air.org>
> Cc: r-help@r-project.org
> Subject: Re: [R] Possible Improvement to sapply
> Wouldn't that change how simplify='array' is handled?
>> str(sapply(1:3, function(x)diag(x,5,2), simplify=&
, March 13, 2018 12:14 PM
To: Doran, Harold <hdo...@air.org>
Cc: Martin Morgan <martin.mor...@roswellpark.org>; r-help@r-project.org
Subject: Re: [R] Possible Improvement to sapply
Could your code use vapply instead of sapply? vapply forces you to declare the
type and dimensions
of
You’re right, it sure does. My suggestion causes it to fail when simplify =
‘array’
From: William Dunlap [mailto:wdun...@tibco.com]
Sent: Tuesday, March 13, 2018 12:11 PM
To: Doran, Harold <hdo...@air.org>
Cc: r-help@r-project.org
Subject: Re: [R] Possible Improvement to sapply
Wo
Wouldn't that change how simplify='array' is handled?
> str(sapply(1:3, function(x)diag(x,5,2), simplify="array"))
int [1:5, 1:2, 1:3] 1 0 0 0 0 0 1 0 0 0 ...
> str(sapply(1:3, function(x)diag(x,5,2), simplify=TRUE))
int [1:10, 1:3] 1 0 0 0 0 0 1 0 0 0 ...
> str(sapply(1:3,
.
-Original Message-
From: Martin Morgan [mailto:martin.mor...@roswellpark.org]
Sent: Tuesday, March 13, 2018 9:43 AM
To: Doran, Harold <hdo...@air.org>; 'r-help@r-project.org'
<r-help@r-project.org>
Subject: Re: [R] Possible Improvement to sapply
On 03/13/2018 09:23 AM, D
On 03/13/2018 09:23 AM, Doran, Harold wrote:
While working with sapply, the documentation states that the simplify argument will yield a vector,
matrix etc "when possible". I was curious how the code actually defined "as
possible" and see this within the function
if (!identical(simplify,
While working with sapply, the documentation states that the simplify argument
will yield a vector, matrix etc "when possible". I was curious how the code
actually defined "as possible" and see this within the function
if (!identical(simplify, FALSE) && length(answer))
This seems superfluous
11 matches
Mail list logo