Error in package: sp when starting RStudio - r

When starting RStudio the following message appears: Loading required package: sp. I try to install the sp package and the message appears:
Warning in install.packages :
package ‘sp’ is in use and will not be installed
That way, I can not install it. Also, because of this error, I'm having trouble calling the dplyr package. How do I fix this error?

Try this-
detach("package:sp", unload = TRUE)
install.packages("sp", dependencies=TRUE)

Related

Error: package or namespace load failed for ‘CGPfunctions’ [duplicate]

I am getting the following error when I am loading a few libraries in R:
library(forecast)
Error : object ‘f_eval’ is not exported by 'namespace:lazyeval'
In addition: Warning message:
package ‘forecast’ was built under R version 3.3.2
Error: package or namespace load failed for ‘forecast’
library(tsoutliers)
Error : object ‘f_eval’ is not exported by 'namespace:lazyeval'
In addition: Warning message:
package ‘tsoutliers’ was built under R version 3.3.2
Error: package or namespace load failed for ‘tsoutliers’
I have tried reinstalling the packages but it didn't help. Also, I was able to use the forecast package previously but I started facing this error post the installation of tsoutliers package.
How can I resolve this issue?
This should do the job for you:
install.packages('lazyeval')
In the future, try and provide a bit more about your system and install, using the output from:
sessionInfo()

Why do I get an error when I try to load ggplot2 in R?

When I run:
library("ggplot2")
I get the error below:
Error: package or namespace load failed for ‘ggplot2’:
object ‘enexprs’ is not exported by 'namespace:rlang'
In addition:
Warning message:
package ‘ggplot2’ was built under R version 3.4.4
Any idea how I can solve this issue?
Please install the latest version of rlang to solve this error.

R package installation error: no package called ‘org.Hs.eg.db’

I am trying to install this package http://bioconductor.org/packages/release/data/annotation/html/org.Hs.eg.db.html. When I try to load org.Hs.eg.db using library (org.Hs.eg.db) , gives me this
error: Error in library(org.Hs.eg.db) :
there is no package called ‘org.Hs.eg.db’
It says the packages are downloaded here:
The downloaded source packages are in
‘/tmp/Rtmpgy1ZJE/downloaded_packages’
What could be the reason for this?
If you run into this error nowadays you have to install the package using
BiocManager::install("org.Hs.eg.db")

RQuantLib OSX installation issue

followed the steps below to install QuantLib on OSX and it went smoothly:
http://quantlib.org/install/macosx.shtml
Then trying to install RQuantLib. First download the source, unzipped and executed the following command from Terminal, with the error messages below:
$ R CMD INSTALL RQuantLib
Loading required package: DBI
Loading required package: rJava
Error in .jfindClass(as.character(driverClass)[1]) : class not found
Calls: JDBC -> is.jnull -> .jfindClass
Execution halted
Tried directly in R, same issue:
> install.packages("RQuantLib")
Loading required package: DBI
Loading required package: rJava
Error in .jfindClass(as.character(driverClass)[1]) : class not found
Calls: JDBC -> is.jnull -> .jfindClass
Execution halted
Warning in install.packages :
installation of package ‘RQuantLib’ had non-zero exit status
Tried reinstalling RJDBC in R, no success either. Somehow I can't get this to work, and am stuck now.
Any help is highly appreciated, thanks.

Error when running library(ggplot2)

I just updated to R 2.11.1 and after installing ggplot2, I tried
library(ggplot2)
and got
Loading required package: proto
Loading required package: grid Loading
required package: reshape Loading
required package: plyr Loading
required package: digest Error in
eval(expr, envir, enclos) : could not
find function "proto" In addition:
Warning message: In library(package,
lib.loc = lib.loc, character.only =
TRUE, logical.return = TRUE, :
there is no package called 'proto'
Error : unable to load R code in
package 'ggplot2' Error:
package/namespace load failed for
'ggplot2'
Any help appreciated.
install.packages('ggplot2', dep = TRUE) would do the trick... install proto package
Open R shell and type following in it
install.packages('ggplot2', dep = TRUE)
then it will ask you to select the mirror, select closest one and it will install it and solve your problem.
Also have had troubles, when installing ggplots2, but here is a curious solution (tested on windows):
I installed via RStudio. Both from Tools->install packages and by typing install.packages("ggplots2", dep=T). It didn't work because it kept not installing the dependencies.
I then installed direct by R gui install.packages("ggplots2", dep=T) and everything went well.
I had the same problem and this did the trick.
Install the lazyeval package.
Then install ggplot2
Load the ggplot2 library and everything will hopefully work fine.
Steps
1.Go To -> Tools
2.Click -> Install Packages
3.In Packages Text Box Type ggplot2
Check the checkbox & install dependencies
And your good to go !

Resources