Installing R package from BayesTree_0.3-1.tar on Windows - r

I have installed R and Rtools, and set the path to both, but when I use
R CMD INSTALL C:\transfer\BayesTree_0.3-1.tar
to install this package, I get
Warning: invalid package 'c:\transfer\BayesTree_0.3-1.tar'
Error: ERROR: No packages specified
Do I need to rebuild this as a .tar.gz, or is there another problem?
Many thanks.

Related

error: proj_api.h not found in standard or given locations

I'm trying to install tmap package on R and it requires lwgeom
But when it comes to install 'lwgeom' I get this error:
configure: error: proj_api.h not found in standard or given locations. ERROR: configuration failed for package ‘lwgeom’
I've tryed to install libproj-dev but I've already got it.
I've also installed rgdal package sucessfully but I still got this error
I run on R-studio on Linux Mint 19
how to fix it and install tmap?
Consider installing source from github https://github.com/r-spatial/lwgeom
Or wait for a new upcoming 0.2-4 version of lwgeom.
That error was fixed 2 days ago.
You may also install older version 0.2-2 which is correct.
Consider installing the lwgeom package directly, by using
install.packages("lwgeom", configure.args=c("--with-proj-include=/usr/local, --with-proj-lib=/usr/local"))
in your R console; of course using a proper path to your PROJ location (mine happens to live in /usr/local, but you will want to double check).

Error in installing gtools

I am fairly new to R. I have tried to google my question, and tried a few things, to no avail.
I am working on a MAC * High Sierra version 10.13.5
I am working with R * R version 3.5.0 (2018-04-23) -- "Joy in Playing"
I am unable to install the package "gtools", and I don't know what to do to make it work??
install.packages("gtools", type="source")
Warning: unable to access index for repository https://mirrors.sorengard.com/cran/src/contrib:
cannot open URL 'https://mirrors.sorengard.com/cran/src/contrib/PACKAGES'
Warning message:
package ‘gtools’ is not available (for R version 3.5.0)
I have also tried to install from a file saved on my computer, but this did not work either
library(gtools)
Error: package or namespace load failed for ‘gtools’:
package ‘gtools’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
You could try specifying a specific repository, for example:
install.packages("gtools", repos="https://cran.rstudio.com/")
Why are you using install from source? typically to install a package u only need to use the command
install.packages("gtools")
Then it will automatically ask u for a mirror to download from. It seems like "gtools" is available for R 3.5, so try to download it from another mirror and it should work.

Github gpusvcalibration package installation in R

I am trying to install a package called gpusvcalibration from Github.
library("devtools")
install_github("mfrdixon/gpusvcalibration")
And I get the following error:
Error: Command failed (1)
Anyone know what is going on?
Have you read the installation instructions from the repo and followed them?
Clone the repository and then
Modify the R_EXE and R_INCLUDE variables in the Makefile
R CMD build gpusvcalibration
R CMD check gpusvcalibration
R CMD install gpusvcalibration_0.0-1.tar.gz
install.packages('gpusvcalibration_0.0-1.tar.gz', repo=NULL)

Error when installing R package using Rstudio

I want to install http://cran.r-project.org/src/contrib/Archive/mecdf/ using RStudio but when I use
> install.packages('C:\\Users\\jandre\\Desktop\\mecdf_0.6.1.tar.gz', repos=NULL, type="source")
I get this error:
Installing package into ‘C:/Users/jandre/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Warning in install.packages :
running command '"C:/Program Files/R/R-3.1.1/bin/x64/R" CMD INSTALL -l "C:\Users\jandre\Documents\R\win-library\3.1" "C:/Users/jandre/Desktop/mecdf_0.6.1.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘C:/Users/jandre/Desktop/mecdf_0.6.1.tar.gz’ had non-zero exit status
This occurs in every package I want to install using the tar.gz file. I'm on Win7 x64. RStudio Version 0.98.1028
Can't think of a way to fix this at the moment -- sorry -- but the R administration manual says explicitly:
Note that installing R into a directory whose path contains spaces is not supported, and at least some aspects (such as installing source packages) will not work.
I don't know why this doesn't bite people much more often, given that C:/Program Files/... seems like a relatively normal place to install things on Windows.
I would also expect that the double quotation marks around your R executable name ("C:/Program Files/R/R-3.1.1/bin/x64/R") in the system call should have protected you from this problem ... ?
I had the same error message with the installation of some packages(under Windows 10 OS with R and Rstudio).
It seems that the R software (not R Studio) is dealing with the library where package are installed.
I uninstalled R and Rstudio and installed it a path without space (ex: C:\Program\R).I tried to load the packages that previously failed and it seemed to fix the problem.

install RMySQL for Mac

I get below error when I try to install Mysql package (MAC OS)
install.packages('RMySQL')
package ‘RMySQL’ is available as a source package but not as a binary
Warning in install.packages :
package ‘RMySQL’ is not available (for R version 3.1.0)
I am not sure what I need to set in order for this to work.
The author of RMySQL no longer provide binary packages, so you will have to build from source.
I have posted the complete solution in another thread: Installing RMySQL in mavericks.
Basically, in order for install.packages('RMySQL', type='source') to work correctly, what you are lacking are:
Make sure you have "gcc" available.
Install MySQL client somewhere, e.g., via Homebrew.
Configure and build RMySQL from source in RStudio or in Terminal:
Set the 2 environment variables PKG_CPPFLAGS and PKG_LIBS to indicate where the include and lib are.
Run install.packages('RMySQL', type='source') in RStudio or R CMD INSTALL RMySQL_x.x-x.tar.gz in Terminal
Installing from source worked well for me. For those who are new to R, the way to install from source is:
install.packages('RMySQL', type='source')

Resources