there is no package called '{pkg}' In call: find.package(pkgname, lib.loc = lib.loc)