Skip to content

Commit

Permalink
Fix logic in check_suggested
Browse files Browse the repository at this point in the history
Previously this was throwing an error if the package wasn't installed. cc @jimhester
  • Loading branch information
hadley committed Jun 17, 2016
1 parent b03fdda commit aaa4b61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/utils.r
Expand Up @@ -60,9 +60,9 @@ check_suggested <- function(pkg, version = NULL, compare = NA) {
compare <- dep$compare
}

if (!check_dep_version(pkg, version, compare)) {
if (!is_installed(pkg) || !check_dep_version(pkg, version, compare)) {
msg <- paste0(sQuote(pkg),
if (version == 0) "" else paste0(" >= ", version),
if (is.na(version)) "" else paste0(" >= ", version),
" must be installed for this functionality.")

if (interactive()) {
Expand Down

0 comments on commit aaa4b61

Please sign in to comment.