Why am I unable to use some packages in Rstudio? - r

My Rstudio version is this
Running on R version 3.5.2 (64 bits). I need to use caTool for data analysis but I was unable to find and install the package.
Also, when I tried to install HH package, the console just writes
Error: package ‘latticeExtra’ required by ‘HH’ could not be found In addition: Warning message:package ‘HH’ was built under R version 3.5.3
Last one,
When I attempt to use DMwR package
Error: package or namespace load failed for ‘DMwR’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):there is no package called ‘caTools’In addition: Warning message:package ‘DMwR’ was built under R version 3.5.3
Does this mean caTool is like a dependency for DmwR? How do I fix these issues? I was told to downgrade my Rstudio Version but to which version of Rstudio?

Related

Loading ggplot2 throwing the Error: package or namespace load failed .... there is no package called ‘colorspace’

I'm trying to run a different package that's dependent on ggplot2. When I load ggplot2 it gives me the error:
library(ggplot2) Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘colorspace’
I tried to install colorspace and I got this lovely error:
install.packages("colorspace") ERROR: compilation failed for package ‘colorspace’ Warning in install.packages : installation of package ‘colorspace’ had non-zero exit status'
So I tried installing it after downloading it from http://cran.r-project.org/web/packages/colorspace/index.html.
And that still didn't work.
I've also tried closing everything down and reinstalling ggplot2.
I updated R to
`R version 4.0.5 (2021-03-31) -- "Shake and Throw"
this morning.
Are you in windows, Mac or Linux? For windows users it’s necessary to install Rtools which deals with installing packages from binary. Mac and Linux users should not have this issue.
I have had the same problem today updating my R from 3.6.1 to 4.1 and this worked for me:
install.packages("colorspace")
and when R asks
Do you want to install from sources the package which needs compilation? (Yes/no/cancel)
type no

Unable to update tm and NLP packages

I'm using macOS Sierra Version 10.12.6
I haven't used R-Studio for a long time, so I was prepared to run updates on both R Studio and the packages. My RStudio is Version 1.0.153, but it seems like there is no tm-package or NLP-package that is compatible? I get the following message:
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace ‘slam’ 0.1-32 is being loaded, but >= 0.1.37 is required
In addition: Warning message:
package ‘tm’ was built under R version 3.2.5
Error: package or namespace load failed for ‘tm’
and for NLP:
Warning message:
package ‘NLP’ was built under R version 3.2.5
At the risk of sounding obtuse, I wonder if I need to install new text mining packages. When I click Update inside RStudio, it tells me all packages are updated, so it seems as if these packages don't have a version beyond 3.2.5.

How to install package tm in R-3.3.0

I'm using R-3.3.3. I tried to install package tm using following commands
install.packages('tm',dependencies = TRUE)
library('tm')
But I'm getting error message
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘slam’
In addition: Warning message:
package ‘tm’ was built under R version 3.3.3
Error: package or namespace load failed for ‘tm’
I saw two solutions for same type of error here & dependency ‘slam’ is not available when installing TM package. I tried those two but I'm getting error message like
Installation failed: Could not find build tools necessary to build slam.
Kindly suggest me how to install tm package in R-3.3.3
I faced the same problem today, after testing many ways to solve it I could find the following command that can install the tm package, sorry I know it is very late but still useful.
require(devtools)
install_version("tm", version = "0.7-1", repos = "http://cran.us.r-project.org")

Error message when installing ggplot2

I have been trying to install ggplot2 but get the following error:
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace ‘scales’ 0.4.0 is being loaded, but >= 0.4.1 is required
ERROR: lazy loading failed for package ‘ggplot2’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/ggplot2’
Just so you know, I am using RStudio 1.0.136 and R 3.2.1 GUI Snow Leopard. Could it be a problem of compatibility with the old version of R that I am using? Does anyone know what the above means?
install.packages("scales")
install.packages("ggplot2")
will do the trick. Also try to keep your packages in R updated in the future, since R packages usually depend on the latest versions of other packages.
if you are on windows try :
install.packages("ggplot2", type="win.binary",dependencies = TRUE) else check the documentation in type and binary packages sections for the correct type according to your os :
https://www.rdocumentation.org/packages/utils/versions/3.5.2/topics/install.packages

Error Code with ggplot in R

I have uninstalled R and Rstudio. When I originally downloaded Rstudio the package was not listed in the packages section, so I downloaded and imported the zip file. There is no current version of R that is 3.3.0 that I can find-- my R version is 3.2.2. I have tried to install using the RGui as admin and I get the same error.
This is my error:
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck =
vI[[i]]) : there is no package called ‘gtable’ In addition: Warning
message: package ‘ggplot2’ was built under R version 3.3.0 Error:
package or namespace load failed for ‘ggplot2’
You are somehow executing R 3.3.0. No matter, though, you can simply invoke install.packages('ggplot2', repos='http://cran.rstudio.com', type='source') should sort you. If not, post a comment.

Resources