I have got a below error when I try to use one of the R package “ggplot2”.
It says that there is no package called ggplot2 even though I installed the ggplot2 package in R.
Message from R when I install ggplot2 package,
The above message clearly explaining that the package is not installed on defined path, it has been downloaded on temporary directory. It means there was no proper installation happened in R. This was the reason for error in SQL Server.
Follow the below steps to sort out the issue,
Use “.libPaths” to define the library path before install a package in R.
> .libPaths (.libPaths()[2:3])
Package will be installed like below,
Now run the same SQL Script with R, this time it will be executed without an issue.