Technically it only checks if a package version is different, not necessarily a higher version number.
is_newer_package(package, new_version)
package
R package
new_version
new version number