How to find out which package version is loaded in R?

前端 未结 12 1623
没有蜡笔的小新
没有蜡笔的小新 2020-11-29 14:32

I am in a process of figuring out how to use my university cluster. It has 2 versions of R installed. System wide R 2.11 (Debian 6.0) and R 2.14.2 in non-standard location.

12条回答
  •  我在风中等你
    2020-11-29 14:58

    To check the version of R execute : R --version

    Or after you are in the R shell print the contents of version$version.string

    EDIT

    To check the version of installed packages do the following.

    After loading the library, you can execute sessionInfo ()

    But to know the list of all installed packages:

    packinfo <- installed.packages(fields = c("Package", "Version"))
    packinfo[,c("Package", "Version")]
    

    OR to extract a specific library version, once you have extracted the information using the installed.package function as above just use the name of the package in the first dimension of the matrix.

    packinfo["RANN",c("Package", "Version")]
    packinfo["graphics",c("Package", "Version")]
    

    The above will print the versions of the RANN library and the graphics library.

提交回复
热议问题