Can't install TTR (tseries) R 3.3.3 (on debian stretch) - r

I'm unable to install the tseries package into R version 3.3.3 (on Debian debian stretch 4.9.0-6) because of its dependence on TTR. When I run the install, it tries to compile TTR, which leads to the error message
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/moi/R/x86_64-pc-linux-gnu-library/3.3/curl/libs/curl.so':
/usr/lib/x86_64-linux-gnu/libcurl.so.4:version `CURL_OPENSSL_4' not found (required by /home/moi/R/x86_64-pc-linux-gnu-library/3.3/curl/libs/curl.so)
I did try installing a binary version of TTR using
install.packages("TTR", repos="http://R-Forge.R-project.org")
But that yield the error message package ‘TTR’ is not available (for R version 3.3.3)
The problem appears to be related a request for CURL_OPEN_SSL_4 from the R library curl.so. Since I have libcurl.so.4 installed, I don't understand what the problem is.
I'd appreciate any thoughts on how to resolve this.
thanks

I happen to (also) maintain r-cran-ttr for Debian and here is what I have in my Build-Depends in file debian/control:
Build-Depends: debhelper (>= 7.0.0), r-base-dev (>= 3.4.3), cdbs, \
r-cran-xts (>= 0.10-0), r-cran-zoo, r-cran-curl
So it looks like your r-cran-curl package needs re-installing. You may have the libcurl.so as a run-time dependency (from one or more packages, this is commonly used library) but to compile you need the built-time dependency commonly supplied by the matching -dev package.
So maybe try installing sudo apt-get install libcurl4-openssl-dev, then install package curl from CRAN and once that is there, install TTR from CRAN or R-Forge (which is likely a source install anyway).

Related

error in library.dynam(lib, package, package.lib) shared ovject <library_name>.so not found

Using VirtualBox with Ubuntu 20LTS, and attempting to install and load R packages, getting the error:
error in library.dynam(lib, package, package.lib)
shared object <library_name>.so not found
Where <library_name> can be any of multiply libraries:
rlang
digest
fs
fansi
So the error looks like this:
error in library.dynam(lib, package, package.lib)
shared object digest.so not found
So far, uninstalled and reinstalled the packages with install.packages() and with sudo apt-get install r-cran-.
Currently cannot use devtools to install because it too fails to load with require(devtools) saying shared object fs.so (was) not found.
Please help
Please step back a second and start from the top with a clean installation of R. The do
sudo apt-get install r-cran-digest
and library(digest) will work. I do not recall if fs and fansi are available for 20.04 so you will have to come to terms with source installation but even that should be easy of you have r-base-dev installed.
Now, we generally strongly recommend you start from the README for Ubuntu at the CRAN repo and enable that repo. Then you get R 4.2.1. If you read the part on '5000+ CRAN Packages' you can equally easily get CRAN binaries for 5000+ packages, including fs and fansi as r-cran-* binaries from the c2d4u.team repo.
Better still, I now support a project I call r2u which has all of CRAN for Ubuntu 20.04 and 22.04. The installation is simple in five quick steps in a documented script (and detailed at the README of r2u. You then can do
install.packages(c("digest", "fs", "fansi"))
in R and get binaries in seconds as the gif below shows.

Dependencies 'dplyr','XML'not available for package <pkg>

I am creating an R package I have completed the R CMD Build and R CMD Check and removed all warnings. I am trying to install the <package>.tar.gz on another machine to see whether it goes through fine. But I get this error
> install.packages("cricketr_0.0.9.tar.gz",repos=NULL,type="SOURCE",dependency=TRUE)
ERROR: dependencies 'dplyr', 'plotrix', 'ggplot2', 'scatterplot3d', 'forecast', 'lubridate', 'XML' are not available for package 'cricketr'
Depends:
R (>= 2.15.0)
Imports:
dplyr,
plotrix,
ggplot2,
scatterplot3d,
forecast,
lubridate,
XML
URL: https://github.com/tvganesh/cricketr
While installing on a new system from the tarball should I manually install dependent packages since it will be available once the package is in CRAN?
Any help will be appreciated
In my experience, dependencies are met once you install from a distribution platform like CRAN or GitHub. Note also that in ?install.packages it says:
Not used if repos = NULL.

Problems installing ShortRead package in R -- can't install RCurl dependency

I'm working with Bioconductor and I would like to install the ShortRead package. i've tried many times but I come to an error installing the dependency package RCurl. I get this error in RStudio:
Cannot find curl-config
What shall I do? Is there an alternative to ShortRead?
Thanks ;)
What OS are you using?
sessionInfo ()?
is libcurl (probably you need the dev version) installed? RCurl links to libcurl. RCurl's CRAN page says:
SystemRequirements: libcurl (version 7.14.0 or higher) http://curl.haxx.se. On Linux systems, you will often have to explicitly install libcurl-devel to have the header files and the libcurl library.

Unable to install ggplot2 on Ubuntu 11.10

I am getting the following error when trying to install ggplot2:
> install.packages("ggplot2")
Installing package(s) into ‘/home/dodo/R/x86_64-pc-linux-gnu-library/2.13’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Loading Tcl/Tk interface ... done
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘ggplot2’ is not available (for R version 2.13.1)
I am running Ubuntu 11.10 (oneiric).
Any help is appreciated.
You need R (>= 2.14.0) for this version.
So please go and see the instructions at CRAN to upgrade on Ubuntu to the current R and once you have R 2.14.2 up and running (which is a matter of four or five commands, thanks to the magic of apt-get and friends, upgrade to the current ggplot2.
ggplot2-0.9.0 has an explicit dependency on R >= 2.14 (and an implicit one of R >= 2.14.1). Thus it can not be installed in R version 2.13.1. Perhaps you can get the previous version (0.8.9) from the archives and install that.
You need to install a version that is appropriate to your old version of R or you need to upgrade. To go the first route, you should find a version of ggplot2 in the Archives and then install from source (which is I believe the default for Linux). Perhaps try the UCLA CRAN mirror:
http://cran.stat.ucla.edu/src/contrib/Archive/ggplot2/ggplot2_0.8.9.tar.gz

Errors installing RForge version of xts package for R on OSX

The latest version of xts on CRAN is 0.7-5. But I'd like to try out the blotter package, for which xts >= 0.7.6.17 is required. To get this latest version, I first I downloaded the .tgz file from RForge and tried:
[Downloads]$ R CMD INSTALL xts_0.7-6.17.tgz
WARNING: ignoring environment value of R_HOME
* installing to library ‘/Library/Frameworks/R.framework/Resources/library’
* installing *binary* package ‘xts’ ...
* DONE (xts)
After launching R console, I typed require(xts) and got this:
> require(xts)
Loading required package: xts
Loading required package: zoo
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/Library/Frameworks/R.framework/Versions/2.12/Resources/library/xts/libs/x86_64/xts.so':
dlopen(/Library/Frameworks/R.framework/Versions/2.12/Resources/library/xts/libs/x86_64/xts.so, 6): Library not loaded: /usr/local/lib/libgfortran.2.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/2.12/Resources/library/xts/libs/x86_64/xts.so
Reason: image not found
In addition: Warning message:
package 'xts' was built under R version 2.12.2
I reverted to the CRAN version by downloading that file and running this again:
[Downloads]$ R CMD INSTALL xts_0.7-5.tgz
WARNING: ignoring environment value of R_HOME
* installing to library ‘/Library/Frameworks/R.framework/Resources/library’
* installing *binary* package ‘xts’ ...
* DONE (xts)
Opening R console and typing in require(xts):
> require(xts)
Loading required package: xts
Loading required package: zoo
>
All is well again, except I need to RForge version to get blotter installed.
NOTE: I'm running OS X (10.6.6)
UPDATE: all is NOT well. Now I can't get the CRAN xts version to load properly.
UPDATE #2: I got my old xts back by running install.packages("xts", repo="http://cran.r-project.org"). Actually, I ran it for "quantmod" and "TTR" as well because all manner of mysterious breaking was occurring.
UPDATE #3: Following Dirk's recommendation in comments below, I've attempted to compile from source on OS X and was met with
make: gfortran: No such file or directory
So after installing from the link at http://www.macresearch.org/xcode_gfortran_plugin_update, I'm now faced with a new error complaining about the -arch flag:
gfortran -arch i386 -fPIC -g -O2 -c period.max.f -o period.max.o
f951: error: unrecognized command line option "-arch"
UPDATE #4: I installed the wrong fortran compiler in UPDATE #3. Don't use that compiler for R packages.
If you are using R on the Mac OS X platform, then it's good to know the mechanics of installing from source, as Mac binaries are sometimes slow to make it to repositories. The R eco-system is Ubuntu and SVN. Someday it may morph to OS X and Git (we can hope, no?)
Before you start installing from source, you need to make sure you have Xcode installed.
http://developer.apple.com/technologies/tools/xcode.html
Then you need to have a fortran compiler, which doesn't come with Xcode. The good news is that there is a place devoted to fortran compilers on OS X for R users.
http://r.research.att.com/tools/
Once this is installed and configured properly, you need to get the cutting-edge version of xts from RForge from here: (Thanks Dirk)
http://r-forge.r-project.org/src/contrib/xts_0.7-6.17.tar.gz
Finally, simply run the following from command-line in terminal:
[Downloads]$ R CMD INSTALL xts_0.7-6.17.tar.gz
NOTE: tar.gz is the extension for source files while .tgz is the extension for Mac binaries.

Resources