[R] installing package from source

Marc Schwartz marc_schwartz at me.com
Thu Oct 24 20:34:14 CEST 2013


On Oct 24, 2013, at 1:11 PM, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:

> On 24/10/2013 18:25, Marc Schwartz wrote:
>> 
>> On Oct 24, 2013, at 11:38 AM, David Winsemius <dwinsemius at comcast.net> wrote:
>> 
>>> 
>>> On Oct 23, 2013, at 7:53 PM, Long Vo wrote:
>>> 
>>>> Hi R users,
>>>> Currently I want to fit a FIGARCH model to a dataset. The only package that
>>>> allow for it that I could find is fGarch. However it seems that the FIGARCH
>>>> model class fitting of this package has been moved to Oxmetrics. I tried to
>>>> install the old versions of it using 'tar.gz' files from CRAN archive
>>>> http://cran.r-project.org/src/contrib/Archive/fGarch/
>>>> <http://cran.r-project.org/src/contrib/Archive/fGarch/>   but not sure how
>>>> it works. I tried
>>>> 
>>>> install.packages("myfilepath\fGarch_260.71.tar.gz", repos = NULL,
>>>> type="source")
>>>> 
>>>> And received this error:
>>>> 
>>>> Warning: invalid package './I:_R filesGarch_260.71.tar.gz'
>>>> Error: ERROR: no packages specified
>>>> Warning messages:
>>>> 1: running command '"I:/01_RFI~1/INSTAL~1/R-30~1.1/bin/i386/R" CMD INSTALL
>>>> -l "I:\01_R files\installment\R-3.0.1\library" "./I:_R files
>>>> Garch_260.71.tar.gz"' had status 1
>>>> 2: In install.packages("I:\001_R files\fGarch_260.71.tar.gz", repos = NULL,
>>>> :
>>>> installation of package ‘./I:_R filesGarch_260.71.tar.gz’ had non-zero
>>>> exit status
>>>> 
>>>> Any helps on this?
>>>> 
>>> 
>>> I've aways specified the package names and their locations separately in my call to install.packages, but I don't know if that is always needed. It also appears that you have no "/" separator between your path and the file name.
>> 
>> 
>> Long is trying to install a rather old version of the source R package that contains FORTRAN code on Windows.
>> 
>> Besides the immediate error in the way the path was constructed in the install.packages() call, using a single backslash, which needs to be escaped:
>> 
>>   http://cran.r-project.org/bin/windows/base/rw-FAQ.html#R-can_0027t-find-my-file
>> 
>> there are likely to be issues from trying to install an old version of the package on a newer version of R, perhaps the lack of the requisite development tools for compiling FORTRAN:
>> 
>>   http://cran.r-project.org/bin/windows/base/rw-FAQ.html#Can-I-install-packages-into-libraries-in-this-version_003f
>> 
>> and other issues as well.
>> 
>> Depending upon how far back you need to go in package versions, there may be pre-compiled Windows binaries (.zip files) available in directories here:
>> 
>>   http://cran.r-project.org/bin/windows/contrib/
> 
> I don't think so: see NEWS
> 
> CHANGES IN R 3.0.0:
> 
>  SIGNIFICANT USER-VISIBLE CHANGES:
> 
>    • Packages need to be (re-)installed under this version (3.0.0) of
>      R.
> 
> so only those under bin/windows/contrib/3.0 will work, and there is only one for each package.
> 


Ah, OK. Thanks for noting that Prof. Ripley.

So, Long will need to make some decisions here and it may be worth contacting the fGARCH package maintainer to get any relevant insights into potential gotchas installing an older version of the package on a recent version of R, even from source after installing the needed tools, or having to revert to an older version of R to support the installation of the older package.

Older Windows binaries of R releases are available from:

  http://cran.r-project.org/bin/windows/base/old/

and R 2.6.1 would be about the release that corresponds to the particular version of fGARCH being used above, which is late 2007.

Regards,

Marc



More information about the R-help mailing list