Displaying 3 results from an estimated 3 matches for "lapply1".
Did you mean:
lapply
2011 Jul 30
2
Applying ifelse() on different functions
Dear all, I am looking for some procedure to apply 'ifelse' condition on function. I have created an alternative to lapply() function with exactly same set of arguments named lapply1(), however with different internal codes.
Therefore I want something like, if (some condition) then call lapply1() otherwise lapply() function. Ofcourse I can create a complete if()... else()... like of coding however wondering something may be better available because the arguments are all common...
2010 Sep 21
2
lapply version with [ subseting - a suggestion
...ames:
lapply(names(x), ... [i]),
lapply(seq_along(x), ... x[[i]] ... names(x)[i] ), or
for(i in seq_along(x)) ...
which is rather inconvenient.
How about an argument to lapply which would specify the [ or [[ subseting to use
in the splitting of the vector?
Or may be a different set of functions lapply1,
sapply1?
I believe this pattern is rather common for other users as well.
Thanks.
VS.
2013 Jan 05
2
lapply (and friends) with data.frames are slow
Hey guys,
I noticed something curious in the lapply call. I'll copy+paste the
function call here because it's short enough:
lapply <- function (X, FUN, ...)
{
FUN <- match.fun(FUN)
if (!is.vector(X) || is.object(X))
X <- as.list(X)
.Internal(lapply(X, FUN))
}
Notice that lapply coerces X to a list if the !is.vector || is.object(X)
check passes.
Curiously,