For security reasons I am forced to de-install Java (JRE) on a machine I am using with R.
How can I (easily :-) discover all installed packages that use Java?
Edit 14.12.2021: The log4j-log4shell-cve-2021-44228-vulnerability makes this question (and answers) even more interesting ;-)
To see what packages are installed, use the installed. packages() command. This will return a matrix with a row for each package that has been installed.
It looks like the answer is yes. If you go to a package's canonical page on CRAN, its SystemRequirements: should be listed. Since Java (>= 7.0) is on there, it's required for the package to work. Yes, you need to install java the install 'rJava' from R studio, then install 'tabulizerjars' !
Besides finding the DESCRIPTION files such as cran.r-project.org or stat.ethz.ch, you can also access the description file inside R with the command packageDescription("package") , via the documentation of the package help(package = "package") , or online in the repository of the package.
R packages have dependency packages that must be installed and loaded in order for the desired package to be used. Check out my sample R code below to print all dependencies for a certain package and install all of them.
To install an R package from CRAN, we can use the install.packages () function: Here, we’ve installed the readr R package used for reading data from the files of different types: comma-separated values (CSV), tab-separated values (TSV), fixed-width files, etc. Make sure that the name of the package is in quotation marks.
We can audit the installed R packages for security vulnerabilities via the command Which produces the output As the output suggests, this function performs a few steps: Calls installed.packages () to determine the installed packages on your machine. Although there are warnings about this taking a little while, I’ve never had any issues.
R is a powerhouse programming language with many data science applications. But before we can put its packages to work, we need to install them. Here’s how. R is a programming language for statistical computing, especially efficient for performing data science tasks.
You can use installed.packages
to determine which packages import the rJava
package. You need to tell installed.packages
to include the Imports
field from the package description, and then check which packages import rJava
.
LIBS = installed.packages(fields=c("Imports"))
JPacks = grep("Java", LIBS[,"Imports"], ignore.case=TRUE)
LIBS[JPacks, c("Package", "Imports")]
Package
RWeka "RWeka"
RWekajars "RWekajars"
Imports
RWeka "RWekajars (>= 3.9.0), rJava (>= 0.6-3), graphics, stats,\nutils, grid"
RWekajars "rJava (>= 0.6-3)"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With