Problems installing data.table for R - 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.

Related

Unable to install semPLS package

I'm trying to install the semPLS package on my new MacBook but I get the error:
install.packages("semPLS")
Warning in install.packages :
package 'semPLS' 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
My RStudio is Version R Studio-2022.02.1 Build 461
I've also tried using the earlier version of R 0.99.486 but still have the same problem.
I've used this quite often in the past. It is only when I tried to install the package on my new laptop, that I can't.
I tried looking for the package on cran and cannot find it there. Any advice on how I can locate and install semPLS?
You can install it using the function install_github() from package "devtools"
install devtools:
install.packages("devtools")
library(devtools)
install semPLS:
install_github("cran/semPLS")

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/')

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.

can't install ks package in 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.

RSSA package in R for windows

I have used the Rssa package from cRAN in R using my mac computer and it install just fine. When I try to install it on my windows computer, it gives me this error
Warning in install.packages :
package ‘forecast’ is not available (for R version 3.0.1)
> install.packages("Rssa")
> library(Rssa)
Loading required package: forecast
Error: package ‘forecast’ could not be loaded
Does this mean the forecast dependency is not in the Rssa zip file in cran for windows? If so, is there a way around this or is it something else? I have tried googling this question but not much comes up for this package.
A recent 5.0 release of forecast package is only available for R (≥ 3.0.2). This package is listed in depends to Rssa, so you will have this problem under R 3.0.0 and 3.0.1.
Update your R, and everything will be fine. Another option in to manually install forecast, but that is not recommended.
I've contacted package maintainer, and he is working on either explicitly specify dependency on R (≥ 3.0.2) or moving forecast to suggests instead of depends. This issue will be resolved in the nearest future.

Resources