@yihui Maybe something like this? (Note that it works for the example but I haven't tested thoroughly)

```
needs_install <- function(pkg, compare, version) {
  if (length(find.package(pkg, quiet = TRUE)) == 0) return(TRUE)
  if (is.na(compare)) return(FALSE)
  do.call(compare, list(packageVersion(pkg), version))
}

# Example
deps <- parse_deps("httr (< 2.1),\nRCurl (>= 3)")

needed <- mapply(needs_install, deps$name, deps$compare, deps$version)
needed <- deps$name[needed]
```