x <- list( a = list( b = list(c(d="A", e="B"), 1L, 1:3)))
locations <- findEntry(x, namePattern("e"))
locations
#This shows how the result can be used:
x[[locations[[1]]]]
expr <- paste0(c("x", names(locations[[1]])), collapse = "")
expr
eval(parse(text=expr))
findEntry(x, hasClass("integer"))
Run the code above in your browser using DataLab