can't install ks package in R - r

I tried to install package ks, using code
install.packages("ks-package")
library("MASS")
library("ks")
but got next error:
Warning message:
package ‘ks-package’ is not available (for R version 2.15.2).
After that I tried to use latest R version for this code, but again got error message:
Warning message:
package ‘ks-package’ is not available (for R version 3.0.2)
Please, help me to understand, why there is this error and how can I resolve it...

With the most recent version of R, this should have succeeded:
install.packages("ks", dependencies=TRUE)
library("ks")
If you were using version 2.15.x, then yyou should have the tools for installing from source and then this should have worked:
install.packages("ks", dependencies=TRUE, type="source")
library("ks")
There are some mirrors that maintain copies of binary versions of packages for some OS, but you did not provide the needed information for specific comment on that issue.

Related

Problem with using rclinicaltrials package

I wish to use a package called rclinicaltrials, on using install.packages(), I get the following message -
Warning in install.packages :
package ‘rclinicaltrials’ 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
And after installing, on using library(), I get the message -
Error in library(rclinicaltrials) :
there is no package called ‘rclinicaltrials’
Is there any way of using this package in my version of R? I am using R version 4.1.0 (2021-05-18). Or do I need to install an older version of R?
Thank you

Can't install package 'nutshell' from O'Reilly book 'R in a Nutshell' onto Mac

My first post in an early programming career - any help very welcome.
I am studying R, and using a book called R in Nutshell (O'Reilly). The book is supported by a package that was previously available on CRAN. The package on CRAN has been archived - it is still there though as nutshell_2.0.tar.gz.
I am running MacOS Catalina, R version 3.2.1.(after downgrading from 4.02 to try and solve this issue , without success), and RStudio version 1.3.1093.
When I try to install the package into R via RStudio I have this experience:
packageurl <- "https://cran.r-project.org/src/contrib/Archive/nutshell/nutshell_2.0.tar.gz
install.packages(packageurl,contriburl=NULL,type="source")
Warning in install.packages :
package ‘https://cran.r-project.org/src/contrib/Archive/nutshell/nutshell_2.0.tar.gz’ is not available (for R version 3.2.1)
I have a similar experience if I download the tar.gz file and try to import it directly under Tools/Install Packages.
I am able to install other packages on CRAN successfully.
Many thanks
Up front, I'm doing this on windows and not on macos, but the packages here have no compiled code so there should be few if any differences. Also, I tested on R-4.0.2; I don't think this will be a problem, because these packages appear to have been last-updated in 2012, so if they install on my 4.0.2, then they are likely to work on every version of R since then (including your 4+ year-old R-3.2).
download.file("https://cran.r-project.org/src/contrib/Archive/nutshell.audioscrobbler/nutshell.audioscrobbler_1.0.tar.gz", "nutshell.audioscrobbler_1.0.tar.gz")
download.file("https://cran.r-project.org/src/contrib/Archive/nutshell.bbdb/nutshell.bbdb_1.0.tar.gz", "nutshell.bbdb_1.0.tar.gz")
download.file("https://cran.r-project.org/src/contrib/Archive/nutshell/nutshell_2.0.tar.gz", "nutshell_2.0.tar.gz")
install.packages("nutshell.audioscrobbler_1.0.tar.gz", repos = NULL)
install.packages("nutshell.bbdb_1.0.tar.gz", repos = NULL)
install.packages("nutshell_2.0.tar.gz", repos = NULL)
I tried reproducing installation from archive. I got error that dependencies of this package are not available.
ERROR: dependencies 'nutshell.bbdb', 'nutshell.audioscrobbler' are not available for package 'nutshell'
* removing 'C:/Program Files/R/R-3.6.2/library/nutshell'
Warning in install.packages :
installation of package ‘D:/Profile/maszpa1/Desktop/nutshell_2.0.tar.gz’ had non-zero exit status
Did you get the same error? If yes, then did you try to install them and try again?
As per the accepted answer, the solution was to install the missing dependent packages first, then the Nutshell package.
I was then able to update to R4.02
audioscrobbler_1.0.tar.gz
nutshell.bbdb_1.0.tar.gz
nutshell_2.0.tar.gz

Unable to use Vegan Package on Mac OSX catalina

Is anyone able to help with the following error code or knows a different way to install the vegan package?
Tried both codes below... Need to do some MDS plots!
Code:
install.packages('vegan')
install.packages('vegan', dependencies=TRUE, repos='http://cran.rstudio.com/')
Error Message:
Warning in install.packages :
package ‘vegan’ is not available (for R version 3.3.2)"
You are simply using a (very!) old version of R. Update to the latest version and everything should work fine.

How to fix version problem when installing TTR

I'm new in R programming. Want a run little script for TTR package, but getting version error
Here is my code part
options(repos=(CRAN="https://CRAN.R-project.org/package=TTR"))
install.packages("https://CRAN.R-project.org/package=TTR")
and here is error I get
Warning: unable to access index for repository https://CRAN.R-project.org/package=TTR/src/contrib:
cannot open URL 'https://CRAN.R-project.org/package=TTR/src/contrib/PACKAGES'
Warning message: package 'https://CRAN.R-project.org/package=TTR' is not available (for R version 3.4.4)
Error in library(TTR) : there is no package called 'TTR'
but when I run TTR library from https://rdrr.io/snippets/ , it works well, and R version in the link is 3.4.4
How can I solve this problem?
EDIT: I see this question How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?, but can not find my solution
I tried it with your command, and i get the same error. But using the standard way with install.packages does the job.
You can install the package with:
install.packages('TTR', dependencies=TRUE, repos='http://cran.rstudio.com/')

Problems installing data.table for R

I'm trying to install data.table library for R, but I can't get it to work.I've tried using both CRAN and Bioconductor but I keep getting an error that the package is not available for R 3.2.2:
> biocLite('data.table')
BioC_mirror: http://bioconductor.org
Using Bioconductor version 3.1 (BiocInstaller 1.18.4), R version 3.2.2.
Installing package(s) ‘data.table’
Warning: unable to access index for repository
https://cran.rstudio.com/src/contrib
Warning: unable to access index for repository
https://cran.rstudio.com/src/contrib
Warning message:
package ‘datatable’ is not available (for R version 3.2.2)
> install.packages("data.table")
Warning: unable to access index for repository
https://cran.rstudio.com/src/contrib
Warning message:
package ‘data.table’ is not available (for R version 3.2.2)
I really have no clue what to do...very new to R.
I faced a similar issue trying to install data.table using RStudio (V 0.99.903) and R (latest version 3.3.1) on windows 8. I issued the command install.packages('data.table') but it failed. What worked for me was running the install.packages with R directly. It got installed properly.
When RStudio gives a popup to restart the session before package installation, we need to click "Yes". This refreshes RStudio's memory and at the same time, the dataframes in memory won't be lost. After this step, just use the following commands -
install.packages("data.table")
library(data.table)
and data.table is installed and loaded
I just had this problem. I realized that I hadn't restarted since re-installinging R. After restarting, the problem vanished.
I deleted the data.table folder created in my documents after installation then I went ahead to re-install the package and it worked.

Resources