Forzar install.packages()
Frecuentes
Visto 8,856 veces
7
Is it possible to install a package in R forcefully ?
> install.packages("gsubfn")
Installing package(s) into ‘/home/sebastian/R/x86_64-unknown-linux-gnu-library/2.14’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Loading Tcl/Tk interface ... done
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘gsubfn’ is not available (for R version 2.14.2)
In this case the package requires R >= 2.15 and I only have R 2.14.2 . Wondering whether I can do a force install .
1 Respuestas
4
Download the package from the source. Unzip it, and move the folder to the library (~/R/2.14/Library).
Go to your IDE and do a library(<package_name>)
This may or may not work properly and you are most likely to get a similar warning message saying that package <name> was built under R 2.14
. Ignore it. Most of the functions should work. Be warned, however, there may be some functions which spew funny output, or none at all, as they might be using some features which are not in R 2.14.
You could, however, update your R version. That, IMO, is the best way to go.
Respondido el 07 de enero de 13 a las 12:01
Moving an unzipped version of the package source directly into the library is not the correct way to install a package. That is what R CMD INSTALL
is for. However, as other comments have noted, the restrictions in the DESCRIPTION file would have to be changed and likely something somewhere will break. - Brian Diggs
Agree with you on that. The way I suggested is stop-gap, or, as I would put it, 'Jugaad'. Most def not the right way to go about it. However, if the OP needs only some functionalities, there is an outside chance that he gets what he needs. - JackStinger
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas r installation package or haz tu propia pregunta.
Download and unpack the source, change the "Depends" field in the "DESCRIPTION" file, then build/INSTALL the package... just don't come back and ask why something in the package doesn't work. - Joshua Ulrich
también puedes visitar el Archivo and potentially find some backward compatibility... but I'd mostly listen to Joshua's warning! - Justin
You could forcefully install 2.15 - Dason
@Dason I did that once a little too forcefully and broke my keyboard. - joran