To ckeck which package version is loaded in R, you can use packageVersion() function.

The following method shows how you can do it with syntax.

Method: Use packageVersion() Function

packageVersion("Package_name")

The following example shows how to use packageVersion() function in R.

Using packageVersion() Function

Let’s see how we can use packageVersion() function to check version of package:

# Get version package
packageVersion("ggplot2")

Output:

[1] ‘3.4.4’

Here the output shows package version of ggplot2 package.