R: Error in install.packages : cannot open the connection
Rename the zip file RinSel Software
into Rindsel
. That's the name specified in the discription file.
Then, you can install the package in R
with the command
install.packages("C:/path/to/Rindsel.zip",repos=NULL,type="win.binary")
That works fine... at first (!!!).
Problem with the Rindsel
package is. It is quite old. It was build with R 2.13.1
. Therefore, if you want to load the library which would be the next step to use the package in R you will get the error:
Problems building package (Error: "package has been build before R-3.0.0")
My suggestion: Contact the authors of the package and ask them if they can either provide the source file that you can build the package by yourself or if they can bundle the Rindsel
package with a newer R version.
(Or you could try to hunt down an old R version and see if you can get the thing running with an old R... However, I would not seriously suggest to do that. It would probably result in conflicting dependencies with the other required packages...)
EDIT 15-02-2018: OP asked if one can build an R
package with sources that are presumeably the Rindsel
source files.
Yes, basically, you could do that. You would have to make a your own description and namespace file and put the source file in the R folder than invoke the command in R to build it....
But it's not neccessary with the script files provided by the link the OP posted.
OP, just run the scripts in R
! It's quite easy.
- Download the
zip-file
and extract it on your machine. - Go to that directory. The
R
command would be
setwd('path/to/your/directory')
- Than run the
R
script, e.g, theKNIndex.r
. It's simple:
source('KNIndex.r')
Then the script will run and produce some output / prompts.
Unable to install R packages for R 4.1
The issue was eventually solved by options(download.file.method="libcurl")
.
Following another suggested answer, I tried options(repos = "http://cran.rstudio.com/")
but got the below message:
Warning message:
In download.file(mirrors_csv_url, destfile = mirrors_csv, quiet = TRUE) :
InternetOpenUrl failed: 'ìÂs°þ$'
Then the answer to this question did the trick.
Rstudio unable to install 'psimetrica-R' package from Github
A github source repository is not an R package repository like CRAN -- so you cannot use install.packages()
.
Instead, use remotes::install_gihub()
as in
if (!requireNamespace("remotes", quietly=TRUE)) install.packages("remotes")
remotes::install_github("stmueller/psimetrica-R")
This will install remotes
if needed, and use it to install the desired package.
Or, at least, that would work in principle if psimetrica-R
was a regular R source package. Here it fails because of its layout:
> remotes::install_github("stmueller/psimetrica-R")
Error: Failed to install 'unknown package' from GitHub:
cannot open URL 'https://api.github.com/repos/stmueller/psimetrica-R/contents/DESCRIPTION?ref=HEAD'
>
So you could fork the repo and make it proper package first. At least open source lets you do that.
Related Topics
Plot a Jpg Image Using Base Graphics in R
Why Does Is.Vector() Return True for List
R Shiny Loop to Display Multiple Plots
Adding a Simple Lm Trend Line to a Ggplot Boxplot
How to Deploy Shiny App That Uses Local Data
Control Font Thickness Without Changing Font Size
Find Matches of a Vector of Strings in Another Vector of Strings
Using Variable Value as Column Name in Data.Frame or Cbind
Replace Na with Previous and Next Rows Mean in R
How to Use Tidyr to Fill in Completed Rows Within Each Value of a Grouping Variable
R Ggplot Ordering Bars in "Barplot-Like " Plot
Extract Date from Given String in R
R Sum Every K Columns in Matrix