Aron Lindberg <aron.lindberg <at> 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 >
IIUC, you want the value of every list element that is named "sha" and that name will only apply to atomic objects. If so, this should do it. > input <- dget("/tmp/dpt") > shas <- unlist( input, use.names=FALSE )[ grepl( "sha", names(unlist(input)))] > input[[67]]$content[[1]]$sha [1] "58cf43ecdc1beb7e1043e9de612ecc817b090f15" > which(input[[67]]$content[[1]]$sha == shas ) [1] 194 HTH, Chuck ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.