installing e1071 in R on ubuntu interface - r

I am unable to install e1071 on my ubuntu machine.
I tried using:
sudo apt-get install r-cran-e1071
gives an error message:
Warning messages:
1: In open.connection(con, "r") :
unable to connect to 'cran.r-project.org' on port 80.
2: E: Unable to locate package r-cran-e1071
and
install.packages("e1071", dep = TRUE, type = "source")
gives an error message:
package ‘e1071’ is not available (for R version 2.15.2)
sessionInfo() gives:
R version 2.15.2 (2012-10-26)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_IN LC_NUMERIC=C LC_TIME=en_IN
[4] LC_COLLATE=en_IN LC_MONETARY=en_IN LC_MESSAGES=en_IN
[7] LC_PAPER=C LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_IN LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tcltk_2.15.2 tools_2.15.2

The package e1071 depends on package class. The package class depends on R (≥ 3.0.0). Hence, you should update to a more recent R version.

Like #SvenHohenstein already said, the package needs a different version of R. What you can do is get an old version of the package from its archives, but you'll probably have to install older versions of other packages. In addition, you'll have to build the old version of the package from source as no binary versions are archived. Simply updating to a new R version is much easier...

Related

Package ggvoronoi in latest R (4.2.1) in Ubuntu 20.04 LTS failing to install

I have been successfully using the package ggvoronoi even a few weeks ago in R (3+). Until then all of a sudden R started to tell me:
> library(ggvoronoi)
Error in library(ggvoronoi) : there is no package called ‘ggvoronoi’
Okay, then I tried to install the package, but then getting the following error:
> install.packages("ggvoronoi")
Installing package into ‘/home/pratikmullick/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘ggvoronoi’ is not available (for R version 3.6.3)
Finally I updated the R to 4.2.1. This is my sessionInfo()
> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_IN.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_IN.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_IN.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_IN.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.2.1 tools_4.2.1
But even then the problem with installing ggvoronoi did not solve:
> install.packages('ggvoronoi')
Installing package into ‘/home/pratikmullick/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘ggvoronoi’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Can anyone please help me?

R devtools unable to install - Ubuntu 20.04 - package or namespace load failed for ‘pkgload’

I am pretty desperate to install.packages("devtools").
However it allways fails with this error
Error: .onLoad failed in loadNamespace() for 'pkgload', details:
call: readRDS(nsInfoFilePath)
error: error reading from connection
Execution halted
ERROR: lazy loading failed for package ‘devtools’
* removing ‘/home/bjoern/R/x86_64-pc-linux-gnu-library/3.6/devtools’
Things I tried to fix this:
Add the dependencies = T argument
Following a suggestion by hadley wickham on github -> update rlang package
Try to run install.packages("pkgload") resulting in nearly exactly the same error (see below)
Completely removing R and reinstalling it
Additionally installing package following packages:
r-base-dev
r-cran-devtools
r-recommended
Updated all packages update.packages(ask = FALSE, checkBuilt = TRUE)
Error of install.packages("pkgload")
Error: package or namespace load failed for ‘pkgload’:
.onLoad failed in loadNamespace() for 'pkgload', details:
call: readRDS(nsInfoFilePath)
error: error reading from connection
Error: loading failed
Execution halted
ERROR: loading failed
I digged even deeper to the pkgload (which at least I hope is the only reason for the problem). I will check if manually (re)installing all imports and suggests from the CRAN page of pkgload does solve it.
Imports: desc, methods, pkgbuild, rlang, rprojroot, rstudioapi,
utils, withr Suggests: bitops, covr, Rcpp, testthat
My sessionInfo() output:
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=de_DE.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=de_DE.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.3 tools_3.6.3
I still refuse to belief that it is impossibe to install devtools on ubuntu20
However at this point I take any straw
Solution Edit:
In short what fixed the issue for me was installing testthat package before. Thanks to comment by rui-barradas
install.packages("testthat")
install.packages("pkgload")
install.packages("devtools")
I am also on Ubuntu 20.04 but running R 4.0.0.
When trying to install a package, if it depends on another that was installed prior to R 4.0.0 I get an error message and the installation fails. This happens even if I set dependencies = TRUE in the call to install.packages.
Example: The command was
install.packages('pkgload')
I omit the first output lines, saying that the file was downloaded. Then, the relevant part.
installing source package ‘pkgload’ ...
** package ‘rcmdcheck’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** byte-compile and prepare package for lazy loading Error: package ‘testthat’ was installed before R 4.0.0: please re-install it
Execution halted ERROR: lazy loading failed for package ‘pkgload’
removing ‘/usr/local/lib/R/site-library/pkgload’
restoring previous ‘/usr/local/lib/R/site-library/pkgload’ Warning in install.packages : installation of package ‘pkgload’ had
non-zero exit status The downloaded source packages are in
‘/tmp/RtmpVxpbs0/downloaded_packages’
Correct way.
The right way of installing package pkgload was to run the sequence
install.packages('testthat')
install.packages('pkgload')
and the problem was solved.
Note that with other packages, it already happened to see this be a recursive issue. Imagine that package testthat depended (which it does not) on another package installed prior to R 4.0.0.
Annoying but solvable.
sessionInfo()
#R version 4.0.0 (2020-04-24)
#Platform: x86_64-pc-linux-gnu (64-bit)
#Running under: Ubuntu 20.04 LTS
#
#Matrix products: default
#BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
#LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
#
#locale:
# [1] LC_CTYPE=pt_PT.UTF-8 LC_NUMERIC=C
#[3] LC_TIME=pt_PT.UTF-8 LC_COLLATE=pt_PT.UTF-8
# [5] LC_MONETARY=pt_PT.UTF-8 LC_MESSAGES=pt_PT.UTF-8
# [7] LC_PAPER=pt_PT.UTF-8 LC_NAME=C
# [9] LC_ADDRESS=C LC_TELEPHONE=C
#[11] LC_MEASUREMENT=pt_PT.UTF-8 LC_IDENTIFICATION=C
#
#attached base packages:
#[1] stats graphics grDevices utils datasets
#[6] methods base
#
#other attached packages:
#[1] rvest_0.3.5 xml2_1.3.2 data.table_1.12.8
#
#loaded via a namespace (and not attached):
I had the same problems, and the solution was, at least in my case, Ubuntu 20.04.1 LTS (Focal Fossa) + R 4.0.2:
First (from terminal), install:
Step 1: sudo apt-get update -y
Step 2: sudo apt-get install -y libxml2-dev
Then from RStudio (setRepositories first, and choose 8 repositories) and install both packages:
Install xml2 package
install devtools
And works for me.

Installing Quantstrat in a recently updated R in Fedora Linux

I have updated my Fedora Distribution recently, and R was updated too. I re installed most of the packages, but I couuldnt install blotter and quantstrat.
How can I solve this issue? Thank you!
The error I get is the following one:
install.packages("quantstrat", repos="http://R-Forge.R-project.org")
Warning in install.packages :
package ‘quantstrat’ is not available (for R version 3.4.0)
My sessioninfo is the folowing:
> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Fedora 25 (Twenty Five)
Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so
locale:
[1] LC_CTYPE=es_AR.UTF-8 LC_NUMERIC=C LC_TIME=es_AR.UTF-8 LC_COLLATE=es_AR.UTF-8
[5] LC_MONETARY=es_AR.UTF-8 LC_MESSAGES=es_AR.UTF-8 LC_PAPER=es_AR.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=es_AR.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.0 tools_3.4.0
Your problem likely isn't an issue related to Fedora linux. Install quantstrat from souce via github, where the latest code resides:
library(devtools) # need devtools to use install_github
install_github("braverock/quantstrat")
Thank you very much!! I have successfully intalled it! Both in my Fedora and in W10 notebook.
I installed a weeks ago. I had to wait for the new TS package to be available on cran, since blotter required it.
Thank you very much!

Parallel package is not available in R 3.3.1 (Ubuntu 14.04)

I'm doing some heavy work with my computer. I'd like R used the 4 processors . But, used one at a time. I think the parallel package can be useful, but is not available. What I can do?
When I try to install the following appears
> install.packages("parallel")
Installing package into ‘/home/hector/R/x86_64-pc-linux-gnu-library/3.3’
Warning in install.packages :
package ‘parallel’ is not available (for R version 3.3.1)
Warning in install.packages :
package ‘parallel’ is a base package, and should not be updated
Here is my sessionInfo:
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.4 LTS
locale:
[1] LC_CTYPE=es_CL.UTF-8 LC_NUMERIC=C LC_TIME=es_CL.UTF-8
[4] LC_COLLATE=es_CL.UTF-8 LC_MONETARY=es_CL.UTF-8 LC_MESSAGES=es_CL.UTF-8
[7] LC_PAPER=es_CL.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=es_CL.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.3.1
Some packages are coming with R as recommended packages, like parallel, compiler and mgcv. You don't need to install or update them; when you upgrade your R version, they will be upgraded, too, if new package release is available.
These packages are not loaded on R start-up; but you can get them immediately by
library(parallel)
library(compiler)
library(mgcv)
an so on.

Installation of R package `GeoXp` fails

I would like to install the package GeoXp, but R doesn't let me...see the error below...
>install.packages("GeoXp")
...
configure: using libpng dynamic linkage
checking for X... no
configure: error: X11 not found but required, configure aborted.
ERROR: configuration failed for package ‘rgl’
* removing ‘/home/****/R/x86_64-pc-linux-gnu-library/3.0/rgl’
Warning in install.packages :
installation of package ‘rgl’ had non-zero exit status
ERROR: dependency ‘rgl’ is not available for package ‘GeoXp’
* removing ‘/home/******/R/x86_64-pc-linux-gnu-library/3.0/GeoXp’
Warning in install.packages :
installation of package ‘GeoXp’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpAbblyJ/downloaded_packages’
> library("GeoXp")
Error in library("GeoXp") : there is no package called ‘GeoXp’
Well, there seems to be a problem with the dependencies...but installing rgl does not work either...
Here my session info:
> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=de_DE.UTF-8 LC_NUMERIC=C
LC_TIME=de_DE.UTF-8 LC_COLLATE=de_DE.UTF-8
LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=de_DE.UTF-8
[7] LC_PAPER=de_DE.UTF-8 LC_NAME=C
LC_ADDRESS=C LC_TELEPHONE=C
LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods
base
other attached packages:
[1] spacetime_1.1-3 sp_1.0-17
loaded via a namespace (and not attached):
[1] grid_3.0.2 intervals_0.15.0 lattice_0.20-29
tools_3.0.2 xts_0.9-7 zoo_1.7-11
What can I do?
GeoXp has a dependency on rgl, tries to install that first, but fails there. rgl needs to have the X11 development libraries, as well as the (open source) OpenGL development and run-time libraries (mesa). For Ubuntu, you need to install the system packages libgl1-mesa-dev and libglu1-mesa-dev first (with apt-get or sth similar), then install in R package rgl, then GeoXp.
I think the problem is that you have to install X library and gl
Ops, sorry #Pascal, I did not see your comment.

Resources