Cant install blotter package used for quantstrat - r

I'm trying to use the quantstrat package in R. I have uploaded/installed the package using
install.packages("quantstrat", repos="http://R-Forge.R-project.org")
However the once I use
require(quanstrat)
I get the message :
Loading required package: quantstrat
Failed with error: ‘package ‘blotter’ required by ‘quantstrat’ could not be found’
I then use
install.packages("blotter", repos="http://R-Forge.R-project.org")
but get the following message:
Package which is only available in source form, and may need compilation of C/C++/Fortran:
‘blotter’
These will not be installed
Can anyone offer some suggestion?

I am very late here, but perhaps relevant to note that "blotter" and "quantstrat" are not on CRAN, and several years ago moved to GitHub. The README on the repo (https://github.com/braverock/quantstrat) has more information for installing blotter and more importantly quantstrat.
install.packages("devtools") # if not installed
install.packages("FinancialInstrument") #if not installed
install.packages("PerformanceAnalytics") #if not installed
# next install blotter from GitHub
devtools::install_github("braverock/blotter")
# next install quantstrat from GitHub
devtools::install_github("braverock/quantstrat")

Related

R package bizdays cannot be installed

I have been using bizdays package for a long time and since I changed my window installation recently I had to install all of the packages for R. The only package that is not installed is bizdays. The documentations appear to show this package should be still on CRAN, but I cannot find it or install it. Is there any way to somehow install it back?
This is the error I am getting:
install.packages("bizdays")
Installing package into ‘C:/Users/me/OneDrive/Documents/R/win-library/3.6’ (as ‘lib’ is unspecified)
So it seems the package got installed, and when I try to use it this is the error thrown:
library(bizdays)
Error in library(bizdays) : there is no package called ‘bizdays’
You may need to update R to =>4.0
You can check with R.version.
Needing to update R is a fairly common cause of package install problems, as packages can use new R features. You will need to restart RStudio

How to install microbiomeSeq package?

I've been having a lot of trouble installing the package "microbiomeSeq" in Rstudio.
I keep getting errors like:
ERROR: dependency 'KMDA' is not available for package 'microbiomeSeq'
removing 'C:/Users/14142/AppData/Local/R/win-library/4.2/microbiomeSeq'
Warning message:
In i.p(...) :
installation of package ‘C:/Users/Public/Documents/Wondershare/CreatorTemp/Rtmpc7iXOi/file7643cdd730b/microbiomeSeq_0.1.tar.gz’ had non-zero exit status
library(microbiomeSeq)
Error in library(microbiomeSeq) :
there is no package called ‘microbiomeSeq’
The KMDA package has been archived from CRAN:
Archived on 2022-06-14 as check problems were not corrected despite reminders.
Perhaps the maintainers will resolve this and republish (perhaps unlikely since the package has not been updated since 2015), but until then you can install it from github. Note: all (I think) CRAN packages are mirrored in their basic form under https://github.com/cran. I say "basic" because it is not a clone of the original github repo (if it is even on github), it is just a repo that is generated from the source tarball of packages released on CRAN.
if (!"remotes" %in% installed.packages()[,1]) install.packages("remotes")
remotes::install_github("cran/KMDA")

Installing a Package Removed from CRAN

I am using the R programming language. I am trying to install the "Data Mining with R" (DMwR) package. However, when I visit the CRAN website for this package, it seems to be gone:
Package ‘DMwR’ was removed from the CRAN repository.
Formerly available versions can be obtained from the archive.
Archived on 2021-03-16 as check problems were not corrected despite reminders.
A summary of the most recent check results can be obtained from the check results archive.
I visited the Github page for this package
Then, I tried to install this package directly from Github:
> library(devtools)
Loading required package: usethis
Warning message:
package ‘usethis’ was built under R version 4.0.5
> install_github("Luis Torgo/DMwR")
Error: Failed to install 'unknown package' from GitHub:
JSON: EXPECTED value GOT <
But this also is not working. Can someone please show me how to install this package?
Besides installing from the CRAN mirror repo, another option is
remotes::install_version("DMwR", version="0.4.1")
for this method, you do have to look up the last version in the archive directory (would probably be scrapeable if you wanted to write the code)
as with remotes::install_github("cran/<package>"), you will be installing from source, which means that if the package or any of its dependencies have compiled components (in this case it doesn't appear so), you'll need to have development tools (compiler etc.) installed on your system
A quick word of caution:
this will work well if packages have been archived recently, and if the reason for archiving was because the CRAN maintainers are being fussy (that's their prerogative);
however, a package may have become incompatible with the rest of the current R ecosystem (R version, dependencies) since its last update - in which case you may find yourself in dependency hell trying to install it (or, worse, your results may be unreliable).
Had the same message on R 4.1.0
install.packages("DMwR")
Warning message:
package ‘DMwR’ is not available for this version of R
An option is also to create a checkpoint. According to the CRAN package website, it is archived on '2021-03-16'. So, we could use the checkpoint one day before that date
library(checkpoint)
checkpoint("2021-03-15")
install.packages("DMwR")
library(DMwR)
#Loading required package: lattice
#Loading required package: grid
#Registered S3 method overwritten by 'quantmod':
# method from
# as.zoo.data.frame zoo
The checkpoint can be deleted as well
delete_all_checkpoints()
You can install it from the CRAN github mirror (despite it being removed from CRAN), e.g.
library(devtools)
install_github("cran/DMwR")
That package was in support of a book published in 2010. The author published a second edition in 2017 and the current version of the support package is https://cran.r-project.org/web/packages/DMwR2/index.html
It does have currently CRAN-hosted source and binary packages, and doesn't need compilation, so it should be able to be installed with:
install.packages("DMwR2", dependencies=TRUE)
You can get the most recent version by following the directions at the Github site:
library(devtools) # You need to install this package!
install_github("ltorgo/DMwR2",ref="develop")
Those are much more likely to run properly with recent versions of R.

install quantstrat for R latest R version ()

I would like to install a package when using the latest R version in RStudio.
In particular the quantstrat package
Is that possible?
This is the R latest version I have 3.4.1
my error message:
Warning in install.packages :
package ‘quantstrat’ is not available (for R version 3.4.1)
Because quantstrat build-fail at R-Forge, you can't get the pre-build file(.tar.gz). You can get the code from github and build by yourself.
install.packages("devtools")
require(devtools)
install_github("braverock/blotter") # dependency
install_github("braverock/quantstrat")
Can you provide the installation code that produced that error message? Are you trying to install it from CRAN?
That doesn't appear possible.
A post from 2014 states it's not on CRAN
quantstrat is a R package ... still under heavy development and can’t be installed from CRAN yet. You can install it from source and the process is straightforward.
It's not on the current list of available CRAN packages
It's R-Forge page states the current version 'Failed to build'.
You could download the previous version (and its dependency) from R-Forge at
http://download.r-forge.r-project.org/bin/windows/contrib/3.2/quantstrat_0.9.1739.zip and
http://download.r-forge.r-project.org/bin/windows/contrib/3.2/blotter_0.9.1741.zip
(or get the Linux tar.gz files). Assuming they're saved in your personal Downloads folder, install it in R with
install.packages("~/Downloads/blotter_0.9.1741.zip", repos = NULL)
install.packages("~/Downloads/quantstrat_0.9.1739.zip", repos = NULL)
According to that first link, you'll need to install these prereqs first, if they're not already:
install.packages("FinancialInstrument")
install.packages("PerformanceAnalytics")
install.packages("foreach")
Edit: see the comment below from #brian-g-peterson for how the current deployment avenue uses GitHub. https://github.com/braverock/quantstrat

How to install the PROcess Packages which is a tar file in R?

I tried for installing the PROcess package by following way:
>install.packages("/home/R-Packages/PROcess.tar.gz",repos=NULL)
Then following error occurs:
ERROR: dependency ‘Icens’ is not available for package ‘PROcess’
Then I have tried to install the Icens packages:
>install.packages("Icens")
Then following error occurs:
package ‘Icens’ is not available (for R version 2.15.3)
So Can anyone help me out of this problem and suggest some way so that I can able to install the PROcess packages.
The Icens package has been moved from CRAN to another repository: Bioconductor. The Bioconductor page of Icens states that it can be installed using the following command:
source("http://bioconductor.org/biocLite.R")
biocLite("Icens")

Resources