The elNamed(x, name) function can simplify this code a bit. The following
gives the same
result as David W's get_shas() for the sample dataset provided:
get_shas2 <- function (input) {
lapply(input, function(el) elNamed(elNamed(el, "content")[[1]],
"sha")[1])
}
Bill Dunlap
TIBCO Sof
On Feb 20, 2015, at 6:13 AM, Aron Lindberg wrote:
> Hmm…Chuck’s solution may actually be problematic because there are several
> entries which at the deepest level are called “sha”, but that should not be
> included, such as:
>
> input[[67]]$content[[1]]$commit$tree$sh
>
>
> and
>
> input[[
On Fri, 20 Feb 2015, Aron Lindberg wrote:
Hmm…Chuck’s solution may actually be problematic because there are several
entries which at the deepest level are called “sha”, but that should not be
included, such as:
input[[67]]$content[[1]]$commit$tree$sha
and
input[[67]]$content[[1]]
How can you expect a solution if you cannot specify the problem?
-- Bert
Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
Clifford Stoll
On Fri, Feb 20, 2015 at 6:13 AM, Aron Lindber
Hmm…Chuck’s solution may actually be problematic because there are several
entries which at the deepest level are called “sha”, but that should not be
included, such as:
input[[67]]$content[[1]]$commit$tree$sha
and
input[[67]]$content[[1]]$parents[[1]]$sha
it’s only the “sha” th
Thanks Chuck and Rolf.
While Rolf’s code also works on the dput that I actually gave you (a smaller
subset of the full dataset), it failed to work on the larger dataset, because
there are further exceptions:
input[[i]]$content[[1]] is sometimes a list, sometimes a character vector, and
Aron Lindberg case.edu> writes:
>
> Hi Everyone,
>
> I'm working on a thorny subsetting problem involving list of lists. I've put
> a
dput of the data here:
>
> https://gist.githubusercontent.com/aronlindberg/b916dee897d051ac5be5/
raw/a78cbf873a7e865c3173f943ff6309ea688c653b/dput
>
On 20/02/15 08:45, Aron Lindberg wrote:
Hi Everyone,
I'm working on a thorny subsetting problem involving list of lists.
If you think this is "thorny" you ain't seen nothin' yet!
But note that you've got a list of lists of lists ... i.e. the nesting
is at least 3 deep.
I've put a dput of
Hi Everyone,
I'm working on a thorny subsetting problem involving list of lists. I've put a
dput of the data here:
https://gist.githubusercontent.com/aronlindberg/b916dee897d051ac5be5/raw/a78cbf873a7e865c3173f943ff6309ea688c653b/dput
I can get one intense of the element I want this
9 matches
Mail list logo