Installing a package from a source?

I am trying to install an older version of the phylogenetic package "geiger" on R I am on a Windows XP computer. I tried the following construction:

 install.packages(C:\geiger_1.3-1.tar.gz, repos = NULL, type = "source") 

And every permutation that I can think of for her.

Does anyone have any ideas?

Edit: returned error:

 Error: unexpected input in "install.packages(C:\" 
+4
source share
3 answers

Should I not pass the file name as a string (or better yet w / file.path )? for example install.packages(file.path("geiger_1.3-1.tar.gz"), repos = NULL, type = "source") Remember that when installing packages you need to pass the line to which the libraries are loaded, you can pass a name without quotes (or a string).

Answering your comment here to be able to format

So you wrote install.packages(C:\Rfiles("geiger_1.3-1.tar.gz"), repos = NULL, type = "source") . Remember that the first argument to install.packages must be a character vector. What you went through is C:\Rfiles("geiger_1.3-1.tar.gz") , which is really nothing. Take a look at help(file.path) and help(install.packages) to see some examples of how to specify the path to the file. In this particular case, you should try:

 g.path <- file.path("C:", "Rfiles", "geiger_1.3-1.tar.gz") install.packages(g.path, repos = NULL, type = "source") 

This (as far as I can tell) is the absolute path to your package, without worrying about the backslash / redirect problem.

+5
source

Thanks so much for your suggestions. I finally solved this with another package: "repmis". This package includes a team called "InstallOldPackages" that does just that. You can specify the package name and version number that you need.

+2
source

On Windows, you usually need to switch the backslash \ to forwardslhes / or you get an error. I suspect:

 install.packages("C:/geiger_1.3-1.tar.gz", repos = NULL, type = "source") 

will work for you. This is probably the easiest way.

0
source

Source: https://habr.com/ru/post/1485137/


All Articles