mufernando - 1 year ago 83

R Question

I have a list with ten elements and each of these is a list with 2 elements. This is part of what I get with str():

`> str(results)`

List of 10

$ :List of 2

I want to apply the function

Example

`results <- list(list(1, 2), list(3, 4), list(5, 6), list(4, 1), list(5, 1),`

list(5, 1), list(-1, 10), list(6, 0), list(0, 9), list(4, 4))

Answer Source

This might help:

```
min(sapply(results, `[[`, 2))
```

or equivalently:

```
min(sapply(results, function(x) { x[[2]] }))
```