Since I've developed my R into 3.6.1, mailR package is not working anymore getting this error: there is no package called ‘R.utils’. Installing this package does not work either. Is there any way to fix it?
-
How did you update your R and your packages? If it can't find `R.utils`, you can just install it with `install.packages("R.utils")`. Not sure why this dependency wouldn't have been installed. – MrFlick Dec 11 '19 at 15:48
-
I already tried to install R.utils the same way you said but it has a problem with loading it. – Ali Sobhani Dec 12 '19 at 09:55
-
What exactly is the problem loading it? You need to be able to install all the dependencies for a given package before it will work. – MrFlick Dec 12 '19 at 14:02
1 Answers
The package mailR
depends on rJava
package.
"It’s a wrapper around Apache Commons Email, an email library built on top of the Java Mail API. Due to this, mailR has a dependency on the rJava package, a low-level interface to Java VM.", source.
Therefore, you need to install the package rJava
in order to use mailR
, and you need to have Java Runtime Environment on your operating system in order for rJava
to work properly. I recommend using either Oracle's or OpenJDK.
After you have these installed, you need to include both libraries:
library(rJava)
library(mailR)
Note that you might run into an error that says Error in library(mailR) : there is no package called ‘mailR’
even though you have it installed. In this case, restart your PC, run R Studio again and then include the library, and there should be no issues.

- 169
- 1
- 11