Griliches( dataset) from Ecdat not compatiable with current version of R - r

I have been using the dataset Griliches for a project. Tried going back to project and this error appears
Warning in install.packages :
package ‘Griliches’ is not available (for R version 3.6.1)
A couple of weeks ago I updated all my packages, maybe this was the problem? I've tried deleting and downloading R again, also tried installing Griliches again.
I am new to R and finding this very confusing, also apologies if I didn't present my question properly.

I assume you mean the data set 'Griliches'? This can be found from library Ecdat. Maybe you are confusing data and library with each other?
install.packages('Ecdat')
library(Ecdat)
data('Griliches')
An alternative source for the same data is in Github. The Github version can be installed by:
install.packages('devtools')
devtools::install_github('lachlandeer/hayashir')
library(hayashir)
data(griliches)

Related

R studio install package failed

I tried to install the packages in the following way:
pacman::p_load(tidyverse, lubridate, zoo,
timetk, modeltime,
trelliscopejs, seasonal,
tsibble, feasts, fable)
However, I got the below errors:
I'm not sure what's wrong, I'm using the latest R version 4.2.1, the warning seems to suggest that need to change to 4.1.3, is there anyway to install those packages without changing the version?
The problem is not related to the package in itself. The warning about the version only tells you that the last time this package was built was on R 4.1.3, but it should work on R 4.2.
The problem is that the place where R searches this package doesn't exist. If you go here: https://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/, you will see that the last version of R is 3.4, whereas you're looking for a package built in R 4.1 (see the version in the URL address in the error message).
Here's some advice to solve this (I can't reproduce your problem so I can't be sure this works): if you're using RStudio, go to "Tools -> Global Options -> Packages". I think that under "Primary CRAN repository", there should be the name of the current place where R searches for the files to install each package. You can change this: either pick "Global (CDN) - RStudio" or any other that is not too far from your location. Then restart R and try reinstalling the packages.

Unable to install Peaks package: package ‘Peaks’ is not available for this version of R [duplicate]

This question already has answers here:
How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?
(18 answers)
Closed 12 months ago.
I am working with series data and want to count the number of local 'maxima' and 'minima' (i.e. peaks and troughs/oscillations) along each series. I want to use the 'Peaks' package for this but only get the following error:
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
Warning in install.packages :
package ‘Peaks’ 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
As suggested I installed rtools without any problems but it still returned the same error when I tried installing 'Peaks'. I have not found any information at the cran.r-project link and have also tried to install findpeaks but got the same error. I am not actually sure what version I am running on my desktop (how do you check?); but I have tried it also on Rstudiocloud, which I think is the latest version (4.1.2).I have also tried:
findPeaks(MaxMn, thresh=0)
findValleys(MaxMn, thresh=0)
but R couldn't find the function. I'm a little confused about whether it is a package or function and what I need to do to make it happen. Any suggestions would be greatly appreciated.
Peaks vignette: https://www.rdocumentation.org/packages/splus2R/versions/1.3-3/topics/peaks
After installing Rtools, you need to put it on the system PATH so that R can find it while trying to build a package from its source code. It's highly likely that in your case Rtools is installed but not on the system path.
You can find the latest details on the process of installing rtools, adding to path and verifying installation is correct from Rtools page (https://cran.r-project.org/bin/windows/Rtools/rtools40.html).
The package is no longer available on CRAN: "Archived on 2019-04-18 as check problems were not corrected despite reminders."
From googling "R detect peaks", it looks like there are a number of current packages you might be able to use, including pracma and peakPick. In addition to CRAN, this also feels like something the Bioconductor repository may have packages for.

Difficulty installing a package in R linux, dalton_rqi

Downloaded package from below URL.
Attempted to install using below command; response shown.
library(dalton.rqi,lib.loc='/home/X/Desktop/')
Error: package ‘dalton.rqi’ was built before R 3.0.0: please re-install it
https://my.clevelandclinic.org/departments/anesthesiology/depts/outcomes-research/risk-quantification
It appears this is a compiled package that maybe I don't have the source for? Is there a way to force install of the package? I'm unable to install using Rstudio GUI in its current form as a zip. Tried repackaging to tar.gz has Rstudio was looking for and also had a non-zero exit status error.
Any ideas?
I'm afraid this can't be achieved directly. The error message says it well: to use a package in R it needs to be built on an R version matching yours.
I can suggest two ways to move forward:
Contact the authors, ask for the R sources (it is somewhat surprising they did not make them available in the first place), and build the package yourself.
Downgrade your R version as far back as needed to match the one this pre-built package used.

R Studio 1.1.456 (Windows): Why do I sometimes have to install binary packages instead of installing from the source?

I am asking this question because I recently solved a problem installing R Shiny (see below). However, the answers I find don't expand in detail about why this problem occurs and I really want to understand to improve my knowledge of R and why these things happen.
So my attempt to install Shiny in RStudio failed and I believe these are the important error messages:
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'httpuv' 1.3.3 is being loaded, but >= 1.4.3 is required
ERROR: lazy loading failed for package 'shiny'
* removing 'C:/Program Files/R/R-3.2.2/library/shiny'
* restoring previous 'C:/Program Files/R/R-3.2.2/library/shiny'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.2.2\library" C:\Users\Sam\AppData\Local\Temp\RtmpuI3XHe/downloaded_packages/shiny_1.1.0.tar.gz' had status 1
Warning in install.packages :
installation of package ‘shiny’ had non-zero exit status
I went through the usual processes first to find a solution.
Checked my RStudio was up to date
Checked for and installed package updates
Among the further solutions I tried were:
Downloading the package directly from the R Studio interface
Using devtools to install Shiny from Github
Using install.packages("shiny", dependencies=TRUE).
None of these solutions worked and I believe it is to do with the dependency httpuv, but I'm not sure why.
So in the end the code I was able to use is: install.packages('shiny', type = "binary") and this allowed me to begin using Shiny.
While it wasn't too difficult for me to find a work around for this problem, I would really appreciate someone taking some time out of their day to explain why my version of RStudio in Windows (Version 1.1.456) doesn't support the source package of Shiny and why installing the binary package works. I hate fixing an issue but having zero understanding of it.
R version 3.2.2
Thank you.
Binary versus Source Code Options and Issue
You are experiencing the push-pull friction between the old and new code and R environment dependencies. The reality here is you have to choose between stability and progress. It is difficult to have both.
Consider:
You are running R version 3.2.2 in binary form, that R version was released on August 15th 2015. Yet, you are trying to install the latest source code version of Shiny.
There is a 3-year delta between the package source code version and R version you are using. The package code and R environment source code have evolved.
A lot of changes have occurred between then and now in the compile and source code environment.
Think of it this way.
The binary package image is a snapshot of the compile and source code environment assumptions at the time of compilation. If you download the current source code image you are using a snapshot of the current code environment (Now) which includes literally thousands of small incremental changes to the assumptions and dependencies in the source code files and compile environment. if you look in the shiny package description you note:
Shiny depends on httpuv which depends on Rcpp
httpuv is built on top of the libuv and http-parser C libraries.
To get httpuv to compile from source you'll need to match the R Environment, the dependent libraries and source dependencies manually. No small feat.
Case in point to compile the above packages from source code (github) you'll likely be using Devtools which if you download in binary form was compiled under R version 3.2.5.
The changes, assumptions and inter-dependencies make for a complex backport compile situation. Hence, the advantage of binary package snapshots.
Options:
In this situation, you generally have two options. You can either:
Download a source version that is old that matches your R version and environment.
The downside of this approach is you cannot access current package features.
The upside is that the package and R environment match historical context.
Upgrade to a current R environment
The downside of this approach is you have to roll with the R releases.
The upside is that you get to gain access to the latest package features made available in the current source code.
Solution Options:
How to do the above? In the first case, you might use devtools::install_git and pull the source for a particular branch or version of a package and compile it. In the second, you can upgrade your environment, and then pull and upgrade your packages.
If you want to work off a particular R environment version you have to use the binary versions. Why? These will match the R environment version coding environment assumptions.
This is a classic problem highlighting the push-pull between current code and old code. You have to choose between stability and progress. It is difficult to have both.
I hope the above helps explain the situation.

Is RDCOMClient still available?

I have spent the past several days trying to install RDCOMClient in order to integrate R output in MS Word using R2wd
Thanks to SO, I was finally able to wrestle devtools and other required packages into shape (man, that was way more difficult than it should have been!) but I have not been able to install RDCOMClient
The closest I have come is downloading RDCOMClient_0.93-0.zip and then receiving the error message
"Error: package ‘RDCOMClient’ was built before R 3.0.0: please
re-install it"
I also received the message
"package ‘RDCOMClient’ is not available (for R version 3.4.0)"
at one point.
I have tried the omegahat site as well as github and CRAN with no luck.
I am beginning to think the package is no longer available (I wish I had known that days ago!) but still wonder if I am missing something.
If the package is no longer available for version 3.4.0, can you suggest another package with similar functionality? I am looking to write analyses in MS Word and then embed tables, charts and other output from R.
Thanks!
Yes it is. You need to install Rtools first.
Then you can install RDCOMClient via:
remotes::install_github("omegahat/RDCOMClient")

Resources