How to install the fftw3 package of R in ubuntu 12.04? - r

I am trying to install the fftw3 package through R console
>install.packages("fftw")
After this command it is asking to select the cran mirror.I have selected the cran mirror then following error occurs:
Loading Tcl/Tk interface ... done
Warning: unable to access index for repository http://ftp.iitm.ac.in/cran/src/contrib
Warning messages:
1: In open.connection(con, "r") :
unable to connect to 'cran.r-project.org' on port 80.
2: In getDependencies(pkgs, dependencies, available, lib) :
package ‘fftw’ is not available (for R version 2.14.1)
And When I am trying for fftw3 then following error occurs:
> install.packages("fftw3")
Installing package(s) into ‘/root/R/x86_64-pc-linux-gnu-library/2.14’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://ftp.iitm.ac.in/cran/src/contrib
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘fftw3’ is not available (for R version 2.14.1)
Can anyone help me out of this?

As Paul said, that's probably not an R package. There is an R package that is a wrapper for the FFTW library, also called fftw, you should install that:
Link to CRAN page of fftw
In Ubuntu you have then still the system requirement to have a proper installed fftw library, that you probably can solve via
sudo apt-get install fftw3 fftw3-dev pkg-config

The website you linked talks about a C library, there is nothing about an R code package. You mistakenly assume that R can install any .tar.gz file as an R library. An R library has a very specific structure of files and directories, and the error you get is because the .tar.gz does not adhere to this structure.

Related

Problem with installing Rtools: cannot locate the file in PATH

I'm trying to download the package "Seurat" in R, the package is installed and it's now in my list of packages.
** testing if installed package keeps a record of temporary installation path
* DONE (patchwork)
The downloaded source packages are in
‘C:\Users\parnian\AppData\Local\Temp\RtmpAVgSd8\downloaded_packages’
But when I try to call it (library(Seurat)) I get the following error:
> library(Seurat)
Error: package or namespace load failed for ‘Seurat’:
object ‘wrap_plots’ is not exported by 'namespace:patchwork'
I read the similar questions and manually installed "patchwork":
> install.packages("patchwork")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/parnian/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
R also tells me to install Rtools whhich I have, but when I follow these commands:
> writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")
but when I want to verify that make can be found (Sys.which("make")), I get this:
> Sys.which("make")
make
""
Also the downloaded packages of Seurat are saved in a location that doesn't even exist in my computer! How is that possible?
How can I fix this? Is there something wrong with the address I write for the path?
Thank you

How can I install source R packages from a local CRAN and binary for its dependencies?

I have a package which I wrote that is deployed on a local CRAN. I built the tgz with R CMD build and deployed it to a local cran initialised with miniCRAN. Of course, this package is deployed by miniCRAN as source.
Now, in a packrat environment I have to install this package and its dependencies, but the dependencies come from CRAN. I do
> install.packages("mypackage", repos=c("file:///path/to/my/localCRAN", "https://mran.microsoft.com/snapshot/2018-08-01"), type="source")
However, this forces every package to build as source, and this fails because I don't have stuff to compile, say, dplyr or other stuff. I want to download the binaries for those.
If I issue instead
> install.packages("mypackage", repos=c("file:///path/to/my/localCRAN", "https://mran.microsoft.com/snapshot/2018-08-01"))
then install.packages tries to install also my package as binary and stops first with this error
Error in read.dcf(file = tmpf) : cannot open the connection
In addition: Warning message:
In read.dcf(file = tmpf) :
cannot open compressed file '/Users/username/my/localCRAN/bin/macosx/el-capitan/contrib/3.5/PACKAGES', probable reason 'No such file or directory'
So I created an empty PACKAGES file at that path, and now it fails with the following error
package ‘mypackage’ is available as a source package but not as a binary
Warning message:
package ‘mypackage’ is not available (as a binary package for R version 3.5.3)
How can I install my package as source, and its CRAN dependencies as binary?

Issue installing rJava on aix7.1.3

I have installed the 32bit version of R 3.1.1 on AIX 7.1.3
I am in the step of installing the rJava package from the R shell using the command: install.packages("rJava")
However, I am getting this error:
Warning: unable to access index for repository http://cran.utstat.utoronto.ca/src/contrib
Warning messages:
1: In open.connection(con, "r") : unable to resolve 'cran.r-project.org'
2: package 'rJava' is not available (for R version 3.1.1)
It seems that R is unable to connect to the internet to download the package.
I have tried several mirror sites.
Any idea how to resolve this issue in AIX?
Is there also an alternative option to install rJava manually not through the install.packages() R command?
You could try to compile the package with devtools:
install.packages('devtools')
devtools::install_github('s-u/rJava')
Make sure to have the correct javac in your path.

How do I install Aspell package/library in Windows?

I would like to install Aspell package in R in Windows but there is no binary file available of Aspell package.
Please suggest some way around.
Following is the message i get on trying to install it.
> install.packages("Aspell", repos = "http://www.omegahat.org/R")
Installing package into ‘C:/Users/admin/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
package ‘Aspell’ is available as a source package but not as a binary
Warning message:
package ‘Aspell’ is not available (for R version 3.0.1)
It is said: "There is currently no binary version for Windows. Send mail to me if you would like one."
From
http://www.omegahat.org/Aspell/

install.packages() in R

I am trying to install an R package from its source file. The package could be installed only on R.2.9.2. So I uninstall my new version of R, installed the mentioned version and tried to install package like this:
install.packages(pathToPackage, repos="NULL", type="source")
But I am receiving this error:
argument 'lib' is missing: using 'C:\Users\hora\Documents/R/win-library/2.9'
Warning: unable to access index for repository NULL/src/contrib
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘c://Users//hora//Downloads//affymicro.zip’ is not available
What is the solution? Thank you in advance.

Resources